Runs Stics simulations for the USMs found in usms_workspace (a text workspace as generated by gen_workspace_from_sms), and saves the resulting simulation and observation data as .rds files in output_dir. The saved files can later be reused as sim_rds/ref_sim_rds and obs_rds by evaluate or balance_closure_test, bypassing the need to run simulations or extract observations again.

run_simulations(
  stics_exe,
  usms_workspace,
  metadata_file,
  output_dir,
  usms = NULL,
  vars = NULL,
  parallel = FALSE,
  cores = NA,
  verbose = 1L,
  usms_files = lifecycle::deprecated()
)

Arguments

stics_exe

path to the Stics executable

usms_workspace

path to the Stics text workspace containing the USMs to simulate

metadata_file

path to the metadata CSV file describing USM rotations (successive USMs)

output_dir

directory where the simulation results (simulations.rds) and observation data (observations.rds) will be written. Created if it doesn't exist.

usms

character vector of USM names to simulate. If NULL (default), all USMs found in usms_workspace are simulated. Use read_usms_files to read them from USM list files.

vars

character vector of variable names to simulate. If NULL (default), the variables are derived automatically from the observation files found in usms_workspace. Pass this explicitly to simulate variables that aren't observed, e.g. the balance closure variables consumed by balance_closure_test.

parallel

Boolean. Is the computation to be done in parallel ?

cores

Number of cores to use for parallel computation

verbose

Integer. Logging verbosity level: 0 = warnings and errors only, 1 = info, 2 = debug

usms_files

Deprecated. Use usms = read_usms_files(usms_files) instead.

Value

invisibly, a list with two elements: sim and obs, each a list of results (one tibble per USM), as returned by SticsOnR::stics_wrapper and SticsRFiles::get_obs respectively