Stepper

class Stepper

Perform an action (update or write) every so many trials. This action could be read-only (see Analyze) or not (see Modify). Write to screen if file name is not provided.

Subclassed by feasst::Analyze, feasst::Modify

Public Functions

int trials_per_update() const

Return the number of trials per update.

int trials_per_write() const

Return the number of trials per write.

const std::string &output_file() const

Return the file name.

std::string output_file(const Criteria &criteria) const

Return the file name with optionally appended phase.

bool output_file_append_phase() const

Return true if phase is to be appended to file name.

void empty_output_file()

Empty the file name.

bool append() const

Return true if appending.

bool rewrite_header() const

Return true if header is to be rewritten.

int stop_after_phase() const

Stop after simulation reaches this phase index.

int start_after_phase() const

Stop after simulation reaches this phase index.

int stop_after_iteration() const

Stop after Criteria reaches this iteration.

int start_after_iteration() const

Stop after Criteria reaches this iteration.

int configuration_index() const

Return the configuration index.

const Configuration &configuration(const System &system) const

Given the system, return the configuration.

void set_state(const int state = 0)

Set the state. Append file name if not empty.

bool is_multistate() const

Return if multistate.

int state() const

Return the state.

const Accumulator &accumulator() const

Return the accumulator.

Accumulator *get_accumulator()

Get the accumulator.

int trials_since_update() const

Return the number of trials since update.

int trials_since_write() const

Return the number of trials since write.

bool is_multistate_aggregate() const

Return true if aggregating the write of multistate.

virtual std::string header(const MonteCarlo &mc) const

Return the header for writing.

void printer(const std::string output, const std::string &output_file)

Write to standard output if file name is not set. Otherwise, output file.

Arguments

Stepper(argtype args = argtype())

args:

  • trials_per_write: Set the number of trials per write (default: 1). Disabled if negative value is provided.

  • trials_per_update: Set the number of trials per update (default: 1). Disabled if negative value is provided.

  • output_file: Set the file name to write output (default: empty).

  • append: append file output if set to true. Do not append if false (default: “false”).

  • clear_file: set true to clear contents of output_file, if exists. (default: false).

  • stop_after_phase: stop when simulation reaches this phase index. If -1, never stop (default: -1).

  • start_after_phase: start when simulation reaches this phase index. If -1, start at beginning (default: -1).

  • output_file_append_phase: append phase to file name (default: false)

  • multistate: set “true” to copy for each state (default: false)

  • multistate_aggregate: aggregate the writing of all states, only when multistate is enabled (default: true). Thus, trials_per_write refers now to the writing of all states. Individual states no longer write.

  • stop_after_iteration: stop when Criteria reaches this iteration. If -1, never stop (default: -1).

  • start_after_iteration: start when Criteria reaches this iteration. If -1, start at beginning (default: -1).

  • rewrite_header: set true to rewrite header every write (default: true). If multistate_aggregate, automatically set to false.

  • Accumulator arguments.

  • configuration_index: index of configuration (default: 0)