Modular Megafauna Model 1.1.5
A physiological, dynamic herbivore simulator in C++.
Loading...
Searching...
No Matches
Fauna Namespace Reference

Namespaces

namespace  Demo
 
namespace  Output
 

Classes

struct  AllometryParameters
 Coefficient and exponent for an allometric relationship. More...
 
class  ambiguous_param_type
 Exception that a parameter can be interpreted in multiple ways. More...
 
class  bad_array_size
 Exception that an array parameter does not have the correct length. More...
 
class  BreedingSeason
 Helper class for reproduction within a breeding season. More...
 
class  CohortPopulation
 A population of HerbivoreCohort objects. More...
 
class  CreateHerbivoreCohort
 Function class constructing HerbivoreCohort objects. More...
 
class  CreateHerbivoreCommon
 Parent class for CreateHerbivoreCohort. More...
 
class  Date
 Helper class to hold an absolute simulation day. More...
 
class  DateInterval
 Two dates framing a time interval. More...
 
struct  DistributeForage
 Interface for a forage distribution algorithm. More...
 
struct  DistributeForageEqually
 Equal forage distribution algorithm. More...
 
class  FatmassEnergyBudget
 A herbivore’s energy budget with fat reserves. More...
 
class  FeedHerbivores
 Function object to feed herbivores. More...
 
class  ForageBase
 Base class for herbivore forage in a habitat. More...
 
class  ForageValues
 
class  GetBackgroundMortality
 Function object to calculate constant herbivore background mortality. More...
 
class  GetForageDemands
 Function object to calculate forage demands for a herbivore. More...
 
class  GetSimpleLifespanMortality
 Function object for herbivore death after given lifespan is reached. More...
 
class  GetStarvationIlliusOConnor2000
 
class  GetStarvationMortalityThreshold
 Function object to calculate death at low body fat. More...
 
struct  GivenPointAllometry
 Parameters for an allometric relationship with exponent and one point. More...
 
class  GrassForage
 Grass forage in a habitat. More...
 
class  Habitat
 Abstract class of a homogenous spatial unit populated by herbivores. More...
 
struct  HabitatEnvironment
 Variables describing the habitat that are not forage ⇒ abiotic environment. More...
 
class  HabitatForage
 All values for large herbivore forage in a Habitat. More...
 
class  HalfMaxIntake
 Ingestion rate as Holling’s Type II functional response. More...
 
class  HerbivoreBase
 Abstract base class for herbivores. More...
 
class  HerbivoreCohort
 A herbivore cohort (age-class) More...
 
struct  HerbivoreInterface
 Interface for any herbivore implementation in the model. More...
 
class  Hft
 One herbivore functional type (i.e. one species). More...
 
class  InsfileReader
 Class to read parameters and HFTs from given instruction file. More...
 
class  invalid_option
 Exception that a string parameter does not match possible options. More...
 
struct  missing_group
 Exception if a group listed in hft.groups cannot be found. More...
 
struct  missing_hft_parameter
 Exception that an HFT parameter is missing in the instruction file. More...
 
struct  missing_parameter
 Exception that a parameter is missing in the instruction file. More...
 
struct  param_out_of_range
 Exception if an integer or double parameter is out of range. More...
 
struct  Parameters
 Parameters for the herbivory module. More...
 
class  PeriodAverage
 Average of a double value over a given time period. More...
 
struct  PopulationInterface
 A container of herbivore objects. More...
 
class  ReproductionConstMax
 Use a constant annual increase rate for herbivore reproduction. More...
 
class  ReproductionLinear
 Reproduction rate increases linearly with fat reserves up to maximum. More...
 
class  ReproductionLogistic
 Reproduction model following Illius & O’Connor (2000) More...
 
class  SimulateDay
 Function object to simulate one day in one habitat. More...
 
class  SimulationUnit
 A habitat with the herbivores that live in it. More...
 
struct  unknown_parameters
 Exception that parameters couldn’t be parsed in the TOML file. More...
 
class  World
 Central class to construct and own megafauna habitats and populations. More...
 
class  WorldConstructor
 Helper class of World to create various megafauna components. More...
 
struct  wrong_param_type
 Exception that a parameter is not of an expected data type. More...
 

Typedefs

typedef ForageValues< ForageValueTag::ZeroToOneDigestibility
 Digestibility [fraction] for different forage types. More...
 
