Gadget
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Protected Attributes | List of all members
SuitFunc Class Referenceabstract

This is the base class used to calculate the predator prey suitability value. More...

#include <suitfunc.h>

Inheritance diagram for SuitFunc:
Inheritance graph
Collaboration diagram for SuitFunc:
Collaboration graph

Public Member Functions

 SuitFunc (const char *givenname)
 This is the default SuitFunc constructor. More...
 
virtual ~SuitFunc ()
 This is the default SuitFunc destructor. More...
 
const ModelVariableVectorgetConstants () const
 This function will return the value of the selection function parameters. More...
 
void readConstants (CommentStream &infile, const TimeClass *const TimeInfo, Keeper *const keeper)
 This function will read the value of the suitability function parameters from file. More...
 
void updateConstants (const TimeClass *const TimeInfo)
 This function will update the suitability function parameters. More...
 
int didChange (const TimeClass *const TimeInfo)
 This function will check to see if the suitability function parameters have changed. More...
 
virtual int usesPredLength ()=0
 This will return 1 if the suitability function is based on the predator length, 0 otherwise. More...
 
virtual int usesPreyLength ()=0
 This will return 1 if the suitability function is based on the prey length, 0 otherwise. More...
 
virtual void setPredLength (double length)
 This will set the predator length. More...
 
virtual void setPreyLength (double length)
 This will set the prey length. More...
 
virtual double calculate ()=0
 This will return the suitability value that has been calculated. More...
 
int numConstants ()
 This will return the number of constants used to calculate the suitability value. More...
 
- Public Member Functions inherited from HasName
 HasName ()
 This is the default HasName constructor. More...
 
virtual ~HasName ()
 This is the default HasName destructor. More...
 
 HasName (const char *givenname)
 This is the HasName constructor for a specified name. More...
 
const char * getName () const
 This will return a null terminated text string containing the name of the object. More...
 

Protected Attributes

ModelVariableVector coeff
 This is the ModelVariableVector of suitability function constants. More...
 

Detailed Description

This is the base class used to calculate the predator prey suitability value.

Note
This will always be overridden by the derived classes that actually calculate the suitability value

Constructor & Destructor Documentation

◆ SuitFunc()

SuitFunc::SuitFunc ( const char *  givenname)
inline

This is the default SuitFunc constructor.

Parameters
givennameis the name for the SuitFunc selection function

◆ ~SuitFunc()

virtual SuitFunc::~SuitFunc ( )
inlinevirtual

This is the default SuitFunc destructor.

Member Function Documentation

◆ calculate()

virtual double SuitFunc::calculate ( )
pure virtual

This will return the suitability value that has been calculated.

Returns
0 (will be overridden in derived classes)

Implemented in AndersenFleetSuitFunc, GammaSuitFunc, RichardsSuitFunc, StraightUnboundedSuitFunc, InverseSuitFunc, StraightSuitFunc, ExpSuitFuncL50, AndersenSuitFunc, ConstSuitFunc, and ExpSuitFuncA.

◆ didChange()

int SuitFunc::didChange ( const TimeClass *const  TimeInfo)

This function will check to see if the suitability function parameters have changed.

Parameters
TimeInfois the TimeClass for the current model
Returns
1 if the parameters have changed, 0 otherwise

◆ getConstants()

const ModelVariableVector & SuitFunc::getConstants ( ) const

This function will return the value of the selection function parameters.

Returns
v, a ModelVariableVector of the parameters

◆ numConstants()

int SuitFunc::numConstants ( )
inline

This will return the number of constants used to calculate the suitability value.

Returns
number

◆ readConstants()

void SuitFunc::readConstants ( CommentStream infile,
const TimeClass *const  TimeInfo,
Keeper *const  keeper 
)

This function will read the value of the suitability function parameters from file.

Parameters
infileis the CommentStream to read the parameters from
TimeInfois the TimeClass for the current model
keeperis the Keeper for the current model

◆ setPredLength()

void SuitFunc::setPredLength ( double  length)
virtual

This will set the predator length.

Parameters
lengthis the predator length

Reimplemented in RichardsSuitFunc, AndersenSuitFunc, and ExpSuitFuncA.

◆ setPreyLength()

void SuitFunc::setPreyLength ( double  length)
virtual

This will set the prey length.

Parameters
lengthis the prey length

Reimplemented in AndersenFleetSuitFunc, GammaSuitFunc, RichardsSuitFunc, StraightUnboundedSuitFunc, InverseSuitFunc, StraightSuitFunc, ExpSuitFuncL50, AndersenSuitFunc, and ExpSuitFuncA.

◆ updateConstants()

void SuitFunc::updateConstants ( const TimeClass *const  TimeInfo)

This function will update the suitability function parameters.

Parameters
TimeInfois the TimeClass for the current model

◆ usesPredLength()

virtual int SuitFunc::usesPredLength ( )
pure virtual

This will return 1 if the suitability function is based on the predator length, 0 otherwise.

Returns
0 (will be overridden in derived classes)

Implemented in AndersenFleetSuitFunc, GammaSuitFunc, RichardsSuitFunc, StraightUnboundedSuitFunc, InverseSuitFunc, StraightSuitFunc, ExpSuitFuncL50, AndersenSuitFunc, ConstSuitFunc, and ExpSuitFuncA.

◆ usesPreyLength()

virtual int SuitFunc::usesPreyLength ( )
pure virtual

This will return 1 if the suitability function is based on the prey length, 0 otherwise.

Returns
0 (will be overridden in derived classes)

Implemented in AndersenFleetSuitFunc, GammaSuitFunc, RichardsSuitFunc, StraightUnboundedSuitFunc, InverseSuitFunc, StraightSuitFunc, ExpSuitFuncL50, AndersenSuitFunc, ConstSuitFunc, and ExpSuitFuncA.

Member Data Documentation

◆ coeff

ModelVariableVector SuitFunc::coeff
protected

This is the ModelVariableVector of suitability function constants.


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