18 def create_scoring(m, ps):
19 pairs = [[0, 1], [0, 2], [1, 3], [2, 3], [3, 4], [4, 5], [1, 5]]
25 [(ps[p[0]], ps[p[1]])
for p
in pairs],
28 pr.set_maximum_score(.01)
35 dr.set_maximum_score(.01)
39 def create_representation(m):
43 p = m.add_particle(
"P%d" % i)
49 def create_discrete_states(m, ps):
56 vs = vs + [-v
for v
in vs]
57 print(len(vs),
"states for each particle")
62 pst.set_particle_states(m.get_particle(p), states)
66 def create_sampler(m, r, pst):
84 states.set_log_level(IMP.SILENT)
85 s.set_assignments_table(states)
86 s.set_subset_filter_tables(filters)
94 m.set_log_level(IMP.SILENT)
96 print(
"creating representation")
97 ps = create_representation(m)
98 print(
"creating discrete states")
99 pst = create_discrete_states(m, ps)
100 print(
"creating score function")
101 rs = create_scoring(m, ps)
102 print(
"creating sampler")
103 s = create_sampler(m, rs, pst)
110 cs = s.create_sample()
112 print(
"found ", cs.get_number_of_configurations(),
"solutions")
114 for i
in range(cs.get_number_of_configurations()):
115 cs.load_configuration(i)
116 print(
"solution number:", i,
" is:", sf.evaluate(
False))
Strings setup_from_argv(const Strings &argv, std::string description, std::string positional_description, int num_positional)
Various classes to hold sets of particles.
Upper bound harmonic function (non-zero when feature > mean)
Sample best solutions using Domino.
Filter a configuration of the subset using the Model thresholds.
Create a scoring function on a list of restraints.
Score distance between two particle centers using a harmonic function.
static XYZ setup_particle(Model *m, ParticleIndex pi)
Class for storing model, its restraints, constraints, and particles.
Do not allow two particles to be in the same state.
Store a list of ParticleIndexPairs.
Apply a function to the distance to a fixed point.
A decorator for a particle with x,y,z coordinates.
void set_log_level(LogLevel l)
Set the current global log level.
Basic functionality that is expected to be used by a wide variety of IMP users.
Applies a SingletonScore to a Singleton.
Applies a PairScore to each Pair in a list.
Divide-and-conquer inferential optimization in discrete space.