API

EcoSISTEM.AbstractAbioticType
AbstractAbiotic{H <: AbstractHabitat, B <: AbstractBudget} <: AbstractPartition

Abstract supertype for all abiotic environment types and a subtype of AbstractPartition

EcoSISTEM.AbstractEcosystemType
AbstractEcosystem{Part <: AbstractAbiotic, SL <: SpeciesList,
    TR <: AbstractTraitRelationship} <: AbstractMetacommunity{Float64,
        Matrix{Int64}, Matrix{Float64}, SL, Part}

Abstract supertype for all ecosystem types and a subtype of AbstractMetacommunity.

EcoSISTEM.AbstractRequirementType
Abstract1Requirement{Energy}

Abstract supertype for all species energy requirement types, parameterised by the type(s) of energy required Energy.

EcoSISTEM.AbstractTraitsType
AbstractTraits{T}

Abstract supertype for all trait types, parameterised by traits of any type T.

EcoSISTEM.AlwaysMovementType
AlwaysMovement{K <: AbstractKernel, B <: BoundaryCondition} <: AbstractMovement

Movement can happen to any individual ("animal-like").

EcoSISTEM.BirthOnlyMovementType
BirthOnlyMovement{K <: AbstractKernel, B <: BoundaryCondition} <: AbstractMovement

Movement can only happen to individuals that have just been born ("plant-like").

EcoSISTEM.CacheType
Cache

Cache houses an integer array of moves made by all species in a timestep for the update! function, netmigration.

EcoSISTEM.CachedEcosystemType
CachedEcosystem{Part <: AbstractAbiotic, SL <: SpeciesList,
    TR <: AbstractTraitRelationship} <: AbstractEcosystem{Part, SL, TR}

CachedEcosystem houses the same information as Ecosystem (see ?Ecosystem), but holds the time period abundances as a CachedGridLandscape, so that they may be present or missing.

EcoSISTEM.CachedEcosystemMethod
CachedEcosystem(eco::Ecosystem, outputfile::String, rng::StepRangeLen)

Function to create a CachedEcosystem given an existing ecosystem, eco, output folder to which the simulations are saved, outputfile, and a range of times over which to simulate, rng.

EcoSISTEM.CachedGridLandscapeType
CachedGridLandscape

Ecosystem abundances housed in the cached landscape. These are either stored in the matrix or output to a cache.

EcoSISTEM.ContinuousHabType
ContinuousHab{C <: Number} <: AbstractHabitat{C}

This habitat subtype houses a habitat matrix matrix of any units, a grid square size size and HabitatUpdate type change.

EcoSISTEM.ContinuousTimeHabType
ContinuousTimeHab{C <: Number, M <: AbstractArray{C, 3}} <: AbstractHabitat{C}

This habitat subtype houses a habitat matrix matrix of any units, the time slice of the habitat matrix currently being operated on time, a grid square size size and HabitatUpdate type change.

EcoSISTEM.ContinuousTraitType
ContinuousTrait{C <: Number} <: AbstractTraits{T}

Abstract trait type that holds information on a single continuous trait for each species, of any Number type C.

EcoSISTEM.CylinderType
Cylinder <: BoundaryCondition

A cylindrical boundary where species can cross the x boundary but not the y.

EcoSISTEM.DiscreteHabType
DiscreteHab <: AbstractHabitat{String}

This habitat subtype has a matrix of strings and a float grid square size

EcoSISTEM.DiscreteTraitType
BasicTrait{T} <: AbstractTraits{T}

Basic trait type that holds information on a single trait for each species, of any type T.

EcoSISTEM.EcosystemType
Ecosystem{Part <: AbstractAbiotic} <:
   AbstractEcosystem{Part, SL, TR}

Ecosystem houses information on species and their interaction with their environment. For species, it holds abundances and locations, abundances, as well as properties such as trait information, spplist, and movement types, lookup. For environments, it provides information on environmental conditions and available resources,abenv. Finally, there is a slot for the relationship between the environment and the characteristics of the species, relationship.

EcoSISTEM.EcosystemMethod
Ecosystem(spplist::SpeciesList, abenv::GridAbioticEnv,
    rel::AbstractTraitRelationship)

Function to create an Ecosystem given a species list, an abiotic environment and trait relationship. An optional population function can be added, popfun, which defaults to generic random filling of the ecosystem.

EcoSISTEM.EqualPopType
EqualPop <: AbstractParams

Parameter type that holds information on a population's birth and death rates, birth and death, specifically populations where all species have the same information. l represents the longevity of species based on their energy requirements and s is the survival of species dependent on how well their traits reflect the environment. Finally boost is used to manipulate how much of a boost the species get from being in an environment with lots of available energy.

EcoSISTEM.FluctScenarioType
FluctScenario <: AbstractScenario

This scenario type holds a function that acts to fluctuate the environment.

