IMP Reference Guide
2.6.0
The Integrative Modeling Platform
|
Class for adding up scores during ScoringFunction evaluation. More...
#include <IMP/ScoreAccumulator.h>
Class for adding up scores during ScoringFunction evaluation.
This provides a place to accumulate scores from Restraint evaluation. A new ScoreAccumulator is created for each Restraint evaluation context (eg each Restraint::add_score_and_derivatives() call). As a result, the ScoreAccumulator can automatically handle restraint and derivative weights, keeping track of maximum scores and other needed bookkeeping.
Definition at line 46 of file ScoreAccumulator.h.
Public Member Functions | |
ScoreAccumulator () | |
ScoreAccumulator (ScoreAccumulator o, const Restraint *r) | |
ScoreAccumulator (ScoreAccumulator o, double weight, double local_max) | |
void | add_score (double score) |
bool | get_abort_evaluation () const |
Return if the score already exceeds the maximum. More... | |
DerivativeAccumulator * | get_derivative_accumulator () |
bool | get_is_evaluate_if_below () const |
bool | get_is_evaluate_if_good () const |
double | get_maximum () const |
void | show (std::ostream &out=std::cout) const |
IMP::ScoreAccumulator::ScoreAccumulator | ( | ) |
For swig, makes invalid (not null) state.
Definition at line 67 of file ScoreAccumulator.h.
IMP::ScoreAccumulator::ScoreAccumulator | ( | ScoreAccumulator | o, |
const Restraint * | r | ||
) |
Compose outer accumulator with one for this restraint.
IMP::ScoreAccumulator::ScoreAccumulator | ( | ScoreAccumulator | o, |
double | weight, | ||
double | local_max | ||
) |
Compose outer accumulator with one for this restraint.
Definition at line 72 of file ScoreAccumulator.h.
void IMP::ScoreAccumulator::add_score | ( | double | score | ) |
Add to the total score. It will be weighted appropriately internally.
Definition at line 80 of file ScoreAccumulator.h.
bool IMP::ScoreAccumulator::get_abort_evaluation | ( | ) | const |
Return if the score already exceeds the maximum.
Expensive restraints can check this during evaluation to determine if another restraint has aborted evaluation.
Definition at line 95 of file ScoreAccumulator.h.
bool IMP::ScoreAccumulator::get_is_evaluate_if_below | ( | ) | const |
Return true if the current evaluation being done is one where scores are only considered if they are below some threshold (get_maximum()).
Definition at line 113 of file ScoreAccumulator.h.
bool IMP::ScoreAccumulator::get_is_evaluate_if_good | ( | ) | const |
Return true if the current evaluation should abort if any restraint is above its maximum allowed good score. Restraints that take advantage of this in evaluation should simply consult get_maximum() as that will take into account both their maximum and that on any RestraintSets that contain them and are being evaluated.
Definition at line 121 of file ScoreAccumulator.h.
double IMP::ScoreAccumulator::get_maximum | ( | ) | const |
The maximum allowed score for the Restraint::do_add_score_and_derivatives() call.
Definition at line 124 of file ScoreAccumulator.h.