Gadget
Public Member Functions | Protected Attributes | List of all members
Suits Class Reference

This is the class used to calculate and store the suitability values for all the preys of a single predator. More...

#include <suits.h>

Collaboration diagram for Suits:
Collaboration graph

Public Member Functions

 Suits ()
 This is the default Suits constructor. More...
 
 ~Suits ()
 This is the default Suits destructor. More...
 
void addPrey (const char *preyname, SuitFunc *suitf)
 This function will add suitability values for a given prey. More...
 
void deletePrey (int i, Keeper *const keeper)
 This function will delete suitability values for a given prey. More...
 
const char * getPreyName (int i) const
 This function will return the name of a given prey. More...
 
void Initialise (const Predator *const pred)
 This will initialise the preys that will be consumed by the predator. More...
 
int numPreys () const
 This function will return the number of preys that have suitability values. More...
 
int didChange (int i, const TimeClass *const TimeInfo)
 This function will check to see if the suitability parameters for a given prey have changed on the current timestep. More...
 
const DoubleMatrixgetSuitability (int i) const
 This function will return the calculated suitability values for a given prey. More...
 
void Reset (const Predator *const pred, const TimeClass *const TimeInfo)
 This function will reset the suitability information for a given predator. More...
 

Protected Attributes

CharPtrVector preynames
 This is the CharPtrVector of prey names. More...
 
SuitFuncPtrVector suitFunction
 This is the SuitFuncPtrVector of the suitability functions used when calculating the consumption of the preys. More...
 
DoubleMatrixPtrVector preCalcSuitability
 This is the DoubleMatrixPtrVector of calculated suitability values. More...
 

Detailed Description

This is the class used to calculate and store the suitability values for all the preys of a single predator.

Constructor & Destructor Documentation

◆ Suits()

Suits::Suits ( )
inline

This is the default Suits constructor.

◆ ~Suits()

Suits::~Suits ( )

This is the default Suits destructor.

Member Function Documentation

◆ addPrey()

void Suits::addPrey ( const char *  preyname,
SuitFunc suitf 
)

This function will add suitability values for a given prey.

Parameters
preynameis the name of the prey to be added
suitfis the SuitFunc that defines the suitability values

◆ deletePrey()

void Suits::deletePrey ( int  i,
Keeper *const  keeper 
)

This function will delete suitability values for a given prey.

Parameters
iis the index of the prey to be deleted
keeperis the Keeper for the current model

◆ didChange()

int Suits::didChange ( int  i,
const TimeClass *const  TimeInfo 
)
inline

This function will check to see if the suitability parameters for a given prey have changed on the current timestep.

Parameters
iis the index of the prey
TimeInfois the TimeClass for the current model
Returns
1 if the values have changed, 0 otherwise

◆ getPreyName()

const char* Suits::getPreyName ( int  i) const
inline

This function will return the name of a given prey.

Parameters
iis the index of the prey
Returns
name of the prey

◆ getSuitability()

const DoubleMatrix& Suits::getSuitability ( int  i) const
inline

This function will return the calculated suitability values for a given prey.

Parameters
iis the index of the prey
Returns
preCalcSuitability[i], the DoubleMatrix containing the suitability values

◆ Initialise()

void Suits::Initialise ( const Predator *const  pred)

This will initialise the preys that will be consumed by the predator.

Parameters
predis the Predator that the suitability functions are defined for

◆ numPreys()

int Suits::numPreys ( ) const
inline

This function will return the number of preys that have suitability values.

Returns
number of preys

◆ Reset()

void Suits::Reset ( const Predator *const  pred,
const TimeClass *const  TimeInfo 
)

This function will reset the suitability information for a given predator.

Parameters
predis the Predator that the suitability functions are defined for
TimeInfois the TimeClass for the current model

Member Data Documentation

◆ preCalcSuitability

DoubleMatrixPtrVector Suits::preCalcSuitability
protected

This is the DoubleMatrixPtrVector of calculated suitability values.

Note
The indices for this object are [prey][predator length][prey length]

◆ preynames

CharPtrVector Suits::preynames
protected

This is the CharPtrVector of prey names.

◆ suitFunction

SuitFuncPtrVector Suits::suitFunction
protected

This is the SuitFuncPtrVector of the suitability functions used when calculating the consumption of the preys.


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