R6
class to represent a generic (abstract) manager for
generating or processing simulation results, as well as optionally generating values
via generators.
poems::GenericClass
-> GenericManager
attached
A list of dynamically attached attributes (name-value pairs).
sample_data
A data frame of sampled parameters for each simulation/result.
generators
A list of generators (Generator
or inherited class) objects for generating simulation model values.
parallel_cores
Number of cores for running the simulations in parallel.
results_dir
Results directory path.
results_ext
Result file extension (default is .RData).
results_filename_attributes
A vector of: prefix (optional); attribute names (from the sample data frame); postfix (optional); utilized to construct results filenames.
error_messages
A vector of error messages encountered.
warning_messages
A vector of warning messages encountered.
Inherited methods
new()
Initialization method sets any included attributes (sample_data, generators, parallel_cores, results_dir, results_filename_attributes) and attaches other attributes individually listed.
GenericManager$new(...)
...
Parameters listed individually.
get_attribute()
Returns a named manager or attached attribute.
GenericManager$get_attribute(param)
param
Character string name of the attribute.
Selected attribute value.
get_message_sample()
Substitutes the specified sample details into a status message (using sprintf) and returns the result.
GenericManager$get_message_sample(status_message, sample_index)
status_message
Character string message with a placeholder for sample details.
sample_index
Row index of sample data frame containing details of substitution parameters.
Status message with substituted sample details.
get_results_filename()
Constructs and returns the results filename based on the sample data frame index and results filename attributes.
GenericManager$get_results_filename(sample_index)
sample_index
Row index of sample data frame containing details of substitution parameters.
Results filename with substituted sample details.
clone()
The objects of this class are cloneable with this method.
GenericManager$clone(deep = FALSE)
deep
Whether to make a deep clone.
generic_manager <- GenericManager$new(
attr1 = 22:23,
results_filename_attributes = c("attr1", "example")
)
generic_manager$get_results_filename(1)
generic_manager$get_results_filename(2)
Run the code above in your browser using DataLab