IMP logo
IMP Reference Guide  develop.7482b7c7af, 2026/12/05
The Integrative Modeling Platform
IMP::npctransport::Statistics Class Reference

Statistics and order parameters about the simulations. More...

#include <IMP/npctransport/Statistics.h>

Inheritance diagram for IMP::npctransport::Statistics:

Detailed Description

Statistics and order parameters about the simulations.

Definition at line 63 of file Statistics.h.

Public Member Functions

 Statistics (SimulationData *sd, unsigned int statistics_interval_frames, std::string output_file_name)
void add_fg_chain_stats (FGChain *fg_chain)
 add statistics about an FG chain
void add_floater_stats (IMP::Particle *p)
 add statistics about a floater particle
void add_interaction_stats (core::ParticleType type0, core::ParticleType type1)
 add statistics about interactions between particles of type 0 and 1
OptimizerStates add_optimizer_states (Optimizer *o=nullptr)
 add all statistics-related optimizer states to o
bool get_is_activated ()
Model * get_model ()
Model * get_model () const
std::string get_output_file_name () const
SimulationData * get_sd ()
SimulationData const * get_sd () const
virtual std::string get_type_name () const override
virtual ::IMP::VersionInfo get_version_info () const override
 Get information about the module and version of the object.
void remove_particle_type (core::ParticleType pt)
 Remove all statistics related to particle type pt.
void reset_statistics_optimizer_states ()
void set_interrupted (bool tf)
 Loads the stats file and set the interrupted flag to true.
void update (const IMP::internal::SimpleTimer &timer, unsigned int nf_new=1, bool force_full_output=false)
void update_particle_type_xyz_distribution_map (Particle *p)
void update_particle_type_zr_distribution_map (Particle *p)
Public Member Functions inherited from IMP::Object
CheckLevel get_check_level () const
 get_derived_object (self)
 Return this object cast to the most derived subclass.
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.
const std::string & get_name () const
 Get the (not necessarily unique) name of this object.
void set_name (std::string name)
void set_was_used (bool tf) const
void show (std::ostream &out=std::cout) const
virtual void clear_caches ()

Additional Inherited Members

Protected Member Functions inherited from IMP::Object
 Object (std::string name)
 Construct an object with the given name.
virtual void do_destroy ()

Constructor & Destructor Documentation

◆ Statistics()

IMP::npctransport::Statistics::Statistics ( SimulationData * sd,
unsigned int statistics_interval_frames,
std::string output_file_name )
Parameters
sdthe sd that owns and uses this statistics object
statistics_interval_framesthe interval of simulation frames for gathering statistics
output_file_namename of output file to which to dump statistics (or update if it already exists) when calling update()

◆ ~Statistics()

virtual IMP::npctransport::Statistics::~Statistics ( )
virtual

Definition at line 359 of file Statistics.h.

Member Function Documentation

◆ add_fg_chain_stats()

void IMP::npctransport::Statistics::add_fg_chain_stats ( FGChain * fg_chain)

add statistics about an FG chain

add statistics about an FG chains

Parameters
fg_chainthe chain

◆ add_floater_stats()

void IMP::npctransport::Statistics::add_floater_stats ( IMP::Particle * p)

add statistics about a floater particle

add statistics about a floater particle

Parameters
pthe particle

◆ add_interaction_stats()

void IMP::npctransport::Statistics::add_interaction_stats ( core::ParticleType type0,
core::ParticleType type1 )

add statistics about interactions between particles of type 0 and 1

add statistics about interactions between particles of type 0 and 1 (order does not matter)

Parameters
type0type of first interacting particles
type1type of other interacting particles

◆ add_optimizer_states()

OptimizerStates IMP::npctransport::Statistics::add_optimizer_states ( Optimizer * o = nullptr)

add all statistics-related optimizer states to o

Parameters
ooptimizer to which optimizer states are added, use get_sd()->get_bd() if nullptr
Returns
the list of optimizer states that were added
Note
If called for more than one optimizer, only the last optimizer will be guaranteed to work well.

