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

The class to handle all Osmia bee population related matters. More...

#include <Osmia_Population_Manager.h>

Inheritance diagram for Osmia_Population_Manager:
Population_Manager Population_Manager_Base

Public Member Functions

 Osmia_Population_Manager (Landscape *L)
 Osmia_Population_Manager Constructor. More...
 
void Init ()
 Used to collect data initialisation together. More...
 
virtual ~Osmia_Population_Manager (void)
 Osmia_Population_Manager Destructor. More...
 
void TheAOROutputProbe () override
 Output method. More...
 
void CreateObjects (TTypeOfOsmiaLifeStages ob_type, TAnimal *pvo, struct_Osmia *data, int number)
 Method for creating a new individual Osmia. More...
 
bool IsEndPreWinter ()
 Returns flag to denore the end of prewintering, if ended it is set to true. More...
 
bool IsOverWinterEnd ()
 Returns flag to denore the end of overwintering, if ended it is set to true. More...
 
bool IsOsmiaNestPossible (int a_polyindex)
 Checks whether a nest is possible here. More...
 
bool SantityCheck (int a_polyindex)
 Checks whether a nest is possible here. More...
 
Osmia_NestCreateNest (int a_x, int a_y, int a_polyindex)
 Creates an Osmia_Nest in the polygon referenced by the index polyindex. More...
 
void ReleaseOsmiaNest (int a_polyindex, Osmia_Nest *a_nest)
 Release the given nest in the given polygon. More...
 
int GetForageHours ()
 Return the Osmia flying weather hours. More...
 
double GetProvisioningParams (int a_age)
 Returns the values of provisioning parameters for a adult age. More...
 
double GetFirstCocoonProvisioningMass (int a_age, int a_massclass)
 Return the first cocoon mass for a nest give an age and female mass. More...
 
double GetSexRatioEggsAgeMass (int a_massclass, int a_age)
 Return the sex ratio for a nest give an age and female mass. More...
 
int AddToDensityGrid (APoint a_loc)
 Adds a bee to the density grid at a location. More...
 
void AddToDensityGrid (int a_index)
 Adds a bee to the density grid using the grid index value. More...
 
void RemoveFromDensityGrid (int a_index)
 Adds a bee to the density grid using the grid index value. More...
 
int GetDensity (APoint a_loc)
 Gets the number of bees at a location. More...
 
int GetDensity (int a_index)
 Gets the number of bees at a location based on the grid index value. More...
 
void ClearDensityGrid ()
 Empties the bee density grid. More...
 
double GetPrePupalDevelDays ()
 Returns the amount of development a pre-pupal bee will get today based on temperature. More...
 
void CalForageHours (void)
 
- 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...
 
void OpenTheAOROutputProbe (const string &a_AORFilename) override
 Opens the AOR output file. More...
 
unsigned GetLiveArraySize (int a_listindex) override
 Gets the number of 'live' objects for a list index in the TheArray. More...
 
unsigned GetPopulationSize (int a_listindex) override
 Gets the number of species objects by default it is the same as LiveArray, however it could be different. This function should be used/overriden when we are interested in the number of the objects for presentation and not in inner maintenance of the PopulationManager and or 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 unsigned Probe (int ListIndex, Probe_Data *p_TheProbe)
 
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 ()
 
virtual void TheRipleysOutputProbe (ofstream *a_prb)
 Special output functionality. More...
 
virtual void TheReallyBigOutputProbe ()
 
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...
 
virtual double GetAphidDensity (int, int)
 Return the aphid density, it is only used when aphid simulations are running. More...
 

Protected Member Functions

virtual void DoFirst ()
 Things to do before anything else at the start of a timestep
More...
 
virtual void DoBefore ()
 Things to do before the Step. More...
 
virtual void DoAfter ()
 Things to do before the EndStep. More...
 
virtual void DoLast ()
 Things to do after the EndStep - here calculations related to summing global day degrees. More...
 
- Protected Member Functions inherited from Population_Manager
virtual bool StepFinished ()
 Methods to run the simulations. More...
 
virtual void DoSpecialBetweenLifeStages (int a_life_stage)
 
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)
 
virtual void Catastrophe ()
 
- Protected Member Functions inherited from Population_Manager_Base
 ~Population_Manager_Base ()=default
 

Protected Attributes

PollenMap_centroidbased * m_ThePollenMap
 A pointer to the pollen map object. More...
 
int m_FlyingWeather
 A daily value to indicate the hours the weather is OK for Osmia adult activity. More...
 
bool m_PreWinteringEndFlag
 
bool m_OverWinterEndFlag
 
Osmia_Nest_Manager m_OurOsmiaNestManager
 This provides the interface to the Osmia_Nests linked to the polgons. More...
 
double m_NestProvisioningParameters [365]
 A lookup table used to store pre-calculated nest provisioning parameters in advance since they are CPU intensive. More...
 
vector< eggsexratiovsagelogisticcurvedatam_EggSexRatioEqns
 Holds logistic equation values per age/mass of female for egg sex ratios. More...
 
vector< femalecocoonmassvsagelogisticcurvedatam_FemaleCocoonMassEqns
 Holds logistic equation values per age/mass of female for first female cocoon mass. More...
 
vector< int > m_FemaleDensityGrid
 holds numbers of females per 1km2 More...
 
int m_GridExtent
 holds numbers of grid cells per row More...
 
double m_PollenCompetitionsReductionScaler
 An attribute used to scale the available pollen based on assumed competetion from other bee species. More...
 
vector< double > m_PrePupalDevelRates
 Holds the prepupal development rates for fast access. More...
 
double m_PrePupalDevelDaysToday
 Holds the prepupal development rates for today for fast access. More...
 
vector< OsmiaPollenNectarThresholdsm_PN_thresholds
 Holds a list of pollen and nectar thresholds, one for each month. 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...
 

Static Protected Attributes

static probability_distribution m_exp_ZeroTo1 = probability_distribution("BETA", "0.75,2.5")
 Static instance of the probability_distribution class of distance probabilities for approx exponential probs zero to 1.0. More...
 

Additional Inherited Members

- 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...
 

Detailed Description

The class to handle all Osmia bee population related matters.

Constructor & Destructor Documentation

◆ Osmia_Population_Manager()

Osmia_Population_Manager::Osmia_Population_Manager ( Landscape L)

Osmia_Population_Manager Constructor.

Loads the list of Animal Classes.

254  : Population_Manager(L, 6)
255 {
257  m_ListNames[0] = "Egg"; // from egg laying to the beginning of feeding
258  m_ListNames[1] = "Larva"; // larval development + cocoon spinning
259  m_ListNames[2] = "Prepupa"; // the summer diapause period
260  m_ListNames[3] = "Pupa";
261  m_ListNames[4] = "In Cocoon"; // fully developed adults remaining within cocoons (includes overwintering period)
262  m_ListNames[5] = "Female";
263  m_ListNameLength = 6;
264  m_SimulationName = "Osmia";
265  // Init performs intialisation of the data to run the Osmia model
266  Init();
267  // Set up neccessary conditions for mid-lifecycle start
268  m_PreWinteringEndFlag = true;
269  m_OverWinterEndFlag = false;
270 
271 
272  // Get all the polygon that is suitable for osmia nesting
273  std::vector<int> suitable_polygons;
275  int num_poly = m_TheLandscape->SupplyNumberOfPolygons();
276  for (int i = 0; i < num_poly; i++)
277  {
278  if (IsOsmiaNestPossible(i))
279  {
280  suitable_polygons.push_back(i);
281  }
282  }
283 
284  int num_poly_for_nesting = suitable_polygons.size();
285 
286  // Create some animals
287  int temp_thread_num = omp_get_max_threads();
288  int start_num_in_thread = (cfg_OsmiaStartNo.value() / temp_thread_num +1);
289  #pragma omp parallel
290  {
291  for (int i = 0; i < start_num_in_thread; i++) // This will need to be an input variable (config)
292  {
293  struct_Osmia* sp;
294  sp = new struct_Osmia;
295  sp->OPM = this;
296  sp->L = m_TheLandscape;
297  double minmass =(cfg_OsmiaFemaleMassMin.value() - 4) / 0.25;
298  double maxmass = (cfg_OsmiaFemaleMassMax.value() - 4) / 0.25;
299  sp->mass = minmass + (maxmass - minmass) * g_rand_uni_fnc();
301  sp->sex = true;
302 
303  //first find a suitable polygon randomly
304  int pindex = suitable_polygons[g_random_fnc(num_poly_for_nesting)];
305  APoint temp_point = m_TheLandscape->SupplyARandomLocPoly(pindex);
306  sp->x = temp_point.m_x;
307  sp->y = temp_point.m_y;
308  sp->nest = CreateNest(sp->x, sp->y, pindex);
310  //sp->nest->AddEgg(NULL);
312  delete sp;
313  }
314  }
315  for (unsigned co = 0; co<unsigned(SupplyListSize(int(TTypeOfOsmiaLifeStages::to_OsmiaInCocoon))); co++)
316  {
317  dynamic_cast<Osmia_InCocoon*>(SupplyAnimalPtr(int(TTypeOfOsmiaLifeStages::to_OsmiaInCocoon),co))->SetAgeDegrees(2000);
318  }
319  // Store the competition scaler for faster access
321  // Store prepal development rates for faster access
322  m_PrePupalDevelRates.resize(42);
323  for (int i = 0; i < 42; i++) m_PrePupalDevelRates[i] = cfg_OsmiaPrepupalDevelRates.value(i);
324  //PartitionLiveDead(int(TTypeOfOsmiaLifeStages::to_OsmiaInCocoon));
325  m_is_paralleled = true; // Osmia is always parallel
326 
327  //reset the pesticide files
328  #ifdef __OSMIA_PESTICIDE_STORE
329  ofstream oversprayfile("osmia_overspray.txt", ios::trunc);
330  oversprayfile << "Year" << '\t' << "Day" << '\t' << "Female ID" << "(application rate: "<<cfg_pest_product_amounts.value(0)<<"g/ha)"<<endl;
331  oversprayfile.close();
332 
333  ofstream contactfile("osmia_contact.txt", ios::trunc);
334  contactfile << "Year" << '\t' << "Day" << '\t' << "Female ID" << '\t' << "Pesticide(g/m2)" << endl;
335  contactfile.close();
336 
337  ofstream intakefile("osmia_pest_intake.txt", ios::trunc);
338  intakefile << "Year" << '\t' << "Day" << '\t' << "Female ID" << '\t' << "Pesticide(g)" << '\t' << "Sugar(g)" << endl;
339  intakefile.close();
340 
341  #endif
342 }

