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
Ladybird_Population_Manager Class Reference

#include <Ladybird_All.h>

Inheritance diagram for Ladybird_Population_Manager:
Beetle_Population_Manager Population_Manager Population_Manager_Base

Public Member Functions

 Ladybird_Population_Manager (Landscape *a_l_ptr, int a_numberLifeStages)
 Constructor for population manager class. More...
 
 ~Ladybird_Population_Manager () override
 Destructor: the same as in base class but needs to remove a different number of postion maps. More...
 
bool IsLocationAllowedLarvae (TTypesOfVegetation a_tov)
 Checks the tov list of disallowed tovs and returns false if a_tov is disallowed
More...
 
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. More...
 
bool OnFarmEvent (FarmToDo a_event, Beetle_Base *a_caller) override
 Used to determine mortality based on an event for any beetle class - pure vitual must be overriden. More...
 
bool GetFlyingWeather () const
 the function returns true if the weather is suitable for flying More...
 
bool GetLadybirdLarvaCanMove () const
 Gets the larval movement flag for today. More...
 
void SetAphidPopulationManager (Aphid_Population_Manager *a_aphid_population_manager_ptr)
 The function to set the aphid population manager pointer. More...
 
int GetAphidPopulationManagerSize () const
 The function to get a aphid population manager number. More...
 
Aphid_Population_ManagerGetAphidPopulationManager (const int a_index) const
 The function to get a aphid population manager pointer referenced by a_index. More...
 
double GetAphidDensity (int a_x, int a_y) override
 Returns the number of aphids per square metre at this x,y location. More...
 
void DecAphids (int a_x, int a_y, int a_num)
 the method decreases the number of aphids by "num" in the given location in all the underlying aphid models More...
 
void TheAOROutputProbe () override
 Special output functionality. More...
 
void AddCannibalismDeath (int a_ob_type, int a_x, int a_y)
 The method to add one death to t he given life stage at the given location because of cannibalism. More...
 
void DoSpecialBetweenLifeStages (int a_life_stage) override
 Cannibalism is handled here. More...
 
- Public Member Functions inherited from Beetle_Population_Manager
 Beetle_Population_Manager (Landscape *a_l_ptr, int a_n)
 Beetle_Population_Manager Constructor. More...
 
 ~Beetle_Population_Manager () override
 Beetle_Population_Manager Destructor. More...
 
void DoBefore () override
 Replaces the Step function for the Egg_List. More...
 
void DoLast () override
 Adds output adult locations to DoLast. More...
 
unsigned Probe (int a_ListIndex, Probe_Data *a_TheProbe_ptr) override
 Overides the Population_Manager::Probe method. More...
 
int SupplyEggPopSize () const
 Get egg population size. More...
 
int SupplyDailyEggPopSize (const int day) const
 Get the number of eggs created on a given day. More...
 
void SupplyEggLocXY (unsigned day, int j, int &x, int &y) const
 Get the location of an egg from a given day. More...
 
double SupplyDevelConst1 (unsigned a_index) const
 
virtual double SupplyDayDegs (const unsigned a_stage, const int a_day)
 Get the day degress experienced this year for a specific day created and instar/stage. More...
 
unsigned GetPopulationSize (int) override
 Returns the population size of the lifestage type bobType. More...
 
void OpenTheAOROutputProbe (const string &a_AORFilename) override
 Opens the AOR output file. More...
 
virtual bool OnFarmEventPupae (FarmToDo event, Beetle_Base *a_caller)
 Used to determine mortality based on an event for any beetle class - not a pure vitual but must be overriden if needed. More...
 
void DoBeetleActiveProbe (int a_lifestage)
 Counts all active beetles and saves the results to a file. More...
 
void SetStageProductionRecord (int a_value, int a_stage)
 Sets stage production record attribute. More...
 
int GetStageProductionRecord (int a_stage) const
 Gets the stage production record attribute. More...
 
void AddStageProductionRecord (int a_value, int a_stage)
 Adds to the stage production record attribute. More...
 
- Public Member Functions inherited from Population_Manager
 Population_Manager (Landscape *a_l_ptr, int a_numberLifeStages=12)
 
virtual ~Population_Manager (void)
 
void SetNoProbesAndSpeciesSpecificFunctions (int a_pn) override
 Sets up probe and species specifics. More...
 
unsigned GetLiveArraySize (int a_listindex) override
 Gets the number of 'live' objects for a list index in the TheArray. More...
 
void IncLiveArraySize (int a_listindex)
 Increments the number of 'live' objects for a list index in the TheArray. More...
 
unsigned int FarmAnimalCensus (unsigned int a_farm, unsigned int a_typeofanimal)
 
char * SpeciesSpecificReporting (int a_species, int a_time) override
 
char * ProbeReport (int a_time)
 
char * ProbeReportTimed (int a_time)
 
void ImpactProbeReport (int a_Time)
 
bool BeginningOfMonth ()
 
void LOG (const char *fname)
 
int SupplyStepSize () const
 
void Run (int NoTSteps) override
 
virtual void ImpactedProbe ()
 
virtual TAnimalSupplyAnimalPtr (unsigned int a_index, unsigned int a_animal)
 Returns the pointer indexed by a_index and a_animal. Note NO RANGE CHECK. More...
 
virtual unsigned SupplyListIndexSize ()
 
unsigned SupplyListSize (unsigned listindex) const
 
void PushIndividual (const unsigned a_listindex, TAnimal *a_individual_ptr)
 
const char * SupplyStateNames (int i) const
 
unsigned SupplyStateNamesLength () const
 
virtual void DisplayLocations ()
 
TAnimalFindIndividual (unsigned Type, TAnimal *a_me)
 
virtual TAnimalFindClosest (int x, int y, unsigned Type, TAnimal *a_me)
 
omp_nest_lock_t * GetGuardMapElement (unsigned a_x_index, unsigned a_y_index)
 Return the guard map cell. More...
 
void SetGuardMapElement (unsigned a_x_index, unsigned a_y_index)
 Set the given guard map cell. More...
 
void UnsetGuardMapElement (unsigned a_x_index, unsigned a_y_index)
 Unset the given guard map cell. More...
 
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. More...
 
bool OpenTheRipleysOutputProbe ()
 
bool OpenTheMonthlyRipleysOutputProbe ()
 
bool OpenTheReallyBigProbe ()
 
void CloseTheMonthlyRipleysOutputProbe () const
 
virtual void CloseTheRipleysOutputProbe ()
 
virtual void CloseTheReallyBigOutputProbe ()
 
TTypesOfPopulation GetPopulationType ()
 
int GetSeasonNumber ()
 Get the season number. More...
 
void LamdaDeath (int x, int y)
 
void LamdaBirth (int x, int y)
 
void LamdaBirth (int x, int y, int z)
 
void LamdaClear ()
 
void LamdaDumpOutput ()
 
virtual int SupplyPegPosx (int)
 
virtual int SupplyPegPosy (int)
 
virtual int SupplyCovPosx (int)
 
virtual int SupplyCovPosy (int)
 
virtual bool OpenTheFledgelingProbe ()
 
virtual bool OpenTheBreedingPairsProbe ()
 
virtual bool OpenTheBreedingSuccessProbe ()
 
virtual void BreedingPairsOutput (int)
 
virtual int TheBreedingFemalesProbe (int)
 
virtual int TheFledgelingProbe ()
 
virtual void BreedingSuccessProbeOutput (double, int, int, int, int, int, int, int)
 
virtual int TheBreedingSuccessProbe (int &, int &, int &, int &, int &, int &)
 
virtual void FledgelingProbeOutput (int, int)
 
virtual void TheGeneticProbe (unsigned, int, unsigned &)
 
virtual void GeneticsResultsOutput (FILE *, unsigned)
 
void Debug_Shuffle (unsigned int Type)
 
virtual void RunStepMethods ()
 
- Public Member Functions inherited from Population_Manager_Base
 Population_Manager_Base (Landscape *L)
 The Population_Manager_Base constructor. More...
 
virtual void Catastrophe (int)
 Must be re-implemented in descendent classes. More...
 
int SupplySimW () const
 Returns landscape width in m. More...
 
int SupplySimH () const
 Returns landscape height in m. More...
 
int SupplySimWH () const
 Returns half the landscape width in m. More...
 
int SupplySimHH () const
 Returns half the landscape height in m. More...
 
virtual int ProbeFileInput (char *p_Filename, int p_ProbeNo)
 A stub to build specfic probes and functions. More...
 
int SupplyListNameLength () const
 
const char * SupplyListName (int a_i) const
 Get a list name from the list. More...
 
virtual void SupplyLocXY (unsigned, unsigned, int &, int &)
 A stub for identifying an individual at a location. More...
 
virtual TAnimalFindClosest (int, int, unsigned)
 A stub for identifying an individual at a location. More...
 
std::string SupplySimulationName ()
 
void SetStepCounterInADay (int a_counter)
 Set step counter in a day. More...
 
int GetStepCounterInADay (void)
 Return the sep counter in a day. More...
 

Static Public Member Functions

static double getLongRangeDuration ()
 long flight duration: used in distance calculation More...
 

Public Attributes

std::vector< Aphid_Population_Manager * > m_AphidPopulationManagerPtrList
 The pointer to aphid population manager. More...
 
TTovList m_LadybirdProhibitedTovsForMovement
 the types of vegetation that are prohibited for ladybirds More...
 
TToleList m_LadybirdProhibitedTolesForMovement
 the types of landscape that are prohibited for ladybirds More...
 
TToleList m_LadybirdAggregationToles
 the types of landscape that are aggregation targets More...
 
TToleList LadybirdProhibitedTolesForMovementLarva
 the types of vegetation that are prohibited for ladybirds larva More...
 
TTovList LadybirdLongRangeTovs
 the types of vegetation that are targets of long range movement More...
 
TToleList LadybirdLongRangeToles
 the types of landscape that are targets of long range movement More...
 
TTovList LadybirdAggregationTovs
 the types of vegetation that are aggregation targets More...
 
- Public Attributes inherited from Beetle_Population_Manager
long m_EPopSize {0}
 To store the current population size. More...
 
std::unique_ptr< MovementMapm_MoveMap
 Map of suitability for movement. More...
 
std::unique_ptr< std::vector< std::unique_ptr< Beetle_Egg_List > > > m_EList {nullptr}
 Replacement for TheArray[0]. More...
 
- Public Attributes inherited from Population_Manager
bool ProbesSet {}
 
- Public Attributes inherited from Population_Manager_Base
Probe_DataTheProbe [100] = {nullptr}
 Holds a list of pointers to standard output probes. More...
 

Protected Member Functions

void DoExtremeTempActions (double a_atemptoday) override
 Species specific actions to cope with response to extreme temperature, if needed. More...
 
void DoEggDailyMortalityActions (double a_atemptoday) override
 Species specific actions to cope with temperature related egg mortality. More...
 
void DoLarvalDailyMortalityActions (double a_atemptoday) override
 Species specific actions to cope with temperature related laval mortality. More...
 
int GetTempMortRange (double a_temp) const
 Gets the temperature category for mortality calculations. More...
 
void DayDegreeCalculations (int a_dayinyear, bool a_usehourly) override
 Does day degree development calculations here. More...
 
void CalculateDailyEggProduction (double a_temptoday) override
 Figure out the maximum number of eggs that can be laid today - must be overridden in descendent classes. More...
 
void DoFirst () override
 Does day degree development calculations here. More...
 
- Protected Member Functions inherited from Beetle_Population_Manager
void Catastrophe () override
 Method to arbitrarily alter populations size. More...
 
void Catastrophe2 ()
 Method to arbitrarily alter populations size restricted spatially. More...
 
void TheRipleysOutputProbe (ofstream *a_prb) override
 Special output functionality. More...
 
void TheReallyBigOutputProbe () override
 Special output functionality. More...
 
bool IsStartHabitat (int a_x, int a_y) const
 Used to specify legal starting habitats for simulation start-up. More...
 
bool IsStartHabitatAux (TTypesOfLandscapeElement tole) const
 Used to specify legal starting habitats for simulation start-up. More...
 
void SetAdultEggLayingThreshold (const double a_value)
 Set the temperature threshold for egg laying. More...
 