typedef ForageValues< ForageValueTag::PositiveAndZeroForageEnergy
 Energy values [MJ] for different forage types. More...
 
typedef ForageValues< ForageValueTag::PositiveAndZeroForageEnergyContent
 Net energy content [MJ/kgDM] for different forage types. More...
 
typedef ForageValues< ForageValueTag::ZeroToOneForageFraction
 A fraction for each forage type. More...
 
typedef ForageValues< ForageValueTag::PositiveAndZeroForageMass
 Dry matter mass values [kgDM or kgDM/km²] for different forage types. More...
 
typedef std::vector< std::pair< HerbivoreInterface *, ForageMass > > ForageDistribution
 Data structure defining which herbivore gets what to eat [kgDM/km²]. More...
 
typedef std::list< const Habitat * > HabitatList
 A list of Habitat pointers. More...
 
typedef std::vector< std::shared_ptr< const Hft > > HftList
 List of pointers to Hft objects. More...
 
typedef std::vector< HerbivoreInterface * > HerbivoreVector
 A list of herbivore interface pointers. More...
 
typedef std::vector< const HerbivoreInterface * > ConstHerbivoreVector
 A list of read-only herbivore interface pointers. More...
 
typedef std::vector< std::shared_ptr< PopulationInterface > > PopulationList
 

Enumerations

enum class  ForageType { Grass , Inedible }
 Different types of forage. More...
 
enum class  ForageValueTag { PositiveAndZero , ZeroToOne }
 Describes which values are allowed in Fauna::ForageValues. More...
 
enum class  SimMode { Lint , Simulate }
 Mode of the whole simulation program: What is it started for? More...
 
enum class  FurSeason { Summer , Winter }
 Selector for winter or summer pelt. More...
 
enum class  Sex { Female , Male }
 The sex of a herbivore. More...
 
enum class  ConductanceModel { BradleyDeavers1980 , CuylerOeritsland2004 }
 Selector for a function of how to calculate whole-body conductance. More...
 
enum class  DietComposer { PureGrazer }
 Model to define a herbivore’s diet in a multi-forage scenario. More...
 
enum class  DigestiveLimit { None , Allometric , FixedFraction , IlliusGordon1992 }
 Algorithm to calculate the daily digestive capacity of a herbivore. More...
 
enum class  ExpenditureComponent {
  BasalMetabolicRate , FieldMetabolicRate , Taylor1981 , Thermoregulation ,
  Zhu2018
}
 Algorithm to calculate a herbivore’s daily energy needs. More...
 
enum class  ForagingLimit { GeneralFunctionalResponse , IlliusOConnor2000 }
 A factor limiting a herbivore’s daily forage harvesting. More...
 
enum class  NetEnergyModel { GrossEnergyFraction }
 How forage net energy content is calculated. More...
 
enum class  MortalityFactor { Background , Lifespan , StarvationIlliusOConnor2000 , StarvationThreshold }
 One way how a herbivore can die. More...
 
enum class  ReproductionModel { None , ConstantMaximum , Linear , Logistic }
 Algorithm to calculate herbivore reproduction time and success. More...
 
enum class  ForageDistributionAlgorithm { Equally }
 Parameter for selecting algorithm for forage distribution among herbivores. More...
 
enum class  HerbivoreType { Cohort }
 
enum class  OutputInterval { Daily , Monthly , Annual , Decadal }
 Time interval for aggregating output. More...
 
enum class  OutputFormat { TextTables }
 Parameter for selecting the output writer implementation. More...
 

Functions

double average (const double a, const double b, const double weight_a=1.0, const double weight_b=1.0)
 Build weighted average of two numbers. More...
 
const std::string & get_forage_type_name (const ForageType)
 Get a short, lowercase string identifier for a forage type. More...
 
ForageValues< ForageValueTag::PositiveAndZeroforagefractions_to_foragevalues (const ForageValues< ForageValueTag::ZeroToOne > &fractions)
 Convert forage fractions (in [0,1]) into values in [0,∞]. More...
 
ForageFraction foragevalues_to_foragefractions (const ForageValues< ForageValueTag::PositiveAndZero > values, const double tolerance)
 Convert forage values to fractional values. More...
 
ForageFraction convert_mj_to_kg_proportionally (const ForageValues< ForageValueTag::PositiveAndZero > &mj_per_kg, const ForageValues< ForageValueTag::ZeroToOne > &mj_proportions)
 Convert forage energy to mass keeping the energy-wise proportions. More...
 
