setComponent: Add a dynamical ecosystem component

View source: R/extension.R

setComponentR Documentation

Add a dynamical ecosystem component

Description

By default, mizer models any number of size-resolved consumer species and a single size-resolved resource spectrum. Your model may require additional components, like for example detritus or carrion or multiple resources or .... This function allows you to set up such components.

Usage

setComponent(
  params,
  component,
  initial_value,
  dynamics_fun,
  encounter_fun,
  mort_fun,
  component_params
)

removeComponent(params, component)

Arguments

params

A MizerParams object

component

Name of the component

initial_value

Initial value of the component

dynamics_fun

Name of function to calculate value at the next time step

encounter_fun

Name of function to calculate contribution to encounter rate. Optional.

mort_fun

Name of function to calculate contribution to the mortality rate. Optional.

component_params

Object holding the parameters needed by the component functions. This could for example be a named list of parameters. Optional.

Details

The component can be a number, a vector, an array, a list, or any other data structure you like.

If you set a component with a new name, the new component will be added to the existing components. If you set a component with an existing name, that component will be overwritten. You can remove a component with removeComponent().

Value

The updated MizerParams object


mizer documentation built on Oct. 17, 2024, 9:07 a.m.