init_pop: Initialise populations

View source: R/init_pop.R

init_popR Documentation

Initialise populations

Description

init_pop sets up the populations spatial distribution based on the habitat preference, starting cell and 'n' numbers of movements for all populations in the simulation.

Usage

init_pop(
  sim_init = sim_init,
  Bio = NULL,
  hab = NULL,
  start_cell = NULL,
  lambda = NULL,
  init_move_steps = 10,
  rec_params = NULL,
  rec_wk = NULL,
  spwn_wk = NULL,
  M = NULL,
  K = NULL,
  cores = 3
)

Arguments

Bio

is a named Numeric vector of the starting (total) biomass for each of the populations.

hab

is the list of Matrices with the habitat preferences created by create_hab

start_cell

is a list of Numeric vectors with the starting cells for the populations

lambda

is the strength that the movement distance decays at in the move_prob function

init_move_steps

is a Numeric indicating the number of movements to initialise for the population distributions

rec_params

is a list with an element for each population, containing a vector of the stock recruit parameters which must contain model, a, b and cv. See Recr for details.

rec_wk

is a list with an element for each population, containing a vector of the weeks in which recruitment takes place for the population

spwn_wk

is a list with an element for each population, containing a vector of the weeks in which spawning takes place for the population

M

is a named vector, with the annual natural mortality rate for each population

K

is a named vector, with the annual growth rate for each population

spawn_areas

is a list of lists, with the first level the population ("spp1" etc..) and the second the boundary coordinates (x1, x2, y1, y2) for the create_spawn_hab function

Value

The function returns the recording vectors at the population level, the spatial matrices for the starting population densities and the demographic parameters for each population

Examples

init_pop(sim_init = sim_init, Bio = c("spp1" = 1e6, "spp2" = 2e5), hab = list(spp1 = matrix(nc = 10,
runif(10*10)), spp2 = matrix(nc = 10, runif(10*10)), lambda = c("spp1" =
0.2, "spp2" = 0.3), init_move_steps = 10), rec_params = list("spp1" =
c("model" = "BH", "a" = 10, "b" = 50, "cv" = 0.2), "spp2" = c("model" = "BH",
"a" = 1, "b" = 8, "cv" = 0.2)), rec_wk = list("spp1" = 13:16, "spp2" =
13:18), spwn_wk = list("spp1" = 15:18, "spp2" = 18:20),M = c("spp1" = 0.2,
"spp2" = 0.1), K = c("spp1" = 0.3, "spp2" = 0.2))
Note, example will not have the right biomass

pdolder/MixFishSim documentation built on Oct. 17, 2023, 4:25 p.m.