void incInField ()
 Increments in field counter. More...
 
void incInCrop ()
 Increments in crop counter. More...
 
void incOffField ()
 Increments off field counter. More...
 
void PestMortLocOutput ()
 Annual pesticide mortality locations output. More...
 
- Protected Member Functions inherited from Population_Manager
virtual bool StepFinished ()
 Methods to run the simulations. More...
 
virtual void DoAfter ()
 
virtual void SortX (unsigned Type)
 
void SortXIndex (unsigned Type)
 
virtual void SortY (unsigned Type)
 
void SortState (unsigned Type)
 
void SortStateR (unsigned Type)
 
virtual unsigned PartitionLiveDead (unsigned Type)
 
virtual void Shuffle_or_Sort (unsigned Type)
 
virtual void Shuffle (unsigned Type)
 
- Protected Member Functions inherited from Population_Manager_Base
 ~Population_Manager_Base ()=default
 

Protected Attributes

vector< double > m_EggTemperatureMortality { }
 Storage for the temperature related mortality for eggs. More...
 
int m_MortalityTempIndexToday { 0 }
 Storage for the index to the mortality vector for todays temperature (speed optimisation) More...
 
LadybirdToleTovs m_LadybirdToleTovs
 Class holding all the tole tov related information - for tidyness. More...
 
vector< Eigen::MatrixXi > m_cannibalism_dead_num_map
 Holds the daily dead number caused by cannibalism. More...
 
vector< int > m_cannibalism_dead_total_num
 Holds the daily total dead number for each life stage caused by cannibalism. More...
 
TTovList m_LadybirdProhibitedTovsForMovementLarva
 Uses the open cannibalisations events list to remove beetles. More...
 
double TodaysEggProductionTempFactor {0.0}
 the dependence between temperature and the clutch size: updated daily More...
 
double m_LadybirdLarvaMovementThreshold { 10.0 }
 minimum temperature that larva can move at More...
 
bool m_LadybirdLarvaCanMove_bool {true}
 minimum temperature that larva can move at More...
 
- Protected Attributes inherited from Beetle_Population_Manager
double m_MortalityTempStep {5.0}
 Threshold temperatures for mortalities: Step size. More...
 
double m_MortalityTempMin {0.0}
 hreshold temperatures for mortalities: Min More...
 
double m_MortalityTempMax {25.0}
 Threshold temperatures for mortalities: Max. More...
 
int m_TemperatureCategory { 0 }
 Storage for the temperature category today. More...
 
int m_NoTemperatureCategories { 0 }
 Storage for the number of temperature categories used. More...
 
vector< std::array< double, 365 > > m_DayDegs {}
 Storage for daily day degrees for non-adult stages. More...
 
TToleList m_BeetleStartHabitats
 the list of the toles that the beetles are assigned to in the beginning of the simulation More...
 
tBeetleToleTovs m_BeetleToleTovs
 The list of start habitats for the beetle. More...
 
int m_BeetleLarvalStagesNum { 3 }
 
vector< int > m_StageProductionProduction { 0 }
 Testing/Output attribute holding the number of larvae produced today. More...
 
double m_AdultEggLayingThreshold {}
 Temperature threshold for egg laying. More...
 
double m_EggProductionSlope {}
 the slope of the linear function that defines todays egg production More...
 
vector< double > m_DevelConst1 {}
 Day degree threshold constant for eggs to pupae. More...
 
vector< double > m_DevelopmentInflectionPoints {}
 Inflection point in day degree calculations for non-adult stages. More...
 
vector< double > m_AboveInflectionRates {}
 Day degree constant above inflection point for all non-adult stages. More...
 
vector< SimplePositionMapInt * > m_BeetlePositionMaps [bob_foobar] {}
 
int m_InFieldNo {}
 In-field counter. More...
 
int m_InCropNo {}
 In-crop counter. More...
 
int m_OffFieldNo {}
 Off-field counter. More...
 
TTypesOfVegetation m_InCropRef {}
 In crop tole reference. More...
 
- Protected Attributes inherited from Population_Manager
vector< unsigned > m_LiveArraySize
 
int m_NoProbes = 0
 
std::vector< std::vector< omp_nest_lock_t * > > m_MapGuard
 This is used to make sure animals will not behaviour at the same area - multi threads. More...
 
int m_guard_cell_height_num
 
int m_guard_cell_width_num
 
int m_guard_cell_size
 
bool m_is_paralleled
 This is used to indicate whether the species is paralleled. More...
 
const char * StateNames [100] {}
 
int m_StepSize {}
 
vector< vector< forward_list< TAnimal * > * > > TheSubArrays
 Hold all the animal pointers. More...
 
vector< vector< int > > TheSubArraysSizes
 Hold all the animal sizes in each thread. More...
 
vector< int > m_LifeStageOrderVec
 The vector to store the life stage order for looping specie life stages. More...
 
vector< forward_list< TAnimal * >::iterator > TheSubArraysIterators
 the iterator from last time called for SupplyAnimalPtr(), this for fast loop all the animals in the derived class. More...
 
vector< int > TheSubArrayPreviousIndex
 the animal index number from last time called for SupplyAnimalPtr(), this for fast loop all the animals in the derived class. More...
 
vector< int > TheSubArrayThreadIndex
 the thread index number from last time called for SupplyAnimalPtr(), this for fast loop all the animals in the derived class. More...
 
unsigned StateNamesLength
 
FILE * TestFile {}
 
FILE * TestFile2 {}
 
vector< unsigned > BeforeStepActions
 Holds the season list of possible before step actions. More...
 
int m_SeasonNumber
 Holds the season number. Used when running goose and hunter sims. More...
 
TTypesOfPopulation m_population_type {TOP_NoSpecies}
 
ofstream * AOROutputPrb {}
 
ofstream * RipleysOutputPrb {}
 
ofstream * RipleysOutputPrb1 {}
 
ofstream * RipleysOutputPrb2 {}
 
ofstream * RipleysOutputPrb3 {}
 
ofstream * RipleysOutputPrb4 {}
 
ofstream * RipleysOutputPrb5 {}
 
ofstream * RipleysOutputPrb6 {}
 
ofstream * RipleysOutputPrb7 {}
 
ofstream * RipleysOutputPrb8 {}
 
ofstream * RipleysOutputPrb9 {}
 
ofstream * RipleysOutputPrb10 {}
 
ofstream * RipleysOutputPrb11 {}
 
ofstream * RipleysOutputPrb12 {}
 
ofstream * ReallyBigOutputPrb {}
 
AOR_Probem_AOR_Probe {}
 A pointer to the AOR probe. More...
 
long int lamdagrid [2][257][257] {}
 
- Protected Attributes inherited from Population_Manager_Base
int SimH
 stores the simulation height More...
 
int SimW
 stores the simulation width More...
 
int SimHH
 stores the simulation height halved More...
 
int SimWH
 stores the simulation width halved More...
 
string m_SimulationName
 stores the simulation name More...
 
Landscapem_TheLandscape
 holds an internal pointer to the landscape More...
 
int m_ListNameLength {}
 the number of life-stages simulated in the population manager More...
 
const char * m_ListNames [32] {}
 A list of life-stage names. More...
 
std::string m_AORProbeFileName {"AOR_Probe.txt"}
 name of the AOR Probe file More...
 
std::string m_ProbeFileName {"Probe.res"}
 name of the Probe file More...
 
int m_step_counter_in_a_day
 Step counter in a day, this is used for the animals with finer step size other than one day. More...
 

Additional Inherited Members

- Static Protected Member Functions inherited from Beetle_Population_Manager
static void PestMortLocOutputOpen ()
 Annual pesticide mortality output file open. More...
 
static void PestMortLocOutputError ()
 Pesticide mortality output error handling. More...
 

Constructor & Destructor Documentation

◆ Ladybird_Population_Manager()

Ladybird_Population_Manager::Ladybird_Population_Manager ( Landscape a_l_ptr,
int  a_numberLifeStages 
)
explicit

Constructor for population manager class.

Ladybird had temperature related egg mortality in 5 degree steps, so load this from the config

Must create and extra position map because we have an extra larval stage

838  : Beetle_Population_Manager(a_l_ptr, a_numberLifeStages)
839 {
840  m_SimulationName = "Ladybird";
842  m_BeetleLarvalStagesNum = 4; // default is 3
843  m_DayDegs.resize(m_BeetleLarvalStagesNum + 2); // Resets the values to zero (+2 = eggs & pupae)
845  // Change default mortality range maximum because we have more values at higher temperature for ladybird
846  m_MortalityTempMax = 45;
847  // Load List of Animal Classes
848  m_ListNames[4] = "Larva4";
849  m_ListNames[5] = "Pupa";
850  m_ListNames[6] = "Adult";
869  // Create starting adults
870  int temp_thread_num = omp_get_max_threads();
871  int start_num_in_thread = (cfg_ladybirdStartNos.value() / temp_thread_num +1);
872  #pragma omp parallel
873  {
874  for (int i = 0; i < start_num_in_thread; i++)
875  {
876  Struct_Beetle aps(-1, -1, m_TheLandscape, this);
877  do {
880  } while (!IsStartHabitat(aps.m_x, aps.m_y));
881  Ladybird_Population_Manager::CreateObjects(lobs_Adult, nullptr, nullptr, &aps, 1); // Qualification due to function call in constructor
882  }
883  }
884  //PartitionLiveDead(lobs_Adult);
885  // To start all the beetles in the right state we loop through those created and force them to dormancy behaviour
886  for (int t=0; t<temp_thread_num; t++) {
887  for (auto it = TheSubArrays[lobs_Adult][t]->begin(); it != TheSubArrays[lobs_Adult][t]->end(); ++it) {
888  if((*it)->GetCurrentStateNo() >= 0){
889  dynamic_cast<Ladybird_Adult*>(*it)->SetState(tobs_Hibernating);
890  (*it)->SetAge(151); // Make sure starting adults are not seen as young ones
891  }
892  dynamic_cast<Ladybird_Adult*>(*it)->SetState(tobs_Hibernating);
893  }
894  }
895 #ifdef __LADYBIRDPESTICIDE1
897  m_InFieldNo = 0;
898  m_OffFieldNo = 0;
899  m_InCropNo = 0;
900 #endif
902 
903  //initialise the map for caniblism death
904  m_cannibalism_dead_num_map.resize(lobs_Foobar-1); //canniablism is not applied adults
906  for (int i = 0; i < lobs_Foobar-1; i++) {
908  m_cannibalism_dead_num_map[i].setZero();
910  }
911 
912  //set the life stage running order
913  for(int i=0; i<a_numberLifeStages; i++){
914  m_LifeStageOrderVec[i] = a_numberLifeStages-1-i;
915  }
916 
917 }

