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)
29 def create_representation(m):
38 def create_discrete_states(ps):
45 vs = vs + [-v
for v
in vs]
46 print len(vs),
"states for each particle"
51 pst.set_particle_states(p, states)
61 def __init__(self, pos, value):
63 IMP.domino.SubsetFilter.__init__(
64 self,
"MF" + str(pos) +
" " + str(value))
68 def get_next_state(self, pos, s):
72 if s[self.pos] > self.value:
78 def get_is_ok(self, state):
80 ret = state[self.pos] == self.value
83 def get_strength(self, s, excluded):
87 def __init__(self, p, s):
89 IMP.domino.SubsetFilterTable.__init__(
90 self,
"MFT" + p.get_name() +
" at " + str(s))
94 def get_subset_filter(self, subset, excluded):
96 if self.p
in subset
and self.p
not in sum([list(x)
for x
in excluded], []):
98 return self.MyFilter(list(subset).index(self.p), self.s)
103 def create_sampler(m, ps, rs, pst):
112 rc.add_restraints(rs)
116 mf = MyFilterTable(ps[1], 0)
121 s.set_assignments_table(states)
122 s.set_subset_filter_tables(filters)
127 m.set_log_level(IMP.base.SILENT)
129 print "creating representation"
130 ps = create_representation(m)
131 print "creating discrete states"
132 pst = create_discrete_states(ps)
133 print "creating score function"
134 rs = create_scoring(m, ps)
136 print "creating sampler"
137 s = create_sampler(m, ps, rs, pst)
143 print "found ", cs.get_number_of_configurations(),
"solutions"
144 for i
in range(cs.get_number_of_configurations()):
145 cs.load_configuration(i)
146 print "solution number:", i,
" is:", m.evaluate(
False)
See IMP.container for more information.
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 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.
See IMP.core for more information.
Applies a PairScore to each Pair in a list.
See IMP.domino for more information.
Class for storing model, its restraints, constraints, and particles.