Sets the intrinsic resource growth rate and the intrinsic resource carrying capacity as well as the name of the function used to simulate the resource dynamics

setResource(
params,
resource_rate = NULL,
resource_capacity = NULL,
reset = FALSE,
r_pp = resource_params(params)[["r_pp"]],
kappa = resource_params(params)[["kappa"]],
lambda = resource_params(params)[["lambda"]],
n = resource_params(params)[["n"]],
w_pp_cutoff = resource_params(params)[["w_pp_cutoff"]],
resource_dynamics = NULL,
...
)

getResourceRate(params)

resource_rate(params)

resource_rate(params) <- value

getResourceCapacity(params)

resource_capacity(params)

resource_capacity(params) <- value

getResourceDynamics(params)

resource_dynamics(params)

resource_dynamics(params) <- value

## Arguments

params A MizerParams object Optional. Vector of resource intrinsic birth rates Optional. Vector of resource intrinsic carrying capacity If set to TRUE, then both resource_rate and resource_capacity will be reset to the value calculated from the resource parameters, even if they were previously overwritten with custom values. If set to FALSE (default) then a recalculation from the resource parameters will take place only if no custom values have been set. Coefficient of the intrinsic resource birth rate Coefficient of the intrinsic resource carrying capacity Scaling exponent of the intrinsic resource carrying capacity Allometric growth exponent for resource The upper cut off size of the resource spectrum. The carrying capacity will be set to 0 above this size. Default is 10 g. Optional. Name of the function that determines the resource dynamics by calculating the resource spectrum at the next time step from the current state. You only need to specify this if you do not want to use the default resource_semichemostat(). Unused .

## Value

setResource: A MizerParams object with updated resource parameters

## Setting resource dynamics

By default, mizer uses a semichemostat model to describe the resource dynamics in each size class independently. This semichemostat dynamics is implemented by the function resource_semichemostat(). You can change the resource dynamics by writing your own function, modelled on resource_semichemostat(), and then passing the name of your function in the resource_dynamics argument.

The resource_rate argument is a vector specifying the intrinsic resource growth rate for each size class. If it is not supplied, then the intrinsic growth rate $$r(w)$$ at size $$w$$ is set to $$r(w) = r_{pp}\, w^{n-1}.$$ The values of $$r_{pp}$$ and $$n$$ are taken from the r_pp and n arguments.

The resource_capacity argument is a vector specifying the intrinsic resource carrying capacity for each size class. If it is not supplied, then the intrinsic carrying capacity $$c(w)$$ at size $$w$$ is set to $$c(w) = \kappa\, w^{-\lambda}$$ for all $$w$$ less than w_pp_cutoff and zero for larger sizes. The values of $$\kappa$$ and $$\lambda$$ are taken from the kappa and lambda arguments.

resource_params()
Other functions for setting parameters: gear_params(), resource_params(), setExtMort(), setFishing(), setInitialValues(), setInteraction(), setMaxIntakeRate(), setMetabolicRate(), setParams(), setPredKernel(), setReproduction(), setSearchVolume(), species_params()