EcoSISTEM.GaussType
Gauss{TR} <: AbstractTraitRelationship{TR}

The Gaussian relationship between a continuous trait and its environment, paramaterised on any TR.

EcoSISTEM.GaussTraitType
GaussTrait{C <: Number} <: ContinuousTrait{C}

Trait type that holds Gaussian mean and variance trait information for each species, of any number type C.

EcoSISTEM.GaussianKernelType
GaussianKernel <: AbstractKernel

GaussianMovement holds parameters for a gaussian movement kernel; a dispersal variance for a species, var, and a threshold, thresh, beyond which dispersal cannot take place.

EcoSISTEM.GridAbioticEnvType
GridAbioticEnv{H, B} <: AbstractAbiotic{H, B}

This abiotic environment type holds a habitat and budget, as well as a string of subcommunity names.

EcoSISTEM.GridLandscapeType
GridLandscape

Ecosystem abundances housed in the landscape. These are represented in both 2 dimensions (for computational efficiency in simulations) and 3 dimensions (to represent species, their abundances and position in the grid).

EcoSISTEM.LongTailKernelType
LongTailKernel <: AbstractKernel

LongTailKernel holds parameters for a movement kernel; a dispersal variance for a species, var, and a threshold, thresh, beyond which dispersal cannot take place.

EcoSISTEM.LookupType
Lookup

Lookup houses information on x, y grid locations and the probability of occurrence at the location for the species in question p. pnew and moves are initially empty storage and written over by the movement step in update!(). pnew is the recalculated probability based on which directions are available and moves is the number of moves to that grid location in that step.

EcoSISTEM.MatchType
Match{TR} <: AbstractTraitRelationship{TR}

The relationship between a discrete trait and its environment, paramaterised on any TR. Current conditions are matched to a trait preference and checked for a match.

EcoSISTEM.MultiScenarioType
MultiScenario{S1 <: AbstractScenario, S2 <: AbstractScenario} <: AbstractScenario

This scenario type holds multiple different scenario types.

EcoSISTEM.NoBoundaryType
NoBoundary <: BoundaryCondition

A hard boundary where no species can cross.

EcoSISTEM.NoMovementType
NoMovement{K <: AbstractKernel, B <: BoundaryCondition} <: AbstractMovement

No movement can take place.

EcoSISTEM.NoRelContinuousType
NoRelContinuous{TR} <: AbstractTraitRelationship{TR}

The absense of a relationship between a continuous trait and its environment, paramaterised on any TR. Returns the value 1.

EcoSISTEM.NoRelDiscreteType
NoRelDiscrete{TR} <: AbstractTraitRelationship{TR}

The absense of a relationship between a discrete trait and its environment, paramaterised on any TR. Returns the value 1.

EcoSISTEM.PopGrowthType
PopGrowth <: AbstractParams

Basic parameter type that holds information on a population's birth and death rates, birth and death, as well as how these are altered by energy availability. l represents the longevity of species based on their energy requirements and s is the survival of species dependent on how well their traits reflect the environment.

EcoSISTEM.RainBinType
RainBin{C <: Int} <: ContinuousTrait{C}

Trait type that holds binned rainfall preference information created through ClimatePref. Holds an array of counts per rainfall band (mm).

EcoSISTEM.SimpleBudgetType
SimpleBudget <: AbstractBudget{Float64}

This budget type has a matrix of floats, representing the energy budget of each subcommunity in the abiotic environment.

EcoSISTEM.SimpleRequirementType
SimpleRequirement <: Abstract1Requirement{Float64}

A simple energy requirement is a single float for each species.

EcoSISTEM.SimpleScenarioType
SimpleScenario <: AbstractScenario

This scenario type holds a function that acts to change the entire ecosystem.

EcoSISTEM.SizeRequirementType
SizeRequirement <: Abstract1Requirement{Float64}

A simple energy requirement is a single float for each species.

EcoSISTEM.SolarBudgetType
SolarBudget <: AbstractBudget{typeof(1.0*kJ)}

This budget type has a matrix of solar energy units, representing the energy budget of each subcommunity in the abiotic environment at a fixed point in time.

EcoSISTEM.SolarRequirementType
SolarRequirement <: Abstract1Requirement{typeof(1.0*kJ)}

A vector of solar energy requirements (kJ) for each species.

EcoSISTEM.SolarTimeBudgetType
SolarTimeBudget <: AbstractBudget{typeof(1.0*kJ)}

This budget type has a matrix of solar energy units, representing the energy budget of each subcommunity in the abiotic environment along with which time dimension we are interested in.

EcoSISTEM.SpeciesListType
SpeciesList{TR <: AbstractTraits, R <: AbstractRequirement,
            MO <: AbstractMovement, T <: AbstractTypes,
            P <: AbstractParams} <: AbstractTypes

Species list houses all species-specific information including trait information, phylogenetic relationships, requirement for energy and movement types.

