IMP logo

IMP::core::TypedPairScore Class Reference


Detailed Description

Delegate to another PairScore depending on particle types.

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.

Inheritance diagram for IMP::core::TypedPairScore:

Inheritance graph
[legend]

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.

Constructor & Destructor Documentation

IMP::core::TypedPairScore::TypedPairScore ( IntKey  typekey,
bool  allow_invalid_types = true 
)

Constructor.

Parameters:
[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.


Member Function Documentation

void IMP::core::TypedPairScore::set_pair_score ( PairScore ps,
Int  atype,
Int  btype 
)

Set the PairScore to delegate to for a given pair of particle types.

Parameters:
[in] ps PairScore to use at evaluate time.
[in] atype First particle type.
[in] btype Second particle type.

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.


The documentation for this class was generated from the following files:

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