community: Main simulation function

Description Usage Arguments Examples

Description

Runs a simulation with any number of structured populations, for a limited time. See the vignette for a detailed explanation of each parameter and use cases.

Usage

1
2
3
4
community(maxtime, numstages, parameters, init, interactionsD, interactionsG,
  interactionsR, height = 100, width = 100, boundary = c("reflexive",
  "absorptive", "periodic"), dispKernel = c("exponential", "random"),
  starttime = 0, maxpop = 30000, maxid = 0)

Arguments

maxtime

How long the simulation must run

numstages

Array of number of stages for each population

parameters

Data.frame or matrix with one row for each stage. Columns: D, G, R, dispersal distance, radius (optional), maxstressefect (optional). See create.parameters

init

Either an array of initial numbers for each stage of each population, or a data.frame with the history of a simulation

interactionsD

Optional. A square matrix of effects of life stages over each other, where element [i,j] is the effect of stage i over stage j. Positive values equal facilitation, negative ones, competition. The interactions occur only if the affected individual is within the affecting individual's radius, and are additive. Affects death rates (is subtracted from D).

interactionsG

Same as above, but affecting growth rates (is added to G).

interactionsR

Same as above, but affecting reproduction rates (is added to R) .

height

Arena height

width

Arena width

boundary

Type of boundary condition. Options are "reflexive", "absorptive" and "periodic". Default is reflexive.

dispKernel

Type of dispersion kernel. Options are "exponential" and "random", in which seeds are dispersed randomly regardless of parent position (note: "random" option ignores dispersal parameter)

starttime

Use for proceeding simulations. Time when simulation begins.

maxpop

If the simulation reaches this many individuals total, it will stop. Default is 30000.

maxid

Use for proceeding simulations. Maximum id used by the current simulation. Should probably never be set explicitly.

Examples

1
2
3
4
5
param <- data.frame(D=c(2,1,2,1),G=c(2,0,2,0),R=c(0,3,0,3),dispersal=c(0,2,0,20))
malth <- community(2,c(2,2),param,init=c(10,10,10,10))
ab <- abundance.matrix(malth)
stackplot(ab[,1:2]) # species 1
stackplot(ab[,3:4]) # species 2

Lobz/facilitation documentation built on May 7, 2019, 2:01 p.m.