EcoSISTEM.SpeciesListMethod
SpeciesList{R <: AbstractRequirement,
  MO <: AbstractMovement, P <: AbstractParams}(numspecies::Int64,
  numtraits::Int64, abun_dist::Distribution, req::R,
  movement::MO, params::P)

Function to create a SpeciesList given a number of species, the number of traits they possess, their abundances, requirement from the environment and their movement kernel.

EcoSISTEM.SpeciesListMethod
SpeciesList{R <: AbstractRequirement, MO <: AbstractMovement,
  T <: AbstractTypes, P <: AbstractParams}(numspecies::Int64,
  numtraits::Int64, abun_dist::Distribution, req::R,
  movement::MO, phy::T, params::P)

Function to create a SpeciesList given a number of species, the number of traits they possess, their abundances, requirement from the environment and their movement kernel and any type of AbstractTypes.

EcoSISTEM.TempBinType
TempBin{C <: Int} <: ContinuousTrait{C}

Trait type that holds binned temperature preference information created through ClimatePref. Holds an array of counts per temperature band (°C).

EcoSISTEM.TorusType
Torus <: BoundaryCondition

A toroidal boundary where species can cross both boundaries.

EcoSISTEM.TraitCollection2Type
TraitCollection2{T1, T2} <: AbstractTraits{Tuple{T1, T2}}

Trait collection that holds two trait types, TR1 and TR2.

EcoSISTEM.TraitCollection3Type
TraitCollection3{T1, T2, T3} <: AbstractTraits{Tuple{T1, T2, T3}}

Trait collection that holds three trait types, TR1, TR2 and TR3.

EcoSISTEM.TrapezeType
Trapeze{TR} <: AbstractTraitRelationship{TR}

The relationship between a continuous trait and its environment, paramaterised on any TR.

EcoSISTEM.TrapezoidType
Trapezoid{T<:Real} <: ContinuousUnivariateDistribution

Trapezoidal distribution as described at https://en.wikipedia.org/wiki/Trapezoidal_distribution.

EcoSISTEM.UnifType
Trapeze{TR} <: AbstractTraitRelationship{TR}

The relationship between a continuous trait and its environment, paramaterised on any TR.

EcoSISTEM.VolWaterBudgetType
VolWaterBudget <: AbstractBudget{typeof(1.0*mm)}

This budget type has a matrix of water volumes, representing the energy budget of each subcommunity in the abiotic environment at a fixed point in time.

EcoSISTEM.VolWaterRequirementType
VolWaterRequirement <: Abstract1Requirement{typeof(1.0*mm)}

A vector of soil water volume requirements (m^3) for each species.

EcoSISTEM.VolWaterTimeBudgetType
VolWaterTimeBudget <: AbstractBudget{typeof(1.0*mm)}

This budget type has a matrix of volumetric soil water units, representing the water budget of each subcommunity in the abiotic environment along with which time dimension we are interested in.

EcoSISTEM.WaterBudgetType
WaterBudget <: AbstractBudget{typeof(1.0*mm)}

This budget type has a matrix of rainfall energy units, representing the energy budget of each subcommunity in the abiotic environment at a fixed point in time.

EcoSISTEM.WaterRequirementType
WaterRequirement <: Abstract1Requirement{typeof(1.0*mm)}

A vector of water requirements (mm) for each species.

EcoSISTEM.WaterTimeBudgetType
WaterTimeBudget <: AbstractBudget{typeof(1.0*mm)}

This budget type has a matrix of rainfall units, representing the water budget of each subcommunity in the abiotic environment along with which time dimension we are interested in.

EcoSISTEM.additiveTR2Type
additiveTR2{TR1, TR2} <: AbstractTraitRelationship{Tuple{TR1, TR2}}

Type that houses multiple AbstractTraitRelationships for two trait and habitat levels.

EcoSISTEM.additiveTR3Type
multiplicativeTR3{TR1, TR2, TR3} <: AbstractTraitRelationship{Tuple{TR1, TR2, TR3}}

Type that houses multiple AbstractTraitRelationships for three trait and habitat levels.

EcoSISTEM.multiplicativeTR2Type
multiplicativeTR2{TR1, TR2} <: AbstractTraitRelationship{Tuple{TR1, TR2}}

Type that houses multiple AbstractTraitRelationships for two trait and habitat levels.

EcoSISTEM.multiplicativeTR3Type
multiplicativeTR3{TR1, TR2, TR3} <: AbstractTraitRelationship{Tuple{TR1, TR2, TR3}}

Type that houses multiple AbstractTraitRelationships for three trait and habitat levels.

EcoSISTEM.BMFunction
BM(T::Real, σ²::Float64, start::Float64, lab::String="")

Function to evolve a Real value through Brownian motion, with a starting value, start, and rate, σ².

EcoSISTEM.ContinuousEvolveMethod
ContinuousEvolve(val::Union{Float64, Unitful.Quantity{Float64}}, var::Union{Float64, Unitful.Quantity{Float64}}, tree::BinaryTree)

