Ejemplo n.º 1
0
 def setUp(self):
     # create some DontLeaveBasin objects with different energy
     # criteria
     self.dlb_e_plus2 = dlb.DontLeaveBasin(Ecriterion=100.0)
     self.dlb_e_0 = dlb.DontLeaveBasin(Ecriterion=1.0)
     self.dlb_e_4 = dlb.DontLeaveBasin(Ecriterion=1.0e-4)
     self.dlb_e_6 = dlb.DontLeaveBasin(Ecriterion=1.0e-6)
     self.dlb_default = dlb.DontLeaveBasin()
Ejemplo n.º 2
0
 def test_rejectZeroCriterion(self):
     # test that with an energy criterion of zero, all changes in energy
     # are rejected
     # Create a DontLeaveBasin object with Ecriterion = 0
     dlb_zero = dlb.DontLeaveBasin(Ecriterion=0.0)
     (Eold, Enew) = (random.random(), random.random())
     self.assertTrue(not dlb_zero.acceptReject(Eold, Enew))