Loading [MathJax]/extensions/MathZoom.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
Ladybird_Adult Class Referencefinal

#include <Ladybird_All.h>

Inheritance diagram for Ladybird_Adult:
Ladybird_Base Beetle_Adult Beetle_Base Beetle_Base TAnimal TAnimal TALMaSSObject TALMaSSObject

Public Member Functions

 Ladybird_Adult (int a_x, int a_y, Landscape *a_l_ptr, Ladybird_Population_Manager *a_lpm_ptr)
 Ladybird adult constructor. More...
 
void ReInit (int a_x, int a_y, Landscape *a_l_ptr, Ladybird_Population_Manager *a_lpm_ptr)
 ReInit for object pool. More...
 
void BeginStep () override
 the standard begin step function as overridden by the ladybird adult More...
 
void SetOverwintered (const bool a_value)
 sets the value of the state variable that flags that the beetle has overwintered More...
 
void SetIsHibernating (const bool a_val)
 sets the value of the state variable that flags whether the beetle is currently hibernating More...
 
- Public Member Functions inherited from Ladybird_Base
 Ladybird_Base (Ladybird_Population_Manager *a_lpm_ptr)
 Class constructor. More...
 
 ~Ladybird_Base () override=default
 
- Public Member Functions inherited from Beetle_Base
 Beetle_Base (int a_x, int a_y, Landscape *a_l_ptr, Beetle_Population_Manager *a_bpm_ptr)
 Beetle_Base Constructor. More...
 
virtual void SetState (const TTypesOfBeetleState a_state)
 Used to force a beetle state (e.g. at start of the simulation) More...
 
virtual void StDie ()
 Common state Die. More...
 
void CopyMyself (int a_beetle)
 For experimental purposes. More...
 
virtual bool GetDensityDependentMortality ()
 The density dependent mortality calculation (cannibalism) defaults to none. More...
 
void KillAndRemoveFromMap ()
 Kills the beetle - this version forces the beetle to re-enter the Step code and call st_Dying. More...
 
void IncDensity (int a_x, int a_y, int a_lifestage)
 The method inreases the number of beetles in this specific location by one. Used when called by a beetle of different lifestage than the one incremented. More...
 
void DecDensity (int a_x, int a_y)
 The method decreases the number of beetles in this specific location by one. More...
 
void KillOneInMap (int a_x, int a_y, int a_lifestage)
 The method decreases the number of beetles in this specific location by one. More...
 
void IncDensity (const int a_x, const int a_y)
 The method inreases the number of beetles in this specific location by one. More...
 
void DecDensity (const int a_x, const int a_y, const int a_lifestage)
 The method decreases the number of beetles in this specific location by one. Used when called by a beetle of different lifestage than the one dying. More...
 
int GetDensity (int a_x, int a_y) const
 The method to return the number of beetles in this specific location. More...
 
int GetDensityRange (int a_x, int a_y, int a_range) const
 The method to return the number of beetles in this specific location with a range. More...
 
int GetDensityRangeEdge (int a_x, int a_y, int a_range) const
 The method to return the number of beetles in this specific location with a range. More...
 
virtual double GetDevelopmentConstants (const int a_i) const
 the method returns the larvae development constant to be used in day degrees calculation More...
 
int WhatState () override
 Return the beetle state as an integer. More...
 
- Public Member Functions inherited from TAnimal
 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 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...
 
- Public Member Functions inherited from TALMaSSObject
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...
 
- Public Member Functions inherited from Beetle_Adult
 Beetle_Adult (int a_x, int a_y, Landscape *a_l_ptr, Beetle_Population_Manager *a_bpm_ptr)
 
void ReInit (int a_x, int a_y, Landscape *a_l_ptr, Beetle_Population_Manager *a_bpm_ptr) override
 ReInit for object pool. More...
 
void Step () override
 Adult Step. More...
 
void EndStep () override
 Adult EndStep. More...
 
void SetCanReproduce (const bool a_param)
 set the ability to reproduce to the value given as an agrument More...
 
double GetStriglingMortality () const override
 Mortality by mechanincal weeding. More...
 
double GetSoilCultivationMortality () const override
 the method overrides the method that returns the mortality due to soil cultivation More...
 
double GetInsecticideApplication () const override
 the method overrides the method that returns the mortality due to insecticide application More...
 
double GetHarvestMortality () const override
 the method overrides the method that returns the mortality due to harvest More...
 

Static Public Member Functions

static void SetOvipositionPeriod (const bool a_cond)
 
static void SetAphidsPerPreyLevel (const int a_value)
 
static void SetHibernationClumpeSizeDist (const vector< double > &a_dist)
 
static void SetOvipositionRateTemp (const vector< double > &a_dist)
 
static void SetBackgroundMortTemp (const vector< double > &a_vector)
 
static void SetShortRangeDistToday (const int a_value)
 
- Static Public Member Functions inherited from Ladybird_Base
static void SetLadybirdStagesNutritionalValue (const vector< int > &a_list)
 Sets the list of aphid equivalents of each ladybird stage. More...
 
- Static Public Member Functions inherited from Beetle_Base
static int GetDensityStage (int a_x, int a_y, unsigned a_stage)
 The method to return the number of beetles in this specific location for a given stage. More...
 
static int GetDensityStages (int a_x, int a_y, int a_numberstageStart, int a_numberstangeEnd)
 The method to return the number of beetles in this specific location, summing multiple stages. More...
 
static int GetDensityRangeStages (int a_x, int a_y, int a_range, int a_numberstageStart, int a_numberstangeEnd)
 The method to return the number of beetles in this specific location with a range, summing multiple stages. More...
 
static void SetDevelopmentConstants (const std::vector< double > &a_value)
 Set the day degree constant. More...
 
static void SetTodaysTempCategory (int a_category)
 Set the soil temperature category used for calculatiung mortality steps. More...
 
static void SetMoveDistribution (const string &a_type_str, const string &a_args_str)
 Set the movement distribution. More...
 
static void SetBeetleSuitableForHibernation (const TTovList &a_list)
 Set the list of tovs that are suitable for hibernation. More...
 
static void SetBeetleReproductionLandscape (const TToleList &a_list)
 Set the list of toles that the beetles are allowed to reproduce upon. More...
 
static void SetBeetleHalfReproductionLandscape (const TToleList &a_list)
 Set the list of toles that the beetles are allowed to reproduce upon, but that yield half of normal fertility (bembidion) More...
 
static void SetDipsersalDayDegrees (const int a_value)
 
static void SetMaxShortRangeAttempts (const int a_value)
 
static void SetDDepRange (const int a_value)
 Set density-dependent range parameter. More...
 
static void SizeBeetleMap (const int a_value)
 Size the lifestage map. More...
 
static void SetBeetleMap (const int a_value, SimplePositionMapInt *a_map_ptr)
 Set lifestage map. More...
 
static int ChooseDirection (const double(&a_probabilities)[8])
 The function that draws the random number and checks in which interval in the probabilities vector are we This would be the direction the beetle will take. More...
 
- Static Public Member Functions inherited from TAnimal
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 Public Member Functions inherited from TALMaSSObject
static void OnArrayBoundsError ()
 Used for debugging only, tests basic object properties. More...
 
- Static Public Member Functions inherited from Beetle_Adult
static void SetAdultPPPElimRate (const double a_rate)
 Set body PPP eliminatation rate. More...
 
static void SetAdultPppThreshold (const double a_thresh)
 Set body PPP threshold. More...
 
static void SetAdultPppEffectProb (const double a_conc)
 Set body PPP effect probability. More...
 
static void SetAdultPppEffectProbDecay (const double a_decay)
 Set body PPP effect probability. More...
 
static void SetAdult_SoilCultivationMortality (const double a_value)
 Set adult soil mortality parameter. More...
 
static void SetAdult_InsecticideApplication (const double a_value)
 Set Insecticide mortality parameter. More...
 
static void SetAdult_StriglingMort (const double a_value)
 Set the mechanical weeding mortality parameter. More...
 
static void SetAdult_HarvestMort (const double a_value)
 Set the harvest parameter. More...
 
static void SetInFieldHibernateChance (const double a_value)
 
static void SetAdultMaxMoveDist (const int a_value)
 Set the max move distance for dispersal. More...
 
static void SetAdultMovementTempThreshold (const double a_value)
 Set the temperature threshold for movement. More...
 
static void SetAdultTurnRate (const double a_value)
 
static void SetStartAggregatingDay (const int a_value)
 
static void SetStartAggregatingDayProb (const int a_value)
 
static void SetStopAggregationDay (const int a_value)
 
