Skip to contents

Sets 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.

Usage

calibrate_dynamic_fire(observed_targets_path, scenario_template, cfg, out_dir)

Arguments

observed_targets_path

Character. Path to the .rds from save_observed_fire_targets().

scenario_template

Character. Path to the calibration scenario's scenario.txt (the return of build_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.