Calculates the energy rate $$E_{r.i}(w)$$ (grams/year) available for reproduction and growth after metabolism and movement have been accounted for.

getEReproAndGrowth(
params,
n = initialN(params),
n_pp = initialNResource(params),
n_other = initialNOther(params),
t = 0,
...
)

## Arguments

params A MizerParams object A matrix of species abundances (species x size). A vector of the resource abundance by size A list of abundances for other dynamical components of the ecosystem The time for which to do the calculation (Not used by standard mizer rate functions but useful for extensions with time-dependent parameters.) Unused

## Value

A two dimensional array (species x size) holding $$E_{r.i}(w) = \max(0, \alpha_i\, (1 - {\tt feeding\_level}_i(w))\, {\tt encounter}_i(w) - {\tt metab}_i(w)).$$ Due to the form of the feeding level, calculated by getFeedingLevel(), this can also be expressed as $$E_{r.i}(w) = \max(0, \alpha_i\, {\tt feeding\_level}_i(w)\, h_i(w) - {\tt metab}_i(w))$$ where $$h_i$$ is the maximum intake rate, set with setMaxIntakeRate(). The assimilation rate $$\alpha_i$$ is taken from the species parameter data frame in params. The metabolic rate metab is taken from params and set with setMetabolicRate().

The return value can be negative, which means that the energy intake does not cover the cost of metabolism and movement.

## Your own energy rate function

By default getEReproAndGrowth() calls mizerEReproAndGrowth(). However you can replace this with your own alternative energy rate function. If your function is called "myEReproAndGrowth" then you register it in a MizerParams object params with

params <- setRateFunction(params, "EReproAndGrowth", "myEReproAndGrowth")

Your function will then be called instead of mizerEReproAndGrowth(), with the same arguments.

The part of this energy rate that is invested into growth is calculated with getEGrowth() and the part that is invested into reproduction is calculated with getERepro().

Other rate functions: getEGrowth(), getERepro(), getEncounter(), getFMortGear(), getFMort(), getFeedingLevel(), getMort(), getPredMort(), getPredRate(), getRDD(), getRDI(), getRates(), getResourceMort()

## Examples

if (FALSE) {
params <- newMultispeciesParams(NS_species_params_gears, inter)
# Project with constant fishing effort for all gears for 20 time steps
sim <- project(params, t_max = 20, effort = 0.5)
# Get the energy at a particular time step
getEReproAndGrowth(params, n = N(sim)[15, , ], n_pp = NResource[15, ], t = 15)
}