static void SetDailyAdultMort (const double a_value)
 Set the daily fixed mortality probability. More...
 
static void SetAdultDenDepMort0 (const int a_value)
 Storage for density-dependent mortality parameter. More...
 
static void SetAdultDenDepMort1 (const double a_value)
 Set density-dependent mortality parameter. More...
 
static void SetDispersalThreshold (const double a_value)
 Set the adult dispersal temp threshold for DD calcuation. More...
 
static void SetTodaysEggProduction (const int a_value)
 Daily temperature determined egg production. More...
 
static void SetStartReproductionDay (const int a_value)
 
static void SetDailyStartReproductionChance (const double a_value)
 

Protected Member Functions

double GetExtremeTempMin () const
 returns the lower limit of bearable temperatures. below it the beetle will be subject to high mortality. More...
 
bool WinterMort () const override
 The method for calculating overwintering mortality. More...
 
TTypesOfBeetleState St_Aggregate () override
 Aggreagte function for the adult ladybird - moves them to hibernaculae. More...
 
TTypesOfBeetleState St_Hibernate () override
 Hibernate function for the Adult. More...
 
TTypesOfBeetleState St_Forage () override
 method that implements the foraging behaviour for adult beetles More...
 
TTypesOfBeetleState St_Dispersal () override
 the ladybird adult's override of a dispersal beahviour More...
 
void TryToReproduce () override
 Does reproduction if possible. More...
 
bool LongRangeFind (int a_distance, int a_minimumflightlength, int a_target, bool(Ladybird_Adult::*a_func)(int, int, int))
 The function to determine a landing location for long range movement for foraging or aggregating. More...
 
bool FindTarget (int a_distance, int a_minimumflightlength, int a_target)
 The function to determine a landing location for long range movement for foraging or aggregating. More...
 
bool ShouldStartAggregating ()
 The method evaluates whether the beetle should start aggregation. More...
 
bool IsProbhibited (int a_x, int a_y) const
 Tests for toles that are not allowed for movement to at x,y, location. More...
 
bool IsAggregationSite (const int a_x, const int a_y, const int a_unused)
 Tests for toles that are aggregation types at x,y, location. More...
 
bool IsForageSite (const int a_x, const int a_y, const int a_target)
 Tests for aphid densities at x,y. More...
 
void setEggCounter (int num)
 sets the total to-lay egg counter to a value More...
 
void decEggCounter (int num)
 decrements the total to-lay counter by value More...
 
int getEggCounter ()
 returns thetotal egg counter (how many eggs left to lay) More...
 
void setDailyEggs (int num)
 sets daily eggs to-lay More...
 
void decDailyEggs (int num)
 decrements daily eggs to-lay More...
 
- Protected Member Functions inherited from Ladybird_Base
void EatToday (const int a_add)
 Adds to the counter of eaten aphids. More...
 
virtual int GetEatenToday () const
 return the value of daily aphid consumption counter More...
 
virtual void SetEatenToday (int a)
 set the value of the counter of eaten aphids More...
 
int GetAphidsToEat ()
 return how many aphids are left to be eaten More...
 
virtual int GetAphidsAppetite ()
 The function returns the aphids appetite (virtual function stub: to be overridden) More...
 
virtual void ResetAphidsAppetite ()
 reset the appetite to zero More...
 
virtual int EatAphids (int a_x, int a_y, int a_appetite)
 the method that is responsible for aphid foraging behaviour (removes the aphids from the aphid model) More...
 
int Cannibalise (int a_appetite)
 Perform the cannibalisation behaviour from the perspective of a cannibal : receives the appetite to fulfill, returns how much is left to be eaten after an attempt to cannibalise. More...
 
virtual void CalcAphidsAppetite ()
 Calculates the appetite of aphids based on the age (Arshad et al, 2017) More...
 
bool CanMove ()
 returns true if the beetle can still move today More...
 
int GetMaxDailyDistance ()
 
- Protected Member Functions inherited from Beetle_Base
virtual void Init (Beetle_Population_Manager *a_bpm_ptr)
 Init for a beetle object. More...
 
bool OnFarmEvent (FarmToDo event) override
 the farming event mortality. This is the function that is used for all the beetles. It calls methods that are re-defined by object and by method. More...
 
virtual bool CheckManagementBeetle ()
 
virtual double TempRelatedMortality ()
 Basic movement for beetle. More...
 
virtual int GetDDepthRange () const
 range at which density dependent mortality is applied - base class does not override, but others might need to More...
 
void Beetle_1M_Move (int a_dist)
 The function that calculates the cumulative probability for the movement direction. It calls the movement factor method and processes ints result to adjust "p" (by reference) More...
 
virtual bool IsLocationAllowed (int x, int y)
 
virtual double GetShortRangeDistance () const
 returns the length of the short range hop
More...
 
virtual double MovementFactor (int x, int y, int x1, int y1)
 function that calculates the factor that is taken into account when considering the movement of the individual More...
 
virtual bool DailyMortality ()
 Checks daily mortality returns true on death, default, no death. More...
 
- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 
- Protected Member Functions inherited from Beetle_Adult
void InternalPesticideHandlingAndResponse () override
 Handle pesticide events code for the beetle. More...
 
double GetDailyMortalityRate () const override
 the override of the function that returns the background mortality rate More...
 
void Init ()
 Intitialise attribute values. More...
 
virtual bool CheckDormancyExit ()
 Hibernation breaking check (override likely in descendent classes) More...
 
virtual TTypesOfBeetleState CheckDormancy ()
 Determines whether its time to hibernate. More...
 
virtual void CheckReproduction ()
 Starts reproduction when ready. More...
 
virtual TTypesOfBeetleState Ageing ()
 Daily ageing. More...
 
bool DDepMort () const
 Density-dependent mortality. More...
 
void MoveToWithPlacesList (int a_dist)
 Moves attempting egg laying under way. More...
 
virtual int MoveTo_Quality_Assess ()
 Moves w.r.t. habitat quality only. More...
 
TTypesOfBeetleState MoveToNoList (int a_dist)
 Moves using a stopping rule for hibernation. More...
 
virtual void Reproduce (int a_x, int a_y)
 Produces the eggs. More...
 
virtual void Turning ()
 Turning returns a direction to move in next step. More...
 
virtual void TurningForced ()
 Turning returns a direction to move in next step. More...
 
void TurningRandom ()
 Turning returns a direction to move in next step chosen randomly from 8 possibles (0-7) More...
 
virtual int GetDistanceToMove ()
 Inline function to get the distance moved today. More...
 
virtual bool IsSuitableForHibernation (TTypesOfVegetation)
 Support function: Checking that the tole is suitable for hibernation. More...
 
virtual bool IsReproductionLandscape (TTypesOfLandscapeElement tole)
 Support function: Checking if it is the reproduction landscape. More...
 
virtual bool IsHalfReproductionLandscape (TTypesOfLandscapeElement tole)
 Support function: Checking if it is the half-reproduction landscape. More...
 
bool GetCanReproduce () const
 returns the value of the flag that indicates the beetles that can reproduce More...
 
int GetStartAggregationDayProb () const
 return the aggregation start day probability More...
 
bool CheckForDispersal ()
 the method that checks for the dispersal More...
 
void IncNegDegrees ()
 the method that keeps track of the negative day degrees (negative day degrees cause mortality) More...
 

Protected Attributes

int m_EmergenceDay { 0 }
 The day of the year when this particular individual emerged, to be used to track minimum delay time between the emergence and oviposition. More...
 
bool m_IsHibernating { false }
 State variable: true if hibernating. More...
 
bool m_HasOverwintered { false }
 State variable: true if overwintered. More...
 
int m_DailyEggs { 0 }
 The variables holding the amount of eggs to be laid today. More...
 
double m_ADayDeg { 0 }
 day degrees sum for an individual More...
 
int m_UnsuccessfulAphidsAttempts { 0 }
 The variable that holds the unsuccesful searches for aphids. More...
 
int m_OviMaturation {0}
 Counter for ovi maturation. More...
 
int m_HibernationClumpSize { 0 }
 Records the size of the hibernation clump. More...
 
- Protected Attributes inherited from Ladybird_Base
int m_EatenToday { 0 }
 number of aphids or aphid equivalents eaten today More...
 
int m_WantToEatToday { 0 }
 number of ladybird larvae younger than this to eat in EndStep More...
 
int m_AphidsAppetite { 0 }
 the today's appetite More...
 
int m_MoveCounter { 0 }
 the counter of the steps made today More...
 
Ladybird_Population_Managerm_OurPopulationLadybird { nullptr }
 pointer to the population manager More...
 
- Protected Attributes inherited from Beetle_Base
TTypesOfBeetleState m_CurrentBState { tobs_Initiation }
 Current behavioural state. More...
 
Beetle_Population_Managerm_OurPopulation { nullptr }
 Pointer to the population manager. More...
 
double m_BodyBurden { -1.0 }
 Current body burden of pesticide. More...
 
double m_CurrentPppEffectProb { -1.0 }
 Current effect probability. More...
 
unsigned m_Lifestage { 0 }
 This is a useful parameter holding the beetle type (this includes larval stages) More...
 
- Protected Attributes inherited from TAnimal
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
 
- 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...
 
- Protected Attributes inherited from Beetle_Adult
double m_negDegrees {-1}
 The number of negative day degrees experienced. More...
 
double m_HibernateDegrees {-1}
 The number of day degrees experienced in the spring which may trigger dispersal. More...
 
unsigned int m_OldDirection {0}
 The last direction moved. More...
 
int m_EggCounter {-1}
 The number of eggs produced. More...
 
vector< PointDirectionm_plList {}
 A helper attribute when simulating movement. More...
 
PointDirection m_plPoint
 A helper attribute when simulating movement. More...
 
bool m_CanReproduce_bool {false}
 Signal reproductive readiness. More...
 

Static Protected Attributes

static int m_AphidsPerPreyLevel = 0
 Speed storage for the prey level denominator. More...
 
static vector< double > m_HibernationClumpeSizeDist = cfg_LadybirdHibernaculaeSizesDist.value()
 Holds the clump size distribution with density table. More...
 
static vector< double > m_OvipositionRateTemp = cfg_LadybirdDailyOvipostionRateTemp.value()
 Oviposition rate per day under perfect food with temps 0-50 degrees. More...
 
static vector< double > m_BackgroundMortTemp = {}
 Oviposition rate per day under perfect food with temps 0-50 degrees. More...
 
static int m_ShortRangeDistToday = 0
 Max distance moved in short range movements today (set by populaton manager each day) More...
 
static bool m_OvipostionPeriod = false
 Static variable to flag when its possible to lay eggs. More...
 
- Static Protected Attributes inherited from Ladybird_Base
static vector< int > m_LadybirdStagesNutritionalValue = {}
 Holds the aphid equivalents of each ladybird stage. More...
 
- Static Protected Attributes inherited from Beetle_Base
static vector< double > m_DevelopmentConstants = {}
 Day degree constant, the target to reach before next stage. More...
 
static std::unique_ptr< probability_distributionm_Move_distribution = nullptr
 Probabilty of adult movement by distance to be defined by the probability type and parameters. More...
 
static TTovList m_BeetleSuitableForHibernation = {tov_Undefined}
 the list of tovs that are suitable for hibernation More...
 
static TToleList m_BeetleReproductionLandscape = {tole_Foobar}
 the list of toles that the beetles are allowed to reproduce upon More...
 
static TToleList m_BeetleHalfReproductionLandscape = {tole_Foobar}
 the list of toles that the beetles are allowed to reproduce upon, but that yield half of normal fertility (bembidion) More...
 
static int m_DipsersalDayDegrees = 8
 
static int m_DDepRange = 3
 The depth of the surrounding cells for density dependence calculations in adults. More...
 
static int m_MaxShortRangeAttempts = 1
 The number of tries allowed to find a short range legal move. More...
 
static int m_TodaysTempCategory = 0
 Set the soiltemperature category used for calculatiung mortality steps. More...
 
- Static Protected Attributes inherited from TAnimal
static Landscapem_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...
 
- Static Protected Attributes inherited from Beetle_Adult
static double m_InFieldHibernateChance = 0.25
 The chance that a beetle might hibernate in non-grassy areas (open field) More...
 
static int m_AdultMaxMoveDist = -1
 holds the max move distance for dispersal More...
 
static double m_AdultMovementTempThreshold = 1
 holds the temperature threshold for movement More...
 
static double m_AdultTurnRate = 0.80
 
static int m_StartAggregatingDay = 270
 
static int m_StartAggregatingDayProb = 260
 
static int m_StopAggregationDay = 280
 
static double m_DailyAdultMort = 0.001
 Daily fixed mortality probability. More...
 
static int m_AdultDenDepMort0 = 0
 Storage for density-dependent mortality parameter. More...
 
static double m_AdultDenDepMort1 = 0.0
 Storage for density-dependent mortality parameter. More...
 
static int m_TodaysEggProduction = 0
 Daily temperature determined egg production. More...
 
static double m_AdultSoilCultivationMortality_ = 0.0
 The adult soil mortality parameter. More...
 
static double m_AdultHarvestMort = 0.0
 The adult harvest mortality parameter. More...
 
static double m_AdultStriglingMort_ = 0.0
 The adult strigling mortality parameter. More...
 
static double m_AdultInsecticideApplication_ = 0.0
 The Insecticide mortality parameter. More...
 
static double m_BeetleAdultPppElimRate = 0.0
 the daily elimination rate for pesticides More...
 
static double m_BeetleAdultPppThreshold = 0.0
 PPP effects threshold. More...
 
static double m_BeetleAdultPppEffectProb = 0.0
 Effect probability on threshold excedence. More...
 
static double m_BeetleAdultPppEffectProbDecay = 0.0
 Effect probability for delayed effects on threshold excedence. More...
 
static double m_AdultDispersalThreshold = 6.0
 Adult dispersal temp threshold for DD calcuation. More...
 
static int m_StartReproductionDay = 0
 
static double m_DailyStartReproductionChance = 0
 

Additional Inherited Members

- Static Public Attributes inherited from Beetle_Base
static vector< SimplePositionMapInt * > m_BeetleMaps = {}
 A list of pointers to the specific map for a beetle lifestage. More...
 
- Static Protected Member Functions inherited from Ladybird_Base
static int GetTempMortRange (double a_temp)
 returns the mortality range that corresponds to the temperature More...
 

Constructor & Destructor Documentation

◆ Ladybird_Adult()

Ladybird_Adult::Ladybird_Adult ( int  a_x,
int  a_y,
Landscape a_l_ptr,
Ladybird_Population_Manager a_lpm_ptr 
)

Ladybird adult constructor.

530  : Ladybird_Base(a_lpm_ptr), Beetle_Base( // NOLINT(clang-diagnostic-reorder-ctor)
531  a_x, a_y, a_l_ptr, static_cast<Beetle_Population_Manager*>(a_lpm_ptr)), Beetle_Adult(a_x, a_y, a_l_ptr, static_cast<Beetle_Population_Manager*>(a_lpm_ptr)) {
532  m_HasOverwintered = false; // probably not needed false is a default value
533  m_CanReproduce_bool = false;
537 }

References cfg_LadybirdMinimumOviMaturation, cfg_LadybirdStartEggsNo, lobs_Adult, Beetle_Adult::m_CanReproduce_bool, Beetle_Adult::m_EggCounter, m_HasOverwintered, Beetle_Base::m_Lifestage, m_OviMaturation, and CfgInt::value().

Member Function Documentation

◆ BeginStep()

void Ladybird_Adult::BeginStep ( void  )
overridevirtual

the standard begin step function as overridden by the ladybird adult

Reimplemented from Beetle_Adult.

565  {
566  m_AgeDays++;
568  double mortchance = 0; // only testing for extreme temperature mortality here
569  if (m_IsHibernating) {
571  }
572  else if (m_EmergenceDay>0)
573  {
574  int emergence_age = m_DayInYear - m_EmergenceDay;
575  //if (emergence_age > 59) emergence_age = 59;
576  //mortchance = m_BackgroundMortTemp[emergence_age];
578  }
580  if (g_rand_uni_fnc() < mortchance) m_CurrentBState = tobs_BDying;
581  // Reset any counters here
582  m_MoveCounter = 0;
583 }

References cfg_LadybirdBackgroundMortalityAfterHibernation, cfg_LadybirdExtremeTempMortChance, cfg_LadybirdMeanDaysAfterHibernation, cfg_LadybirdStdDaysAfterHibernation, Beetle_Base::CheckManagementBeetle(), g_rand_uni_fnc(), GetExtremeTempMin(), TAnimal::m_AgeDays, Beetle_Base::m_CurrentBState, TAnimal::m_DayInYear, m_EmergenceDay, m_IsHibernating, Ladybird_Base::m_MoveCounter, TAnimal::m_TemperatureToday, tobs_BDying, and CfgFloat::value().

◆ decDailyEggs()

void Ladybird_Adult::decDailyEggs ( int  num)
inlineprotected

decrements daily eggs to-lay

