Public Documentation
Documentation for BioEnergeticFoodWebs
's public (exported) interface.
See Internal Documentation for documentation on internal functions.
Contents
Index
BioEnergeticFoodWebs.foodweb_evenness
BioEnergeticFoodWebs.nichemodel
BioEnergeticFoodWebs.population_biomass
BioEnergeticFoodWebs.population_stability
BioEnergeticFoodWebs.simulate
BioEnergeticFoodWebs.species_persistence
BioEnergeticFoodWebs.species_richness
BioEnergeticFoodWebs.total_biomass
Setting up simulations
Missing docstring for model_parameters
. Check Documenter's build log for details.
Generating networks
BioEnergeticFoodWebs.nichemodel
— FunctionNiche model of food webs
Takes a number of species S
and a number of interactions L
, and returns a food web with predators in rows, and preys in columns. This function is used internally by nichemodel
called with a connectance.
Niche model of food webs
Takes a number of species S
and a connectance C
, and returns a food web with predators in rows, and preys in columns. Note that the connectance is first transformed into an integer number of interactions.
This function has two keyword arguments:
tolerance
is the allowed error on tolerance (see below)toltype
is the type or error, and can be:abs
(absolute) and:rel
(relative). Relative tolerance is the amount of error allowed, relative to the desired connectance value. If the simulated network has a tolerance x, the target connectance is c, then the relative error is |1-x/c|.
Simulating and saving the output
BioEnergeticFoodWebs.simulate
— FunctionMain simulation loop
simulate(parameters, biomass; start::Int64=0, stop::Int64=500, use::Symbol=:stiff)
This function takes two mandatory arguments:
p
is aDict
as returned bymake_parameters
biomass
is anArray{Float64, 1}
with the initial biomasses of every species
Internally, the function will check that the length of biomass
matches with the size of the network.
In addition, the function takes three optional arguments:
start
(defaults to 0), the initial timestop
(defaults to 500), the final timeuse
(defaults to:stiff
), a hint to select the solver
The integration method is, by default, :stiff
, and can be changed to :nonstiff
. This is because internally, this function used the DifferentialEquations
package to pick the most appropriate algorithm.
The simulate
function returns a Dict{Symbol, Any}
, with three top-level keys:
:p
, the parameters that were given as input:t
, the timesteps:B
, anArray{Float64, 2}
with the biomasses
The array of biomasses has one row for each timestep, and one column for each species.
Missing docstring for BioEnergeticFoodWebs.save
. Check Documenter's build log for details.
Analysis of output
BioEnergeticFoodWebs.population_stability
— FunctionPopulation stability
Population stability is measured as the mean of the negative coefficient of variations of all species with an abundance higher than threshold
. By default, the stability is measured over the last last=1000
timesteps.
BioEnergeticFoodWebs.total_biomass
— FunctionTotal biomass
Returns the sum of biomass, averaged over the last last
timesteps.
BioEnergeticFoodWebs.population_biomass
— FunctionPer species biomass
Returns the average biomass of all species, over the last last
timesteps.
BioEnergeticFoodWebs.foodweb_evenness
— FunctionFood web diversity
Based on the average of Shannon's entropy (corrected for the number of species) over the last last
timesteps. Values close to 1 indicate that all populations have equal biomasses.
BioEnergeticFoodWebs.species_richness
— FunctionNumber of surviving species
Number of species with a biomass larger than the threshold
. The threshold is by default set at eps()
, which should be close to 10^-16.
BioEnergeticFoodWebs.species_persistence
— FunctionProportion of surviving species
Proportion of species with a biomass larger than the threshold
. The threshold is by default set at eps()
, which should be close to 10^-16.