Exemple #1
0
    def test_value(self):
        """Check score value of LennardJonesPairScore"""
        m, d0, d1, c = make_test_pair_score()

        box = IMP.algebra.Vector3D(10.0, 20.0, 30.0)
        for r0 in (2.0, 1.0):
            d0.set_radius(r0)
            for r1 in (2.0, 1.0):
                d1.set_radius(r1)
                rmin = r0 + r1
                for wd0 in (0.0, 1.0, 2.0):
                    d0.set_well_depth(wd0)
                    for wd1 in (0.0, 1.0, 2.0):
                        d1.set_well_depth(wd1)
                        wd = math.sqrt(wd0 * wd1)
                        for att in (0.0, 0.5, 1.0):
                            c.set_attractive_weight(att)
                            for rep in (0.0, 0.5, 1.0):
                                c.set_repulsive_weight(rep)
                                for r in (3.0, 4.0, 5.0):
                                    place_xyzs(d0, d1, box, r)
                                    score = m.evaluate(False)
                                    expected = wd * (rep * (rmin / r)**12 -
                                                     2.0 * att * (rmin / r)**6)
                                    self.assertAlmostEqual(score,
                                                           expected,
                                                           delta=1e-2)
    def test_value(self):
        """Check score value of LennardJonesPairScore"""
        m, d0, d1, c = make_test_pair_score()

        box = IMP.algebra.Vector3D(10.0, 20.0, 30.0)
        for r0 in (2.0, 1.0):
            d0.set_radius(r0)
            for r1 in (2.0, 1.0):
                d1.set_radius(r1)
                rmin = r0 + r1
                for wd0 in (0.0, 1.0, 2.0):
                    d0.set_well_depth(wd0)
                    for wd1 in (0.0, 1.0, 2.0):
                        d1.set_well_depth(wd1)
                        wd = math.sqrt(wd0 * wd1)
                        for att in (0.0, 0.5, 1.0):
                            c.set_attractive_weight(att)
                            for rep in (0.0, 0.5, 1.0):
                                c.set_repulsive_weight(rep)
                                for r in (3.0, 4.0, 5.0):
                                    place_xyzs(d0, d1, box, r)
                                    score = m.evaluate(False)
                                    expected = wd * (rep * (rmin/r)**12
                                                     - 2.0 * att * (rmin/r)**6)
                                    self.assertAlmostEqual(score, expected,
                                                           delta=1e-2)
Exemple #3
0
 def place_all(dist):
     place_xyzs(d0, d1, box, dist)
     smd0.set_coordinates(d0.get_coordinates())
     smd1.set_coordinates(d1.get_coordinates())
 def place_all(dist):
     place_xyzs(d0, d1, box, dist)
     smd0.set_coordinates(d0.get_coordinates())
     smd1.set_coordinates(d1.get_coordinates())