Function to evolve a continuous trait along a BinaryTree, tree via Brownian motion. Takes in a starting value, val and a variance, var.

EcoSISTEM.DiscreteEvolveFunction
DiscreteEvolve(numTraits::Int64, tree::BinaryTree)

Function to evolve a discrete switching trait along a BinaryTree, tree. Takes in a number of traits, numTraits to be switched between and rate to switch between traits, switch_rate with default value of 0.5.

EcoSISTEM.HabitatLossMethod
HabitatLoss(eco::AbstractEcosystem, hab::ContinuousHab, timestep::Unitful.Time)

Function to destroy habitat for one timestep of the ecosystem using HabitatUpdate information.

EcoSISTEM.NoChangeMethod
NoChange(eco::AbstractEcosystem, hab::ContinuousHab, timestep::Unitful.Time)

Function to keep the habitat the same for one timestep of the model.

EcoSISTEM.RainfallChangeMethod
RainfallChange(eco::AbstractEcosystem, hab::ContinuousHab, timestep::Unitful.Time)

Function to change the rainfall for one timestep of the ecosystem using HabitatUpdate information.

EcoSISTEM.TempChangeMethod
TempChange(eco::AbstractEcosystem, hab::ContinuousHab, timestep::Unitful.Time)

Function to increase the temperature for one timestep of the ecosystem using HabitatUpdate information.

EcoSISTEM.TempFluctMethod
TempFluct(eco::AbstractEcosystem, hab::ContinuousHab, timestep::Unitful.Time)

Function to fluctuate the temperature for one timestep of the ecosystem using HabitatUpdate information.

EcoSISTEM.abundancesMethod
abundances(cache::CachedEcosystem, tm::Unitful.Time)

Function to extract abundances for an ecosystem, cache, at a certain point in time, tm. If the abundances for that time are missing from the ecosystem, then the function checks on disk for the last saved version and simulates forward.

EcoSISTEM.assign_traits!Method
assign_traits!(tree::AbstractTree, start::Vector{Float64},
  σ²::Vector{Float64})

Function to evolve continuous functional traits through a phylogenetic tree through Brownian motion, with a starting value, start, and rate, σ².

EcoSISTEM.assign_traits!Method
assign_traits!(tree::AbstractTree, switch_rate::Vector{Float64},
traits::Vector{Vector{String}})

Function to evolve categorical functional traits through a phylogenetic tree with a specific switching rate.

EcoSISTEM.bioclimAEMethod

bioclimAE(bc::Worldclim_bioclim, maxbud::Unitful.Quantity{Float64}, area::Unitful.Area{Float64})

Function to create a ContinuousHab, SimpleBudget type abiotic environment from an Wordclim type climate. It either creates a SimpleBudget type filled with the maximum budget value maxbud or uses a provided budget of type SolarBudget. If a Bool matrix of active grid squares is included, active, this is used, else one is created with all grid cells active.

EcoSISTEM.budgetupdate!Method
budgetupdate!(eco::AbstractEcosystem, timestep::Unitful.Time)

Function to update the budget of an ecosystem for one timestep.

EcoSISTEM.calc_lookup_moves!Method
calc_lookup_moves!(bound, x::Int64, y::Int64, sp::Int64, eco::Ecosystem, abun::Int64)

Function to calculate the number of moves taken by a species, sp, from a specific grid square location (x, y). There is a boundary condition, bound, which determines how the species can move across space (see AbstractBoundary). The total abundance of individuals is given in abun, which may be the number of births in the timestep, or total indiviuals.

EcoSISTEM.combineTRMethod
combineTR

Function that combines the output of multiple trait relationships, which varies depending on whether multiplicative, additive etc.

EcoSISTEM.convert_coordsFunction
convert_coords(eco, i::Int64, width::Int64)
convert_coords(eco, x::Int64, y::Int64, width::Int64)

Function to convert coordinates from two-dimensional (x,y) format to one dimension (i), or vice versa, using the width of the grid. This function can also be applied to arrays of coordinates.

EcoSISTEM.emptygridlandscapeMethod
emptygridlandscape(gae::GridAbioticEnv, spplist::SpeciesList)

Function to create an empty GridLandscape given a GridAbioticEnv and a SpeciesList.

EcoSISTEM.emptypopulate!Method
emptypopulate!(ml::GridLandscape, spplist::SpeciesList,
               abenv::AB, rel::R) where {AB <: EcoSISTEM.AbstractAbiotic, R <: EcoSISTEM.AbstractTraitRelationship}
EcoSISTEM.energy_adjustmentMethod
energy_adjustment(eco::Ecosystem, bud::AbstractBudget, i::Int64, sp::Int64)

Function to calculate how much birth and death rates should be adjusted by, according to how much energy is available, bud, in the grid square, i, and how much energy the species, sp, requires.

