Recorder

A metatype for recording Monte Carlo steps.

Attributes

Name Type Description
period number Recording period. If set to 1 all Monte carlo steps are recorded. Otherwise a downsampling by a factor of period is applied.
record function Callback function applied to Monte Carlo steps.

The record callback function has the following synopsis and arguments. No return value is expected.

Recorder.record(state, medium, event)
Name Type Description
state State Recorded Monte Carlo state.
medium Medium Medium at the Monte Carlo state location.
event Event Event flag of the Monte Carlo step.

Warning

The event and state arguments are overwritten between successive calls of the record callback function. They must be copied (e.g. using the clone method) if data are to be retained.

Constructor

The Recorder constructor takes two optionnal arguments as shown in the synopsis below. If no callback function is provided a default one is used resulting in Monte Carlo steps to be printed to the standard output.

Synopsis

pumas.Recorder((record), (period))

Arguments

Name Type Description
(record) function User callback as detailed above.
(period) number Recording period (downsampling). Defaults to 1, i.e. the record callback is called for all Monte Carlo steps.

See also

Context, Event, Mode, State.