ALMaSS Skylark ODDox  1.1
The skylark model description following ODdox protocol
TAnimal Class Reference

The base class for all ALMaSS animal classes. More...

#include <PopulationManager.h>

Public Member Functions

unsigned SupplyFarmOwnerRef ()
 
AnimalPosition SupplyPosition ()
 
APoint SupplyPoint ()
 
int SupplyPolygonRef ()
 
int Supply_m_Location_x ()
 
int Supply_m_Location_y ()
 
virtual void KillThis ()
 
virtual void CopyMyself ()
 
void SetX (int a_x)
 
void SetY (int a_y)
 
 TAnimal (int x, int y, Landscape *L)
 
virtual void BeginStep (void)
 BeingStep behaviour - must be implemented in descendent classes. More...
 
virtual void Step (void)
 Step behaviour - must be implemented in descendent classes. More...
 
virtual void EndStep (void)
 EndStep behaviour - must be implemented in descendent classes. More...
 
virtual void ReinitialiseObject (int x, int y, Landscape *L)
 Used to re-use an object - must be implemented in descendent classes. More...
 
virtual int WhatState ()
 
virtual void Dying ()
 
void CheckManagement (void)
 
void CheckManagementXY (int x, int y)
 
virtual bool OnFarmEvent (FarmToDo)
 
- Public Member Functions inherited from TALMaSSObject
int GetCurrentStateNo ()
 Returns the current state number. More...
 
void SetCurrentStateNo (int a_num)
 Sets the current state number. More...
 
bool GetStepDone ()
 Returns the step done indicator flag. More...
 
void SetStepDone (bool a_bool)
 Sets the step done indicator flag. More...
 
virtual void ReinitialiseObject ()
 Used to re-use an object - must be implemented in descendent classes. More...
 
 TALMaSSObject ()
 The constructor for TALMaSSObject. More...
 
virtual ~TALMaSSObject ()
 The destructor for TALMaSSObject. More...
 
void OnArrayBoundsError ()
 Used for debugging only, tests basic object properties. More...
 

Protected Member Functions

void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 

Protected Attributes

int m_Location_x
 
int m_Location_y
 
Landscapem_OurLandscape
 
- Protected Attributes inherited from TALMaSSObject
int m_CurrentStateNo
 The basic state number for all objects - '-1' indicates death. More...
 
bool m_StepDone
 Indicates whether the iterative step code is done for this timestep. More...
 

Detailed Description

The base class for all ALMaSS animal classes.

Includes all the functionality required to be handled by classes derived from Population_Manager, hence a number of empty methods that MUST be reimplemented in descendent classes e.g. CopyMyself()

Constructor & Destructor Documentation

◆ TAnimal()

TAnimal::TAnimal ( int  x,
int  y,
Landscape L 
)

Member Function Documentation

◆ BeginStep()

virtual void TAnimal::BeginStep ( void  )
inlinevirtual

BeingStep behaviour - must be implemented in descendent classes.

Reimplemented from TALMaSSObject.

Reimplemented in Skylark_Male, Skylark_Female, Skylark_PreFledgeling, Skylark_Nestling, and Skylark_Clutch.

250  {
251  }

◆ CheckManagement()

◆ CheckManagementXY()

void TAnimal::CheckManagementXY ( int  x,
int  y 
)

◆ CopyMyself()

virtual void TAnimal::CopyMyself ( )
inlinevirtual
224  {
225  };

◆ CorrectWrapRound()

void TAnimal::CorrectWrapRound ( )
inlineprotected

Corrects wrap around co-ordinate problems.

Does the standard wrap around testing of positions. Uses the addition and modulus operators to avoid testing for negative or > landscape extent. This would be an alternative that should be tested for speed at some point.

References m_Location_x, m_Location_y, m_OurLandscape, Landscape::SupplySimAreaHeight(), and Landscape::SupplySimAreaWidth().

◆ Dying()

virtual void TAnimal::Dying ( )
inlinevirtual
266  {
267  KillThis();
268  }

References KillThis().

Referenced by Skylark_Population_Manager::Catastrophe().

◆ EndStep()

virtual void TAnimal::EndStep ( void  )
inlinevirtual

