19 m.set_log_level(IMP.base.SILENT)
22 for i, d
in enumerate(ds):
40 for pr
in [(0, 1), (1, 2), (0, 2)]:
42 (ds[pr[0]], ds[pr[1]]),
58 def setup(cover, scale):
62 pst.set_particle_states(p, st)
64 r.set_maximum_score(.5 * scale ** 2)
71 sampler.set_subset_filter_tables(fs)
72 sampler.set_log_level(IMP.base.SILENT)
73 return (sampler, lf, pst)
75 (sampler, lf, pst) = setup(covers[0], 4.0)
78 ac = sampler.get_sample_assignments(subset)
83 def get_mapping(cover0, cover1):
84 nn = IMP.algebra.NearestNeighbor3D(cover0)
85 ret = [[]
for c
in cover0]
86 for i, p
in enumerate(cover1):
87 nns = nn.get_nearest_neighbor(p)
94 def display_mapping(index, cover0, cover1, mapping):
96 for i, c
in enumerate(mapping):
102 for i, c
in enumerate(cover0):
109 for curi
in range(1, len(covers)):
110 scale = 4.0 / 2 ** curi
112 mapping = get_mapping(covers[curi - 1], covers[curi])
114 display_mapping(curi - 1, covers[curi - 1], covers[curi], mapping)
115 (sampler, lf, pst) = setup(covers[curi], scale)
119 for i, p
in enumerate(subset):
122 lf.set_allowed_states(p, allowed)
123 ccac = sampler.get_sample_assignments(subset)
127 print "for scale", scale,
"got", ac
129 for i, a
in enumerate(ac):
135 for c
in covers[curi]:
Maintain an explicit list of what states each particle is allowed to have.
Sample best solutions using Domino.
A harmonic score on the distance between two spheres.
Filter a configuration of the subset using the kernel::Model thresholds.
Represent a subset of the particles being optimized.
static XYZR setup_particle(kernel::Model *m, ParticleIndex pi)
static Colored setup_particle(kernel::Model *m, ParticleIndex pi, Color color)
Color get_display_color(unsigned int i)
Apply a function to the distance to a fixed point.
Class to handle individual model particles.
An axis-aligned bounding box.
base::Vector< VectorD< D > > get_grid_interior_cover_by_spacing(const BoundingBoxD< D > &bb, double s)
See IMP.core for more information.
Write a CGO file with the geometry.
Applies a PairScore to a Pair.
static const FloatKeys & get_xyz_keys()
Get a vector containing the keys for x,y,z.
void load_particle_states(const Subset &s, const Assignment &ss, const ParticleStatesTable *pst)
Applies a SingletonScore to a Singleton.
Apply a function to an attribute.
See IMP.domino for more information.
Class for storing model, its restraints, constraints, and particles.
Display an IMP::core::XYZR particle as a ball.
Harmonic function (symmetric about the mean)