383 { m_DailyEggs-=num; }

References m_DailyEggs.

◆ decEggCounter()

void Ladybird_Adult::decEggCounter ( int  num)
inlineprotected

decrements the total to-lay counter by value

377 { m_EggCounter-=num;}

References Beetle_Adult::m_EggCounter.

◆ FindTarget()

bool Ladybird_Adult::FindTarget ( int  a_distance,
int  a_minimumflightlength,
int  a_target 
)
protected

The function to determine a landing location for long range movement for foraging or aggregating.

Parameters
a_distanceThe maximum distance to move
a_minimumflightlengthThe minimum distance to move
a_targetThe target aphids needed if any
Returns
true if a place if found, false if not

Starting at the minumum move this checks locations along a vector for being a target place to move (aphids above minimum) If OK the position is changed.

701  {
706  int x;
707  int y;
708  int direction = g_random_fnc(16);
709  int found = 0;
710  APoint locs;
711  double best = 0;
712  do {
713  // This will spiral out from the centre searching distance distances but in all directions
714  direction = direction + 1 & 15;
715  // If we go out of the Area we wrap the animal in
716  x = m_Location_x + a_minimumflightlength * g_vector16_x[direction];
717  y = m_Location_y + a_minimumflightlength * g_vector16_y[direction];
718  if (x > (m_SimulationWidth - 1)) x -= (m_SimulationWidth);
719  else if (x < 0) x += m_SimulationWidth;
720  if (y > (m_SimulationHeight - 1)) y -= (m_SimulationHeight);
721  else if (y < 0) y += (m_SimulationHeight);
722  double aph = m_OurPopulationLadybird->GetAphidDensity(x, y);
723  if (aph> a_target)
724  {
725  if (aph>best)
726  {
727  best = aph;
728  locs.m_x = x;
729  locs.m_y = y;
730  }
731  found++;
732  }
733  } while (a_minimumflightlength++ < a_distance && found < 50);
734  // alter the location
736  if (found == 0) {
737  m_Location_x = x;
738  m_Location_y = y;
741  return false; // We did not find any place
742  }
743  m_Location_x = locs.m_x;
744  m_Location_y = locs.m_y;
747  return true;
748 }

References Beetle_Base::DecDensity(), g_random_fnc(), Ladybird_Population_Manager::GetAphidDensity(), Beetle_Base::IncDensity(), TAnimal::m_guard_cell_x, TAnimal::m_guard_cell_y, TAnimal::m_Location_x, TAnimal::m_Location_y, Ladybird_Base::m_OurPopulationLadybird, TAnimal::m_SimulationHeight, TAnimal::m_SimulationWidth, APoint::m_x, APoint::m_y, and Population_Manager::UpdateGuardMap().

Referenced by St_Dispersal(), and St_Forage().

◆ getEggCounter()

int Ladybird_Adult::getEggCounter ( )
inlineprotected

returns thetotal egg counter (how many eggs left to lay)

379 { return m_EggCounter;}

References Beetle_Adult::m_EggCounter.

◆ GetExtremeTempMin()

double Ladybird_Adult::GetExtremeTempMin ( ) const
protected

returns the lower limit of bearable temperatures. below it the beetle will be subject to high mortality.

557  {
558  const int month = m_OurLandscape->SupplyMonth() - 1; // not forgetting -1 since this is calendar month and not a programmers months
559  if (m_IsHibernating) {
561  }
562  return cfg_Ladybird_SCP.value(month);
563 }

References cfg_Ladybird_SCP, cfg_LadybirdExtremeTempMinHibernatingFactor, m_IsHibernating, TAnimal::m_OurLandscape, Landscape::SupplyMonth(), CfgFloat::value(), and CfgArray_Double::value().

Referenced by BeginStep().

◆ IsAggregationSite()

bool Ladybird_Adult::IsAggregationSite ( const int  a_x,
const int  a_y,
const int  a_unused 
)
inlineprotected

Tests for toles that are aggregation types at x,y, location.

Parameters
a_xx-coordinate
a_yy-coordinate
a_unusedis to allow for compatability in a function pointer call
Returns
true if aggregation site, false if not
661  {
664  return true;
665 }

References Ladybird_Population_Manager::m_LadybirdAggregationToles, TAnimal::m_OurLandscape, Ladybird_Base::m_OurPopulationLadybird, and Landscape::SupplyElementType().

Referenced by St_Aggregate().

◆ IsForageSite()

bool Ladybird_Adult::IsForageSite ( const int  a_x,
const int  a_y,
const int  a_target 
)
inlineprotected

Tests for aphid densities at x,y.

Parameters
a_xx-coordinate
a_yy-coordinate
a_targetthe threshold accepted
Returns
true if aggregation site, false if not
667  {
668  if (m_OurPopulationLadybird->GetAphidDensity(a_x, a_y) < a_target) return false;
669  return true;
670 }

References Ladybird_Population_Manager::GetAphidDensity(), and Ladybird_Base::m_OurPopulationLadybird.

◆ IsProbhibited()

bool Ladybird_Adult::IsProbhibited ( int  a_x,
int  a_y 
) const
protected

Tests for toles that are not allowed for movement to at x,y, location.

Parameters
a_xx-coordinate
a_yy-coordinate
Returns
true if prohibited, false if not
655  {
658  return true;
659 }

References Ladybird_Population_Manager::m_LadybirdProhibitedTolesForMovement, TAnimal::m_OurLandscape, Ladybird_Base::m_OurPopulationLadybird, and Landscape::SupplyElementType().

◆ LongRangeFind()

bool Ladybird_Adult::LongRangeFind ( int  a_distance,
int  a_minimumflightlength,
int  a_target,
bool(Ladybird_Adult::*)(int, int, int)  a_func 
)
protected

The function to determine a landing location for long range movement for foraging or aggregating.

Parameters
a_distanceThe maximum distance to move
a_minimumflightlengthThe minimum distance to move
a_targetThe target aphids needed if any
Returns
true if a place if found, false if not

Starting at the minumum move this checks locations along a vector for being a target place to move (aphids above minimum) If OK the position is changed.

672  {
677  int x;
678  int y;
679  int direction = g_random_fnc(16);
680  do {
681  // This will spiral out from the centre searching distance distances but in all directions
682  direction = direction + 1 & 15;
683  // If we go out of the Area we wrap the animal in
684  x = m_Location_x + a_minimumflightlength * g_vector16_x[direction];
685  y = m_Location_y + a_minimumflightlength * g_vector16_y[direction];
686  if (x > (m_SimulationWidth - 1)) x -= (m_SimulationWidth);
687  else if (x < 0) x += m_SimulationWidth;
688  if (y > (m_SimulationHeight - 1)) y -= (m_SimulationHeight);
689  else if (y < 0) y += (m_SimulationHeight);
690  } while (a_minimumflightlength++ < a_distance && !(this->*a_func)(x, y, a_target));
691  // alter the location
693  m_Location_x = x;
694  m_Location_y = y;
697  if (a_minimumflightlength >= a_distance) return false; // We did not find any place
698  return true;
699 }

References Beetle_Base::DecDensity(), g_random_fnc(), Beetle_Base::IncDensity(), TAnimal::m_guard_cell_x, TAnimal::m_guard_cell_y, TAnimal::m_Location_x, TAnimal::m_Location_y, Ladybird_Base::m_OurPopulationLadybird, TAnimal::m_SimulationHeight, TAnimal::m_SimulationWidth, and Population_Manager::UpdateGuardMap().

Referenced by St_Aggregate().

◆ ReInit()

◆ SetAphidsPerPreyLevel()

static void Ladybird_Adult::SetAphidsPerPreyLevel ( const int  a_value)
inlinestatic

◆ SetBackgroundMortTemp()

static void Ladybird_Adult::SetBackgroundMortTemp ( const vector< double > &  a_vector)
inlinestatic

◆ setDailyEggs()

void Ladybird_Adult::setDailyEggs ( int  num)
inlineprotected

sets daily eggs to-lay

381 { m_DailyEggs=num; }

References m_DailyEggs.

◆ setEggCounter()

void Ladybird_Adult::setEggCounter ( int  num)
inlineprotected

sets the total to-lay egg counter to a value

375 { m_EggCounter=num; }

References Beetle_Adult::m_EggCounter.

◆ SetHibernationClumpeSizeDist()

static void Ladybird_Adult::SetHibernationClumpeSizeDist ( const vector< double > &  a_dist)
inlinestatic

◆ SetIsHibernating()

void Ladybird_Adult::SetIsHibernating ( const bool  a_val)
inline

sets the value of the state variable that flags whether the beetle is currently hibernating