References cfg_BeetleLarvalStagesNum, cfg_Ladybird_DevelopmentInflectionPoints, cfg_LadybirdAphidsToLay, cfg_LadybirdAphidsToLayScaler, cfg_LadybirdDailyOvipostionRateTemp, cfg_LadybirdEggTemperatureMortality, cfg_LadybirdHibernaculaeSizesDist, cfg_LadybirdLarvaAppetite, cfg_LadybirdLarvalMortCategories, cfg_LadybirdLarvalPreyDevelParameters, cfg_LadybirdLarvalTemperatureMortality, cfg_LadybirdLarvaMovementThreshold, cfg_LadybirdMaximumFlightLength, cfg_LadybirdStagesNutritionalValue, cfg_ladybirdStartNos, cfg_MaxShortRangeAttempts, CreateObjects(), g_random_fnc(), LadybirdTovParams::getList(), LadybirdToleParams::getList(), Beetle_Population_Manager::IsStartHabitat(), LadybirdToleTovs::LadybirdAggregationToles, LadybirdToleTovs::LadybirdProhibitedToles, LadybirdToleTovs::LadybirdProhibitedTovsForMovementLarva, lobs_Adult, lobs_Foobar, Beetle_Population_Manager::m_BeetleLarvalStagesNum, Beetle_Population_Manager::m_BeetlePositionMaps, m_cannibalism_dead_num_map, m_cannibalism_dead_total_num, Beetle_Population_Manager::m_DayDegs, Beetle_Population_Manager::m_DevelopmentInflectionPoints, m_EggTemperatureMortality, Beetle_Population_Manager::m_InCropNo, Beetle_Population_Manager::m_InFieldNo, m_LadybirdAggregationToles, m_LadybirdLarvaMovementThreshold, m_LadybirdProhibitedTolesForMovement, m_LadybirdProhibitedTovsForMovementLarva, m_LadybirdToleTovs, Population_Manager::m_LifeStageOrderVec, Population_Manager_Base::m_ListNameLength, Population_Manager_Base::m_ListNames, Beetle_Population_Manager::m_MortalityTempMax, Beetle_Population_Manager::m_OffFieldNo, Population_Manager::m_population_type, Population_Manager_Base::m_SimulationName, Beetle_Population_Manager::m_StageProductionProduction, Population_Manager_Base::m_TheLandscape, Struct_Beetle::m_x, Struct_Beetle::m_y, Beetle_Population_Manager::PestMortLocOutputOpen(), Beetle_Adult::SetAdultMaxMoveDist(), Ladybird_Adult::SetAphidsPerPreyLevel(), Beetle_Base::SetBeetleMap(), Ladybird_Adult::SetHibernationClumpeSizeDist(), Ladybird_Larvae1::SetLadybirdLarvalPreyDevelParameters(), Ladybird_Base::SetLadybirdStagesNutritionalValue(), Ladybird_Larvae1::SetLarvalAppetite(), Beetle_Larvae::SetLarvalDailyMort(), Beetle_Base::SetMaxShortRangeAttempts(), Ladybird_Adult::SetOvipositionRateTemp(), Landscape::SupplySimAreaHeight(), Landscape::SupplySimAreaWidth(), Population_Manager::TheSubArrays, tobs_Hibernating, TOP_Ladybird, CfgInt::value(), CfgFloat::value(), CfgArray_Int::value(), and CfgArray_Double::value().

◆ ~Ladybird_Population_Manager()

Ladybird_Population_Manager::~Ladybird_Population_Manager ( )
overridedefault

Destructor: the same as in base class but needs to remove a different number of postion maps.

Member Function Documentation

◆ AddCannibalismDeath()

void Ladybird_Population_Manager::AddCannibalismDeath ( int  a_ob_type,
int  a_x,
int  a_y 
)
inline

The method to add one death to t he given life stage at the given location because of cannibalism.

476 {m_cannibalism_dead_num_map[a_ob_type](a_y, a_x)+=1; m_cannibalism_dead_total_num[a_ob_type]+=1;}

References m_cannibalism_dead_num_map, and m_cannibalism_dead_total_num.

Referenced by Ladybird_Base::Cannibalise().

◆ CalculateDailyEggProduction()

void Ladybird_Population_Manager::CalculateDailyEggProduction ( double  a_temptoday)
inlineoverrideprotectedvirtual

Figure out the maximum number of eggs that can be laid today - must be overridden in descendent classes.

Implements Beetle_Population_Manager.

417 {}

Referenced by DayDegreeCalculations().

◆ CreateObjects()

void Ladybird_Population_Manager::CreateObjects ( int  ,
TAnimal ,
void *  ,
Struct_Beetle ,
int   
)
overridevirtual

Method to add beetles to the population - it must be overridden in all descendent classes.

Reimplemented from Beetle_Population_Manager.

1130 {
1131  for (int i = 0; i < a_number; i++)
1132  {
1133  if (a_ob_type == lobs_Egg) { (*m_EList)[a_data->m_l->SupplyDayInYear()]->AddEgg(a_data->m_x, a_data->m_y); }
1134  if (a_ob_type == lobs_Larva1)
1135  {
1136  auto* new_Larva(new Ladybird_Larvae1(a_data->m_x, a_data->m_y, a_data->m_l, this));
1137  PushIndividual(a_ob_type, new_Larva);
1138  IncLiveArraySize(a_ob_type);
1139  }
1140  if (a_ob_type == lobs_Larva2)
1141  {
1142  auto* new_Larva(new Ladybird_Larvae2(a_data->m_x, a_data->m_y, a_data->m_l, this));
1143  PushIndividual(a_ob_type, new_Larva);
1144  IncLiveArraySize(a_ob_type);
1145  }
1146  if (a_ob_type == lobs_Larva3)
1147  {
1148  auto* new_Larva(new Ladybird_Larvae3(a_data->m_x, a_data->m_y, a_data->m_l, this));
1149  PushIndividual(a_ob_type, new_Larva);
1150  IncLiveArraySize(a_ob_type);
1151  }
1152  if (a_ob_type == lobs_Larva4)
1153  {
1154  auto* new_Larva(new Ladybird_Larvae4(a_data->m_x, a_data->m_y, a_data->m_l, this));
1155  PushIndividual(a_ob_type, new_Larva);
1156  IncLiveArraySize(a_ob_type);
1157 
1158  }
1159  if (a_ob_type == lobs_Pupa)
1160  {
1161  auto* new_Pupa(new Ladybird_Pupae(a_data->m_x, a_data->m_y, a_data->m_l, this));
1162  PushIndividual(a_ob_type, new_Pupa);
1163  IncLiveArraySize(a_ob_type);
1164  }
1165  if (a_ob_type == lobs_Adult)
1166  {
1167  auto* new_Adult(new Ladybird_Adult(a_data->m_x, a_data->m_y, a_data->m_l, this));
1168  PushIndividual(a_ob_type, new_Adult);
1169  IncLiveArraySize(a_ob_type);
1170  }
1171  }
1172 }

References Population_Manager::IncLiveArraySize(), lobs_Adult, lobs_Egg, lobs_Larva1, lobs_Larva2, lobs_Larva3, lobs_Larva4, lobs_Pupa, Struct_Beetle::m_l, Struct_Beetle::m_x, Struct_Beetle::m_y, Population_Manager::PushIndividual(), and Landscape::SupplyDayInYear().

Referenced by Ladybird_Population_Manager(), Ladybird_Pupae::St_Emerge(), and Ladybird_Adult::TryToReproduce().

◆ DayDegreeCalculations()

void Ladybird_Population_Manager::DayDegreeCalculations ( int  a_dayinyear,
bool  a_usehourly 
)
overrideprotectedvirtual

Does day degree development calculations here.

Reimplemented from Beetle_Population_Manager.

990  {
991 
992 
993 
994  const double airtemp = m_TheLandscape->SupplyTemp();
995  // Save some useful temperature related values used for mortality calculations for juvenile stages
996  double atemptoday = airtemp;
998  if (atemptoday < m_MortalityTempMin) m_TemperatureCategory = 0;
999  else if (atemptoday > m_MortalityTempMax) m_TemperatureCategory = m_NoTemperatureCategories - 1; // minus 1 because of zero based index
1000  else m_TemperatureCategory = static_cast<int>(floor((atemptoday - m_MortalityTempMin) / m_MortalityTempStep + 0.5));
1002  // Calculate the number of eggs laid today
1003  CalculateDailyEggProduction(airtemp);
1004  // Calculated the DayDegrees for the different stages today
1005  for (int stg = 0; stg <= m_BeetleLarvalStagesNum + 1; ++stg) { // +1 for pupa
1006  double temp_added_today = 0.0;
1007  // Need to use hourly temperatures
1008  double atempsum = 0;
1009  for (int hour = 0; hour < 24; hour++)
1010  {
1011  double atemp = m_TheLandscape->SupplyTempHour(hour);
1012  atempsum += atemp;
1013  if (atemp > m_DevelConst1[stg]){
1014  temp_added_today += atemp - m_DevelConst1[stg];
1015  }
1016  }
1017  temp_added_today /= 24.0;
1018  atemptoday = atempsum / 24.0;
1019 
1020 
1021  if (atemptoday > m_DevelopmentInflectionPoints[stg]) {
1022  for (int i = 0; i <= a_dayinyear; i++) {
1023  m_DayDegs[stg][i] += temp_added_today * m_AboveInflectionRates[stg];
1024  }
1025  }
1026  else {
1027  for (int i = 0; i <= a_dayinyear; i++) {
1028  m_DayDegs[stg][i] += temp_added_today;
1029  }
1030  }
1031  }
1032  // Do any extreme temperature mortality
1033  DoExtremeTempActions(atemptoday);
1034  // Set any egg mortalities needed today
1035  DoEggDailyMortalityActions(atemptoday);
1036  // Set any egg mortalities needed today
1037  DoLarvalDailyMortalityActions(atemptoday);
1038 
1039 
1040  const double temp = m_TheLandscape->SupplyTemp();
1041  // Sets/unsets the larval movement flag
1043  if ((cfg_LadybirdOvipositionPeriodStart.value() < a_dayinyear) && (cfg_LadybirdOvipositionPeriodEnd.value() > a_dayinyear))
1045  vector<double> morts = {};
1046  for (int i = 0; i < 60; i++) {
1047  const int ageclass = i / 5;
1048  const double d1 = cfg_LadybirdAdultTemperatureMortalityParams.value().at(ageclass * 3);
1049  const double d2 = cfg_LadybirdAdultTemperatureMortalityParams.value().at(ageclass * 3 + 1);
1050  const double d3 = cfg_LadybirdAdultTemperatureMortalityParams.value().at(ageclass * 3 + 2);
1051  morts.push_back((d1 + d2 * temp + d3 * temp * temp)*cfg_LadybirdMortalityScaler.value());
1052  }
1054  int movemax = 2;
1055  if (temp>=10) movemax = static_cast<int>(temp*cfg_LadybirdMovementProportion.value() * cfg_LadybirdMovementRatePerT.value() * m_TheLandscape->SupplyDaylength());
1056  if (movemax < cfg_LadybirdShortMovementsMaxThreshold.value()) movemax = cfg_LadybirdShortMovementsMaxThreshold.value(); // At least 1m per short move
1057  Ladybird_Adult::SetShortRangeDistToday(static_cast<int>(floor(movemax / cfg_LadybirdShortMovementsMaxThreshold.value() + 0.5)));
1058  movemax /= 2;
1059  if (movemax > 10) movemax = 10; // Larvae constrained to 1-10m
1062 }

References CalculateDailyEggProduction(), cfg_LadybirdAdultTemperatureMortalityParams, cfg_LadybirdLarvaeMoveStep, cfg_LadybirdMortalityScaler, cfg_LadybirdMovementProportion, cfg_LadybirdMovementRatePerT, cfg_LadybirdOvipositionPeriodEnd, cfg_LadybirdOvipositionPeriodStart, cfg_LadybirdShortMovementsMaxThreshold, DoEggDailyMortalityActions(), DoExtremeTempActions(), DoLarvalDailyMortalityActions(), Beetle_Population_Manager::m_AboveInflectionRates, Beetle_Population_Manager::m_BeetleLarvalStagesNum, Beetle_Population_Manager::m_DayDegs, Beetle_Population_Manager::m_DevelConst1, Beetle_Population_Manager::m_DevelopmentInflectionPoints, m_LadybirdLarvaCanMove_bool, m_LadybirdLarvaMovementThreshold, Beetle_Population_Manager::m_MortalityTempMax, Beetle_Population_Manager::m_MortalityTempMin, Beetle_Population_Manager::m_MortalityTempStep, Beetle_Population_Manager::m_NoTemperatureCategories, Beetle_Population_Manager::m_TemperatureCategory, Population_Manager_Base::m_TheLandscape, Ladybird_Adult::SetBackgroundMortTemp(), Ladybird_Larvae1::SetLadybirdLarvaeMoveMax(), Ladybird_Larvae1::SetLadybirdLarvaeMoveStep(), Ladybird_Adult::SetOvipositionPeriod(), Ladybird_Adult::SetShortRangeDistToday(), Beetle_Base::SetTodaysTempCategory(), Landscape::SupplyDaylength(), Landscape::SupplyTemp(), Landscape::SupplyTempHour(), CfgInt::value(), CfgFloat::value(), and CfgArray_Double::value().

◆ DecAphids()

void Ladybird_Population_Manager::DecAphids ( int  a_x,
int  a_y,
int  a_num 
)

the method decreases the number of aphids by "num" in the given location in all the underlying aphid models

