Configuration class Encapsulates all configuration parameters for the package, with validation. The same object is used for all workflows, with workflow-specific validation methods.

Public fields

stics_exe

Path to STICS executable (required)

usms_workspace

Path to USMs workspace (required)

metadata_file

Path to metadata file (required if run_simulations = TRUE)

eval_workspace

Path to evaluation workspace (required)

output_dir

Path to output directory for export workflow (required for export)

run_simulations

Logical. Whether to run simulations or just prepare the workspace.

parallel

Logical. Whether to run workflow in parallel.

verbose

Integer. Verbosity level (0 = silent, 1 = info, 2 = debug).

cores

Integer or NA. Number of CPU cores to use for parallel processing (only if parallel = TRUE). NA means auto-detect.

percentage

Numeric. Percentage of simulations to consider for export and plots (between 0 and 100).

species

Character vector or NULL. If specified, only these species will be included in export and plots.

usms

Character vector or NULL. If specified, only these USMs will be included in export and plots.

var2exclude

Character vector or NULL. If specified, these variables will be excluded from export and plots.

sim_rds

Character or NULL. Path to an .rds file containing pre-computed simulation results. If supplied, bypasses the need to run simulations (see validate_eval()). Independent of obs_rds.

obs_rds

Character or NULL. Path to an .rds file containing observation data used as reference for evaluation, plots and balance closure. Independent of sim_rds — has no effect on required fields.

ref_sim_rds

Character or NULL. Path to an .rds file containing reference simulation results used for evaluation and plots. Required for evaluation.

Methods


Configuration$new()

Create a Configuration object. Values are validated against a declarative schema.

Usage

Configuration$new(...)

Arguments

...

Named configuration fields. Must match names defined in config_schema$fields. Unspecified fields use their default values. Invalid or unknown fields will trigger validation errors.


Configuration$validate_eval()

Validate configuration for evaluation workflow. Note: if sim_rds is supplied, it bypasses the need to run simulations (see check_metadata_file). obs_rds is independent and has no effect on required fields. usms_workspace remains required for eval regardless of sim_rds/obs_rds.

Usage

Configuration$validate_eval()


Configuration$validate_balance_closure()

Validate configuration for balance closure test

Usage

Configuration$validate_balance_closure()


Configuration$print()

Print the configuration, with fields grouped by theme (paths, execution, filtering, ...) rather than as a flat list. Makes it much easier to eyeball the current state of a large Configuration.

Usage

Configuration$print(...)

Arguments

...

Ignored. For compatibility with R6 print() generic.


Configuration$clone()

The objects of this class are cloneable with this method.

Usage

Configuration$clone(deep = FALSE)

Arguments

deep

Whether to make a deep clone.