double get_expenditure_taylor_1981 (const double current_bodymass, const double adult_bodymass)
 Energy expenditure [MJ/ind/day] based on cattle from Taylor et al. (1981) More...
 
double get_expenditure_zhu_et_al_2018 (const double bodymass, const double ambient_temperature)
 Daily expenditure by Zhu et al (2018) [70]. More...
 
double watts_to_MJ_per_day (const double W)
 Convert Watts (=J/s) to MJ/day. More...
 
double get_conductance_bradley_deavers_1980 (const double bodymass)
 
double get_conductance_cuyler_oeritsland_2004 (const double bodymass, const FurSeason season)
 Extrapolate conductance from reindeer fur. More...
 
double get_thermoregulatory_expenditure (const double thermoneutral_rate, const double conductance, const double core_temperature, const double ambient_temperature)
 Calculate additional energy requirements to keep body temperature. More...
 
void create_directories (const std::string path, const mode_t mode=0755)
 Create a folder including all its parent folders. More...
 
bool directory_exists (const std::string path)
 Check whether a folder in the filesystem exists. More...
 
bool file_exists (const std::string &path)
 Check whether a file in the filesystem exists. More...
 
void remove_directory (const std::string &path)
 Delete a directory recursively. More...
 
double get_digestive_limit_illius_gordon_1992 (const double bodymass_adult, const double bodymass, const double digestibility, const std::array< double, 3 > &ijk)
 Get digestion-limited daily grass energy intake after Illius & Gordon (1992) More...
 
ForageEnergyContent get_net_energy_from_gross_energy (const ForageEnergyContent &ge_content, const Digestibility &digestibility, const double me_coefficient, const double k_maintenance)
 Get net energy content of the forage [MJ/kgDM]. More...
 
Overload operator * as non-member.
ForageValues< ForageValueTag::PositiveAndZerooperator* (const double lhs, const ForageFraction &rhs)
 Multiply forage fractions with coefficient, allowing numbers >0. More...
 
ForageValues< ForageValueTag::PositiveAndZerooperator* (const ForageFraction &lhs, const ForageValues< ForageValueTag::PositiveAndZero > &rhs)
 Multiply forage fractions with coefficient, allowing numbers >0. More...
 
ForageValues< ForageValueTag::PositiveAndZerooperator* (const ForageValues< ForageValueTag::PositiveAndZero > &lhs, const ForageFraction &rhs)
 Multiply forage fractions with coefficient, allowing numbers >0. More...
 

Variables

const int FORAGE_TYPE_COUNT = (int)ForageType::Inedible + 1
 Number of elements in ForageType. More...
 
const std::set< ForageTypeFORAGE_TYPES = get_all_forage_types()
 

Detailed Description

Namespace for the whole modular megafauna model library.

Typedef Documentation

◆ ConstHerbivoreVector

typedef std::vector<const HerbivoreInterface*> Fauna::ConstHerbivoreVector

A list of read-only herbivore interface pointers.

◆ Digestibility

Digestibility [fraction] for different forage types.

◆ ForageDistribution

typedef std::vector<std::pair<HerbivoreInterface*, ForageMass> > Fauna::ForageDistribution

Data structure defining which herbivore gets what to eat [kgDM/km²].

◆ ForageEnergy

Energy values [MJ] for different forage types.

◆ ForageEnergyContent

Net energy content [MJ/kgDM] for different forage types.

◆ ForageFraction

A fraction for each forage type.

◆ ForageMass

Dry matter mass values [kgDM or kgDM/km²] for different forage types.

◆ HabitatList

typedef std::list<const Habitat*> Fauna::HabitatList

A list of Habitat pointers.

◆ HerbivoreVector

A list of herbivore interface pointers.

◆ HftList

typedef std::vector< std::shared_ptr< const Hft > > Fauna::HftList

List of pointers to Hft objects.

Using shared pointers guarantees that the Hft instances don’t get released while they may still be used.

◆ PopulationList

typedef std::vector<std::shared_ptr<PopulationInterface> > Fauna::PopulationList

Enumeration Type Documentation

◆ ConductanceModel

enum class Fauna::ConductanceModel
strong

Selector for a function of how to calculate whole-body conductance.

See also
Thermoregulation by Conductance
Enumerator
BradleyDeavers1980 

Allometric formula from data by Bradley & Deavers (1980) [6].