1331  {
1332  //if there are more than one aphid speicies, divide the number of aphids to kill by the number of species
1333  //const double num_per_species = static_cast<double>(a_num) / static_cast<double>(m_AphidPopulationManagerPtrList.size());
1334  double available = GetAphidDensity(a_x, a_y);
1335  double divider_per_species = static_cast<double>(a_num) / available;
1336  double available_each_cell = 0;
1337  for (int i = 0; i < m_AphidPopulationManagerPtrList.size(); i++) {
1338  available_each_cell = m_AphidPopulationManagerPtrList[i]->SupplyAphidDensity(a_x, a_y);
1339  m_AphidPopulationManagerPtrList[i]->KillAphid(a_x, a_y, available_each_cell*divider_per_species);
1340  }
1341 }

References GetAphidDensity(), and m_AphidPopulationManagerPtrList.

Referenced by Ladybird_Base::EatAphids().

◆ DoEggDailyMortalityActions()

void Ladybird_Population_Manager::DoEggDailyMortalityActions ( double  a_atemptoday)
overrideprotectedvirtual

Species specific actions to cope with temperature related egg mortality.

Reimplemented from Beetle_Population_Manager.

References m_EggTemperatureMortality, Beetle_Population_Manager::m_TemperatureCategory, and Beetle_Egg_List::SetDailyEggMort().

Referenced by DayDegreeCalculations().

◆ DoExtremeTempActions()

void Ladybird_Population_Manager::DoExtremeTempActions ( double  a_atemptoday)
overrideprotectedvirtual

Species specific actions to cope with response to extreme temperature, if needed.

Ladybird specific actions to cope with response to extreme temperature.

Parameters
a_atemptodayis the temperature today

Tests for extreme temperature then applies the mortality to juvenile stages. This is called by the standard beetle class population manager once per day

Reimplemented from Beetle_Population_Manager.

1068  {
1073  if (((a_atemptoday < cfg_LadybirdExtremeTempMin.value()) || (a_atemptoday > cfg_LadybirdExtremeTempMax.value())))
1074  {
1075  // Apply the extreme temperature mortality as needed here
1076  const double extrememortchance = cfg_LadybirdExtremeTempMortChance.value();
1077  int temp_thread_num = omp_get_max_threads();
1078  for (unsigned stage = lobs_Larva1; stage < lobs_Adult; stage++)
1079  {
1080  for(int t=0; t<temp_thread_num; t++){
1081  for (auto it = TheSubArrays[stage][t]->begin(); it != TheSubArrays[stage][t]->end(); ++it)
1082  {
1083  if((*it)->GetCurrentStateNo() >= 0){
1084  if (g_rand_uni_fnc() < extrememortchance) {
1085  Beetle_Base* temp_beetle = dynamic_cast<Beetle_Base*>(*it);
1086  temp_beetle->StDie();
1087  temp_beetle->DecDensity(temp_beetle->Supply_m_Location_x(), temp_beetle->Supply_m_Location_y());
1088  }
1089  }
1090  }
1091  }
1092  }
1093  // Eggs need different handling
1094  for (int i = 0; i < 365; i++)
1095  {
1096  ((*m_EList)[i])->ExtremeTempMortality(extrememortchance);
1097  }
1098  }
1099 }

References cfg_LadybirdExtremeTempMax, cfg_LadybirdExtremeTempMin, cfg_LadybirdExtremeTempMortChance, Beetle_Base::DecDensity(), g_rand_uni_fnc(), lobs_Adult, lobs_Larva1, Beetle_Base::StDie(), TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Population_Manager::TheSubArrays, and CfgFloat::value().

Referenced by DayDegreeCalculations().

◆ DoFirst()

void Ladybird_Population_Manager::DoFirst ( void  )
overrideprotectedvirtual

Does day degree development calculations here.

This method removes any eggs that have survived until winter. In descendent classes other stages may need to be removed.
It subsequently calculates day degree development for each day for each beetle stage. This is an optimising strategy to prevent each beetle individual calculating these.
Finally it replaces the Egg_List BeginStep functionality. This is also an optimisation since it only requires 365 Egg_lists, one for each day of the year instead of millions of individual eggs.
NB this breaks the traditional ALMaSS protocol for handling animal individuals.

Reimplemented from Beetle_Population_Manager.

1345  {
1347  if (g_date->JanFirst()) {
1348  int temp_total_adult = m_LiveArraySize[lobs_Adult];
1349  if(temp_total_adult > cfg_LadybirdMaxAdultNumber.value()){
1350  #pragma omp parallel
1351  {
1352  int thread_id = omp_get_thread_num();
1353  for(auto it = TheSubArrays[lobs_Adult][thread_id]->begin(); it != TheSubArrays[lobs_Adult][thread_id]->end(); ++it){
1354  int loc_x = (*it)->Supply_m_Location_x();
1355  int loc_y = (*it)->Supply_m_Location_y();
1356  int loc_x_cell = loc_x / m_guard_cell_size;
1357  int loc_y_cell = loc_y / m_guard_cell_size;
1358  (*it)->SetGuardMapIndex(loc_x_cell, loc_y_cell);
1359  omp_set_nest_lock(m_MapGuard[loc_y_cell][loc_x_cell]);
1361  Ladybird_Adult* temp_adult = dynamic_cast<Ladybird_Adult*>(*it);
1362  temp_adult->DecDensity(temp_adult->Supply_m_Location_x(), temp_adult->Supply_m_Location_y());
1363  temp_adult->StDie();
1364  }
1365  if(m_is_paralleled){
1366  loc_x_cell = (*it)->SupplyGuardCellX();
1367  loc_y_cell = (*it)->SupplyGuardCellY();
1368  }
1369  omp_unset_nest_lock(m_MapGuard[loc_y_cell][loc_x_cell]);
1370  }
1371  }
1373  }
1374  }
1375 }

References cfg_LadybirdAdultMortalityRate, cfg_LadybirdMaxAdultNumber, Beetle_Base::DecDensity(), Beetle_Population_Manager::DoFirst(), g_date, g_rand_uni_fnc(), Calendar::JanFirst(), lobs_Adult, Population_Manager::m_guard_cell_size, Population_Manager::m_is_paralleled, Population_Manager::m_LiveArraySize, Population_Manager::m_MapGuard, Population_Manager::PartitionLiveDead(), Beetle_Base::StDie(), TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Population_Manager::TheSubArrays, and CfgFloat::value().

◆ DoLarvalDailyMortalityActions()

void Ladybird_Population_Manager::DoLarvalDailyMortalityActions ( double  a_atemptoday)
overrideprotectedvirtual

Species specific actions to cope with temperature related laval mortality.

Just fixes the temperature category for today. This is called by the standard beetle class population manager once per day.

Reimplemented from Beetle_Population_Manager.

1105  {
1111 }

References GetTempMortRange(), and m_MortalityTempIndexToday.

Referenced by DayDegreeCalculations().

◆ DoSpecialBetweenLifeStages()

void Ladybird_Population_Manager::DoSpecialBetweenLifeStages ( int  a_life_stage)
overridevirtual

Cannibalism is handled here.

Reimplemented from Population_Manager.

921  {
922  //The densitiy map is already changed, so need to change the density map here
923  if(a_life_stage<=0) return; //nothing to do for egg
924  //first we check the egg
925  if(m_cannibalism_dead_total_num[0]>0){ //if there is any dead egg
926  for (int i = 0; i < 365; i++){
927  (*m_EList)[i]->CannibalismMortality(m_cannibalism_dead_num_map[0], m_cannibalism_dead_total_num[0]);
928  if(m_cannibalism_dead_total_num[0]<=0){ //if there is no dead one, move to the next
929  break;
930  }
931  }
932  //m_cannibalism_dead_num_map[0].setZero();
934  }
935 
936  //now the larva and pupa, again we can't do it in parallel
937  for (int listindex = lobs_Larva1; listindex< a_life_stage; listindex++){
938  if(m_cannibalism_dead_total_num[listindex]<=0){ //if there is no dead one, move to the next
939  continue;
940  }
941  int temp_thread_num = omp_get_max_threads();
942  while(m_cannibalism_dead_total_num[listindex] >0 ){
943  bool is_enough = false;
944  for (int thread_id=0; thread_id < temp_thread_num; thread_id++){
945  auto pre_it = TheSubArrays[listindex][thread_id]->before_begin();
946  for (auto it=TheSubArrays[listindex][thread_id]->begin(); it!=TheSubArrays[listindex][thread_id]->end();){
947  //let's check the guard map
948  int loc_x = (*it)->Supply_m_Location_x();
949  int loc_y = (*it)->Supply_m_Location_y();
950  if (m_cannibalism_dead_num_map[listindex](loc_y, loc_x) > 0 && (*it)->GetCurrentStateNo() >= 0){
951  //kill it
952  dynamic_cast<Beetle_Base*>(*it)->StDie();
953  m_cannibalism_dead_num_map[listindex](loc_y, loc_x) -= 1;
954  //dynamic_cast<Beetle_Base*>(*it)->DecDensity(loc_x, loc_y, listindex);
955  delete (*it);
956  it = TheSubArrays[listindex][thread_id]->erase_after(pre_it);
957  m_cannibalism_dead_total_num[listindex] -= 1;
958  TheSubArraysSizes[listindex][thread_id] -= 1;
959  }
960  //already dead so delete it and remove it from the list
961  else if ((*it)->GetCurrentStateNo() < 0){
962  TheSubArraysSizes[listindex][thread_id] -= 1;
963  //dynamic_cast<Beetle_Base*>(*it)->DecDensity(loc_x, loc_y, listindex);
964  delete (*it);
965  it = TheSubArrays[listindex][thread_id]->erase_after(pre_it);
966  }
967  else{
968  pre_it = it;
969  ++it;
970  }
971 
972  if(m_cannibalism_dead_total_num[listindex] <= 0){
973  is_enough = true;
974  break;
975  }
976  }
977  if(is_enough){
978  break;
979  }
980  }
981  }
982 
983  m_LiveArraySize[listindex] = 0;
984  for (int thread_id=0; thread_id < temp_thread_num; thread_id++){
985  m_LiveArraySize[listindex] += TheSubArraysSizes[listindex][thread_id];
986  }
987  }
988 }

References lobs_Larva1, m_cannibalism_dead_num_map, m_cannibalism_dead_total_num, Population_Manager::m_LiveArraySize, Population_Manager::TheSubArrays, and Population_Manager::TheSubArraysSizes.

◆ GetAphidDensity()

double Ladybird_Population_Manager::GetAphidDensity ( int  a_x,
int  a_y 
)
overridevirtual

Returns the number of aphids per square metre at this x,y location.

Parameters
a_xx-coordinate
a_yy-coordinate
Returns
Aphid number

Reimplemented from Population_Manager_Base.

1323  {
1324  double n{ 0 };
1325  for (int i = 0; i < static_cast<int>(m_AphidPopulationManagerPtrList.size()); i++) {
1326  n += m_AphidPopulationManagerPtrList[i]->SupplyAphidDensity(a_x, a_y);
1327  }
1328  return n;
1329 };

References m_AphidPopulationManagerPtrList.

Referenced by DecAphids(), Ladybird_Base::EatAphids(), Ladybird_Adult::FindTarget(), Ladybird_Adult::IsForageSite(), Ladybird_Adult::ShouldStartAggregating(), Ladybird_Larvae1::St_Develop(), and Ladybird_Adult::TryToReproduce().

◆ GetAphidPopulationManager()

Aphid_Population_Manager* Ladybird_Population_Manager::GetAphidPopulationManager ( const int  a_index) const
inline

The function to get a aphid population manager pointer referenced by a_index.

463 { return m_AphidPopulationManagerPtrList[a_index]; }

References m_AphidPopulationManagerPtrList.

◆ GetAphidPopulationManagerSize()

int Ladybird_Population_Manager::GetAphidPopulationManagerSize ( ) const
inline

The function to get a aphid population manager number.

461 { return static_cast<int>(m_AphidPopulationManagerPtrList.size()); }

References m_AphidPopulationManagerPtrList.

◆ GetFlyingWeather()

bool Ladybird_Population_Manager::GetFlyingWeather ( ) const
inline

the function returns true if the weather is suitable for flying

1317  {
1320  return false;
1321 }