EcoSISTEM.equalpopMethod
equalpop(params::EqualPop, numspp)

Function that takes demographic parameters from type EqualPop and converts them into type PopGrowth based on the number of species (numspp).

EcoSISTEM.eraAEMethod

eraAE(era::ERA, maxbud::Unitful.Quantity{Float64})

Function to create a ContinuousHab, SimpleBudget type abiotic environment from an ERA type climate. It either creates a SimpleBudget type filled with the maximum budget value maxbud or uses a provided budget of type SolarTimeBudget. If a Bool matrix of active grid squares is included, active, this is used, else one is created with all grid cells active.

EcoSISTEM.eraChangeMethod
eraChange(eco::AbstractEcosystem, hab::ContinuousHab, timestep::Unitful.Time)

Function to step the ERA climate forward by one timestep.

EcoSISTEM.genlookupsMethod
genlookups(hab::AbstractHabitat, mov::GaussianMovement)

Function to generate lookup tables, which hold information on the probability of moving to neighbouring squares.

EcoSISTEM.geom_mean_abunMethod
geom_mean_abun(eco::Ecosystem, qs::Vector{Float64})

Function to calculate the geometric mean abundance for the entire ecosystem.

EcoSISTEM.get_neighboursFunction
get_neighbours(mat::Matrix, x_coord::Int64, y_coord::Int64, chess::Int64=4)

Function to get the neighbours of a grid square in a matrix in 4 or 8 directions

EcoSISTEM.get_traitsFunction
get_traits(tree::AbstractTree, tips::Bool=true)

Function to retrieve functional traits assigned to a phylogenetic tree, either just tips or all nodes.

EcoSISTEM.getbudgetMethod
getbudget(eco::Ecosystem)

Function to extract budget from Ecosystem object.

EcoSISTEM.getdimensionMethod
getdimension(eco::Ecosystem)

Function to extract dimension of habitat from Ecosystem object.

EcoSISTEM.getdispersaldistMethod
getdispersaldist(eco::Ecosystem)

Function to extract average dispersal distance of species from Ecosystem object. Returns a vector of distances, unless a specific species is provided as a String or Integer.

EcoSISTEM.getdispersalvarMethod
getdispersalvar(eco::Ecosystem)

Function to extract dispersal varaince of species from Ecosystem object. Returns a vector of distances, unless a specific species is provided as a String or Integer.

EcoSISTEM.getgridsizeMethod
getgridsize(eco::Ecosystem)

Function to extract grid cell size of habitat from Ecosystem object.

EcoSISTEM.gethabitatMethod
gethabitat(eco::Ecosystem)

Function to extract habitat from Ecosystem object.

EcoSISTEM.getlookupMethod
getlookup(eco::Ecosystem)

Function to extract movement lookup table of species from Ecosystem object.

EcoSISTEM.getprefMethod
getpref(traits::T, field::Symbol) where T <: AbstractTraits

Function to extract trait preferences for all species in the ecosystem.

EcoSISTEM.getrelationshipMethod
getpref(traits::T, field::Symbol) where T <: AbstractTraits

Function to extract the trait relationship of all species in the ecosystem.

EcoSISTEM.getsizeMethod
getsize(eco::Ecosystem)

Function to extract size of habitat from Ecosystem object.

EcoSISTEM.habitatupdate!Method
habitatupdate!(eco::AbstractEcosystem, timestep::Unitful.Time)

Function to update the habitat of an ecosystem for one timestep.

EcoSISTEM.makeuniqueMethod
makeunique(eco::Ecosystem)

Function to convert type of similarity in SpeciesList to UniqueTypes, i.e. an identity matrix.

EcoSISTEM.mean_abunMethod
mean_abun(eco::Ecosystem, qs::Vector{Float64})

Function to calculate the mean arithmetic abundance for the entire ecosystem.

EcoSISTEM.meta_shannonMethod
meta_shannon(eco::Ecosystem, qs::Vector{Float64})

Function to calculate the Shannon entropy for the entire ecosystem.

EcoSISTEM.meta_simpsonMethod
meta_simpson(eco::Ecosystem, qs::Vector{Float64})

Function to calculate the Simpson diversity for the entire ecosystem.

EcoSISTEM.meta_speciesrichnessMethod
meta_speciesrichness(eco::Ecosystem, qs::Vector{Float64})

Function to calculate the species richness for the entire ecosystem.

EcoSISTEM.move!Method
move!(eco::Ecosystem, ::AbstractMovement, i::Int64, sp::Int64, grd::Matrix{Int64, 2}, abun::Int64)

Function to calculate the movement of species sp from a given position in the landscape i, using the lookup table found in the Ecosystem and updating the movement patterns on a cached grid, grd. Optionally, a number of births can be provided, so that movement only takes place as part of the birth process, instead of the entire population

