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

Function object to calculate death at low body fat. More...

#include <mortality_factors.h>

Public Member Functions

 GetStarvationMortalityThreshold (const double min_bodyfat=DEFAULT_MIN_BODYFAT)
 Constructor. More...
 
double operator() (const double bodyfat) const
 Get daily mortality. More...
 

Static Public Attributes

static const double DEFAULT_MIN_BODYFAT = 0.005
 Default minimum body fat threshold [kg/kg]. More...
 

Private Attributes

double min_bodyfat
 

Detailed Description

Function object to calculate death at low body fat.

Death simply occurs if proportional body fat drops below a given threshold.

Constructor & Destructor Documentation

◆ GetStarvationMortalityThreshold()

GetStarvationMortalityThreshold::GetStarvationMortalityThreshold ( const double  min_bodyfat = DEFAULT_MIN_BODYFAT)

Constructor.

Parameters
min_bodyfatMinimum body fat threshold [kg/kg].
Exceptions
std::invalid_argumentIf min_bodyfat not in [0,1).

Member Function Documentation

◆ operator()()

double GetStarvationMortalityThreshold::operator() ( const double  bodyfat) const

Get daily mortality.

Returns
0.0 if bodyfat<min_bodyfat, else 1.0
Exceptions
std::invalid_argumentIf bodyfat not in [0,1).

Member Data Documentation

◆ DEFAULT_MIN_BODYFAT

const double GetStarvationMortalityThreshold::DEFAULT_MIN_BODYFAT = 0.005
static

Default minimum body fat threshold [kg/kg].

◆ min_bodyfat

double Fauna::GetStarvationMortalityThreshold::min_bodyfat
private

The documentation for this class was generated from the following files: