Loading [MathJax]/extensions/ams.js
 |
ALMaSS
1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
|
Go to the documentation of this file.
36 #ifndef PopulationManagerH
37 #define PopulationManagerH
42 #include <forward_list>
442 void FileOutput(
int No,
int time,
int ProbeNo)
const;
446 ofstream*
OpenFile(
const string& Nme);
450 if (!(*m_MyFile).is_open())
501 if (
m_n < 1)
return -1;
575 virtual void Run(
int a_NoTSteps) {
576 for (
int i = 0; i < a_NoTSteps; i++)
666 unsigned int FarmAnimalCensus(
unsigned int a_farm,
unsigned int a_typeofanimal);
672 void LOG(
const char* fname);
674 void Run(
int NoTSteps)
override;
705 while(temp_animal_num < a_animal){
709 if(temp_animal_num == a_animal){
727 int return_value = 0;
758 omp_set_nest_lock(
m_MapGuard[a_y_index][a_x_index]);
764 omp_unset_nest_lock(
m_MapGuard[a_y_index][a_x_index]);
774 if(a_index_x != temp_index_x || a_index_y != temp_index_y){
775 omp_unset_nest_lock(
m_MapGuard[a_index_y][a_index_x]);
776 omp_set_nest_lock(
m_MapGuard[temp_index_y][temp_index_x]);
777 a_index_x = temp_index_x;
778 a_index_y = temp_index_y;
830 virtual void SortX(
unsigned Type);
832 virtual void SortY(
unsigned Type);
837 virtual void Shuffle(
unsigned Type);
881 lamdagrid[1][x / __lgridsize][y / __lgridsize]++;
886 for (
int i = 0; i < 257; i++)
888 for (
int j = 0; j < 257; j++)
910 ,
int ,
int ,
int ) {
913 ,
int& ) {
return 0; }
949 void SetPopulation(std::shared_ptr<Population_Manager_Base> p_pm,
int a_pt) {
std::vector< std::shared_ptr< Population_Manager_Base > > m_populationlist[static_cast< int >(TOP_foobar)]
Definition: PopulationManager.h:971
int SupplySimHH() const
Returns half the landscape height in m.
Definition: PopulationManager.h:573
Base class for all population managers.
Definition: PopulationManager.h:554
FILE * TestFile2
Definition: PopulationManager.h:817
Definition: PopulationManager.h:59
int Supply_m_Location_x() const
Returns the ALMaSS x-coordinate.
Definition: PopulationManager.h:239
Probe_Data()
Definition: PopulationManager.cpp:1656
Definition: PopulationManager.h:68
int m_Time
Definition: PopulationManager.h:424
CfgInt cfg_RipleysOutput_interval("G_RIPLEYSOUTPUT_INTERVAL", CFG_CUSTOM, 1)
Definition: PopulationManager.h:81
Definition: MapErrorMsg.h:37
ofstream * OpenFile(const string &Nme)
Definition: PopulationManager.cpp:1666
PesticideToxicity m_my_pesticide
Definition: PopulationManager.h:379
double g_rand_uni_fnc()
Definition: ALMaSS_Random.cpp:56
APoint SupplyPoint() const
Returns the objects location in ALMaSS coordinates.
Definition: PopulationManager.h:222
virtual void KillThis()
Sets all parameters ready for object destruction.
Definition: PopulationManager.h:263
void UnsetGuardMapElement(unsigned a_x_index, unsigned a_y_index)
Unset the given guard map cell.
Definition: PopulationManager.h:762
void SetStepDone(bool a_bool)
Sets the step done indicator flag.
Definition: PopulationManager.h:143
Test the given animal's y-coordinate against the given y-coordinate.
Definition: PopulationManager.h:411
static void SetSimulationWidth(int a_value)
Sets the simulation width.
Definition: PopulationManager.h:321
virtual void Step()
Step behaviour - must be implemented in descendent classes.
Definition: PopulationManager.h:148
TTypesOfVegetation TranslateVegTypes(int VegReference)
Returns vegetation type translated from the ALMaSS reference number.
Definition: Landscape.h:2326
bool operator()(TAnimal *a_a1, int a_x) const
Definition: PopulationManager.h:413
Definition: PopulationManager.h:94
AnimalPosition SupplyPosition() const
Returns the objects location and habitat type and veg type.
Definition: PopulationManager.cpp:1533
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
double SupplyTemp(void)
Passes a request on to the associated Weather class function, the temperature for the current day.
Definition: Landscape.h:1993
virtual void DoLast()
Definition: PopulationManager.cpp:656
double get_SD()
Returns the sample standard deviation.
Definition: PopulationManager.h:521
std::vector< std::vector< omp_nest_lock_t * > > m_MapGuard
This is used to make sure animals will not behaviour at the same area - multi threads.
Definition: PopulationManager.h:790
int SupplyPolygonRef() const
Returns the polygon reference where the object is located.
Definition: PopulationManager.h:229
bool m_TargetTypes[16]
Definition: PopulationManager.h:441
static void SetTempToday(double a_value)
Sets the temperature today attribute.
Definition: PopulationManager.h:337
TTypesOfVegetation SupplyVegType(int a_x, int a_y)
Returns the vegetation type of the polygon using the polygon reference number a_polyref or coordinate...
Definition: Landscape.h:1925
Test the given animal's x-coordinate against the given x-coordinate.
Definition: PopulationManager.h:400
int SupplyListNameLength() const
Definition: PopulationManager.h:589
Definition: PopulationManager.h:464
vector< vector< int > > TheSubArraysSizes
Hold all the animal sizes in each thread.
Definition: PopulationManager.h:806
TTypesOfLandscapeElement SupplyElementType(int a_polyref)
Returns the landscape type of the polygon using the polygon reference number a_polyref or coordinates...
Definition: Landscape.h:1732
int m_guard_cell_width_num
Definition: PopulationManager.h:792
CfgInt cfg_ProbeTargetTypesNo("PROBE_TARGET_TYPES_NO", CFG_CUSTOM, 10, 1, 16)
virtual void Shuffle_or_Sort(unsigned Type)
Definition: PopulationManager.cpp:1255
virtual void EndStep()
EndStep behaviour - must be implemented in descendent classes.
Definition: PopulationManager.h:151
bool m_FullLandscapeProbe
Definition: PopulationManager.h:429
int SupplySimH() const
Returns landscape height in m.
Definition: PopulationManager.h:569
double m_Sum
Definition: PopulationManager.h:472
int GetStepCounterInADay(void)
Return the sep counter in a day.
Definition: PopulationManager.h:605
unsigned StateNamesLength
Definition: PopulationManager.h:815
TTypesOfPopulation m_population_type
Definition: PopulationManager.h:858
void SetPopulation(std::shared_ptr< Population_Manager_Base > p_pm, int a_pt)
Definition: PopulationManager.h:949
Definition: PesticideToxicity.h:63
Definition: LandscapeFarmingEnums.h:183
Definition: PopulationManager.h:73
char * value() const
Definition: Configurator.h:182
static void setLandscapePointer(Landscape *a_landscape)
The function to set the static landscape pointer.
Definition: PesticideToxicity.h:60
A struct of 100 ints.
Definition: PopulationManager.h:103
vector< unsigned > BeforeStepActions
Holds the season list of possible before step actions.
Definition: PopulationManager.h:819
virtual int TheBreedingFemalesProbe(int)
Definition: PopulationManager.h:907
char * AnsiString
Definition: PopulationManager.h:49
Definition: PopulationManager.h:69
A small class to hold the pointers to active population managers.
Definition: PopulationManager.h:946
void FileAppendOutput(int No, int time) const
Definition: PopulationManager.cpp:1641
The base class of all ALMaSS objects requiring Step code.
Definition: PopulationManager.h:128
CfgInt cfg_ReallyBigOutput_day1("G_REALLYBIGOUTPUT_DAY_ONE", CFG_CUSTOM, 1)
CfgInt cfg_MapGuardCellSize("MAP_GUARD_CELL_SIZE", CFG_CUSTOM, 20)
The size to create the map guard.
None_Population_Manager(Landscape *L)
Definition: PopulationManager.h:934
Population_Manager_Base(Landscape *L)
The Population_Manager_Base constructor.
Definition: PopulationManager.cpp:182
int m_guard_cell_y
The index y to the guard cell.
Definition: PopulationManager.h:374
char * SpeciesSpecificReporting(int a_species, int a_time) override
Definition: PopulationManager.cpp:1300
String configurator entry class.
Definition: Configurator.h:173
Definition: PopulationManager.h:70
void CloseFile() const
Definition: PopulationManager.cpp:115
Definition: PopulationManager.h:82
virtual void SupplyLocXY(unsigned, unsigned, int &, int &)
A stub for identifying an individual at a location.
Definition: PopulationManager.h:593
const char * m_ListNames[32]
A list of life-stage names.
Definition: PopulationManager.h:628
ofstream * AOROutputPrb
Definition: PopulationManager.h:859
void Run(int NoTSteps) override
Definition: PopulationManager.cpp:350
virtual void BeginStep()
BeingStep behaviour - must be implemented in descendent classes.
Definition: PopulationManager.h:145
virtual int ProbeFileInput(char *p_Filename, int p_ProbeNo)
A stub to build specfic probes and functions.
Definition: PopulationManager.cpp:672
ofstream * RipleysOutputPrb4
Definition: PopulationManager.h:864
CfgBool cfg_Fixed_random_sequence("G_FIXEDRANDOMSEQUENCE", CFG_CUSTOM, false)
bool OpenForAppendToFile()
Definition: PopulationManager.h:448
Definition: PopulationManager.h:78
virtual int SupplyCovPosy(int)
Definition: PopulationManager.h:901
Function to compare to TAnimal's m_CurrentStateNo to anything but -1.
Definition: PopulationManager.cpp:143
omp_nest_lock_t * GetGuardMapElement(unsigned a_x_index, unsigned a_y_index)
Return the guard map cell.
Definition: PopulationManager.h:750
CfgInt cfg_RipleysOutputFirstYear("G_RIPLEYSOUTPUT_FIRSTYEAR", CFG_CUSTOM, 1)
virtual int SupplyCovPosx(int)
Definition: PopulationManager.h:900
int SimHH
stores the simulation height halved
Definition: PopulationManager.h:618
int SupplyGuardCellX() const
Returns the x-index to the guard cell.
Definition: PopulationManager.h:247
virtual void BreedingSuccessProbeOutput(double, int, int, int, int, int, int, int)
Definition: PopulationManager.h:909
ofstream * RipleysOutputPrb6
Definition: PopulationManager.h:866
FILE * TestFile
Definition: PopulationManager.h:816
virtual void CloseTheRipleysOutputProbe()
Definition: PopulationManager.cpp:1020
FarmToDo
Definition: Treatment.h:31
int SupplyMonth(void)
Passes a request on to the associated Calendar class function, returns m_month + 1 (the calendar mont...
Definition: Landscape.h:2272
double m_K
Definition: PopulationManager.h:470
int m_StepSize
Definition: PopulationManager.h:802
static int m_DayInYear
A holder for the day in year shared with all TAnimal objects.
Definition: PopulationManager.h:358
unsigned m_x
Definition: PopulationManager.h:173
ofstream * RipleysOutputPrb
Definition: PopulationManager.h:860
unsigned m_y1
Definition: PopulationManager.h:117
Definition: PopulationManager.h:65
void SetX(const int a_x)
Sets the x-coordinate.
Definition: PopulationManager.h:277
Definition: PopulationManager.cpp:134
Definition: PopulationManager.h:92
void FillVegAreaData()
Runs through all polygons and records the area of each vegetation type.
Definition: Landscape.cpp:5712
void SetGuardMapElement(unsigned a_x_index, unsigned a_y_index)
Set the given guard map cell.
Definition: PopulationManager.h:756
vector< int > m_LifeStageOrderVec
The vector to store the life stage order for looping specie life stages.
Definition: PopulationManager.h:808
int m_ListNameLength
the number of life-stages simulated in the population manager
Definition: PopulationManager.h:626
Definition: PopulationManager.h:62
virtual void Dying()
A wrapped for KillThis - ideally should not be used.
Definition: PopulationManager.h:305
vector< forward_list< TAnimal * >::iterator > TheSubArraysIterators
the iterator from last time called for SupplyAnimalPtr(), this for fast loop all the animals in the d...
Definition: PopulationManager.h:810
ofstream * RipleysOutputPrb3
Definition: PopulationManager.h:863
void SortXIndex(unsigned Type)
virtual void RunStepMethods()
Definition: PopulationManager.cpp:521
unsigned SupplyFarmOwnerRef() const
Get the current location farm ref if any.
Definition: PopulationManager.cpp:1547
int SupplySimWH() const
Returns half the landscape width in m.
Definition: PopulationManager.h:571
void ImpactProbeReport(int a_Time)
Definition: PopulationManager.cpp:1513
unsigned m_x2
Definition: PopulationManager.h:118
virtual bool OpenTheFledgelingProbe()
Definition: PopulationManager.h:902
double m_SumX2
Definition: PopulationManager.h:474
void CloseTheMonthlyRipleysOutputProbe() const
Definition: PopulationManager.cpp:1029
bool value() const
Definition: Configurator.h:164
void SortState(unsigned Type)
Definition: PopulationManager.cpp:1159
Landscape * m_TheLandscape
holds an internal pointer to the landscape
Definition: PopulationManager.h:624
virtual void TheRipleysOutputProbe(ofstream *a_prb)
Special output functionality.
Definition: PopulationManager.cpp:1061
int SimWH
stores the simulation width halved
Definition: PopulationManager.h:620
virtual char * SpeciesSpecificReporting(int, int)
A stub to build specfic reporting.
Definition: PopulationManager.h:586
TAnimal(int x, int y, Landscape *L)
The TAnimal constructor saving the x,y, location and the landscape pointer.
Definition: PopulationManager.cpp:1553
Data structure to hold & output probe data probe data is designed to be used to return the number of ...
Definition: PopulationManager.h:421
int GetSeasonNumber()
Get the season number.
Definition: PopulationManager.h:855
void CheckManagementXY(int a_x, int a_y)
Used to start a check for any management related effects at x,y.
Definition: PopulationManager.cpp:1603
static CfgInt cfg_DayInMonth("PRB_DAYINMONTH", CFG_CUSTOM, 1)
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.
Definition: PopulationManager.h:634
TTypesOfVegetation m_RefVeg[25]
Definition: PopulationManager.h:437
virtual unsigned Probe(int ListIndex, Probe_Data *p_TheProbe)
Definition: PopulationManager.cpp:792
AOR_Probe * m_AOR_Probe
A pointer to the AOR probe.
Definition: PopulationManager.h:875
Definition: PopulationManager.h:67
TTypesOfLandscapeElement
Values that represent the types of landscape polygon that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:57
Definition: PopulationManager.h:75
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
void LamdaClear()
Definition: PopulationManager.h:885
virtual unsigned GetPopulationSize(int a_listindex)
Must be re-implemented in descendent classes.
Definition: PopulationManager.h:562
Definition: PopulationManager.h:64
vector< int > TheSubArrayThreadIndex
the thread index number from last time called for SupplyAnimalPtr(), this for fast loop all the anima...
Definition: PopulationManager.h:814
void LamdaBirth(int x, int y)
Definition: PopulationManager.h:883
double get_SE()
Returns the sample standard error.
Definition: PopulationManager.h:529
int SimH
stores the simulation height
Definition: PopulationManager.h:614
CfgInt cfg_ReallyBigOutput_interval("G_REALLYBIGOUTPUT_INTERVAL", CFG_CUSTOM, 1)
ofstream * RipleysOutputPrb11
Definition: PopulationManager.h:871
bool operator()(TAnimal *a_a1, int a_x) const
Definition: PopulationManager.h:402
ofstream * RipleysOutputPrb1
Definition: PopulationManager.h:861
TTypesOfPopulation g_Species
Definition: PopulationManager.cpp:101
Part of the basic ALMaSS system (obselete) Communicates the range centre, age and size of animals to ...
Definition: PopulationManager.h:185
virtual void Catastrophe(int)
Must be re-implemented in descendent classes.
Definition: PopulationManager.h:564
int SupplyStepSize() const
Definition: PopulationManager.h:673
int SupplyDayInMonth(void)
Passes a request on to the associated Calendar class function, returns m_day_in_month
Definition: Landscape.h:2277
CfgInt cfg_ReallyBigOutput_day2("G_REALLYBIGOUTPUT_DAY_TWO", CFG_CUSTOM, 91)
A struct defining two x,y coordinate sets of positive co-ords only.
Definition: PopulationManager.h:114
virtual TAnimal * FindClosest(int, int, unsigned)
A stub for identifying an individual at a location.
Definition: PopulationManager.h:596
Definition: PopulationManager.h:84
int SupplySimAreaHeight(void)
Gets the simulation landscape height.
Definition: Landscape.h:2302
void SetSpeciesFunctions(TTypesOfPopulation a_species)
This is the jumping off point for any landscape related species setup, it creates function pointers t...
Definition: Landscape.cpp:7821
int SupplyFarmOwner(int a_x, int a_y)
Returns the farm owner pointer for the polygon referenced by a_polyref or a_x, a_y.
Definition: Landscape.h:1774
static void SetDayInYear(int a_value)
Sets the day in year attribute.
Definition: PopulationManager.h:329
int SupplySimAreaWidth(void)
Gets the simulation landscape width.
Definition: Landscape.h:2297
int m_Location_y
The objects ALMaSS y coordinate.
Definition: PopulationManager.h:366
TTypesOfLandscapeElement TranslateEleTypes(int EleReference)
Returns element type translated from the ALMaSS reference number.
Definition: Landscape.h:2313
virtual void TheReallyBigOutputProbe()
Definition: PopulationManager.cpp:1056
double get_meanvalue() const
Returns the mean.
Definition: PopulationManager.h:500
A simple class defining an x,y coordinate set.
Definition: ALMaSS_Setup.h:52
~Population_Manager_Base()=default
virtual void DoBefore()
Definition: PopulationManager.cpp:341
ofstream * RipleysOutputPrb9
Definition: PopulationManager.h:869
void LamdaBirth(int x, int y, int z)
Definition: PopulationManager.h:884
Definition: PopulationManager.h:63
static Landscape * m_OurLandscape
A pointer to the landscape object shared with all TAnimal objects.
Definition: PopulationManager.h:342
Bool configurator entry class.
Definition: Configurator.h:155
void CheckManagement()
Used to start a check for any management related effects at the objects current location.
Definition: PopulationManager.cpp:1591
std::string m_ProbeFileName
name of the Probe file
Definition: PopulationManager.h:632
virtual bool OnFarmEvent(FarmToDo)
Must be reimplemented if used in descendent classes. Sets the action on a management event.
Definition: PopulationManager.h:317
CfgInt cfg_ReallyBigOutput_day3("G_REALLYBIGOUTPUT_DAY_THREE", CFG_CUSTOM, 182)
Class to handle statistics and constructs based on allele frequencies.
Definition: GeneticMaterial.h:61
bool operator()(TAnimal *&A1, TAnimal *&A2) const
Definition: PopulationManager.cpp:166
int Supply_m_Location_y() const
Returns the ALMaSS y-coordinate.
Definition: PopulationManager.h:243
void LamdaDumpOutput()
Definition: PopulationManager.cpp:771
The base class for all ALMaSS animal classes. Includes all the functionality required to be handled b...
Definition: PopulationManager.h:200
int m_SeasonNumber
Holds the season number. Used when running goose and hunter sims.
Definition: PopulationManager.h:821
Function to compare to TAnimal's m_Location_x.
Definition: PopulationManager.cpp:127
static int m_SimulationWidth
A static member for the simulation width because it is often used by descendent classes.
Definition: PopulationManager.h:346
unsigned SupplyStateNamesLength() const
Definition: PopulationManager.h:739
void SetY(const int a_y)
Sets the y-coordinate.
Definition: PopulationManager.h:281
unsigned m_NoEleTypes
Definition: PopulationManager.h:434
void setHostAnimalPointer(TAnimal *animal)
The function to set the host animal pointer.
Definition: PesticideToxicity.h:106
static void SetSimulationHeight(int a_value)
Sets the simulation height.
Definition: PopulationManager.h:325
CfgInt cfg_PmEventsize("PM_EVENTSIZE", CFG_CUSTOM, 100)
void OpenTheAOROutputProbe(const string &a_AORFilename) override
Opens the AOR output file.
Definition: PopulationManager.cpp:295
A class defining an animals position.
Definition: PopulationManager.h:169
double m_Size
Definition: PopulationManager.h:187
Definition: AOR_Probe.h:4
to_BeforeStepActions
Definition: PopulationManager.h:90
char m_MyFileName[255]
Definition: PopulationManager.h:425
APoint m_OldRange
Definition: PopulationManager.h:190
PopulationManagerList()
Definition: PopulationManager.h:948
Definition: PopulationManager.h:58
std::string m_AORProbeFileName
name of the AOR Probe file
Definition: PopulationManager.h:630
virtual void ImpactedProbe()
Definition: PopulationManager.cpp:785
const char * SupplyStateNames(int i) const
Definition: PopulationManager.h:738
bool operator()(TAnimal *&A1) const
Definition: PopulationManager.cpp:145
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
void SetCurrentStateNo(int a_num)
Sets the current state number.
Definition: PopulationManager.h:139
CfgBool cfg_RipleysOutputMonthly_used("G_RIPLEYSOUTPUTMONTHLY_USED", CFG_CUSTOM, false)
Base class for all population managers for agent based models.
Definition: PopulationManager.h:645
bool operator()(TAnimal *A1) const
Definition: PopulationManager.cpp:175
rectangle m_Rect[16]
Definition: PopulationManager.h:433
ofstream * RipleysOutputPrb5
Definition: PopulationManager.h:865
Definition: PopulationManager.h:66
virtual void OpenTheAOROutputProbe(const string &a_string)
An empty method that needs to be here because the population manager lists might contain sub-populati...
Definition: PopulationManager.h:599
int SupplyDayInYear(void)
Passes a request on to the associated Calendar class function, the day in the year.
Definition: Landscape.h:2267
int m_AgeDays
To hold the age in days.
Definition: PopulationManager.h:378
Definition: PopulationManager.h:83
virtual void ReinitialiseObject(int a_x, int a_y)
Used to re-use an object - must be implemented in descendent classes.
Definition: PopulationManager.h:292
long int lamdagrid[2][257][257]
Definition: PopulationManager.h:877
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
Definition: PopulationManager.h:133
bool m_is_paralleled
This is used to indicate whether the species is paralleled.
Definition: PopulationManager.h:796
virtual int SupplyPegPosx(int)
Definition: PopulationManager.h:898
Definition: PopulationManager.h:85
double get_varianceS()
Returns the sample variance.
Definition: PopulationManager.h:513
unsigned m_y2
Definition: PopulationManager.h:119
Definition: PopulationManager.h:80
ofstream * RipleysOutputPrb2
Definition: PopulationManager.h:862
int SupplyYearNumber(void)
Passes a request on to the associated Calendar class function, returns m_simulationyear
Definition: Landscape.h:2287
std::array< bool, TOP_foobar > m_populationarray
Definition: PopulationManager.h:972
virtual TAnimal * FindClosest(int x, int y, unsigned Type, TAnimal *a_me)
Definition: PopulationManager.cpp:1102
static CfgStr cfg_ReallyBigOutput_filename("G_REALLYBIGOUTPUT_FILENAME", CFG_CUSTOM, "ReallyBigOutput.txt")
char g_Str[255]
Definition: PopulationManager.cpp:99
Definition: PopulationManager.h:95
double get_varianceP()
Returns the population variance.
Definition: PopulationManager.h:505
unsigned m_ReportInterval
Definition: PopulationManager.h:431
virtual int TheFledgelingProbe()
Definition: PopulationManager.h:908
TTypesOfPopulation
An enum to hold all the possible types of population handled by a Population_Manager class.
Definition: PopulationManager.h:57
int value() const
Definition: Configurator.h:116
CfgInt cfg_ReallyBigOutput_day4("G_REALLYBIGOUTPUT_DAY_FOUR", CFG_CUSTOM, 274)
CfgBool cfg_AorOutput_used("G_AOROUTPUT_USED", CFG_CUSTOM, false)
unsigned m_NoVegTypes
Definition: PopulationManager.h:435
TTypesOfLandscapeElement m_EleType
Definition: PopulationManager.h:175
Probe_Data * TheProbe[100]
Holds a list of pointers to standard output probes.
Definition: PopulationManager.h:588
double m_n
Definition: PopulationManager.h:471
SimpleStatistics()=default
SimpleStatistics constructor.
virtual unsigned GetLiveArraySize(int a_listindex)
Must be re-implemented in descendent classes. Gets the number of 'live' objects.
Definition: PopulationManager.h:560
char * ProbeReportTimed(int a_time)
Definition: PopulationManager.cpp:1490
ofstream * RipleysOutputPrb12
Definition: PopulationManager.h:872
double get_N() const
Returns the number of values.
Definition: PopulationManager.h:496
unsigned m_y
Definition: PopulationManager.h:174
virtual int SupplyPegPosy(int)
Definition: PopulationManager.h:899
virtual void DoFirst()
Definition: PopulationManager.cpp:333
int SimW
stores the simulation width
Definition: PopulationManager.h:616
double m_SumX
Definition: PopulationManager.h:473
int GetCurrentStateNo() const
Returns the current state number.
Definition: PopulationManager.h:137
Definition: PopulationManager.h:91
Definition: LandscapeFarmingEnums.h:610
void SetAge(int a_age)
Sets the animals age in days.
Definition: PopulationManager.h:259
void SetStepCounterInADay(int a_counter)
Set step counter in a day.
Definition: PopulationManager.h:603
unsigned m_NoAreas
Definition: PopulationManager.h:432
bool OpenTheRipleysOutputProbe()
Definition: PopulationManager.cpp:897
bool m_FileRecord
Definition: PopulationManager.h:428
void UpdateGuardMap(int a_x, int a_y, int &a_index_x, int &a_index_y)
Get the index of the guard map for the given location.
Definition: PopulationManager.h:768
void remove_variable(double x)
Remove a value.
Definition: PopulationManager.h:489
virtual void CopyMyself()
Used to copy the object details to another in descendent classes.
Definition: PopulationManager.h:273
const char * StateNames[100]
Definition: PopulationManager.h:801
unsigned int FarmAnimalCensus(unsigned int a_farm, unsigned int a_typeofanimal)
Definition: PopulationManager.cpp:1448
virtual int TheBreedingSuccessProbe(int &, int &, int &, int &, int &, int &)
Definition: PopulationManager.h:912
unsigned m_RefFarms[25]
Definition: PopulationManager.h:439
TAnimal * FindIndividual(unsigned Type, TAnimal *a_me)
Definition: PopulationManager.cpp:1078
Definition: PopulationManager.h:76
bool operator()(TAnimal *&A1, TAnimal *&A2) const
Definition: PopulationManager.cpp:157
TTypesOfPopulation GetPopulationType()
Definition: PopulationManager.h:853
static CfgStr cfg_RipleysOutput_filename("G_RIPLEYSOUTPUT_FILENAME", CFG_CUSTOM, "RipleysOutput.txt")
virtual void FledgelingProbeOutput(int, int)
Definition: PopulationManager.h:914
char * ProbeReport(int a_time)
Definition: PopulationManager.cpp:1463
bool OpenTheReallyBigProbe()
Definition: PopulationManager.cpp:1005
CfgInt cfg_RipleysOutput_day("G_RIPLEYSOUTPUT_DAY", CFG_CUSTOM, 60)
Function to compare to TAnimal's m_CurrentStateNo to -1.
Definition: PopulationManager.cpp:173
virtual void DisplayLocations()
Definition: PopulationManager.cpp:661
TTypesOfLandscapeElement GetOwner_tole(int a_x, int a_y)
Returns the landscape type of the polygon owner (used in cases relating to e.g. unsprayed field margi...
Definition: Landscape.h:1742
bool OpenTheMonthlyRipleysOutputProbe()
Definition: PopulationManager.cpp:912
virtual ~TALMaSSObject()=default
The destructor for TALMaSSObject.
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
unsigned GetLiveArraySize(int a_listindex) override
Gets the number of 'live' objects for a list index in the TheArray.
Definition: PopulationManager.h:657
int SupplyActivePopulationsCount()
returns the number of active populations O(1)
Definition: PopulationManager.cpp:1689
ofstream * RipleysOutputPrb7
Definition: PopulationManager.h:867
CfgInt cfg_ReallyBigOutputFirstYear("G_REALLYBIGOUTPUT_FIRSTYEAR", CFG_CUSTOM, 1)
void SetNoProbesAndSpeciesSpecificFunctions(int a_pn) override
Sets up probe and species specifics.
Definition: PopulationManager.cpp:289
static int m_SimulationHeight
A static member for the simulation height because it is often used by descendent classes.
Definition: PopulationManager.h:350
virtual void ReinitialiseObject(int a_x, int a_y, Landscape *a_l_ptr)
Definition: PopulationManager.h:282
Definition: PopulationManager.h:74
bool GetStepDone() const
Returns the step done indicator flag.
Definition: PopulationManager.h:141
virtual void GeneticsResultsOutput(FILE *, unsigned)
Definition: PopulationManager.h:918
static void OnArrayBoundsError()
Used for debugging only, tests basic object properties.
Definition: PopulationManager.cpp:1614
virtual void reset(void)
Reset PesticideToxicity class, this should be called when the host animal is dead.
Definition: PesticideToxicity.cpp:195
virtual void TheGeneticProbe(unsigned, int, unsigned &)
Definition: PopulationManager.h:916
virtual void BreedingPairsOutput(int)
Definition: PopulationManager.h:905
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
unsigned m_x1
Definition: PopulationManager.h:116
Integer configurator entry class.
Definition: Configurator.h:102
CfgInt cfg_AorOutput_interval("G_AORSOUTPUT_INTERVAL", CFG_CUSTOM, 1)
CfgBool l_pest_enable_pesticide_engine
Used to turn on or off the PPP functionality of ALMaSS.
CfgInt cfg_FixedRandomSeed("G_FIXEDRANDOMSEED", CFG_CUSTOM, 0)
static double m_TemperatureToday
A holder for the temperature today shared with all TAnimal objects.
Definition: PopulationManager.h:354
int m_Age
Definition: PopulationManager.h:188
void SortStateR(unsigned Type)
Definition: PopulationManager.cpp:1171
bool BeginningOfMonth()
Definition: PopulationManager.cpp:1282
const char * SupplyListName(int a_i) const
Get a list name from the list.
Definition: PopulationManager.h:591
The base class for all farm types.
Definition: Farm.h:755
int m_guard_cell_x
The index x to the guard cell.
Definition: PopulationManager.h:370
Definition: PopulationManager.h:96
Definition: PopulationManager.h:60
std::shared_ptr< Population_Manager_Base > GetPopulation_smart(int a_pt, int a_index=0)
Definition: PopulationManager.h:966
void FileOutput(int No, int time, int ProbeNo) const
Definition: PopulationManager.cpp:1626
virtual void SortX(unsigned Type)
Definition: PopulationManager.cpp:1135
bool operator()(TAnimal *&A1, TAnimal *&A2) const
Definition: PopulationManager.cpp:136
TTypesOfLandscapeElement SupplyPolygonType() const
Returns the polygon type where the object is located.
Definition: PopulationManager.h:233
Function to compare to TAnimal's Current behavioural state.
Definition: PopulationManager.cpp:155
int SupplyAge() const
Returns the animals age in days.
Definition: PopulationManager.h:255
bool operator()(TAnimal *&A1, TAnimal *&A2) const
Definition: PopulationManager.cpp:129
int g_thread_count
Definition: PopulationManager.cpp:107
virtual unsigned PartitionLiveDead(unsigned Type)
Definition: PopulationManager.cpp:1181
string m_SimulationName
stores the simulation name
Definition: PopulationManager.h:622
int SupplySimW() const
Returns landscape width in m.
Definition: PopulationManager.h:567
const int March
Julian start dates of the month of March.
Definition: Landscape.h:42
virtual unsigned SupplyListIndexSize()
Definition: PopulationManager.h:725
int m_NoProbes
Definition: PopulationManager.h:787
virtual void DoSpecialBetweenLifeStages(int a_life_stage)
Definition: PopulationManager.h:829
vector< int > TheSubArrayPreviousIndex
the animal index number from last time called for SupplyAnimalPtr(), this for fast loop all the anima...
Definition: PopulationManager.h:812
void Debug_Shuffle(unsigned int Type)
unsigned m_NoFarms
Definition: PopulationManager.h:436
CfgInt cfg_PmEventday("PM_EVENTDAY", CFG_CUSTOM, March)
void add_variable(double x)
Add a value.
Definition: PopulationManager.h:480
virtual ~Population_Manager(void)
Definition: PopulationManager.cpp:262
int m_guard_cell_size
Definition: PopulationManager.h:793
ofstream * RipleysOutputPrb8
Definition: PopulationManager.h:868
CfgBool cfg_CfgRipleysOutputUsed("G_RIPLEYSOUTPUT_USED", CFG_CUSTOM, false)
int SupplyGuardCellY() const
Returns the y-index to the guard cell.
Definition: PopulationManager.h:251
Definition: Configurator.h:70
virtual bool StepFinished()
Methods to run the simulations.
Definition: PopulationManager.cpp:632
void CorrectWrapRound()
Corrects wrap around co-ordinate problems.
Definition: PopulationManager.h:383
bool ProbesSet
Definition: PopulationManager.h:743
virtual double GetAphidDensity(int, int)
Return the aphid density, it is only used when aphid simulations are running.
Definition: PopulationManager.h:607
virtual void CloseTheReallyBigOutputProbe()
Definition: PopulationManager.cpp:1048
virtual void Shuffle(unsigned Type)
Definition: PopulationManager.cpp:1229
CfgInt cfg_PmEventfrequency("PM_EVENTFREQUENCY", CFG_CUSTOM, 999999)
Definition: PopulationManager.h:71
int n[100]
Definition: PopulationManager.h:105
void PushIndividual(const unsigned a_listindex, TAnimal *a_individual_ptr)
Definition: PopulationManager.cpp:1682
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:131
CfgBool cfg_ReallyBigOutputUsed("G_REALLYBIGOUTPUT_USED", CFG_CUSTOM, false)
unsigned SupplyListSize(unsigned listindex) const
Definition: PopulationManager.h:726
Population_Manager(Landscape *a_l_ptr, int a_numberLifeStages=12)
Definition: PopulationManager.cpp:200
virtual void Run(int a_NoTSteps)
A place holder for the run function for all population managers, this must be reimplemented in descen...
Definition: PopulationManager.h:575
int SupplyLastTreatment(int a_polyref, int *a_index)
Returns the last treatment recorded for the polygon.
Definition: Landscape.h:1941
APoint m_Range
Definition: PopulationManager.h:189
ofstream * ReallyBigOutputPrb
Definition: PopulationManager.h:873
Population_Manager_Base * GetPopulation(int a_pt, int a_index=0)
Definition: PopulationManager.h:962
Function to compare to TAnimal's m_CurrentStateNo.
Definition: PopulationManager.cpp:164
virtual bool OpenTheBreedingSuccessProbe()
Definition: PopulationManager.h:904
Definition: PopulationManager.h:72
vector< vector< forward_list< TAnimal * > * > > TheSubArrays
Hold all the animal pointers.
Definition: PopulationManager.h:804
std::string SupplySimulationName()
Definition: PopulationManager.h:597
TTypesOfLandscapeElement m_RefEle[25]
Definition: PopulationManager.h:438
void Warn(std::string a_msg1, std::string a_msg2)
Wrapper for the g_msg Warn function.
Definition: Landscape.h:2250
int GetPopulationManagerNum(int a_pt)
Returns the number of population manager,.
Definition: PopulationManager.h:957
ofstream * m_MyFile
Definition: PopulationManager.h:423
double get_Total() const
Returns the mean.
Definition: PopulationManager.h:498
vector< TAnimal * > TListOfAnimals
Definition: PopulationManager.h:50
virtual bool OpenTheBreedingPairsProbe()
Definition: PopulationManager.h:903
int m_Location_x
The objects ALMaSS x coordinate.
Definition: PopulationManager.h:362
unsigned GetPopulationSize(int a_listindex) override
Gets the number of species objects by default it is the same as LiveArray, however it could be differ...
Definition: PopulationManager.h:663
CfgInt cfg_ProbeMaxAreas("PROBE_MAX_AREAS", CFG_CUSTOM, 10, 1, 16)
void LOG(const char *fname)
Definition: PopulationManager.cpp:304
int m_guard_cell_height_num
Definition: PopulationManager.h:791
virtual void TheAOROutputProbe()
Definition: PopulationManager.cpp:1067
int SupplyPolyRef(int a_x, int a_y)
Get the in map polygon reference number from the x, y location.
Definition: Landscape.h:2157
CfgBool l_pest_enable_pesticide_engine
Used to turn on or off the PPP functionality of ALMaSS.
virtual int WhatState()
Returns the objects current state number.
Definition: PopulationManager.h:301
CfgInt cfg_CatastropheEventStartYear("PM_CATASTROPHEEVENTSTARTYEAR", CFG_CUSTOM, 999999)
virtual void SortY(unsigned Type)
Definition: PopulationManager.cpp:1147
Definition: PopulationManager.h:61
void ClearData()
Clears the data.
Definition: PopulationManager.h:537
CfgInt cfg_AorOutput_day("G_AOROUTPUT_DAY", CFG_CUSTOM, 60)
CfgInt cfg_AorOutputFirstYear("G_AOROUTPUT_FIRSTYEAR", CFG_CUSTOM, 1)
Definition: PopulationManager.h:93
void SetFile(ofstream *F)
Definition: PopulationManager.cpp:1680
virtual TAnimal * SupplyAnimalPtr(unsigned int a_index, unsigned int a_animal)
Return the animal pointer for the give life stage and number.
Definition: PopulationManager.h:609
TALMaSSObject()
The constructor for TALMaSSObject.
Definition: PopulationManager.cpp:1578
void ReinitialiseObjectBase()
Used to initialise an object.
Definition: PopulationManager.h:154
vector< unsigned > m_LiveArraySize
Definition: PopulationManager.h:786
ofstream * RipleysOutputPrb10
Definition: PopulationManager.h:870
void LamdaDeath(int x, int y)
Definition: PopulationManager.h:879
void SetGuardMapIndex(int a_index_x, int a_index_y)
Set the guard map index, this is used to avoid two animals operating in the same location when using ...
Definition: PopulationManager.h:207
A class for running simulations without animals.
Definition: PopulationManager.h:932
virtual void Catastrophe()
Definition: PopulationManager.cpp:1289
Definition: Treatment.h:33
static void SetOurLandscape(Landscape *a_value)
Sets the landscape pointer.
Definition: PopulationManager.h:333
virtual void SetNoProbesAndSpeciesSpecificFunctions(int)
A stub to build specfic probes and functions.
Definition: PopulationManager.h:581
virtual void DoAfter()
Definition: PopulationManager.cpp:648
TTypesOfVegetation m_VegType
Definition: PopulationManager.h:176
void IncLiveArraySize(int a_listindex)
Increments the number of 'live' objects for a list index in the TheArray.
Definition: PopulationManager.h:665