1 #ifndef CASM_MonteCounter_HH
2 #define CASM_MonteCounter_HH
10 class EquilibriumMonteSettings;
Track the number of passes, steps and samples taken in a Monte Carlo calculation.
bool sample_time() const
Returns true if based on period and current number of steps it is time to take a sample.
bool m_is_max_step
Maximum allowed number of steps.
void reset()
Set all counter variables back to 0.
bool maximums_met() const
Check if maximum number of pass, step, and samples has been met.
size_type m_step
Number of steps taken during the current pass.
bool m_is_N_step
Requested number of steps.
size_type samples() const
Number of samples taken.
SAMPLE_MODE m_sample_mode
Whether sampling mode is by SAMPLE_MODE::PASS or SAMPLE_MODE::STEP.
bool m_is_min_pass
Minimum allowed number of passes.
MonteCounter & operator++()
Prefix increment step and updates pass.
bool is_complete() const
Check if requested number of pass, step, or samples has been met.
bool m_is_N_pass
Requested number of passes.
bool minimums_met() const
Check if minimum number of pass, step, and samples has been met.
size_type m_samples
Number of data samples taken.
bool m_is_max_sample
Maximum allowed number of samples to take.
size_type steps_per_pass() const
Number of steps per pass.
size_type step() const
Number of steps into the current pass.
size_type m_since_last_sample
Number of passes or steps since last sample.
void increment_samples()
Increments the number of samples taken and resets counter until the next sample should be taken.
void debugprint(std::ostream &sout) const
bool m_is_max_pass
Maximum allowed number of passes.
void set(size_type _pass, size_type _step, size_type _samples)
Set all counter variables for performing a restart.
bool m_is_min_step
Minimum allowed number of steps.
MonteCounter(const EquilibriumMonteSettings &settings, size_type _steps_per_pass)
Construct a MonteCounter and initialize to all counts to zero.
bool m_is_N_sample
Requested number of samples.
bool m_is_min_sample
Minimum allowed number of samples to take.
size_type pass() const
Number of complete passes performed.
SAMPLE_MODE
How often to sample runs.
INDEX_TYPE Index
For long integer indexing: