File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/extensions/ams.js
ALMaSS  1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Spider_BaseClasses.h
Go to the documentation of this file.
1 // Version of 5th May 2020
2 /*
3 *******************************************************************************************************
4 Copyright (c) 2020, Christopher John Topping, Aarhus University
5 All rights reserved.
6 
7 Redistribution and use in source and binary forms, with or without modification, are permitted provided
8 that the following conditions are met:
9 
10 Redistributions of source code must retain the above copyright notice, this list of conditions and the
11 following disclaimer.
12 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
13 the following disclaimer in the documentation and/or other materials provided with the distribution.
14 
15 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
16 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
17 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
18 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
19 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
20 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
22 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
23 ********************************************************************************************************
24 */
25 // Version of 7th January 2020
26 //---------------------------------------------------------------------------
29 #ifndef Spider_BaseH
30 #define Spider_BaseH
31 //---------------------------------------------------------------------------
32 
33 //#define __SpidDebug
34 
35 // Forward Declarations
36 
37 class Landscape;
39 
40 //------------------------------------------------------------------------------
41 
45 enum TTypesOfSpiders : unsigned
46 {
47  tspi_Egg = 0,
50 };
51 
55 enum SpiderFoodQuality : unsigned
56 {
63 };
64 
68 enum TTypesOfSpiderState : unsigned
69 {
70  // General
76  // Egg
78  // Juvenile
82  // Female
86  // Destroy
88 };
89 //------------------------------------------------------------------------------
90 
95 {
96 public:
97  int x;
98  int y;
101  int noEggs;
102 };
103 //------------------------------------------------------------------------------
104 
106  {
107  // Attributes
108  public:
118  static std::array<int, 31> m_DispDistances;
119  protected:
125  double BallooningHrs[52 * 7];
155  double m_EggDegrees[365];
174 #ifdef __SpidDebug
175 
176  int m_Deaths[10];
178  int m_JDeaths;
180  int m_Mature;
181 #endif
182  // Methods
183  public:
185  inline int GetEggSacSpread() {
186  return m_EggSacSpread;
187  }
189  inline int GetDoubleEggSacSpread() {
190  return m_DoubleEggSacSpread;
191  }
195  }
198  return m_DaysSinceRain;
199  }
201  int GetTodaysMonth() {
202  return m_TodaysMonth; }
204  double GetTodaysDroughtSc(int index) {
205  return m_TodaysDroughtScore[index]; }
207  double GetJuvMort() {
208  return m_DailyJuvMort; }
210  int GetDispDist(int chance) {
211  return m_DispersalDistances[chance];
212  }
214  double GetBTime(int day) {
215  return BallooningHrs[day];
216  }
218  double GetBTimeToday() {
219  return m_TodaysBallooningTime; }
222  return m_WindDirection; }
225  return m_BallooningWeather; };
227  double GetEggDegreesPoor() {
228  return m_EggProdDDegsPoor; }
230  double GetEggDegreesInt() {
231  return m_EggProdDDegsInt; }
233  double GetEggDegreesGood() {
234  return m_EggProdDDegsGood; }
236  double GetJuvDegrees_good() {
237  return m_JuvDegreesGood; }
240  return m_JuvDegreesIntermediate; }
242  double GetJuvDegrees_poor() {
243  return m_JuvDegreesPoor; }
245  double GetEggDevelDegrees(int day) {
246  return m_EggDegrees[day]; }
248  bool CheckHumidity(int /* x */, int /* y */) {
249  return true; } // TODO
251  bool GetWalking() {
252  return m_WalkingOnly; }
254  bool GetMinWalkTemp() {
255  return m_MinWalkTemp; }
259  virtual void Init(void);
261  virtual void DoFirst(void) { ; }
263  virtual ~Spider_Population_Manager();
265  virtual void TheAOROutputProbe() { ; }
267  virtual void TheRipleysOutputProbe(FILE* a_prb) { ; }
269  bool InSquare(int p_x, int p_y, int p_sqx, int p_sqy, int p_range);
271  void virtual Catastrophe() { ; }
273  virtual void CreateObjects(int ob_type, TAnimal* pvo, struct_Spider* data, int number) { ; }
274 #ifdef __SpidDebug
275 
276  void RecordDeath(int a_type) { m_Deaths[a_type]++; }
278  void RecordJDeath() { m_JDeaths++; }
280  void RecordMature() { m_Mature++; }
281 #endif
282 };
283 //---------------------------------------------------------------------------
284 
285 class Spider_Base : public TAnimal
286 {
287  // Attributes
288 public:
292  static int m_SimW;
294  static int m_SimH;
298 protected:
300  double m_AgeDegrees;
302  int m_Age;
306  unsigned m_Lifestage{ 0 };
307  // Methods
308 public:
311  Spider_Base(int x, int y, Landscape* L, Spider_Population_Manager* SpMan);
313  void ReInit(int x, int y, Landscape* L, Spider_Population_Manager* SpMan);
315  void Init(Spider_Population_Manager* p_spMan);
317  virtual int WhatState() { return int(m_CurrentSpState); }
319  virtual bool OnFarmEvent(FarmToDo /* event */) { return true; }
321  virtual void KillThis() {
323  }
324 protected:
326  virtual bool EggPosValid(unsigned a_x, unsigned a_y);
330  bool HatchDensityMort(int a_x, int a_y, int a_range);
332  virtual int CheckPosMap(unsigned x, unsigned y);
334  virtual bool GetPosMapPositive(unsigned x, unsigned y, unsigned range);
336  virtual int GetPosMapDensity(unsigned x, unsigned y, unsigned range);
338  virtual void ClearPosMap(unsigned x, unsigned y);
340  virtual void SetPosMap(unsigned x, unsigned y);
341 };
342 
344 class Spider_Egg : public Spider_Base
345 {
346 // Attributes
347 public:
353  static double m_EggDevelConst;
354 protected:
358  int m_NoEggs;
359 // Methods
360 public:
361 void EndStep();
363  Spider_Egg(int x, int y, Landscape* L, Spider_Population_Manager* EPM, int Eggs);
365  virtual void ReInit(int x, int y, Landscape* L, Spider_Population_Manager* EPM, int Eggs);
367  virtual void BeginStep();
369  virtual void Step();
371  void SetNoEggs(int Eggs) { m_NoEggs = Eggs; }
373  int GetNoEggs() { return m_NoEggs; }
375  virtual bool OnFarmEvent(FarmToDo event) { return true; }
376 protected:
380  virtual void st_Hatch() ;
382  virtual void st_Die();
384  virtual void Hatch(int a_eggsackspread, unsigned a_doubleeggsacspread, unsigned a_noeggs, unsigned a_range);
385 };
386 //------------------------------------------------------------------------------
387 
390 {
391 public:
392  // Static parameter passing attributes
396  static std::array<int, 40> m_DispersalChance;
398  static double m_JuvDevelConst;
399 protected:
408 public:
409  void EndStep();
411  Spider_Juvenile(int x, int y, Landscape* L, Spider_Population_Manager* SpPM);
413  virtual void ReInit(int x, int y, Landscape* L, Spider_Population_Manager* SpPM);
415  virtual void BeginStep();
417  virtual void Step();
419  virtual bool OnFarmEvent(FarmToDo event) { return true; }
421  virtual void SpecialWinterMort();
422 protected:
427  return AssessHabitat();
428  };
432  virtual TTypesOfSpiderState st_Walk();
434  virtual void Maturation();
436  virtual bool BallooningMortality(int dist);
438  virtual int BalloonTo(int direction, int distance);
440  virtual int WalkTo(int direction);
444  virtual int Balloon();
446  virtual int Walk();
448  virtual SpiderFoodQuality AssessFood();
452  virtual void AddToBadHabitatDays() { if (m_BadHabitatDays < 39) m_BadHabitatDays++; }
454  virtual void CalcDrought() {}
455 };
456 //------------------------------------------------------------------------------
457 
460 {
461 // Attributes
462 public:
464  static double m_EggProducConst;
468  static int m_DailyFemaleMort;
469 protected:
476 // Methods
477 public:
478 void EndStep();
480  Spider_Female(int x, int y, Landscape* L, Spider_Population_Manager* EPM);
482  void ReInit(int x, int y, Landscape* L, Spider_Population_Manager* EPM);
484  virtual void BeginStep();
486  virtual void Step();
488  virtual bool OnFarmEvent(FarmToDo event) { return true; }
491 protected:
493  int st_Reproduce();
495  bool ProduceEggSac();
497  virtual int CalculateEggsPerEggSac() { return 0; }
499  void CreateEggSac(int a_NoEggs);
503  virtual TTypesOfSpiderState st_Walk();
504 };
505 //------------------------------------------------------------------------------
506 
507 #endif
508 
Spider_Population_Manager::GetEggDegreesGood
double GetEggDegreesGood()
Returns todays egg sac production day degrees for good food
Definition: Spider_BaseClasses.h:233
Spider_Population_Manager::m_EggProdThresholdPassed
bool m_EggProdThresholdPassed
A flag for passing minimum temperature for producing eggs.
Definition: Spider_BaseClasses.h:141
Spider_Juvenile::m_droughtFactor
double m_droughtFactor
The running score of drought conditions
Definition: Spider_BaseClasses.h:407
Spider_Base::Init
void Init(Spider_Population_Manager *p_spMan)
Used it initialise objects (also used by ReInit)
Definition: Spider_BaseClasses.cpp:141
Spider_Population_Manager::GetBTime
double GetBTime(int day)
Returns ballooning hours for a given day
Definition: Spider_BaseClasses.h:214
Spider_Base::HatchDensityMort
bool HatchDensityMort(int a_x, int a_y, int a_range)
Checks for density-dependent mortality at this location
Definition: Spider_BaseClasses.cpp:107
Spider_Base::m_DenDependenceConst0
static int m_DenDependenceConst0
This is the number of local spiders needed before density dependent mortality will kill
Definition: Spider_BaseClasses.h:290
Spider_Population_Manager::Spider_Population_Manager
Spider_Population_Manager(Landscape *p_L, int N)
The constructor
Definition: Spider_BaseClasses.cpp:1075
Spider_Female::st_Reproduce
int st_Reproduce()
The behavioural state reproduce
Definition: Spider_BaseClasses.cpp:1004
Spider_Juvenile::BallooningMortality
virtual bool BallooningMortality(int dist)
Determines the ballooning mortality associated with distance dist
Definition: Spider_BaseClasses.cpp:612
Spider_Population_Manager::m_EggPosMap
SimplePositionMap * m_EggPosMap
Pointer to the egg position map
Definition: Spider_BaseClasses.h:112
g_rand_uni_fnc
double g_rand_uni_fnc()
Definition: ALMaSS_Random.cpp:56
Spider_Juvenile::st_AssessHabitat
virtual TTypesOfSpiderState st_AssessHabitat()
The behavioural state assess habitat
Definition: Spider_BaseClasses.h:426
Spider_Base::m_OurPosMap
SimplePositionMap * m_OurPosMap
Contains a pointer to the relevant position map - allocation of this must be controlled by the descen...
Definition: Spider_BaseClasses.h:328
Spider_Egg
The generic base class for spider eggsacs
Definition: Spider_BaseClasses.h:344
Spider_Population_Manager::m_MoveMap
MovementMapUnsigned * m_MoveMap
A representation of the landscape in terms of quality - NB MUST be assigned by the descendent populat...
Definition: Spider_BaseClasses.h:110
tosps_FWalk
Definition: Spider_BaseClasses.h:85
cfg_SpiderEggPPPThreshold
static CfgFloat cfg_SpiderEggPPPThreshold("SPID_EGGPPPTHRESHOLD", CFG_CUSTOM, 99999.9, 0.0, 100000)
PPP effects threshold.
Spider_Population_Manager::m_DaysSinceRain
int m_DaysSinceRain
The number of days since last rain
Definition: Spider_BaseClasses.h:127
Spider_Egg::Hatch
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 juveni...
Definition: Spider_BaseClasses.cpp:303
Spider_Population_Manager::m_DispDistances
static std::array< int, 31 > m_DispDistances
An array to hold the dispersal distances possible as a probability 0-30 (x out of 10000)
Definition: Spider_BaseClasses.h:118
Spider_Juvenile::st_Balloon
virtual TTypesOfSpiderState st_Balloon()
The behavioural state balloon
Definition: Spider_BaseClasses.cpp:545
Spider_Base::Spider_Base
Spider_Base(int x, int y, Landscape *L, Spider_Population_Manager *SpMan)
Constructor
Definition: Spider_BaseClasses.cpp:132
Spider_Base::m_pesticide_accum
double m_pesticide_accum
Body-burden of pesticde
Definition: Spider_BaseClasses.h:296
Spider_Population_Manager::m_BallooningStop
int m_BallooningStop
A limiter for the day in year to stop ballooning - to be assigned in a descendent classes population ...
Definition: Spider_BaseClasses.h:149
Spider_Base::m_AgeDegrees
double m_AgeDegrees
A local pointer the population manager
Definition: Spider_BaseClasses.h:300
Landscape::SupplyElementType
TTypesOfLandscapeElement SupplyElementType(int a_polyref)
Returns the landscape type of the polygon using the polygon reference number a_polyref or coordinates...
Definition: Landscape.h:1732
cfg_SpiderAdultPPPEffectProb
static CfgFloat cfg_SpiderAdultPPPEffectProb("SPID_ADPPPEFFECTPROB", CFG_CUSTOM, 0, 0.0, 1.0)
Effect probability on threshold excedence.
Spider_Juvenile::EndStep
void EndStep()
EndStep behaviour - must be implemented in descendent classes.
Definition: Spider_BaseClasses.cpp:189
Spider_Juvenile::m_MustBalloon
bool m_MustBalloon
Flag to force ballooning if possible
Definition: Spider_BaseClasses.h:403
Spider_Population_Manager::m_WindDirection
int m_WindDirection
Todays wind direction
Definition: Spider_BaseClasses.h:143
Spider_Juvenile::m_BadHabitatDays
int m_BadHabitatDays
The number of days in bad conditions
Definition: Spider_BaseClasses.h:405
Spider_Juvenile::OnFarmEvent
virtual bool OnFarmEvent(FarmToDo event)
Determines the impact of any farm management events at the juvenile's location
Definition: Spider_BaseClasses.h:419
Spider_Base::GetPosMapDensity
virtual int GetPosMapDensity(unsigned x, unsigned y, unsigned range)
Returns total number of non-zero locations within range of this coordinate (TL corner)
Definition: Spider_BaseClasses.cpp:160
cfg_SpiderEggPPPEffectProb
static CfgFloat cfg_SpiderEggPPPEffectProb("SPID_EGGPPPEFFECTPROB", CFG_CUSTOM, 0, 0.0, 1.0)
Effect probability on threshold excedence.
Spider_Population_Manager::GetTodaysMonth
int GetTodaysMonth()
Return current month
Definition: Spider_BaseClasses.h:201
Spider_Population_Manager::m_EggProdDDegsInt
double m_EggProdDDegsInt
Links reproduction to food levels and day degrees - intermediate food
Definition: Spider_BaseClasses.h:165
Population_Manager::BeforeStepActions
vector< unsigned > BeforeStepActions
Holds the season list of possible before step actions.
Definition: PopulationManager.h:819
Spider_Population_Manager::m_JuvDegreesGood
double m_JuvDegreesGood
Contribution to day degrees under good food.
Definition: Spider_BaseClasses.h:157
Spider_Population_Manager::m_JuvDegreesIntermediate
double m_JuvDegreesIntermediate
Contribution to day degrees under intermediate food
Definition: Spider_BaseClasses.h:159
sfq_Poor
Definition: Spider_BaseClasses.h:60
Spider_Egg::ReInit
virtual void ReInit(int x, int y, Landscape *L, Spider_Population_Manager *EPM, int Eggs)
Used to reinitialise and object
Definition: Spider_BaseClasses.cpp:229
Spider_Female::ReInit
void ReInit(int x, int y, Landscape *L, Spider_Population_Manager *EPM)
Reinitialise reused objects
Definition: Spider_BaseClasses.cpp:881
DroughtMort
int DroughtMort[8]
Definition: Spider_BaseClasses.cpp:81
Spider_Egg::st_Hatch
virtual void st_Hatch()
The behavioural state hatch
Definition: Spider_BaseClasses.cpp:281
Spider_Juvenile::m_JuvDevelConst
static double m_JuvDevelConst
Day degrees maturation threshold
Definition: Spider_BaseClasses.h:398
Spider_Juvenile::AssessFood
virtual SpiderFoodQuality AssessFood()
Evaluates food status at current location
Definition: Spider_BaseClasses.cpp:599
Spider_Female::m_EggProducConst
static double m_EggProducConst
Daydegrees threshold needed to produce an eggsac
Definition: Spider_BaseClasses.h:464
cfg_LowFoodLevel
static CfgFloat cfg_LowFoodLevel("SPID_LOWFOODLEVEL", CFG_CUSTOM, 10.58)
Spider_Population_Manager::CreateObjects
virtual void CreateObjects(int ob_type, TAnimal *pvo, struct_Spider *data, int number)
Creates new spider objects - this must be overridden in descendent classes
Definition: Spider_BaseClasses.h:273
Spider_Juvenile::m_MyDirection
char m_MyDirection
The currrent movement direction
Definition: Spider_BaseClasses.h:401
TAnimal::m_guard_cell_y
int m_guard_cell_y
The index y to the guard cell.
Definition: PopulationManager.h:374
Spider_Base::m_OurPopulationManager
Spider_Population_Manager * m_OurPopulationManager
Definition: Spider_BaseClasses.h:309
Spider_Population_Manager::m_BallooningStart
int m_BallooningStart
A limiter for the day in year to start ballooning - to be assigned in a descendent classes population...
Definition: Spider_BaseClasses.h:147
Spider_Egg::m_DateLaid
int m_DateLaid
The day in year the eggsac was produced
Definition: Spider_BaseClasses.h:356
Population_Manager_Base::m_ListNames
const char * m_ListNames[32]
A list of life-stage names.
Definition: PopulationManager.h:628
Spider_Female::OnFarmEvent
virtual bool OnFarmEvent(FarmToDo event)
Determines the impact of any farm management events at the female's location
Definition: Spider_BaseClasses.h:488
tosps_Develop
Definition: Spider_BaseClasses.h:73
cfg_BalDensityDepMortConst
static CfgInt cfg_BalDensityDepMortConst("SPID_BALDENSITYDEPMORTCONST", CFG_CUSTOM, 1)
tosps_FBalloon
Definition: Spider_BaseClasses.h:84
Spider_Population_Manager::GetDoubleEggSacSpread
int GetDoubleEggSacSpread()
Return 2 x EggSacSpread value
Definition: Spider_BaseClasses.h:189
Spider_Juvenile::m_DispersalChance
static std::array< int, 40 > m_DispersalChance
Disperals probability as a function of bad habitat days
Definition: Spider_BaseClasses.h:396
Spider_Population_Manager::GetTodaysDroughtSc
double GetTodaysDroughtSc(int index)
Returns the drought score for high, medium or low plant biomass
Definition: Spider_BaseClasses.h:204
struct_Spider::L
Landscape * L
Definition: Spider_BaseClasses.h:99
SimplePositionMap
Used to map locations of individuals for density estimates - space inefficient but good for testing.
Definition: PositionMap.h:45
Spider_Juvenile::AssessHabitat
virtual TTypesOfSpiderState AssessHabitat()
Evaluates the habitat at current location
Definition: Spider_BaseClasses.cpp:666
Spider_Population_Manager::GetEggSacSpread
int GetEggSacSpread()
Return the EggSacSpread value
Definition: Spider_BaseClasses.h:185
tosps_Move
Definition: Spider_BaseClasses.h:74
Spider_Juvenile::ReInit
virtual void ReInit(int x, int y, Landscape *L, Spider_Population_Manager *SpPM)
Used to reinitialise reused objects
Definition: Spider_BaseClasses.cpp:363
Spider_Population_Manager::m_AdultPosMap
SimplePositionMap * m_AdultPosMap
Pointer to the egg position map
Definition: Spider_BaseClasses.h:116
Spider_Female::m_DailyFemaleMort
static int m_DailyFemaleMort
Daily mortality probability
Definition: Spider_BaseClasses.h:468
CfgFloat::value
double value() const
Definition: Configurator.h:142
struct_Spider::noEggs
int noEggs
Definition: Spider_BaseClasses.h:101
FarmToDo
FarmToDo
Definition: Treatment.h:31
Spider_Population_Manager::m_EggSacSpread
int m_EggSacSpread
Used to spread spiderlings on day 1 of hatch - to be assigned in a descendent classes population mana...
Definition: Spider_BaseClasses.h:135
Spider_Egg::GetNoEggs
int GetNoEggs()
Returns the number of eggs in the eggsac
Definition: Spider_BaseClasses.h:373
Spider_Population_Manager::GetDispDist
int GetDispDist(int chance)
Returns the dispsersal distance associated with a particular frequency value
Definition: Spider_BaseClasses.h:210
cfg_SpiderAdultPPPElimiationRate
static CfgFloat cfg_SpiderAdultPPPElimiationRate("SPID_ADPPPELIMIATIONRATE", CFG_CUSTOM, 0.0, 0.0, 1.0)
the daily adult elimination rate for pesticides
SimplePositionMap::ClearMapValue
virtual void ClearMapValue(unsigned a_x, unsigned a_y)
Definition: PositionMap.h:60
SimplePositionMap::SetMapValue
virtual void SetMapValue(unsigned a_x, unsigned a_y)
Definition: PositionMap.h:55
Spider_Population_Manager::InSquare
bool InSquare(int p_x, int p_y, int p_sqx, int p_sqy, int p_range)
Returns true if p_x,p_y is inside the square defined by p_sqz,p_sqy as TL corner and p_range size len...
Definition: Spider_BaseClasses.cpp:1168
TTypesOfSpiderState
TTypesOfSpiderState
The enumeration lists all spider behavioural states used by all spider species.
Definition: Spider_BaseClasses.h:68
cfg_WalDensityDepMortConst
static CfgInt cfg_WalDensityDepMortConst("SPID_WALDENSITYDEPMORTCONST", CFG_CUSTOM, 1)
Spider_Population_Manager::m_WalkingOnly
bool m_WalkingOnly
A flag to denote the spider does not balloon
Definition: Spider_BaseClasses.h:169
Spider_Population_Manager::m_DoubleEggSacSpread
int m_DoubleEggSacSpread
Twice the m_EggSacSpread, used to save multiplications
Definition: Spider_BaseClasses.h:137
Population_Manager_Base::m_ListNameLength
int m_ListNameLength
the number of life-stages simulated in the population manager
Definition: PopulationManager.h:626
Spider_Base::CheckPosMap
virtual int CheckPosMap(unsigned x, unsigned y)
Returns the value in m_OurPosMap for this location
Definition: Spider_BaseClasses.cpp:150
cfg_SpiderAdultPPPThreshold
static CfgFloat cfg_SpiderAdultPPPThreshold("SPID_ADPPPTHRESHOLD", CFG_CUSTOM, 99999.9, 0.0, 100000)
PPP effects threshold.
Spider_Egg::OnFarmEvent
virtual bool OnFarmEvent(FarmToDo event)
Determines the impact of any farm management events at the eggsac's location
Definition: Spider_BaseClasses.h:375
spider_tole_egss_position_valid
bool spider_tole_egss_position_valid(Landscape *m_OurLandscape, int x, int y)
Definition: Spider_toletoc.cpp:3
Spider_Female::ZeroEggSacDegrees
void ZeroEggSacDegrees()
Reset eggsac day degrees counter to zero
Definition: Spider_BaseClasses.h:490
Spider_Base::m_CurrentSpState
TTypesOfSpiderState m_CurrentSpState
Stores the current behavioural state
Definition: Spider_BaseClasses.h:304
Spider_Base::m_Lifestage
unsigned m_Lifestage
This is a useful parameter holding the spider type.
Definition: Spider_BaseClasses.h:306
Spider_Population_Manager::m_EggDegrees
double m_EggDegrees[365]
Cumulative day degrees from 1st Jan
Definition: Spider_BaseClasses.h:155
Spider_Female::Step
virtual void Step()
The Step code
Definition: Spider_BaseClasses.cpp:949
Spider_Population_Manager::GetJuvDegrees_good
double GetJuvDegrees_good()
Returns todays juvenile development day degrees for good food
Definition: Spider_BaseClasses.h:236
tosps_Hatch
Definition: Spider_BaseClasses.h:77
MovementMapUnsigned::GetMapValue
unsigned GetMapValue(unsigned a_x, unsigned a_y) const
Definition: MovementMap.h:56
Spider_Population_Manager::m_EggProdDDegsPoor
double m_EggProdDDegsPoor
Links reproduction to food levels and day degrees - poor food
Definition: Spider_BaseClasses.h:167
Population_Manager_Base::m_TheLandscape
Landscape * m_TheLandscape
holds an internal pointer to the landscape
Definition: PopulationManager.h:624
Spider_Female::EndStep
void EndStep()
EndStep behaviour - must be implemented in descendent classes.
Definition: Spider_BaseClasses.cpp:175
Spider_Juvenile::BalloonTo
virtual int BalloonTo(int direction, int distance)
Carry out ballooning in a given direction and distance
Definition: Spider_BaseClasses.cpp:713
Spider_Base::SetPosMap
virtual void SetPosMap(unsigned x, unsigned y)
Sets a PosMap location to non-zero
Definition: Spider_BaseClasses.cpp:170
tosps_Mature
Definition: Spider_BaseClasses.h:80
struct_Spider::SpPM
Spider_Population_Manager * SpPM
Definition: Spider_BaseClasses.h:100
TTypesOfLandscapeElement
TTypesOfLandscapeElement
Values that represent the types of landscape polygon that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:57
sfq_Chameleon
Definition: Spider_BaseClasses.h:57
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
Spider_Population_Manager::GetBallooningMortalityPerMeter
double GetBallooningMortalityPerMeter()
Return ballooning mortality per meter
Definition: Spider_BaseClasses.h:193
Population_Manager_Base::SimH
int SimH
stores the simulation height
Definition: PopulationManager.h:614
Spider_Egg::st_Develop
TTypesOfSpiderState st_Develop()
The behavioural state develop
Definition: Spider_BaseClasses.cpp:289
Spider_Population_Manager::DoFirst
virtual void DoFirst(void)
DoFirst method, to be overridden in descendent classes
Definition: Spider_BaseClasses.h:261
tosps_Reproduce
Definition: Spider_BaseClasses.h:83
SimplePositionMap::GetMapValue
virtual bool GetMapValue(unsigned a_x, unsigned a_y)
Definition: PositionMap.h:50
Spider_Population_Manager::m_TodaysDroughtScore
double m_TodaysDroughtScore[3]
Holds the current drought score for three vegetation classes
Definition: Spider_BaseClasses.h:131
Spider_Juvenile::m_JuvDensityDepMortConst
static int m_JuvDensityDepMortConst
Juvenile density dependent mortality threshold
Definition: Spider_BaseClasses.h:394
Spider_Juvenile::CheckToleTovIndex
virtual SpiderFoodQuality CheckToleTovIndex()
Returns the movement map value at current location
Definition: Spider_BaseClasses.cpp:653
Landscape::SupplyPesticide
double SupplyPesticide(int a_x, int a_y, PlantProtectionProducts a_ppp)
Gets total pesticide for a location.
Definition: Landscape.cpp:1386
tosps_AssessHabitat
Definition: Spider_BaseClasses.h:72
Spider_Juvenile::st_Walk
virtual TTypesOfSpiderState st_Walk()
The bheavioural state walk
Definition: Spider_BaseClasses.cpp:569
Spider_Base::m_Age
int m_Age
Stores the spiders age in days
Definition: Spider_BaseClasses.h:302
Spider_Juvenile::Maturation
virtual void Maturation()
The behavioural state maturation
Definition: Spider_BaseClasses.cpp:507
TAnimal::m_Location_y
int m_Location_y
The objects ALMaSS y coordinate.
Definition: PopulationManager.h:366
spider_toc_index
SpiderFoodQuality spider_toc_index(Landscape *m_OurLandscape, int x, int y)
Definition: Spider_toletoc.cpp:70
Spider_Female::CreateEggSac
void CreateEggSac(int a_NoEggs)
Creates the egg sac in the system.
Definition: Spider_BaseClasses.cpp:1054
Spider_Juvenile
The generic base class for juvenile spiders
Definition: Spider_BaseClasses.h:389
TAnimal::m_OurLandscape
static Landscape * m_OurLandscape
A pointer to the landscape object shared with all TAnimal objects.
Definition: PopulationManager.h:342
TAnimal::CheckManagement
void CheckManagement()
Used to start a check for any management related effects at the objects current location.
Definition: PopulationManager.cpp:1591
Spider_Female
The generic base class for female spiders
Definition: Spider_BaseClasses.h:459
struct_Spider
This is a data class that is used to create new instances of spider objects by CreateObjects in the r...
Definition: Spider_BaseClasses.h:94
sfq_None
Definition: Spider_BaseClasses.h:59
TAnimal
The base class for all ALMaSS animal classes. Includes all the functionality required to be handled b...
Definition: PopulationManager.h:200
sfq_Best
Definition: Spider_BaseClasses.h:62
Spider_Population_Manager::GetEggDevelDegrees
double GetEggDevelDegrees(int day)
Returns todays egg development day degrees
Definition: Spider_BaseClasses.h:245
Spider_Female::ProduceEggSac
bool ProduceEggSac()
Produce an eggsac at current location
Definition: Spider_BaseClasses.cpp:1035
Spider_Population_Manager::GetWalking
bool GetWalking()
Returns walking only flag
Definition: Spider_BaseClasses.h:251
struct_Spider::x
int x
Definition: Spider_BaseClasses.h:97
sfq_Ok
Definition: Spider_BaseClasses.h:61
Spider_Egg::m_NoEggs
int m_NoEggs
The number of eggs contained in the eggsac
Definition: Spider_BaseClasses.h:358
Spider_Egg::SetNoEggs
void SetNoEggs(int Eggs)
Sets the number of eggs attribute
Definition: Spider_BaseClasses.h:371
struct_Spider::y
int y
Definition: Spider_BaseClasses.h:98
Spider_Population_Manager::GetEggDegreesInt
double GetEggDegreesInt()
Returns todays egg sac production day degrees for intermediate food
Definition: Spider_BaseClasses.h:230
Spider_Population_Manager::GetJuvDegrees_intermediate
double GetJuvDegrees_intermediate()
Returns todays juvenile development day degrees for intermediate food
Definition: Spider_BaseClasses.h:239
Population_Manager
Base class for all population managers for agent based models.
Definition: PopulationManager.h:645
Spider_Egg::Spider_Egg
Spider_Egg(int x, int y, Landscape *L, Spider_Population_Manager *EPM, int Eggs)
The Spider_Egg constructor
Definition: Spider_BaseClasses.cpp:222
Landscape::SupplyDayInYear
int SupplyDayInYear(void)
Passes a request on to the associated Calendar class function, the day in the year.
Definition: Landscape.h:2267
SpiderFoodQuality
SpiderFoodQuality
The enumeration lists five catagories of habitat for spiders. Chameleon is used when the vegetation t...
Definition: Spider_BaseClasses.h:55
Spider_Juvenile::Step
virtual void Step()
The Step code
Definition: Spider_BaseClasses.cpp:407
tosps_Dying
Definition: Spider_BaseClasses.h:75
TALMaSSObject::m_StepDone
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
Definition: PopulationManager.h:133
Population_Manager::m_is_paralleled
bool m_is_paralleled
This is used to indicate whether the species is paralleled.
Definition: PopulationManager.h:796
Spider_Juvenile::WalkTo
virtual int WalkTo(int direction)
Walk in a given direction
Definition: Spider_BaseClasses.cpp:785
Spider_Population_Manager::m_MinWalkTemp
bool m_MinWalkTemp
A flag to show whether minimum walking temperature is reached
Definition: Spider_BaseClasses.h:171
TTypesOfSpiders
TTypesOfSpiders
The enumeration lists all spider life stages used by all spider species.
Definition: Spider_BaseClasses.h:45
Spider_Population_Manager::~Spider_Population_Manager
virtual ~Spider_Population_Manager()
Destructor
Definition: Spider_BaseClasses.cpp:1156
Spider_Population_Manager::TheAOROutputProbe
virtual void TheAOROutputProbe()
A method to generate the AOR probe output
Definition: Spider_BaseClasses.h:265
Spider_Female::st_Walk
virtual TTypesOfSpiderState st_Walk()
the behavioural state walk
Definition: Spider_BaseClasses.cpp:890
Spider_Egg::Step
virtual void Step()
The Step code
Definition: Spider_BaseClasses.cpp:243
CfgInt::value
int value() const
Definition: Configurator.h:116
Spider_Population_Manager::GetWindDirection
int GetWindDirection()
Returns the wind direction
Definition: Spider_BaseClasses.h:221
Spider_Population_Manager::m_TodaysMonth
int m_TodaysMonth
Holds the current month
Definition: Spider_BaseClasses.h:129
Spider_Juvenile::AddToBadHabitatDays
virtual void AddToBadHabitatDays()
Increments bad habitat days up to max of 39
Definition: Spider_BaseClasses.h:452
Spider_Population_Manager::BallooningHrs
double BallooningHrs[52 *7]
The daily number of ballooning hours - to be assigned in a descendent classes population manager
Definition: Spider_BaseClasses.h:125
Spider_Population_Manager::GetDaysSinceRain
int GetDaysSinceRain()
Return the number of days since rain
Definition: Spider_BaseClasses.h:197
Spider_Population_Manager::m_EggDevelopmentThreshold
double m_EggDevelopmentThreshold
The lower threshold for egg development - to be assigned in a descendent classes population manager
Definition: Spider_BaseClasses.h:151
Spider_Population_Manager::IsBallooningWeather
bool IsBallooningWeather()
Returns the flag for ballooning weather
Definition: Spider_BaseClasses.h:224
Spider_Egg::m_DailyEggMortConst
static int m_DailyEggMortConst
This is a space for holding cfg species specific parameters - this is the daily egg mortality probabi...
Definition: Spider_BaseClasses.h:351
Population_Manager_Base::SimW
int SimW
stores the simulation width
Definition: PopulationManager.h:616
Spider_Population_Manager::TheRipleysOutputProbe
virtual void TheRipleysOutputProbe(FILE *a_prb)
A method to generate the Ripley probe output
Definition: Spider_BaseClasses.h:267
cfg_HighFoodLevel
static CfgFloat cfg_HighFoodLevel("SPID_HIGHFOODLEVEL", CFG_CUSTOM, 18.515)
Population_Manager::UpdateGuardMap
void UpdateGuardMap(int a_x, int a_y, int &a_index_x, int &a_index_y)
Get the index of the guard map for the given location.
Definition: PopulationManager.h:768
tspi_Spiderling
Definition: Spider_BaseClasses.h:48
Population_Manager::StateNames
const char * StateNames[100]
Definition: PopulationManager.h:801
Spider_Population_Manager::Init
virtual void Init(void)
An initiation method to initialise all the necessary values - must be overridden for species specific...
Definition: Spider_BaseClasses.cpp:1163
Spider_Female::m_lifespan
int m_lifespan
Limits the age to which the female spider can reach
Definition: Spider_BaseClasses.h:475
Landscape::SupplyInsects
double SupplyInsects(int a_polyref)
Returns the insect biomass on a polygon using the polygon reference number a_polyref or based on the ...
Definition: Landscape.h:1712
Spider_Female::Spider_Female
Spider_Female(int x, int y, Landscape *L, Spider_Population_Manager *EPM)
The construtor
Definition: Spider_BaseClasses.cpp:873
Spider_Population_Manager::GetBTimeToday
double GetBTimeToday()
Returns todays ballooning time
Definition: Spider_BaseClasses.h:218
Spider_Population_Manager::Catastrophe
virtual void Catastrophe()
Allows for the possibility to create population level mortality
Definition: Spider_BaseClasses.h:271
Spider_Female::CalculateEggsPerEggSac
virtual int CalculateEggsPerEggSac()
Determines the number of eggs per egg sac - This must be overidden in descendent classes.
Definition: Spider_BaseClasses.h:497
TAnimal::ReinitialiseObject
virtual void ReinitialiseObject(int a_x, int a_y, Landscape *a_l_ptr)
Definition: PopulationManager.h:282
Spider_Base::WhatState
virtual int WhatState()
Returns the current spider behavioural state
Definition: Spider_BaseClasses.h:317
Spider_Population_Manager
Definition: Spider_BaseClasses.h:105
MovementMap.h
Movementmap.h This file contains the headers for the MovementMap class
Spider_Juvenile::Walk
virtual int Walk()
Carries out walking
Definition: Spider_BaseClasses.cpp:639
CfgInt
Integer configurator entry class.
Definition: Configurator.h:102
Spider_Juvenile::CalcDrought
virtual void CalcDrought()
For extension in descendent classes to calculate drought days for mortality
Definition: Spider_BaseClasses.h:454
Spider_Population_Manager::m_DailyJuvMort
double m_DailyJuvMort
The daily probability of a juvenile dying - to be assigned in a descendent classes population manager
Definition: Spider_BaseClasses.h:121
Spider_Population_Manager::GetJuvDegrees_poor
double GetJuvDegrees_poor()
Returns todays juvenile development day degrees for poor food
Definition: Spider_BaseClasses.h:242
cfg_NoFoodLevel
static CfgFloat cfg_NoFoodLevel("SPID_NOFOODLEVEL", CFG_CUSTOM, 1.25)
TAnimal::m_guard_cell_x
int m_guard_cell_x
The index x to the guard cell.
Definition: PopulationManager.h:370
Spider_Egg::BeginStep
virtual void BeginStep()
The begin step code
Definition: Spider_BaseClasses.cpp:238
tosps_Destroy
Definition: Spider_BaseClasses.h:87
Spider_Female::m_Max_Egg_Production
static int m_Max_Egg_Production
The maximum number of eggs possible
Definition: Spider_BaseClasses.h:466
Spider_Population_Manager::CheckHumidity
bool CheckHumidity(int, int)
Returns humid or not
Definition: Spider_BaseClasses.h:248
CfgFloat
Double configurator entry class.
Definition: Configurator.h:126
Spider_Base::m_SimH
static int m_SimH
The height of the landscape
Definition: Spider_BaseClasses.h:294
Spider_Female::BeginStep
virtual void BeginStep()
The BeingStep code
Definition: Spider_BaseClasses.cpp:926
Spider_Base
Definition: Spider_BaseClasses.h:285
Spider_Juvenile::Balloon
virtual int Balloon()
Carries out ballooning
Definition: Spider_BaseClasses.cpp:622
CFG_CUSTOM
Definition: Configurator.h:70
g_random_fnc
int g_random_fnc(const int a_range)
Definition: ALMaSS_Random.cpp:74
Spider_Juvenile::BeginStep
virtual void BeginStep()
The BeginStep code
Definition: Spider_BaseClasses.cpp:374
Spider_Egg::m_EggDevelConst
static double m_EggDevelConst
This is a space for holding cfg species specific parameters - this is a developmental threshold for h...
Definition: Spider_BaseClasses.h:353
Spider_Base::m_SimW
static int m_SimW
The width of the landscape
Definition: Spider_BaseClasses.h:292
Spider_Population_Manager::GetMinWalkTemp
bool GetMinWalkTemp()
Returns the minimum walking temperature
Definition: Spider_BaseClasses.h:254
Spider_Female::st_Balloon
virtual TTypesOfSpiderState st_Balloon()
The behavioural state balloon
Definition: Spider_BaseClasses.cpp:907
Spider_Population_Manager::GetJuvMort
double GetJuvMort()
Return current juvenile mortality rate
Definition: Spider_BaseClasses.h:207
tspi_Egg
Definition: Spider_BaseClasses.h:47
Spider_Population_Manager::m_BallooningMortalityPerMeter
double m_BallooningMortalityPerMeter
The mortality of ballooned distance - to be assigned in a descendent classes population manager
Definition: Spider_BaseClasses.h:139
TALMaSSObject::m_CurrentStateNo
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:131
BallooningHours
const double BallooningHours[52]
Definition: Spider_BaseClasses.cpp:73
tosps_Initiation
Definition: Spider_BaseClasses.h:71
sfq_Lethal
Definition: Spider_BaseClasses.h:58
spider_tole_lethal
bool spider_tole_lethal(Landscape *m_OurLandscape, int x, int y)
Definition: Spider_toletoc.cpp:59
Spider_Juvenile::st_Develop
virtual TTypesOfSpiderState st_Develop()
The behavioural state development
Definition: Spider_BaseClasses.cpp:468
PositionMap.h
PositionMap.h This file contains the headers for the PositionMap class
Spider_Population_Manager::m_JuvPosMap
SimplePositionMap * m_JuvPosMap
Pointer to the egg position map
Definition: Spider_BaseClasses.h:114
SimplePositionMap::GetMapDensity
virtual int GetMapDensity(unsigned a_x, unsigned a_y, unsigned a_range)
Definition: PositionMap.h:65
Spider_Egg::st_Die
virtual void st_Die()
The behavioural state die
Definition: Spider_BaseClasses.cpp:275
tspi_Female
Definition: Spider_BaseClasses.h:49
spider_tole_juvenile_maturation_valid
bool spider_tole_juvenile_maturation_valid(Landscape *m_OurLandscape, int x, int y)
Definition: Spider_toletoc.cpp:40
Spider_Base::KillThis
virtual void KillThis()
Destroys the spider
Definition: Spider_BaseClasses.h:321
cfg_SpiderJuvPPPElimiationRate
static CfgFloat cfg_SpiderJuvPPPElimiationRate("SPID_JUVPPPELIMIATIONRATE", CFG_CUSTOM, 0.0, 0.0, 1.0)
the daily juvenile elimination rate for pesticides
tosps_JWalk
Definition: Spider_BaseClasses.h:81
cfg_SpiderJuvPPPEffectProb
static CfgFloat cfg_SpiderJuvPPPEffectProb("SPID_JUVPPPEFFECTPROB", CFG_CUSTOM, 0, 0.0, 1.0)
Effect probability on threshold excedence.
Landscape::Warn
void Warn(std::string a_msg1, std::string a_msg2)
Wrapper for the g_msg Warn function.
Definition: Landscape.h:2250
cfg_SpiderEggPPPElimiationRate
static CfgFloat cfg_SpiderEggPPPElimiationRate("SPID_EGGPPPELIMIATIONRATE", CFG_CUSTOM, 0.0, 0.0, 1.0)
the daily egg elimination rate for pesticides
Spider_Juvenile::Spider_Juvenile
Spider_Juvenile(int x, int y, Landscape *L, Spider_Population_Manager *SpPM)
the constructor
Definition: Spider_BaseClasses.cpp:351
Spider_Base::ReInit
void ReInit(int x, int y, Landscape *L, Spider_Population_Manager *SpMan)
Reinitialise object code
Definition: Spider_BaseClasses.cpp:136
Spider_Female::m_EggSacDegrees
double m_EggSacDegrees
Day degrees sum for eggsac production
Definition: Spider_BaseClasses.h:471
Spider_Base::OnFarmEvent
virtual bool OnFarmEvent(FarmToDo)
Determines the impact of any farm management events at the spiders location - must be overridden.
Definition: Spider_BaseClasses.h:319
SimplePositionMap::GetMapPositive
virtual bool GetMapPositive(unsigned a_x, unsigned a_y, unsigned a_range)
Definition: PositionMap.h:75
Spider_Base::GetPosMapPositive
virtual bool GetPosMapPositive(unsigned x, unsigned y, unsigned range)
Returns whether there are any non-zero values within range of this coordinate (TL corner)
Definition: Spider_BaseClasses.cpp:155
TAnimal::m_Location_x
int m_Location_x
The objects ALMaSS x coordinate.
Definition: PopulationManager.h:362
Spider_Base::EggPosValid
virtual bool EggPosValid(unsigned a_x, unsigned a_y)
Checks if its possible to create an eggsac here
Definition: Spider_BaseClasses.cpp:100
Spider_Base::ClearPosMap
virtual void ClearPosMap(unsigned x, unsigned y)
Clears a PosMap location
Definition: Spider_BaseClasses.cpp:165
Spider_Egg::m_HatDensityDepMortConst
static int m_HatDensityDepMortConst
This is a space for holding cfg species specific parameters - this is the mortality constant associat...
Definition: Spider_BaseClasses.h:349
count
Definition: SubPopulation.h:48
Spider_Population_Manager::m_BallooningWeather
bool m_BallooningWeather
A flag for whether the weather is correct for ballooning
Definition: Spider_BaseClasses.h:145
tosps_JBalloon
Definition: Spider_BaseClasses.h:79
Spider_Juvenile::SpecialWinterMort
virtual void SpecialWinterMort()
Used to impose extra mortaltiy to those spiderlings that don't reach a minimum developmental stage by...
Definition: Spider_BaseClasses.cpp:589
Spider_Population_Manager::GetEggDegreesPoor
double GetEggDegreesPoor()
Returns todays egg sac production day degrees for poor food
Definition: Spider_BaseClasses.h:227
Spider_Population_Manager::m_EggDevelopmentThreshold2
double m_EggDevelopmentThreshold2
The upper threshold for egg development - to be assigned in a descendent classes population manager
Definition: Spider_BaseClasses.h:153
Spider_Population_Manager::m_MinWalkTempThreshold
double m_MinWalkTempThreshold
A minimum dispersal by walking temperature
Definition: Spider_BaseClasses.h:173
Spider_Population_Manager::m_JuvDegreesPoor
double m_JuvDegreesPoor
Contribution to day degrees under poor food
Definition: Spider_BaseClasses.h:161
ppp_1
Definition: LandscapeFarmingEnums.h:1079
Spider_Population_Manager::m_DispersalDistances
int m_DispersalDistances[10000]
The distribution of dispersal distances - to be assigned in a descendent classes population manager
Definition: Spider_BaseClasses.h:123
Spider_Female::m_EggsProduced
int m_EggsProduced
Record of the number of eggs produced
Definition: Spider_BaseClasses.h:473
cfg_ExtraCompetionMortality
static CfgInt cfg_ExtraCompetionMortality("SPID_EXTRACOMPETITIONMORTALITY", CFG_CUSTOM, 10)
Spider_Egg::EndStep
void EndStep()
EndStep behaviour - must be implemented in descendent classes.
Definition: Spider_BaseClasses.cpp:203
Spider_Population_Manager::m_EggProdDDegsGood
double m_EggProdDDegsGood
Links reproduction to food levels and day degrees - good food.
Definition: Spider_BaseClasses.h:163
cfg_SpiderJuvPPPThreshold
static CfgFloat cfg_SpiderJuvPPPThreshold("SPID_JUVPPPTHRESHOLD", CFG_CUSTOM, 99999.9, 0.0, 100000)
PPP effects threshold.
Spider_Population_Manager::m_TodaysBallooningTime
double m_TodaysBallooningTime
The current day's ballooning time
Definition: Spider_BaseClasses.h:133
MovementMapUnsigned
Movement maps are used for rapid computing of animal movement. This version uses values of 0 to max i...
Definition: MovementMap.h:52