Stepper

class Stepper

Perform an action (update or write) every so many steps. 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

Stepper(const argtype &args = argtype())

args:

  • steps_per_write: Set the number of trial steps per write (default: 1). Disabled if negative value is provided.

  • steps_per_update: Set the number of trial steps per update (default: 1). Disabled if negative value is provided.

  • file_name: Set the file name to write output (default: empty). If empty, write to screen.

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

  • clear_file: set true to clear contents of file_name, 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).

  • file_name_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, steps_per_write refers now to the writing of all states. Individual states no longer write.

  • num_block: number of updated per block in accumulator. If not provided, use default value in Accumulator.

  • num_moments: number of moments in accumulator. If not provided, use default value in Accumulator.

  • configuration: index of configuration (default: 0)

int steps_per_update() const

Return the number of steps per update.

int steps_per_write() const

Return the number of steps per write.

const std::string file_name() const

Return the file name.

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

Return the file name with optionally appended phase.

bool file_name_append_phase() const

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

void empty_file_name()

Empty the file name.

bool append() const

Return true if appending.

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 configuration() const

Return the configuration index.

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.

int steps_since_update() const

Return the number of steps since update.

int steps_since_write() const

Return the number of steps since write.

bool is_multistate_aggregate() const

Return true if aggregating the write of multistate.

virtual std::string header(const Criteria &criteria, const System &system, const TrialFactory &trials) const

Return the header for writing.