
DEoptim driver for Dynamic Fire calibration
calibrate_dynamic_fire.RdSets up a warm Docker pool (for the landis simulator on Docker) and a FORK
cluster of n_cores workers, then invokes DEoptim::DEoptim() with the
multi-component loss as the objective. Pool + cluster are torn down via
on.exit() regardless of success / error / interrupt.
Arguments
- observed_targets_path
Character. Path to the
.rdsfromsave_observed_fire_targets().- scenario_template
Character. Path to the calibration scenario's
scenario.txt(the return ofbuild_calibration_scenario_template()).- cfg
List. Calibration config. Expected keys:
- lower, upper
Named numeric vectors keyed by
calibration_par_names().- NP, itermax, strategy
DEoptim control args.
- n_reps, sim_years, weights, base_seed
Per-trial settings.
- n_cores, parallel
Parallelism settings.
- simulator
"landis"(default),"r_reimpl", or"mock".- method
"docker"(default) or"local".- image, cpu_limit, mem_limit, pull
Pool settings (Docker only).
- out_dir
Character. Where to write the DEoptim trace + scratch sub-directory. Created if missing.
Value
List with best_params (named numeric), objective (scalar),
deoptim (full DEoptim return), trace_path (CSV path), cfg (echo),
pool_image / pool_digest (provenance; NA when no pool was started).
Details
Designed to be called from a tar_target with deployment = "main" so the
outer targets crew doesn't try to dispatch this as a single worker while
it manages its own internal cluster.
Per-worker container assignment: each FORK worker sets its
LANDIS_POOL_CONTAINER_IDX env var to its 1-based pool index.
sim_landis() reads this when running inside the worker.
DEoptim is gated on requireNamespace("DEoptim"); install via
renv::install("DEoptim") before calling.
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(),
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_landis(),
sim_mock(),
sim_r_reimpl()