A particle is scored based on the distance between it and a constant point as passed to a UnaryFunction. This is useful for anchoring constraining particles within a sphere.
To restrain a set of particles store in SingletonContainer pc in a sphere do the following: import IMP.example radius=10 stiffness=2 center= IMP.algebra.Vector3D(1,2,3) (m,c)=IMP.example.create_model_and_particles() ub= IMP.core.HarmonicUpperBound(radius, stiffness) ss= IMP.core.DistanceToSingletonScore(ub, center) r= IMP.container.SingletonsRestraint(ss, c) m.add_restraint(r) m.evaluate(False)
Public Member Functions | |
DistanceToSingletonScore (UnaryFunction *f, const algebra::VectorD< 3 > &pt) | |
ContainersTemp | get_input_containers (Particle *) const |
ParticlesTemp | get_input_particles (Particle *p) const |
ParticlesList | get_interacting_particles (Particle *) const |
bool | get_is_changed (Particle *p) const |
IMP_SINGLETON_SCORE_BASE (DistanceToSingletonScore) |