ALMaSS Vole ODDox  1.1
The vole model description following ODdox protocol
Owl Class Reference

The Owl class is one of two current implementations of TPredator. More...

#include <Predators.h>

Public Member Functions

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...
 
 Owl (Vole_Population_Manager *ThePrey, int p_x, int p_y, Landscape *p_L, TPredator_Population_Manager *p_PPM)
 
virtual ~Owl ()
 
- Public Member Functions inherited from TPredator
 TPredator (Vole_Population_Manager *ThePrey, int p_x, int p_y, Landscape *p_L, TPredator_Population_Manager *p_PPM)
 
 ~TPredator ()
 
bool OverlapMyTerritory (unsigned x, unsigned y)
 
virtual void st_Dispersal ()
 
virtual void st_Movement ()
 
virtual int st_Hunting ()
 
unsigned SupplySpeciesID ()
 
int SupplyKill ()
 
bool SupplyTerr ()
 
int SupplyKillEff ()
 
int SupplyHomeRange ()
 
- Public Member Functions inherited from TAnimal
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 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...
 

Additional Inherited Members

- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 
- Protected Attributes inherited from TPredator
TTypeOfPredatorState CurrentPState
 
unsigned SpeciesID
 
unsigned m_DispersalMax
 
unsigned m_SearchArea
 
int m_kills_this_season
 
int PreyResponse1
 
int PreyResponse2
 
int m_Search_x
 
int m_Search_y
 
int SimW
 
int SimH
 
unsigned m_FailureCount
 
unsigned m_NoFailuresBeforeDispersal
 
unsigned m_HomeRange
 
bool m_HaveTerritory
 
int m_KillEfficiency
 
Vole_Population_Managerm_Prey
 
TPredator_Population_Managerm_OurPopulationManager
 
vector< Vole_Base * > * CurrentPrey
 
- Protected Attributes inherited from TAnimal
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 Owl class is one of two current implementations of TPredator.

It is configurable via config parameters and in other than name and default configuration it is identical to the Weasel class

Definition at line 208 of file Predators.h.

Constructor & Destructor Documentation

◆ Owl()

Owl::Owl ( Vole_Population_Manager ThePrey,
int  p_x,
int  p_y,
Landscape p_L,
TPredator_Population_Manager p_PPM 
)

◆ ~Owl()

Owl::~Owl ( )
virtual

Definition at line 1005 of file Predators.cpp.

1006 {
1007  //Nothing to do
1008 }

Member Function Documentation

◆ BeginStep()

void Owl::BeginStep ( void  )
virtual

BeingStep behaviour - must be implemented in descendent classes.

Reimplemented from TPredator.

Definition at line 933 of file Predators.cpp.

934 {
935  int day= m_OurLandscape->SupplyDayInYear();
936  if (day==owl_breed_day)
937  {
939  for (int k=0; k<noToMake; k++)
940  {
941  // make a new owl
942  struct_Predator* sp;
943  sp = new struct_Predator;
945  sp->L = m_OurLandscape;
946  sp->x = m_Location_x;
947  sp->y = m_Location_y;
948  m_OurPopulationManager->CreateObjects(OWL,NULL,sp,1); // 1 = owl
949  delete sp;
950  }
951  }
952  else if (day==364)
953  {
955  {
957  {
959  KillThis();
960  }
961  }
962  m_kills_this_season=0; // reset the count
963  }
964 }

References TPredator_Population_Manager::CreateObjects(), TPredator_Population_Manager::dec_inds(), TAnimal::KillThis(), struct_Predator::L, TPredator::m_kills_this_season, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, TPredator::m_OurPopulationManager, OWL, owl_breed_day, owl_breed_threshold, owl_death_threshold, struct_Predator::PM, TPredator_Population_Manager::supply_no_inds(), Landscape::SupplyDayInYear(), struct_Predator::x, and struct_Predator::y.

◆ EndStep()

virtual void Owl::EndStep ( void  )
inlinevirtual

EndStep behaviour - must be implemented in descendent classes.

Reimplemented from TPredator.

Definition at line 216 of file Predators.h.

216 {}

◆ Step()

void Owl::Step ( void  )
virtual

Step behaviour - must be implemented in descendent classes.

Reimplemented from TPredator.

Definition at line 967 of file Predators.cpp.

968 {
969  if (m_StepDone || m_CurrentStateNo == -1) return;
970  switch (CurrentPState)
971  {
972  case tops_InitialState: // Initial state
974  m_HaveTerritory=false;
975  break;
976  case tops_Hunting:
978  m_StepDone=true;
979  break;
980  case tops_Dispersal:
981  st_Dispersal();
983  m_StepDone=true;
984  break;
985  case tops_Movement:
986  st_Movement();
987  if (st_Hunting()<PreyResponse2) // alter this figure to increase functional response
988  m_FailureCount++;
989  else m_FailureCount=0;
991  {
992  m_HaveTerritory=false;
994  }
996  m_StepDone=true;
997  break;
998  default:
999  m_OurLandscape->Warn("Owl::Step()","unknown state - default");
1000  exit(1);
1001  }
1002 }