References cfg_LadybirdFlyingThreshTemp, cfg_LadybirdFlyingThreshWind, Population_Manager_Base::m_TheLandscape, Landscape::SupplyTemp(), Landscape::SupplyWind(), and CfgFloat::value().

◆ GetLadybirdLarvaCanMove()

bool Ladybird_Population_Manager::GetLadybirdLarvaCanMove ( ) const
inline

Gets the larval movement flag for today.

455 { return m_LadybirdLarvaCanMove_bool; }

References m_LadybirdLarvaCanMove_bool.

Referenced by Ladybird_Larvae1::St_Develop().

◆ getLongRangeDuration()

static double Ladybird_Population_Manager::getLongRangeDuration ( )
inlinestatic

long flight duration: used in distance calculation

457 {return 3000.;} // 50 min * 60 sec/min // todo: move parameters to constants class

◆ GetTempMortRange()

int Ladybird_Population_Manager::GetTempMortRange ( double  a_temp) const
protected

Gets the temperature category for mortality calculations.

1113  {
1114  const double mintemp1 = cfg_LadybirdMortalityTempMin.value();
1115  const double maxtemp1 = cfg_LadybirdMortalityTempMax.value();
1116  const double steptemp = cfg_LadybirdMortalityTempStep.value();
1117  if (a_temp < mintemp1) {
1118  a_temp = mintemp1;
1119  }
1120  else {
1121  if (a_temp > maxtemp1) {
1122  a_temp = maxtemp1;
1123  }
1124  }
1125  return (int)round((a_temp - steptemp) / steptemp) - 1;
1126 }

References cfg_LadybirdMortalityTempMax, cfg_LadybirdMortalityTempMin, cfg_LadybirdMortalityTempStep, and CfgFloat::value().

Referenced by DoLarvalDailyMortalityActions().

◆ IsLocationAllowedLarvae()

bool Ladybird_Population_Manager::IsLocationAllowedLarvae ( TTypesOfVegetation  a_tov)
inline

Checks the tov list of disallowed tovs and returns false if a_tov is disallowed

444  {
446  return false;
447  }
448  return true;
449  }

References m_LadybirdProhibitedTovsForMovementLarva.

Referenced by Ladybird_Larvae1::IsLocationAllowed().

◆ OnFarmEvent()

bool Ladybird_Population_Manager::OnFarmEvent ( FarmToDo  event,
Beetle_Base a_caller 
)
overridevirtual

Used to determine mortality based on an event for any beetle class - pure vitual must be overriden.

Implements Beetle_Population_Manager.

1174  {
1175  switch (a_event)
1176  {
1177  case sleep_all_day:
1178  break;
1179  case autumn_plough:
1180  case stubble_plough: // assumed to be the same as for autumn plough
1181  case stubble_cultivator_heavy: // assumed to be the same as for autumn plough
1182  case heavy_cultivator_aggregate: // assumed to be the same as for autumn plough
1183  case autumn_harrow:
1184  case preseeding_cultivator: // assumed to be the same as for harrow
1185  case preseeding_cultivator_sow: // assumed to be the same as for harrow
1186  case autumn_roll:
1187  case autumn_sow:
1188  case winter_plough:
1189  case deep_ploughing:
1190  case spring_plough:
1191  case spring_harrow:
1192  case shallow_harrow:
1194  case strigling_sow:
1195  case bed_forming:
1196  case bulb_harvest:
1197  case winter_harrow:
1198  case summer_plough:
1199  case summer_harrow:
1200  case burn_straw_stubble:
1201  case flammebehandling:
1202  case stubble_harrowing:
1203  if (g_rand_uni_fnc() < a_caller->GetSoilCultivationMortality()) return true;
1204  break;
1205  case harvest:
1206  case green_harvest:
1207  case cut_to_hay:
1208  case cut_to_silage:
1209  case mow:
1210  case cut_weeds:
1211  case straw_chopping:
1212  case swathing:
1213  if (g_rand_uni_fnc() < a_caller->GetHarvestMortality()) return true;
1214  break;
1215  case strigling:
1216  case strigling_hill:
1217  if (g_rand_uni_fnc() < a_caller->GetStriglingMortality()) return true;
1218  break;
1219  case insecticide_treat:
1221  case trial_toxiccontrol:
1222  case syninsecticide_treat:
1223  case product_treat:
1224  if (g_rand_uni_fnc() < a_caller->GetInsecticideApplication()) return true;
1225  break;
1226  // Biocide Treatment mortality
1227  case biocide:
1228  if (g_rand_uni_fnc() < (a_caller->GetInsecticideApplication()) * (1.0 - cfg_biocide_reduction_val.value())) return true;
1229  break;
1230  // Below here are all the no mortality operations
1231  case spring_roll:
1232  case spring_sow:
1233  case spring_sow_with_ferti:
1234  case fp_npks:
1235  case fp_npk:
1236  case fp_pk:
1237  case fp_sk:
1238  case fp_k:
1239  case fp_p:
1240  case fp_liquidNH3:
1241  case fp_slurry:
1242  case fp_manganesesulphate:
1243  case fp_ammoniumsulphate:
1244  case fp_manure:
1245  case fp_greenmanure:
1246  case fp_sludge:
1247  case fp_rsm:
1248  case fp_calcium:
1249  case fp_boron:
1250  case fa_npks:
1251  case fa_boron:
1252  case fa_npk:
1253  case fa_cu:
1254  case fa_nk:
1255  case harvestshoots:
1256  case manual_weeding:
1257  case fa_pk:
1258  case fa_p:
1259  case fa_k:
1260  case fa_sk:
1261  case fa_slurry:
1262  case fa_ammoniumsulphate:
1263  case fa_manganesesulphate:
1264  case fa_manure:
1265  case fa_greenmanure:
1266  case fa_sludge:
1267  case fa_rsm:
1268  case fa_calcium:
1269  case herbicide_treat:
1270  case growth_regulator:
1271  case fungicide_treat:
1272  case org_insecticide:
1273  case org_herbicide:
1274  case org_fungicide:
1275  case fp_pks:
1276  case fa_pks:
1277  case fp_n:
1278  case fa_n:
1280  case pruning:
1281  case shredding:
1282  case fiber_covering:
1283  case fiber_removal:
1284  case fp_nk:
1285  case fp_ns:
1286  case fp_nc:
1287  case autumn_sow_with_ferti:
1288  case harvest_bushfruit:
1289  case fp_cu:
1290  case hilling_up:
1291  case water:
1292  case flower_cutting:
1293  case straw_covering:
1294  case straw_removal:
1295  case cattle_out:
1296  case cattle_out_low:
1297  case hay_turning:
1298  case hay_bailing:
1299  case burn_top: //AHA
1300  case pigs_out:
1301  case molluscicide:
1302  case row_cultivation:
1303  case trial_control:
1304  case glyphosate:
1305  case pheromone:
1306  case start:
1307  case summer_sow:
1308  case suckering:
1309  case last_treatment:
1310  break;
1311  default: // NOLINT(clang-diagnostic-covered-switch-default)
1312  m_TheLandscape->Warn("Beetle Adult - Unknown Treatment in Daily Mortality:", std::to_string(a_event));
1313  exit(1);
1314  }
1315  return false;
1316 }

References autumn_harrow, autumn_or_spring_plough, autumn_plough, autumn_roll, autumn_sow, autumn_sow_with_ferti, bed_forming, biocide, bulb_harvest, burn_straw_stubble, burn_top, cattle_out, cattle_out_low, cfg_biocide_reduction_val, cut_to_hay, cut_to_silage, cut_weeds, deep_ploughing, fa_ammoniumsulphate, fa_boron, fa_calcium, fa_cu, fa_greenmanure, fa_k, fa_manganesesulphate, fa_manure, fa_n, fa_nk, fa_npk, fa_npks, fa_p, fa_pk, fa_pks, fa_rsm, fa_sk, fa_sludge, fa_slurry, fiber_covering, fiber_removal, flammebehandling, flower_cutting, fp_ammoniumsulphate, fp_boron, fp_calcium, fp_cu, fp_greenmanure, fp_k, fp_liquidNH3, fp_manganesesulphate, fp_manure, fp_n, fp_nc, fp_nk, fp_npk, fp_npks, fp_ns, fp_p, fp_pk, fp_pks, fp_rsm, fp_sk, fp_sludge, fp_slurry, fungicide_treat, g_rand_uni_fnc(), Beetle_Base::GetHarvestMortality(), Beetle_Base::GetInsecticideApplication(), Beetle_Base::GetSoilCultivationMortality(), Beetle_Base::GetStriglingMortality(), glyphosate, green_harvest, growth_regulator, harvest, harvest_bushfruit, harvestshoots, hay_bailing, hay_turning, heavy_cultivator_aggregate, herbicide_treat, hilling_up, insecticide_treat, last_treatment, Population_Manager_Base::m_TheLandscape, manual_weeding, molluscicide, mow, org_fungicide, org_herbicide, org_insecticide, pheromone, pigs_out, preseeding_cultivator, preseeding_cultivator_sow, product_treat, pruning, row_cultivation, shallow_harrow, shredding, sleep_all_day, spring_harrow, spring_plough, spring_roll, spring_sow, spring_sow_with_ferti, start, straw_chopping, straw_covering, straw_removal, strigling, strigling_hill, strigling_sow, stubble_cultivator_heavy, stubble_harrowing, stubble_plough, suckering, summer_harrow, summer_plough, summer_sow, swathing, syninsecticide_treat, trial_control, trial_insecticidetreat, trial_toxiccontrol, CfgFloat::value(), Landscape::Warn(), water, winter_harrow, and winter_plough.

◆ SetAphidPopulationManager()

void Ladybird_Population_Manager::SetAphidPopulationManager ( Aphid_Population_Manager a_aphid_population_manager_ptr)
inline

The function to set the aphid population manager pointer.

459 { m_AphidPopulationManagerPtrList.push_back(a_aphid_population_manager_ptr); }

References m_AphidPopulationManagerPtrList.

◆ TheAOROutputProbe()

void Ladybird_Population_Manager::TheAOROutputProbe ( )
overridevirtual

Special output functionality.

Reimplemented from Beetle_Population_Manager.

References AOR_Probe::DoProbe(), lobs_Adult, and Population_Manager::m_AOR_Probe.

Member Data Documentation

◆ LadybirdAggregationTovs

TTovList Ladybird_Population_Manager::LadybirdAggregationTovs

the types of vegetation that are aggregation targets

◆ LadybirdLongRangeToles

TToleList Ladybird_Population_Manager::LadybirdLongRangeToles

the types of landscape that are targets of long range movement

◆ LadybirdLongRangeTovs

TTovList Ladybird_Population_Manager::LadybirdLongRangeTovs

the types of vegetation that are targets of long range movement

◆ LadybirdProhibitedTolesForMovementLarva

TToleList Ladybird_Population_Manager::LadybirdProhibitedTolesForMovementLarva

the types of vegetation that are prohibited for ladybirds larva

the types of landscape that are prohibited for ladybirds larva

◆ m_AphidPopulationManagerPtrList

std::vector<Aphid_Population_Manager*> Ladybird_Population_Manager::m_AphidPopulationManagerPtrList

◆ m_cannibalism_dead_num_map

vector<Eigen::MatrixXi> Ladybird_Population_Manager::m_cannibalism_dead_num_map
protected

Holds the daily dead number caused by cannibalism.

Referenced by AddCannibalismDeath(), DoSpecialBetweenLifeStages(), and Ladybird_Population_Manager().

◆ m_cannibalism_dead_total_num

vector<int> Ladybird_Population_Manager::m_cannibalism_dead_total_num
protected

Holds the daily total dead number for each life stage caused by cannibalism.

Referenced by AddCannibalismDeath(), DoSpecialBetweenLifeStages(), and Ladybird_Population_Manager().

◆ m_EggTemperatureMortality

vector<double> Ladybird_Population_Manager::m_EggTemperatureMortality { }
protected

Storage for the temperature related mortality for eggs.

Referenced by DoEggDailyMortalityActions(), and Ladybird_Population_Manager().

◆ m_LadybirdAggregationToles

TToleList Ladybird_Population_Manager::m_LadybirdAggregationToles