308 { m_IsHibernating = a_val; }

References m_IsHibernating.

◆ SetOverwintered()

void Ladybird_Adult::SetOverwintered ( const bool  a_value)
inline

sets the value of the state variable that flags that the beetle has overwintered

306 { m_HasOverwintered = a_value; }

References m_HasOverwintered.

◆ SetOvipositionPeriod()

static void Ladybird_Adult::SetOvipositionPeriod ( const bool  a_cond)
inlinestatic

◆ SetOvipositionRateTemp()

static void Ladybird_Adult::SetOvipositionRateTemp ( const vector< double > &  a_dist)
inlinestatic

◆ SetShortRangeDistToday()

static void Ladybird_Adult::SetShortRangeDistToday ( const int  a_value)
inlinestatic

◆ ShouldStartAggregating()

bool Ladybird_Adult::ShouldStartAggregating ( )
inlineprotected

The method evaluates whether the beetle should start aggregation.

The function that checks whether the aggregation behaviour should be triggered

The main triggers for hibernation are photoperiod (explicit through the first and last aggregation day) and decrease in temperature and physiological ageing of the plants (implicitly through the aphid density). The ladybirds cannot stay active after the last day of aggregation.

Aggregation could be triggered in this period

639  {
645  const int daylength = m_OurLandscape->SupplyDaylength();
646  if ((m_DayInYear > July) && (daylength < cfg_LadybirdAggregationEnd.value())) return true;
647  if (daylength > cfg_LadybirdAggregationStart.value()) return false;
649  if (aphids_num > cfg_AphidsToStayAwake.value()) return false;
650  if (aphids_num < cfg_AphidsToHibernate.value()) return true;
651  if (g_rand_uni_fnc() < cfg_LadybirdHibernationChance.value()) return true;
652  return false;
653 }

References cfg_AphidsToHibernate, cfg_AphidsToStayAwake, cfg_LadybirdAggregationEnd, cfg_LadybirdAggregationStart, cfg_LadybirdHibernationChance, g_rand_uni_fnc(), Ladybird_Population_Manager::GetAphidDensity(), July, TAnimal::m_DayInYear, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, Ladybird_Base::m_OurPopulationLadybird, Landscape::SupplyDaylength(), CfgInt::value(), and CfgFloat::value().

Referenced by St_Aggregate(), and St_Forage().

◆ St_Aggregate()

TTypesOfBeetleState Ladybird_Adult::St_Aggregate ( )
overrideprotectedvirtual

Aggreagte function for the adult ladybird - moves them to hibernaculae.

Reimplemented from Beetle_Adult.

585  {
586  // Fly to find hibernacula
587  if (!(ShouldStartAggregating())) return tobs_BDying; //passed the aggregating pertiod but failed to find a place, need to die
589  return tobs_Aggregating;
590 }

References cfg_LadybirdMinimumFlightLength, IsAggregationSite(), LongRangeFind(), Beetle_Adult::m_AdultMaxMoveDist, ShouldStartAggregating(), tobs_Aggregating, tobs_BDying, tobs_Hibernating, and CfgInt::value().

◆ St_Dispersal()

TTypesOfBeetleState Ladybird_Adult::St_Dispersal ( )
overrideprotectedvirtual

the ladybird adult's override of a dispersal beahviour

This is the Dispersal function and uses long range movement to move the beetles away from the hibernation sites. There is a mimum move of 100m (assuming the minimum long-range move is 10m) It also applies a post emergence mortality due to parasitoids

Reimplemented from Beetle_Adult.

624 {
632  if (g_rand_uni_fnc() < range) return tobs_BDying;
633  m_IsHibernating = false;
634  FindTarget(2*m_AdultMaxMoveDist, 1000 + cfg_LadybirdMinimumFlightLength.value(), cfg_LadybirdAdultAphidPreyDensityOK.value()); // moves the ladybird at least 90m from where it starts
635  return tobs_Foraging;
636 }

References cfg_LadybirdAdultAphidPreyDensityOK, cfg_LadybirdMinimumFlightLength, cfg_LadybirdParasitoidMortalityChanceMax, cfg_LadybirdParasitoidMortalityChanceMin, FindTarget(), g_rand_uni_fnc(), Beetle_Adult::m_AdultMaxMoveDist, m_IsHibernating, tobs_BDying, tobs_Foraging, CfgInt::value(), and CfgFloat::value().

◆ St_Forage()

TTypesOfBeetleState Ladybird_Adult::St_Forage ( )
overrideprotectedvirtual

method that implements the foraging behaviour for adult beetles

Once there are enough aphids in the current location to satisfy their appetite, the adults only move randomly. Once there are not enough aphids at a location to satisfy the appetite of adult or larva then cannibalism can occur and the adults perform short range movement towards the direction of higher concentration of aphids. If there are not enough aphids for several moves in a row(more than short movement threshold, then long range flight is triggered. If out of last Y steps there were more than attempted long flights– the beetle die. After each ovipositing the short range movement is triggered so the adult won’t deplete the aphid resources of the young. If there are not enough aphids for several moves in a row (more than short movement threshold), then long range flight is triggered. If out of last X steps there were more than attempted long flights the beetle dies.

Reimplemented from Beetle_Adult.

751  {
752  // If oviposition period is over or laid all the eggs-> Die
753  if (m_CanReproduce_bool) {
754  if ((m_EggCounter <= 0)) {
755  //cout << "DEBUG: Layed all eggs-> dying" << endl;
756  return tobs_BDying; // StepDone is false
757  }
758  }
759  // If its too cold then do not do any movement today. Here we assume that the temperature threshold is the same for all types of activity
760  // eating/moving/mating
762  if (ShouldStartAggregating()) {
763  // it should start aggregating, if it has already overwintered and we are in a uniseasonal mode
764  // then it is time to die
765  if (m_HasOverwintered) return tobs_BDying;
766  return tobs_Aggregating; // start aggregating
767  }
768  }
779  int aphidsneeded;
780  int tries = 0;
781  m_EatenToday = 0;
782  do
783  {
785  if (aphidsneeded > 1) Beetle_1M_Move(m_ShortRangeDistToday);
786  } while ((aphidsneeded > 0) && (++tries < cfg_LadybirdShortMovementsMaxThreshold.value()));
787  if (aphidsneeded < 1) // Eaten our fill, perhaps breed
788  {
790  TryToReproduce();
791  //Beetle_1M_Move(m_ShortRangeDistToday);
792  }
793  //else
794  //{
795  //LongRangeFind(m_AdultMaxMoveDist, cfg_LadybirdMinimumFlightLength.value(), cfg_LadybirdAdultAphidPreyDensityOK.value(), &Ladybird_Adult::IsForageSite);
797  //}
798 
799  return tobs_Foraging;
800 }

References Beetle_Base::Beetle_1M_Move(), cfg_LadybirdAdultAphidPreyDensityOK, cfg_LadybirdMinimumFlightLength, cfg_LadybirdMovementTempThreshold, cfg_LadybirdShortMovementsMaxThreshold, Ladybird_Base::EatAphids(), FindTarget(), Ladybird_Base::GetAphidsToEat(), Beetle_Adult::m_AdultMaxMoveDist, Beetle_Adult::m_CanReproduce_bool, Ladybird_Base::m_EatenToday, Beetle_Adult::m_EggCounter, m_HasOverwintered, TAnimal::m_Location_x, TAnimal::m_Location_y, m_ShortRangeDistToday, TAnimal::m_TemperatureToday, m_UnsuccessfulAphidsAttempts, ShouldStartAggregating(), tobs_Aggregating, tobs_BDying, tobs_Foraging, TryToReproduce(), CfgInt::value(), and CfgFloat::value().

◆ St_Hibernate()

TTypesOfBeetleState Ladybird_Adult::St_Hibernate ( )
overrideprotectedvirtual

Hibernate function for the Adult.

Reimplemented from Beetle_Adult.

592  {
593  m_IsHibernating = true;
594  if (m_DayInYear == 0) {
595  m_HasOverwintered = true;
596  // All movement has stopped by this time, so determine densities and clump sizes
597  const int numberbeetlesnear = GetDensityRangeEdge(m_Location_x-50, m_Location_y-50, 100);
598  int index = 2; // There are three densities
599  if (numberbeetlesnear < 10) index = 0;
600  else if (numberbeetlesnear < 100) index = 1;
601  const double chance = g_rand_uni_fnc();
602  int c = 0;
603  while (chance >= m_HibernationClumpeSizeDist[index * 4 + c]) m_HibernationClumpSize = c++;
604  }
605  else {
608  // First take a mortality test for emergence mortality, dependent on the size of the hibernacula
609  if (m_HibernationClumpSize < 2) {
611  }
614  // this is needed to count the minimum timespan until oviposition
616  return tobs_Dispersing; // dispersing
617  }
618  }
619  }
620  return tobs_Hibernating;
621 }

