Public Documentation

Documentation for BioEnergeticFoodWebs's public (exported) interface.

See Internal Documentation for documentation on internal functions.

Contents

Index

Setting up simulations

Missing docstring.

Missing docstring for model_parameters. Check Documenter's build log for details.

Generating networks

BioEnergeticFoodWebs.nichemodelFunction

Niche 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:

  1. tolerance is the allowed error on tolerance (see below)

  2. 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.simulateFunction

Main simulation loop

simulate(parameters, biomass; start::Int64=0, stop::Int64=500, use::Symbol=:stiff)

This function takes two mandatory arguments:

  • p is a Dict as returned by make_parameters
  • biomass is an Array{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 seven optional arguments:

  • start (defaults to 0), the initial time
  • stop (defaults to 500), the final time
  • use (defaults to :stiff), a hint to select the solver
  • cb_interp_points (default to 100), number of interpolation points used to check for an event (extinction)
  • extinction_threshold (default to 1e-6), biomass below which a species is considered as extinct
  • interval_tkeep (default to 0.25), controls the density of the outputs, defaukt behavior is to save outputs at times = [start:interval_tkeep:stop]

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, an Array{Float64, 2} with the biomasses

If a nutient intake model is used for productivity, a C Array is also returned, with the 2 nutrients concentrations through time

The array of biomasses (and nutrients concentrations if applicable) has one row for each timestep, and one column for each species.

Missing docstring.

Missing docstring for BioEnergeticFoodWebs.save. Check Documenter's build log for details.

Analysis of output

BioEnergeticFoodWebs.population_stabilityFunction

Population 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.foodweb_evennessFunction

Food 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_richnessFunction

Number 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_persistenceFunction

Proportion 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.