Learn R Programming

mizer (version 2.0.0)

getFeedingLevel: Get feeding level

Description

Returns the feeding level. By default this function uses the function mizerFeedingLevel() to calculate the feeding level, but this can be overruled via setRateFunction().

Usage

getFeedingLevel(object, n, n_pp, n_other, encounter, time_range, drop = FALSE)

Arguments

object

A MizerParams object or a MizerSim object

n

A matrix of species abundances (species x size).

n_pp

A vector of the resource abundance by size

n_other

A list of abundances for other dynamical components of the ecosystem

encounter

The encounter rate matrix (optional) of dimension no. species x no. size bins. If not passed in, it is calculated internally using getEncounter(). Only used if object argument is of type MizerParams.

time_range

The time_range can be character or numeric.

drop

If TRUE then any dimension of length 1 will be removed from the returned array.

Value

If a MizerParams object is passed in, the function returns a two dimensional array (predator species x predator size) based on the abundances also passed in. If a MizerSim object is passed in, the function returns a three dimensional array (time step x predator species x predator size) with the feeding level calculated at every time step in the simulation. If drop = TRUE then the dimension of length 1 will be removed from the returned array.

Feeding level

The feeding level \(f_i(w)\) is the proportion of its maximum intake rate at which the predator is actually taking in fish. It is calculated from the encounter rate \(E_i\) and the maximum intake rate \(h_i(w)\) as $$f_i(w) = \frac{E_i(w)}{E_i(w)+h_i(w)}.$$ The encounter rate \(E_i\) is passed as an argument or calculated with getEncounter(). The maximum intake rate \(h_i(w)\) is taken from the params object, and is set with setMaxIntakeRate(). As a consequence of the above expression for the feeding level, \(1-f_i(w)\) is the proportion of the food available to it that the predator actually consumes.

The feeding level is used in mizerEReproAndGrowth() and in mizerPredRate().

See Also

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

Examples

Run this code
# NOT RUN {
params <- newMultispeciesParams(NS_species_params_gears, inter)
# With constant fishing effort for all gears for 20 time steps
sim <- project(params, t_max = 20, effort = 0.5)
# Get the feeding level at one time step
n <- sim@n[21,,]
n_pp <- sim@n_pp[21,]
fl <- getFeedingLevel(params,n,n_pp)
# Get the feeding level at all saved time steps
fl <- getFeedingLevel(sim)
# Get the feeding level for time 15 - 20
fl <- getFeedingLevel(sim, time_range = c(15,20))
# }

Run the code above in your browser using DataLab