See also
get_conductance_bradley_deavers_1980()
CuylerOeritsland2004 

Allometric formula extrapolating from reindeer fur conductivity.

See also
get_conductance_cuyler_oeritsland_2004

◆ DietComposer

enum class Fauna::DietComposer
strong

Model to define a herbivore’s diet in a multi-forage scenario.

Enumerator
PureGrazer 

Eat exclusively grass.

◆ DigestiveLimit

enum class Fauna::DigestiveLimit
strong

Algorithm to calculate the daily digestive capacity of a herbivore.

Enumerator
None 

No digestive limit.

Allometric 

Dry-matter ingestion is limited to a fraction of live herbivore body mass.

The digestion-limited maximum intake, $DMI$, is a fraction of body mass, $M$, and scales allometrically with body mass in a power law relationship.

Attention
Too long; didn’t read: It makes sense to set the exponent of Hft::digestion_allometric to the exponent of Hft::expenditure_basal_rate minus 1.

Hft::digestion_allometric defines the maximum fractional intake for adult males, $DMI_{ad}$, as well as the exponent for the allometric scaling to other body masses. The allometric scaling relationship takes the form $DMI = a * M^b$.

Scaling maximum intake allometrically can be better than having a fixed fraction (DigestiveLimit::FixedFraction) for all animals because younger animals (and female adults) have a lower body mass and thus a higher metabolic rate per body mass. Therefore they also need a higher digestive limit. This is important so that young animals are not starving after birth because their intake is restricted.

Energy expenditure must be balanced by intake. Let’s take Kleiber’s ¾ power law (Kleiber 1961[36]) as an example. Metabolic rate scales with $M^{0.75}$, and so the metabolic rate per body mass scales with $M^{0.75}/M = M^{-0.25}$. The forage intake per body mass must balance these expenditures. In this case it makes sense to say that the maximum relative intake ( $DMI$) also scales with $M^{-0.25}$, which is the same as saying that the absolute intake scales with $M^{0.75}$.

In this example, the (relative) dry-matter intake (DMI) would be:

\[
DMI(M) = DMI_{ad} * M_{ad}^{0.25} * M^{-0.25}
\]

For nursing newborns, the energy input comes from mother milk, but that is not considered in this model. Newborns are simulated as if they ate fresh forage directly. The very high dry-matter intake limit for newborns stands in place for the energy supply that would come from lactation.

Allometric scaling of digestive limit.
FixedFraction 

Dry-matter ingestion is limited to a fixed fraction of live body mass.

The parameter Hft::digestion_fixed_fraction ( $f_{ad}$) defines the maximum daily intake in dry matter as a fraction of body mass.

IlliusGordon1992 

Limit digestive limit with get_digestive_limit_illius_gordon_1992().

◆ ExpenditureComponent

enum class Fauna::ExpenditureComponent
strong

Algorithm to calculate a herbivore’s daily energy needs.

Enumerator
BasalMetabolicRate 

Only the allometric basal metabolic rate.

\[
BMR = c * M^e
\]

FieldMetabolicRate 

Allometric basal metabolic rate with FMR constant multiplier.

\[
FMR = f * BMR = f * c * M^e
\]

Taylor1981 

Formula for field metabolic rate in cattle: get_expenditure_taylor_1981()

Thermoregulation 

Increased expenditure in lower temperature, see Thermoregulation by Conductance.

Zhu2018 

Formula for temperature-dependent field metabolic rate: get_expenditure_zhu_et_al_2018()

◆ ForageDistributionAlgorithm

Parameter for selecting algorithm for forage distribution among herbivores.

Enumerator
Equally 

Equal forage distribution: Fauna::DistributeForageEqually.

◆ ForageType

enum class Fauna::ForageType
strong

Different types of forage.

Enumerator
Grass 

Forage type grass.

Inedible 

Plants that are not edible for herbivores.

◆ ForageValueTag

enum class Fauna::ForageValueTag
strong

Describes which values are allowed in Fauna::ForageValues.

Enumerator
PositiveAndZero 

Only values in interval [0,∞) are allowed.

ZeroToOne 

Only values in interval [0,1] are allowed.

◆ ForagingLimit

enum class Fauna::ForagingLimit
strong

A factor limiting a herbivore’s daily forage harvesting.

Enumerator
GeneralFunctionalResponse 

Type-II functional response applied “on top” of all other constraints.