EcoSISTEM.pdMethod
pd(eco::Ecosystem, qs::Vector{Float64})

Function to calculate Faith's phylogenetic diversity (PD) for the entire ecosystem.

EcoSISTEM.peakedgradAEMethod
peakedgradAE(minT::Unitful.Temperature{Float64},
   maxT::Unitful.Temperature{Float64},
   dimension::Tuple{Int64, Int64}, maxbud::Unitful.Quantity{Float64},
   area::Unitful.Area{Float64}, rate::Quantity{Float64, 𝚯*𝐓^-1},
   active::Matrix{Bool})

Function to create a temperature gradient ContinuousHab, SimpleBudget type abiotic environment. Given a min and max temperature, it generates a gradient from minima at the top and bottom peaking to maximum in the middle. It creates a ContinuousHab environment with dimensions dimension and a specified area area. It also creates a SimpleBudget type filled with the maximum budget value maxbud. The rate of temperature change is specified using the parameter rate. If a Bool matrix of active grid squares is included, active, this is used, else one is created with all grid cells active.

EcoSISTEM.raingradMethod
raingrad(minT::Unitful.Temperature{Float64}, maxT::Unitful.Temperature{Float64},
  size::Unitful.Length{Float64},
  dim::Tuple{Int64, Int64}, rate::Quantity{Float64, 𝚯*𝐓^-1})

Function to create a ContinuousHab habitat with a rainfall gradient.

EcoSISTEM.raingradAEMethod
raingradAE(min::Unitful.Temperature{Float64},
  max::Unitful.Temperature{Float64},
  dimension::Tuple{Int64, Int64}, maxbud::Float64,
  area::Unitful.Area{Float64}, rate::Quantity{Float64, typeof(𝚯*𝐓^-1)},
  active::Matrix{Bool})

Function to create a rain gradient ContinuousHab, SimpleBudget type abiotic environment. Given a min and max rainfall, it generates a gradient from minimum at the bottom to maximum at the top. It creates a ContinuousHab environment with dimensions dimension and a specified area area. It also creates a SimpleBudget type filled with the maximum budget value maxbud. The rate of rainfall change is specified using the parameter rate. If a Bool matrix of active grid squares is included, active, this is used, else one is created with all grid cells active.

EcoSISTEM.randomnichesMethod
randomniches(dimension::Tuple, types::Vector{String}, clumpiness::Float64, weights::Vector)

Function to create a DiscreteHab habitat of dimension dimension, made up of sampled string types, types, that have a weighting, weights and clumpiness parameter, clumpiness.

EcoSISTEM.reenergise!Method
reenergise!(eco::Ecosystem, budget::Union{Float64, Unitful.Quantity{Float64}}, grid::Tuple{Int64, Int64})

Function to refill an ecosystem eco, with energy from a budget value, budget and a grid size.

EcoSISTEM.repopulate!Method
repopulate!(eco::Ecosystem, abun::Int64)

Function to repopulate an ecosystem eco, with option for including trait preferences. An additional abun parameter can be included, in order to repopulate the ecosystem with a specified number of individuals.

EcoSISTEM.resetrate!Method
resetrate!(eco::Ecosystem, rate::Quantity{Float64, typeof(𝐓^-1)})

Function to reset the rate of habitat change for a species.

EcoSISTEM.runscenario!Method
runscenario!(eco::Ecosystem, timestep::Unitful.Time, scenario::S, currentstep::Unitful.Time) where S <: AbstractScenario

This function runs any scenario type for one timestep.

EcoSISTEM.simplehabitatMethod
simplehabitat(val::Unitful.Quantity, size::Unitful.Length,
dim::Tuple{Int64, Int64})

Function to create a ContinuousHab habitat of dimension dim, with cell size and filled value, val.

EcoSISTEM.simplehabitatAEMethod
simplehabitatAE(val::Union{Float64, Unitful.Quantity{Float64}},
    dimension::Tuple{Int64, Int64}, maxbud::Float64, area::Unitful.Area{Float64},
    active::Matrix{Bool})

Function to create a simple ContinuousHab, SimpleBudget type abiotic environment. It creates a ContinuousHab filled with a given value, val, dimensions (dimension) and a specified area (area). It also creates a SimpleBudget type filled with the maximum budget value (maxbud). The rate of temperature change is specified using the parameter rate. If a Bool matrix of active grid squares is included, active, this is used, else one is created with all grid cells active.

EcoSISTEM.simplenicheAEMethod
simplenicheAE(numniches::Int64, dimension::Tuple,
                    maxBud::Float64, area::Unitful.Area{Float64},
                    active::Matrix{Bool})

Function to create a simple DiscreteHab, SimpleBudget type abiotic environment. Given a number of niche types numniches, it creates a DiscreteHab environment with dimensions dimension and a specified area area. It also creates a SimpleBudget type filled with the maximum budget value maxbud. If a Bool matrix of active grid squares is included, active, this is used, else one is created with all grid cells active.