References cfg_OsmiaDensityDependentPollenRemovalConst, cfg_OsmiaFemaleMassMax, cfg_OsmiaFemaleMassMin, cfg_OsmiaOverwinterDegreeDaysInitialSimu, cfg_OsmiaPrepupalDevelRates, cfg_OsmiaStartNo, cfg_pest_product_amounts, CreateNest(), CreateObjects(), g_rand_uni_fnc(), g_random_fnc(), Init(), IsOsmiaNestPossible(), struct_Osmia::L, Population_Manager::m_is_paralleled, Population_Manager_Base::m_ListNameLength, Population_Manager_Base::m_ListNames, m_OurOsmiaNestManager, m_OverWinterEndFlag, m_PollenCompetitionsReductionScaler, m_PrePupalDevelRates, m_PreWinteringEndFlag, Population_Manager_Base::m_SimulationName, Population_Manager_Base::m_TheLandscape, APoint::m_x, APoint::m_y, struct_Osmia::mass, struct_Osmia::nest, struct_Osmia::OPM, struct_Osmia::overwintering_degree_days, struct_Osmia::parasitised, struct_Osmia::sex, Population_Manager::SupplyAnimalPtr(), Landscape::SupplyARandomLocPoly(), Population_Manager::SupplyListSize(), Landscape::SupplyNumberOfPolygons(), to_OsmiaInCocoon, topara_Unparasitised, Osmia_Nest_Manager::UpdateOsmiaNesting(), CfgInt::value(), CfgFloat::value(), CfgArray_Double::value(), struct_Osmia::x, and struct_Osmia::y.

◆ ~Osmia_Population_Manager()

Osmia_Population_Manager::~Osmia_Population_Manager ( void  )
virtual

Osmia_Population_Manager Destructor.

239 {
240 // delete m_PollenNectarLists;
241 #ifdef __OSMIATESTING
242  delete m_female_weight_record_lock;
243  m_eggsfirstnest.close();
244  ofstream ofile("EggsDistributions.txt", ios::out);
245  for (int i = 0; i < 30; i++)
246  {
247  ofile << m_egghistogram[0][i] << '\t' << m_egghistogram[1][i] << '\t' << m_egghistogram[2][i] << '\t' << m_egghistogram[3][i] << endl;
248  }
249  ofile.close();
250 #endif // __OSMIATESTING
251 }

Member Function Documentation

◆ AddToDensityGrid() [1/2]

int Osmia_Population_Manager::AddToDensityGrid ( APoint  a_loc)
inline

Adds a bee to the density grid at a location.

450  {
451  int index = (a_loc.m_x / 1000) + (a_loc.m_y / 1000) * m_GridExtent;
452  m_FemaleDensityGrid[index]++;
453  return index;
454  }

References m_FemaleDensityGrid, m_GridExtent, APoint::m_x, and APoint::m_y.

◆ AddToDensityGrid() [2/2]

void Osmia_Population_Manager::AddToDensityGrid ( int  a_index)
inline

Adds a bee to the density grid using the grid index value.

457  {
458  m_FemaleDensityGrid[a_index]++;
459  }

References m_FemaleDensityGrid.

◆ CalForageHours()

void Osmia_Population_Manager::CalForageHours ( void  )
613  {
614  //set it to zero first
615  m_FlyingWeather = 0;
616  int sunrise_time = g_date->SunRiseTime()/60;
617  int sunset_time = g_date->SunSetTime()/60;
618  for (int i = sunrise_time; i<=sunset_time; i++ ){
622  m_FlyingWeather += 1.0;
623  }
624  }
625  }
626  }
627 }

References cfg_OsmiaMaxPrecipForFlying, cfg_OsmiaMaxWindSpeedForFlying, cfg_OsmiaMinTempForFlying, g_date, g_weather, Weather::GetRainHour(), Weather::GetTempHour(), Weather::GetWindHour(), m_FlyingWeather, Calendar::SunRiseTime(), Calendar::SunSetTime(), and CfgFloat::value().

Referenced by DoFirst().

◆ ClearDensityGrid()

void Osmia_Population_Manager::ClearDensityGrid ( )
inline

Empties the bee density grid.

478  {
479  for (int i=0; i< m_FemaleDensityGrid.size(); i++) m_FemaleDensityGrid[i] = 0;
480  }

References m_FemaleDensityGrid.

Referenced by DoFirst(), and Init().

◆ CreateNest()

Osmia_Nest* Osmia_Population_Manager::CreateNest ( int  a_x,
int  a_y,
int  a_polyindex 
)
inline

Creates an Osmia_Nest in the polygon referenced by the index polyindex.

418  {
419  Osmia_Nest* return_nest_ptr;
420  m_TheLandscape->SetPolygonLock(a_polyindex);
421  return_nest_ptr = m_OurOsmiaNestManager.CreateNest(a_x, a_y, a_polyindex);
422  m_TheLandscape->ReleasePolygonLock(a_polyindex);
423  return return_nest_ptr;
424  }

References Osmia_Nest_Manager::CreateNest(), m_OurOsmiaNestManager, Population_Manager_Base::m_TheLandscape, Landscape::ReleasePolygonLock(), and Landscape::SetPolygonLock().

Referenced by Osmia_Female::FindNestLocation(), and Osmia_Population_Manager().

◆ CreateObjects()

void Osmia_Population_Manager::CreateObjects ( TTypeOfOsmiaLifeStages  ob_type,
TAnimal pvo,
struct_Osmia data,
int  number 
)

Method for creating a new individual Osmia.

492  {
493  Osmia_Egg* new_Osmia_Egg;
494  Osmia_Larva* new_Osmia_Larva;
495  Osmia_Prepupa* new_Osmia_Prepupa;
496  Osmia_Pupa* new_Osmia_Pupa;
497  Osmia_InCocoon* new_Osmia_InCocoon;
498  Osmia_Female* new_Osmia_Female;
499 #ifdef __RECORDOSMIAEGGPRODUCTION
500  if (os_type == TTypeOfOsmiaLifeStages::to_OsmiaEgg) RecordEggProduction(number);
501 #endif
502  for (int i = 0; i < number; i++) {
503  switch (os_type) {
505  new_Osmia_Egg = new Osmia_Egg(data);
506  PushIndividual(int(os_type),new_Osmia_Egg);
507  IncLiveArraySize(int(os_type));
508  data->nest->SetCellLock();
509  data->nest->AddEgg(new_Osmia_Egg);
510  data->nest->ReleaseCellLock();
511  break;
513  new_Osmia_Larva = new Osmia_Larva(data);
514  PushIndividual(int(os_type),new_Osmia_Larva);
515  IncLiveArraySize(int(os_type));
516  // Need to replace the pointer held by the nest (egg->larvae)
517  data->nest->SetCellLock();
518  data->nest->ReplaceNestPointer(a_caller,new_Osmia_Larva);
519  data->nest->ReleaseCellLock();
520  break;
522  new_Osmia_Prepupa = new Osmia_Prepupa(data);
523  PushIndividual(int(os_type),new_Osmia_Prepupa);
524  IncLiveArraySize(int(os_type));
525  data->nest->SetCellLock();
526  data->nest->ReplaceNestPointer(a_caller, new_Osmia_Prepupa);
527  data->nest->ReleaseCellLock();
528  break;
530  new_Osmia_Pupa = new Osmia_Pupa(data);
531  PushIndividual(int(os_type),new_Osmia_Pupa);
532  IncLiveArraySize(int(os_type));
533  data->nest->SetCellLock();
534  data->nest->ReplaceNestPointer(a_caller, new_Osmia_Pupa);
535  data->nest->ReleaseCellLock();
536  break;
538  new_Osmia_InCocoon = new Osmia_InCocoon(data);
539  PushIndividual(int(os_type),new_Osmia_InCocoon);
540  IncLiveArraySize(int(os_type));
541  data->nest->SetCellLock();
542  //cout<<"Osmia cocoon created"<<endl;
543  if(a_caller == NULL){
544  data->nest->AddCocoon(new_Osmia_InCocoon);
545  }
546  else{
547  data->nest->ReplaceNestPointer(a_caller, new_Osmia_InCocoon);
548  }
549  //cout << "Nest set created" << endl;
550  data->nest->ReleaseCellLock();
551  break;
553  new_Osmia_Female = new Osmia_Female(data);
554  //code used for pestiside store
555  #ifdef __OSMIA_PESTICIDE_STORE
556  #pragma omp critical
557  {
558  m_female_count++;
559  new_Osmia_Female->m_animal_id = m_female_count;
560  }
561  #endif
562  PushIndividual(int(os_type),new_Osmia_Female);
563  IncLiveArraySize(int(os_type));
564  //data->nest->RemoveCell(a_caller);
565  break;
566  }
567  }
568 }

References Osmia_Nest::AddCocoon(), Osmia_Nest::AddEgg(), Population_Manager::IncLiveArraySize(), struct_Osmia::nest, Population_Manager::PushIndividual(), Osmia_Nest::ReleaseCellLock(), Osmia_Nest::ReplaceNestPointer(), Osmia_Nest::SetCellLock(), to_OsmiaEgg, to_OsmiaFemale, to_OsmiaInCocoon, to_OsmiaLarva, to_OsmiaPrepupa, and to_OsmiaPupa.

Referenced by Osmia_Female::LayEgg(), Osmia_Population_Manager(), Osmia_Pupa::st_Emerge(), Osmia_InCocoon::st_Emerge(), Osmia_Egg::st_Hatch(), Osmia_Larva::st_Prepupate(), and Osmia_Prepupa::st_Pupate().

◆ DoAfter()

virtual void Osmia_Population_Manager::DoAfter ( )
inlineprotectedvirtual

Things to do before the EndStep.

Reimplemented from Population_Manager.

550 {}

◆ DoBefore()

void Osmia_Population_Manager::DoBefore ( )
protectedvirtual

Things to do before the Step.

Things to do before the Step

To save time we only refil the pollen map if any adults are around to care about this.

If some stages survive to winter due to slow development we kill these here

Reimplemented from Population_Manager.

648 {
652  int today = m_TheLandscape->SupplyDayInYear();
653  if (today == 0)
654  {
655  unsigned size2 = (unsigned)GetLiveArraySize(int(TTypeOfOsmiaLifeStages::to_OsmiaLarva));
656  for (unsigned j = 0; j < size2; j++) {
657  Osmia_Larva* larva = dynamic_cast<Osmia_Larva*>(SupplyAnimalPtr(int(TTypeOfOsmiaLifeStages::to_OsmiaLarva), j));
658  larva->st_Dying();
659  }
661  for (unsigned j = 0; j < size2; j++) {
662  Osmia_Prepupa* prepupa = dynamic_cast<Osmia_Prepupa*>(SupplyAnimalPtr(int(TTypeOfOsmiaLifeStages::to_OsmiaPrepupa), j));
663  prepupa->st_Dying();
664  }
666  for (unsigned j = 0; j < size2; j++) {
667  Osmia_Pupa* pupa = dynamic_cast<Osmia_Pupa*>(SupplyAnimalPtr(int(TTypeOfOsmiaLifeStages::to_OsmiaPupa), j));
668  pupa->st_Dying();
669  }
670 #ifdef __OSMIATESTING
671  // Record the Osmia weights if needed
672  ofstream ofile("OsmiaFemaleWeights.txt", ios::app);
673  int sz = m_FemaleWeights.size();
674  vector<int> histogram;
675  for (int h = 0; h <= 20; h++) histogram.push_back(0);
676  for (int i = 0; i < sz; i++) {
677  // Create histogram values
678  int col = int(m_FemaleWeights[i] / 10);
679  histogram[col]++;
680  }
681  for (int h = 0; h <= 20; h++) {
682  ofile << histogram[h] << '\t';
683  }
684  ofile << endl;
685  ofile.close();
686  m_FemaleWeights.clear();
687 #endif
688 
689  }
690  // Debug code to ensure all nests have some occupied cells.
692  {
693  // Only if no females around to mess this up.
695  }
696 }

References Osmia_Nest_Manager::CheckZeroNests(), Population_Manager::GetLiveArraySize(), m_OurOsmiaNestManager, Population_Manager_Base::m_TheLandscape, Osmia_Base::st_Dying(), Population_Manager::SupplyAnimalPtr(), Landscape::SupplyDayInYear(), to_OsmiaFemale, to_OsmiaLarva, to_OsmiaPrepupa, and to_OsmiaPupa.

◆ DoFirst()

void Osmia_Population_Manager::DoFirst ( void  )
protectedvirtual

Things to do before anything else at the start of a timestep

Reimplemented from Population_Manager.

570  {
571 
572  double temp = m_TheLandscape->SupplyTemp();
573  Osmia_Base::SetTemp(temp); // Sets the static variable for temperature for all Osmia (speed optimisation)
574  //if ((!g_weather->Raining()) && (temp > 10.0) && (g_weather->GetWind() < 8.0)) m_FlyingWeather = true; else m_FlyingWeather = false;
575  //if (temp > 10.0 && g_weather->GetWind() < 8.0) m_FlyingWeather = true; else m_FlyingWeather = false;
576  //m_FlyingWeather = g_weather->GetFlyingHours();
577  CalForageHours();
578  m_OurOsmiaNestManager.UpdateOsmiaNesting(); // Updates nest status for all nests
579  ClearDensityGrid(); // Clears this before all the bees get going
580  int temp_i = int(floor(temp + 0.5));
581  if (temp_i < 0) temp_i = 0;
583 
584 }

References CalForageHours(), ClearDensityGrid(), m_OurOsmiaNestManager, m_PrePupalDevelDaysToday, m_PrePupalDevelRates, Population_Manager_Base::m_TheLandscape, Osmia_Base::SetTemp(), Landscape::SupplyTemp(), and Osmia_Nest_Manager::UpdateOsmiaNesting().

◆ DoLast()

virtual void Osmia_Population_Manager::DoLast ( )
inlineprotectedvirtual

Things to do after the EndStep - here calculations related to summing global day degrees.

If the PostPreWinteringFlag is not set and its after Sept 1st then we need to test for the end of pre-wintering

Based on checking for a sustained and stable drop in autumn temperature

Reimplemented from Population_Manager.

553  {
554  int today = m_TheLandscape->SupplyDayInYear();
555  if (today > September)
556  {
557  int day = g_date->OldDays() + g_date->DayInYear();
558  double t0 = m_TheLandscape->SupplyTempPeriod(day, 1);
563  {
564  double t1 = m_TheLandscape->SupplyTempPeriod(day - 1, 1);
565  double t2 = m_TheLandscape->SupplyTempPeriod(day - 2, 1);
566  double t3 = m_TheLandscape->SupplyTempPeriod(day - 3, 1);
567  double t4 = m_TheLandscape->SupplyTempPeriod(day - 4, 1);
568  double t5 = m_TheLandscape->SupplyTempPeriod(day - 5, 1);
570  if (((t2 < 13.0) && (t1 < 13.0) && (t0 < 13.0)) && (((t5 - t4 > 1.0) && (t4 - t3 > 1.0)) || ((t3 < 13.0) && (t5 - t4 >= 3.0))))
571  {
572  m_PreWinteringEndFlag = true;
573  }
574  }
575  }
576  if (today == March)
577  {
578  m_OverWinterEndFlag = true;
579  }
580  if (today == June)
581  {
582  // No emergence after April so we can safely reset this flag here.
583  m_PreWinteringEndFlag = false;
584  m_OverWinterEndFlag = false;
585  }
586 #ifdef __OSMIARECORDFORAGE
587  double meanforage = 0.0;
588  if (Osmia_Female::m_foragecount > 0) meanforage = Osmia_Female::m_foragesum / Osmia_Female::m_foragecount;
589  cout << meanforage << endl;
590  Osmia_Female::m_foragesum = 0.0;
591  Osmia_Female::m_foragecount = 0.0;
592 #endif
593 
594 #ifdef __OSMIATESTING
595  if (today == 364) {
596  ofstream file1("OsmiaStageLengths.txt", ios::app);
597  file1 << "Year: " << g_date->GetYear() << endl;
598  file1 << "Mean egg stage days is:" << '\t' << m_EggStageLength.get_meanvalue() << endl;
599  file1 << "Mean larval stage days is:" << '\t' << m_LarvalStageLength.get_meanvalue() << endl;
600  file1 << "Mean prepupal stage days is:" << '\t' << m_PrePupaStageLength.get_meanvalue() << endl;
601  file1 << "Mean pupal stage days is:" << '\t' << m_PupaStageLength.get_meanvalue() << endl;
602  file1 << "Mean incocoon stage days is:" << '\t' << m_InCocoonStageLength.get_meanvalue() << endl;
603  m_EggStageLength.ClearData();
604  m_LarvalStageLength.ClearData();
605  m_PrePupaStageLength.ClearData();
606  m_PupaStageLength.ClearData();
607  m_InCocoonStageLength.ClearData();
608  file1.close();
609  }
610 #endif
611  }

References SimpleStatistics::ClearData(), Calendar::DayInYear(), g_date, SimpleStatistics::get_meanvalue(), Calendar::GetYear(), June, m_OverWinterEndFlag, m_PreWinteringEndFlag, Population_Manager_Base::m_TheLandscape, March, Calendar::OldDays(), September, Landscape::SupplyDayInYear(), and Landscape::SupplyTempPeriod().

◆ GetDensity() [1/2]

int Osmia_Population_Manager::GetDensity ( APoint  a_loc)
inline

Gets the number of bees at a location.

467  {
468  int index = (a_loc.m_x / 1000) + (a_loc.m_y / 1000) * m_GridExtent;
469  return m_FemaleDensityGrid[index];
470  }

References m_FemaleDensityGrid, m_GridExtent, APoint::m_x, and APoint::m_y.

◆ GetDensity() [2/2]

int Osmia_Population_Manager::GetDensity ( int  a_index)
inline

Gets the number of bees at a location based on the grid index value.

473  {
474  return m_FemaleDensityGrid[a_index];
475  }

