Method new()
Initialization method sets the population model, and optionally the simulation function, the sample ID, and any attached attributes listed individually.
Usage
ModelSimulator$new(
simulation_model = NULL,
simulation_function = NULL,
sample_id = NULL,
...
)
Arguments
simulation_model
A SimulationModel
(or inherited class) object (can be set later).
simulation_function
Optional name (character string) or direct assignment (assigned or loaded via source path) of the simulation function, which takes a SimulationModel
(or inherited class) as an input and returns the simulation results.
sample_id
Optional identifier for the simulation sample.
...
Additional parameters passed individually are attached.
Method new_clone()
Creates a new (re-initialized) object of the current (inherited) object class with optionally passed parameters.
Usage
ModelSimulator$new_clone(...)
Arguments
...
Parameters passed via the inherited class constructor (defined in initialize and run via new).
Returns
New object of the current (inherited) class.
Method get_attribute()
Returns selected named simulator or attached attribute.
Usage
ModelSimulator$get_attribute(param)
Arguments
param
Name of the parameter/attribute.
Returns
Selected parameter/attribute value.
Method run()
Runs a model simulator (function), stores the results, and creates a status log entry as a list.
Usage
ModelSimulator$run()
Returns
A list representing a simulation log entry with a successful boolean and a status message template (with a placeholder for the sample identifier).
Method clone()
The objects of this class are cloneable with this method.
Usage
ModelSimulator$clone(deep = FALSE)
Arguments
deep
Whether to make a deep clone.