action_grow.Rd
Add growth/maturity actions to a g3 model
g3a_grow_lengthvbsimple(
linf_f = g3_parameterized('Linf', by_stock = by_stock),
kappa_f = g3_parameterized('K', by_stock = by_stock),
by_stock = TRUE)
g3a_grow_weightsimple(
alpha_f = g3_parameterized('walpha', by_stock = by_stock),
beta_f = g3_parameterized('wbeta', by_stock = by_stock),
by_stock = TRUE)
g3a_grow_impl_bbinom(
delta_len_f = g3a_grow_lengthvbsimple(by_stock = by_stock),
delta_wgt_f = g3a_grow_weightsimple(by_stock = by_stock),
beta_f = g3_parameterized('bbin', by_stock = by_stock),
maxlengthgroupgrowth,
by_stock = TRUE)
g3a_grow_length_multspec(
p0 = g3_parameterized('multispec.p0', value = 1, by_stock = by_stock),
p1 = g3_parameterized('multispec.p1', value = 1, by_stock = by_stock),
p2 = g3_parameterized('multispec.p2', value = 1, by_stock = by_stock),
p3 = g3_parameterized('multispec.p3', value = 0, by_stock = by_stock),
temperature = 0,
by_stock = TRUE)
g3a_grow_weight_multspec(
p4 = g3_parameterized('multispec.p4', value = 1, by_stock = by_stock),
p5 = g3_parameterized('multispec.p5', value = 1, by_stock = by_stock),
p6 = g3_parameterized('multispec.p6', value = 0, by_stock = by_stock),
p7 = g3_parameterized('multispec.p7', value = 1, by_stock = by_stock),
p8 = g3_parameterized('multispec.p8', value = 0, by_stock = by_stock),
temperature = 0,
by_stock = TRUE)
g3a_grow_length_weightjones(
p0 = g3_parameterized('weightjones.p0', value = 0, by_stock = by_stock),
p1 = g3_parameterized('weightjones.p1', value = 0, by_stock = by_stock),
p2 = g3_parameterized('weightjones.p2', value = 1, by_stock = by_stock),
p3 = g3_parameterized('weightjones.p3', value = 0, by_stock = by_stock),
p4 = g3_parameterized('weightjones.p4', value = 1, by_stock = by_stock),
p5 = g3_parameterized('weightjones.p5', value = 100, by_stock = by_stock),
p6 = g3_parameterized('weightjones.p6', value = 1, by_stock = by_stock),
p7 = g3_parameterized('weightjones.p7', value = 1, by_stock = by_stock),
reference_weight = 0,
temperature = 0,
by_stock = TRUE)
g3a_grow_weight_weightjones(
q0 = g3_parameterized('weightjones.q0', value = 1, by_stock = by_stock),
q1 = g3_parameterized('weightjones.q1', value = 1, by_stock = by_stock),
q2 = g3_parameterized('weightjones.q2', value = 1, by_stock = by_stock),
q3 = g3_parameterized('weightjones.q3', value = 1, by_stock = by_stock),
q4 = g3_parameterized('weightjones.q4', value = 1, by_stock = by_stock),
q5 = g3_parameterized('weightjones.q5', value = 0, by_stock = by_stock),
max_consumption = g3a_predate_maxconsumption(temperature = temperature),
temperature = 0,
by_stock = TRUE)
g3a_growmature(stock, impl_f, maturity_f = ~0, output_stocks = list(),
output_ratios = rep(1/length(output_stocks), times = length(output_stocks)),
transition_f = ~cur_step_final, run_f = ~TRUE,
run_at = g3_action_order$grow,
transition_at = g3_action_order$mature)
A formula to substitute for \(L_\infty\).
A formula to substitute for \(\kappa\).
A formula to substitute for \(\alpha\).
A formula to substitute for \(\beta\).
A formula to substitute for the equivalent value.
Maximum predator consumption, see g3a_predate_maxconsumption
.
A formula providing values for the current temperature,
likely implemented with g3_timeareadata
.
An integer with the maximum length groups an individual can jump in one step.
Reference weight. see formula for g3a_grow_length_weightjones
.
g3_stock
to grow.
A formula defining a non-negative vector for mean increase in length for stock
for each lengthgroup, as defined by g3a_grow_lengthvbsimple
.
A formula defining the corresponding weight increase as a matrix of
lengthgroup to lengthgroup delta for stock
, as defined by g3a_grow_weightsimple
.
Change the default parameterisation (e.g. to be by 'species'), see g3_parameterized
.
A pair of formula objects, as defined by g3a_grow_impl_bbinom
.
Both define a matrix of length groups i
to length group deltas j
(0..maxlengthgroupgrowth),
the values in the first indicate the proportion of individuals moving from i
to i + j
,
the values in the second indicate the corresponding weight increase of individuals moving from i
to i + j
.
A maturity formula, as defined by g3a_mature_constant
.
List of g3_stock
s that maturing stock should move into.
Vector of proportions for how to distribute into output_stocks, summing to 1, default evenly spread.
formula specifying a contition for running maturation steps as well as growth, default final step of year.
formula specifying a condition for running this action, default always runs.
Integer order that actions will be run within model, see g3_action_order
.
Integer order that transition actions will be run within model, see g3_action_order
.
A model can have any number of g3a_growmature
actions, so long as the
calling arguments are different. For instance, run_f = ~age == 5
and
run_f = ~age == 7
.
impl_f's dependent variables are analysed to see what will affect growth.
If nothing but cur_step_size
will affect growth, then growth will only
be recalculated when the step size changes.
Returns a formula for use as delta_len_f:
$$ {{\Delta}L}_i = ( L_\infty - L_i )(1 - e^{-\kappa{\Delta}t}) $$
Where \( \Delta{t} \) is the length of the current timestep.
Returns a formula for use as delta_wgt_f:
$$ {{\Delta}W}_{i,j} = \alpha ( (L_i + {{\Delta}L}_j)^\beta - {L_i}^\beta ) $$
Where \( \Delta{t} \) is the length of the current timestep,
\( {{\Delta}L} \) is all possible length group increases i.e 0..maxlengthgroupgrowth
.
Returns a formula for use as delta_len_f: $$ {{\Delta}L}_i = {\Delta}t p_0 L_i^{p_1} \psi_i (p_2 T + p_3) $$
Supplied parameters
Length of the current timestep
Current length
Feeding level of stock. See g3a_predate_catchability_predator
Temperature of current region
Returns a formula for use as delta_wgt_f: $$ {{\Delta}W}_{i,j} = {\Delta}t p_4 {W_i}^p_5 (\psi_i - p_6) (p_7 T + p_8) $$
Supplied parameters
Length of the current timestep
Current mean weight
Feeding level of stock. See g3a_predate_catchability_predator
Temperature of current region
Note that the equation is not dependent on the change in length, the value will be the same for each \(j\).
formula object converting mean growths using beta-binomia distribution. See https://gadget-framework.github.io/gadget2/userguide/chap-stock.html#beta-binomial
An action (i.e. list of formula objects) that will, for the given stock...
Move any maturing individuals into temporary storage, stock__transitioning_num
/ stock__transitioning_wgt
Calculate increase in length/weight using growth_f and impl_f
Move the contents of the temporary storage into output_stocks
ling_imm <- g3_stock(c(species = 'ling', 'imm'), seq(20, 156, 4))
ling_mat <- g3_stock(c(species = 'ling', 'mat'), seq(20, 156, 4))
# Growth / maturity for immature ling
growth_action <- g3a_growmature(ling_imm,
impl_f = g3a_grow_impl_bbinom(
# Parameters will be ling.Linf, ling.K
g3a_grow_lengthvbsimple(by_stock = 'species'),
# Parameters will be ling_imm.walpha, ling_imm.wbeta
g3a_grow_weightsimple(),
maxlengthgroupgrowth = 15),
maturity_f = g3a_mature_constant(
alpha = g3_parameterized('ling.mat1', scale = 0.001),
l50 = g3_parameterized('ling.mat2')),
output_stocks = list(ling_mat))
# Multspec growth - define a data frame with temperature
temperature <- g3_timeareadata(
'temp',
data.frame(year = 2000, step=c(1,2), temp=c(10, 14)),
value_field = "temp" )
ms_growth_actions <- list(
g3a_growmature(ling_imm, g3a_grow_impl_bbinom(
g3a_grow_length_multspec(temperature = temperature),
g3a_grow_weight_multspec(temperature = temperature),
maxlengthgroupgrowth = 8 )),
NULL)