The core population object in marlin. Stores all life-history parameters,
spatial structure, and state variables for an age-structured fish
population on a 2-D grid. Instances are created via
create_critter; users rarely need to call Fish$new()
directly.
Details
Key public fields (after initialisation)
n_p_a_0Matrix
[patches, ages]of numbers at unfished equilibrium. Used asinitial_conditionsinsimmar.ssb0Unfished spawning stock biomass (summed across patches and ages). Reference point for depletion calculations.
b0Unfished total biomass.
b0_pVector of unfished biomass per patch.
movement_matrixList of sparse transition matrices (one per season block), each
[patches, patches], column-stochastic. Built from the diffusion-taxis process during initialisation.length_at_ageNumeric vector of mean length at each age class, computed from the growth model.
sel_at_ageDefault selectivity at age (used only as a reference; actual selectivity is set per-metier).
agesNumeric vector of age classes.
resolutionInteger vector
c(nx, ny).patchesTotal number of patches (
nx * ny).time_stepFraction of a year per time step (
1 / seasons).depletionTarget B/B0 at the start of the simulation.
init_expltInitial exploitation rate.
sigma_recStandard deviation of log recruitment deviates.
ac_recFirst-order autocorrelation of log recruitment deviates.
gridData frame with
x,y, andpatch_areacolumns defining the spatial grid.
Methods
Fish$new()
Used to store parameters describing the behavior of an object of class Fish
Usage
Fish$new(
common_name = NULL,
scientific_name = NULL,
linf = NA,
vbk = NA,
t0 = -0.5,
cv_len = 0.1,
l0 = 18.85,
rmax = 37.24,
k = 0.89,
t50 = 4.57,
length_a = 0.1,
length_b = 3,
length_units = "cm",
length_bin_width = 1,
growth_model = "von_bertalanffy",
min_age = NA,
max_age = NA,
weight_a = NA,
weight_b = NA,
pups = 10,
weight_units = "kg",
fec_form = "weight",
fec_expo = 1,
fec_at_age = NULL,
length_50_mature = NA,
length_95_mature = NULL,
delta_mature = 0.1,
age_50_mature = NULL,
age_95_mature = NULL,
age_mature = NA,
semelparous = FALSE,
m = NA,
m_at_age = NULL,
steepness = 0.8,
r0 = 10000,
ssb0 = NA,
b0 = NA,
popsize_measure = "b0",
density_dependence = "global_habitat",
adult_diffusion = 4,
recruit_diffusion = 10,
adult_home_range = NULL,
recruit_home_range = NULL,
query_fishlife = TRUE,
sigma_rec = 0,
ac_rec = 0,
cores = 4,
mat_mode = "age",
default_wb = 2.8,
tune_weight = FALSE,
linf_buffer = 1.2,
resolution = NULL,
patch_area = 1,
habitat = list(),
season_blocks = list(),
recruit_habitat = NULL,
depletion = 1,
burn_years = 50,
seasons = 1,
explt_type = "f",
init_explt = 0.1,
get_common_name = FALSE,
spawning_seasons = NULL,
max_hab_mult = 2,
lorenzen_m = TRUE,
lorenzen_c = -1,
lorenzen_ref_age = NA
)Arguments
common_namecommon name of the species (can be used to lookup information using
taxizeandfishlife)scientific_namecommon name of the species (can be used to lookup information in
fishlife)linfasymptotic length of the species in a von Bertalanffy growth function
vbkgrowth parameter k of the species in a von Bertalanffy growth function
t0hypothetical age at which the fish would have length 0 (e.g. -0.5 years)
cv_lencoefficient of variation around the length at age relationship (in log space)
l0length at age 0 in growth cessation model
rmaxrelated to maximum growth rate in growth cessation model
ksteepness of the logistic function in the growth cessation model >=0
t50age at the logistic function midpoint in the growth cessation model
length_aa coefficient in power function growth
length_bb power coefficient in power function growth
length_unitsunits of the length at age function (arbitrary)
length_bin_widththe width of the length bins in the length-at-age key, defaults to 1cm
growth_modelone of "von_bertalanffy" or "power"
min_ageminimum (youngest) age tracked in the model. Defaults to
NA, in which case it is set to one time step (1 / seasons). Because recruits are deposited at the youngest age after the population has been aged, the youngest cohort is already one time step removed from the spawning pool, so the model does not represent age 0 ("at birth"); starting at one time step is more consistent with this and keeps the (extrapolated) age-0 natural mortality out of the model. Set to0to recover the previous behavior.max_agemaximum age tracked by the model (individuals this age or older are tracked in the plus group)
weight_aalpha parameter in the allometric weight function alpha x length ^ beta
weight_bbeta parameter in the allometric weight function alpha x length ^ beta
pupsnumber of pups per individual for animals with pups rather than larvae
weight_unitsunits of the allometric weight function (defaults to kg)
fec_formone of of "weight" (default) or "pups". When "weight", fecundity is a function of weight. When "pups", constant number of pups per individual produced
fec_expoexponent for fecundity at weight relationship, 1 = isometric > 1 hyperallometric
fec_at_agemanual vector of fecundity at age
length_50_maturelength at 50% maturity in a logistic maturity ogive
length_95_maturelength at 95% maturity in a logistic maturity ogive
delta_matureas an alternative, the different in units of length between length_50_mature and length_95_mature
age_50_matureage at 50% maturity in a logistic maturity ogive if maturity is age based
age_95_matureage at 95% maturity in a logistic maturity ogive if maturity is age based
age_maturean alternative option to just set one age mature, which ends up as the age_50_mature
semelparousTRUE or FALSE. When FALSE (default), individuals can reproduce multiple times. When TRUE, individuals can only spawn once, so mortality at increase increases as a function of maturity at age
minstantaneous natural mortality rate. When
lorenzen_m = TRUE, this is the average natural mortality across ages fromlorenzen_ref_age(which defaults to the age at maturity) to the maximum age, i.e. the literature value is interpreted as an average adult ratem_at_agea vector of natural mortality age at age in case manually specified
steepnesssteepness parameter (h) in a Beverton-Holt spawner-recruit function
r0asymptotic number of recruits under unfished conditions
ssb0asymptotic spawning stock biomass of recruits under unfished conditions. Tunnes r0 to achieve
b0desired level of unfished biomass
popsize_measurewhether unfished population size should be set based on biomass or spawning stock biomass
density_dependencetiming and nature of density dependence in the Beverton-Holt spawner recruit function, one of one of 'global_habitat','local_habitat','pre_dispersal','post_dispersal','global_ssb'. When 'global_habitat' density dependence is a function of the total spawning biomass across all patches, and recruits are then distributed proportional to recruit habitat quality. When 'local_habitat' density dependence is a function of the spawning biomass in each patch, and recruits are then distributed proportional to recruit habitat quality. When 'pre_dispersal', density dependence is a function of the spawning biomass in each patch, and recruits are then distributed from their home patch based on the
recruit_home_range. When 'post_dispersal', larvae are distributed from their home patch based onrecruit_home_range, and then density dependence happens based on spawning biomass in the settling patches. When 'global_ssb', density dependence is a function of the total spawning biomass and recruits are then distributed in space proportional to spawning biomass.adult_diffusiondiffusion parameter D in the CTMC movement function for "adults" (not recruits). Deprecated, best to use
adult_home_rangerecruit_diffusiondiffusion parameter D in the CTMC movement function for recruits. Deprecated, best to use
recruit_home_rangeadult_home_rangethe desired home range of adults. Overrides adult_diffusion if set
recruit_home_rangethe desired home range of recruits Overrides recruit_diffusion if set
query_fishlifeTRUE or FALSE to query
Fishlifefor missing life history values. When set to FALSE all required life history values must be supplied by the usersigma_recthe standard deviation of recruitment deviates in log-normal space
ac_recthe autocorrelation of recruitment deviates
coresthe number of cores used to tun the weight relationship if used (deprecated)
mat_modespecifies whether maturity is a function of age (default) or length
default_wbdeprecated
tune_weightdeprecated
linf_buffermultiplier around linf to create length at age key, taking into account that some fish will be larger than Linf
resolutiona vector of length two with number of patches in X and Y dimensions
patch_areaarea of each patch (e.g. KM2). Either a scaler, a matrix, or a vector. If vector must be in correct patch order (arrange(x,y))
habitata matrix with dimensions X and Y specifying quality of adult (non-recruit) habitat. Determines taxis matrix
season_blockslist with elements indicating blocks of seasons. For example, if there are four seasons, setting
season_blocks = list(c(1,2),c(3,4))indicates that seasons 1 and 2 are one block, 3 and 4 another. Allows for the model to be run at fine time scales while allowing some processes like movement or spawning to operate at coarser scalesrecruit_habitata matrix with dimensions X and Y with quality of recruit habitat (scales r0 in space as well as recruit diffusion under applicable forms of density dependence)
depletiondepletion (SSB/SSB0) under initial fished conditions
burn_yearsnumber of years used to burn in the population to tune parameters without analytical solutions like SSB0
seasonsnumber of seasons per year. 4 would indicate quarterly time steps, 12 monthly, 365 daily.
explt_typedeprecated plot object of class fish
init_expltinstantaneous fishing mortality rate under initial fished conditions
get_common_nameTRUE or FALSE to lookup common name from scientific name. Requires internet connection
spawning_seasonsseasons in which spawning occurs
max_hab_multmaximum value of that habitat matrix multiplier (to prevent some habitats from being >>> good, defaults to 2)
lorenzen_mTRUE or FALSE to use the Lorenzen function to calculate natural mortality at age
lorenzen_cthe rate of the Lorenzen curve. Defaults to -1, larger values will make the difference between natural mortality at young vs old ages less pronounced
lorenzen_ref_agelower age bound of the range over which the mean Lorenzen natural mortality is set equal to
m. The range always runs from this age to the maximum age. Defaults toNA, in which case the age at maturity is used. Analogous to the age-range Lorenzen option in Stock Synthesis (see Powers 2014, ICES J. Mar. Sci. 71:1629)
Fish$plot()
Returns
a plot of the life history values plot diffusion
Shows the realized dispersal after one year, starting from a single individual in the center patch. Post-recruit and recruit dispersal are drawn as two separate panels, each with its own color scale floored at 0, so the post-recruit panel renders consistently across critters regardless of how recruit dispersal differs.
Fish$swim()
Usage
Fish$swim(
burn_steps = 0,
season = 1,
f_p_a = NULL,
last_n_p_a = NULL,
adult_movement = NULL,
tune_unfished = 0,
rec_devs = NA,
move_fish = 1
)Arguments
burn_stepsnumber of steps for burn in period if applicable
seasonthe current season
f_p_amatrix of fishing mortality by patch and age
last_n_p_amatrix of initial numbers by patch and age
adult_movementthe adult movement matrix
tune_unfishedboolean indicating whether to tune unfished
rec_devsexternally supplied recruitment deviates
move_fish1 means fish move, 0 means they do not. Only set to 0 when running exploratory fishing