References cfg_Ladybird_Emergance_Day_Length, cfg_Ladybird_Emergence_Chance, cfg_LadybirdEmergenceMortalityAlone, cfg_LadybirdEmergenceMortalityClump, g_rand_uni_fnc(), Beetle_Base::GetDensityRangeEdge(), TAnimal::m_DayInYear, m_EmergenceDay, m_HasOverwintered, m_HibernationClumpeSizeDist, m_HibernationClumpSize, m_IsHibernating, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, Landscape::SupplyDaylength(), tobs_BDying, tobs_Dispersing, tobs_Hibernating, CfgInt::value(), and CfgFloat::value().

◆ TryToReproduce()

void Ladybird_Adult::TryToReproduce ( )
overrideprotectedvirtual

Does reproduction if possible.

If we are in breeding condition and its the right season then if there enough aphids around, lay an egg and move on, at least if we tried this four days already

Reimplemented from Beetle_Adult.

802  {
807  if ( m_HasOverwintered && m_OvipostionPeriod) // no breeding unless overwintered
808  {
809  if (!m_CanReproduce_bool) {
810  if (m_OviMaturation-- > 0) return; // After this period we can reproduce
811  m_CanReproduce_bool = true;
812  }
813  //Adjust aphidsToLay value for off crop
814  double aphidsToLay = cfg_LadybirdAphidsToLay.value();
816  if (current_landtype == tole_Field) {
818  }
820  if (aphids > aphidsToLay){
821  // Decide the prey level
822  int prey_level = static_cast<int>(floor(((aphids - aphidsToLay) / m_AphidsPerPreyLevel) + 1.5));
823  if (prey_level > 5) prey_level = 5;
824  const int cl_size = static_cast<int>(m_OvipositionRateTemp[static_cast<int>(m_TemperatureToday)] * cfg_LadybirdClutchPreyScaler.value(prey_level));
825  m_EggCounter -= cl_size;
827  m_OurPopulationLadybird->CreateObjects(lobs_Egg, this, nullptr, &bst, cl_size);
829  }
830  }
831 }

References cfg_LadybirdAphidsToLay, cfg_LadybirdAphidsToLay_OffCropFactor, cfg_LadybirdClutchPreyScaler, Ladybird_Population_Manager::CreateObjects(), g_landscape_ptr, Ladybird_Population_Manager::GetAphidDensity(), lobs_Egg, m_AphidsPerPreyLevel, Beetle_Adult::m_CanReproduce_bool, Beetle_Base::m_CurrentBState, Beetle_Adult::m_EggCounter, m_HasOverwintered, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, Ladybird_Base::m_OurPopulationLadybird, m_OviMaturation, m_OvipositionRateTemp, m_OvipostionPeriod, TAnimal::m_TemperatureToday, Landscape::SupplyElementType(), tobs_BDying, tole_Field, CfgInt::value(), and CfgArray_Double::value().

Referenced by St_Forage().

◆ WinterMort()

bool Ladybird_Adult::WinterMort ( ) const
inlineoverrideprotectedvirtual

The method for calculating overwintering mortality.

Implements Beetle_Adult.

320 { return false; }

Member Data Documentation

◆ m_ADayDeg

double Ladybird_Adult::m_ADayDeg { 0 }
protected

day degrees sum for an individual

Referenced by ReInit().

◆ m_AphidsPerPreyLevel

int Ladybird_Adult::m_AphidsPerPreyLevel = 0
staticprotected

Speed storage for the prey level denominator.

Referenced by SetAphidsPerPreyLevel(), and TryToReproduce().

◆ m_BackgroundMortTemp

vector< double > Ladybird_Adult::m_BackgroundMortTemp = {}
staticprotected

Oviposition rate per day under perfect food with temps 0-50 degrees.

Referenced by SetBackgroundMortTemp().

◆ m_DailyEggs

int Ladybird_Adult::m_DailyEggs { 0 }
protected

The variables holding the amount of eggs to be laid today.

Referenced by decDailyEggs(), ReInit(), and setDailyEggs().

◆ m_EmergenceDay

int Ladybird_Adult::m_EmergenceDay { 0 }
protected

The day of the year when this particular individual emerged, to be used to track minimum delay time between the emergence and oviposition.

Referenced by BeginStep(), ReInit(), and St_Hibernate().

◆ m_HasOverwintered

bool Ladybird_Adult::m_HasOverwintered { false }
protected

State variable: true if overwintered.

Referenced by Ladybird_Adult(), ReInit(), SetOverwintered(), St_Forage(), St_Hibernate(), and TryToReproduce().

◆ m_HibernationClumpeSizeDist

vector< double > Ladybird_Adult::m_HibernationClumpeSizeDist = cfg_LadybirdHibernaculaeSizesDist.value()
staticprotected

Holds the clump size distribution with density table.

Referenced by SetHibernationClumpeSizeDist(), and St_Hibernate().

◆ m_HibernationClumpSize

int Ladybird_Adult::m_HibernationClumpSize { 0 }
protected

Records the size of the hibernation clump.

Referenced by St_Hibernate().

◆ m_IsHibernating

bool Ladybird_Adult::m_IsHibernating { false }
protected

State variable: true if hibernating.

Referenced by BeginStep(), GetExtremeTempMin(), SetIsHibernating(), St_Dispersal(), and St_Hibernate().

◆ m_OviMaturation

int Ladybird_Adult::m_OviMaturation {0}
protected

Counter for ovi maturation.

Referenced by Ladybird_Adult(), ReInit(), and TryToReproduce().

◆ m_OvipositionRateTemp

vector< double > Ladybird_Adult::m_OvipositionRateTemp = cfg_LadybirdDailyOvipostionRateTemp.value()
staticprotected

Oviposition rate per day under perfect food with temps 0-50 degrees.

Referenced by SetOvipositionRateTemp(), and TryToReproduce().

◆ m_OvipostionPeriod

bool Ladybird_Adult::m_OvipostionPeriod = false
staticprotected

Static variable to flag when its possible to lay eggs.

Referenced by SetOvipositionPeriod(), and TryToReproduce().

◆ m_ShortRangeDistToday

int Ladybird_Adult::m_ShortRangeDistToday = 0
staticprotected

Max distance moved in short range movements today (set by populaton manager each day)

Referenced by SetShortRangeDistToday(), and St_Forage().

◆ m_UnsuccessfulAphidsAttempts

int Ladybird_Adult::m_UnsuccessfulAphidsAttempts { 0 }
protected

The variable that holds the unsuccesful searches for aphids.

Referenced by ReInit(), and St_Forage().


