Description Usage Arguments Details Examples
Functions for generating and altering the simulated Community. Function Init_Community
initializes a simulation.
Function bdm
runs one interaction of a Gillespie Algorithm of birth death and migration process in
a system of generalized Lotka-Volterra system of competing species
Function abundance
returns the current abundance vector for the community.
Function elapsed_time
returns the current simulation time for the community.
Function trajectories
returns a data frame in which each line corresponds to the species abundance
distribution at a different time.
1 2 3 4 5 6 7 8 9 10 | Init_Community(abundance, interaction, K = 1000, b = 1, m = 0.1, d0 = 0,
save.int = 1)
bdm(count = 1, progress = "text")
abundance()
elapsed_time()
trajectories()
|
abundance |
vector of initial abundances of species in the community (set species not present to zero). For convenience, a single number is expanded as |
interaction |
matrix of interaction coefficients, see |
K |
carrying capacities of each species |
b |
birth rates (constant) |
m |
per capita migration rate in the metacommunity. May be the given as the
resulting list of the |
d0 |
death rate when N=0 |
save.int |
History saving interval (in simulated time units) |
count |
Number of cycles to be simulated |
progress |
Should a text bar be used? Currently, "text" will produce a text based bar, and |
Because of the way the interaction with the underlying c++ code is implemented, only one
community may be simulated at a time. Calling Init_Community
more than once will
overwrite the previous simulation objects!
1 2 3 4 5 6 7 8 9 10 11 12 13 | # Initializes the community (in a global object)
Init_Community(100)
# Runs 1e6 iteractions of the birth-death-migration process
bdm(1e6)
# Gets and analyzes the abundance vector
(ab <- as.numeric(abundance()))
require(sads)
f <- sads::fitlnorm(ab[ab>0])
plot(f, which=1)
# Simulation internal time elapsed
elapsed_time()
# History saves a line for each time period elapsed (starting with 0):
dim(trajectories())
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.