Loading [MathJax]/extensions/ams.js
ALMaSS  1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PettiforFeedingTimeCurveClass Class Reference

A curve for feeding time derived from Pettifor et al (2000). Journal of Applied Ecology 37: 103-135. More...

#include <CurveClasses.h>

Inheritance diagram for PettiforFeedingTimeCurveClass:
CurveClass

Public Member Functions

 PettiforFeedingTimeCurveClass (double a_A, double a_B, double a_C, bool a_reversecurve, double a_MaxX, double a_MinX, const char *a_name)
 
virtual ~PettiforFeedingTimeCurveClass ()
 
- Public Member Functions inherited from CurveClass
 CurveClass (bool a_reversecurve, double a_MaxX, double a_MinX, const char *a_name)
 
virtual ~CurveClass ()
 
virtual double GetY (double a_X)
 
virtual void WriteDataFile (int a_step)
 

Protected Member Functions

virtual double DoCalc (double a_x)
 The specific calulation of y for a given x. More...
 
- Protected Member Functions inherited from CurveClass
virtual void CalculateCurveValues ()
 fills in the curve for 10,000 values from MinX to MaxX More...
 

Protected Attributes

double m_parameterA
 Parameter A is the maximum feeding time. More...
 
double m_parameterB
 Parameter B is the minimum feeding time. More...
 
double m_parameterC
 Parameter C is the threshold floksize above which feeding time remains at maximum. More...
 
- Protected Attributes inherited from CurveClass
double m_parameterMaxX
 A parameter for a the maximum value of X we consider. More...
 
double m_parameterMinX
 A parameter for a the minimum value of X we consider. More...
 
double m_step
 The size of each step on the X-axis. More...
 
double m_step_inv
 The inverse of m_step. More...
 
double * m_values
 The values of y we store for each X. More...
 
string m_name
 A scaler for the x-values. More...
 
bool m_reversecurve
 If true the values fall from 1 to zero, otherwise its zero to 1. More...
 

Detailed Description

A curve for feeding time derived from Pettifor et al (2000). Journal of Applied Ecology 37: 103-135.

Constructor & Destructor Documentation

◆ PettiforFeedingTimeCurveClass()

PettiforFeedingTimeCurveClass::PettiforFeedingTimeCurveClass ( double  a_A,
double  a_B,
double  a_C,
bool  a_reversecurve,
double  a_MaxX,
double  a_MinX,
const char *  a_name 
)
211  : CurveClass(a_reversecurve, a_MaxX, a_MinX, a_name) {
212  m_parameterA = a_A; // Max feeding time
213  m_parameterB = a_B; // Min feeding time
214  m_parameterC = a_C; // Flock size threshold
216 }

References CurveClass::CalculateCurveValues(), m_parameterA, m_parameterB, and m_parameterC.

◆ ~PettiforFeedingTimeCurveClass()

PettiforFeedingTimeCurveClass::~PettiforFeedingTimeCurveClass ( )
virtual
219  {
220  ;
221 }

Member Function Documentation

◆ DoCalc()

double PettiforFeedingTimeCurveClass::DoCalc ( double  a_x)
protectedvirtual

The specific calulation of y for a given x.

Reimplemented from CurveClass.

224  {
225  if (a_x >= m_parameterC) return m_parameterA;
226  else return m_parameterB + a_x * ((m_parameterA - m_parameterB) / m_parameterC);
227 }

References m_parameterA, m_parameterB, and m_parameterC.

Member Data Documentation

◆ m_parameterA

double PettiforFeedingTimeCurveClass::m_parameterA
protected

Parameter A is the maximum feeding time.

Referenced by DoCalc(), and PettiforFeedingTimeCurveClass().

◆ m_parameterB

double PettiforFeedingTimeCurveClass::m_parameterB
protected

Parameter B is the minimum feeding time.

Referenced by DoCalc(), and PettiforFeedingTimeCurveClass().

◆ m_parameterC

double PettiforFeedingTimeCurveClass::m_parameterC
protected

Parameter C is the threshold floksize above which feeding time remains at maximum.

Referenced by DoCalc(), and PettiforFeedingTimeCurveClass().


The documentation for this class was generated from the following files:
PettiforFeedingTimeCurveClass::m_parameterB
double m_parameterB
Parameter B is the minimum feeding time.
Definition: CurveClasses.h:159
PettiforFeedingTimeCurveClass::m_parameterA
double m_parameterA
Parameter A is the maximum feeding time.
Definition: CurveClasses.h:157
CurveClass::CalculateCurveValues
virtual void CalculateCurveValues()
fills in the curve for 10,000 values from MinX to MaxX
Definition: CurveClasses.cpp:57
CurveClass::CurveClass
CurveClass(bool a_reversecurve, double a_MaxX, double a_MinX, const char *a_name)
Definition: CurveClasses.cpp:40
PettiforFeedingTimeCurveClass::m_parameterC
double m_parameterC
Parameter C is the threshold floksize above which feeding time remains at maximum.
Definition: CurveClasses.h:161