1 Dependencies {#dependencies}
8 In order to properly evaluate an
IMP::Restraint, all of its input
IMP::Particle and
IMP::Container objects must first be updated (e.g., the non-bonded list contents must be correct and the coordinates of rigid body members must be correct). This requires processing the set of all dependencies amongst particles, containers, restraints and determing which need to be updated and in what order (so that
IMP::ScoreState objects are only asked to update things after their inputs are updated).
10 # Dependency graph # {#dependency_graph}
13 Given the graph, one can simply walk up from an IMP::
Restraint to determine the full set of input particles or input IMP::
ScoreState objects. A topological sort of the input IMP::
ScoreStates provides a safe ordering to call e.g. IMP::
ScoreState::before_evaluate() (since it means that all of the IMP::
ScoreState inputs are up to date).
15 When an IMP::
ScoringFunction is evaluated, it needs to determine all the IMP::
ScoreState objects needed by its IMP::
Restraints and an appropriate order to evaluate them in. It can then, in order, call IMP::
ScoreState::before_evaluate(), evaluate the restraints, and then call IMP::
ScoreState::after_evaluate().
17 # Caching dependencies # {#dependency_caching}
19 Since generating and traversing the dependency graph is reasonably expensive, the relationships encoded in it are cached in the
IMP::Model. Specifically, when dependencies are needed, the graph is generated and,
for each restraint, the ordered list of required (upstream) IMP::
ScoreState objects is computed. This is stored in the IMP::
Restraint. Subsequent evaluations of the restraint can simply used the cached data. These caches are cleared whenever
22 - the contents of a container like IMP::container::ListSingletonContainer is changed
IMP::kernel::ModelObject ModelObject
boost::graph DependencyGraph
A directed graph on the interactions between the various objects in the model.
IMP::kernel::ScoreState ScoreState
IMP::kernel::ScoringFunction ScoringFunction
IMP::base::Vector< IMP::base::Pointer< Restraint > > Restraints
Return all close unordered pairs of particles taken from the SingletonContainer.
ScoreStates maintain invariants in the Model.
DependencyGraph get_dependency_graph(kernel::Model *m)
IMP::base::Vector< IMP::base::Pointer< ScoreState > > ScoreStates
Abstract class for containers of particles.
Class to handle individual model particles.
IMP::kernel::DependencyGraph DependencyGraph
A decorator for a rigid body.
IMP::kernel::Restraint Restraint
A shared container for Singletons.
const algebra::Vector3D & get_internal_coordinates() const
Return the internal (local) coordinates of this member.
Class for storing model, its restraints, constraints, and particles.