Learn R Programming

mizer (version 3.0.0)

getFeedingLevel: Get feeding level

Description

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

Usage

getFeedingLevel(object, ...)

Value

  • MizerParams: An ArraySpeciesBySize object (predator species x predator size) with the feeding level.

  • MizerSim: An ArrayTimeBySpeciesBySize object (time step x predator species x predator size) with the feeding level at every time step. If drop = TRUE then dimensions of length 1 will be removed.

Arguments

object

A MizerParams or MizerSim object.

...

Additional arguments that depend on the class of object.

For a MizerParams object:

n

A matrix of species abundances (species x size). Defaults to the initial abundances stored in object.

n_pp

A vector of the resource abundance by size. Defaults to the initial resource abundance stored in object.

n_other

A named list of the abundances of other dynamical components. Defaults to the initial values stored in object.

t

The time for which to do the calculation. Defaults to 0.

For a MizerSim object:

time_range

The time range over which to return the rates. Either a vector of values, a vector of min and max time, or a single value. Defaults to the whole time range of the simulation.

drop

If TRUE then any dimension of length 1 is 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.

Your own feeding level function

By default getFeedingLevel() calls mizerFeedingLevel(). However you can replace this with your own alternative feeding level function. If your function is called "myFeedingLevel" then you register it in a MizerParams object params with

params <- setRateFunction(params, "FeedingLevel", "myFeedingLevel")

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

See Also

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

Examples

Run this code
# \donttest{
params <- NS_params
# Get initial feeding level
fl <- getFeedingLevel(params)
# Project 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 all saved time steps
fl <- getFeedingLevel(sim)
# Get the feeding level for years 15 - 20
fl <- getFeedingLevel(sim, time_range = c(15, 20))
# }

Run the code above in your browser using DataLab