13 def __init__(self, rs):
14 IMP.OptimizerState.__init__(self, rs[0].get_model(),
15 "MyOptimizerState%1%")
20 print r.get_name(), r.get_last_score()
26 r0 = IMP.kernel._ConstRestraint(m, [], 1)
27 r0.set_name(
"restraint 0")
29 r1 = IMP.kernel._ConstRestraint(m, [], 2)
30 r1.set_name(
"restraint 1")
33 sf = rs.create_scoring_function()
35 os = MyOptimizerState([r0, r1])
36 os.set_name(
"python optimizer state")
38 co = IMP.kernel._ConstOptimizer(m)
39 co.set_scoring_function(sf)
40 co.add_optimizer_state(os)
41 print co.optimize(100)
44 co.remove_optimizer_state(os)
Shared optimizer state that is invoked upon commitment of new coordinates.
Object used to hold a set of restraints.
Class for storing model, its restraints, constraints, and particles.