Added setConnectionWeight method.