This example shows how to set up an optimization involving several particles constrained to be connected in a loop. It uses non bonded lists and a variety of restraints.
6 from __future__
import print_function
23 m.set_log_level(IMP.SILENT)
39 chainr.set_name(
"The chain restraint")
40 restraints.append(chainr)
45 nbl.add_pair_filter(bpc)
52 (ps[0].get_particle_index(),
53 ps[-1].get_particle_index()))
54 tie.set_name(
"tie ends")
55 restraints.append(tie)
60 r.set_maximum_score(.1)
61 s.set_scoring_function(restraints)
62 s.set_number_of_attempts(10)
64 confs = s.create_sample()
65 print(
"Found", confs.get_number_of_configurations(),
"configurations")
66 fh = RMF.create_rmf_file(
"solutions.rmfz")
68 for i
in range(0, confs.get_number_of_configurations()):
69 confs.load_configuration(i)