References m_FemaleDensityGrid.

◆ GetFirstCocoonProvisioningMass()

double Osmia_Population_Manager::GetFirstCocoonProvisioningMass ( int  a_age,
int  a_massclass 
)
inline

Return the first cocoon mass for a nest give an age and female mass.

440  {
441  return m_FemaleCocoonMassEqns[a_massclass][a_age]-(m_exp_ZeroTo1.Get() * m_FemaleCocoonMassEqns[a_massclass][a_age] * 0.6);
442  }

References probability_distribution::Get(), m_exp_ZeroTo1, and m_FemaleCocoonMassEqns.

Referenced by Osmia_Female::st_ReproductiveBehaviour().

◆ GetForageHours()

int Osmia_Population_Manager::GetForageHours ( )
inline

Return the Osmia flying weather hours.

432 { return m_FlyingWeather; }

References m_FlyingWeather.

Referenced by Osmia_Female::st_Develop(), and Osmia_Female::st_ReproductiveBehaviour().

◆ GetPrePupalDevelDays()

double Osmia_Population_Manager::GetPrePupalDevelDays ( )
inline

Returns the amount of development a pre-pupal bee will get today based on temperature.

482  {
484  }

References m_PrePupalDevelDaysToday.

Referenced by Osmia_Prepupa::st_Develop().

◆ GetProvisioningParams()

double Osmia_Population_Manager::GetProvisioningParams ( int  a_age)
inline

Returns the values of provisioning parameters for a adult age.

435  {
436  return m_NestProvisioningParameters[a_age];
437  }

References m_NestProvisioningParameters.

◆ GetSexRatioEggsAgeMass()

double Osmia_Population_Manager::GetSexRatioEggsAgeMass ( int  a_massclass,
int  a_age 
)
inline

Return the sex ratio for a nest give an age and female mass.

445  {
446  return m_EggSexRatioEqns[a_massclass][a_age];
447  }

References m_EggSexRatioEqns.

Referenced by Osmia_Female::st_ReproductiveBehaviour().

◆ Init()

void Osmia_Population_Manager::Init ( )

Used to collect data initialisation together.

Initiates the Osmia nests on each landscape element The temperature related mortality needs to be calculated for in nest development and stored in the static variable in the Osmia_Base

Calculate number of hours needed for provisioning of one cell depending on Osmia age [based on Seidelmann 2006]

Sets the parasitoid parameters for per capitata likelihood of parasitism

Creates the data structures to hold Osmia density measures

Calculate the foraging efficiency with age mg/hr

Resets the OsmiaStageLengths output file.

345 {
351  // struct_Osmia o_data;
352  // o_data.age = 0;
353  // o_data.L = m_TheLandscape;
354  // o_data.OPM = this;
355  // o_data.x = 0;
356  // o_data.y = 0;
357  // o_data.nest = NULL;
358  // o_data.parasitised = TTypeOfOsmiaParasitoids::topara_Unparasitised;
359  // o_data.mass = 100;
360  // o_data.sex = true;
361  m_PreWinteringEndFlag = true;
362  #ifdef __OSMIATESTING
363  m_female_weight_record_lock = new omp_nest_lock_t;
364  omp_init_nest_lock(m_female_weight_record_lock);
365 
366  for (int i = 0; i < 30; i++)
367  {
368  m_egghistogram[0][i] = 0;
369  m_egghistogram[1][i] = 0;
370  m_egghistogram[2][i] = 0;
371  m_egghistogram[3][i] = 0;
372  }
373  m_eggsfirstnest.open("eggsfirstnest.txt", ios_base::out);
374  ofstream ofile("OsmiaFemaleWeights.txt", ios::out);
375  #endif
377  // Set the values of egg/base static variables
378 
380  /*temporarily uses .get()'ed version of GetPopulation to get the raw pointer, will move to smart pointers: issue opened*/
381  Osmia_Egg::SetParasitoidManager(static_cast<OsmiaParasitoid_Population_Manager*>(this->m_TheLandscape->SupplyThePopManagerList()->GetPopulation(TOP_OsmiaParasitoids)));
382  // Set the values of InCocoon static variables
384 
385  // Set the values of female static variables
389  Osmia_Female::SetCocoonToProvisionMass(cfg_OsmiaProvMassFromCocoonMass.value());// Also sets some other derived static members
403 #ifdef __OSMIARECORDFORAGE
404  Osmia_Female::m_foragesum = 0.0;
405  Osmia_Female::m_foragecount = 0;
406 #endif
407 #ifdef __OSMIA_PESTICIDE
408  Osmia_Female::m_OsmiaPPPEffectProb = cfg_OsmiaPesticideProbability.value();
409  Osmia_Female::m_OsmiaPPPThreshold = cfg_OsmiaPesticideThreshold.value();
410 #endif
411 
412  // Read the pollen and nectar thresholds
414  for (int m = 0; m < 12; m++)
415  {
420  m_PN_thresholds.push_back(pnt);
421  }
422 
423  // Calculates sexratio for egg lookups
424 
425  // Create a data curve for 0 to 59 days for the sex ratio
426  // Logistic(x | x0, min, max, k) = min + (max - min) / (1 + exp(-k * (x - x0)))
427  vector<double> params_logistic, params_lin, params_logistic2, params_lin2; // these are X0,min,max,k, and linear a,b respectively
428  params_logistic = cfg_OsmiaSexRatioVsMotherAgeLogistic.value();
435  {
436  for (unsigned age = 0; age <= 60; age++)
437  {
438  // Calculate the data for the egg sex ration curve
439  double adjustedmax = params_lin[0] * mass + params_lin[1];
440  curve1.push_back(params_logistic[1] + (adjustedmax - params_logistic[1]) / (1 + exp(-params_logistic[3] * (age - params_logistic[0]))));
441  // Calculate the data for the cocoon mass vs female mass curve
442  double avg_female_cocoon_mass = params_lin2[0] * mass + params_lin2[1];
443  double first_female_cocoon_mass = avg_female_cocoon_mass + cfg_Osmia_LifetimeCocoonMassLoss.value() / 2.0; // this lifetime cocoon mass loss nedds to have +/- 5 mg
444  // NB this is calculated as provisioning mass
445  curve2.push_back( 40.0+ (cfg_OsmiaProvMassFromCocoonMass.value() * (params_logistic2[1] + (first_female_cocoon_mass - params_logistic2[1]) / (1 + exp(-params_logistic2[3] * (age - params_logistic2[0]))))));
446  }
447  m_EggSexRatioEqns.push_back(curve1);
448  m_FemaleCocoonMassEqns.push_back(curve2);
449  curve1.clear();
450  curve2.clear();
451  }
452  // Calculate nest provisioning time parameters
453  for (int d = 0; d < 365; d++) //here max 60 is needed because then bee will die anyway
454  {
456  /***CJT** Changed from daily to hours */
457  double eff = 21.643 / (1 + pow(exp(1.0), (log(d) - log(18.888)) * 3.571)); // provisioning efficiency [mg/h]
458  double constructime = (2.576 * eff + 56.17) / eff; // cell construction time [h]
459  m_NestProvisioningParameters[d] = int(constructime ); // days needed for 1 cell construction
460  }
468  m_GridExtent = SimW / 1000;
469  int GEy = SimH / 1000;
470  m_FemaleDensityGrid.resize(m_GridExtent * GEy);
472 
477  for (int i = 1; i <= 100; i++) Osmia_Female::AddForageEfficiency(21.643 / (1 + exp((log(i) - log(18.888)) * 3.571)));
481  #ifdef __OSMIATESTING
482  ofstream file1("OsmiaStageLengths.txt", ios::out);
483  file1.close();
484  #endif
485 
486 }

References Osmia_Female::AddForageEfficiency(), cfg_MaximumCellConstructionTime, cfg_MinimumCellConstructionTime, cfg_Osmia_LifetimeCocoonMassLoss, cfg_OsmiaAdultMassCategoryStep, cfg_OsmiaBombylidProb, cfg_OsmiaCocoonMassFromProvMass, cfg_OsmiaDetailedMaskStep, cfg_OsmiaFemaleBckMort, Cfg_OsmiaFemaleCocoonMassVsMotherAgeLogistic, Cfg_OsmiaFemaleCocoonMassVsMotherMassLinear, cfg_OsmiaFemaleFindNestAttemptNo, cfg_OsmiaFemaleMassMax, cfg_OsmiaFemaleMassMin, cfg_OsmiaForageSteps, cfg_OsmiaMaxNoEggsInNest, cfg_OsmiaMinNoEggsInNest, cfg_OsmiaNectarThresholds, cfg_OsmiaParasitismProbToTimeCellOpen, cfg_OsmiaPerCapitaParasationChance, cfg_OsmiaPesticideProbability, cfg_OsmiaPesticideThreshold, cfg_OsmiaPollenGiveUpReturn, cfg_OsmiaPollenGiveUpThreshold, cfg_OsmiaPollenThresholds, cfg_OsmiaProvMassFromCocoonMass, cfg_OsmiaSexRatioVsMotherAgeLogistic, cfg_OsmiaSexRatioVsMotherMassLinear, cfg_OsmiaTypicalHomingDistance, cfg_PollenScoreToMg, cfg_TotalNestsPossible, cfg_UsingMechanisticParasitoids, ClearDensityGrid(), PopulationManagerList::GetPopulation(), Osmia_Nest_Manager::InitOsmiaBeeNesting(), m_EggSexRatioEqns, m_FemaleCocoonMassEqns, m_FemaleDensityGrid, m_GridExtent, OsmiaPollenNectarThresholds::m_nectarTqual, OsmiaPollenNectarThresholds::m_nectarTquan, m_NestProvisioningParameters, m_OurOsmiaNestManager, m_PN_thresholds, OsmiaPollenNectarThresholds::m_pollenTqual, OsmiaPollenNectarThresholds::m_pollenTquan, m_PreWinteringEndFlag, Population_Manager_Base::m_TheLandscape, Osmia_Female::SetBombylidProbability(), Osmia_Female::SetCocoonToProvisionMass(), Osmia_Female::SetDailyMort(), Osmia_Female::SetForageMaskDetailed(), Osmia_Female::SetForageSteps(), Osmia_Female::SetMaxEggsPerNest(), Osmia_Female::SetMaximumCellConstructionTime(), Osmia_Female::SetMinEggsPerNest(), Osmia_Female::SetMinimumCellConstructionTime(), Osmia_Female::SetNestFindAttempts(), Osmia_InCocoon::SetOverwinteringTempThreshold(), Osmia_Base::SetParameterValues(), Osmia_Female::SetParasitismProbToTimeCellOpen(), Osmia_Base::SetParasitoidManager(), Osmia_Female::SetParasitoidParameters(), Osmia_Female::SetPollenGiveUpReturn(), Osmia_Female::SetPollenGiveUpThreshold(), Osmia_Female::SetPollenScoreToMg(), Osmia_Female::SetProvisionToCocoonMass(), Osmia_Female::SetTotalNestsPossible(), Osmia_Female::SetUsingMechanisticParasitoids(), Population_Manager_Base::SimH, Population_Manager_Base::SimW, Landscape::SupplyThePopManagerList(), TOP_OsmiaParasitoids, CfgInt::value(), CfgFloat::value(), CfgBool::value(), and CfgArray_Double::value().

