- object
Stock-and-flow model, object of class stockflow.
- method
Integration method. Defaults to "euler".
- start
Start time of simulation. Defaults to 0.
- stop
End time of simulation. Defaults to 100.
- dt
Timestep of solver; controls simulation accuracy. Smaller = more
accurate but slower. Defaults to 0.01.
- save_at
Controls which time points are saved in the output. Either:
A single number: save every N time units (interval). Must be >= dt.
Use larger than dt to reduce output size without sacrificing accuracy.
Example: dt = 0.01, save_at = 1 saves every 100th computed point.
A numeric vector: explicit time points to include in output.
Values must lie within [start, stop].
Pass NA, NULL, or "" to reset to saving all dt steps.
Mutually exclusive with save_n. Defaults to NULL (save all).
- save_n
Save exactly N evenly-spaced time points from start to stop.
save_n = 1 saves only the final time point (stop).
Pass NA, NULL, or "" to reset to saving all dt steps.
Mutually exclusive with save_at. Defaults to NULL (save all).
- seed
Seed number to ensure reproducibility across runs in case of
random elements. Must be an integer. Defaults to NULL (no seed).
- time_units
Simulation time unit. Defaults to "seconds".
- language
Coding language in which to simulate model. Either "R" or
"Julia". Defaults to "R".
- only_stocks
If TRUE, only return stocks in output, discarding flows
and auxiliaries. If FALSE, flows and auxiliaries are saved, which slows
down the simulation. Defaults to TRUE.
- vars
Character vector of variable names to save in simulation output.
If specified, this overrides only_stocks.
- keep_nonnegative_stock
If TRUE, keeps original non-negativity setting
of stocks. Defaults to FALSE.
- keep_nonnegative_flow
If TRUE, keeps original non-negativity setting
of flows. Defaults to TRUE.
- save_sims
If TRUE, individual simulations are retained in
ensemble() output. Defaults to FALSE.