the types of landscape that are aggregation targets

Referenced by Ladybird_Adult::IsAggregationSite(), and Ladybird_Population_Manager().

◆ m_LadybirdLarvaCanMove_bool

bool Ladybird_Population_Manager::m_LadybirdLarvaCanMove_bool {true}
protected

minimum temperature that larva can move at

Referenced by DayDegreeCalculations(), and GetLadybirdLarvaCanMove().

◆ m_LadybirdLarvaMovementThreshold

double Ladybird_Population_Manager::m_LadybirdLarvaMovementThreshold { 10.0 }
protected

minimum temperature that larva can move at

Referenced by DayDegreeCalculations(), and Ladybird_Population_Manager().

◆ m_LadybirdProhibitedTolesForMovement

TToleList Ladybird_Population_Manager::m_LadybirdProhibitedTolesForMovement

the types of landscape that are prohibited for ladybirds

Referenced by Ladybird_Adult::IsProbhibited(), and Ladybird_Population_Manager().

◆ m_LadybirdProhibitedTovsForMovement

TTovList Ladybird_Population_Manager::m_LadybirdProhibitedTovsForMovement

the types of vegetation that are prohibited for ladybirds

◆ m_LadybirdProhibitedTovsForMovementLarva

TTovList Ladybird_Population_Manager::m_LadybirdProhibitedTovsForMovementLarva
protected

Uses the open cannibalisations events list to remove beetles.

List of prohibited tov types for larvae

Referenced by IsLocationAllowedLarvae(), and Ladybird_Population_Manager().

◆ m_LadybirdToleTovs

LadybirdToleTovs Ladybird_Population_Manager::m_LadybirdToleTovs
protected

Class holding all the tole tov related information - for tidyness.

Referenced by Ladybird_Population_Manager().

◆ m_MortalityTempIndexToday

int Ladybird_Population_Manager::m_MortalityTempIndexToday { 0 }
protected

Storage for the index to the mortality vector for todays temperature (speed optimisation)

Referenced by DoLarvalDailyMortalityActions().

◆ TodaysEggProductionTempFactor

double Ladybird_Population_Manager::TodaysEggProductionTempFactor {0.0}
protected

the dependence between temperature and the clutch size: updated daily

variables


