This is an internal function used by the user-facing
It is of potential interest only to mizer extension authors.
project_simple( params, n = params@initial_n, n_pp = params@initial_n_pp, n_other = params@initial_n_other, effort = params@initial_effort, t = 0, dt = 0.1, steps, resource_dynamics_fn = get(params@resource_dynamics), other_dynamics_fns = lapply(params@other_dynamics, get), rates_fns = lapply(params@rates_funcs, get), ... )
A MizerParams object.
An array (species x size) with the number density at start of simulation.
A vector (size) with the resource number density at start of simulation.
A named list with the abundances of other components at start of simulation.
The fishing effort to be used throughout the simulation. This must be a vector or list with one named entry per fishing gear.
Time at the start of the simulation.
Size of time step.
The number of time steps by which to project.
The function for the resource dynamics. See Details.
List with the functions for the dynamics of the other components. See Details.
List with the functions for calculating the rates. See Details.
Other arguments that are passed on to the rate functions.
List with the final values of
The function does not check its arguments because it is meant to be as fast
as possible to allow it to be used in a loop. For example, it is called in
project() once for every saved value. The function also does not save its
intermediate results but only returns the result at time
t + dt * steps.
During this time it uses the constant fishing effort
The functional arguments can be calculated from slots in the
<- get(params@resource_dynamics) resource_dynamics_fn <- lapply(params@other_dynamics, get) other_dynamics_fns <- lapply(params@rates_funcs, get)rates_fns
The reason the function does not do that itself is to shave 20 microseconds of its running time, which pays when the function is called hundreds of times in a row.
This function is also used in
steady(). In between calls to
steady() function checks whether the values are
still changing significantly, so that it can stop when a steady state has
been approached. Mizer extension packages might have a similar need to run
a simulation repeatedly for short periods to run some other code in
between. Because this code may want to use the values of the rates at the
final time step, these too are included in the returned list.