This has no empirical basis, but serves as a way to implement an “artificial” smooth negative feedback from forage to fat mass.

Note that this model is functionally similar to ForagingLimit::IlliusOConnor2000, but Illius & O’Connor (2000) [35] use a value for Hft::foraging_half_max_intake_density that is empirical-based.

Here, it shall be explicitely stated that the half-max intake density is not based on observation, but solely used as a means to create a workable forage–intake feedback.

See also
Hft::foraging_half_max_intake_density, HalfMaxIntake
IlliusOConnor2000 

Foraging is limited by a functional response towards digestion limit.

Illius & O’Connor (2000) [35] describe daily food intake rate as a Holling Type II functional response (compare HalfMaxIntake). As the maximum daily energy intake they choose the digestive capacity (compare get_digestive_limit_illius_gordon_1992()).

Like in the model of Pachzelt et al. (2013) [49], the grass forage density of the whole patch (habitat) is used (not the sward density

Note
This model for maximum foraging works only for pure grazers (⇒ DietComposer::PureGrazer). GrassForage::get_sward_density()).
See also
Hft::foraging_half_max_intake_density

◆ FurSeason

enum class Fauna::FurSeason
strong

Selector for winter or summer pelt.

Enumerator
Summer 

Summer fur.

Winter 

Winter fur.

◆ HerbivoreType

enum class Fauna::HerbivoreType
strong

Parameter for selecting the class implementing Fauna::HerbivoreInterface.

Enumerator
Cohort 

Use class HerbivoreCohort.

◆ MortalityFactor

enum class Fauna::MortalityFactor
strong

One way how a herbivore can die.

Enumerator
Background 

Independent background mortality for juveniles and adults.

See also
GetBackgroundMortality
Lifespan 

A herbivore dies if its age exceeds Hft::life_history_lifespan.

See also
Fauna::GetSimpleLifespanMortality
StarvationIlliusOConnor2000 

Starvation death following Illius & O’Connor (2000).

See also
Fauna::GetStarvationIlliusOConnor2000
StarvationThreshold 

Starvation death at a minimum bodyfat threshold.

◆ NetEnergyModel

enum class Fauna::NetEnergyModel
strong

How forage net energy content is calculated.

See also
Energy Content of Forage
Enumerator
GrossEnergyFraction 

Use get_net_energy_from_gross_energy().

◆ OutputFormat

enum class Fauna::OutputFormat
strong

Parameter for selecting the output writer implementation.

Enumerator
TextTables 

Use class Output::TextTableWriter.

◆ OutputInterval

enum class Fauna::OutputInterval
strong

Time interval for aggregating output.

Enumerator
Daily 

Don’t aggregate output over time, but write every day.

Monthly 

Aggregate output for each month.

Annual 

Aggregate output for each year.

Decadal 

Aggregate output for 10 years intervals.

◆ ReproductionModel

enum class Fauna::ReproductionModel
strong

Algorithm to calculate herbivore reproduction time and success.

Enumerator
None 

Disable reproduction all together.

ConstantMaximum 

Use class ReproductionConstMax for reproduction.

Linear 

Use class ReproductionLinear for reproduction.

Logistic 

Use class ReproductionLogistic to calculate reproduction.

◆ Sex

enum class Fauna::Sex
strong

The sex of a herbivore.

Enumerator
Female 
Male 

◆ SimMode

enum class Fauna::SimMode
strong

Mode of the whole simulation program: What is it started for?

Enumerator
Lint 

Only check (“lint”) the instruction file, don’t perform simulations.

See also
linter.cpp
Simulate 

Default mode: We want to simulate herbivores.

Function Documentation

◆ average()

double Fauna::average ( const double  a,
const double  b,
const double  weight_a = 1.0,
const double  weight_b = 1.0 
)

Build weighted average of two numbers.

Exceptions
std::invalid_argumentIf one weight is smaller than zero.
std::invalid_argumentIf the sum of weights is zero.
std::invalid_argumentIf one weight is NAN or INFINITY.
Note
NAN is checked by weight_a != weight_a, but this might not work if compiled with g++ with the option -fastmath.

◆ convert_mj_to_kg_proportionally()

ForageFraction Fauna::convert_mj_to_kg_proportionally ( const ForageValues< ForageValueTag::PositiveAndZero > &  mj_per_kg,
const ForageValues< ForageValueTag::ZeroToOne > &  mj_proportions 
)

Convert forage energy to mass keeping the energy-wise proportions.

