IMP logo
Public Member Functions | Static Public Member Functions
IMP::Model Class Reference

Detailed Description

Class for storing model, its restraints, constraints, and particles.

The Model maintains a standard IMP container for each of Particle, ScoreState and Restraint object types.

Each Float attribute has an associated range which reflects the range of values that it is expected to take on during optimization. The optimizer can use these ranges to make the optimization process more efficient. By default, the range estimates are simply the range of values for that attribute in the various particles, but it can be set to another value. For example, an attribute storing an angle could have the range set to (0,PI).

The ranges are not enforced; they are just guidelines. In order to enforce ranges, see, for example, IMP::example::ExampleSingletonModifier.

+ Inheritance diagram for IMP::Model:

List of all members.

Public Member Functions

 Model (std::string name="Model %1%")
void clear_particle_caches (ParticleIndex pi)
ScoringFunctioncreate_model_scoring_function ()
ModelObjectsTemp get_model_objects () const
void remove_particle (Particle *p)
void update ()
 Sometimes it is useful to be able to make sure the model is up to date.
- Public Member Functions inherited from IMP::RestraintSet
 RestraintSet (Model *m, double weight, const std::string &name="RestraintSet %1%")
 Create an empty set that is registered with the model.
ContainersTemp get_input_containers () const
ParticlesTemp get_input_particles () const
std::pair< RestraintsTemp,
RestraintSetsTemp > 
get_non_sets_and_sets () const
double unprotected_evaluate (DerivativeAccumulator *accum) const
double unprotected_evaluate_if_below (DerivativeAccumulator *accum, double max) const
double unprotected_evaluate_if_good (DerivativeAccumulator *accum, double max) const
void remove_restraint (Restraint *d)
template<class F >
void remove_restraints_if (const F &f)
template<class List >
void remove_restraints (List d)
template<class List >
void set_restraints (List ps)
template<class List >
void set_restraints_order (List ps)
unsigned int add_restraint (Restraint *obj)
template<class List >
void add_restraints (List objs)
void clear_restraints ()
unsigned int get_number_of_restraints () const
bool get_has_restraints () const
Restraintget_restraint (unsigned int i) const
Restraints get_restraints () const
void reserve_restraints (unsigned int sz)
RestraintIterator restraints_begin ()
RestraintIterator restraints_end ()
RestraintConstIterator restraints_begin () const
RestraintConstIterator restraints_end () const
- Public Member Functions inherited from IMP::Restraint
 Restraint (Model *m, std::string name)
Restraintcreate_current_decomposition () const
 Decompose this restraint into constituent terms for the current conf.
Restraintcreate_decomposition () const
 Decompose this restraint into constituent terms.
double evaluate (bool calc_derivs) const
 Return the score for this restraint for the current state of the model.
double evaluate_if_below (bool calc_derivatives, double max) const
 See Model::evaluate_with_maximum()
double evaluate_if_good (bool calc_derivatives) const
 See Model::evaluate_if_good()
double get_last_score () const
bool get_was_good () const
void set_weight (Float weight)
Float get_weight () const
double get_maximum_score () const
void set_maximum_score (double s)
- Public Member Functions inherited from IMP::ModelObject
 ModelObject (Model *m, std::string name)
ModelObjectsTemp get_inputs () const
Modelget_model () const
ModelObjectsTemp get_outputs () const
- Public Member Functions inherited from IMP::base::Object
std::size_t __hash__ () const
virtual std::string get_type_name () const =0
 Return a string identifying the type of the object.
virtual IMP::base::VersionInfo get_version_info () const =0
 Get information about the module and version of the object.
void set_check_level (CheckLevel l)
void set_log_level (LogLevel l)
 Set the logging level used in this object.
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)

Static Public Member Functions

static Modelget_from (IMP::base::Object *o)

States

The Model stores a list of ScoreStates which are given an opportunity to update the stored Particles and their internal state before and after the restraints are evaluated. Use the methods below to manipulate the list of ScoreState objects.

The value type for the iterators is a ScoreState*.

Note:
The order of addition of ScoreState objects does not matter.
Familiarity with these methods is not required to use imp.
void remove_score_state (ScoreState *d)
template<class F >
void remove_score_states_if (const F &f)
template<class List >
void remove_score_states (List d)
template<class List >
void set_score_states (List ps)
template<class List >
void set_score_states_order (List ps)
unsigned int add_score_state (ScoreState *obj)
template<class List >
void add_score_states (List objs)
void clear_score_states ()
unsigned int get_number_of_score_states () const
bool get_has_score_states () const
ScoreStateget_score_state (unsigned int i) const
ScoreStates get_score_states () const
void reserve_score_states (unsigned int sz)
ScoreStateIterator score_states_begin ()
ScoreStateIterator score_states_end ()
ScoreStateConstIterator score_states_begin () const
ScoreStateConstIterator score_states_end () const

Restraints

The Model scores the current configuration using the stored Restraint objects. Use the methods below to manipulate the list.

The value type for the iterators is a Restraint*.

RestraintSetget_root_restraint_set ()

Statistics

The Model can gather various statistics about the restraints and score states used. To use this feature, first turn on statistics gather and then run your optimization (or just call evaluate).

Note:
Telling the model not to gather statistics does not clear existing statistics.
void clear_all_statistics ()
void set_gather_statistics (bool tf)
bool get_gather_statistics () const
void show_all_statistics (std::ostream &out=std::cout) const
void show_restraint_time_statistics (std::ostream &out=std::cout) const
void show_restraint_score_statistics (std::ostream &out=std::cout) const
RestraintStatistics get_restraint_statistics (Restraint *r) const
void show_score_state_time_statistics (std::ostream &out=std::cout) const

Model Data

Arbitrary non-particle data can be associated with the Model. This can be used for Model-level caches and such.

void add_data (ModelKey mk, base::Object *o)
base::Objectget_data (ModelKey mk) const
void remove_data (ModelKey mk)
bool get_has_data (ModelKey mk) const

Methods to debug particles

It is sometimes useful to inspect the list of all particles when debugging. These methods allow you to do that.

Note:
Only use this if you really know what you are doing as Particles can be added to the object from many different places.

The value type for the iterators is a Particle*.

unsigned int get_number_of_particles () const
ParticlesTemp get_particles () const
Particleget_particle (ParticleIndex p) const
ParticleIterator particles_begin () const
ParticleIterator particles_end () const

Additional Inherited Members


Constructor & Destructor Documentation

IMP::Model::Model ( std::string  name = "Model %1%")

Construct an empty model


Member Function Documentation

ScoringFunction* IMP::Model::create_model_scoring_function ( )

Create a scoring function from the model restraints.

ModelObjectsTemp IMP::Model::get_model_objects ( ) const

Get all the ModelObjects associated with this Model.

void IMP::Model::remove_particle ( Particle p)

Remove a particle from the Model. The particle will then be inactive and cannot be used for anything and all data stored in the particle is lost.

void IMP::Model::update ( )

Sometimes it is useful to be able to make sure the model is up to date.

This method updates all the state but does not necessarily compute the score. Use this to make sure that your containers and rigid bodies are up to date.


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

Generated on Tue May 22 2012 23:33:23 for IMP by doxygen 1.8.1