R6 class representing a nested container for generator attributes
Source:R/GenerativeTemplate.R
GenerativeTemplate.RdR6 class representing a nested container for
Generator attributes that are maintained when new model clones are
created. The container maintains input and output attribute names,
file, function and distribution templates, correlation parameters (for distribution
generation), rounding decimals, occupancy mask, and any inherited class model
attributes that need to be maintained when cloning.
Active bindings
descriptionA brief description of what the generator generates.
inputsAn array of input attribute names for the generator.
outputsAn array of output attribute names for the generator.
file_templatesA list of file template attributes.
function_templatesA list of function template attributes.
distribution_templatesA list of distribution template attributes.
uses_correlationsA boolean to indicate that a
SpatialCorrelation(or inherited class) object is used for generating correlated random deviates.spatial_correlationA
SpatialCorrelation(or inherited class) object for generating correlated random deviates.temporal_correlationAbsolute correlation coefficient between simulation time steps for all grid cells (0-1; default = 1).
time_stepsNumber of simulation time steps (default = 1).
generate_rastersBoolean to indicate if rasters should be generated (default: NULL).
decimalsNumber of decimal places applied to the generated values (default: NULL = no rounding).
occupancy_maskOptional binary mask array (matrix), data frame, or raster (stack) for generated (time-series) data.
Methods
Method new()
Initialization method initializes the generator templates.
Usage
GenerativeTemplate$new()Examples
gen_template <- GenerativeTemplate$new()
gen_template$occupancy_mask <- array(c(1, 1, 0, 0, 1, 1, 1))
gen_template$decimals <- 4
gen_template$description <- "Test generator"
coordinates <- data.frame(x = c(1:4, 4:2), y = c(1, 1:4, 4:3))
generator <- Generator$new(
region = Region$new(coordinates = coordinates), attr1 = 1,
template_attached = gen_template
)
generator$description
#> [1] "unnamed"
generator$occupancy_mask
#> NULL
generator$decimals
#> NULL