5 from __future__
import print_function
16 IMP.kernel.Restraint.__init__(self, m,
"MyRestraint %1%")
20 def unprotected_evaluate(self, da):
22 for i
in range(1, len(self.ps)):
25 if p0.get_value(k) > p1.get_value(k):
26 diff = (p0.get_value(k) - p1.get_value(k))
28 p0.add_to_derivative(k, -1, da)
29 p1.add_to_derivative(k, 1, da)
31 if IMP.get_log_level() >= IMP.base.TERSE:
32 print(p0.get_name(),
"and", p1.get_name(),
" are ok")
35 def do_get_inputs(self):
42 for i
in range(0, 10):
46 r = MyRestraint(m, ps, k)
48 print(r.evaluate(
True))
A restraint is a term in an IMP ScoringFunction.
Class to handle individual model particles.
Class for storing model, its restraints, constraints, and particles.