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

Function object for herbivore death after given lifespan is reached. More...

#include <mortality_factors.h>

Public Member Functions

 GetSimpleLifespanMortality (const int lifespan_years)
 Constructor. More...
 
double operator() (const int age_days) const
 Calculate mortality for today. More...
 

Private Attributes

int lifespan_years
 

Detailed Description

Function object for herbivore death after given lifespan is reached.

Constructor & Destructor Documentation

◆ GetSimpleLifespanMortality()

GetSimpleLifespanMortality::GetSimpleLifespanMortality ( const int  lifespan_years)

Constructor.

Parameters
lifespan_yearsLifespan in years
Exceptions
std::invalid_argumentIf lifespan_years<=0.

Member Function Documentation

◆ operator()()

double Fauna::GetSimpleLifespanMortality::operator() ( const int  age_days) const
inline

Calculate mortality for today.

Parameters
age_daysCurrent age of the herbivore in days (0=first day of life).
Exceptions
std::invalid_argumentIf age_days<0.
Returns
0.0 if age<lifespan; 1.0 if age>=lifespan

Member Data Documentation

◆ lifespan_years

int Fauna::GetSimpleLifespanMortality::lifespan_years
private

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