You will usually not need to call this function directly. Instead change
the gamma and q species parameters with given_species_params(params) <-
and let mizer recalculate the search volume for you. Call setSearchVolume()
directly only if you want to impose a different functional form for the size
dependence of the search volume. See vignette("guide-change-parameters")
for a full explanation of when to reach for which level of the model.
Usage
setSearchVolume(params, search_vol = NULL, reset = FALSE, ..., species = NULL)
search_vol(params)
search_vol(params, species = NULL) <- valueArguments
- params
MizerParams
- search_vol
Optional. An array (species x size) holding the search volume for each species at size. If not supplied, a default is set as described in the section "Setting search volume".
- reset
If set to TRUE, then the search volume will be reset to the value calculated from the species parameters, even if it was previously overwritten with a custom value. If set to FALSE (default) then a recalculation takes place for species without a custom value.
- ...
Unused
- species
Optional character vector of species to override or reset. Omit to override or reset the whole array. Values may be full arrays or arrays containing only the selected species. For a single species its values without the species dimension are also accepted: a vector, or a gear x size matrix for the selectivity. Other species keep their existing override status. See
rate_overrides()to inspect overrides.- value
search_vol
Value
setSearchVolume(): A MizerParams object with updated search volume.
search_vol(): An ArraySpeciesBySize object (species x size)
holding the search volume.
Setting search volume
The search volume \(\gamma_i(w)\) of an individual of species \(i\)
and weight \(w\) multiplies the predation kernel when
calculating the encounter rate in getEncounter() and the
predation rate in getPredRate().
The name "search volume" is a bit misleading, because \(\gamma_i(w)\) does not have units of volume. It is simply a parameter that determines the rate of predation. Its units depend on your choice, see section "Units in mizer". If you have chosen to work with total abundances, then it is a rate with units 1/year. If you have chosen to work with abundances per m^2 then it has units of m^2/year. If you have chosen to work with abundances per m^3 then it has units of m^3/year.
If the search_vol argument is not supplied, then the search volume is
set to
$$\gamma_i(w) = \gamma_i w^q_i.$$
The values of \(\gamma_i\) (the search volume at 1g) and \(q_i\) (the
allometric exponent of the search volume) are taken from the gamma and
q columns in the species parameter dataframe. If the gamma
column is not supplied in the species parameter dataframe, a default is
calculated by the get_gamma_default() function. If the q column is not
supplied, a default of lambda - 2 + n is used. Note that only
for predators of size \(w = 1\) gram is the value of the species parameter
\(\gamma_i\) the same as the value of the search volume \(\gamma_i(w)\).
With reset = FALSE, manually overridden species are preserved while the
other species are recalculated. A message is issued if recalculation would
change protected values. See rate_overrides() to inspect overrides.
See also
Other functions for setting parameters:
gear_params(),
rate_overrides(),
setExtDiffusion(),
setExtEncounter(),
setExtMort(),
setFishing(),
setInteraction(),
setMaxIntakeRate(),
setMetabolicRate(),
setParams(),
setPredKernel(),
setReproduction(),
species_params(),
use_predation_diffusion()
Examples
# Inspect the current search volume
search_vol(NS_params)["Cod", 1:5]
#> 0.001 0.00119 0.00142 0.0017 0.00203
#> 6.365796e-13 7.332810e-13 8.446721e-13 9.729844e-13 1.120788e-12
# Double the search volume for all species
sv <- search_vol(NS_params) * 2
params <- setSearchVolume(NS_params, search_vol = sv)
search_vol(params)["Cod", 1:5]
#> 0.001 0.00119 0.00142 0.0017 0.00203
#> 1.273159e-12 1.466562e-12 1.689344e-12 1.945969e-12 2.241577e-12