◆ get_is_activated()

bool IMP::npctransport::Statistics::get_is_activated ( )

if true, statistics have been activated, so add_optimizer_states() was called such that statistics are being tracked

Definition at line 270 of file Statistics.h.

◆ get_model() [1/2]

Model * IMP::npctransport::Statistics::get_model ( )

returns the model associated with the owned SimulationData

◆ get_model() [2/2]

Model * IMP::npctransport::Statistics::get_model ( ) const

returns the model associated with the owned SimulationData

◆ get_output_file_name()

std::string IMP::npctransport::Statistics::get_output_file_name ( ) const

Definition at line 281 of file Statistics.h.

◆ get_sd() [1/2]

SimulationData * IMP::npctransport::Statistics::get_sd ( )

return the SimulationData object that owns this ScoringFunction

Definition at line 264 of file Statistics.h.

◆ get_sd() [2/2]

SimulationData const * IMP::npctransport::Statistics::get_sd ( ) const

return the SimulationData object that owns this ScoringFunction

Definition at line 276 of file Statistics.h.

◆ get_type_name()

virtual std::string IMP::npctransport::Statistics::get_type_name ( ) const
overridevirtual

Reimplemented from IMP::Object.

Definition at line 359 of file Statistics.h.

◆ get_version_info()

virtual ::IMP::VersionInfo IMP::npctransport::Statistics::get_version_info ( ) const
overridevirtual

Get information about the module and version of the object.

Reimplemented from IMP::Object.

Definition at line 359 of file Statistics.h.

Here is the call graph for this function:

◆ remove_particle_type()

void IMP::npctransport::Statistics::remove_particle_type ( core::ParticleType pt)

Remove all statistics related to particle type pt.

Removes statistics of particle type pt from all internal maps and from the optimizer states of get_sd()->get_bd()

Parameters
ptthe particle type to be removed

◆ reset_statistics_optimizer_states()

void IMP::npctransport::Statistics::reset_statistics_optimizer_states ( )

resets all the counters of any statistics counters, and the simulation time to zero

◆ set_interrupted()

void IMP::npctransport::Statistics::set_interrupted ( bool tf)

Loads the stats file and set the interrupted flag to true.

◆ update()

void IMP::npctransport::Statistics::update ( const IMP::internal::SimpleTimer & timer,
unsigned int nf_new = 1,
bool force_full_output = false )

opens / creates statistics protobuf file, and update it with appropriate statistics, using statistics file originally specified in the constructor, and based on statistics gathered from the optimizer that was specified by add_optimizer_states().

Exceptions
UsageExceptionIf add_optimizer_states() was not called yet (= get_is_activated() is false)
Parameters
timerthe timer that was used to measure the time that has elapsed for statistics
nf_newthe number of frames by which the statistics file should be advanced. This is used to weight the contribution of average statistics over time.
force_full_outputif true, then full statistics are dumped to the output file, even if the number of calls to update does not divide by the value of full_output_statistics_interval_factor
Note
this method is not const cause it may invoke e.g., energy evaluation though it does not substantially change anything in the state of the object
if configuration file full_output_statistics_interval_factor is larger than 1, then full statistics are dumped every N calls to update(), where N is the value of full_output_statistics_interval_factor, and only the HDF5 file is updated at each call.

◆ update_particle_type_xyz_distribution_map()

void IMP::npctransport::Statistics::update_particle_type_xyz_distribution_map ( Particle * p)

updates the map of x-y-z distributions of particle coordinates with p's binned position counts (if z-symmetry flag is on, z is absolute vertical location)

Comment: assume a pore geometry, no checks made that it is so

◆ update_particle_type_zr_distribution_map()

void IMP::npctransport::Statistics::update_particle_type_zr_distribution_map ( Particle * p)

updates the map of z-r distributions of particle coordinates with p's binned position counts (if z-symmetry flag is on, z is absolute vertical location; r is distance from pore axis)

Comment: assume a pore geometry, no checks made that it is so


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