13 "An optimizer state which prints out the last scores of some restraints"
16 IMP.OptimizerState.__init__(self, rs[0].get_model(),
17 "MyOptimizerState%1%")
22 print(r.get_name(), r.get_last_score())
29 r0 = IMP._ConstRestraint(m, [], 1)
30 r0.set_name(
"restraint 0")
32 r1 = IMP._ConstRestraint(m, [], 2)
33 r1.set_name(
"restraint 1")
36 sf = rs.create_scoring_function()
38 os = MyOptimizerState([r0, r1])
39 os.set_name(
"Python optimizer state")
41 co = IMP._ConstOptimizer(m)
42 co.set_scoring_function(sf)
43 co.add_optimizer_state(os)
44 print(co.optimize(100))
47 co.remove_optimizer_state(os)
Strings setup_from_argv(const Strings &argv, std::string description, std::string positional_description, int num_positional)
Object used to hold a set of restraints.
Class for storing model, its restraints, constraints, and particles.
Shared optimizer state that is invoked upon commitment of new coordinates.