15 def create_scoring(m, ps):
16 pairs = [[0, 1], [0, 2], [1, 3], [2, 3], [3, 4], [4, 5], [1, 5]]
22 pr.set_maximum_score(.01)
28 def create_representation(m):
37 def create_discrete_states(ps):
44 vs = vs + [-v
for v
in vs]
45 print(len(vs),
"states for each particle")
50 pst.set_particle_states(p, states)
60 def __init__(self, pos, value):
62 IMP.domino.SubsetFilter.__init__(
63 self,
"MF" + str(pos) +
" " + str(value))
67 def get_next_state(self, pos, s):
71 if s[self.pos] > self.value:
77 def get_is_ok(self, state):
79 ret = state[self.pos] == self.value
82 def get_strength(self, s, excluded):
86 def __init__(self, p, s):
88 IMP.domino.SubsetFilterTable.__init__(
89 self,
"MFT" + p.get_name() +
" at " + str(s))
93 def get_subset_filter(self, subset, excluded):
95 if self.p
in subset
and self.p
not in sum([list(x)
for x
in excluded], []):
97 return self.MyFilter(list(subset).index(self.p), self.s)
102 def create_sampler(m, ps, rs, pst):
111 rc.add_restraints(rs)
115 mf = MyFilterTable(ps[1], 0)
120 s.set_assignments_table(states)
121 s.set_subset_filter_tables(filters)
126 m.set_log_level(IMP.base.SILENT)
128 print(
"creating representation")
129 ps = create_representation(m)
130 print(
"creating discrete states")
131 pst = create_discrete_states(ps)
132 print(
"creating score function")
133 rs = create_scoring(m, ps)
135 print(
"creating sampler")
136 s = create_sampler(m, ps, rs, pst)
140 cs = s.create_sample()
142 print(
"found ", cs.get_number_of_configurations(),
"solutions")
143 for i
in range(cs.get_number_of_configurations()):
144 cs.load_configuration(i)
145 print(
"solution number:", i,
" is:", m.evaluate(
False))
Various classes to hold sets of particles.
Upper bound harmonic function (non-zero when feature > mean)
void set_log_level(LogLevel l)
Set the current global log level.
Sample best solutions using Domino.
static XYZ setup_particle(kernel::Model *m, ParticleIndex pi)
Filter a configuration of the subset using the kernel::Model thresholds.
Do not allow two particles to be in the same state.
Store a kernel::ParticleIndexPairs.
Apply a function to the distance to a fixed point.
A decorator for a particle with x,y,z coordinates.
Class to handle individual model particles.
Basic functionality that is expected to be used by a wide variety of IMP users.
Applies a PairScore to each Pair in a list.
Divide-and-conquer inferential optimization in discrete space.
Class for storing model, its restraints, constraints, and particles.