![]() |
ALMaSS
1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
|
The generic base class for spider eggsacs
More...
#include <Spider_BaseClasses.h>
Public Member Functions | |
void | EndStep () |
EndStep behaviour - must be implemented in descendent classes. More... | |
Spider_Egg (int x, int y, Landscape *L, Spider_Population_Manager *EPM, int Eggs) | |
The Spider_Egg constructor More... | |
virtual void | ReInit (int x, int y, Landscape *L, Spider_Population_Manager *EPM, int Eggs) |
Used to reinitialise and object More... | |
virtual void | BeginStep () |
The begin step code More... | |
virtual void | Step () |
The Step code More... | |
void | SetNoEggs (int Eggs) |
Sets the number of eggs attribute More... | |
int | GetNoEggs () |
Returns the number of eggs in the eggsac More... | |
virtual bool | OnFarmEvent (FarmToDo event) |
Determines the impact of any farm management events at the eggsac's location More... | |
![]() | |
Spider_Base (int x, int y, Landscape *L, Spider_Population_Manager *SpMan) | |
Constructor More... | |
void | ReInit (int x, int y, Landscape *L, Spider_Population_Manager *SpMan) |
Reinitialise object code More... | |
void | Init (Spider_Population_Manager *p_spMan) |
Used it initialise objects (also used by ReInit) More... | |
virtual int | WhatState () |
Returns the current spider behavioural state More... | |
virtual void | KillThis () |
Destroys the spider More... | |
![]() | |
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 | 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 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... | |
![]() | |
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... | |
Static Public Attributes | |
static int | m_HatDensityDepMortConst = 0 |
This is a space for holding cfg species specific parameters - this is the mortality constant associated with Spider_Egg::Hatch. More... | |
static int | m_DailyEggMortConst = 0 |
This is a space for holding cfg species specific parameters - this is the daily egg mortality probability Spider_Egg::st_Develop. More... | |
static double | m_EggDevelConst = 0 |
This is a space for holding cfg species specific parameters - this is a developmental threshold for hatch in Spider_Egg::st_Develop. More... | |
![]() | |
static int | m_DenDependenceConst0 = 0 |
This is the number of local spiders needed before density dependent mortality will kill More... | |
static int | m_SimW = 0 |
The width of the landscape More... | |
static int | m_SimH = 0 |
The height of the landscape More... | |
Protected Member Functions | |
TTypesOfSpiderState | st_Develop () |
The behavioural state develop More... | |
virtual void | st_Hatch () |
The behavioural state hatch More... | |
virtual void | st_Die () |
The behavioural state die More... | |
virtual void | Hatch (int a_eggsackspread, unsigned a_doubleeggsacspread, unsigned a_noeggs, unsigned a_range) |
Determines the number and location of spiderlings to survive hatching and triggers creation of juvenile objects More... | |
![]() | |
virtual bool | EggPosValid (unsigned a_x, unsigned a_y) |
Checks if its possible to create an eggsac here More... | |
bool | HatchDensityMort (int a_x, int a_y, int a_range) |
Checks for density-dependent mortality at this location More... | |
virtual int | CheckPosMap (unsigned x, unsigned y) |
Returns the value in m_OurPosMap for this location More... | |
virtual bool | GetPosMapPositive (unsigned x, unsigned y, unsigned range) |
Returns whether there are any non-zero values within range of this coordinate (TL corner) More... | |
virtual int | GetPosMapDensity (unsigned x, unsigned y, unsigned range) |
Returns total number of non-zero locations within range of this coordinate (TL corner) More... | |
virtual void | ClearPosMap (unsigned x, unsigned y) |
Clears a PosMap location More... | |
virtual void | SetPosMap (unsigned x, unsigned y) |
Sets a PosMap location to non-zero More... | |
![]() | |
void | CorrectWrapRound () |
Corrects wrap around co-ordinate problems. More... | |
Protected Attributes | |
int | m_DateLaid |
The day in year the eggsac was produced More... | |
int | m_NoEggs |
The number of eggs contained in the eggsac More... | |
![]() | |
double | m_AgeDegrees |
A local pointer the population manager More... | |
int | m_Age |
Stores the spiders age in days More... | |
TTypesOfSpiderState | m_CurrentSpState |
Stores the current behavioural state More... | |
unsigned | m_Lifestage { 0 } |
This is a useful parameter holding the spider type. More... | |
SimplePositionMap * | m_OurPosMap |
Contains a pointer to the relevant position map - allocation of this must be controlled by the descendent class init. More... | |
![]() | |
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... | |
![]() | |
double | m_pesticide_accum |
Body-burden of pesticde More... | |
Spider_Population_Manager * | m_OurPopulationManager |
![]() | |
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 generic base class for spider eggsacs
Spider_Egg::Spider_Egg | ( | int | x, |
int | y, | ||
Landscape * | L, | ||
Spider_Population_Manager * | EPM, | ||
int | Eggs | ||
) |
The Spider_Egg constructor
References m_DateLaid, Spider_Population_Manager::m_EggPosMap, m_NoEggs, Spider_Base::m_OurPosMap, and Landscape::SupplyDayInYear().
|
virtual |
|
virtual |
EndStep behaviour - must be implemented in descendent classes.
Reimplemented from TALMaSSObject.
References cfg_SpiderEggPPPEffectProb, cfg_SpiderEggPPPElimiationRate, cfg_SpiderEggPPPThreshold, g_rand_uni_fnc(), Spider_Base::m_CurrentSpState, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, Spider_Base::m_pesticide_accum, ppp_1, Landscape::SupplyPesticide(), tosps_Dying, and CfgFloat::value().
|
inline |
|
protectedvirtual |
Determines the number and location of spiderlings to survive hatching and triggers creation of juvenile objects
References Spider_Population_Manager::CreateObjects(), Spider_Base::EggPosValid(), g_random_fnc(), SimplePositionMap::GetMapValue(), Spider_Base::HatchDensityMort(), struct_Spider::L, Spider_Population_Manager::m_JuvPosMap, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, Spider_Base::m_OurPopulationManager, Spider_Base::m_SimH, Spider_Base::m_SimW, SimplePositionMap::SetMapValue(), struct_Spider::SpPM, tspi_Spiderling, struct_Spider::x, and struct_Spider::y.
Referenced by st_Hatch().
|
inlinevirtual |
Determines the impact of any farm management events at the eggsac's location
Reimplemented from Spider_Base.
Reimplemented in Oedothorax_Egg, and Erigone_Egg.
|
virtual |
Used to reinitialise and object
References m_DateLaid, Spider_Population_Manager::m_EggPosMap, m_NoEggs, Spider_Base::m_OurPopulationManager, Spider_Base::m_OurPosMap, Spider_Base::ReInit(), and Landscape::SupplyDayInYear().
|
inline |
|
protected |
The behavioural state develop
References g_random_fnc(), Spider_Population_Manager::GetEggDevelDegrees(), m_DailyEggMortConst, m_DateLaid, m_EggDevelConst, Spider_Base::m_OurPopulationManager, TALMaSSObject::m_StepDone, tosps_Develop, tosps_Dying, and tosps_Hatch.
Referenced by Step().
|
protectedvirtual |
The behavioural state die
References SimplePositionMap::ClearMapValue(), TALMaSSObject::m_CurrentStateNo, Spider_Population_Manager::m_EggPosMap, TAnimal::m_Location_x, TAnimal::m_Location_y, and Spider_Base::m_OurPopulationManager.
Referenced by Step().
|
protectedvirtual |
The behavioural state hatch
References SimplePositionMap::ClearMapValue(), Spider_Population_Manager::GetDoubleEggSacSpread(), Spider_Population_Manager::GetEggSacSpread(), Hatch(), Spider_Base::m_CurrentSpState, TALMaSSObject::m_CurrentStateNo, Spider_Population_Manager::m_EggPosMap, m_HatDensityDepMortConst, TAnimal::m_Location_x, TAnimal::m_Location_y, m_NoEggs, Spider_Base::m_OurPopulationManager, and tosps_Destroy.
Referenced by Step().
|
virtual |
The Step code
Reimplemented from TALMaSSObject.
References Spider_Base::m_CurrentSpState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, st_Develop(), st_Die(), st_Hatch(), tosps_Destroy, tosps_Develop, tosps_Dying, tosps_Hatch, tosps_Initiation, and Landscape::Warn().
|
static |
This is a space for holding cfg species specific parameters - this is the daily egg mortality probability Spider_Egg::st_Develop.
Referenced by Erigone_Population_Manager::Init(), Oedothorax_Population_Manager::Init(), and st_Develop().
|
protected |
The day in year the eggsac was produced
Referenced by ReInit(), Spider_Egg(), and st_Develop().
|
static |
This is a space for holding cfg species specific parameters - this is a developmental threshold for hatch in Spider_Egg::st_Develop.
Referenced by Erigone_Population_Manager::Init(), Oedothorax_Population_Manager::Init(), and st_Develop().
|
static |
This is a space for holding cfg species specific parameters - this is the mortality constant associated with Spider_Egg::Hatch.
Referenced by Erigone_Population_Manager::Init(), Oedothorax_Population_Manager::Init(), and st_Hatch().
|
protected |
The number of eggs contained in the eggsac
Referenced by GetNoEggs(), ReInit(), SetNoEggs(), Spider_Egg(), and st_Hatch().