|
ALMaSS
1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
|
Base class for all population managers for agent based models.
More...
#include <PopulationManager.h>
|
| 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 | TheAOROutputProbe () |
|
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...
|
|
Base class for all population managers for agent based models.
The core of the handling of animal populations. All time-step code and most input/output is handled by this class and its descendents. This class effectively implements a state machine to facilitate simulation of animal behaviours and handle potential issues with concurrency. The PopulationManager class is never instantiated but must be used by deriving a descendent class.
◆ Population_Manager()
Population_Manager::Population_Manager |
( |
Landscape * |
a_l_ptr, |
|
|
int |
a_numberLifeStages = 12 |
|
) |
| |
Constructor for the Population_Manager class
208 for (
int i = 0; i < a_numberLifeStages; i++)
222 for (
int i = 0; i < a_numberLifeStages; i++)
231 #ifdef __LAMBDA_RECORD
232 ofstream fout(
"LambdaGridOuput.txt", ios_base::out);
References BeforeStepActions, cfg_MapGuardCellSize, cfg_RipleysOutputMonthly_used, g_thread_count, LamdaClear(), m_guard_cell_height_num, m_guard_cell_size, m_guard_cell_width_num, m_is_paralleled, m_LifeStageOrderVec, Population_Manager_Base::m_ListNames, m_LiveArraySize, m_MapGuard, m_SeasonNumber, OpenTheMonthlyRipleysOutputProbe(), Population_Manager_Base::SimH, Population_Manager_Base::SimW, StateNamesLength, TheSubArrayPreviousIndex, TheSubArrays, TheSubArraysIterators, TheSubArraysSizes, TheSubArrayThreadIndex, CfgInt::value(), and CfgBool::value().
◆ ~Population_Manager()
Population_Manager::~Population_Manager |
( |
void |
| ) |
|
|
virtual |
Destructor for the Population_Manager class
References cfg_AorOutput_used, cfg_CfgRipleysOutputUsed, cfg_ReallyBigOutputUsed, cfg_RipleysOutputMonthly_used, CloseTheMonthlyRipleysOutputProbe(), CloseTheReallyBigOutputProbe(), CloseTheRipleysOutputProbe(), m_AOR_Probe, m_guard_cell_height_num, m_guard_cell_width_num, m_MapGuard, TheSubArrays, and CfgBool::value().
◆ BeginningOfMonth()
bool Population_Manager::BeginningOfMonth |
( |
| ) |
|
◆ BreedingPairsOutput()
virtual void Population_Manager::BreedingPairsOutput |
( |
int |
| ) |
|
|
inlinevirtual |
◆ BreedingSuccessProbeOutput()
virtual void Population_Manager::BreedingSuccessProbeOutput |
( |
double |
, |
|
|
int |
, |
|
|
int |
, |
|
|
int |
, |
|
|
int |
, |
|
|
int |
, |
|
|
int |
, |
|
|
int |
|
|
) |
| |
|
inlinevirtual |
◆ Catastrophe()
void Population_Manager::Catastrophe |
( |
void |
| ) |
|
|
protectedvirtual |
◆ CloseTheMonthlyRipleysOutputProbe()
void Population_Manager::CloseTheMonthlyRipleysOutputProbe |
( |
| ) |
const |
close the monthly probes
References RipleysOutputPrb1, RipleysOutputPrb10, RipleysOutputPrb11, RipleysOutputPrb12, RipleysOutputPrb2, RipleysOutputPrb3, RipleysOutputPrb4, RipleysOutputPrb5, RipleysOutputPrb6, RipleysOutputPrb7, RipleysOutputPrb8, and RipleysOutputPrb9.
Referenced by ~Population_Manager().
◆ CloseTheReallyBigOutputProbe()
void Population_Manager::CloseTheReallyBigOutputProbe |
( |
| ) |
|
|
virtual |
◆ CloseTheRipleysOutputProbe()
void Population_Manager::CloseTheRipleysOutputProbe |
( |
| ) |
|
|
virtual |
◆ Debug_Shuffle()
void Population_Manager::Debug_Shuffle |
( |
unsigned int |
Type | ) |
|
◆ DisplayLocations()
void Population_Manager::DisplayLocations |
( |
| ) |
|
|
virtual |
Used to update the graphics when control is not returned to the ALMaSS_GUI between timesteps.
◆ DoAfter()
void Population_Manager::DoAfter |
( |
| ) |
|
|
protectedvirtual |
◆ DoBefore()
void Population_Manager::DoBefore |
( |
| ) |
|
|
protectedvirtual |
◆ DoFirst()
void Population_Manager::DoFirst |
( |
void |
| ) |
|
|
protectedvirtual |
Can be used in descendent classes
Reimplemented in Spider_Population_Manager, Oedothorax_Population_Manager, Erigone_Population_Manager, Beetle_Population_Manager, THare_Population_Manager, Ladybird_Population_Manager, Skylark_Population_Manager, Bembidion_Population_Manager, Vole_Population_Manager, Osmia_Population_Manager, and TPredator_Population_Manager.
Referenced by RunStepMethods().
◆ DoLast()
void Population_Manager::DoLast |
( |
| ) |
|
|
protectedvirtual |
◆ DoSpecialBetweenLifeStages()
virtual void Population_Manager::DoSpecialBetweenLifeStages |
( |
int |
a_life_stage | ) |
|
|
inlineprotectedvirtual |
◆ FarmAnimalCensus()
unsigned int Population_Manager::FarmAnimalCensus |
( |
unsigned int |
a_farm, |
|
|
unsigned int |
a_typeofanimal |
|
) |
| |
1449 unsigned int No = 0;
1450 int temp_thread_num = omp_get_max_threads();
1451 for(
int i=0; i<temp_thread_num; i++){
1453 if((*it)->GetCurrentStateNo() < 0){
1456 if (a_farm == (*it)->SupplyFarmOwnerRef()) No++;
References TheSubArrays.
◆ FindClosest()
TAnimal * Population_Manager::FindClosest |
( |
int |
x, |
|
|
int |
y, |
|
|
unsigned |
Type, |
|
|
TAnimal * |
a_me |
|
) |
| |
|
virtual |
Finds the closest individual to an x,y point that is not a_me
1104 int distance = 100000000;
1106 int temp_thread_num = omp_get_max_threads();
1107 for(
int j=0; j<temp_thread_num; j++){
1109 int dx = (*it)->Supply_m_Location_x();
1110 int dy = (*it)->Supply_m_Location_y();
1120 if ((*it)->GetCurrentStateNo() != -1)
References TheSubArrays.
◆ FindIndividual()
TAnimal * Population_Manager::FindIndividual |
( |
unsigned |
Type, |
|
|
TAnimal * |
a_me |
|
) |
| |
Gets a random live individual returned as TAnimal*
Gets a random individual that is not a_me
1080 int temp_thread_num = omp_get_max_threads();
1082 int temp_animal_num = 0;
1083 for(
int j=0; j<temp_thread_num; j++){
1085 if(temp_animal_num >= i){
1090 if(temp_animal_num == i){
References g_rand_uni_fnc(), GetLiveArraySize(), and TheSubArrays.
◆ FledgelingProbeOutput()
virtual void Population_Manager::FledgelingProbeOutput |
( |
int |
, |
|
|
int |
|
|
) |
| |
|
inlinevirtual |
◆ GeneticsResultsOutput()
virtual void Population_Manager::GeneticsResultsOutput |
( |
FILE * |
, |
|
|
unsigned |
|
|
) |
| |
|
inlinevirtual |
◆ GetGuardMapElement()
omp_nest_lock_t* Population_Manager::GetGuardMapElement |
( |
unsigned |
a_x_index, |
|
|
unsigned |
a_y_index |
|
) |
| |
|
inline |
◆ GetLiveArraySize()
unsigned Population_Manager::GetLiveArraySize |
( |
int |
a_listindex | ) |
|
|
inlineoverridevirtual |
Gets the number of 'live' objects for a list index in the TheArray.
Reimplemented from Population_Manager_Base.
References m_LiveArraySize.
Referenced by Skylark_Population_Manager::BreedingPairsOutput(), Erigone_Population_Manager::Catastrophe(), Oedothorax_Population_Manager::Catastrophe(), Vole_Population_Manager::Catastrophe(), Skylark_Population_Manager::Catastrophe(), THare_Population_Manager::Catastrophe(), Beetle_Population_Manager::Catastrophe(), Beetle_Population_Manager::Catastrophe2(), Osmia_Population_Manager::DoBefore(), Erigone_Population_Manager::DoFirst(), Oedothorax_Population_Manager::DoFirst(), Vole_Population_Manager::DoFirst(), THare_Population_Manager::DoFirst(), AOR_Probe_Goose::DoProbe(), AOR_Probe::DoProbeInHaitatType(), THare_Population_Manager::ExtraPopMort(), FindIndividual(), Vole_Population_Manager::FindOutsideRadiusMale(), Vole_Population_Manager::FindRandomMale(), Vole_Population_Manager::GeneticsOutputFile(), Vole_Population_Manager::GeneticsResultsOutput(), GetPopulationSize(), Beetle_Population_Manager::GetPopulationSize(), THare_Population_Manager::Hunting(), THare_Population_Manager::HuntingDifferentiatedBeetleBankArea(), THare_Population_Manager::HuntingGrid(), Vole_Population_Manager::ImpactedProbe(), Vole_Population_Manager::LandscapeQuadrantOutputProbe(), THare_Population_Manager::MRROutputs(), THare_Population_Manager::POMOutputs(), Probe(), Beetle_Population_Manager::Probe(), Skylark_Population_Manager::ProbePOM(), Skylark_Population_Manager::ReHouse(), Vole_Population_Manager::ResistanceOutput(), Vole_Population_Manager::SendMessage(), Vole_Population_Manager::TheAgeSexLocationProbe(), Skylark_Population_Manager::TheBreedingFemalesProbe(), Skylark_Population_Manager::TheBreedingSuccessProbe(), Skylark_Population_Manager::TheFledgelingProbe(), Vole_Population_Manager::TheReallyBigOutputProbe(), Beetle_Population_Manager::TheReallyBigOutputProbe(), Erigone_Population_Manager::TheRipleysOutputProbe(), Oedothorax_Population_Manager::TheRipleysOutputProbe(), Vole_Population_Manager::TheRipleysOutputProbe(), Skylark_Population_Manager::TheRipleysOutputProbe(), THare_Population_Manager::TheRipleysOutputProbe(), Beetle_Population_Manager::TheRipleysOutputProbe(), and Vole_Population_Manager::TheSexRatiosProbe().
◆ GetPopulationSize()
unsigned Population_Manager::GetPopulationSize |
( |
int |
a_listindex | ) |
|
|
inlineoverridevirtual |
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.
Reimplemented from Population_Manager_Base.
Reimplemented in Beetle_Population_Manager.
References GetLiveArraySize().
◆ GetPopulationType()
◆ GetSeasonNumber()
int Population_Manager::GetSeasonNumber |
( |
| ) |
|
|
inline |
◆ ImpactedProbe()
void Population_Manager::ImpactedProbe |
( |
| ) |
|
|
virtual |
◆ ImpactProbeReport()
void Population_Manager::ImpactProbeReport |
( |
int |
a_Time | ) |
|
◆ IncLiveArraySize()
void Population_Manager::IncLiveArraySize |
( |
int |
a_listindex | ) |
|
|
inline |
◆ LamdaBirth() [1/2]
void Population_Manager::LamdaBirth |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
inline |
◆ LamdaBirth() [2/2]
void Population_Manager::LamdaBirth |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
z |
|
) |
| |
|
inline |
◆ LamdaClear()
void Population_Manager::LamdaClear |
( |
| ) |
|
|
inline |
◆ LamdaDeath()
void Population_Manager::LamdaDeath |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
inline |
◆ LamdaDumpOutput()
void Population_Manager::LamdaDumpOutput |
( |
| ) |
|
◆ LOG()
void Population_Manager::LOG |
( |
const char * |
fname | ) |
|
Debug function used to log whatever is needed - this is just a place to write whatever is needed at the time - so contents vary
305 FILE* PFile = fopen(fname,
"w");
312 for (
unsigned listindex = 0; listindex <
TheSubArrays.size(); listindex++)
317 fprintf( PFile,
"%s :\n",
m_ListNames[ listindex ].c_str() );
322 fprintf(PFile,
"%i %i %i\n", j, AP.
m_x, AP.
m_y);
References Population_Manager_Base::m_ListNames, m_LiveArraySize, Population_Manager_Base::m_TheLandscape, AnimalPosition::m_x, AnimalPosition::m_y, SupplyAnimalPtr(), TAnimal::SupplyPosition(), TheSubArrays, and Landscape::Warn().
◆ OpenTheAOROutputProbe()
void Population_Manager::OpenTheAOROutputProbe |
( |
const string & |
a_AORFilename | ) |
|
|
overridevirtual |
◆ OpenTheBreedingPairsProbe()
virtual bool Population_Manager::OpenTheBreedingPairsProbe |
( |
| ) |
|
|
inlinevirtual |
◆ OpenTheBreedingSuccessProbe()
virtual bool Population_Manager::OpenTheBreedingSuccessProbe |
( |
| ) |
|
|
inlinevirtual |
◆ OpenTheFledgelingProbe()
virtual bool Population_Manager::OpenTheFledgelingProbe |
( |
| ) |
|
|
inlinevirtual |
◆ OpenTheMonthlyRipleysOutputProbe()
bool Population_Manager::OpenTheMonthlyRipleysOutputProbe |
( |
| ) |
|
open 12 ripley output probes, one for each month
916 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
923 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
930 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
937 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
944 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
951 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
958 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
965 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
972 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
979 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
986 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
993 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
References cfg_RipleysOutput_filename, g_msg, RipleysOutputPrb1, RipleysOutputPrb10, RipleysOutputPrb11, RipleysOutputPrb12, RipleysOutputPrb2, RipleysOutputPrb3, RipleysOutputPrb4, RipleysOutputPrb5, RipleysOutputPrb6, RipleysOutputPrb7, RipleysOutputPrb8, RipleysOutputPrb9, CfgStr::value(), MapErrorMsg::Warn(), and WARN_FILE.
Referenced by Population_Manager().
◆ OpenTheReallyBigProbe()
bool Population_Manager::OpenTheReallyBigProbe |
( |
| ) |
|
open the probe
1009 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
References cfg_ReallyBigOutput_filename, g_msg, ReallyBigOutputPrb, CfgStr::value(), MapErrorMsg::Warn(), and WARN_FILE.
Referenced by Beetle_Population_Manager::Beetle_Population_Manager(), Erigone_Population_Manager::Init(), Oedothorax_Population_Manager::Init(), Vole_Population_Manager::Init(), Skylark_Population_Manager::Init(), and THare_Population_Manager::Init().
◆ OpenTheRipleysOutputProbe()
bool Population_Manager::OpenTheRipleysOutputProbe |
( |
| ) |
|
open the Ripley probe
901 g_msg->
Warn(
WARN_FILE,
"Population_Manager::OpenTheRipleysOutputProbe(): ""Unable to open probe file",
References cfg_RipleysOutput_filename, g_msg, RipleysOutputPrb, CfgStr::value(), MapErrorMsg::Warn(), and WARN_FILE.
Referenced by Beetle_Population_Manager::Beetle_Population_Manager(), Erigone_Population_Manager::Init(), Oedothorax_Population_Manager::Init(), Vole_Population_Manager::Init(), Skylark_Population_Manager::Init(), and THare_Population_Manager::Init().
◆ PartitionLiveDead()
unsigned Population_Manager::PartitionLiveDead |
( |
unsigned |
Type | ) |
|
|
protectedvirtual |
◆ Probe()
unsigned Population_Manager::Probe |
( |
int |
ListIndex, |
|
|
Probe_Data * |
p_TheProbe |
|
) |
| |
|
virtual |
Default data probe. Rarely used in actuality but always available
Reimplemented in Beetle_Population_Manager.
799 int temp_thread_num = omp_get_max_threads();
802 for (
int thread_id=0; thread_id<temp_thread_num; thread_id++){
804 if((*it)->GetCurrentStateNo() < 0){
807 Sp = (*it)->SupplyPosition();
808 unsigned Farm = (*it)->SupplyFarmOwnerRef();
809 for (
int i = 0; i < p_TheProbe->
m_NoAreas; i++)
812 m_x <= p_TheProbe->m_Rect[i].m_x2 && Sp.
m_y <= p_TheProbe->
m_Rect[i].
m_y2))
813 for (
int k = 0; k < p_TheProbe->
m_NoFarms; k++)
823 for (
int thread_id=0; thread_id<temp_thread_num; thread_id++){
825 if((*it)->GetCurrentStateNo() < 0){
828 for (
unsigned i = 0; i < p_TheProbe->
m_NoAreas; i++)
845 for (
int thread_id=0; thread_id<temp_thread_num; thread_id++){
847 if((*it)->GetCurrentStateNo() < 0){
850 Sp = (*it)->SupplyPosition();
851 for (
unsigned i = 0; i < p_TheProbe->
m_NoAreas; i++)
854 m_x <= p_TheProbe->m_Rect[i].m_x2 && Sp.
m_y <= p_TheProbe->
m_Rect[i].
m_y2))
874 for (
int thread_id=0; thread_id<temp_thread_num; thread_id++){
876 if((*it)->GetCurrentStateNo() < 0){
879 Sp = (*it)->SupplyPosition();
880 for (
unsigned i = 0; i < p_TheProbe->
m_NoAreas; i++)
References GetLiveArraySize(), AnimalPosition::m_EleType, Probe_Data::m_FullLandscapeProbe, Probe_Data::m_NoAreas, Probe_Data::m_NoEleTypes, Probe_Data::m_NoFarms, Probe_Data::m_NoVegTypes, Probe_Data::m_Rect, Probe_Data::m_RefEle, Probe_Data::m_RefFarms, Probe_Data::m_RefVeg, AnimalPosition::m_VegType, AnimalPosition::m_x, rectangle::m_x1, rectangle::m_x2, AnimalPosition::m_y, rectangle::m_y1, rectangle::m_y2, and TheSubArrays.
Referenced by ProbeReport(), and ProbeReportTimed().
◆ ProbeReport()
char * Population_Manager::ProbeReport |
( |
int |
a_time | ) |
|
◆ ProbeReportTimed()
char * Population_Manager::ProbeReportTimed |
( |
int |
a_time | ) |
|
◆ PushIndividual()
void Population_Manager::PushIndividual |
( |
const unsigned |
a_listindex, |
|
|
TAnimal * |
a_individual_ptr |
|
) |
| |
1683 int temp_thread_num = omp_get_thread_num();
1685 TheSubArrays[a_listindex][temp_thread_num]->push_front(a_individual_ptr);
References TheSubArrays.
Referenced by Erigone_Population_Manager::CreateObjects(), Oedothorax_Population_Manager::CreateObjects(), TPredator_Population_Manager::CreateObjects(), Bembidion_Population_Manager::CreateObjects(), Vole_Population_Manager::CreateObjects(), PoecilusCupreus_Population_Manager::CreateObjects(), Osmia_Population_Manager::CreateObjects(), Skylark_Population_Manager::CreateObjects(), Ladybird_Population_Manager::CreateObjects(), THare_Population_Manager::CreateObjects(), and Vole_Population_Manager::CreateObjectsInit().
◆ Run()
void Population_Manager::Run |
( |
int |
NoTSteps | ) |
|
|
overridevirtual |
This is the main scheduling method for the population manager.
Note the structure of Shuffle_or_Sort(), DoFirst(), BeginStep, DoBefore(), Step looping until all are finished, DoAfter(), EndStep, DoLast().
Can do multiple time-steps here inside one landscape time-step (a day). This is used in the roe deer model to provide 10 minute behavioural time-steps.
It is necessary to remove any dead animals before the timestep starts. It is possible that animals are killed after their population manager Run method has been executed. This is the case with geese and hunters. Checking death first prevents this becomming a problem.
Reimplemented from Population_Manager_Base.
Reimplemented in TPredator_Population_Manager.
354 for (
int t_steps = 0; t_steps < NoTSteps; t_steps++)
361 for (
unsigned listindex = 0; listindex < size1; listindex++)
370 for (
int listindex = 0; listindex < size1; listindex++)
374 int thread_id = omp_get_thread_num();
376 (*it)->SetStepDone(
false);
381 if(omp_get_max_threads()<=1){
382 for (
unsigned listindex = 0; listindex < size1; listindex++)
391 for (
unsigned listindex = 0; listindex < size1; listindex++)
489 g_msg->
Warn(
"Population_Manager::Run ",
"Wrong month");
References cfg_AorOutput_day, cfg_AorOutput_interval, cfg_AorOutput_used, cfg_AorOutputFirstYear, cfg_CfgRipleysOutputUsed, cfg_ReallyBigOutput_day1, cfg_ReallyBigOutput_day2, cfg_ReallyBigOutput_day3, cfg_ReallyBigOutput_day4, cfg_ReallyBigOutput_interval, cfg_ReallyBigOutputFirstYear, cfg_ReallyBigOutputUsed, cfg_RipleysOutput_day, cfg_RipleysOutput_interval, cfg_RipleysOutputFirstYear, cfg_RipleysOutputMonthly_used, g_msg, m_LiveArraySize, Population_Manager_Base::m_TheLandscape, PartitionLiveDead(), RipleysOutputPrb, RipleysOutputPrb1, RipleysOutputPrb10, RipleysOutputPrb11, RipleysOutputPrb12, RipleysOutputPrb2, RipleysOutputPrb3, RipleysOutputPrb4, RipleysOutputPrb5, RipleysOutputPrb6, RipleysOutputPrb7, RipleysOutputPrb8, RipleysOutputPrb9, RunStepMethods(), TAnimal::SetDayInYear(), TAnimal::SetTempToday(), Shuffle_or_Sort(), Landscape::SupplyDayInMonth(), Landscape::SupplyDayInYear(), SupplyListIndexSize(), Landscape::SupplyMonth(), Landscape::SupplyTemp(), Landscape::SupplyYearNumber(), TheAOROutputProbe(), TheReallyBigOutputProbe(), TheRipleysOutputProbe(), TheSubArrayPreviousIndex, TheSubArrays, TheSubArraysIterators, TheSubArraysSizes, TheSubArrayThreadIndex, CfgInt::value(), CfgBool::value(), and MapErrorMsg::Warn().
◆ RunStepMethods()
void Population_Manager::RunStepMethods |
( |
| ) |
|
|
virtual |
532 int thread_id = omp_get_thread_num();
538 int loc_x = (*it)->Supply_m_Location_x();
539 int loc_y = (*it)->Supply_m_Location_y();
542 (*it)->SetGuardMapIndex(loc_x_cell, loc_y_cell);
543 omp_set_nest_lock(
m_MapGuard[loc_y_cell][loc_x_cell]);
547 loc_x_cell = (*it)->SupplyGuardCellX();
548 loc_y_cell = (*it)->SupplyGuardCellY();
549 omp_unset_nest_lock(
m_MapGuard[loc_y_cell][loc_x_cell]);
565 int thread_id = omp_get_thread_num();
573 int loc_x = (*it)->Supply_m_Location_x();
574 int loc_y = (*it)->Supply_m_Location_y();
577 (*it)->SetGuardMapIndex(loc_x_cell, loc_y_cell);
578 omp_set_nest_lock(
m_MapGuard[loc_y_cell][loc_x_cell]);
584 loc_x_cell = (*it)->SupplyGuardCellX();
585 loc_y_cell = (*it)->SupplyGuardCellY();
586 omp_unset_nest_lock(
m_MapGuard[loc_y_cell][loc_x_cell]);
602 int thread_id = omp_get_thread_num();
607 int loc_x = (*it)->Supply_m_Location_x();
608 int loc_y = (*it)->Supply_m_Location_y();
611 (*it)->SetGuardMapIndex(loc_x_cell, loc_y_cell);
612 omp_set_nest_lock(
m_MapGuard[loc_y_cell][loc_x_cell]);
616 loc_x_cell = (*it)->SupplyGuardCellX();
617 loc_y_cell = (*it)->SupplyGuardCellY();
618 omp_unset_nest_lock(
m_MapGuard[loc_y_cell][loc_x_cell]);
References DoAfter(), DoBefore(), DoFirst(), DoLast(), DoSpecialBetweenLifeStages(), m_guard_cell_size, m_is_paralleled, m_LifeStageOrderVec, m_MapGuard, StepFinished(), and TheSubArrays.
Referenced by Run().
◆ SetGuardMapElement()
void Population_Manager::SetGuardMapElement |
( |
unsigned |
a_x_index, |
|
|
unsigned |
a_y_index |
|
) |
| |
|
inline |
◆ SetNoProbesAndSpeciesSpecificFunctions()
void Population_Manager::SetNoProbesAndSpeciesSpecificFunctions |
( |
int |
a_pn | ) |
|
|
overridevirtual |
◆ Shuffle()
void Population_Manager::Shuffle |
( |
unsigned |
Type | ) |
|
|
protectedvirtual |
◆ Shuffle_or_Sort()
void Population_Manager::Shuffle_or_Sort |
( |
unsigned |
Type | ) |
|
|
protectedvirtual |
This method is used to determine whether the array of animals should be shuffled or sorted.
To do nothing ensure that the BeforeStepActions[] is set appropriately // 0 = Shuffle, 1 = SortX, 2 = SortY, 3 = sortXIndex, 4 = do nothing
1273 m_TheLandscape->
Warn(
"Population_Manager::Shuffle_or_Sort",
"- BeforeStepAction Unknown");
References BeforeStepActions, g_rand_uni_fnc(), Population_Manager_Base::m_TheLandscape, Shuffle(), SortX(), SortY(), and Landscape::Warn().
Referenced by Run().
◆ SortState()
void Population_Manager::SortState |
( |
unsigned |
Type | ) |
|
|
protected |
Sort TheSubArrays w.r.t. the current state attribute
1160 int temp_thread_num = omp_get_max_threads();
1161 for(
int i=0; i<temp_thread_num; i++){
References TheSubArrays, and TAnimal::WhatState().
◆ SortStateR()
void Population_Manager::SortStateR |
( |
unsigned |
Type | ) |
|
|
protected |
◆ SortX()
void Population_Manager::SortX |
( |
unsigned |
Type | ) |
|
|
protectedvirtual |
◆ SortXIndex()
void Population_Manager::SortXIndex |
( |
unsigned |
Type | ) |
|
|
protected |
◆ SortY()
void Population_Manager::SortY |
( |
unsigned |
Type | ) |
|
|
protectedvirtual |
◆ SpeciesSpecificReporting()
char * Population_Manager::SpeciesSpecificReporting |
( |
int |
a_species, |
|
|
int |
a_time |
|
) |
| |
|
overridevirtual |
This method handles species specific outputs. This is one place to do it. More commonly this is done in descendent classes
Reimplemented from Population_Manager_Base.
1302 if (a_species == -1) {
return g_Str; }
1393 #ifdef __SpecificPesticideEffectsVinclozolinLike__
1396 #ifdef __WithinOrchardPesticideSim__
1401 else if (a_species == 0)
1404 int a_day = a_time % 365;
1405 if (a_time % 365 == 364)
1408 int BreedingFemales, YoungOfTheYear, TotalPop, TotalFemales, TotalMales, BreedingAttempts;
1412 if (BreedingFemales > 0)
1414 bs = No / static_cast<float>(BreedingFemales);
1428 for (
int ProbeNo = 0; ProbeNo <
m_NoProbes; ProbeNo++)
References BreedingPairsOutput(), BreedingSuccessProbeOutput(), Landscape::FillVegAreaData(), FledgelingProbeOutput(), g_Str, ImpactProbeReport(), m_NoProbes, Population_Manager_Base::m_TheLandscape, ProbeReport(), TheBreedingSuccessProbe(), and TheFledgelingProbe().
◆ StepFinished()
bool Population_Manager::StepFinished |
( |
void |
| ) |
|
|
protectedvirtual |
◆ SupplyAnimalPtr()
virtual TAnimal* Population_Manager::SupplyAnimalPtr |
( |
unsigned int |
a_index, |
|
|
unsigned int |
a_animal |
|
) |
| |
|
inlinevirtual |
Returns the pointer indexed by a_index and a_animal. Note NO RANGE CHECK.
Reimplemented from Population_Manager_Base.
705 while(temp_animal_num < a_animal){
709 if(temp_animal_num == a_animal){
References TheSubArrayPreviousIndex, TheSubArrays, TheSubArraysIterators, TheSubArraysSizes, and TheSubArrayThreadIndex.
Referenced by Skylark_Population_Manager::BreedingPairsOutput(), Erigone_Population_Manager::Catastrophe(), Oedothorax_Population_Manager::Catastrophe(), Vole_Population_Manager::Catastrophe(), Skylark_Population_Manager::Catastrophe(), THare_Population_Manager::Catastrophe(), Beetle_Population_Manager::Catastrophe(), Beetle_Population_Manager::Catastrophe2(), Osmia_Population_Manager::DoBefore(), Erigone_Population_Manager::DoFirst(), Oedothorax_Population_Manager::DoFirst(), Vole_Population_Manager::DoFirst(), Bembidion_Population_Manager::DoFirst(), THare_Population_Manager::DoFirst(), AOR_Probe_Goose::DoProbe(), AOR_Probe::DoProbeInHaitatType(), THare_Population_Manager::ExtraPopMort(), Vole_Population_Manager::FindOutsideRadiusMale(), Vole_Population_Manager::FindRandomMale(), Vole_Population_Manager::GeneticsOutputFile(), Vole_Population_Manager::GeneticsResultsOutput(), Vole_Population_Manager::GetVoleAllele(), THare_Population_Manager::Hunting(), THare_Population_Manager::HuntingDifferentiatedBeetleBankArea(), THare_Population_Manager::HuntingGrid(), Vole_Population_Manager::ImpactedProbe(), TPredator_Population_Manager::InOtherTerritory(), LOG(), THare_Population_Manager::MRROutputs(), Osmia_Population_Manager::Osmia_Population_Manager(), THare_Population_Manager::POMOutputs(), TPredator_Population_Manager::PredSampleFile(), Beetle_Population_Manager::Probe(), Skylark_Population_Manager::ProbePOM(), Skylark_Population_Manager::ReHouse(), Vole_Population_Manager::ResistanceOutput(), TPredator_Population_Manager::Run(), Vole_Population_Manager::SendMessage(), TPredator_Population_Manager::StepFinished(), Skylark_Population_Manager::TheBreedingFemalesProbe(), Skylark_Population_Manager::TheBreedingSuccessProbe(), Skylark_Population_Manager::TheFledgelingProbe(), Vole_Population_Manager::TheReallyBigOutputProbe(), Beetle_Population_Manager::TheReallyBigOutputProbe(), Erigone_Population_Manager::TheRipleysOutputProbe(), Oedothorax_Population_Manager::TheRipleysOutputProbe(), Skylark_Population_Manager::TheRipleysOutputProbe(), THare_Population_Manager::TheRipleysOutputProbe(), Beetle_Population_Manager::TheRipleysOutputProbe(), and Vole_Population_Manager::TheSexRatiosProbe().
◆ SupplyCovPosx()
virtual int Population_Manager::SupplyCovPosx |
( |
int |
| ) |
|
|
inlinevirtual |
◆ SupplyCovPosy()
virtual int Population_Manager::SupplyCovPosy |
( |
int |
| ) |
|
|
inlinevirtual |
◆ SupplyListIndexSize()
virtual unsigned Population_Manager::SupplyListIndexSize |
( |
| ) |
|
|
inlinevirtual |
◆ SupplyListSize()
unsigned Population_Manager::SupplyListSize |
( |
unsigned |
listindex | ) |
const |
|
inline |
◆ SupplyPegPosx()
virtual int Population_Manager::SupplyPegPosx |
( |
int |
| ) |
|
|
inlinevirtual |
◆ SupplyPegPosy()
virtual int Population_Manager::SupplyPegPosy |
( |
int |
| ) |
|
|
inlinevirtual |
◆ SupplyStateNames()
const char* Population_Manager::SupplyStateNames |
( |
int |
i | ) |
const |
|
inline |
◆ SupplyStateNamesLength()
unsigned Population_Manager::SupplyStateNamesLength |
( |
| ) |
const |
|
inline |
◆ SupplyStepSize()
int Population_Manager::SupplyStepSize |
( |
| ) |
const |
|
inline |
◆ TheAOROutputProbe()
void Population_Manager::TheAOROutputProbe |
( |
| ) |
|
|
virtual |
◆ TheBreedingFemalesProbe()
virtual int Population_Manager::TheBreedingFemalesProbe |
( |
int |
| ) |
|
|
inlinevirtual |
◆ TheBreedingSuccessProbe()
virtual int Population_Manager::TheBreedingSuccessProbe |
( |
int & |
, |
|
|
int & |
, |
|
|
int & |
, |
|
|
int & |
, |
|
|
int & |
, |
|
|
int & |
|
|
) |
| |
|
inlinevirtual |
◆ TheFledgelingProbe()
virtual int Population_Manager::TheFledgelingProbe |
( |
| ) |
|
|
inlinevirtual |
◆ TheGeneticProbe()
virtual void Population_Manager::TheGeneticProbe |
( |
unsigned |
, |
|
|
int |
, |
|
|
unsigned & |
|
|
) |
| |
|
inlinevirtual |
◆ TheReallyBigOutputProbe()
void Population_Manager::TheReallyBigOutputProbe |
( |
| ) |
|
|
virtual |
◆ TheRipleysOutputProbe()
void Population_Manager::TheRipleysOutputProbe |
( |
ofstream * |
a_prb | ) |
|
|
virtual |
◆ UnsetGuardMapElement()
void Population_Manager::UnsetGuardMapElement |
( |
unsigned |
a_x_index, |
|
|
unsigned |
a_y_index |
|
) |
| |
|
inline |
◆ UpdateGuardMap()
void Population_Manager::UpdateGuardMap |
( |
int |
a_x, |
|
|
int |
a_y, |
|
|
int & |
a_index_x, |
|
|
int & |
a_index_y |
|
) |
| |
|
inline |
Get the index of the guard map for the given location.
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;
References m_guard_cell_size, and m_MapGuard.
Referenced by Spider_Juvenile::BalloonTo(), Beetle_Base::Beetle_1M_Move(), Vole_JuvenileMale::Dispersal(), Vole_Male::Dispersal(), Vole_JuvenileFemale::Dispersal(), Vole_Base::Escape(), Osmia_Female::FindNestLocation(), Ladybird_Adult::FindTarget(), Ladybird_Adult::LongRangeFind(), Vole_Base::MoveTo(), Beetle_Adult::MoveToNoList(), Beetle_Adult::MoveToWithPlacesList(), THare::Run(), THare::Running(), TPredator::st_Dispersal(), Osmia_Female::st_Dispersal(), Hare_Juvenile::st_Dispersal(), Vole_Male::st_Eval_n_Explore(), TPredator::st_Movement(), Vole_Female::st_Special_Explore(), Beetle_Adult::TryToReproduce(), and Spider_Juvenile::WalkTo().
◆ AOROutputPrb
ofstream* Population_Manager::AOROutputPrb {} |
|
protected |
◆ BeforeStepActions
vector<unsigned> Population_Manager::BeforeStepActions |
|
protected |
◆ lamdagrid
long int Population_Manager::lamdagrid[2][257][257] {} |
|
protected |
◆ m_AOR_Probe
AOR_Probe* Population_Manager::m_AOR_Probe {} |
|
protected |
A pointer to the AOR probe.
Referenced by OpenTheAOROutputProbe(), Beetle_Population_Manager::OpenTheAOROutputProbe(), Erigone_Population_Manager::TheAOROutputProbe(), Oedothorax_Population_Manager::TheAOROutputProbe(), Vole_Population_Manager::TheAOROutputProbe(), Osmia_Population_Manager::TheAOROutputProbe(), Ladybird_Population_Manager::TheAOROutputProbe(), Skylark_Population_Manager::TheAOROutputProbe(), THare_Population_Manager::TheAOROutputProbe(), Beetle_Population_Manager::TheAOROutputProbe(), and ~Population_Manager().
◆ m_guard_cell_height_num
int Population_Manager::m_guard_cell_height_num |
|
protected |
◆ m_guard_cell_size
int Population_Manager::m_guard_cell_size |
|
protected |
◆ m_guard_cell_width_num
int Population_Manager::m_guard_cell_width_num |
|
protected |
◆ m_is_paralleled
bool Population_Manager::m_is_paralleled |
|
protected |
◆ m_LifeStageOrderVec
vector<int> Population_Manager::m_LifeStageOrderVec |
|
protected |
◆ m_LiveArraySize
vector<unsigned> Population_Manager::m_LiveArraySize |
|
protected |
◆ m_MapGuard
std::vector<std::vector<omp_nest_lock_t*> > Population_Manager::m_MapGuard |
|
protected |
◆ m_NoProbes
int Population_Manager::m_NoProbes = 0 |
|
protected |
◆ m_population_type
Referenced by Beetle_Population_Manager::Beetle_Population_Manager(), Bembidion_Population_Manager::Bembidion_Population_Manager(), Beetle_Population_Manager::DayDegreeCalculations(), GetPopulationType(), Erigone_Population_Manager::Init(), Oedothorax_Population_Manager::Init(), Vole_Population_Manager::Init(), Skylark_Population_Manager::Init(), THare_Population_Manager::Init(), Ladybird_Population_Manager::Ladybird_Population_Manager(), PoecilusCupreus_Population_Manager::PoecilusCupreus_Population_Manager(), and TPredator_Population_Manager::TPredator_Population_Manager().
◆ m_SeasonNumber
int Population_Manager::m_SeasonNumber |
|
protected |
◆ m_StepSize
int Population_Manager::m_StepSize {} |
|
protected |
◆ ProbesSet
bool Population_Manager::ProbesSet {} |
◆ ReallyBigOutputPrb
ofstream* Population_Manager::ReallyBigOutputPrb {} |
|
protected |
Referenced by Beetle_Population_Manager::Beetle_Population_Manager(), CloseTheReallyBigOutputProbe(), Erigone_Population_Manager::Init(), Oedothorax_Population_Manager::Init(), Vole_Population_Manager::Init(), Skylark_Population_Manager::Init(), THare_Population_Manager::Init(), OpenTheReallyBigProbe(), Vole_Population_Manager::TheReallyBigOutputProbe(), Beetle_Population_Manager::TheReallyBigOutputProbe(), and TPredator_Population_Manager::TPredator_Population_Manager().
◆ RipleysOutputPrb
ofstream* Population_Manager::RipleysOutputPrb {} |
|
protected |
◆ RipleysOutputPrb1
ofstream* Population_Manager::RipleysOutputPrb1 {} |
|
protected |
◆ RipleysOutputPrb10
ofstream* Population_Manager::RipleysOutputPrb10 {} |
|
protected |
◆ RipleysOutputPrb11
ofstream* Population_Manager::RipleysOutputPrb11 {} |
|
protected |
◆ RipleysOutputPrb12
ofstream* Population_Manager::RipleysOutputPrb12 {} |
|
protected |
◆ RipleysOutputPrb2
ofstream* Population_Manager::RipleysOutputPrb2 {} |
|
protected |
◆ RipleysOutputPrb3
ofstream* Population_Manager::RipleysOutputPrb3 {} |
|
protected |
◆ RipleysOutputPrb4
ofstream* Population_Manager::RipleysOutputPrb4 {} |
|
protected |
◆ RipleysOutputPrb5
ofstream* Population_Manager::RipleysOutputPrb5 {} |
|
protected |
◆ RipleysOutputPrb6
ofstream* Population_Manager::RipleysOutputPrb6 {} |
|
protected |
◆ RipleysOutputPrb7
ofstream* Population_Manager::RipleysOutputPrb7 {} |
|
protected |
◆ RipleysOutputPrb8
ofstream* Population_Manager::RipleysOutputPrb8 {} |
|
protected |
◆ RipleysOutputPrb9
ofstream* Population_Manager::RipleysOutputPrb9 {} |
|
protected |
◆ StateNames
const char* Population_Manager::StateNames[100] {} |
|
protected |
◆ StateNamesLength
unsigned Population_Manager::StateNamesLength |
|
protected |
◆ TestFile
FILE* Population_Manager::TestFile {} |
|
protected |
◆ TestFile2
FILE* Population_Manager::TestFile2 {} |
|
protected |
◆ TheSubArrayPreviousIndex
vector<int> Population_Manager::TheSubArrayPreviousIndex |
|
protected |
◆ TheSubArrays
vector<vector<forward_list<TAnimal*>*> > Population_Manager::TheSubArrays |
|
protected |
Hold all the animal pointers.
Referenced by Bembidion_Population_Manager::Bembidion_Population_Manager(), Beetle_Population_Manager::DoBeetleActiveProbe(), Ladybird_Population_Manager::DoExtremeTempActions(), Ladybird_Population_Manager::DoFirst(), Ladybird_Population_Manager::DoSpecialBetweenLifeStages(), FarmAnimalCensus(), FindClosest(), FindIndividual(), Ladybird_Population_Manager::Ladybird_Population_Manager(), LOG(), PartitionLiveDead(), PoecilusCupreus_Population_Manager::PoecilusCupreus_Population_Manager(), Population_Manager(), Probe(), PushIndividual(), Run(), RunStepMethods(), Shuffle(), SortState(), SortStateR(), SortX(), SortY(), StepFinished(), SupplyAnimalPtr(), SupplyListIndexSize(), and ~Population_Manager().
◆ TheSubArraysIterators
vector<forward_list<TAnimal*>::iterator> Population_Manager::TheSubArraysIterators |
|
protected |
◆ TheSubArraysSizes
vector<vector<int> > Population_Manager::TheSubArraysSizes |
|
protected |
◆ TheSubArrayThreadIndex
vector<int> Population_Manager::TheSubArrayThreadIndex |
|
protected |
The documentation for this class was generated from the following files:
int Supply_m_Location_x() const
Returns the ALMaSS x-coordinate.
Definition: PopulationManager.h:239
CfgInt cfg_RipleysOutput_interval("G_RIPLEYSOUTPUT_INTERVAL", CFG_CUSTOM, 1)
Definition: MapErrorMsg.h:37
double g_rand_uni_fnc()
Definition: ALMaSS_Random.cpp:56
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
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
static void SetTempToday(double a_value)
Sets the temperature today attribute.
Definition: PopulationManager.h:337
vector< vector< int > > TheSubArraysSizes
Hold all the animal sizes in each thread.
Definition: PopulationManager.h:806
int m_guard_cell_width_num
Definition: PopulationManager.h:792
virtual void Shuffle_or_Sort(unsigned Type)
Definition: PopulationManager.cpp:1255
bool m_FullLandscapeProbe
Definition: PopulationManager.h:429
unsigned StateNamesLength
Definition: PopulationManager.h:815
TTypesOfPopulation m_population_type
Definition: PopulationManager.h:858
char * value() const
Definition: Configurator.h:182
vector< unsigned > BeforeStepActions
Holds the season list of possible before step actions.
Definition: PopulationManager.h:819
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.
Population_Manager_Base(Landscape *L)
The Population_Manager_Base constructor.
Definition: PopulationManager.cpp:182
const char * m_ListNames[32]
A list of life-stage names.
Definition: PopulationManager.h:628
ofstream * RipleysOutputPrb4
Definition: PopulationManager.h:864
CfgInt cfg_RipleysOutputFirstYear("G_RIPLEYSOUTPUT_FIRSTYEAR", CFG_CUSTOM, 1)
virtual void BreedingSuccessProbeOutput(double, int, int, int, int, int, int, int)
Definition: PopulationManager.h:909
ofstream * RipleysOutputPrb6
Definition: PopulationManager.h:866
virtual void CloseTheRipleysOutputProbe()
Definition: PopulationManager.cpp:1020
int SupplyMonth(void)
Passes a request on to the associated Calendar class function, returns m_month + 1 (the calendar mont...
Definition: Landscape.h:2272
int m_StepSize
Definition: PopulationManager.h:802
unsigned m_x
Definition: PopulationManager.h:173
ofstream * RipleysOutputPrb
Definition: PopulationManager.h:860
unsigned m_y1
Definition: PopulationManager.h:117
void FillVegAreaData()
Runs through all polygons and records the area of each vegetation type.
Definition: Landscape.cpp:5712
vector< int > m_LifeStageOrderVec
The vector to store the life stage order for looping specie life stages.
Definition: PopulationManager.h:808
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
virtual void RunStepMethods()
Definition: PopulationManager.cpp:521
void ImpactProbeReport(int a_Time)
Definition: PopulationManager.cpp:1513
unsigned m_x2
Definition: PopulationManager.h:118
void CloseTheMonthlyRipleysOutputProbe() const
Definition: PopulationManager.cpp:1029
bool value() const
Definition: Configurator.h:164
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
static CfgInt cfg_DayInMonth("PRB_DAYINMONTH", CFG_CUSTOM, 1)
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
void LamdaClear()
Definition: PopulationManager.h:885
vector< int > TheSubArrayThreadIndex
the thread index number from last time called for SupplyAnimalPtr(), this for fast loop all the anima...
Definition: PopulationManager.h:814
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
ofstream * RipleysOutputPrb1
Definition: PopulationManager.h:861
TTypesOfPopulation g_Species
Definition: PopulationManager.cpp:101
CfgInt cfg_ReallyBigOutput_day2("G_REALLYBIGOUTPUT_DAY_TWO", CFG_CUSTOM, 91)
int SupplyDayInMonth(void)
Passes a request on to the associated Calendar class function, returns m_day_in_month
Definition: Landscape.h:2277
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
static void SetDayInYear(int a_value)
Sets the day in year attribute.
Definition: PopulationManager.h:329
virtual void TheReallyBigOutputProbe()
Definition: PopulationManager.cpp:1056
virtual void DoBefore()
Definition: PopulationManager.cpp:341
ofstream * RipleysOutputPrb9
Definition: PopulationManager.h:869
CfgInt cfg_ReallyBigOutput_day3("G_REALLYBIGOUTPUT_DAY_THREE", CFG_CUSTOM, 182)
int Supply_m_Location_y() const
Returns the ALMaSS y-coordinate.
Definition: PopulationManager.h:243
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
unsigned m_NoEleTypes
Definition: PopulationManager.h:434
A class defining an animals position.
Definition: PopulationManager.h:169
Definition: AOR_Probe.h:4
std::string m_AORProbeFileName
name of the AOR Probe file
Definition: PopulationManager.h:630
virtual void ImpactedProbe()
Definition: PopulationManager.cpp:785
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
CfgBool cfg_RipleysOutputMonthly_used("G_RIPLEYSOUTPUTMONTHLY_USED", CFG_CUSTOM, false)
rectangle m_Rect[16]
Definition: PopulationManager.h:433
ofstream * RipleysOutputPrb5
Definition: PopulationManager.h:865
int SupplyDayInYear(void)
Passes a request on to the associated Calendar class function, the day in the year.
Definition: Landscape.h:2267
long int lamdagrid[2][257][257]
Definition: PopulationManager.h:877
bool m_is_paralleled
This is used to indicate whether the species is paralleled.
Definition: PopulationManager.h:796
unsigned m_y2
Definition: PopulationManager.h:119
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
static CfgStr cfg_ReallyBigOutput_filename("G_REALLYBIGOUTPUT_FILENAME", CFG_CUSTOM, "ReallyBigOutput.txt")
char g_Str[255]
Definition: PopulationManager.cpp:99
virtual int TheFledgelingProbe()
Definition: PopulationManager.h:908
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
ofstream * RipleysOutputPrb12
Definition: PopulationManager.h:872
unsigned m_y
Definition: PopulationManager.h:174
virtual void DoFirst()
Definition: PopulationManager.cpp:333
int SimW
stores the simulation width
Definition: PopulationManager.h:616
int GetCurrentStateNo() const
Returns the current state number.
Definition: PopulationManager.h:137
unsigned m_NoAreas
Definition: PopulationManager.h:432
const char * StateNames[100]
Definition: PopulationManager.h:801
virtual int TheBreedingSuccessProbe(int &, int &, int &, int &, int &, int &)
Definition: PopulationManager.h:912
unsigned m_RefFarms[25]
Definition: PopulationManager.h:439
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
CfgInt cfg_RipleysOutput_day("G_RIPLEYSOUTPUT_DAY", CFG_CUSTOM, 60)
bool OpenTheMonthlyRipleysOutputProbe()
Definition: PopulationManager.cpp:912
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
ofstream * RipleysOutputPrb7
Definition: PopulationManager.h:867
CfgInt cfg_ReallyBigOutputFirstYear("G_REALLYBIGOUTPUT_FIRSTYEAR", CFG_CUSTOM, 1)
virtual void BreedingPairsOutput(int)
Definition: PopulationManager.h:905
unsigned m_x1
Definition: PopulationManager.h:116
CfgInt cfg_AorOutput_interval("G_AORSOUTPUT_INTERVAL", CFG_CUSTOM, 1)
bool BeginningOfMonth()
Definition: PopulationManager.cpp:1282
The base class for all farm types.
Definition: Farm.h:755
void FileOutput(int No, int time, int ProbeNo) const
Definition: PopulationManager.cpp:1626
virtual void SortX(unsigned Type)
Definition: PopulationManager.cpp:1135
int g_thread_count
Definition: PopulationManager.cpp:107
virtual unsigned PartitionLiveDead(unsigned Type)
Definition: PopulationManager.cpp:1181
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
unsigned m_NoFarms
Definition: PopulationManager.h:436
int m_guard_cell_size
Definition: PopulationManager.h:793
ofstream * RipleysOutputPrb8
Definition: PopulationManager.h:868
CfgBool cfg_CfgRipleysOutputUsed("G_RIPLEYSOUTPUT_USED", CFG_CUSTOM, false)
virtual bool StepFinished()
Methods to run the simulations.
Definition: PopulationManager.cpp:632
virtual void CloseTheReallyBigOutputProbe()
Definition: PopulationManager.cpp:1048
virtual void Shuffle(unsigned Type)
Definition: PopulationManager.cpp:1229
CfgBool cfg_ReallyBigOutputUsed("G_REALLYBIGOUTPUT_USED", CFG_CUSTOM, false)
ofstream * ReallyBigOutputPrb
Definition: PopulationManager.h:873
vector< vector< forward_list< TAnimal * > * > > TheSubArrays
Hold all the animal pointers.
Definition: PopulationManager.h:804
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 m_guard_cell_height_num
Definition: PopulationManager.h:791
virtual void TheAOROutputProbe()
Definition: PopulationManager.cpp:1067
virtual int WhatState()
Returns the objects current state number.
Definition: PopulationManager.h:301
virtual void SortY(unsigned Type)
Definition: PopulationManager.cpp:1147
CfgInt cfg_AorOutput_day("G_AOROUTPUT_DAY", CFG_CUSTOM, 60)
CfgInt cfg_AorOutputFirstYear("G_AOROUTPUT_FIRSTYEAR", CFG_CUSTOM, 1)
vector< unsigned > m_LiveArraySize
Definition: PopulationManager.h:786
ofstream * RipleysOutputPrb10
Definition: PopulationManager.h:870
virtual void DoAfter()
Definition: PopulationManager.cpp:648
TTypesOfVegetation m_VegType
Definition: PopulationManager.h:176