![]() |
ALMaSS
1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
|
The base class for predators encompsassing all their general behaviours. More...
#include <Predators.h>
Public Member Functions | |
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 () |
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... | |
unsigned | SupplySpeciesID () |
int | SupplyKill () |
bool | SupplyTerr () |
int | SupplyKillEff () |
int | SupplyHomeRange () |
![]() | |
TAnimal (int x, int y, Landscape *L) | |
The TAnimal constructor saving the x,y, location and the landscape pointer. More... | |
TAnimal (int x, int y) | |
The TAnimal constructor saving the x,y used if landscape is already set. More... | |
void | SetGuardMapIndex (int a_index_x, int a_index_y) |
Set the guard map index, this is used to avoid two animals operating in the same location when using multithread. More... | |
unsigned | SupplyFarmOwnerRef () const |
Get the current location farm ref if any. More... | |
AnimalPosition | SupplyPosition () const |
Returns the objects location and habitat type and veg type. More... | |
APoint | SupplyPoint () const |
Returns the objects location in ALMaSS coordinates. More... | |
int | SupplyPolygonRef () const |
Returns the polygon reference where the object is located. More... | |
TTypesOfLandscapeElement | SupplyPolygonType () const |
Returns the polygon type where the object is located. More... | |
int | Supply_m_Location_x () const |
Returns the ALMaSS x-coordinate. More... | |
int | Supply_m_Location_y () const |
Returns the ALMaSS y-coordinate. More... | |
int | SupplyGuardCellX () const |
Returns the x-index to the guard cell. More... | |
int | SupplyGuardCellY () const |
Returns the y-index to the guard cell. More... | |
int | SupplyAge () const |
Returns the animals age in days. More... | |
void | SetAge (int a_age) |
Sets the animals age in days. More... | |
virtual void | KillThis () |
Sets all parameters ready for object destruction. More... | |
virtual void | CopyMyself () |
Used to copy the object details to another in descendent classes. More... | |
void | SetX (const int a_x) |
Sets the x-coordinate. More... | |
void | SetY (const int a_y) |
Sets the y-coordinate. More... | |
virtual void | ReinitialiseObject (int a_x, int a_y, Landscape *a_l_ptr) |
virtual void | ReinitialiseObject (int a_x, int a_y) |
Used to re-use an object - must be implemented in descendent classes. More... | |
virtual int | WhatState () |
Returns the objects current state number. More... | |
virtual void | Dying () |
A wrapped for KillThis - ideally should not be used. More... | |
void | CheckManagement () |
Used to start a check for any management related effects at the objects current location. More... | |
void | CheckManagementXY (int a_x, int a_y) |
Used to start a check for any management related effects at x,y. More... | |
virtual bool | OnFarmEvent (FarmToDo) |
Must be reimplemented if used in descendent classes. Sets the action on a management event. More... | |
![]() | |
int | GetCurrentStateNo () const |
Returns the current state number. More... | |
void | SetCurrentStateNo (int a_num) |
Sets the current state number. More... | |
bool | GetStepDone () const |
Returns the step done indicator flag. More... | |
void | SetStepDone (bool a_bool) |
Sets the step done indicator flag. More... | |
void | ReinitialiseObjectBase () |
Used to initialise an object. More... | |
TALMaSSObject () | |
The constructor for TALMaSSObject. More... | |
virtual | ~TALMaSSObject ()=default |
The destructor for TALMaSSObject. More... | |
Protected Attributes | |
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_Manager * | m_Prey |
TPredator_Population_Manager * | m_OurPopulationManager |
vector< Vole_Base * > * | CurrentPrey |
![]() | |
int | m_Location_x |
The objects ALMaSS x coordinate. More... | |
int | m_Location_y |
The objects ALMaSS y coordinate. More... | |
int | m_guard_cell_x |
The index x to the guard cell. More... | |
int | m_guard_cell_y |
The index y to the guard cell. More... | |
int | m_AgeDays {0} |
To hold the age in days. More... | |
PesticideToxicity | m_my_pesticide |
![]() | |
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... | |
Additional Inherited Members | |
![]() | |
static void | SetSimulationWidth (int a_value) |
Sets the simulation width. More... | |
static void | SetSimulationHeight (int a_value) |
Sets the simulation height. More... | |
static void | SetDayInYear (int a_value) |
Sets the day in year attribute. More... | |
static void | SetOurLandscape (Landscape *a_value) |
Sets the landscape pointer. More... | |
static void | SetTempToday (double a_value) |
Sets the temperature today attribute. More... | |
![]() | |
static void | OnArrayBoundsError () |
Used for debugging only, tests basic object properties. More... | |
![]() | |
void | CorrectWrapRound () |
Corrects wrap around co-ordinate problems. More... | |
![]() | |
static Landscape * | m_OurLandscape = nullptr |
A pointer to the landscape object shared with all TAnimal objects. More... | |
static int | m_SimulationWidth = 0 |
A static member for the simulation width because it is often used by descendent classes. More... | |
static int | m_SimulationHeight = 0 |
A static member for the simulation height because it is often used by descendent classes. More... | |
static double | m_TemperatureToday = 0.0 |
A holder for the temperature today shared with all TAnimal objects. More... | |
static int | m_DayInYear = 0 |
A holder for the day in year shared with all TAnimal objects. More... | |
The base class for predators encompsassing all their general behaviours.
Defines simple predators that are really nothing more than moving mortality probabilities of different sizes and strengths. Breeding is once a year if enough prey are eaten, and death occurs if a starvation criteria is reached. The last individual cannot die so the population can never go extinct. If predators do not eat for a definable number of hunts then they may disperse, otherwise they move only locally. Different types of predators can be defined in the same simulation by defining the Weasel and Owl classes using configuration variables to create e.g. specialist or generalist predators, with different movement patterns, hunting efficiency and numerical responses.
TPredator::TPredator | ( | Vole_Population_Manager * | ThePrey, |
int | p_x, | ||
int | p_y, | ||
Landscape * | p_L, | ||
TPredator_Population_Manager * | p_PPM | ||
) |
Tpredator constructor
References CurrentPState, m_DispersalMax, m_FailureCount, m_HaveTerritory, m_HomeRange, m_KillEfficiency, m_kills_this_season, TAnimal::m_Location_x, TAnimal::m_Location_y, m_NoFailuresBeforeDispersal, TAnimal::m_OurLandscape, m_OurPopulationManager, m_Prey, m_Search_x, m_Search_y, m_SearchArea, PreyResponse1, PreyResponse2, SimH, SimW, Landscape::SupplySimAreaHeight(), Landscape::SupplySimAreaWidth(), and tops_InitialState.
|
inlinevirtual |
BeingStep behaviour - must be implemented in descendent classes.
Reimplemented from TALMaSSObject.
|
inlinevirtual |
EndStep behaviour - must be implemented in descendent classes.
Reimplemented from TALMaSSObject.
bool TPredator::OverlapMyTerritory | ( | unsigned | x, |
unsigned | y | ||
) |
References m_HomeRange, TAnimal::m_Location_x, TAnimal::m_Location_y, SimH, and SimW.
Referenced by TPredator_Population_Manager::InOtherTerritory().
|
virtual |
Moves the home range to an area where it does not overlap with a conspecific
References g_random_fnc(), TPredator_Population_Manager::InOtherTerritory(), m_DispersalMax, TAnimal::m_guard_cell_x, TAnimal::m_guard_cell_y, m_HaveTerritory, TAnimal::m_Location_x, TAnimal::m_Location_y, m_OurPopulationManager, SimH, SimW, SpeciesID, and Population_Manager::UpdateGuardMap().
Referenced by Weasel::Step(), and Owl::Step().
|
virtual |
References CurrentPrey, g_random_fnc(), m_KillEfficiency, m_kills_this_season, m_Prey, m_Search_x, m_Search_y, m_SearchArea, and Vole_Population_Manager::SupplyVoleList().
Referenced by Weasel::Step(), and Owl::Step().
|
virtual |
References g_random_fnc(), TAnimal::m_guard_cell_x, TAnimal::m_guard_cell_y, m_HomeRange, TAnimal::m_Location_x, TAnimal::m_Location_y, m_OurPopulationManager, m_Search_x, m_Search_y, m_SearchArea, SimH, SimW, and Population_Manager::UpdateGuardMap().
Referenced by Weasel::Step(), and Owl::Step().
|
inlinevirtual |
Step behaviour - must be implemented in descendent classes.
Reimplemented from TALMaSSObject.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
protected |
Referenced by st_Hunting().
|
protected |
Referenced by Weasel::Step(), Owl::Step(), and TPredator().
|
protected |
Referenced by Owl::Owl(), st_Dispersal(), TPredator(), and Weasel::Weasel().
|
protected |
Referenced by Weasel::Step(), Owl::Step(), and TPredator().
|
protected |
Referenced by st_Dispersal(), Weasel::Step(), Owl::Step(), SupplyTerr(), and TPredator().
|
protected |
Referenced by OverlapMyTerritory(), Owl::Owl(), st_Movement(), SupplyHomeRange(), TPredator(), and Weasel::Weasel().
|
protected |
Referenced by Owl::Owl(), st_Hunting(), SupplyKillEff(), TPredator(), and Weasel::Weasel().
|
protected |
Referenced by Weasel::BeginStep(), Owl::BeginStep(), st_Hunting(), SupplyKill(), and TPredator().
|
protected |
Referenced by Owl::Owl(), Weasel::Step(), Owl::Step(), TPredator(), and Weasel::Weasel().
|
protected |
Referenced by Weasel::BeginStep(), Owl::BeginStep(), st_Dispersal(), st_Movement(), and TPredator().
|
protected |
Referenced by st_Hunting(), and TPredator().
|
protected |
Referenced by st_Hunting(), st_Movement(), and TPredator().
|
protected |
Referenced by st_Hunting(), st_Movement(), and TPredator().
|
protected |
Referenced by Owl::Owl(), st_Hunting(), st_Movement(), TPredator(), and Weasel::Weasel().
|
protected |
Referenced by Owl::Owl(), Weasel::Step(), Owl::Step(), TPredator(), and Weasel::Weasel().
|
protected |
Referenced by Owl::Owl(), Weasel::Step(), Owl::Step(), TPredator(), and Weasel::Weasel().
|
protected |
Referenced by OverlapMyTerritory(), st_Dispersal(), st_Movement(), and TPredator().
|
protected |
Referenced by OverlapMyTerritory(), st_Dispersal(), st_Movement(), and TPredator().
|
protected |
Referenced by Owl::Owl(), st_Dispersal(), SupplySpeciesID(), and Weasel::Weasel().