Referenced by Osmia_Population_Manager().

◆ IsEndPreWinter()

bool Osmia_Population_Manager::IsEndPreWinter ( )
inline

Returns flag to denore the end of prewintering, if ended it is set to true.

410 { return m_PreWinteringEndFlag; }

References m_PreWinteringEndFlag.

Referenced by Osmia_InCocoon::st_Develop().

◆ IsOsmiaNestPossible()

bool Osmia_Population_Manager::IsOsmiaNestPossible ( int  a_polyindex)
inline

Checks whether a nest is possible here.

414 { return m_OurOsmiaNestManager.IsOsmiaNestPossible(a_polyindex); }

References Osmia_Nest_Manager::IsOsmiaNestPossible(), and m_OurOsmiaNestManager.

Referenced by Osmia_Female::FindNestLocation(), and Osmia_Population_Manager().

◆ IsOverWinterEnd()

bool Osmia_Population_Manager::IsOverWinterEnd ( )
inline

Returns flag to denore the end of overwintering, if ended it is set to true.

412 { return m_OverWinterEndFlag; }

References m_OverWinterEndFlag.

Referenced by Osmia_InCocoon::st_Develop().

◆ ReleaseOsmiaNest()

void Osmia_Population_Manager::ReleaseOsmiaNest ( int  a_polyindex,
Osmia_Nest a_nest 
)
inline

◆ RemoveFromDensityGrid()

void Osmia_Population_Manager::RemoveFromDensityGrid ( int  a_index)
inline

Adds a bee to the density grid using the grid index value.

462  {
463  m_FemaleDensityGrid[a_index]--;
464  }

References m_FemaleDensityGrid.

◆ SantityCheck()

bool Osmia_Population_Manager::SantityCheck ( int  a_polyindex)
inline

Checks whether a nest is possible here.

416 { return m_OurOsmiaNestManager.SanityCheck(a_polyindex); }

References m_OurOsmiaNestManager, and Osmia_Nest_Manager::SanityCheck().

◆ TheAOROutputProbe()

void Osmia_Population_Manager::TheAOROutputProbe ( )
overridevirtual

Member Data Documentation

◆ m_EggSexRatioEqns

vector<eggsexratiovsagelogisticcurvedata> Osmia_Population_Manager::m_EggSexRatioEqns
protected

Holds logistic equation values per age/mass of female for egg sex ratios.

Referenced by GetSexRatioEggsAgeMass(), and Init().

◆ m_exp_ZeroTo1

probability_distribution Osmia_Population_Manager::m_exp_ZeroTo1 = probability_distribution("BETA", "0.75,2.5")
staticprotected

Static instance of the probability_distribution class of distance probabilities for approx exponential probs zero to 1.0.

A distribution to create an exponential decay from zero to one.

Referenced by GetFirstCocoonProvisioningMass().

◆ m_FemaleCocoonMassEqns

vector<femalecocoonmassvsagelogisticcurvedata> Osmia_Population_Manager::m_FemaleCocoonMassEqns
protected

Holds logistic equation values per age/mass of female for first female cocoon mass.

Referenced by GetFirstCocoonProvisioningMass(), and Init().

◆ m_FemaleDensityGrid

vector<int> Osmia_Population_Manager::m_FemaleDensityGrid
protected

holds numbers of females per 1km2

Referenced by AddToDensityGrid(), ClearDensityGrid(), GetDensity(), Init(), and RemoveFromDensityGrid().

◆ m_FlyingWeather

int Osmia_Population_Manager::m_FlyingWeather
protected

A daily value to indicate the hours the weather is OK for Osmia adult activity.

Referenced by CalForageHours(), and GetForageHours().

◆ m_GridExtent

int Osmia_Population_Manager::m_GridExtent
protected

holds numbers of grid cells per row

Referenced by AddToDensityGrid(), GetDensity(), and Init().

◆ m_NestProvisioningParameters

double Osmia_Population_Manager::m_NestProvisioningParameters[365]
protected

A lookup table used to store pre-calculated nest provisioning parameters in advance since they are CPU intensive.

Referenced by GetProvisioningParams(), and Init().

◆ m_OurOsmiaNestManager

Osmia_Nest_Manager Osmia_Population_Manager::m_OurOsmiaNestManager
protected

This provides the interface to the Osmia_Nests linked to the polgons.

  • it duplicates some functionality of the Landscape but is held here to prevent bloating of landscape code/footprint for other models

Referenced by CreateNest(), DoBefore(), DoFirst(), Init(), IsOsmiaNestPossible(), Osmia_Population_Manager(), ReleaseOsmiaNest(), and SantityCheck().

◆ m_OverWinterEndFlag

bool Osmia_Population_Manager::m_OverWinterEndFlag
protected

A flag to signal the period between onset of wintering and March 1st

Referenced by DoLast(), IsOverWinterEnd(), and Osmia_Population_Manager().

◆ m_PN_thresholds

vector< OsmiaPollenNectarThresholds> Osmia_Population_Manager::m_PN_thresholds
protected

Holds a list of pollen and nectar thresholds, one for each month.

Referenced by Init().

◆ m_PollenCompetitionsReductionScaler

double Osmia_Population_Manager::m_PollenCompetitionsReductionScaler
protected

An attribute used to scale the available pollen based on assumed competetion from other bee species.

Referenced by Osmia_Population_Manager().

◆ m_PrePupalDevelDaysToday

double Osmia_Population_Manager::m_PrePupalDevelDaysToday
protected

Holds the prepupal development rates for today for fast access.

Referenced by DoFirst(), and GetPrePupalDevelDays().

◆ m_PrePupalDevelRates

vector<double> Osmia_Population_Manager::m_PrePupalDevelRates
protected

Holds the prepupal development rates for fast access.

Referenced by DoFirst(), and Osmia_Population_Manager().

◆ m_PreWinteringEndFlag

bool Osmia_Population_Manager::m_PreWinteringEndFlag
protected

A flag to signal the prewinter phase is over

Referenced by DoLast(), Init(), IsEndPreWinter(), and Osmia_Population_Manager().

◆ m_ThePollenMap

PollenMap_centroidbased* Osmia_Population_Manager::m_ThePollenMap
protected

A pointer to the pollen map object.


