IMP Reference Guide
2.12.0
The Integrative Modeling Platform
|
Score the model efficiently when a small number of particles are changed. More...
#include <IMP/core/IncrementalScoringFunction.h>
Score the model efficiently when a small number of particles are changed.
This is a scoring function that computes the score efficiently when a small number of particles are changed.
To ensure proper evaluation, the ScoringFunction is divided into a number of sub scoring functions, one for each possibly moved particle.
Definition at line 39 of file IncrementalScoringFunction.h.
Public Member Functions | |
IncrementalScoringFunction (Model *m, const ParticleIndexes &to_move, const RestraintsTemp &rs, double weight=1.0, double max=NO_MAX, std::string name="IncrementalScoringFunction%1%") | |
Constructor. More... | |
void | add_close_pair_score (PairScore *ps, double distance, const ParticlesTemp &particles, const PairPredicates &filters) |
void | add_close_pair_score (PairScore *ps, double distance, const ParticlesTemp &particles) |
void | clear_close_pair_scores () |
virtual Restraints | create_restraints () const |
Return a set of restraints equivalent to this scoring function. More... | |
void | do_add_score_and_derivatives (IMP::ScoreAccumulator sa, const ScoreStatesTemp &ss) |
virtual ModelObjectsTemp | do_get_inputs () const |
ParticleIndexes | get_movable_indexes () const |
virtual std::string | get_type_name () const |
virtual ::IMP::VersionInfo | get_version_info () const |
Get information about the module and version of the object. More... | |
virtual void | handle_set_has_required_score_states (bool) |
void | reset_moved_particles () |
Undo the last moved particles. More... | |
void | set_moved_particles (const ParticleIndexes &p) |
Set which particles have moved since the last evaluate. More... | |
Public Member Functions inherited from IMP::ScoringFunction | |
ScoringFunction (Model *m, std::string name) | |
virtual ModelObjectsTemp | do_get_outputs () const |
double | evaluate (bool derivatives) |
Evaluate and return the score. More... | |
double | evaluate_if_below (bool derivatives, double max) |
double | evaluate_if_good (bool derivatives) |
bool | get_had_good_score () const |
double | get_last_score () const |
returns the score that was calculated in the last evaluate call More... | |
Public Member Functions inherited from IMP::ModelObject | |
ModelObject (Model *m, std::string name) | |
bool | get_has_dependencies () const |
Return whether this object has dependencies computed. More... | |
bool | get_has_required_score_states () const |
Return whether score states are computed. More... | |
ModelObjectsTemp | get_inputs () const |
ModelObjectsTemps | get_interactions () const |
Get the interacting sets induced by this ModelObject. More... | |
Model * | get_model () const |
ModelObjectsTemp | get_outputs () const |
const ScoreStatesTemp & | get_required_score_states () const |
Get the score states that are ancestors of this in the dependency graph. More... | |
void | set_has_dependencies (bool tf) |
Either invalidate the dependencies or ensure they are correct. More... | |
void | set_has_required_score_states (bool tf) |
Compute the required score states. More... | |
Public Member Functions inherited from IMP::Object | |
virtual void | clear_caches () |
CheckLevel | get_check_level () const |
LogLevel | get_log_level () const |
void | set_check_level (CheckLevel l) |
void | set_log_level (LogLevel l) |
Set the logging level used in this object. More... | |
void | set_was_used (bool tf) const |
void | show (std::ostream &out=std::cout) const |
const std::string & | get_name () const |
void | set_name (std::string name) |
Additional Inherited Members | |
Public Types inherited from IMP::ScoringFunction | |
typedef std::pair< double, bool > | ScoreIsGoodPair |
Protected Member Functions inherited from IMP::ScoringFunction | |
ScoreAccumulator | get_score_accumulator (bool deriv) |
ScoreAccumulator | get_score_accumulator_if_below (bool deriv, double max) |
ScoreAccumulator | get_score_accumulator_if_good (bool deriv) |
Protected Member Functions inherited from IMP::ModelObject | |
virtual ModelObjectsTemps | do_get_interactions () const |
Protected Member Functions inherited from IMP::Object | |
Object (std::string name) | |
Construct an object with the given name. More... | |
virtual void | do_destroy () |
IMP::core::IncrementalScoringFunction::IncrementalScoringFunction | ( | Model * | m, |
const ParticleIndexes & | to_move, | ||
const RestraintsTemp & | rs, | ||
double | weight = 1.0 , |
||
double | max = NO_MAX , |
||
std::string | name = "IncrementalScoringFunction%1%" |
||
) |
Constructor.
Pass the particles that will be individually moved, and the list of restraints to evaluate on them.
m | Model object containing all particles to be moved |
to_move | particles to be moved; must contain at least one particle |
rs | restraints (can be empty in principle, in which case the score is 0) |
weight | the weight used to scale the restraints |
max | maximum value for evaluate_if_good or evaluate_if_below; can be ignored for most purposes |
name | The name template to use for the scoring function. |
void IMP::core::IncrementalScoringFunction::add_close_pair_score | ( | PairScore * | ps, |
double | distance, | ||
const ParticlesTemp & | particles, | ||
const PairPredicates & | filters | ||
) |
Close pairs scores can be handled separately for efficiency, to do that, add a pair score here to act on the list of particles.
|
virtual |
Return a set of restraints equivalent to this scoring function.
Implements IMP::ScoringFunction.
|
virtual |
Do the actual work of computing the score and (optional) derivatives. The list of all score states that must be updated is passed.
Implements IMP::ScoringFunction.
|
virtual |
Get any Particle, Container or other ModelObjects read by this during evaluation. If you read everything in a container, you can just return that container.
Implements IMP::ModelObject.
|
virtual |
Get information about the module and version of the object.
Reimplemented from IMP::Object.
Definition at line 121 of file IncrementalScoringFunction.h.
|
virtual |
Called when set_has_required_score_states() is called.
Reimplemented from IMP::ModelObject.
void IMP::core::IncrementalScoringFunction::reset_moved_particles | ( | ) |
Undo the last moved particles.
This is similar in effect to, but perhaps more efficient than, calling set_moved_particles() a second time with the same list.
void IMP::core::IncrementalScoringFunction::set_moved_particles | ( | const ParticleIndexes & | p | ) |
Set which particles have moved since the last evaluate.