EcoSISTEM.simulate!Method
simulate!(cache::CachedEcosystem,  srt::Unitful.Time, timestep::Unitful.Time)

Function to run a cached ecosystem, cache at a specified timepoint, srt, for a particular timestep, 'timestep'.

EcoSISTEM.simulate!Method
simulate!(eco::Ecosystem, duration::Unitful.Time, interval::Unitful.Time,
     timestep::Unitful.Time)

Function to run an ecosystem, eco for specified length of times, duration, for a particular timestep, 'timestep'.

EcoSISTEM.simulate!Method
simulate!(eco::Ecosystem, times::Unitful.Time, timestep::Unitful.Time,
          cacheInterval::Unitful.Time, cacheFolder::String,
          scenario_name::String)

Function to run an ecosystem, eco for specified length of times, duration, for a particular timestep, 'timestep'. A cache interval and folder/file name are specified for saving output.

EcoSISTEM.simulate_record!Method
simulate_record!(eco::Ecosystem, duration::Unitful.Time, interval::Unitful.Time,
     timestep::Unitful.Time)

Function to run an ecosystem, eco for specified length of times, duration, for a particular timestep, 'timestep', and time interval for abundances to be recorded, interval. Optionally, there may also be a scenario by which the whole ecosystem is updated, such as removal of habitat patches.

EcoSISTEM.simulate_record_diversity!Method
simulate_record_diversity!(storage::AbstractArray, eco::Ecosystem,
  times::Unitful.Time, interval::Unitful.Time,timestep::Unitful.Time,
  scenario::SimpleScenario, divfun::Function, qs::Float64)

Function to run an ecosystem, eco for specified length of times, duration, for a particular timestep, 'timestep', and time interval for a diversity to be calculated and recorded, interval. Optionally, there may also be a scenario by which the whole ecosystem is updated, such as removal of habitat patches.

EcoSISTEM.sorensonMethod
sorenson(eco::Ecosystem, qs::Vector{Float64})

Function to calculate the Sorenson similarity for the entire ecosystem.

EcoSISTEM.tematchMethod
tematch(sppl::SpeciesList, abenv::AbstractAbiotic)

Function to check that the types of a trait list and habitat list are the same for a species list (sppl) and abiotic environment (abenv).

EcoSISTEM.tempgradMethod
tempgrad(minT::Unitful.Temperature{Float64}, maxT::Unitful.Temperature{Float64},
  size::Unitful.Length{Float64},
  dim::Tuple{Int64, Int64}, rate::Quantity{Float64, 𝚯*𝐓^-1})

Function to create a ContinuousHab habitat with a temperature gradient.

EcoSISTEM.tempgradAEMethod
tempgradAE(min::Unitful.Temperature{Float64},
  max::Unitful.Temperature{Float64},
  dimension::Tuple{Int64, Int64}, maxbud::Float64,
  area::Unitful.Area{Float64}, rate::Quantity{Float64, typeof(𝚯*𝐓^-1)},
  active::Matrix{Bool})

Function to create a temperature gradient ContinuousHab, SimpleBudget type abiotic environment. Given a min and max temperature, it generates a gradient from minimum at the bottom to maximum at the top. It creates a ContinuousHab environment with dimensions dimension and a specified area area. It also creates a SimpleBudget type filled with the maximum budget value maxbud. The rate of temperature change is specified using the parameter rate. If a Bool matrix of active grid squares is included, active, this is used, else one is created with all grid cells active.

EcoSISTEM.traitfunMethod
traitfun(eco::AbstractEcosystem, pos::Int64, sp::Int64)

Function to calculate relationship between the current environment and a species' particular trait.

EcoSISTEM.traitpopulate!Method
traitpopulate!(ml::GridLandscape, spplist::SpeciesList,
               abenv::AbstractAbiotic)

Function to populate a grid landscape given the abundances found in species list based upon how well the species traits match their environment.

EcoSISTEM.traitrepopulate!Method
repopulate!(eco::Ecosystem, abun::Int64)

Function to repopulate an ecosystem eco, with option for including trait preferences. An additional abun parameter can be included, in order to repopulate the ecosystem with a specified number of individuals.

EcoSISTEM.trmatchMethod
trmatch(sppl::SpeciesList, traitrel::AbstractTraitRelationship)

Function to check that the types of a trait list and trait relationship list are the same for a species list (sppl) and trait relationship (traitrel).

EcoSISTEM.unziptempFunction
EcoSISTEM.unziptemp(path::String)

Helper function for the FAIR Data Pipeline to unzip files that are stored as zips to a temporary folder.

EcoSISTEM.update!Method
update!(eco::Ecosystem, time::Unitful.Time)

Function to update a ecosystem abundances and environment for one timestep.

EcoSISTEM.update_energy_usage!Method
update_energy_usage!(eco::Ecosystem)

