IMP logo

IMP.example examples

range_restriction.py

This example shows how to use the example singleton modifier to constrain the coordinates of a set of particles to remain within a box.

import IMP.example
import IMP.core
import IMP.container

bb= IMP.algebra.BoundingBox3D(IMP.algebra.Vector3D(0,0,0),
                              IMP.algebra.Vector3D(10,10,10))

m= IMP.Model()
ps= IMP.core.create_xyzr_particles(m, 20, 1)
sc= IMP.container.ListSingletonContainer(ps)
ss= IMP.container.SingletonsConstraint(sc, IMP.example.ExampleSingletonModifier(bb), None)
m.add_score_state(ss)

# now optimize and things

Generated on Mon Mar 8 23:08:33 2010 for IMP by doxygen 1.5.8