The documentation for this class was generated from the following files:
Beetle_Base::GetDensityRangeEdge
int GetDensityRangeEdge(int a_x, int a_y, int a_range) const
The method to return the number of beetles in this specific location with a range.
Definition: Beetle_BaseClasses.cpp:396
Ladybird_Population_Manager::GetAphidDensity
double GetAphidDensity(int a_x, int a_y) override
Returns the number of aphids per square metre at this x,y location.
Definition: Ladybird_All.cpp:1323
tobs_Foraging
Definition: Beetle_BaseClasses.h:68
tobs_Aggregating
Definition: Beetle_BaseClasses.h:69
g_rand_uni_fnc
double g_rand_uni_fnc()
Definition: ALMaSS_Random.cpp:56
Ladybird_Base::GetAphidsToEat
int GetAphidsToEat()
return how many aphids are left to be eaten
Definition: Ladybird_All.h:107
Beetle_Base::IncDensity
void IncDensity(int a_x, int a_y, int a_lifestage)
The method inreases the number of beetles in this specific location by one. Used when called by a bee...
Definition: Beetle_BaseClasses.h:255
Ladybird_Adult::m_UnsuccessfulAphidsAttempts
int m_UnsuccessfulAphidsAttempts
The variable that holds the unsuccesful searches for aphids.
Definition: Ladybird_All.h:282
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
Ladybird_Adult::m_HibernationClumpeSizeDist
static vector< double > m_HibernationClumpeSizeDist
Holds the clump size distribution with density table.
Definition: Ladybird_All.h:290
Ladybird_Adult::m_OvipostionPeriod
static bool m_OvipostionPeriod
Static variable to flag when its possible to lay eggs.
Definition: Ladybird_All.h:332
cfg_LadybirdClutchPreyScaler
static CfgArray_Double cfg_LadybirdClutchPreyScaler("LADYBIRD_CLUTCHPREYSCALER", CFG_CUSTOM, 6, vector< double > {0, 0.51, 0.81, 0.93, 0.98, 1})
Scaling parameter for prey levels effect on clutch size.
cfg_LadybirdShortMovementsMaxThreshold
static CfgInt cfg_LadybirdShortMovementsMaxThreshold("LADYBIRD_SHORTMOVEMENTTHRESHOLD", CFG_CUSTOM, 12)
Max number of attempts to short range movement before initiating a long-range move.
TAnimal::m_guard_cell_y
int m_guard_cell_y
The index y to the guard cell.
Definition: PopulationManager.h:374
Ladybird_Adult::m_IsHibernating
bool m_IsHibernating
State variable: true if hibernating.
Definition: Ladybird_All.h:274
Ladybird_Population_Manager::CreateObjects
void CreateObjects(int a_ob_type, TAnimal *a_pvo, void *, Struct_Beetle *a_data, int a_number) override
Method to add beetles to the population - it must be overridden in all descendent classes.
Definition: Ladybird_All.cpp:1129
cfg_LadybirdMovementTempThreshold
static CfgFloat cfg_LadybirdMovementTempThreshold("LADYBIRD_MOVEMENTTEMPTHRESHOLD", CFG_CUSTOM, 4.0)
The temperature at which the movement is possible for adults.
Ladybird_Adult::m_ADayDeg
double m_ADayDeg
day degrees sum for an individual
Definition: Ladybird_All.h:280
July
const int July
Julian start dates of the month of July.
Definition: Landscape.h:50
Beetle_Adult::m_EggCounter
int m_EggCounter
The number of eggs produced.
Definition: Beetle_BaseClasses.h:876
Beetle_Base::CheckManagementBeetle
virtual bool CheckManagementBeetle()
Definition: Beetle_BaseClasses.h:198
Ladybird_Adult::m_AphidsPerPreyLevel
static int m_AphidsPerPreyLevel
Speed storage for the prey level denominator.
Definition: Ladybird_All.h:286
CfgFloat::value
double value() const
Definition: Configurator.h:142
cfg_LadybirdParasitoidMortalityChanceMax
static CfgFloat cfg_LadybirdParasitoidMortalityChanceMax("LADYBIRD_PARASITOIDMORTALITYCHANCEMAX", CFG_CUSTOM, 0.25)
Maxcimum probability of parasitoid death for ladybirds in the spring.
Ladybird_Base::m_EatenToday
int m_EatenToday
number of aphids or aphid equivalents eaten today
Definition: Ladybird_All.h:89
Ladybird_Adult::IsAggregationSite
bool IsAggregationSite(const int a_x, const int a_y, const int a_unused)
Tests for toles that are aggregation types at x,y, location.
Definition: Ladybird_All.cpp:661
Landscape::SupplyMonth
int SupplyMonth(void)
Passes a request on to the associated Calendar class function, returns m_month + 1 (the calendar mont...
Definition: Landscape.h:2272
Ladybird_Base::EatAphids
virtual int EatAphids(int a_x, int a_y, int a_appetite)
the method that is responsible for aphid foraging behaviour (removes the aphids from the aphid model)
Definition: Ladybird_All.cpp:240
Ladybird_Base::m_OurPopulationLadybird
Ladybird_Population_Manager * m_OurPopulationLadybird
pointer to the population manager
Definition: Ladybird_All.h:97
TAnimal::m_DayInYear
static int m_DayInYear
A holder for the day in year shared with all TAnimal objects.
Definition: PopulationManager.h:358
Ladybird_Adult::GetExtremeTempMin
double GetExtremeTempMin() const
returns the lower limit of bearable temperatures. below it the beetle will be subject to high mortali...
Definition: Ladybird_All.cpp:557
Ladybird_Adult::m_HibernationClumpSize
int m_HibernationClumpSize
Records the size of the hibernation clump.
Definition: Ladybird_All.h:288
cfg_LadybirdAggregationEnd
static CfgInt cfg_LadybirdAggregationEnd("LADYBIRD_AGGREGATION_END", CFG_CUSTOM, 685)
Assumed daylength trigger for aggregation end. 685 = Berlin 20/10.
cfg_LadybirdStartEggsNo
static CfgInt cfg_LadybirdStartEggsNo("LADYBIRS_START_EGGS_NOS", CFG_CUSTOM, 1042)
the number of eggs each one of the starting ladybirds has
Beetle_Base::m_Lifestage
unsigned m_Lifestage
This is a useful parameter holding the beetle type (this includes larval stages)
Definition: Beetle_BaseClasses.h:166
cfg_LadybirdParasitoidMortalityChanceMin
static CfgFloat cfg_LadybirdParasitoidMortalityChanceMin("LADYBIRD_PARASITOIDMORTALITYCHANCEMIN", CFG_CUSTOM, 0.05)
Minimim probability of parasitoid death for ladybirds in the spring.
Ladybird_Adult::m_EmergenceDay
int m_EmergenceDay
The day of the year when this particular individual emerged, to be used to track minimum delay time b...
Definition: Ladybird_All.h:272
g_landscape_ptr
Landscape * g_landscape_ptr
Definition: Landscape.cpp:352
Ladybird_Adult::m_ShortRangeDistToday
static int m_ShortRangeDistToday
Max distance moved in short range movements today (set by populaton manager each day)
Definition: Ladybird_All.h:296
TTypesOfLandscapeElement
TTypesOfLandscapeElement
Values that represent the types of landscape polygon that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:57
Ladybird_Adult::TryToReproduce
void TryToReproduce() override
Does reproduction if possible.
Definition: Ladybird_All.cpp:802
cfg_LadybirdHibernationChance
static CfgFloat cfg_LadybirdHibernationChance("LADYBIRD_HIBERNATIONCHANCE", CFG_CUSTOM, 0.1)
The daily chance to hibernate if aphids are not abundant between the aggregation start and end dates.
cfg_LadybirdExtremeTempMortChance
static CfgFloat cfg_LadybirdExtremeTempMortChance("LADYBIRD_EXTREME_TEMP_MORT_CHANCE", CFG_CUSTOM, 0.25)
cfg_LadybirdBackgroundMortalityAfterHibernation
static CfgFloat cfg_LadybirdBackgroundMortalityAfterHibernation("LADYBIRD_BACKGROUND_MORTALITY_AFTER_HIBERNATION", CFG_CUSTOM, 0.05)
The background mortality that a female has after hibernation.
Ladybird_Adult::m_OvipositionRateTemp
static vector< double > m_OvipositionRateTemp
Oviposition rate per day under perfect food with temps 0-50 degrees.
Definition: Ladybird_All.h:292
TAnimal::m_Location_y
int m_Location_y
The objects ALMaSS y coordinate.
Definition: PopulationManager.h:366
APoint
A simple class defining an x,y coordinate set.
Definition: ALMaSS_Setup.h:52
TAnimal::m_OurLandscape
static Landscape * m_OurLandscape
A pointer to the landscape object shared with all TAnimal objects.
Definition: PopulationManager.h:342
Ladybird_Base::m_AphidsAppetite
int m_AphidsAppetite
the today's appetite
Definition: Ladybird_All.h:93
TAnimal::m_SimulationWidth
static int m_SimulationWidth
A static member for the simulation width because it is often used by descendent classes.
Definition: PopulationManager.h:346
lobs_Egg
Definition: Ladybird_All.h:65
Beetle_Adult::m_AdultMaxMoveDist
static int m_AdultMaxMoveDist
holds the max move distance for dispersal
Definition: Beetle_BaseClasses.h:881
Ladybird_Adult::m_DailyEggs
int m_DailyEggs
The variables holding the amount of eggs to be laid today.
Definition: Ladybird_All.h:278
cfg_LadybirdStdDaysAfterHibernation
static CfgFloat cfg_LadybirdStdDaysAfterHibernation("LADYBIRD_STD_DAYS_AFTER_HIBERNATION", CFG_CUSTOM, 10.77)
The std number of days that a female can have after hibernation.
cfg_Ladybird_Emergence_Chance
static CfgFloat cfg_Ladybird_Emergence_Chance("LADYBIRD_EMERGANCE_CHANCE", CFG_CUSTOM, 0.1)
Beetle_Adult::m_CanReproduce_bool
bool m_CanReproduce_bool
Signal reproductive readiness.
Definition: Beetle_BaseClasses.h:969
TAnimal::m_AgeDays
int m_AgeDays
To hold the age in days.
Definition: PopulationManager.h:378
Beetle_Base::Beetle_1M_Move
void Beetle_1M_Move(int a_dist)
The function that calculates the cumulative probability for the movement direction....
Definition: Beetle_BaseClasses.cpp:326
APoint::m_x
int m_x
Definition: ALMaSS_Setup.h:55
Beetle_Adult::Beetle_Adult
Beetle_Adult(int a_x, int a_y, Landscape *a_l_ptr, Beetle_Population_Manager *a_bpm_ptr)
Definition: Beetle_BaseClasses.cpp:893
Ladybird_Population_Manager::m_LadybirdAggregationToles
TToleList m_LadybirdAggregationToles
the types of landscape that are aggregation targets
Definition: Ladybird_All.h:426
CfgInt::value
int value() const
Definition: Configurator.h:116
Beetle_Base::Beetle_Base
Beetle_Base(int a_x, int a_y, Landscape *a_l_ptr, Beetle_Population_Manager *a_bpm_ptr)
Beetle_Base Constructor.
Definition: Beetle_BaseClasses.cpp:291
CfgArray_Double::value
std::vector< double > value() const
Definition: Configurator.h:219
Beetle_Base::m_CurrentBState
TTypesOfBeetleState m_CurrentBState
Current behavioural state.
Definition: Beetle_BaseClasses.h:158
cfg_LadybirdMinimumFlightLength
static CfgInt cfg_LadybirdMinimumFlightLength("LADYBIRD_MINIMUMFLIGHTLENGTH", CFG_CUSTOM, 10)
Minimum distance for long-range flight in m.
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
Ladybird_Adult::m_BackgroundMortTemp
static vector< double > m_BackgroundMortTemp
Oviposition rate per day under perfect food with temps 0-50 degrees.
Definition: Ladybird_All.h:294
Struct_Beetle
A data class for Beetle data.
Definition: Beetle_BaseClasses.h:125
Ladybird_Adult::m_HasOverwintered
bool m_HasOverwintered
State variable: true if overwintered.
Definition: Ladybird_All.h:276
TAnimal::m_SimulationHeight
static int m_SimulationHeight
A static member for the simulation height because it is often used by descendent classes.
Definition: PopulationManager.h:350
cfg_LadybirdMeanDaysAfterHibernation
static CfgFloat cfg_LadybirdMeanDaysAfterHibernation("LADYBIRD_MEAN_DAYS_AFTER_HIBERNATION", CFG_CUSTOM, 147.75)
The mean number of days that a female can have after hibernation.
TAnimal::m_TemperatureToday
static double m_TemperatureToday
A holder for the temperature today shared with all TAnimal objects.
Definition: PopulationManager.h:354
Ladybird_Adult::FindTarget
bool FindTarget(int a_distance, int a_minimumflightlength, int a_target)
The function to determine a landing location for long range movement for foraging or aggregating.
Definition: Ladybird_All.cpp:701
TAnimal::m_guard_cell_x
int m_guard_cell_x
The index x to the guard cell.
Definition: PopulationManager.h:370
Ladybird_Population_Manager::m_LadybirdProhibitedTolesForMovement
TToleList m_LadybirdProhibitedTolesForMovement
the types of landscape that are prohibited for ladybirds
Definition: Ladybird_All.h:424
Ladybird_Base::Ladybird_Base
Ladybird_Base(Ladybird_Population_Manager *a_lpm_ptr)
Class constructor.
Definition: Ladybird_All.cpp:236
cfg_LadybirdEmergenceMortalityClump
static CfgFloat cfg_LadybirdEmergenceMortalityClump("LADYBIRD_EMERGENCEMORALTIYCLUMP", CFG_CUSTOM, 0.09)
Probability of death on emergence from hibernation if in a clump.
tole_Field
Definition: LandscapeFarmingEnums.h:65
Ladybird_Adult::LongRangeFind
bool LongRangeFind(int a_distance, int a_minimumflightlength, int a_target, bool(Ladybird_Adult::*a_func)(int, int, int))
The function to determine a landing location for long range movement for foraging or aggregating.
Definition: Ladybird_All.cpp:672
tobs_Dispersing
Definition: Beetle_BaseClasses.h:71
cfg_LadybirdAphidsToLay
static CfgInt cfg_LadybirdAphidsToLay("LADYBIRD_APHIDSTOLAY", CFG_CUSTOM, 100)
The density of aphids per m2 threshold for egg laying.
cfg_LadybirdAdultAphidPreyDensityOK
static CfgInt cfg_LadybirdAdultAphidPreyDensityOK("LADYBIRD_ADULT_APHID_PREY_DENSITY_OK", CFG_CUSTOM, 10)
The minumum number of aphids per m2 to settle.
cfg_LadybirdEmergenceMortalityAlone
static CfgFloat cfg_LadybirdEmergenceMortalityAlone("LADYBIRD_EMERGENCEMORALTIYALONE", CFG_CUSTOM, 0.14)
Probability of on emergence from hibernation if alone.
cfg_LadybirdAphidsToLay_OffCropFactor
static CfgInt cfg_LadybirdAphidsToLay_OffCropFactor("LADYBIRD_APHIDSTOLAY_OFFCROP_FACTOR", CFG_CUSTOM, 0.25)
Offcrop LADYBIRD_APHIDSTOLAY reduction factor.
cfg_LadybirdExtremeTempMinHibernatingFactor
static CfgFloat cfg_LadybirdExtremeTempMinHibernatingFactor("LADYBIRD_EXTREME_TEMP_MIN_HIB_FACTOR", CFG_CUSTOM, 0.2)
g_random_fnc
int g_random_fnc(const int a_range)
Definition: ALMaSS_Random.cpp:74
Beetle_Base::DecDensity
void DecDensity(int a_x, int a_y)
The method decreases the number of beetles in this specific location by one.
Definition: Beetle_BaseClasses.h:263
cfg_AphidsToStayAwake
static CfgInt cfg_AphidsToStayAwake("LADYBIRD_APHIDS_TO_STAY_AWAKE", CFG_CUSTOM, 1000)
Num of aphids needed to stay awake.
cfg_LadybirdAggregationStart
static CfgInt cfg_LadybirdAggregationStart("LADYBIRD_AGGREGATION_START", CFG_CUSTOM, 750)
Assumed daylength trigger for aggregation start. 750 = Berlin 20/09.
cfg_LadybirdMinimumOviMaturation
static CfgInt cfg_LadybirdMinimumOviMaturation("LADYBIRD_MINIMUMOVIMATURATION", CFG_CUSTOM, 4)
The lentgth of time before oviposition when finding the first good forage patch.
tobs_BDying
Definition: Beetle_BaseClasses.h:73
cfg_Ladybird_Emergance_Day_Length
static CfgInt cfg_Ladybird_Emergance_Day_Length("LADYBIRD_EMERGANCE_DAY_LENGTH", CFG_CUSTOM, 755)
cfg_AphidsToHibernate
static CfgInt cfg_AphidsToHibernate("LADYBIRD_APHIDS_TO_STAY_AWAKE", CFG_CUSTOM, 10)
Num of aphids that triggers hibernation.
lobs_Adult
Definition: Ladybird_All.h:71
Beetle_Adult::ReInit
void ReInit(int a_x, int a_y, Landscape *a_l_ptr, Beetle_Population_Manager *a_bpm_ptr) override
ReInit for object pool.
Definition: Beetle_BaseClasses.cpp:898
cfg_Ladybird_SCP
static CfgArray_Double cfg_Ladybird_SCP("LADYBIRD_SCP", CFG_CUSTOM, 12, { -15, -15, -10, -9, -5, -5, -5, -5, -5, -9, -12, -17 })
Minimum tolerated temperature at given month of the year.
Ladybird_Base::m_MoveCounter
int m_MoveCounter
the counter of the steps made today
Definition: Ladybird_All.h:95
TAnimal::m_Location_x
int m_Location_x
The objects ALMaSS x coordinate.
Definition: PopulationManager.h:362
Ladybird_Adult::m_OviMaturation
int m_OviMaturation
Counter for ovi maturation.
Definition: Ladybird_All.h:284
Landscape::SupplyDaylength
int SupplyDaylength(void)
Passes a request on to the associated Weather class function, the day length for the current day.
Definition: Landscape.h:2201
APoint::m_y
int m_y
Definition: ALMaSS_Setup.h:56
tobs_Hibernating
Definition: Beetle_BaseClasses.h:70
Ladybird_Adult::ShouldStartAggregating
bool ShouldStartAggregating()
The method evaluates whether the beetle should start aggregation.
Definition: Ladybird_All.cpp:639