action_naturalmortality.Rd
Add natural mortality to a g3 model
g3a_naturalmortality_exp(
param_f = g3_parameterized('M', by_stock = by_stock, by_age = TRUE),
by_stock = TRUE,
action_step_size_f = ~cur_step_size)
g3a_naturalmortality(
stock,
mortality_f = g3a_naturalmortality_exp(),
run_f = TRUE,
run_at = g3_action_order$naturalmortality)
A formula to substitute for \(m\).
How much model time passes in between runs of action? defaults to ~cur_step_size
, i.e. every step.
Use action_step_size_f = 1
if action only runs yearly.
Change the default parameterisation (e.g. to be by 'species'), see g3_parameterized
.
g3_stock
mortality applies to.
A mortality formula, as defined by g3a_naturalmortality_exp
.
formula specifying a condition for running this action, default always runs.
Integer order that actions will be run within model, see g3_action_order
.
A model can have any number of g3a_naturalmortality
actions, so long as the
calling arguments are different. For instance, run_f = ~age == 5
and
run_f = ~age == 7
.
ling_imm <- g3_stock('ling_imm', seq(20, 156, 4)) %>% g3s_age(3, 10)
# Natural mortality for immature ling
naturalmortality_action <- g3a_naturalmortality(ling_imm)
# NB: M is used in both g3a_naturalmortality and g3a_renewal_initabund, to
# customise, you need to make sure the definitions are in sync, for example:
M <- g3_parameterized('M', by_stock = TRUE, by_age = FALSE)
actions <- list(
g3a_naturalmortality(ling_imm,
g3a_naturalmortality_exp(M)),
g3a_initialconditions_normalparam(ling_imm,
factor_f = g3a_renewal_initabund(M = M)),
NULL)