![]() |
ALMaSS
1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
|
#include <Bembidion_All.h>
Public Member Functions | |
Bembidion_Adult (int a_x, int a_y, Landscape *a_l_ptr, Bembidion_Population_Manager *a_bpm_ptr) | |
constructor for Bembidion adult More... | |
![]() | |
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 | BeginStep () override |
Adult BeginStep. 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... | |
![]() | |
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... | |
![]() | |
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... | |
![]() | |
int | GetCurrentStateNo () const |
Returns the current state number. More... | |
void | SetCurrentStateNo (int a_num) |
Sets the current state number. More... | |
bool | GetStepDone () const |
Returns the step done indicator flag. More... | |
void | SetStepDone (bool a_bool) |
Sets the step done indicator flag. More... | |
void | ReinitialiseObjectBase () |
Used to initialise an object. More... | |
TALMaSSObject () | |
The constructor for TALMaSSObject. More... | |
virtual | ~TALMaSSObject ()=default |
The destructor for TALMaSSObject. More... | |
Protected Member Functions | |
bool | WinterMort () const override |
The method for calculating overwintering mortality. More... | |
TTypesOfBeetleState | CheckDormancy () override |
Override for standard beetle CheckDormancy due to death test. More... | |
TTypesOfBeetleState | St_Hibernate () override |
Override for state hibernate for Bembidion. More... | |
void | CheckReproduction () override |
Starts reproduction when ready. More... | |
![]() | |
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 TTypesOfBeetleState | St_Forage () |
Foraging behaviour. More... | |
virtual TTypesOfBeetleState | St_Aggregate () |
Aggregation behaviour. More... | |
virtual bool | CheckDormancyExit () |
Hibernation breaking check (override likely in descendent classes) More... | |
virtual TTypesOfBeetleState | St_Dispersal () |
Intiate Dispersal behaviour. 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 | TryToReproduce () |
Does reproduction if possible. 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... | |
![]() | |
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... | |
![]() | |
void | CorrectWrapRound () |
Corrects wrap around co-ordinate problems. More... | |
Additional Inherited Members | |
![]() | |
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) |
![]() | |
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 void | SetSimulationWidth (int a_value) |
Sets the simulation width. More... | |
static void | SetSimulationHeight (int a_value) |
Sets the simulation height. More... | |
static void | SetDayInYear (int a_value) |
Sets the day in year attribute. More... | |
static void | SetOurLandscape (Landscape *a_value) |
Sets the landscape pointer. More... | |
static void | SetTempToday (double a_value) |
Sets the temperature today attribute. More... | |
![]() | |
static void | OnArrayBoundsError () |
Used for debugging only, tests basic object properties. More... | |
![]() | |
static vector< SimplePositionMapInt * > | m_BeetleMaps = {} |
A list of pointers to the specific map for a beetle lifestage. More... | |
![]() | |
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< PointDirection > | m_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... | |
![]() | |
TTypesOfBeetleState | m_CurrentBState { tobs_Initiation } |
Current behavioural state. More... | |
Beetle_Population_Manager * | m_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... | |
![]() | |
int | m_Location_x |
The objects ALMaSS x coordinate. More... | |
int | m_Location_y |
The objects ALMaSS y coordinate. More... | |
int | m_guard_cell_x |
The index x to the guard cell. More... | |
int | m_guard_cell_y |
The index y to the guard cell. More... | |
int | m_AgeDays {0} |
To hold the age in days. More... | |
PesticideToxicity | m_my_pesticide |
![]() | |
int | m_CurrentStateNo |
The basic state number for all objects - '-1' indicates death. More... | |
bool | m_StepDone |
Indicates whether the iterative step code is done for this timestep. More... | |
![]() | |
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 |
![]() | |
static vector< double > | m_DevelopmentConstants = {} |
Day degree constant, the target to reach before next stage. More... | |
static std::unique_ptr< probability_distribution > | m_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 Landscape * | m_OurLandscape = nullptr |
A pointer to the landscape object shared with all TAnimal objects. More... | |
static int | m_SimulationWidth = 0 |
A static member for the simulation width because it is often used by descendent classes. More... | |
static int | m_SimulationHeight = 0 |
A static member for the simulation height because it is often used by descendent classes. More... | |
static double | m_TemperatureToday = 0.0 |
A holder for the temperature today shared with all TAnimal objects. More... | |
static int | m_DayInYear = 0 |
A holder for the day in year shared with all TAnimal objects. More... | |
Bembidion_Adult::Bembidion_Adult | ( | int | a_x, |
int | a_y, | ||
Landscape * | a_l_ptr, | ||
Bembidion_Population_Manager * | a_bpm_ptr | ||
) |
constructor for Bembidion adult
|
overrideprotectedvirtual |
Override for standard beetle CheckDormancy due to death test.
Reimplemented from Beetle_Adult.
References g_random_fnc(), Beetle_Adult::GetStartAggregationDayProb(), Beetle_Adult::m_CanReproduce_bool, Beetle_Base::m_CurrentBState, TAnimal::m_DayInYear, Beetle_Adult::m_EggCounter, Beetle_Adult::m_StartAggregatingDay, tobs_Aggregating, and tobs_BDying.
|
inlineoverrideprotectedvirtual |
Starts reproduction when ready.
Reimplemented from Beetle_Adult.
|
overrideprotectedvirtual |
Override for state hibernate for Bembidion.
Accumulates day degrees from the beginning of the year and starts dispersal when the sum exceeds a threshold or at the beginning of March.
At the end of hibernation the beetle is allowed to reproduce via the m_CanReproduce_bool attribute.
This is the function that describes possibilities of moving to other stage after the hibernation. Currently (as in Bembidion) the only possibilities are: 0 Hibernation 1 Dispersal 2 Death However generally it can include checks for different types of behaviour.
Reimplemented from Beetle_Adult.
References cfg_BeetleHibernationEndDay, cfg_BeetleTotalNoEggs, Beetle_Adult::CheckForDispersal(), Beetle_Adult::m_AdultDispersalThreshold, Beetle_Adult::m_CanReproduce_bool, Beetle_Base::m_CurrentBState, TAnimal::m_DayInYear, Beetle_Adult::m_EggCounter, Beetle_Adult::m_HibernateDegrees, Beetle_Adult::m_StartAggregatingDay, TAnimal::m_TemperatureToday, tobs_BDying, tobs_Dispersing, CfgInt::value(), and WinterMort().
|
overrideprotectedvirtual |
The method for calculating overwintering mortality.
Implements Beetle_Adult.
References g_random_fnc(), and Beetle_Adult::m_negDegrees.
Referenced by St_Hibernate().