Function to calculate how much energy has been used up by the current species in each grid square in the ecosystem, eco. This function is parameterised on whether the species have one type of energy requirement or two.

EcoSISTEM.worldclimAEMethod

worldclimAE(wc::Worldclim_monthly, maxbud::Unitful.Quantity{Float64})

Function to create a ContinuousTimeHab, SimpleBudget type abiotic environment from a Wordclim type climate. It either creates a SimpleBudget type filled with the maximum budget value maxbud or uses a provided budget of type SolarTimeBudget. If a Bool matrix of active grid squares is included, active, this is used, otherwise one is all grid cells are considered active.

EcoSISTEM.worldclimChangeMethod
worldclimChange(eco::AbstractEcosystem, hab::ContinuousHab, timestep::Unitful.Time)

Function to step the Worldclim climate forward by one timestep.

Base.readMethod
read(f, filename)

Function to read raster file into julia.

EcoSISTEM.ClimatePref.convert_coordsFunction
convert_coords(i::Int64, width::Int64)
convert_coords(x::Int64, y::Int64, width::Int64)

Function to convert coordinates from two-dimensional (x,y) format to one dimension (i), or vice versa, using the width of the grid. This function can also be applied to arrays of coordinates.

EcoSISTEM.ClimatePref.downresolutionFunction
downresolution(data::Union{ERA, Worldclim_monthly, Worldclim_bioclim}, rescale::Int64; fn)

Function to decrease the resolution of a climate dataset, by a factor, rescale, and aggregation function, fn. The aggregation function has a default setting of taking the mean value.

EcoSISTEM.ClimatePref.downresolution!Function
downresolution!(resized_array::Matrix{T}, array::Matrix{T}, rescale::Int64, fn)
downresolution!(resized_array::Array{T, 3}, array::Matrix{T}, dim::Int64, rescale::Int64, fn)

Function to decrease the resolution of a climate dataset in place, by a factor, rescale, and aggregation function, fn. The aggregation function has a default setting of taking the mean value.

EcoSISTEM.ClimatePref.extractvaluesMethod
extractvalues(x::Vector{typeof(1.0°)},y::Vector{typeof(1.0°)},
    bc::Worldclim_bioclim, dim::Unitful.Time)

Function to extract values from a bioclim object, at specified x, y locations and time, dim.

EcoSISTEM.ClimatePref.extractvaluesMethod
extractvalues(x::Vector{typeof(1.0°)},y::Vector{typeof(1.0°)},
    bc::Worldclim_bioclim, dim::Unitful.Time)

Function to extract values from a bioclim object, at specified x, y locations and over a time period, dim.

EcoSISTEM.ClimatePref.extractvaluesMethod
extractvalues(x::Vector{typeof(1.0°)},y::Vector{typeof(1.0°)},
    wc::Worldclim_monthly, dim::Unitful.Time)

Function to extract values from a worldclim object, at specified x, y locations and over a range of times, dim.

EcoSISTEM.ClimatePref.extractvaluesMethod
extractvalues(x::Vector{typeof(1.0°)},y::Vector{typeof(1.0°)},
    wc::Worldclim_monthly, dim::Unitful.Time)

Function to extract values from a worldclim object, at specified x, y locations and time, dim.

EcoSISTEM.ClimatePref.readCERAMethod
readCERA(dir::String, file::String, params::String)

Function to extract a certain parameter, param, from an CERA-20C netcdf file, and convert into an axis array.

EcoSISTEM.ClimatePref.readCRUTSMethod
readCRUTS(dir::String)

Function to extract all raster files from a specified folder directory, and convert into an axis array.

EcoSISTEM.ClimatePref.readERAMethod
readERA(dir::String, file::String, param::String, dim::Vector{Vector{T}})
    where T<: Unitful.Time

Function to extract a certain parameter, param, from a directory, dir, containing ERA netcdf files, for a certain timerange, dim, and convert into an axis array.

EcoSISTEM.ClimatePref.readERAMethod
readERA(dir::String, param::String, dim::StepRange(typeof(1month)))

Function to extract a certain parameter, param, from an ERA netcdf file, for a certain timerange, dim, and convert into an axis array.

EcoSISTEM.ClimatePref.readbioclimFunction
readbioclim(dir::String)

Function to extract all raster files from a specified folder directory, and convert into an axis array.

EcoSISTEM.ClimatePref.readlcFunction
readlc(dir::String)

Function to extract all raster files from a specified folder directory, and convert into an axis array.

EcoSISTEM.ClimatePref.readworldclimFunction
readworldclim(dir::String)

Function to extract all raster files from a specified folder directory, and convert into an axis array.

EcoSISTEM.ClimatePref.upresolutionFunction
upresolution(data::Union{ERA, Worldclim_monthly, Worldclim_bioclim}, rescale::Int64; fn)

Function to increase the resolution of a climate dataset, by a factor, rescale.