R6
class to represent a generic (abstract) manager for
generating or processing simulation results, as well as optionally generating values
via generators.
Super class
poems::GenericClass
-> GenericManager
Active bindings
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.
Methods
Inherited methods
Method new()
Initialization method sets any included attributes (sample_data, generators, parallel_cores, results_dir, results_filename_attributes) and attaches other attributes individually listed.
Usage
GenericManager$new(...)
Method get_message_sample()
Substitutes the specified sample details into a status message (using sprintf) and returns the result.
Method get_results_filename()
Constructs and returns the results filename based on the sample data frame index and results filename attributes.
Examples
generic_manager <- GenericManager$new(
attr1 = 22:23,
results_filename_attributes = c("attr1", "example")
)
generic_manager$get_results_filename(1)
#> [1] "sample_1_results"
generic_manager$get_results_filename(2)
#> [1] "sample_2_results"