
Run one DEoptim trial for a candidate parameter vector (blocking)
sim_landis.RdOne calibration trial: copy paths$scenario_template into a scratch dir
under paths$scratch_root, patch dynamic-fire.txt with par_vec, run
LANDIS-II via the warm Docker pool (or a one-off Docker/local invocation if
no pool is supplied), parse the resulting Dynamic Fire logs.
Usage
sim_landis(
par_vec,
par_names = NULL,
paths,
sim_years,
base_seed,
pool = NULL,
pool_idx = NULL,
method = NULL,
pixel_area_ha = 1,
keep_scratch = FALSE
)Arguments
- par_vec
Numeric. Named candidate parameter vector.
- par_names
Character or NULL. Names in canonical order (
calibration_par_names()). Used to re-attach names if DEoptim strips them when calling the objective function with positional args.- paths
Named list of strings. Required entries:
- scenario_template
Directory built by
build_calibration_scenario_template().- scratch_root
Where per-trial dirs are created. Must equal the pool's
scratch_rootwhenpoolis supplied. NULL =tempdir().
- sim_years
Integer. Calibration sim duration in years (informational; the actual Duration comes from the template's scenario.txt).
- base_seed
Integer. Random seed for this trial.
- pool
A
landis_poolfromlandis_pool_start(), or NULL for one-off.- pool_idx
Integer. 1-based container index in
pool. Required whenpoolis non-NULL.- method
Character.
"docker"or"local". Used only whenpoolis NULL. Default fromgetOption("landisutils.run.method").- pixel_area_ha
Numeric. Hectares per cell. Default 1.
- keep_scratch
Logical. Leave the per-trial scratch dir in place for debugging. Default FALSE.
Value
The output of parse_dynamic_fire_logs() for the trial's rep01/.
Details
paths carries only file PATHS so the function is FORK-safe (no terra/sf
objects in the worker's environment).
Isolation between trials in the same pool container: each trial uses a
unique scratch directory; landis_pool_exec() sets per-call env vars to
redirect dotnet caches; the trial directory is deleted after parsing unless
keep_scratch = TRUE.
See also
Other Dynamic Fire calibration helpers:
apply_calibrated_hi_prop(),
apply_calibrated_ignprob(),
bc_fuel_code_to_base(),
build_calibration_scenario_template(),
build_calibration_spinup_scenario(),
calibrate_dynamic_fire(),
calibration_par_names(),
default_severity_prior_sturtevant2009(),
loss_from_stats(),
parse_dynamic_fire_logs(),
patch_fire_config(),
run_calibration_spinup(),
save_observed_fire_targets(),
sim_mock(),
sim_r_reimpl()