Each particle is given an integer type, which is used at evaluate time to select a PairScore to use for a given pair of particles. (The ordering of the particles does not matter.) After creating the object, call set_pair_score() to tell it the PairScore objects you want to use for each pair of particle types.
Public Member Functions | |
ContainersTemp | get_input_containers (const ParticlePair &p) const |
ParticlesTemp | get_input_particles (const ParticlePair &p) const |
ParticlesList | get_interacting_particles (const ParticlePair &p) const |
bool | get_is_changed (const ParticlePair &pp) const |
IMP_PAIR_SCORE_BASE (TypedPairScore) | |
void | set_pair_score (PairScore *ps, Int atype, Int btype) |
Set the PairScore to delegate to for a given pair of particle types. | |
virtual void | set_particle_type (Particle *p) const |
Set the particle's type. | |
TypedPairScore (IntKey typekey, bool allow_invalid_types=true) | |
Constructor. |
IMP::core::TypedPairScore::TypedPairScore | ( | IntKey | typekey, | |
bool | allow_invalid_types = true | |||
) |
Constructor.
[in] | typekey | The IntKey used to denote the type of each particle. |
[in] | allow_invalid_types | Desired behavior for particle pairs that have types not covered by set_pair_score(). If true, the score returned for these pairs is zero. If false, evaluate() raises a ValueException. |
virtual void IMP::core::TypedPairScore::set_particle_type | ( | Particle * | p | ) | const [virtual] |
Set the particle's type.
At evaluate time, if a given particle does not have the typekey attribute, this method is called. Here it does nothing, but it could be overridden in a subclass to automatically set the type of a particle, e.g. from other particle attributes such as an atom or residue name.