The documentation for this class was generated from the following files:
cfg_OsmiaPesticideProbability
static CfgFloat cfg_OsmiaPesticideProbability("OSMIA_PPP_PROB", CFG_CUSTOM, 0.0)
The probability of death per day if the pesticide body burden threshold is exceeded.
cfg_OsmiaParasitismProbToTimeCellOpen
static CfgFloat cfg_OsmiaParasitismProbToTimeCellOpen("OSMIA_PARASITISMPROBTOTIMECELLOPEN", CFG_CUSTOM, 0.0075)
The conversion rate from timethe cell is open to open cell parasitism.
Osmia_Nest::SetCellLock
void SetCellLock(void)
Set the cell lock.
Definition: Osmia.h:160
Osmia_Population_Manager::m_NestProvisioningParameters
double m_NestProvisioningParameters[365]
A lookup table used to store pre-calculated nest provisioning parameters in advance since they are CP...
Definition: Osmia_Population_Manager.h:526
Osmia_Female::SetTotalNestsPossible
static void SetTotalNestsPossible(int a_total)
Set the maximum number of nests possible for a bee.
Definition: Osmia.h:684
Landscape::SupplyNumberOfPolygons
unsigned int SupplyNumberOfPolygons(void)
Returns the number of polygons in the landscape.
Definition: Landscape.h:2127
cfg_OsmiaInCocoonOverwinteringTempThreshold
CfgFloat cfg_OsmiaInCocoonOverwinteringTempThreshold
Is the temperature developmental threshold for overwintering development (a temperature below which d...
g_rand_uni_fnc
double g_rand_uni_fnc()
Definition: ALMaSS_Random.cpp:56
Calendar::GetYear
int GetYear(void)
Definition: Calendar.h:71
Osmia_Base::SetParameterValues
static void SetParameterValues()
Used to populate the static members holding mortality and development parameters.
Definition: Osmia.cpp:215
Osmia_Base::SetTemp
static void SetTemp(double a_temperature)
Definition: Osmia.h:383
Population_Manager::SupplyAnimalPtr
virtual TAnimal * SupplyAnimalPtr(unsigned int a_index, unsigned int a_animal)
Returns the pointer indexed by a_index and a_animal. Note NO RANGE CHECK.
Definition: PopulationManager.h:678
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
Osmia_Nest::ReplaceNestPointer
void ReplaceNestPointer(TAnimal *a_oldpointer, TAnimal *a_newpointer)
Definition: Osmia.h:169
cfg_OsmiaFemaleMassMin
CfgFloat cfg_OsmiaFemaleMassMin
min possible female mass in mg
Osmia_Population_Manager::m_FlyingWeather
int m_FlyingWeather
A daily value to indicate the hours the weather is OK for Osmia adult activity.
Definition: Osmia_Population_Manager.h:516
Landscape::SupplyARandomLocPoly
APoint SupplyARandomLocPoly(int a_poly_id)
The function to get a random location for the given poly ID.
Definition: Landscape.h:263
cfg_OsmiaMinNoEggsInNest
static CfgInt cfg_OsmiaMinNoEggsInNest("OSMIA_MINNOEGGSINNEST", CFG_CUSTOM, 3)
The mimimum number of eggs planned for a nest.
struct_Osmia::y
int y
y-coord
Definition: Osmia_Population_Manager.h:167
cfg_OsmiaNectarThresholds
static CfgArray_Double cfg_OsmiaNectarThresholds("OSMIA_NECTAR_THRESHOLDS", CFG_CUSTOM, 24, vector< double > { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 })
Monthly nectar thresholds, 12 quantity then 12 quality. Units mj/m2 and mg/l.
cfg_OsmiaMaxPrecipForFlying
static CfgFloat cfg_OsmiaMaxPrecipForFlying("OSMIA_MAX_PRECIP_FOR_FLYING", CFG_CUSTOM, 0.1)
The maximum precipitation for osmia to fly out.
struct_Osmia
Used for creation of a new Osmia object.
Definition: Osmia_Population_Manager.h:161
Osmia_Base::st_Dying
virtual void st_Dying(void)
Behavioural state dying.
Definition: Osmia.cpp:258
Osmia_Population_Manager::m_PN_thresholds
vector< OsmiaPollenNectarThresholds > m_PN_thresholds
Holds a list of pollen and nectar thresholds, one for each month.
Definition: Osmia_Population_Manager.h:542
cfg_TotalNestsPossible
static CfgInt cfg_TotalNestsPossible("OSMIA_TOTALNESTSPOSSIBLE", CFG_CUSTOM, 5)
The maximum number of nests possible for a bee.
Osmia_Female::SetBombylidProbability
static void SetBombylidProbability(double a_prob)
Sets Bombylid probability.
Definition: Osmia.h:686
Osmia_Pupa
Definition: Osmia.h:468
struct_Osmia::L
Landscape * L
Landscape pointer.
Definition: Osmia_Population_Manager.h:173
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
TOP_OsmiaParasitoids
Definition: PopulationManager.h:82
Population_Manager_Base::m_ListNames
const char * m_ListNames[32]
A list of life-stage names.
Definition: PopulationManager.h:628
cfg_OsmiaMinTempForFlying
static CfgFloat cfg_OsmiaMinTempForFlying("OSMIA_MIN_TEMP_FOR_FLYING", CFG_CUSTOM, 6)
The minimum temperature in degree for osmia to fly out.
Osmia_Population_Manager::ClearDensityGrid
void ClearDensityGrid()
Empties the bee density grid.
Definition: Osmia_Population_Manager.h:477
cfg_MaximumCellConstructionTime
static CfgInt cfg_MaximumCellConstructionTime("OSMIA_MAXCELLCONSTRUCTTIME", CFG_CUSTOM, 4)
The maximum time allowed to construct a cell in days.
Osmia_InCocoon
Definition: Osmia.h:488
Osmia_Nest_Manager::CreateNest
Osmia_Nest * CreateNest(int a_x, int a_y, int a_polyindex)
Create the osmia nest here
Definition: Osmia_Population_Manager.h:335
Landscape::SupplyThePopManagerList
PopulationManagerList * SupplyThePopManagerList()
Set the pointer to the list of active population managers.
Definition: Landscape.h:313
Osmia_Nest_Manager::UpdateOsmiaNesting
void UpdateOsmiaNesting()
Tell all LE objects to update their osmia nest status.
Definition: Osmia_Population_Manager.h:321
struct_Osmia::overwintering_degree_days
double overwintering_degree_days
This is used to set accumulated overwinter degree days when starting the simulation,...
Definition: Osmia_Population_Manager.h:185
CfgFloat::value
double value() const
Definition: Configurator.h:142
Osmia_Female::SetMinEggsPerNest
static void SetMinEggsPerNest(int a_eggs)
Set the min eggs parameter value.
Definition: Osmia.h:659
Osmia_Female::SetProvisionToCocoonMass
static void SetProvisionToCocoonMass(double a_ratio)
Set the conversion ratio provisioning to cocoon.
Definition: Osmia.h:670
struct_Osmia::sex
bool sex
the sex of the Osmia
Definition: Osmia_Population_Manager.h:171
Osmia_Population_Manager::m_FemaleCocoonMassEqns
vector< femalecocoonmassvsagelogisticcurvedata > m_FemaleCocoonMassEqns
Holds logistic equation values per age/mass of female for first female cocoon mass.
Definition: Osmia_Population_Manager.h:530
eggsexratiovsagelogisticcurvedata
vector< double > eggsexratiovsagelogisticcurvedata
Definition: Osmia_Population_Manager.h:55
Osmia_Female
Definition: Osmia.h:518
Cfg_OsmiaFemaleCocoonMassVsMotherMassLinear
static CfgArray_Double Cfg_OsmiaFemaleCocoonMassVsMotherMassLinear("OSMIA_FEMALECOCOONMASSVSMOTHERSMASSLINEAR", CFG_CUSTOM, 2, vector< double > { 0.3, 65.1 })
Array of parameters for the Osmia female first cocoon mass vs mothers mass linear equation
Population_Manager_Base::m_ListNameLength
int m_ListNameLength
the number of life-stages simulated in the population manager
Definition: PopulationManager.h:626
cfg_UsingMechanisticParasitoids
static CfgBool cfg_UsingMechanisticParasitoids("OSMIA_USEMECHANISTICPARASITOIDS", CFG_CUSTOM, false)
The flag for using mechanistic (true) or statistical (false) parasitoid assumptions.
Osmia_Female::SetParasitoidParameters
static void SetParasitoidParameters(vector< double > a_params)
Definition: Osmia.h:691
Landscape::ReleasePolygonLock
void ReleasePolygonLock(int a_polyref)
Function to release the given polygon locks.
Definition: Landscape.h:603
Landscape::SetPolygonLock
void SetPolygonLock(int a_polyref)
Function to set the given polygon lock.
Definition: Landscape.h:601
Osmia_Nest_Manager::SanityCheck
bool SanityCheck(int a_polyindex)
Definition: Osmia_Population_Manager.h:355
Osmia_Female::SetPollenGiveUpThreshold
static void SetPollenGiveUpThreshold(double a_prop)
Record the give up level for pollen from a forage patch we are foraging from.
Definition: Osmia.h:651
Osmia_Population_Manager::m_PrePupalDevelRates
vector< double > m_PrePupalDevelRates
Holds the prepupal development rates for fast access.
Definition: Osmia_Population_Manager.h:538
Osmia_Female::AddForageEfficiency
static void AddForageEfficiency(double a_eff)
Save a forage efficiency value.
Definition: Osmia.h:695
CfgBool::value
bool value() const
Definition: Configurator.h:164
Population_Manager_Base::m_TheLandscape
Landscape * m_TheLandscape
holds an internal pointer to the landscape
Definition: PopulationManager.h:624
Osmia_Female::SetUsingMechanisticParasitoids
static void SetUsingMechanisticParasitoids(bool a_flag)
Sets the UsingMechanisticParasitoids flag.
Definition: Osmia.h:690
Osmia_Population_Manager::m_PollenCompetitionsReductionScaler
double m_PollenCompetitionsReductionScaler
An attribute used to scale the available pollen based on assumed competetion from other bee species.
Definition: Osmia_Population_Manager.h:536
cfg_Osmia_LifetimeCocoonMassLoss
static CfgFloat cfg_Osmia_LifetimeCocoonMassLoss("OSMIA_LIFETIMECOCOONMASSLOSS", CFG_CUSTOM, 30.0)
Assumed (fitted) value for the total difference in cocoon mass from first to last cocoon
cfg_OsmiaFemaleBckMort
static CfgFloat cfg_OsmiaFemaleBckMort("OSMIA_FEMALEBACKMORT", CFG_CUSTOM, 0.02)
The daily background mortality rate for females.
Osmia_Population_Manager::m_PreWinteringEndFlag
bool m_PreWinteringEndFlag
Definition: Osmia_Population_Manager.h:518
Osmia_Nest
The Osmia nest is assumed to be a linear element with egg cells added one by one.
Definition: Osmia.h:128
cfg_OsmiaProvMassFromCocoonMass
CfgFloat cfg_OsmiaProvMassFromCocoonMass("OSMIAS_PROVISIONINGTOCOCOON", CFG_CUSTOM, 3.247)
The relationhip between cocoon mass and provisioning mass is linear.
OsmiaPollenNectarThresholds::m_nectarTquan
double m_nectarTquan
Definition: Osmia_Population_Manager.h:65
Weather::GetWindHour
double GetWindHour(int hour)
Definition: Weather.h:469
Population_Manager::m_AOR_Probe
AOR_Probe * m_AOR_Probe
A pointer to the AOR probe.
Definition: PopulationManager.h:875
June
const int June
Julian start dates of the month of June.
Definition: Landscape.h:48
Osmia_Population_Manager::m_OverWinterEndFlag
bool m_OverWinterEndFlag
Definition: Osmia_Population_Manager.h:520
Osmia_Nest::AddCocoon
void AddCocoon(TAnimal *a_cocoon)
Adds a cocoon to the nest, this is only used to initialise the simulation.
Definition: Osmia.h:164
cfg_OsmiaMaxNoEggsInNest
static CfgInt cfg_OsmiaMaxNoEggsInNest("OSMIA_MAXNOEGGSINNEST", CFG_CUSTOM, 30)
The maximum number of eggs planned for a nest
Osmia_Population_Manager::m_OurOsmiaNestManager
Osmia_Nest_Manager m_OurOsmiaNestManager
This provides the interface to the Osmia_Nests linked to the polgons.
Definition: Osmia_Population_Manager.h:524
Population_Manager_Base::SimH
int SimH
stores the simulation height
Definition: PopulationManager.h:614
cfg_OsmiaPerCapitaParasationChance
static CfgArray_Double cfg_OsmiaPerCapitaParasationChance("OSMIA_PERCAPITAPARASITATIONCHANCE", CFG_CUSTOM, static_cast< int >(TTypeOfOsmiaParasitoids::topara_foobar) - 1, vector< double > { 0.00001, 0.00002 })
Array of parameters for per capita parasitoid probability for each type of parasitoid in the order ba...
AOR_Probe::DoProbe
virtual void DoProbe(int a_lifestage)
Definition: AOR_Probe.cpp:104
cfg_OsmiaPollenGiveUpThreshold
static CfgFloat cfg_OsmiaPollenGiveUpThreshold("OSMIA_POLLENGIVEUPTHRESHOLD", CFG_CUSTOM, 0.75, 0, 1.0)
The change in proportion pollen before a new patch is selected.
Osmia_Population_Manager::m_FemaleDensityGrid
vector< int > m_FemaleDensityGrid
holds numbers of females per 1km2
Definition: Osmia_Population_Manager.h:532
TTypeOfOsmiaParasitoids::topara_Unparasitised
TTypeOfOsmiaLifeStages::to_OsmiaPrepupa
Osmia_Prepupa
Definition: Osmia.h:447
cfg_OsmiaStartNo
static CfgInt cfg_OsmiaStartNo("OSMIA_STARTNOS", CFG_CUSTOM, 50000)
The starting number of Osmia InCocoons.
Osmia_Female::SetForageMaskDetailed
static void SetForageMaskDetailed(int a_step, int a_max)
Initialise the detailed forage mask.
Definition: Osmia.h:646
Osmia_Female::SetForageSteps
static void SetForageSteps(int a_sz)
Definition: Osmia.h:644
APoint
A simple class defining an x,y coordinate set.
Definition: ALMaSS_Setup.h:52
Osmia_Nest::AddEgg
void AddEgg(TAnimal *a_egg)
Adds an egg to the nest.
Definition: Osmia.h:168
cfg_OsmiaCocoonMassFromProvMass
CfgFloat cfg_OsmiaCocoonMassFromProvMass("OSMIAS_COCOONTOPROVISIONING", CFG_CUSTOM, 1.0/3.247)
The relationhip between cocoon massand provisioning mass is linear.
Osmia_Female::SetPollenGiveUpReturn
static void SetPollenGiveUpReturn(double a_value)
Record the give up level for pollen from a forage patch we are foraging from.
Definition: Osmia.h:653
cfg_OsmiaDetailedMaskStep
CfgInt cfg_OsmiaDetailedMaskStep
Step size for the detailed forage mask. Step is each step out from the centre (min 1)
TTypeOfOsmiaLifeStages::to_OsmiaFemale
struct_Osmia::x
int x
x-coord
Definition: Osmia_Population_Manager.h:165
cfg_OsmiaPesticideThreshold
static CfgFloat cfg_OsmiaPesticideThreshold("OSMIA_PPP_THRESHOLD", CFG_CUSTOM, 10000.0)
The pesticide body burden threshold for ppp effects.
Osmia_Population_Manager::CalForageHours
void CalForageHours(void)
Definition: Osmia_Population_Manager.cpp:613
Osmia_Population_Manager::m_GridExtent
int m_GridExtent
holds numbers of grid cells per row
Definition: Osmia_Population_Manager.h:534
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
cfg_OsmiaPollenThresholds
static CfgArray_Double cfg_OsmiaPollenThresholds("OSMIA_POLLEN_THRESHOLDS", CFG_CUSTOM, 24, vector< double > { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 })
Monthly pollen thresholds, 12 quantity then 12 quality. Units mg/m2 and unitless.
cfg_OsmiaPrepupalDevelRates
static CfgArray_Double cfg_OsmiaPrepupalDevelRates("OSMIA_PREPUPALDEVELRATES", CFG_CUSTOM, 42, vector< double > { 0.118180491, 0.128062924, 0.139167698, 0.151690375, 0.165863251, 0.181962547, 0.200316654, 0.221315209, 0.245418359, 0.273164807, 0.305175879, 0.342150483, 0.384842052, 0.434002716, 0.490272059, 0.553979475, 0.62482638, 0.701432201, 0.780791977, 0.857828943, 0.925409524, 0.97526899, 1, 0.995492173, 0.96251684, 0.90641791, 0.835121012, 0.756712977, 0.677752358, 0.602659522, 0.53389011, 0.472441557, 0.418380352, 0.371255655, 0.330377543, 0.294984821, 0.264336547, 0.237755941, 0.214646732, 0.194494708, 0.176862031, 0.161378614 })
This array is the daily rate of development of prepupa with temperature rounded to the nearest degree...
TTypeOfOsmiaLifeStages::to_OsmiaPupa
cfg_OsmiaAdultMassCategoryStep
CfgFloat cfg_OsmiaAdultMassCategoryStep("OSMIA_ADULTMASSCLASSSTEP", CFG_CUSTOM, 10.0)
The size class step for Osmia female mass.
Osmia_Population_Manager::CreateNest
Osmia_Nest * CreateNest(int a_x, int a_y, int a_polyindex)
Creates an Osmia_Nest in the polygon referenced by the index polyindex.
Definition: Osmia_Population_Manager.h:418
cfg_OsmiaBombylidProb
static CfgFloat cfg_OsmiaBombylidProb("OSMIA_BOMBYLIDPROB", CFG_CUSTOM, 0.5)
The probability that a parasitoid is Bombylid - statistical parasitoids only.
Landscape::SupplyDayInYear
int SupplyDayInYear(void)
Passes a request on to the associated Calendar class function, the day in the year.
Definition: Landscape.h:2267
cfg_OsmiaPollenGiveUpReturn
static CfgFloat cfg_OsmiaPollenGiveUpReturn("OSMIA_POLLENGIVEUPRETURN", CFG_CUSTOM, 0.75, 0, 50.0)
The change in proportion pollen before a new patch is selected.
Calendar::SunSetTime
int SunSetTime(void)
Definition: Calendar.h:65
Osmia_Egg
Definition: Osmia.h:394
TTypeOfOsmiaLifeStages::to_OsmiaEgg
OsmiaPollenNectarThresholds::m_pollenTqual
double m_pollenTqual
Definition: Osmia_Population_Manager.h:62
cfg_OsmiaForageSteps
CfgInt cfg_OsmiaForageSteps
cfg_OsmiaSexRatioVsMotherMassLinear
static CfgArray_Double cfg_OsmiaSexRatioVsMotherMassLinear("OSMIA_SEXRATIOVSMOTHERSMASSLINEAR", CFG_CUSTOM, 2, vector< double > { 0.0055, -0.1025 })
Array of parameters for the Osmia sex ratio vs mothers mass linear equation
Osmia_Female::SetMaxEggsPerNest
static void SetMaxEggsPerNest(int a_eggs)
Set the min eggs parameter value.
Definition: Osmia.h:661
cfg_OsmiaMaxWindSpeedForFlying
static CfgFloat cfg_OsmiaMaxWindSpeedForFlying("OSMIA_MAX_WIND_SPEED_FOR_FLYING", CFG_CUSTOM, 8)
The maximum wind speed in meter per second for osmia to fly out.
Population_Manager::m_is_paralleled
bool m_is_paralleled
This is used to indicate whether the species is paralleled.
Definition: PopulationManager.h:796
APoint::m_x
int m_x
Definition: ALMaSS_Setup.h:55
cfg_PollenScoreToMg
static CfgFloat cfg_PollenScoreToMg("OSMIA_POLLENSCORETOMG", CFG_CUSTOM, 0.8)
The conversion rate from pollen availability score to mg pollen provisioned per day per bee - a fitti...
OsmiaPollenNectarThresholds
A data class to hold each pair of pollen and nectar thresholds.
Definition: Osmia_Population_Manager.h:59
CfgInt::value
int value() const
Definition: Configurator.h:116
cfg_OsmiaFemaleMassMax
CfgFloat cfg_OsmiaFemaleMassMax
max possible female mass in mg
Calendar::SunRiseTime
int SunRiseTime(void)
Definition: Calendar.h:64
Osmia_Nest_Manager::CheckZeroNests
bool CheckZeroNests()
Definition: Osmia_Population_Manager.h:359
cfg_OsmiaSexRatioVsMotherAgeLogistic
static CfgArray_Double cfg_OsmiaSexRatioVsMotherAgeLogistic("OSMIA_SEXRATIOVSMOTHERSAGELOGISTIC", CFG_CUSTOM, 4, vector< double > { 14.90257909, 0.09141286, 0.6031729, -0.39213001 })
Array of parameters for the Osmia sex ratio vs mothers age logistic equation
Osmia_Larva
Definition: Osmia.h:427
CfgArray_Double::value
std::vector< double > value() const
Definition: Configurator.h:219
Population_Manager_Base::SimW
int SimW
stores the simulation width
Definition: PopulationManager.h:616
TTypeOfOsmiaLifeStages::to_OsmiaLarva
struct_Osmia::mass
double mass
The mass of the Osmia in mg.
Definition: Osmia_Population_Manager.h:181
Osmia_Population_Manager::IsOsmiaNestPossible
bool IsOsmiaNestPossible(int a_polyindex)
Checks whether a nest is possible here.
Definition: Osmia_Population_Manager.h:414
femalecocoonmassvsagelogisticcurvedata
vector< double > femalecocoonmassvsagelogisticcurvedata
Definition: Osmia_Population_Manager.h:56
g_weather
class Weather * g_weather
Definition: Weather.cpp:49
Population_Manager::GetLiveArraySize
unsigned GetLiveArraySize(int a_listindex) override
Gets the number of 'live' objects for a list index in the TheArray.
Definition: PopulationManager.h:657
OsmiaPollenNectarThresholds::m_pollenTquan
double m_pollenTquan
Definition: Osmia_Population_Manager.h:64
Osmia_Population_Manager::m_PrePupalDevelDaysToday
double m_PrePupalDevelDaysToday
Holds the prepupal development rates for today for fast access.
Definition: Osmia_Population_Manager.h:540
Weather::GetTempHour
double GetTempHour(int hour)
Get today's weather data at the given hour.
Definition: Weather.h:467
cfg_OsmiaFemaleFindNestAttemptNo
static CfgInt cfg_OsmiaFemaleFindNestAttemptNo("OSMIA_FEMALEFINDNESTATTEMPTNO", CFG_CUSTOM, 20)
Parameter to set the numbe of nest finding attempts.
Osmia_Population_Manager::m_exp_ZeroTo1
static probability_distribution m_exp_ZeroTo1
Static instance of the probability_distribution class of distance probabilities for approx exponentia...
Definition: Osmia_Population_Manager.h:497
cfg_OsmiaDensityDependentPollenRemovalConst
static CfgFloat cfg_OsmiaDensityDependentPollenRemovalConst("OSMIADENSITYDENPENDENTPOLLENREMOVALCONST", CFG_CUSTOM, 0.5)
Parameter to set the proportion of pollen removed by other bees.
struct_Osmia::nest
Osmia_Nest * nest
a pointer to a nest
Definition: Osmia_Population_Manager.h:177
Osmia_Nest_Manager::ReleaseOsmiaNest
void ReleaseOsmiaNest(int a_polyindex, Osmia_Nest *a_nest)
release nest here
Definition: Osmia_Population_Manager.h:342
struct_Osmia::parasitised
TTypeOfOsmiaParasitoids parasitised
Are we parasitised.
Definition: Osmia_Population_Manager.h:179
Osmia_Population_Manager::m_EggSexRatioEqns
vector< eggsexratiovsagelogisticcurvedata > m_EggSexRatioEqns
Holds logistic equation values per age/mass of female for egg sex ratios.
Definition: Osmia_Population_Manager.h:528
September
const int September
Julian start dates of the month of September.
Definition: Landscape.h:54
Population_Manager_Base::m_SimulationName
string m_SimulationName
stores the simulation name
Definition: PopulationManager.h:622
March
const int March
Julian start dates of the month of March.
Definition: Landscape.h:42
Osmia_Female::SetNestFindAttempts
static void SetNestFindAttempts(int a_no)
Record the daily mortality parameter values.
Definition: Osmia.h:657
Osmia_InCocoon::SetOverwinteringTempThreshold
static void SetOverwinteringTempThreshold(double a_temp)
Set method for m_OverwinteringTempThreshold.
Definition: Osmia.h:504
Osmia_Nest_Manager::IsOsmiaNestPossible
bool IsOsmiaNestPossible(int a_polyindex)
Find out whether an osmia nest can be made here.
Definition: Osmia_Population_Manager.h:330
TTypeOfOsmiaLifeStages::to_OsmiaInCocoon
Cfg_OsmiaFemaleCocoonMassVsMotherAgeLogistic
static CfgArray_Double Cfg_OsmiaFemaleCocoonMassVsMotherAgeLogistic("OSMIA_FEMALECOCOONMASSVSMOTHERSAGELOGISTIC", CFG_CUSTOM, 4, vector< double > { 18.04087868, 104.19820591, 133.74150303, -0.17686981})
Array of parameters for the Osmia female cocoon mass vs mothers age logistic equation
Osmia_Base::SetParasitoidManager
static void SetParasitoidManager(OsmiaParasitoid_Population_Manager *a_popman)
Definition: Osmia.h:388
Osmia_Nest_Manager::InitOsmiaBeeNesting
void InitOsmiaBeeNesting()
Read in the Osmia nest density files and allocate to each LE object.
Definition: Osmia_Population_Manager.cpp:850
g_random_fnc
int g_random_fnc(const int a_range)
Definition: ALMaSS_Random.cpp:74
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
Osmia_Nest::ReleaseCellLock
void ReleaseCellLock(void)
Release the cell lock.
Definition: Osmia.h:162
OsmiaPollenNectarThresholds::m_nectarTqual
double m_nectarTqual
Definition: Osmia_Population_Manager.h:63
cfg_OsmiaTypicalHomingDistance
CfgInt cfg_OsmiaTypicalHomingDistance
Osmia_Female::SetPollenScoreToMg
static void SetPollenScoreToMg(double a_ratio)
Set pollen score to provisioned mg value.
Definition: Osmia.h:672
cfg_pest_product_amounts
CfgArray_Double cfg_pest_product_amounts
Amount of pesticide applied in grams of active substance per hectare for each of the 10 pesticides.
Landscape::SupplyTempPeriod
double SupplyTempPeriod(long a_date, int a_period)
Passes a request on to the associated Weather class function, the total temperature from a_date and a...
Definition: Landscape.h:2054
Population_Manager::PushIndividual
void PushIndividual(const unsigned a_listindex, TAnimal *a_individual_ptr)
Definition: PopulationManager.cpp:1682
probability_distribution::Get
double Get() const
Definition: ALMaSS_Random.cpp:283
Population_Manager::SupplyListSize
unsigned SupplyListSize(unsigned listindex) const
Definition: PopulationManager.h:726
Population_Manager::Population_Manager
Population_Manager(Landscape *a_l_ptr, int a_numberLifeStages=12)
Definition: PopulationManager.cpp:200
Osmia_Population_Manager::CreateObjects
void CreateObjects(TTypeOfOsmiaLifeStages ob_type, TAnimal *pvo, struct_Osmia *data, int number)
Method for creating a new individual Osmia.
Definition: Osmia_Population_Manager.cpp:492
PopulationManagerList::GetPopulation
Population_Manager_Base * GetPopulation(int a_pt, int a_index=0)
Definition: PopulationManager.h:962
struct_Osmia::OPM
Osmia_Population_Manager * OPM
Osmia_Population_Manager pointer.
Definition: Osmia_Population_Manager.h:175
cfg_MinimumCellConstructionTime
static CfgInt cfg_MinimumCellConstructionTime("OSMIA_MINCELLCONSTRUCTTIME", CFG_CUSTOM, 1)
The minimum time to construct a cell in days.
cfg_OsmiaOverwinterDegreeDaysInitialSimu
static CfgFloat cfg_OsmiaOverwinterDegreeDaysInitialSimu("OSMIA_OVERWINTER_DEGREE_DAYS_INITIAL_SIMU", CFG_CUSTOM, 320)
The accumulated overwinter degree days for cocoon when initialising the simulations.
Osmia_Female::SetCocoonToProvisionMass
static void SetCocoonToProvisionMass(double a_ratio)
Set the conversion ratio cocoon to provisioning.
Definition: Osmia.h:663
Osmia_Female::SetMaximumCellConstructionTime
static void SetMaximumCellConstructionTime(double a_time)
Set maximum cell construction time.
Definition: Osmia.h:682
Osmia_Female::SetMinimumCellConstructionTime
static void SetMinimumCellConstructionTime(double a_time)
Set minimum cell construction time.
Definition: Osmia.h:680
APoint::m_y
int m_y
Definition: ALMaSS_Setup.h:56
Osmia_Population_Manager::Init
void Init()
Used to collect data initialisation together.
Definition: Osmia_Population_Manager.cpp:344
Osmia_Female::SetDailyMort
static void SetDailyMort(double a_prob)
Record the daily mortality parameter values.
Definition: Osmia.h:655
Osmia_Female::SetParasitismProbToTimeCellOpen
static void SetParasitismProbToTimeCellOpen(double a_ratio)
Set the conversion ratio time cell open to open cell parasitism.
Definition: Osmia.h:688
Weather::GetRainHour
double GetRainHour(int hour)
Definition: Weather.h:470
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