We are interested in applying domino to problems systematically in a multiscale manner. This script experiments with those approaches.
9 m.set_log_level(IMP.base.SILENT)
12 for i, d
in enumerate(ds):
28 for pr
in [(0, 1), (1, 2), (0, 2)]:
30 (ds[pr[0]], ds[pr[1]]),
45 def setup(cover, scale):
49 pst.set_particle_states(p, st)
51 r.set_maximum_score(.5 * scale ** 2)
58 sampler.set_subset_filter_tables(fs)
59 sampler.set_log_level(IMP.base.SILENT)
60 return (sampler, lf, pst)
62 (sampler, lf, pst) = setup(covers[0], 4.0)
65 ac = sampler.get_sample_assignments(subset)
70 def get_mapping(cover0, cover1):
71 nn = IMP.algebra.NearestNeighbor3D(cover0)
72 ret = [[]
for c
in cover0]
73 for i, p
in enumerate(cover1):
74 nns = nn.get_nearest_neighbor(p)
81 def display_mapping(index, cover0, cover1, mapping):
83 for i, c
in enumerate(mapping):
89 for i, c
in enumerate(cover0):
96 for curi
in range(1, len(covers)):
97 scale = 4.0 / 2 ** curi
99 mapping = get_mapping(covers[curi - 1], covers[curi])
101 display_mapping(curi - 1, covers[curi - 1], covers[curi], mapping)
102 (sampler, lf, pst) = setup(covers[curi], scale)
106 for i, p
in enumerate(subset):
109 lf.set_allowed_states(p, allowed)
110 ccac = sampler.get_sample_assignments(subset)
114 print(
"for scale", scale,
"got", ac)
116 for i, a
in enumerate(ac):
122 for c
in covers[curi]: