Goose Management Model ODdox  1.02
GooseMemoryLocation Class Reference

a data structure to hold goose memory location attributes More...

#include <GooseMemoryMap.h>

Public Member Functions

void CalcScore (int a_dist, double a_flightcost, int a_expectedforagingtime)
 Updates the m_score value. More...
 
 GooseMemoryLocation ()
 GooseMemoryLocation default constructor. More...
 
bool operator< (const GooseMemoryLocation &gml)
 operator definition for comparing polygon id numbers More...
 
bool ShouldDelete ()
 Test to see if a memory is too old to remember any longer. More...
 

Public Attributes

int m_age
 how old the memory is More...
 
double m_foodresource
 The max food intake rate (kJ/min) at the location. More...
 
double m_grain
 the grain resource at the location as intake rate kJ/min More...
 
double m_grazing
 the grazing resource at the location as intake rate kJ/min
More...
 
double m_maize
 the maize resource at the location as intake rate kJ/min More...
 
int m_polygonid
 the unique polygon identification More...
 
double m_score
 A score used to assess the location. More...
 
double m_threat
 the threat-level memory strength More...
 
int m_x
 x-coordinate More...
 
int m_y
 y-coordinate More...
 

Static Public Attributes

static int m_infinitememorystop = 0
 the age at which a memory is removed. More...
 

Detailed Description

a data structure to hold goose memory location attributes

Definition at line 41 of file GooseMemoryMap.h.

Constructor & Destructor Documentation

◆ GooseMemoryLocation()

GooseMemoryLocation::GooseMemoryLocation ( )
inline

GooseMemoryLocation default constructor.

Definition at line 69 of file GooseMemoryMap.h.

69  {
70  m_age = 0; m_x = -1; m_y = -1; m_polygonid = -1, m_threat = 0, m_grain = 0; m_maize = 0.0; m_grazing = 0.0; m_foodresource = 0.0; m_infinitememorystop = 0;
71  }

References m_age, m_foodresource, m_grain, m_grazing, m_infinitememorystop, m_maize, m_polygonid, m_threat, m_x, and m_y.

Member Function Documentation

◆ CalcScore()

void GooseMemoryLocation::CalcScore ( int  a_dist,
double  a_flightcost,
int  a_expectedforagingtime 
)
inline

Updates the m_score value.

Definition at line 78 of file GooseMemoryMap.h.

79  {
80  double cost = a_dist * a_flightcost;
81  double score = (m_foodresource * a_expectedforagingtime) - cost;
82  m_score = score * (1 - m_threat);
83  }

References m_foodresource, m_score, and m_threat.

◆ operator<()

bool GooseMemoryLocation::operator< ( const GooseMemoryLocation gml)
inline

operator definition for comparing polygon id numbers

Definition at line 73 of file GooseMemoryMap.h.

74  {
75  return m_polygonid < gml.m_polygonid;
76  }

References m_polygonid.

◆ ShouldDelete()

bool GooseMemoryLocation::ShouldDelete ( )
inline

Test to see if a memory is too old to remember any longer.

Definition at line 85 of file GooseMemoryMap.h.

85 { return (m_age > m_infinitememorystop); }

References m_age, and m_infinitememorystop.

Referenced by IsMarkedToDelete().

Member Data Documentation

◆ m_age

int GooseMemoryLocation::m_age

how old the memory is

Definition at line 45 of file GooseMemoryMap.h.

Referenced by GooseMemoryLocation(), and ShouldDelete().

◆ m_foodresource

double GooseMemoryLocation::m_foodresource

The max food intake rate (kJ/min) at the location.

Definition at line 59 of file GooseMemoryMap.h.

Referenced by CalcScore(), Goose_Base::EvaluateForageToHopLoc(), GooseMemoryLocation(), GooseMemoryMap::MemAdd(), Goose_Base::On_Bang(), and Goose_Base::st_ChooseForageLocation().

◆ m_grain

double GooseMemoryLocation::m_grain

the grain resource at the location as intake rate kJ/min

Definition at line 53 of file GooseMemoryMap.h.

Referenced by Goose_Base::EvaluateForageToHopLoc(), GooseMemoryLocation(), GooseMemoryMap::MemAdd(), and Goose_Base::st_ChooseForageLocation().

◆ m_grazing

double GooseMemoryLocation::m_grazing

the grazing resource at the location as intake rate kJ/min

Definition at line 57 of file GooseMemoryMap.h.

Referenced by Goose_Base::EvaluateForageToHopLoc(), GooseMemoryLocation(), GooseMemoryMap::MemAdd(), and Goose_Base::st_ChooseForageLocation().

◆ m_infinitememorystop

int GooseMemoryLocation::m_infinitememorystop = 0
static

the age at which a memory is removed.

Definition at line 65 of file GooseMemoryMap.h.

Referenced by GooseMemoryLocation(), GooseMemoryMap::GooseMemoryMap(), and ShouldDelete().

◆ m_maize

double GooseMemoryLocation::m_maize

the maize resource at the location as intake rate kJ/min

Definition at line 55 of file GooseMemoryMap.h.

Referenced by Goose_Base::EvaluateForageToHopLoc(), GooseMemoryLocation(), GooseMemoryMap::MemAdd(), and Goose_Base::st_ChooseForageLocation().

◆ m_polygonid

int GooseMemoryLocation::m_polygonid

◆ m_score

double GooseMemoryLocation::m_score

◆ m_threat

double GooseMemoryLocation::m_threat

◆ m_x

int GooseMemoryLocation::m_x

◆ m_y

int GooseMemoryLocation::m_y

The documentation for this class was generated from the following files:
GooseMemoryLocation::m_score
double m_score
A score used to assess the location.
Definition: GooseMemoryMap.h:63
GooseMemoryLocation::m_grazing
double m_grazing
the grazing resource at the location as intake rate kJ/min
Definition: GooseMemoryMap.h:57
GooseMemoryLocation::m_age
int m_age
how old the memory is
Definition: GooseMemoryMap.h:45
GooseMemoryLocation::m_foodresource
double m_foodresource
The max food intake rate (kJ/min) at the location.
Definition: GooseMemoryMap.h:59
GooseMemoryLocation::m_y
int m_y
y-coordinate
Definition: GooseMemoryMap.h:49
GooseMemoryLocation::m_infinitememorystop
static int m_infinitememorystop
the age at which a memory is removed.
Definition: GooseMemoryMap.h:65
GooseMemoryLocation::m_maize
double m_maize
the maize resource at the location as intake rate kJ/min
Definition: GooseMemoryMap.h:55
GooseMemoryLocation::m_x
int m_x
x-coordinate
Definition: GooseMemoryMap.h:47
GooseMemoryLocation::m_threat
double m_threat
the threat-level memory strength
Definition: GooseMemoryMap.h:61
GooseMemoryLocation::m_polygonid
int m_polygonid
the unique polygon identification
Definition: GooseMemoryMap.h:51
GooseMemoryLocation::m_grain
double m_grain
the grain resource at the location as intake rate kJ/min
Definition: GooseMemoryMap.h:53