| run_cohort | R Documentation |
These helpers support batch simulation with: global parameter draws reused across entities (parameter uncertainty) multiple stochastic sims per entity per draw (stochastic uncertainty) parallelization across entities
run_cohort(
engine,
entities,
n_param_draws = 1,
n_sims = 1,
param_draws = NULL,
runtime = NULL,
max_events = 1000,
max_time = NULL,
return_observations = TRUE,
backend = NULL,
n_workers = NULL,
seed = NULL
)
engine |
An Engine object (with a materialized bundle). |
entities |
List of Entity objects. |
n_param_draws |
Integer; number of global parameter draws (D). Default 1. |
n_sims |
Integer; number of stochastic sims per entity per draw (S). Default 1. |
param_draws |
Optional list of exactly |
runtime |
Optional RuntimeContext; carries seed, backend, and n_workers for v2-mode
engines. Takes precedence over the individual |
max_events |
Max events per run. |
max_time |
Optional max time per run. |
return_observations |
Logical; whether to return observations (if bundle provides observe()). |
backend |
Backend used to parallelize across entities. One of "none", "cluster",
"mclapply", or "future". When |
n_workers |
Integer; workers for parallel; default parallel::detectCores() - 1.
When |
seed |
Optional base seed for reproducibility. Public contract:
fixed |
A list with: runs: list of per-run outputs (entity/events/observations; plus trajectory_records when enabled) with labels index: data.frame mapping run_id -> entity_id/param_draw_id/sim_id param_draws: the validated contexts in ascending draw-id order
The index run_id is a batch-local join key shared by the corresponding run,
its SimContext, and its trajectory records. For replay across cohort calls,
use the stable entity/draw/simulation coordinates rather than assuming that a
sequential run_id will remain unchanged when the cohort shape changes.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.