10 from __future__
import print_function
23 for x
in range(0, 3)])
27 [(ps[i[0]], ps[i[1]])
for i
in [(0, 1), (1, 2)]])
28 print([(p[0].get_name(), p[1].get_name())
for p
in lpc.get_particle_pairs()])
30 r.set_maximum_score(.1)
37 pst.set_particle_states(m.get_particle(p), space)
39 m.set_log_level(IMP.SILENT)
46 print(
"Unable to display graph using 'dot'")
50 ds.set_restraints([r])
51 ds.set_scoring_function([r])
53 ds.set_log_level(IMP.SILENT)
58 def get_assignments(vertex):
59 on = mt.get_out_neighbors(vertex)
62 ret = ds.get_vertex_assignments(vertex)
69 a0 = get_assignments(on[0])
70 a1 = get_assignments(on[1])
71 ret = ds.get_vertex_assignments(vertex, a0, a1)
72 print(mt.get_vertex_name(vertex), [str(r)
for r
in ret])
76 get_assignments(mt.get_vertices()[-1])
83 def schedule_job(vertex):
86 on = mt.get_out_neighbors(vertex)
89 max_child_time = max(schedule_job(n), max_child_time)
90 my_time = max_child_time + 1
91 while len(schedule) < my_time + 1:
94 schedule[my_time].append(vertex)
97 schedule_job(mt.get_vertices()[-1])
98 print(
"The merging can be scheduled as", schedule)
Strings setup_from_argv(const Strings &argv, std::string description, std::string positional_description, int num_positional)
Various classes to hold sets of particles.
Sample best solutions using Domino.
static XYZ setup_particle(Model *m, ParticleIndex pi)
Class for storing model, its restraints, constraints, and particles.
Store a list of ParticleIndexPairs.
ParticleIndexPairs get_indexes(const ParticlePairsTemp &ps)
General purpose algebraic and geometric methods that are expected to be used by a wide variety of IMP...
MergeTree get_merge_tree(const SubsetGraph &junction_tree)
Class to handle individual model particles.
std::string show_graphviz(Graph g)
Applies a PairScore to each Pair in a list.
Divide-and-conquer inferential optimization in discrete space.