The documentation for this class was generated from the following files:
Beetle_Population_Manager::Beetle_Population_Manager
Beetle_Population_Manager(Landscape *a_l_ptr, int a_n)
Beetle_Population_Manager Constructor.
Definition: Beetle_BaseClasses.cpp:1400
Ladybird_Pupae
Definition: Ladybird_All.h:252
TAnimal::Supply_m_Location_x
int Supply_m_Location_x() const
Returns the ALMaSS x-coordinate.
Definition: PopulationManager.h:239
lobs_Pupa
Definition: Ladybird_All.h:70
fiber_removal
Definition: Treatment.h:129
fp_rsm
Definition: Treatment.h:64
LadybirdTovParams::getList
TTovList getList()
Definition: Ladybird_toletov.cpp:12
org_insecticide
Definition: Treatment.h:84
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
Beetle_Population_Manager::IsStartHabitat
bool IsStartHabitat(int a_x, int a_y) const
Used to specify legal starting habitats for simulation start-up.
Definition: Beetle_BaseClasses.cpp:1557
fa_sk
Definition: Treatment.h:71
cfg_LadybirdLarvaAppetite
static CfgArray_Int cfg_LadybirdLarvaAppetite("LADYBIRD_LARVAL_APPETITE", CFG_CUSTOM, 4, vector< int >{ 35, 40, 80, 130 })
The appetite for larval stages per day in aphids.
Ladybird_Population_Manager::m_cannibalism_dead_num_map
vector< Eigen::MatrixXi > m_cannibalism_dead_num_map
Holds the daily dead number caused by cannibalism.
Definition: Ladybird_All.h:399
cfg_LadybirdExtremeTempMin
static CfgFloat cfg_LadybirdExtremeTempMin("LADYBIRD_EXTREME_TEMP_MIN", CFG_CUSTOM, -20.0)
row_cultivation
Definition: Treatment.h:88
fa_pk
Definition: Treatment.h:68
winter_harrow
Definition: Treatment.h:144
Ladybird_Base::SetLadybirdStagesNutritionalValue
static void SetLadybirdStagesNutritionalValue(const vector< int > &a_list)
Sets the list of aphid equivalents of each ladybird stage.
Definition: Ladybird_All.h:134
fp_npk
Definition: Treatment.h:52
strigling
Definition: Treatment.h:89
g_rand_uni_fnc
double g_rand_uni_fnc()
Definition: ALMaSS_Random.cpp:56
harvest
Definition: Treatment.h:94
fa_nk
Definition: Treatment.h:142
Beetle_Population_Manager::m_InFieldNo
int m_InFieldNo
In-field counter.
Definition: Beetle_BaseClasses.h:1117
cfg_biocide_reduction_val
CfgFloat cfg_biocide_reduction_val
Landscape::SupplyTemp
double SupplyTemp(void)
Passes a request on to the associated Weather class function, the temperature for the current day.
Definition: Landscape.h:1993
insecticide_treat
Definition: Treatment.h:83
Population_Manager::m_MapGuard
std::vector< std::vector< omp_nest_lock_t * > > m_MapGuard
This is used to make sure animals will not behaviour at the same area - multi threads.
Definition: PopulationManager.h:790
straw_chopping
Definition: Treatment.h:99
fa_greenmanure
Definition: Treatment.h:76
Population_Manager::TheSubArraysSizes
vector< vector< int > > TheSubArraysSizes
Hold all the animal sizes in each thread.
Definition: PopulationManager.h:806
stubble_plough
Definition: Treatment.h:35
growth_regulator
Definition: Treatment.h:81
Ladybird_Population_Manager::DoExtremeTempActions
void DoExtremeTempActions(double a_atemptoday) override
Species specific actions to cope with response to extreme temperature, if needed.
Definition: Ladybird_All.cpp:1068
Beetle_Population_Manager::m_DevelConst1
vector< double > m_DevelConst1
Day degree threshold constant for eggs to pupae.
Definition: Beetle_BaseClasses.h:1068
deep_ploughing
Definition: Treatment.h:43
hilling_up
Definition: Treatment.h:91
Ladybird_Larvae1::SetLarvalAppetite
static void SetLarvalAppetite(const vector< int > &a_value)
Definition: Ladybird_All.h:196
Ladybird_Population_Manager::m_cannibalism_dead_total_num
vector< int > m_cannibalism_dead_total_num
Holds the daily total dead number for each life stage caused by cannibalism.
Definition: Ladybird_All.h:401
green_harvest
Definition: Treatment.h:127
autumn_or_spring_plough
Definition: Treatment.h:103
Beetle_Population_Manager::m_BeetlePositionMaps
vector< SimplePositionMapInt * > m_BeetlePositionMaps[bob_foobar]
Definition: Beetle_BaseClasses.h:1113
Population_Manager::m_population_type
TTypesOfPopulation m_population_type
Definition: PopulationManager.h:858
flower_cutting
Definition: Treatment.h:121
Landscape::SupplyWind
double SupplyWind(void)
Passes a request on to the associated Weather class function, the wind speed for the current day.
Definition: Landscape.h:2061
spring_plough
Definition: Treatment.h:44
fp_sk
Definition: Treatment.h:56
pruning
Definition: Treatment.h:125
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.
Beetle_Population_Manager::m_NoTemperatureCategories
int m_NoTemperatureCategories
Storage for the number of temperature categories used.
Definition: Beetle_BaseClasses.h:1050
Ladybird_Larvae3
Class for beetle larval stage 3, most functionality is in Beetle_Larvae.
Definition: Ladybird_All.h:227
cfg_LadybirdHibernaculaeSizesDist
static CfgArray_Double cfg_LadybirdHibernaculaeSizesDist("LADYBIRD_HIBERNACULAESIZEDIST", CFG_CUSTOM, 12, vector< double >{0.77, 0.95, 1.00, 1.00, 0.51, 0.80, 0.975, 1.00, 0.25, 0.64, 0.95, 1.000})
Distribution of hibernaculae sizes for three densities (four clump sizes)
Ladybird_Population_Manager::m_MortalityTempIndexToday
int m_MortalityTempIndexToday
Storage for the index to the mortality vector for todays temperature (speed optimisation)
Definition: Ladybird_All.h:395
fp_manure
Definition: Treatment.h:61
herbicide_treat
Definition: Treatment.h:80
fp_ammoniumsulphate
Definition: Treatment.h:60
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
flammebehandling
Definition: Treatment.h:90
Population_Manager_Base::m_ListNames
const char * m_ListNames[32]
A list of life-stage names.
Definition: PopulationManager.h:628
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
straw_covering
Definition: Treatment.h:123
cfg_LadybirdFlyingThreshWind
static CfgFloat cfg_LadybirdFlyingThreshWind("LADYBIRD_FLYINGTHRESHWIND", CFG_CUSTOM, 10.0)
The maximum wind speed that still allows flying (m/s)
fp_boron
Definition: Treatment.h:131
cfg_LadybirdAdultMortalityRate
CfgFloat cfg_LadybirdAdultMortalityRate("LADYBIRD_ADULT_MORTALITY_RATE", CFG_CUSTOM, 0.6)
The morality rate when the ladybird adult population is above the maximum allowed number.
Beetle_Base::GetInsecticideApplication
virtual double GetInsecticideApplication() const
the method overrides the method that returns the mortality due to insecticide application
Definition: Beetle_BaseClasses.h:367
fp_cu
Definition: Treatment.h:138
bulb_harvest
Definition: Treatment.h:122
preseeding_cultivator
Definition: Treatment.h:39
cfg_LadybirdMortalityTempStep
static CfgFloat cfg_LadybirdMortalityTempStep("LADYBIRD_MORTALITY_TEMP_STEP", CFG_CUSTOM, 5.0)
trial_control
Definition: Treatment.h:110
fp_npks
Definition: Treatment.h:51
CfgFloat::value
double value() const
Definition: Configurator.h:142
Ladybird_Population_Manager::DoLarvalDailyMortalityActions
void DoLarvalDailyMortalityActions(double a_atemptoday) override
Species specific actions to cope with temperature related laval mortality.
Definition: Ladybird_All.cpp:1105
cfg_LadybirdLarvaMovementThreshold
static CfgFloat cfg_LadybirdLarvaMovementThreshold("LADYBIRD_LARVAMOVEMENTTHRESHOLD", CFG_CUSTOM, 10.0)
Minimum temperature for larval movement.
burn_top
Definition: Treatment.h:143
fp_nk
Definition: Treatment.h:133
cfg_LadybirdMortalityTempMin
static CfgFloat cfg_LadybirdMortalityTempMin("LADYBIRD_MORTALITY_TEMP_MIN", CFG_CUSTOM, 10.0)
lobs_Larva1
Definition: Ladybird_All.h:66
burn_straw_stubble
Definition: Treatment.h:104
cfg_LadybirdAphidsToLayScaler
static CfgFloat cfg_LadybirdAphidsToLayScaler("LADYBIRD_APHIDSTOLAYSCALER", CFG_CUSTOM, 0.6)
Scaling parameter for prey levels above the threshold.
org_herbicide
Definition: Treatment.h:85
Beetle_Base::SetBeetleMap
static void SetBeetleMap(const int a_value, SimplePositionMapInt *a_map_ptr)
Set lifestage map.
Definition: Beetle_BaseClasses.h:334
cfg_LadybirdOvipositionPeriodStart
static CfgInt cfg_LadybirdOvipositionPeriodStart("LADYBIRD_OVIPOSITIONPERIODSTART", CFG_CUSTOM, May)
Oviposition period start.
Beetle_Population_Manager::m_AboveInflectionRates
vector< double > m_AboveInflectionRates
Day degree constant above inflection point for all non-adult stages.
Definition: Beetle_BaseClasses.h:1072
Ladybird_Adult::SetBackgroundMortTemp
static void SetBackgroundMortTemp(const vector< double > &a_vector)
Definition: Ladybird_All.h:313
fa_cu
Definition: Treatment.h:140
autumn_roll
Definition: Treatment.h:38
Population_Manager::m_LifeStageOrderVec
vector< int > m_LifeStageOrderVec
The vector to store the life stage order for looping specie life stages.
Definition: PopulationManager.h:808
strigling_hill
Definition: Treatment.h:117
heavy_cultivator_aggregate
Definition: Treatment.h:120
Ladybird_Larvae1::SetLadybirdLarvalPreyDevelParameters
static void SetLadybirdLarvalPreyDevelParameters(const vector< double > &a_array, int a_no_stages)
Set the larval per instar development factor, a function of aphid abundance.
Definition: Ladybird_All.cpp:338
Landscape::SupplyTempHour
double SupplyTempHour(int hour)
Returns the temperature in a given hour (0 to 23)
Definition: Landscape.h:2103
Population_Manager_Base::m_ListNameLength
int m_ListNameLength
the number of life-stages simulated in the population manager
Definition: PopulationManager.h:626
fp_manganesesulphate
Definition: Treatment.h:59
hay_turning
Definition: Treatment.h:100
Ladybird_Adult::SetOvipositionPeriod
static void SetOvipositionPeriod(const bool a_cond)
Definition: Ladybird_All.h:309
last_treatment
Definition: Treatment.h:150
straw_removal
Definition: Treatment.h:124
fa_n
Definition: Treatment.h:139
Ladybird_Adult::SetHibernationClumpeSizeDist
static void SetHibernationClumpeSizeDist(const vector< double > &a_dist)
Definition: Ladybird_All.h:311
shredding
Definition: Treatment.h:126
LadybirdToleTovs::LadybirdProhibitedTovsForMovementLarva
LadybirdTovParams LadybirdProhibitedTovsForMovementLarva
Definition: Ladybird_toletov.h:53
pheromone
Definition: Treatment.h:149
LadybirdToleTovs::LadybirdAggregationToles
LadybirdToleParams LadybirdAggregationToles
Definition: Ladybird_toletov.h:106
fp_n
Definition: Treatment.h:132
manual_weeding
Definition: Treatment.h:148
fa_npk
Definition: Treatment.h:67
Population_Manager_Base::m_TheLandscape
Landscape * m_TheLandscape
holds an internal pointer to the landscape
Definition: PopulationManager.h:624
lobs_Larva3
Definition: Ladybird_All.h:68
winter_plough
Definition: Treatment.h:42
cfg_MaxShortRangeAttempts
static CfgInt cfg_MaxShortRangeAttempts("LADYBIRD_SHORTMOVESALLOWED", CFG_CUSTOM, 4)
For each short-range move, the number of squares assessed at this location for aphids before admittin...
fp_calcium
Definition: Treatment.h:65
Ladybird_Larvae4
Class for beetle larval stage 3, most functionality is in Beetle_Larvae.
Definition: Ladybird_All.h:240
spring_harrow
Definition: Treatment.h:45
Ladybird_Adult::SetShortRangeDistToday
static void SetShortRangeDistToday(const int a_value)
Definition: Ladybird_All.h:314
cut_to_silage
Definition: Treatment.h:98
cfg_LadybirdMortalityScaler
CfgFloat cfg_LadybirdMortalityScaler("LADYBIRD_ADULTMORTALTISCALER", CFG_CUSTOM, 0.01)
Scaler for mortaltity of adults with temperature.
Population_Manager::m_AOR_Probe
AOR_Probe * m_AOR_Probe
A pointer to the AOR probe.
Definition: PopulationManager.h:875
Ladybird_Adult
Definition: Ladybird_All.h:268
cfg_LadybirdStagesNutritionalValue
static CfgArray_Int cfg_LadybirdStagesNutritionalValue("LADYBIRD_STAGES_NUTRIONAL_VALUE", CFG_CUSTOM, 7, vector< int >{1, 10, 30, 80, 120, 140, 160 })
The nutritional value in aphids of ladybird lifestages when cannibalised.
cfg_LadybirdEggTemperatureMortality
static CfgArray_Double cfg_LadybirdEggTemperatureMortality("LADYBIRD_EGG_TEMPERATURE_MORTALTIY", CFG_CUSTOM, 10, vector< double >{ 0.3723, 0.222525, 0.1136, 0.045525, 0.0183, 0.031925, 0.0864, 0.181725, 0.3179, 0.494925 })
The temperature related mortality of Ladybird eggs.
Beetle_Adult::SetAdultMaxMoveDist
static void SetAdultMaxMoveDist(const int a_value)
Set the max move distance for dispersal.
Definition: Beetle_BaseClasses.h:828
fa_sludge
Definition: Treatment.h:77
pigs_out
Definition: Treatment.h:96
cfg_LadybirdExtremeTempMortChance
static CfgFloat cfg_LadybirdExtremeTempMortChance("LADYBIRD_EXTREME_TEMP_MORT_CHANCE", CFG_CUSTOM, 0.25)
fp_p
Definition: Treatment.h:54
AOR_Probe::DoProbe
virtual void DoProbe(int a_lifestage)
Definition: AOR_Probe.cpp:104
suckering
Definition: Treatment.h:130
cut_to_hay
Definition: Treatment.h:97
fa_boron
Definition: Treatment.h:141
cfg_LadybirdMaximumFlightLength
static CfgInt cfg_LadybirdMaximumFlightLength("LADYBIRD_MAXIMUMFLIGHTLENGTH", CFG_CUSTOM, 500)
Minimum distance for long-range flight in m.
Beetle_Larvae::SetLarvalDailyMort
static void SetLarvalDailyMort(const vector< double > &a_value, const int a_numLarvalStages, const int a_catagories)
Set the daily fixed mortality probability based on the larval stages and temperature.
Definition: Beetle_BaseClasses.h:582
Landscape::SupplySimAreaHeight
int SupplySimAreaHeight(void)
Gets the simulation landscape height.
Definition: Landscape.h:2302
Landscape::SupplySimAreaWidth
int SupplySimAreaWidth(void)
Gets the simulation landscape width.
Definition: Landscape.h:2297
fa_k
Definition: Treatment.h:70
spring_roll
Definition: Treatment.h:46
lobs_Larva4
Definition: Ladybird_All.h:69
Beetle_Population_Manager::m_TemperatureCategory
int m_TemperatureCategory
Storage for the temperature category today.
Definition: Beetle_BaseClasses.h:1048
Beetle_Population_Manager::m_MortalityTempMin
double m_MortalityTempMin
hreshold temperatures for mortalities: Min
Definition: Beetle_BaseClasses.h:1044
TAnimal::Supply_m_Location_y
int Supply_m_Location_y() const
Returns the ALMaSS y-coordinate.
Definition: PopulationManager.h:243
syninsecticide_treat
Definition: Treatment.h:111
lobs_Egg
Definition: Ladybird_All.h:65
fp_nc
Definition: Treatment.h:135
LadybirdToleParams::getList
TToleList getList()
Definition: Ladybird_toletov.cpp:15
fungicide_treat
Definition: Treatment.h:82
cfg_LadybirdLarvaeMoveStep
static CfgInt cfg_LadybirdLarvaeMoveStep("LADYBIRD_LARVAE_MOVE_MAX", CFG_CUSTOM, 4)
the number meters possible to move each day for larvae
cfg_LadybirdMovementProportion
static CfgFloat cfg_LadybirdMovementProportion("LADYBIRD_MOVEMENTPROPORTION", CFG_CUSTOM, 0.71)
Proportion of time spend moving.
fp_sludge
Definition: Treatment.h:63
fp_greenmanure
Definition: Treatment.h:62
shallow_harrow
Definition: Treatment.h:119
fa_slurry
Definition: Treatment.h:72
cattle_out_low
Definition: Treatment.h:112
harvest_bushfruit
Definition: Treatment.h:137
preseeding_cultivator_sow
Definition: Treatment.h:40
fp_pk
Definition: Treatment.h:53
Beetle_Base::GetHarvestMortality
virtual double GetHarvestMortality() const
the method overrides the method that returns the mortality due to harvest
Definition: Beetle_BaseClasses.h:369
fa_pks
Definition: Treatment.h:145
cfg_LadybirdMortalityTempMax
static CfgFloat cfg_LadybirdMortalityTempMax("LADYBIRD_MORTALITY_TEMP_MAX", CFG_CUSTOM, 35.0)
cfg_LadybirdExtremeTempMax
static CfgFloat cfg_LadybirdExtremeTempMax("LADYBIRD_EXTREME_TEMP_MAX", CFG_CUSTOM, 40.0)
org_fungicide
Definition: Treatment.h:86
Beetle_Population_Manager::m_BeetleLarvalStagesNum
int m_BeetleLarvalStagesNum
Definition: Beetle_BaseClasses.h:1058
summer_harrow
Definition: Treatment.h:49
cfg_LadybirdLarvalMortCategories
static CfgInt cfg_LadybirdLarvalMortCategories("LADYBIRD_LARVALMORTCATEGORIES", CFG_CUSTOM, 10)
The number of temperature categoris to consider for larval mortality with temperature.
cattle_out
Definition: Treatment.h:95
harvestshoots
Definition: Treatment.h:147
stubble_cultivator_heavy
Definition: Treatment.h:36
Beetle_Population_Manager::DoFirst
void DoFirst() override
Does day degree development calculations here.
Definition: Beetle_BaseClasses.cpp:1563
Beetle_Egg_List::SetDailyEggMort
static void SetDailyEggMort(const double a_value)
Set the daily fixed mortality probability.
Definition: Beetle_BaseClasses.h:446
Beetle_Base::SetTodaysTempCategory
static void SetTodaysTempCategory(int a_category)
Set the soil temperature category used for calculatiung mortality steps.
Definition: Beetle_BaseClasses.h:312
Population_Manager::m_is_paralleled
bool m_is_paralleled
This is used to indicate whether the species is paralleled.
Definition: PopulationManager.h:796
Ladybird_Larvae1
Definition: Ladybird_All.h:164
biocide
Definition: Treatment.h:116
swathing
Definition: Treatment.h:93
glyphosate
Definition: Treatment.h:114
Ladybird_Population_Manager::m_LadybirdAggregationToles
TToleList m_LadybirdAggregationToles
the types of landscape that are aggregation targets
Definition: Ladybird_All.h:426
Ladybird_Population_Manager::m_LadybirdProhibitedTovsForMovementLarva
TTovList m_LadybirdProhibitedTovsForMovementLarva
Uses the open cannibalisations events list to remove beetles.
Definition: Ladybird_All.h:413
cfg_LadybirdMovementRatePerT
static CfgFloat cfg_LadybirdMovementRatePerT("LADYBIRD_MOVEMENTRATEPERT", CFG_CUSTOM, 0.0325)
rate of movement in m/min/T
CfgInt::value
int value() const
Definition: Configurator.h:116
Ladybird_Population_Manager::m_LadybirdLarvaCanMove_bool
bool m_LadybirdLarvaCanMove_bool
minimum temperature that larva can move at
Definition: Ladybird_All.h:488
Ladybird_Larvae1::SetLadybirdLarvaeMoveStep
static void SetLadybirdLarvaeMoveStep(const int a_value)
Definition: Ladybird_All.h:194
fa_manure
Definition: Treatment.h:75
CfgArray_Double::value
std::vector< double > value() const
Definition: Configurator.h:219
spring_sow
Definition: Treatment.h:47
Beetle_Population_Manager::m_MortalityTempStep
double m_MortalityTempStep
Threshold temperatures for mortalities: Step size.
Definition: Beetle_BaseClasses.h:1042
cut_weeds
Definition: Treatment.h:106
trial_toxiccontrol
Definition: Treatment.h:109
summer_plough
Definition: Treatment.h:48
Beetle_Population_Manager::m_MortalityTempMax
double m_MortalityTempMax
Threshold temperatures for mortalities: Max.
Definition: Beetle_BaseClasses.h:1046
Ladybird_Adult::SetAphidsPerPreyLevel
static void SetAphidsPerPreyLevel(const int a_value)
Definition: Ladybird_All.h:310
Beetle_Population_Manager::PestMortLocOutputOpen
static void PestMortLocOutputOpen()
Annual pesticide mortality output file open.
Struct_Beetle
A data class for Beetle data.
Definition: Beetle_BaseClasses.h:125
fp_pks
Definition: Treatment.h:146
cfg_Ladybird_DevelopmentInflectionPoints
static CfgArray_Double cfg_Ladybird_DevelopmentInflectionPoints("LADYBIRD_DEVELOPMENTINFLECTIONPOINTS", CFG_CUSTOM, 7, vector< double >{ 9999.0, 9999.0, 9999.0, 9999.0, 9999.0, 9999.0, 9999.0 })
fp_ns
Definition: Treatment.h:134
TOP_Ladybird
Definition: PopulationManager.h:76
bed_forming
Definition: Treatment.h:118
product_treat
Definition: Treatment.h:113
Ladybird_Population_Manager::m_LadybirdToleTovs
LadybirdToleTovs m_LadybirdToleTovs
Class holding all the tole tov related information - for tidyness.
Definition: Ladybird_All.h:397
Ladybird_Population_Manager::GetTempMortRange
int GetTempMortRange(double a_temp) const
Gets the temperature category for mortality calculations.
Definition: Ladybird_All.cpp:1113
lobs_Larva2
Definition: Ladybird_All.h:67
Ladybird_Larvae1::SetLadybirdLarvaeMoveMax
static void SetLadybirdLarvaeMoveMax(const int a_value)
Definition: Ladybird_All.h:192
cfg_LadybirdAdultTemperatureMortalityParams
static CfgArray_Double cfg_LadybirdAdultTemperatureMortalityParams("LADYBIRD_ADULT_TEMPERATURE_MORTALTIY", CFG_CUSTOM, 36, vector< double >{0.034, -0.0028, 0.00007, 0.116, -0.0091, 0.0002, 0.094, -0.007, 0.00019, 0.68, -0.0553, 0.00118, 0.67, -0.0533, 0.00118, 1.468, -0.1172, 0.00249, 1.504, -0.1213, 0.00268, 1.807, -0.075, 0.00132, 2.256, -0.1791, 0.00392, 2.788, -0.2217, 0.00484, 3.836, -0.3095, 0.00672, 5.358, -0.4202, 0.00887 })
Parameters for each age class of adult, 3 params x 12 age classes, used to calculate temperature rela...
autumn_sow
Definition: Treatment.h:41
Beetle_Population_Manager::m_InCropNo
int m_InCropNo
In-crop counter.
Definition: Beetle_BaseClasses.h:1119
autumn_harrow
Definition: Treatment.h:37
fa_calcium
Definition: Treatment.h:79
Ladybird_Population_Manager::m_LadybirdProhibitedTolesForMovement
TToleList m_LadybirdProhibitedTolesForMovement
the types of landscape that are prohibited for ladybirds
Definition: Ladybird_All.h:424
LadybirdToleTovs::LadybirdProhibitedToles
LadybirdToleParams LadybirdProhibitedToles
Definition: Ladybird_toletov.h:39
Beetle_Population_Manager::m_DevelopmentInflectionPoints
vector< double > m_DevelopmentInflectionPoints
Inflection point in day degree calculations for non-adult stages.
Definition: Beetle_BaseClasses.h:1070
fa_ammoniumsulphate
Definition: Treatment.h:74
Population_Manager::PartitionLiveDead
virtual unsigned PartitionLiveDead(unsigned Type)
Definition: PopulationManager.cpp:1181
Population_Manager_Base::m_SimulationName
string m_SimulationName
stores the simulation name
Definition: PopulationManager.h:622
Beetle_Base::SetMaxShortRangeAttempts
static void SetMaxShortRangeAttempts(const int a_value)
Definition: Beetle_BaseClasses.h:326
cfg_LadybirdAphidsToLay
static CfgInt cfg_LadybirdAphidsToLay("LADYBIRD_APHIDSTOLAY", CFG_CUSTOM, 100)
The density of aphids per m2 threshold for egg laying.
autumn_sow_with_ferti
Definition: Treatment.h:136
trial_insecticidetreat
Definition: Treatment.h:108
fa_p
Definition: Treatment.h:69
mow
Definition: Treatment.h:105
Ladybird_Larvae2
Class for beetle larval stage 2, most functionality is in Beetle_Larvae.
Definition: Ladybird_All.h:214
CfgArray_Int::value
std::vector< int > value() const
Definition: Configurator.h:201
cfg_LadybirdDailyOvipostionRateTemp
static CfgArray_Double cfg_LadybirdDailyOvipostionRateTemp("LADYBIRD_DAILYOVIPOSTIONRATETEMP", CFG_CUSTOM, 51, vector< double > {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.25257852, 1.089359927, 2.556140369, 4.665581149, 7.404402116, 10.73055526, 14.56924629, 18.80995871, 23.30578578, 27.87607539, 32.31308909, 36.39294043, 39.89049046, 42.59718429, 44.34011106, 45, 44.52558091, 42.94187052, 40.35056184, 36.92175576, 32.87762782, 28.47001231, 23.95500656, 19.56827291, 15.50458074, 11.90429029, 8.84812057, 6.359987945, 4.416318306, 2.959328634, 1.911502299, 1.188820974, 0.711084746, 0.408588017, 0.22526765, 0.119026759, 0.060200647, 0.029109965, 0.013441098 })
Oviposition rate per day under perfect food with temps 0-50 degrees.
Beetle_Population_Manager::m_StageProductionProduction
vector< int > m_StageProductionProduction
Testing/Output attribute holding the number of larvae produced today.
Definition: Beetle_BaseClasses.h:1060
Population_Manager::m_guard_cell_size
int m_guard_cell_size
Definition: PopulationManager.h:793
fa_rsm
Definition: Treatment.h:78
g_random_fnc
int g_random_fnc(const int a_range)
Definition: ALMaSS_Random.cpp:74
cfg_LadybirdLarvalTemperatureMortality
static CfgArray_Double cfg_LadybirdLarvalTemperatureMortality("LADYBIRD_LARVAL_TEMPERATURE_MORTALTIY", CFG_CUSTOM, 40, vector< double >{ 0.3393, 0.215525, 0.1277, 0.075825, 0.0599, 0.079925, 0.1359, 0.227825, 0.3557, 0.519525, 0.097, 0.063225, 0.0411, 0.030625, 0.0318, 0.044625, 0.0691, 0.105225, 0.153, 0.212425, 0.0393, 0.020475, 0.0113, 0.011775, 0.0219, 0.041675, 0.0711, 0.110175, 0.1589, 0.217275, 0.0107, 0.00675, 0.0069, 0.01115, 0.0195, 0.03195, 0.0485, 0.06915, 0.0939, 0.12275 })
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
fa_npks
Definition: Treatment.h:66
water
Definition: Treatment.h:92
stubble_harrowing
Definition: Treatment.h:102
Ladybird_Population_Manager::m_AphidPopulationManagerPtrList
std::vector< Aphid_Population_Manager * > m_AphidPopulationManagerPtrList
The pointer to aphid population manager.
Definition: Ladybird_All.h:390
cfg_BeetleLarvalStagesNum
CfgInt cfg_BeetleLarvalStagesNum
The number of larval stages for this species.
Beetle_Base
The base class for all beetles.
Definition: Beetle_BaseClasses.h:150
Beetle_Population_Manager::m_OffFieldNo
int m_OffFieldNo
Off-field counter.
Definition: Beetle_BaseClasses.h:1121
cfg_LadybirdFlyingThreshTemp
static CfgFloat cfg_LadybirdFlyingThreshTemp("LADYBIRD_FLYINGTHRESHTEMP", CFG_CUSTOM, 15.0)
The temperature at which the flight is possible.
fp_liquidNH3
Definition: Treatment.h:57
molluscicide
Definition: Treatment.h:87
Population_Manager::PushIndividual
void PushIndividual(const unsigned a_listindex, TAnimal *a_individual_ptr)
Definition: PopulationManager.cpp:1682
hay_bailing
Definition: Treatment.h:101
Ladybird_Population_Manager::DoEggDailyMortalityActions
void DoEggDailyMortalityActions(double a_atemptoday) override
Species specific actions to cope with temperature related egg mortality.
Definition: Ladybird_All.cpp:1101
fa_manganesesulphate
Definition: Treatment.h:73
Ladybird_Adult::SetOvipositionRateTemp
static void SetOvipositionRateTemp(const vector< double > &a_dist)
Definition: Ladybird_All.h:312
lobs_Adult
Definition: Ladybird_All.h:71
start
Definition: Treatment.h:32
cfg_LadybirdLarvalPreyDevelParameters
static CfgArray_Double cfg_LadybirdLarvalPreyDevelParameters("LADYBIRD_LARVAL_PREY_DEVEL_PARAMETERS", CFG_CUSTOM, 4 *4, vector< double > { 50.0, 2.572, -0.0689, 0.0008, 50.0, 2.2134, -0.0608, 0.0008, 80.0, 2.612, -0.0448, 0.0003, 120.0, 1.8777, -0.0144, 0.00006 })
The 2nd order polynomial parameters and max aphids per instar.
Population_Manager::TheSubArrays
vector< vector< forward_list< TAnimal * > * > > TheSubArrays
Hold all the animal pointers.
Definition: PopulationManager.h:804
fp_k
Definition: Treatment.h:55
Landscape::Warn
void Warn(std::string a_msg1, std::string a_msg2)
Wrapper for the g_msg Warn function.
Definition: Landscape.h:2250
Calendar::JanFirst
bool JanFirst(void)
Definition: Calendar.h:79
Beetle_Base::GetStriglingMortality
virtual double GetStriglingMortality() const
Mortality by Strigling: similar for all forms– should use base class method.
Definition: Beetle_BaseClasses.h:363
autumn_plough
Definition: Treatment.h:34
cfg_LadybirdMaxAdultNumber
CfgFloat cfg_LadybirdMaxAdultNumber("LADYBIRD_MAX_ADULT_NUMBER", CFG_CUSTOM, 400000.0)
The maximum ladybird adult number allowed.
Ladybird_Population_Manager::CalculateDailyEggProduction
void CalculateDailyEggProduction(double a_temptoday) override
Figure out the maximum number of eggs that can be laid today - must be overridden in descendent class...
Definition: Ladybird_All.h:417
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
Beetle_Base::GetSoilCultivationMortality
virtual double GetSoilCultivationMortality() const
the method overrides the method that returns the mortality due to soil cultivation
Definition: Beetle_BaseClasses.h:365
fp_slurry
Definition: Treatment.h:58
fiber_covering
Definition: Treatment.h:128
cfg_ladybirdStartNos
static CfgInt cfg_ladybirdStartNos("LADYBIRD_STARTNO", CFG_CUSTOM, 200)
lobs_Foobar
Definition: Ladybird_All.h:72
cfg_LadybirdOvipositionPeriodEnd
static CfgInt cfg_LadybirdOvipositionPeriodEnd("LADYBIRD_OVIPOSITIONPERIODEND", CFG_CUSTOM, September)
Oviposition period end.
summer_sow
Definition: Treatment.h:50
Population_Manager::m_LiveArraySize
vector< unsigned > m_LiveArraySize
Definition: PopulationManager.h:786
tobs_Hibernating
Definition: Beetle_BaseClasses.h:70
Ladybird_Population_Manager::m_EggTemperatureMortality
vector< double > m_EggTemperatureMortality
Storage for the temperature related mortality for eggs.
Definition: Ladybird_All.h:393
spring_sow_with_ferti
Definition: Treatment.h:115
Ladybird_Population_Manager::m_LadybirdLarvaMovementThreshold
double m_LadybirdLarvaMovementThreshold
minimum temperature that larva can move at
Definition: Ladybird_All.h:486
Beetle_Base::StDie
virtual void StDie()
Common state Die.
Definition: Beetle_BaseClasses.cpp:308
sleep_all_day
Definition: Treatment.h:33
strigling_sow
Definition: Treatment.h:107
Beetle_Population_Manager::m_DayDegs
vector< std::array< double, 365 > > m_DayDegs
Storage for daily day degrees for non-adult stages.
Definition: Beetle_BaseClasses.h:1052
Population_Manager::IncLiveArraySize
void IncLiveArraySize(int a_listindex)
Increments the number of 'live' objects for a list index in the TheArray.
Definition: PopulationManager.h:665