Set resource interaction to absorb external encounter rate
Source:R/setResourceInteraction.R
setResourceInteraction.RdThis function sets the resource interaction for each species to absorb as much of the external encounter rate as possible. It adjusts the resource capacity so that the resource can sustain the extra encounter without changing the current resource abundance or the resource level.
Value
The modified mizer params object with increased interaction_resource
species parameters and correspondingly decreased external encounter rate.
Details
If the initial abundances were at steady state, then they will remain at steady state. This is because the total encounter rate is not modified by this function and because the extra mortality on the resource is exactly balanced by the changed resource capacity.
Optionally, you can specify the resource dynamics to use (e.g.,
"resource_semichemostat" or "resource_constant") by setting the
resource_dynamics argument. This allows you to switch between dynamic and
constant resource regimes directly through this function. For example:
params <- setResourceInteraction(params, resource_dynamics = "resource_semichemostat")
will set the resource dynamics to semichemostat.
The amount that a species can absorb is limited by the requirement that the
extra resource encounter rate must not exceed the external encounter rate at
any size, because it is subtracted from the latter. This is imposed with a
tolerance: the extra resource encounter rate may exceed the external
encounter rate by up to tol times the total encounter rate at that size.
Hence the total encounter rate, and with it the steady state, changes by at
most a relative amount tol. Without this tolerance a single size at which
the external encounter rate is exactly zero (as produced by
makeInteracting() when predation on fish already covers the whole intake)
would prevent the species from absorbing anything at all.
Because of this, restricting the resource to small sizes with w_pp_cutoff
helps: it makes the resource encounter rate of large predators negligible
compared to their total encounter rate, so their largest sizes no longer
constrain how much they can absorb at the sizes where they do feed on the
resource.
Note: The function ensures that the resource level passed to setResource() is strictly between 0 and 1, as required by mizer. If any value of resource_level is greater than or equal to 1, it is set to just below 1 (0.99999999). If any value is less than or equal to 0, it is set to a small positive value (1e-8). This prevents errors and ensures biological realism.