![]() |
ALMaSS
1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
|
#include <Oedothorax_Population_Manager.h>
Public Member Functions | |
Oedothorax_Population_Manager (Landscape *p_L) | |
virtual void | Init (void) |
An initiation method to initialise all the necessary values - must be overridden for species specific functionality More... | |
virtual void | DoFirst (void) |
DoFirst method, to be overridden in descendent classes More... | |
virtual | ~Oedothorax_Population_Manager () |
void | CreateObjects (int ob_type, TAnimal *pvo, struct_Spider *data, int number) |
Creates new spider objects - this must be overridden in descendent classes More... | |
virtual void | TheAOROutputProbe () |
A method to generate the AOR probe output More... | |
virtual void | TheRipleysOutputProbe (FILE *a_prb) |
A method to generate the Ripley probe output More... | |
![]() | |
int | GetEggSacSpread () |
Return the EggSacSpread value More... | |
int | GetDoubleEggSacSpread () |
Return 2 x EggSacSpread value More... | |
double | GetBallooningMortalityPerMeter () |
Return ballooning mortality per meter More... | |
int | GetDaysSinceRain () |
Return the number of days since rain More... | |
int | GetTodaysMonth () |
Return current month More... | |
double | GetTodaysDroughtSc (int index) |
Returns the drought score for high, medium or low plant biomass More... | |
double | GetJuvMort () |
Return current juvenile mortality rate More... | |
int | GetDispDist (int chance) |
Returns the dispsersal distance associated with a particular frequency value More... | |
double | GetBTime (int day) |
Returns ballooning hours for a given day More... | |
double | GetBTimeToday () |
Returns todays ballooning time More... | |
int | GetWindDirection () |
Returns the wind direction More... | |
bool | IsBallooningWeather () |
Returns the flag for ballooning weather More... | |
double | GetEggDegreesPoor () |
Returns todays egg sac production day degrees for poor food More... | |
double | GetEggDegreesInt () |
Returns todays egg sac production day degrees for intermediate food More... | |
double | GetEggDegreesGood () |
Returns todays egg sac production day degrees for good food More... | |
double | GetJuvDegrees_good () |
Returns todays juvenile development day degrees for good food More... | |
double | GetJuvDegrees_intermediate () |
Returns todays juvenile development day degrees for intermediate food More... | |
double | GetJuvDegrees_poor () |
Returns todays juvenile development day degrees for poor food More... | |
double | GetEggDevelDegrees (int day) |
Returns todays egg development day degrees More... | |
bool | CheckHumidity (int, int) |
Returns humid or not More... | |
bool | GetWalking () |
Returns walking only flag More... | |
bool | GetMinWalkTemp () |
Returns the minimum walking temperature More... | |
Spider_Population_Manager (Landscape *p_L, int N) | |
The constructor More... | |
virtual | ~Spider_Population_Manager () |
Destructor More... | |
bool | InSquare (int p_x, int p_y, int p_sqx, int p_sqy, int p_range) |
Returns true if p_x,p_y is inside the square defined by p_sqz,p_sqy as TL corner and p_range size length More... | |
![]() | |
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 TAnimal * | SupplyAnimalPtr (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 () |
TAnimal * | FindIndividual (unsigned Type, TAnimal *a_me) |
virtual TAnimal * | FindClosest (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 () |
![]() | |
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 TAnimal * | FindClosest (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 | |
void | Catastrophe () |
Allows for the possibility to create population level mortality More... | |
![]() | |
virtual bool | StepFinished () |
Methods to run the simulations. More... | |
virtual void | DoBefore () |
virtual void | DoAfter () |
virtual void | DoLast () |
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) |
![]() | |
~Population_Manager_Base ()=default | |
Additional Inherited Members | |
![]() | |
MovementMapUnsigned * | m_MoveMap |
A representation of the landscape in terms of quality - NB MUST be assigned by the descendent population manager class Init() method More... | |
SimplePositionMap * | m_EggPosMap |
Pointer to the egg position map More... | |
SimplePositionMap * | m_JuvPosMap |
Pointer to the egg position map More... | |
SimplePositionMap * | m_AdultPosMap |
Pointer to the egg position map More... | |
![]() | |
bool | ProbesSet {} |
![]() | |
Probe_Data * | TheProbe [100] = {nullptr} |
Holds a list of pointers to standard output probes. More... | |
![]() | |
static std::array< int, 31 > | m_DispDistances |
An array to hold the dispersal distances possible as a probability 0-30 (x out of 10000) More... | |
![]() | |
double | m_DailyJuvMort |
The daily probability of a juvenile dying - to be assigned in a descendent classes population manager More... | |
int | m_DispersalDistances [10000] |
The distribution of dispersal distances - to be assigned in a descendent classes population manager More... | |
double | BallooningHrs [52 *7] |
The daily number of ballooning hours - to be assigned in a descendent classes population manager More... | |
int | m_DaysSinceRain |
The number of days since last rain More... | |
int | m_TodaysMonth |
Holds the current month More... | |
double | m_TodaysDroughtScore [3] |
Holds the current drought score for three vegetation classes More... | |
double | m_TodaysBallooningTime |
The current day's ballooning time More... | |
int | m_EggSacSpread |
Used to spread spiderlings on day 1 of hatch - to be assigned in a descendent classes population manager More... | |
int | m_DoubleEggSacSpread |
Twice the m_EggSacSpread, used to save multiplications More... | |
double | m_BallooningMortalityPerMeter |
The mortality of ballooned distance - to be assigned in a descendent classes population manager More... | |
bool | m_EggProdThresholdPassed |
A flag for passing minimum temperature for producing eggs. More... | |
int | m_WindDirection |
Todays wind direction More... | |
bool | m_BallooningWeather |
A flag for whether the weather is correct for ballooning More... | |
int | m_BallooningStart |
A limiter for the day in year to start ballooning - to be assigned in a descendent classes population manager More... | |
int | m_BallooningStop |
A limiter for the day in year to stop ballooning - to be assigned in a descendent classes population manager More... | |
double | m_EggDevelopmentThreshold |
The lower threshold for egg development - to be assigned in a descendent classes population manager More... | |
double | m_EggDevelopmentThreshold2 |
The upper threshold for egg development - to be assigned in a descendent classes population manager More... | |
double | m_EggDegrees [365] |
Cumulative day degrees from 1st Jan More... | |
double | m_JuvDegreesGood |
Contribution to day degrees under good food. More... | |
double | m_JuvDegreesIntermediate |
Contribution to day degrees under intermediate food More... | |
double | m_JuvDegreesPoor |
Contribution to day degrees under poor food More... | |
double | m_EggProdDDegsGood |
Links reproduction to food levels and day degrees - good food. More... | |
double | m_EggProdDDegsInt |
Links reproduction to food levels and day degrees - intermediate food More... | |
double | m_EggProdDDegsPoor |
Links reproduction to food levels and day degrees - poor food More... | |
bool | m_WalkingOnly |
A flag to denote the spider does not balloon More... | |
bool | m_MinWalkTemp |
A flag to show whether minimum walking temperature is reached More... | |
double | m_MinWalkTempThreshold |
A minimum dispersal by walking temperature More... | |
![]() | |
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_Probe * | m_AOR_Probe {} |
A pointer to the AOR probe. More... | |
long int | lamdagrid [2][257][257] {} |
![]() | |
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... | |
Landscape * | m_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... | |
Oedothorax_Population_Manager::Oedothorax_Population_Manager | ( | Landscape * | p_L | ) |
Loads the list of Animal Classes.
References Init(), Population_Manager_Base::m_ListNameLength, and Population_Manager_Base::m_ListNames.
|
virtual |
References Spider_Population_Manager::m_MoveMap.
|
protectedvirtual |
Allows for the possibility to create population level mortality
Reimplemented from Spider_Population_Manager.
References cfg_PmEventfrequency, cfg_PmEventsize, g_random_fnc(), Population_Manager::GetLiveArraySize(), Spider_Base::KillThis(), Population_Manager_Base::m_TheLandscape, Population_Manager::SupplyAnimalPtr(), Landscape::SupplyDayInYear(), Landscape::SupplyYearNumber(), and CfgInt::value().
|
virtual |
Creates new spider objects - this must be overridden in descendent classes
Reimplemented from Spider_Population_Manager.
References Population_Manager::IncLiveArraySize(), struct_Spider::L, struct_Spider::noEggs, Population_Manager::PushIndividual(), struct_Spider::x, and struct_Spider::y.
Referenced by Init().
|
virtual |
DoFirst method, to be overridden in descendent classes
Reimplemented from Spider_Population_Manager.
References Spider_Population_Manager::BallooningHrs, cfg_Oedothorax_DailyJuvMort, cfg_Oedothorax_DroughtRHThreshold, cfg_Oedothorax_DroughtScaler, cfg_Oedothorax_DroughtTThreshold, cfg_Oedothorax_EggDevelHA, cfg_Oedothorax_EggDevelRHO25, cfg_Oedothorax_EggProducHA, cfg_Oedothorax_EggProducIntemediate, cfg_Oedothorax_EggProducPoor, cfg_Oedothorax_EggProducRHO25, cfg_Oedothorax_EggProducThreshold, cfg_Oedothorax_JuvDevelHA, cfg_Oedothorax_JuvDevelIntermediate, cfg_Oedothorax_JuvDevelPoor, cfg_Oedothorax_JuvDevelRHO25, cfg_Oedothorax_JuvDevelThreshold, cfg_Oedothorax_TempDailyJuvMortParameterA, cfg_Oedothorax_TempDailyJuvMortParameterB, SimplePositionMap::ClearMapValue(), Calendar::Date(), g_date, g_weather, Population_Manager::GetLiveArraySize(), Weather::GetRHPeriod(), Weather::GetTempPeriod(), TAnimal::KillThis(), Spider_Population_Manager::m_BallooningStart, Spider_Population_Manager::m_BallooningStop, Spider_Population_Manager::m_DailyJuvMort, Spider_Population_Manager::m_EggDegrees, Spider_Population_Manager::m_EggDevelopmentThreshold, Spider_Population_Manager::m_EggDevelopmentThreshold2, Spider_Population_Manager::m_EggPosMap, Spider_Population_Manager::m_EggProdDDegsGood, Spider_Population_Manager::m_EggProdDDegsInt, Spider_Population_Manager::m_EggProdDDegsPoor, Spider_Population_Manager::m_EggProdThresholdPassed, Spider_Population_Manager::m_JuvDegreesGood, Spider_Population_Manager::m_JuvDegreesIntermediate, Spider_Population_Manager::m_JuvDegreesPoor, Spider_Population_Manager::m_MinWalkTemp, Spider_Population_Manager::m_MinWalkTempThreshold, Population_Manager_Base::m_TheLandscape, Spider_Population_Manager::m_TodaysBallooningTime, Spider_Population_Manager::m_TodaysDroughtScore, Spider_Population_Manager::m_TodaysMonth, Spider_Population_Manager::m_WalkingOnly, Spider_Population_Manager::m_WindDirection, MinBallooningTemp, TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Population_Manager::SupplyAnimalPtr(), Landscape::SupplyDayInYear(), Landscape::SupplyGlobalDate(), Landscape::SupplyMonth(), Landscape::SupplyTemp(), Landscape::SupplyWind(), Landscape::SupplyWindDirection8(), CfgFloat::value(), and Spider_Female::ZeroEggSacDegrees().
|
virtual |
An initiation method to initialise all the necessary values - must be overridden for species specific functionality
A few objects are created here just to set the species specific parameter values. It is preferred that this is done here rather than the constructure for parameters that are const since this only needs doing once.
Reimplemented from Spider_Population_Manager.
References Population_Manager::BeforeStepActions, cfg_CfgRipleysOutputUsed, cfg_Oedothorax_BallooningDistanceInterval, cfg_Oedothorax_BallooningStart, cfg_Oedothorax_BallooningStop, cfg_Oedothorax_DailyEggMort, cfg_Oedothorax_DailyFemaleMort, cfg_Oedothorax_DailyJuvMort, cfg_Oedothorax_EggDevelConst2, cfg_Oedothorax_EggDevelThreshold, cfg_Oedothorax_EggDevelThreshold2, cfg_Oedothorax_EggProducConst, cfg_Oedothorax_EggSacSpread, cfg_Oedothorax_HatDensityDepMortConst, cfg_Oedothorax_JuvDensityDepMortConst, cfg_Oedothorax_JuvDevelConst2, cfg_Oedothorax_Max_Egg_Production, cfg_Oedothorax_MaxBalloonPercent, cfg_Oedothorax_MaxDistBalloonable, cfg_Oedothorax_SmallestBallooningDistance, cfg_Oedothorax_SpiderMinWalkTemp, cfg_OedothoraxDensityDependentConstantZero, cfg_OedothoraxStartNos, cfg_ReallyBigOutputUsed, count, CreateObjects(), g_random_fnc(), SimplePositionMap::GetMapValue(), struct_Spider::L, Spider_Population_Manager::m_AdultPosMap, Spider_Population_Manager::m_BallooningMortalityPerMeter, Spider_Population_Manager::m_BallooningStart, Spider_Population_Manager::m_BallooningStop, Spider_Egg::m_DailyEggMortConst, Spider_Female::m_DailyFemaleMort, Spider_Population_Manager::m_DailyJuvMort, Spider_Base::m_DenDependenceConst0, Spider_Population_Manager::m_DispDistances, Spider_Juvenile::m_DispersalChance, Spider_Population_Manager::m_DispersalDistances, Spider_Population_Manager::m_DoubleEggSacSpread, Spider_Egg::m_EggDevelConst, Spider_Population_Manager::m_EggDevelopmentThreshold, Spider_Population_Manager::m_EggDevelopmentThreshold2, Spider_Female::m_EggProducConst, Spider_Population_Manager::m_EggSacSpread, Population_Manager::m_guard_cell_size, Spider_Egg::m_HatDensityDepMortConst, Spider_Juvenile::m_JuvDensityDepMortConst, Spider_Juvenile::m_JuvDevelConst, Population_Manager::m_MapGuard, Spider_Female::m_Max_Egg_Production, Spider_Population_Manager::m_MinWalkTempThreshold, Spider_Population_Manager::m_MoveMap, Population_Manager::m_population_type, Spider_Base::m_SimH, Population_Manager_Base::m_SimulationName, Spider_Base::m_SimW, Population_Manager_Base::m_TheLandscape, Oedothorax_DispersalChance, Population_Manager::OpenTheReallyBigProbe(), Population_Manager::OpenTheRipleysOutputProbe(), Population_Manager::ReallyBigOutputPrb, SimplePositionMap::SetMapValue(), struct_Spider::SpPM, Landscape::SupplySimAreaHeight(), Landscape::SupplySimAreaWidth(), TOP_Oedothorax, tspi_Female, CfgInt::value(), CfgFloat::value(), CfgBool::value(), struct_Spider::x, and struct_Spider::y.
Referenced by Oedothorax_Population_Manager().
|
virtual |
A method to generate the AOR probe output
Reimplemented from Spider_Population_Manager.
References AOR_Probe::DoProbe(), and Population_Manager::m_AOR_Probe.
|
virtual |
A method to generate the Ripley probe output
Reimplemented from Spider_Population_Manager.
References Population_Manager::GetLiveArraySize(), Population_Manager_Base::m_TheLandscape, TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Population_Manager::SupplyAnimalPtr(), and Landscape::SupplySimAreaWidth().