Sets the slots in the MizerParams object holding the initial abundances, initial_n, initial_n_pp and initial_n_other.

setInitial(
  params,
  sim,
  initial_n = params@initial_n,
  initial_n_pp = params@initial_n_pp,
  initial_n_other = params@initial_n_other
)

Arguments

params

A MizerParams object

sim

A MizerSim object. If supplied, the `initial_n`, `initial_n_pp` and `initial_n_pp` arguments are ignored and the information is taken from the last timestep of the simulation in `sim`.

initial_n

The initial abundances of species. A matrix with dimensions species x size. The order of species must be the same as in the MizerParams argument. Optional. Ignored if `sim` is supplied.

initial_n_pp

The initial abundances of plankton. A numeric vector. Optional. Ignored if `sim` is supplied.

initial_n_other

The initial abundances of the other dynamic ecosystem components. A named list with one entry for each component. Optional. Ignored if `sim` is supplied.

Value

A MizerParams object

See also

Other functions for setting parameters: setBMort(), setFishing(), setIntakeMax(), setInteraction(), setMetab(), setParams(), setPlankton(), setPredKernel(), setReproduction(), setSearchVolume()

Examples

if (FALSE) { params <- NS_params sim <- project(params, t_max = 20, effort = 0.5) params <- setInitial(params, sim) }