Parameters
mj_per_kgEnergy content of the forage [MJ/kgDM].
mj_proportionsEnergy-wise proportions [MJ/MJ]. This doesn’t need to add up to 1.0.
Returns
Mass-wise proportions [kgDM/kgDM] whose sum equals the sum of mj_proportions. When converting back from mass to energy, the proportion relative to each other will be like in mj_proportions.

◆ create_directories()

void Fauna::create_directories ( const std::string  path,
const mode_t  mode = 0755 
)

Create a folder including all its parent folders.

This function works for Windows und Unix systems.

Parameters
pathThe absolute or relative path to the final directory. As a file separator use backslash () on Windows and slash (/) on Linux.
modeFile permissions (only applicable to Unix filesystems.
Exceptions
std::runtime_errorIf an error occurred.

◆ directory_exists()

bool Fauna::directory_exists ( const std::string  path)

Check whether a folder in the filesystem exists.

This function works for Windows und Unix systems.

Parameters
pathThe absolute or relative path to the directory.
Returns
True if path exists, false if not.

◆ file_exists()

bool Fauna::file_exists ( const std::string &  path)

Check whether a file in the filesystem exists.

This function works for Windows und Unix systems.

Parameters
pathThe absolute or relative path to the file in question.
Returns
True if path exists, false if not.

◆ foragefractions_to_foragevalues()

ForageValues< ForageValueTag::PositiveAndZero > Fauna::foragefractions_to_foragevalues ( const ForageValues< ForageValueTag::ZeroToOne > &  fractions)

Convert forage fractions (in [0,1]) into values in [0,∞].

Parameters
fractionsA ForageValues object limited to values between zero and one.
Returns
A ForageValues object that has no upper limit for values.

◆ foragevalues_to_foragefractions()

ForageFraction Fauna::foragevalues_to_foragefractions ( const ForageValues< ForageValueTag::PositiveAndZero values,
const double  tolerance 
)

Convert forage values to fractional values.

Parameters
valuesThe object to convert.
toleranceBy how much a value can exceed 1.0 and still be set to 1.0. E.g. tolerance == 0.1 means that any values from 1.0 to 1.1 will be set to 1.0.
Returns
Forage fractional values within [0,1].
Exceptions
std::invalid_argumentIf one number in values exceeds 1.0 + tolerance.
std::invalid_argumentIf tolerance < 0.0.

◆ get_conductance_bradley_deavers_1980()

double Fauna::get_conductance_bradley_deavers_1980 ( const double  bodymass)
inline

Get full body conductance [W/°C] after Bradley & Deavers (1980) [6] The formula is taken from Peters (1983)[53], which is based on data by Bradley & Deavers (1980).

\[
C = 0.224 * M^{0.574}
\]

230 conductance values from 192 mammal species with body weights ranging from 3.5 g to 150 kg.

Parameters
bodymassCurrent body weight [kg/ind].
Exceptions
std::invalid_argumentIf bodymass <= 0.
Returns
Full body conductance [W/°C].

◆ get_conductance_cuyler_oeritsland_2004()

double Fauna::get_conductance_cuyler_oeritsland_2004 ( const double  bodymass,
const FurSeason  season 
)
inline

Extrapolate conductance from reindeer fur.

Cuyler & Øritsland (2004)[11] measured conductivity values of reindeer (Rangifer tarandus) pelts in calm air and dry conditions:

  • 0.63 W/(°C*m²) in winter
  • 2.16 W/(°C*m²) in summer

We assume a body mass of 60 kg for an adult reindeer (Soppela et al. 1986 [63]). Body surface is approximated by a formula from Hudson & White (1985) [29] as $0.09*M^{0.66}$ (in m²).

The whole-body conductance in W/°C is then:

  • for winter $0.63 * 0.09 * 60^{0.66} = 0.8$
  • for summer $2.16 * 0.09 * 60^{0.66} = 2.9$

Both Bradley & Deavers (1980)[6] and Fristoe et al. (2014)[18] suggest that the allometric exponent for body mass for whole-body conductance among mammals is about 0.57. We derive an allometric function for the conductance $C = x*M^{0.56}$ (in W/°C) that contains the value from reindeer pelts.

\[
x_{summer} = 2.9 * 60^{-0.56} = 0.29 \\\\
x_{winter} = 0.8 * 60^{-0.56} = 0.08
\]

Parameters
bodymassAdult body mass [kg/ind].
seasonWhether it’s summer or winter pelt.
Returns
Extrapolated whole-body conductance for an Arctic species [W/°C].
Exceptions
std::invalid_argumentIf bodymass <= 0.

◆ get_digestive_limit_illius_gordon_1992()

double Fauna::get_digestive_limit_illius_gordon_1992 ( const double  bodymass_adult,
const double  bodymass,
const double  digestibility,
const std::array< double, 3 > &  ijk 
)

Get digestion-limited daily grass energy intake after Illius & Gordon (1992)

The model of digestive passage rates by Illius & Gordon (1992)[33] constrains maximum daily energy intake $I_{dig[MJ/day]}$ by gut size and retention time.

\[
I_{dig[MJ/day]} = i * e^{jd} * M_{ad_{[kg]}}^{(ke^d+0.73)} * u_g
\]

  • e: Euler number
  • d: proportional digestibility
  • $M_{ad}$: Adult body mass in kg
  • $u_g = (M/M_{ad})^{0.75}$ is a scaling factor for gut capacity, introduced by Illius & Gordon (1999) [34]
  • Parameters i, j, and k are derived from regression analysis with 12 mammalian herbivores (0.05–547 kg) and are specific to hindgut fermenters and ruminants (Shipley et al. 1999)[61]. They are specified per HFT in Hft::digestion_i_g_1992_ijk
Parameters
bodymass_adultBody mass [kg] at physical maturity.
bodymasscurrent body mass [kg/ind]
digestibilityproportional digestibility of the grass forage
ijkThe parameter constants i, j, k for the exponential function.
Returns
Maximum energy intake of grass [MJ/day/ind]
Exceptions
std::invalid_argumentIf bodymass_adult<=0.0.
std::invalid_argumentIf bodymass<=0.0
std::logic_errorIf bodymass > bodymass_adult.
See also
DigestiveLimit::IlliusGordon1992

◆ get_expenditure_taylor_1981()

double Fauna::get_expenditure_taylor_1981 ( const double  current_bodymass,
const double  adult_bodymass 
)
inline

Energy expenditure [MJ/ind/day] based on cattle from Taylor et al. (1981)

Taylor et al. (1981)[66] Daily energy expenditure is given by

\[
E [\frac{MJ}{day*ind}] = 0.4 * M * M_{ad}^{-0.27}
\]

where M is current body mass [kg/ind] and $M_{ad}$ is adult body mass.

Returns
energy expenditure in MJ for one herbivore individual per day [MJ/day/ind]

◆ get_expenditure_zhu_et_al_2018()

double Fauna::get_expenditure_zhu_et_al_2018 ( const double  bodymass,
const double  ambient_temperature 
)
inline

Daily expenditure by Zhu et al (2018) [70].

\[
E = \frac{k_2}{e^{k_1*T}} * A^{0.75}
\]

  • $E$: Daily energy expenditure [MJ/ind/day].
  • $A$: Body mass [kg/ind].
  • $k_1 = 0.0079$: Constant, derived from regression analysis of data from Anderson & Jetz (2005)[1].
  • $k_2 = 0.36$: Constant, calibrated to yield a range close to the values in Illius & O’Connor (2000)[35].
    Parameters
    bodymassCurrent body mass [kg/ind].
    ambient_temperatureLong-term mean air temperature [°C].
    Returns
    Daily energy expenditure per individual [MJ/ind/day].
    Exceptions
    std::invalid_argumentIf bodymass <= 0.
    See also
    Fauna::EC_ZHU_2018

◆ get_forage_type_name()

const std::string & Fauna::get_forage_type_name ( const ForageType  ft)

Get a short, lowercase string identifier for a forage type.

The names are

  • unique,
  • lowercase,
  • without blank spaces or tabs, newlines etc.,
  • without comma oder underscore (which might be used to combine column names in the output).

◆ get_net_energy_from_gross_energy()

ForageEnergyContent Fauna::get_net_energy_from_gross_energy ( const ForageEnergyContent ge_content,
const Digestibility digestibility,
const double  me_coefficient,
const double  k_maintenance 
)
inline

Get net energy content of the forage [MJ/kgDM].

See Energy Content of Forage for a detailed description of this net energy model.

[f NE = ME * k_m = DE * ME/DE * k_m = GE * DMD * ME/DE * k_m ]f

Parameters
ge_contentGross energy (GE), also called combustion energy, in dry matter. [MJ/kgDM]
digestibilityProportional dry-matter digestibility (DMD).
me_coefficientMetabolizable energy coefficient, i.e. the ratio of metabolizable energy to digestible energy, ME/DE. [fractional]
k_maintenanceNet energy coefficient (k_m) for maintenance, i.e. the proportion of metabolizable remaining energy after heat increment. [fractional]
Returns
Net energy content [MJ/kgDM].
Exceptions
std::invalid_argumentIf either me_coefficient or k_maintenance not in interval (0,1).
See also
Energy Content of Forage
Parameters::forage_gross_energy
Hft::digestion_me_coefficient
Hft::digestion_k_maintenance
Hft::digestion_net_energy_model
NetEnergyModel

◆ get_thermoregulatory_expenditure()

double Fauna::get_thermoregulatory_expenditure ( const double  thermoneutral_rate,
const double  conductance,
const double  core_temperature,
const double  ambient_temperature 
)

Calculate additional energy requirements to keep body temperature.

Please see Thermoregulation by Conductance for the formulas and concepts.

Parameters
thermoneutral_rateThermoneutral expenditure [MJ/ind/day].
conductanceWhole-body thermal conductance of the animal [W/°C].
core_temperatureBody core temperature [°C].
ambient_temperatureAmbient air temperature [°C].
Returns
Additional expenditure for thermoregulation, i.e. heat loss [MJ/ind/day].
Exceptions
std::invalid_argumentIf any parameter is out of range.

◆ operator*() [1/3]

ForageValues< ForageValueTag::PositiveAndZero > Fauna::operator* ( const double  lhs,
const ForageFraction rhs 
)
inline

Multiply forage fractions with coefficient, allowing numbers >0.

Note that this function takes the double value on the left side whereas the member function ForageValues<>::operator*() takes the double value as the right operand and returns a ForageValues<> object of the same template, which doesn’t allow numbers exceeding 1.0 in case of the ForageFraction (=ForageValues<ForageValueTag::ZeroToOne>) class.

◆ operator*() [2/3]

ForageValues< ForageValueTag::PositiveAndZero > Fauna::operator* ( const ForageFraction lhs,
const ForageValues< ForageValueTag::PositiveAndZero > &  rhs 
)
inline

Multiply forage fractions with coefficient, allowing numbers >0.

Note that this function takes the double value on the left side whereas the member function ForageValues<>::operator*() takes the double value as the right operand and returns a ForageValues<> object of the same template, which doesn’t allow numbers exceeding 1.0 in case of the ForageFraction (=ForageValues<ForageValueTag::ZeroToOne>) class.

◆ operator*() [3/3]

ForageValues< ForageValueTag::PositiveAndZero > Fauna::operator* ( const ForageValues< ForageValueTag::PositiveAndZero > &  lhs,
const ForageFraction rhs 
)
inline

Multiply forage fractions with coefficient, allowing numbers >0.

Note that this function takes the double value on the left side whereas the member function ForageValues<>::operator*() takes the double value as the right operand and returns a ForageValues<> object of the same template, which doesn’t allow numbers exceeding 1.0 in case of the ForageFraction (=ForageValues<ForageValueTag::ZeroToOne>) class.

◆ remove_directory()

void Fauna::remove_directory ( const std::string &  path)

Delete a directory recursively.

Warning
Don’t use this function (in its current implementation) for the actual simulation code. It uses system() to call to the shell, but might fail without warning.
Parameters
pathThe absolute or relative path to the directory.
Exceptions
std::invalid_argumentIf path does not exist.
std::runtime_errorIf the system shell is not available throuh system().

◆ watts_to_MJ_per_day()

double Fauna::watts_to_MJ_per_day ( const double  W)
inline

Convert Watts (=J/s) to MJ/day.

Variable Documentation

◆ FORAGE_TYPE_COUNT

const int Fauna::FORAGE_TYPE_COUNT = (int)ForageType::Inedible + 1

Number of elements in ForageType.

◆ FORAGE_TYPES

const std::set< ForageType > Fauna::FORAGE_TYPES = get_all_forage_types()

Set with all enum entries of ForageType except ForageType::Inedible. This set serves mainly the purpose to iterate easily over all forage types:

for (const auto& forage_type : FORAGE_TYPES) {
\/\/Do your calculations
}
const std::set< ForageType > FORAGE_TYPES
Definition: forage_types.cpp:27