Runs the size spectrum model simulation. The function returns an object of type MizerSim that can then be explored with a range of summary_functions and plotting_functions.

project(
  object,
  effort,
  t_max = 100,
  dt = 0.1,
  t_save = 1,
  t_start = 0,
  initial_n,
  initial_n_pp,
  initial_n_other,
  append = TRUE,
  progress_bar = TRUE,
  ...
)

Arguments

object

Either a MizerParams object or a MizerSim object (which contains a MizerParams object).

effort

The effort of each fishing gear through time. See notes below.

t_max

The number of years the projection runs for. The default value is 100. However, this argument is ignored if an array is used for the effort argument. See notes below.

dt

Time step of the solver. The default value is 0.1.

t_save

The frequency with which the output is stored. The default value is 1. Must be an integer multiple of dt.

t_start

The the year of the start of the simulation. The simulation will cover the period from t_start to t_start + t_max. Defaults to 0. Ignored if an array is used for the effort argument or a MizerSim for the object argument.

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. Ignored if the object argument is a MizerSim object, but overrules the initial_n slot if object is a MizerParams object.

initial_n_pp

The initial abundances of plankton. A numeric vector. Ignored if the object argument is a MizerSim object, but overrules the initial_n_pp slot if object is a MizerParams object.

initial_n_other

The initial abundances of the other dynamical ecosystem components. It should be a named list with one entry for each component. Ignored if the object argument is a MizerSim object, but overrules the initial_n_other slot if object is a MizerParams object.

append

A boolean that determines whether the new simulation results are appended to the previous ones. Only relevant if object is a MizerSim object. Default = TRUE.

progress_bar

Either a boolean value to determine whether a progress bar should be shown in the console of a shiny progress object to implement a progress bar in a shiny app

...

Currently unused.

Value

An object of class MizerSim.

Note

The effort argument specifies the level of fishing effort during the simulation. If it is not supplied, the initial effort stored in the params object is used. The effort can be specified in three different ways:

  • A single numeric value. This specifies the effort of all fishing gears which is constant through time (i.e. all the gears have the same constant effort).

  • A numerical vector which has the same length as the number of fishing gears. The vector must be named and the names must correspond to the gear names in the MizerParams object. The values in the vector specify the constant fishing effort of each of the fishing gears, i.e. the effort is constant through time but each gear may have a different fishing effort.

  • A numerical array with dimensions time x gear. This specifies the fishing effort of each gear at each time step. The first dimension, time, must be named numerically and contiguously. The second dimension of the array must be named and the names must correspond to the gear names in the MizerParams argument. The value for the effort for a particular time is used during the interval from that time to the next time in the array.

If effort is specified as an array then the smallest time in the array is used as the initial time for the simulation. Otherwise the initial time is set to the final time of the previous simulation if object is a MizerSim object or to t_start otherwise. Also, if the effort is an array then the t_max argument is ignored and the maximum simulation time is the largest time of the effort array.

If the object argument is of class MizerSim then the initial values for the simulation are taken from the final values in the MizerSim object and the corresponding arguments to this function will be ignored.

See also

Examples

if (FALSE) { # Data set with different fishing gears data(NS_species_params_gears) data(inter) params <- newMultispeciesParams(NS_species_params_gears, inter) # With constant fishing effort for all gears for 20 time steps sim <- project(params, t_max = 20, effort = 0.5) # With constant fishing effort which is different for each gear effort <- c(Industrial = 0, Pelagic = 1, Beam = 0.5, Otter = 0.5) sim <- project(params, t_max = 20, effort = effort) # With fishing effort that varies through time for each gear gear_names <- c("Industrial","Pelagic","Beam","Otter") times <- seq(from = 1, to = 10, by = 1) effort_array <- array(NA, dim = c(length(times), length(gear_names)), dimnames = list(time = times, gear = gear_names)) effort_array[,"Industrial"] <- 0.5 effort_array[,"Pelagic"] <- seq(from = 1, to = 2, length = length(times)) effort_array[,"Beam"] <- seq(from = 1, to = 0, length = length(times)) effort_array[,"Otter"] <- seq(from = 1, to = 0.5, length = length(times)) sim <- project(params, effort = effort_array) }