Rosetta  2021.16
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
protocols::canonical_sampling::MultiTemperatureTrialCounter Class Reference

Keep track of trial statistics for any number of replicas. More...

#include <MultiTemperatureTrialCounter.hh>

Public Member Functions

 MultiTemperatureTrialCounter ()
 Default constructor. A temperature controller must be set before the trial counter can be used. More...
 
 MultiTemperatureTrialCounter (TemperatureController const *)
 Fully construct the counter with a temperature controller. More...
 
void reset ()
 Set all counters for all temperatures to zero. More...
 
void count_trial (std::string const &)
 Note that a move of the given type was attempted. More...
 
void count_accepted (std::string const &)
 Note that a move of the given type was accepted. More...
 
void count_energy_drop (std::string const &, core::Real)
 Note that a move of the given type led to the given energy drop. More...
 
protocols::moves::TrialCounter
const & 
operator[] (core::Size) const
 Return const access to the TrialCounter for the given temperature level. More...
 
protocols::moves::TrialCounteroperator[] (core::Size)
 Return non-const access to the TrialCounter for the given temperature level. More...
 
void show (std::ostream &) const
 Write acceptance rates for each move at each temperature to the given stream. More...
 
void show () const
 Write acceptance rates for each move at each temperature to this module's tracer. More...
 
void write_to_file (std::string const &file, std::string const &tag) const
 Write acceptance rates for each move at each temperature to the given file. More...
 
void set_temperature_observer (TemperatureController const *)
 Set the temperature controller. More...
 

Private Member Functions

void _write_to_stream (std::ostream &, std::string const &tag) const
 Help write the trial counters to the given stream. More...
 

Private Attributes

TemperatureController const * tempering_
 
utility::vector1
< protocols::moves::TrialCounter
counters_
 

Detailed Description

Keep track of trial statistics for any number of replicas.

This class helps MetropolisHastingsMover keep track of move statistics. At the end of a simulation, operator[]() can be used to access the TrialCounter objects kept for each temperature level. Alternatively, the show() and write_to_file() methods can also be used to directly output acceptance rates to a stream or file.

Constructor & Destructor Documentation

protocols::canonical_sampling::MultiTemperatureTrialCounter::MultiTemperatureTrialCounter ( )
inline

Default constructor. A temperature controller must be set before the trial counter can be used.

protocols::canonical_sampling::MultiTemperatureTrialCounter::MultiTemperatureTrialCounter ( TemperatureController const *  temp_in)

Fully construct the counter with a temperature controller.

References reset().

Member Function Documentation

void protocols::canonical_sampling::MultiTemperatureTrialCounter::_write_to_stream ( std::ostream &  os,
std::string const &  tag 
) const
private
void protocols::canonical_sampling::MultiTemperatureTrialCounter::count_accepted ( std::string const &  tag)
void protocols::canonical_sampling::MultiTemperatureTrialCounter::count_energy_drop ( std::string const &  tag,
core::Real  delta 
)

Note that a move of the given type led to the given energy drop.

References counters_, protocols::canonical_sampling::TemperatureController::temperature_level(), and tempering_.

void protocols::canonical_sampling::MultiTemperatureTrialCounter::count_trial ( std::string const &  tag)
protocols::moves::TrialCounter const & protocols::canonical_sampling::MultiTemperatureTrialCounter::operator[] ( core::Size  level) const

Return const access to the TrialCounter for the given temperature level.

References counters_.

protocols::moves::TrialCounter & protocols::canonical_sampling::MultiTemperatureTrialCounter::operator[] ( core::Size  level)

Return non-const access to the TrialCounter for the given temperature level.

References counters_.

void protocols::canonical_sampling::MultiTemperatureTrialCounter::reset ( )
void protocols::canonical_sampling::MultiTemperatureTrialCounter::set_temperature_observer ( TemperatureController const *  temp_in)
void protocols::canonical_sampling::MultiTemperatureTrialCounter::show ( std::ostream &  os) const

Write acceptance rates for each move at each temperature to the given stream.

References _write_to_stream(), and tempering_.

Referenced by protocols::canonical_sampling::TrialCounterObserver::finalize_simulation().

void protocols::canonical_sampling::MultiTemperatureTrialCounter::show ( ) const

Write acceptance rates for each move at each temperature to this module's tracer.

References protocols::canonical_sampling::tr().

void protocols::canonical_sampling::MultiTemperatureTrialCounter::write_to_file ( std::string const &  file,
std::string const &  tag 
) const

Member Data Documentation

utility::vector1< protocols::moves::TrialCounter > protocols::canonical_sampling::MultiTemperatureTrialCounter::counters_
private
TemperatureController const* protocols::canonical_sampling::MultiTemperatureTrialCounter::tempering_
private

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