IMP  2.0.1
The Integrative Modeling Platform
IMP::kernel::ScoreAccumulator Class Reference

Class for adding up scores during ScoringFunction evaluation. More...

#include <IMP/kernel/ScoreAccumulator.h>

+ Inheritance diagram for IMP::kernel::ScoreAccumulator:

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...
 
DerivativeAccumulatorget_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
 

Detailed Description

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 kernel/ScoreAccumulator.h.

Constructor & Destructor Documentation

IMP::kernel::ScoreAccumulator::ScoreAccumulator ( )

For swig, makes invalid (not null) state.

Definition at line 67 of file kernel/ScoreAccumulator.h.

IMP::kernel::ScoreAccumulator::ScoreAccumulator ( ScoreAccumulator  o,
const Restraint r 
)

Compose outer accumulator with one for this restraint.

IMP::kernel::ScoreAccumulator::ScoreAccumulator ( ScoreAccumulator  o,
double  weight,
double  local_max 
)

Compose outer accumulator with one for this restraint.

Definition at line 73 of file kernel/ScoreAccumulator.h.

Member Function Documentation

void IMP::kernel::ScoreAccumulator::add_score ( double  score)

Add to the total score. It will be weighted appropriately internally.

Definition at line 82 of file kernel/ScoreAccumulator.h.

bool IMP::kernel::ScoreAccumulator::get_abort_evaluation ( ) const

Expensive restraints can check this during evaluation to determin if another restraint has aborted evaluation.

Definition at line 97 of file kernel/ScoreAccumulator.h.

bool IMP::kernel::ScoreAccumulator::get_is_evaluate_if_below ( ) const

Return true if the current evaluation being done is one where scores are only consider if they are below some threshold (get_maximum()).

Definition at line 115 of file kernel/ScoreAccumulator.h.

bool IMP::kernel::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 123 of file kernel/ScoreAccumulator.h.

double IMP::kernel::ScoreAccumulator::get_maximum ( ) const

The maximum allowed score for the Restraint::do_add_score_and_derivatives() call.

Definition at line 126 of file kernel/ScoreAccumulator.h.


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