References TPredator::CurrentPState, TALMaSSObject::m_CurrentStateNo, TPredator::m_FailureCount, TPredator::m_HaveTerritory, TPredator::m_NoFailuresBeforeDispersal, TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, TPredator::PreyResponse1, TPredator::PreyResponse2, TPredator::st_Dispersal(), TPredator::st_Hunting(), TPredator::st_Movement(), tops_Dispersal, tops_Hunting, tops_InitialState, tops_Movement, and Landscape::Warn().


The documentation for this class was generated from the following files:
owl_breed_threshold
int owl_breed_threshold
Definition: Predators.cpp:73
TAnimal::KillThis
virtual void KillThis()
Definition: PopulationManager.h:219
tops_Dispersal
Definition: Predators.h:57
OWL
#define OWL
Definition: Predators.cpp:49
struct_Predator::y
int y
Definition: Predators.h:69
TAnimal::m_OurLandscape
Landscape * m_OurLandscape
Definition: PopulationManager.h:229
TPredator_Population_Manager::supply_no_inds
unsigned supply_no_inds(unsigned list)
Definition: Predators.h:157
TPredator::st_Movement
virtual void st_Movement()
Definition: Predators.cpp:753
struct_Predator::PM
TPredator_Population_Manager * PM
Definition: Predators.h:72
owl_death_threshold
int owl_death_threshold
Definition: Predators.cpp:75
owl_breed_day
int owl_breed_day
Definition: Predators.cpp:77
TPredator::PreyResponse2
int PreyResponse2
Definition: Predators.h:109
struct_Predator::L
Landscape * L
Definition: Predators.h:71
struct_Predator
Used for creation of a new predator object.
Definition: Predators.h:65
TPredator_Population_Manager::dec_inds
void dec_inds(unsigned list)
Definition: Predators.h:156
tops_Movement
Definition: Predators.h:58
TPredator::m_SearchArea
unsigned m_SearchArea
Definition: Predators.h:106
TPredator::st_Hunting
virtual int st_Hunting()
Definition: Predators.cpp:726
TAnimal::m_Location_y
int m_Location_y
Definition: PopulationManager.h:228
TPredator::m_KillEfficiency
int m_KillEfficiency
Definition: Predators.h:118
TPredator::st_Dispersal
virtual void st_Dispersal()
Definition: Predators.cpp:787
TPredator::PreyResponse1
int PreyResponse1
Definition: Predators.h:108
Landscape::SupplyDayInYear
int SupplyDayInYear(void)
Definition: Landscape.h:1596
TALMaSSObject::m_StepDone
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
Definition: PopulationManager.h:118
TPredator::m_FailureCount
unsigned m_FailureCount
Definition: Predators.h:114
TPredator_Population_Manager::CreateObjects
void CreateObjects(int ob_type, TAnimal *pvo, struct_Predator *data, int number)
Definition: Predators.cpp:137
TPredator::CurrentPState
TTypeOfPredatorState CurrentPState
Definition: Predators.h:103
TPredator::m_HaveTerritory
bool m_HaveTerritory
Definition: Predators.h:117
TPredator::m_OurPopulationManager
TPredator_Population_Manager * m_OurPopulationManager
Definition: Predators.h:120
TPredator::SpeciesID
unsigned SpeciesID
Definition: Predators.h:104
TPredator::m_DispersalMax
unsigned m_DispersalMax
Definition: Predators.h:105
tops_InitialState
Definition: Predators.h:55
TPredator::TPredator
TPredator(Vole_Population_Manager *ThePrey, int p_x, int p_y, Landscape *p_L, TPredator_Population_Manager *p_PPM)
Definition: Predators.cpp:696
tops_Hunting
Definition: Predators.h:56
TPredator::m_HomeRange
unsigned m_HomeRange
Definition: Predators.h:116
TALMaSSObject::m_CurrentStateNo
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:116
TPredator::m_NoFailuresBeforeDispersal
unsigned m_NoFailuresBeforeDispersal
Definition: Predators.h:115
struct_Predator::x
int x
Definition: Predators.h:68
Landscape::Warn
void Warn(std::string a_msg1, std::string a_msg2)
Definition: Landscape.h:1579
TAnimal::m_Location_x
int m_Location_x
Definition: PopulationManager.h:225
TPredator::m_kills_this_season
int m_kills_this_season
Definition: Predators.h:107