EndStep behaviour - must be implemented in descendent classes.

Reimplemented from TALMaSSObject.

Reimplemented in Skylark_Male, Skylark_Female, Skylark_PreFledgeling, Skylark_Nestling, and Skylark_Clutch.

254  {
255  }

◆ KillThis()

virtual void TAnimal::KillThis ( )
inlinevirtual
220  {
221  m_CurrentStateNo = -1;
222  m_StepDone = true;
223  };

References TALMaSSObject::m_CurrentStateNo, and TALMaSSObject::m_StepDone.

Referenced by Dying().

◆ OnFarmEvent()

virtual bool TAnimal::OnFarmEvent ( FarmToDo  )
inlinevirtual

Reimplemented in Skylark_Male, Skylark_Female, Skylark_PreFledgeling, Skylark_Nestling, and Skylark_Clutch.

271  {
272  return false;
273  }

◆ ReinitialiseObject()

virtual void TAnimal::ReinitialiseObject ( int  x,
int  y,
Landscape L 
)
inlinevirtual

Used to re-use an object - must be implemented in descendent classes.

257  {
258  m_OurLandscape = L;
259  m_Location_x = x;
260  m_Location_y = y;
262  }

References m_Location_x, m_Location_y, m_OurLandscape, and TALMaSSObject::ReinitialiseObject().

◆ SetX()

void TAnimal::SetX ( int  a_x)
inline
240  {
241  m_Location_x = a_x;
242  }

References m_Location_x.

◆ SetY()

void TAnimal::SetY ( int  a_y)
inline
243  {
244 
245  m_Location_y = a_y;
246 
247  }

References m_Location_y.

◆ Step()

virtual void TAnimal::Step ( void  )
inlinevirtual

Step behaviour - must be implemented in descendent classes.

Reimplemented from TALMaSSObject.

Reimplemented in Skylark_Male, Skylark_Female, Skylark_PreFledgeling, Skylark_Nestling, and Skylark_Clutch.

252  {
253  }

◆ Supply_m_Location_x()

int TAnimal::Supply_m_Location_x ( )
inline

◆ Supply_m_Location_y()

int TAnimal::Supply_m_Location_y ( )
inline

◆ SupplyFarmOwnerRef()

unsigned TAnimal::SupplyFarmOwnerRef ( )

◆ SupplyPoint()

APoint TAnimal::SupplyPoint ( )
inline
209 { APoint p( m_Location_x, m_Location_y); return p; }

References m_Location_x, and m_Location_y.

◆ SupplyPolygonRef()

int TAnimal::SupplyPolygonRef ( )
inline

◆ SupplyPosition()

AnimalPosition TAnimal::SupplyPosition ( )

◆ WhatState()

virtual int TAnimal::WhatState ( )
inlinevirtual

Reimplemented in Skylark_Base.

263  {
264  return 0;
265  }

Member Data Documentation

◆ m_Location_x

◆ m_Location_y

◆ m_OurLandscape

Landscape* TAnimal::m_OurLandscape
protected

The documentation for this class was generated from the following file:
TAnimal::KillThis
virtual void KillThis()
Definition: PopulationManager.h:219
TAnimal::m_OurLandscape
Landscape * m_OurLandscape
Definition: PopulationManager.h:229
Landscape::SupplySimAreaHeight
int SupplySimAreaHeight(void)
Definition: Landscape.h:1637
Landscape::SupplySimAreaWidth
int SupplySimAreaWidth(void)
Definition: Landscape.h:1632
TAnimal::m_Location_y
int m_Location_y
Definition: PopulationManager.h:228
TALMaSSObject::m_StepDone
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
Definition: PopulationManager.h:118
TALMaSSObject::ReinitialiseObject
virtual void ReinitialiseObject()
Used to re-use an object - must be implemented in descendent classes.
Definition: PopulationManager.h:143
TALMaSSObject::m_CurrentStateNo
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:116
TAnimal::m_Location_x
int m_Location_x
Definition: PopulationManager.h:225
Landscape::SupplyPolyRef
int SupplyPolyRef(int a_x, int a_y)
Definition: Landscape.h:1488