This restraint stores the used particles in a ParticlePairs. The container used can be set so that the list can be shared with other containers (or a nonbonded list can be used). By default a ListPairContainer is used and the {add_, set_, clear_}particle_pair{s} methodas can be used.
Examples using various multiplicity containers:
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)
import IMP import IMP.core import IMP.atom import IMP.container # This example addes a restraint on nonbonded interactions # after excluding a set of bonded interactions. m= IMP.Model() # The set of particles ps = IMP.container.ListSingletonContainer(IMP.core.create_xyzr_particles(m, 20, 1.0)) # create a bond between two particles bd0= IMP.atom.Bonded.setup_particle(ps.get_particle(0)) bd1= IMP.atom.Bonded.setup_particle(ps.get_particle(1)) IMP.atom.create_custom_bond(bd0, bd1, 2.0) # Set up the nonbonded list for all pairs at are touching # and let things move 3 before updating the list nbl= IMP.container.ClosePairContainer(ps, 0.0, 3.0) nbl.add_pair_filter(IMP.atom.BondedPairFilter()) # Set up excluded volume sdps= IMP.core.SphereDistancePairScore(IMP.core.HarmonicLowerBound(0,1)) evr= IMP.container.PairsRestraint(sdps, nbl) m.add_restraint(evr) # Set up optimizer o= IMP.core.ConjugateGradients() o.set_model(m) o.optimize(1000)
Public Member Functions | |
ContainersTemp | get_input_containers () const |
ParticlesTemp | get_input_particles () const |
ParticlesList | get_interacting_particles () const |
virtual bool | get_is_incremental () const |
PairContainer * | get_pair_container () |
Get the container used to store Particles. | |
PairScore * | get_pair_score () const |
virtual std::string | get_type_name () const |
virtual ::IMP::VersionInfo | get_version_info () const |
PairsRestraint (PairScore *ss, PairContainer *pc, std::string name="PairsRestraint %1%") | |
Create the restraint with a shared container. | |
virtual double | unprotected_evaluate (DerivativeAccumulator *accum) const |
virtual double | unprotected_incremental_evaluate (DerivativeAccumulator *accum) const |
Friends | |
template<class T > | |
void | IMP::internal::unref (T *) |
IMP::container::PairsRestraint::PairsRestraint | ( | PairScore * | ss, | |
PairContainer * | pc, | |||
std::string | name = "PairsRestraint %1%" | |||
) |