View source: R/setInteraction.R
setInteraction | R Documentation |
Set species interaction matrix
setInteraction(params, interaction = NULL)
interaction_matrix(params)
interaction_matrix(params) <- value
params |
MizerParams object |
interaction |
Optional interaction matrix of the species (predator species x prey species). By default all entries are 1. See "Setting interaction matrix" section below. |
value |
An interaction matrix |
setInteraction
: A MizerParams object with updated interaction
matrix
interaction_matrix()
: The interaction matrix (predator species x
prey species)
You do not need to specify an interaction matrix. If you do not, then the predator-prey interactions are purely determined by the size of predator and prey and totally independent of the species of predator and prey.
The interaction matrix \theta_{ij}
modifies the interaction of each
pair of species in the model. This can be used for example to allow for
different spatial overlap among the species.
The values in the interaction matrix are used to scale the encountered food
and predation mortality (see on the website the section on predator-prey encounter rate
and on predation mortality).
The first index refers to the predator species and the second to the prey
species.
The interaction matrix is used when calculating the food encounter rate in
getEncounter()
and the predation mortality rate in getPredMort()
. Its
entries are dimensionless numbers. If all the values in the interaction
matrix are equal then predator-prey interactions are determined entirely by
size-preference.
This function checks that the supplied interaction matrix is valid and then
stores it in the interaction
slot of the params
object.
The order of the columns and rows of the interaction
argument should be
the same as the order in the species params data frame in the params
object. If you supply a named array then the function will check the order
and warn if it is different. One way of creating your own interaction
matrix is to enter the data using a spreadsheet program and saving it as a
.csv file. The data can then be read into R using the command read.csv()
.
The interaction of the species with the resource are set via a column
interaction_resource
in the species_params
data frame. By default this
column is set to all 1s.
Other functions for setting parameters:
gear_params()
,
setExtEncounter()
,
setExtMort()
,
setFishing()
,
setInitialValues()
,
setMaxIntakeRate()
,
setMetabolicRate()
,
setParams()
,
setPredKernel()
,
setReproduction()
,
setSearchVolume()
,
species_params()
params <- newTraitParams(no_sp = 3)
inter <- getInteraction(params)
inter[1, 2:3] <- 0
params <- setInteraction(params, interaction = inter)
getInteraction(params)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.