run_simulation | R Documentation |
This function begins with the current state of x
, runs the model for nt
steps,
then returns a copy of x
with the updated state and state history.
run_simulation(x, nt, reps = length(x[["networks"]]))
x |
A |
nt |
The number of time steps, see 'details' |
reps |
The number of replicate simulations to run; by default a single sim is run on a new flume; for continuing simulations, the same number of replicates will be used |
The time scale of flume is determiend by the combination of (a) the units of the
discharge variable (assumed generally to be m^3/s) and (b) the size of the time step (which is
specified with the dt
parameter of the flume()
function).
At each time step of length dt
, the model will simulate colonisations and extinctions assuming
that resource state is constant throughout the time step, and simulate resource dynamics
continuously via numerical integration. Model output will include the various state variables
at each time step.
For example, if discharge is in m^3/s, then the default dt = 86400
corresponds to a
time step of 86400 seconds, or one day. Setting nt = 100 will run the model for 100 days.
On unix-like platforms, if multiple cores are detectable and replicate simulations are requested,
then these will be run in parallel using the number of cores specified in
getOption("mc.cores")
. If this value is not set, then all available cores will be used by
default. Override the default by setting mc.cores
; for example, to disable parallel execution,
run options(mc.cores = 1)
.
A modified copy of x
, with state updated with the results of the simulation.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.