![]() |
Rosetta Protocols
2014.16.56682
|
Keep track of move statistics at different temperature levels. More...
#include <MultiTempTrialCounter.hh>
Public Member Functions | |
| MultiTempTrialCounter (TemperatureControllerCOP) | |
| Default constructor. More... | |
| ~MultiTempTrialCounter () | |
| Default destructor. More... | |
| void | reset () |
| Set all counters for all temperatures to zero. More... | |
| void | reset_temp_controller (TemperatureControllerCOP) |
| Set the temperature controller. More... | |
| void | count_trial (std::string const &tag) |
| Record when a move of the given type was attempted. More... | |
| void | count_accepted (std::string const &tag) |
| Record when a move of the given type was accepted. More... | |
| void | count_energy_drop (std::string const &tag, core::Real drop) |
| Record when a move of the given type led to the given energy drop. More... | |
| void | collect () |
| Copy all statistics to the root node, if MPI is enabled. More... | |
| protocols::moves::TrialCounter const & | temp_level (core::Size) const |
| Return const access to the TrialCounter for the given temperature level. More... | |
| core::Size | num_temp_levels () const |
| Return the number of temperature levels recorded by this observer. More... | |
| core::Size | total_trials () const |
| Return how many trials have been recorded for all moves and all temperatures. More... | |
| core::Size | trial (std::string const &tag) const |
| Return how many times the given move was attempted for all temperatures. More... | |
| core::Size | accepted (std::string const &tag) const |
| Return how many times the given move was accepted for all temperatures. More... | |
| core::Real | energy_drop (std::string const &tag) const |
| Return the average drop in energy effected by this move for all temperatures. More... | |
| virtual utility::vector1 < std::string > const | tags () const |
| Return the tag name for any move recorded at any temperature. More... | |
| void | show (std::ostream &, std::string line_header="", bool with_end_line=true) const |
| Write acceptance rates for each move at each temperature to the given stream. 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... | |
Public Member Functions inherited from protocols::moves::TrialCounter | |
| TrialCounter () | |
| void | show () const |
Private Member Functions | |
| protocols::moves::TrialCounter & | get_current_counter () |
| Return a reference to the TrialCounter representing the current temperature level. Some sanity checks are done in debug mode. More... | |
| void | write_to_stream (std::ostream &, std::string const &tag) const |
| Help write the trial counters to the given stream. More... | |
Private Attributes | |
| TemperatureControllerCOP | temp_controller_ |
| utility::vector1 < protocols::moves::TrialCounter > | counters_ |
Keep track of move statistics at different temperature levels.
Moves are more likely to be accepted at higher temperatures, so it doesn't make sense to lump all the moves made at different temperatures into the same statistics. Since the default TrialCounter used by MonteCarlo is agnostic to the temperature, this class is provided as a drop-in replacement. Use MonteCarlo.set_counter() to replace the default counter with a MultiTempTrialCounter. Once the simulation is complete, use temp_level() to return the move statistics for the given temperature level. The trial(), accepted(), and energy_drop() method are provided to satisfy the TrialCounter interface, but are not meaningful because they merge the results from all the different temperatures.
| protocols::canonical_sampling::MultiTempTrialCounter::MultiTempTrialCounter | ( | TemperatureControllerCOP | tc | ) |
| protocols::canonical_sampling::MultiTempTrialCounter::~MultiTempTrialCounter | ( | ) |
Default destructor.
|
virtual |
Return how many times the given move was accepted for all temperatures.
Reimplemented from protocols::moves::TrialCounter.
References protocols::moves::TrialCounter::accepted(), and counters_.
| void protocols::canonical_sampling::MultiTempTrialCounter::collect | ( | ) |
Copy all statistics to the root node, if MPI is enabled.
References utility_exit_with_message.
|
virtual |
Record when a move of the given type was accepted.
Reimplemented from protocols::moves::TrialCounter.
References protocols::moves::TrialCounter::count_accepted(), and get_current_counter().
|
virtual |
Record when a move of the given type led to the given energy drop.
Reimplemented from protocols::moves::TrialCounter.
References protocols::moves::TrialCounter::count_energy_drop(), and get_current_counter().
|
virtual |
Record when a move of the given type was attempted.
Reimplemented from protocols::moves::TrialCounter.
References protocols::moves::TrialCounter::count_trial(), and get_current_counter().
|
virtual |
Return the average drop in energy effected by this move for all temperatures.
Reimplemented from protocols::moves::TrialCounter.
References counters_, and protocols::moves::TrialCounter::energy_drop().
|
private |
Return a reference to the TrialCounter representing the current temperature level. Some sanity checks are done in debug mode.
References counters_, and temp_controller_.
Referenced by count_accepted(), count_energy_drop(), and count_trial().
| Size protocols::canonical_sampling::MultiTempTrialCounter::num_temp_levels | ( | ) | const |
Return the number of temperature levels recorded by this observer.
References counters_.
|
virtual |
Set all counters for all temperatures to zero.
Reimplemented from protocols::moves::TrialCounter.
References counters_, and temp_controller_.
Referenced by MultiTempTrialCounter(), and reset_temp_controller().
| void protocols::canonical_sampling::MultiTempTrialCounter::reset_temp_controller | ( | TemperatureControllerCOP | temp_controller | ) |
Set the temperature controller.
References reset(), and temp_controller_.
|
virtual |
Write acceptance rates for each move at each temperature to the given stream.
Reimplemented from protocols::moves::TrialCounter.
References write_to_stream().
|
virtual |
Return the tag name for any move recorded at any temperature.
Reimplemented from protocols::moves::TrialCounter.
References counters_, and protocols::moves::TrialCounter::tags().
| TrialCounter const & protocols::canonical_sampling::MultiTempTrialCounter::temp_level | ( | core::Size | level | ) | const |
Return const access to the TrialCounter for the given temperature level.
References counters_, and temp_controller_.
|
virtual |
Return how many trials have been recorded for all moves and all temperatures.
Reimplemented from protocols::moves::TrialCounter.
References counters_, and protocols::moves::TrialCounter::total_trials().
|
virtual |
Return how many times the given move was attempted for all temperatures.
Reimplemented from protocols::moves::TrialCounter.
References counters_, and protocols::moves::TrialCounter::trial().
| void protocols::canonical_sampling::MultiTempTrialCounter::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.
References out, and write_to_stream().
|
private |
Help write the trial counters to the given stream.
References counters_, protocols::abinitio::abscript::I, and temp_controller_.
Referenced by show(), and write_to_file().
|
private |
Referenced by accepted(), energy_drop(), get_current_counter(), num_temp_levels(), reset(), tags(), temp_level(), total_trials(), trial(), and write_to_stream().
|
private |
Referenced by get_current_counter(), reset(), reset_temp_controller(), temp_level(), and write_to_stream().
1.8.7