action_grow {gadget3} | R Documentation |
Gadget3 growth action
Description
Add growth/maturity actions to a g3 model
Usage
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_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)
Arguments
linf_f |
A formula to substitute for |
kappa_f |
A formula to substitute for |
alpha_f |
A formula to substitute for |
beta_f |
A formula to substitute for |
maxlengthgroupgrowth |
An integer with the maximum length groups an individual can jump in one step. |
stock |
|
delta_len_f |
A formula defining a non-negative vector for mean increase in length for |
delta_wgt_f |
A formula defining the corresponding weight increase as a matrix of
lengthgroup to lengthgroup delta for |
by_stock |
Change the default parameterisation (e.g. to be by 'species'), see |
impl_f |
A pair of formula objects, as defined by |
maturity_f |
A maturity formula, as defined by |
output_stocks |
List of |
output_ratios |
Vector of proportions for how to distribute into output_stocks, summing to 1, default evenly spread. |
transition_f |
formula specifying a contition for running maturation steps as well as growth, default final step of year. |
run_f |
formula specifying a condition for running this action, default always runs. |
run_at |
Integer order that actions will be run within model, see |
transition_at |
Integer order that transition actions will be run within model, see |
Details
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.
Value
g3a_grow_lengthvbsimple
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.
g3a_grow_weightsimple
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
.
g3a_grow_impl_bbinom
formula object converting mean growths using beta-binomia distribution. See https://gadget-framework.github.io/gadget2/userguide/chap-stock.html#beta-binomial
g3a_growmature
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
See Also
https://gadget-framework.github.io/gadget2/userguide/chap-stock.html#sec:stockgrowth,
g3_stock
Examples
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))