19 def __init__(self, m, ps, k):
20 super().__init__(m,
"MyRestraint %1%")
24 def unprotected_evaluate(self, da):
26 for i
in range(1, len(self.ps)):
29 if p0.get_value(k) > p1.get_value(k):
30 diff = (p0.get_value(k) - p1.get_value(k))
32 p0.add_to_derivative(k, -1, da)
33 p1.add_to_derivative(k, 1, da)
36 print(p0.get_name(),
"and", p1.get_name(),
" are ok")
39 def do_get_inputs(self):
51r = MyRestraint(m, ps, k)
53print(r.evaluate(
True))
Class for storing model, its restraints, constraints, and particles.
Class to handle individual particles of a Model object.
A restraint is a term in an IMP ScoringFunction.
void setup_from_argv(int argc, char **argv, std::string description)
Parse the command line flags and return the positional arguments.
LogLevel get_log_level()
Get the currently active global log level.