|
ALMaSS
1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
|
Base class for all population managers.
More...
#include <PopulationManager.h>
|
| Population_Manager_Base (Landscape *L) |
| The Population_Manager_Base constructor. More...
|
|
virtual unsigned | GetLiveArraySize (int a_listindex) |
| Must be re-implemented in descendent classes. Gets the number of 'live' objects. More...
|
|
virtual unsigned | GetPopulationSize (int a_listindex) |
| Must be re-implemented in descendent classes. 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 void | Run (int a_NoTSteps) |
| A place holder for the run function for all population managers, this must be reimplemented in descendent classes. More...
|
|
virtual void | SetNoProbesAndSpeciesSpecificFunctions (int) |
| A stub to build specfic probes and functions. More...
|
|
virtual int | ProbeFileInput (char *p_Filename, int p_ProbeNo) |
| A stub to build specfic probes and functions. More...
|
|
virtual char * | SpeciesSpecificReporting (int, int) |
| A stub to build specfic reporting. 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 () |
|
virtual void | OpenTheAOROutputProbe (const string &a_string) |
| An empty method that needs to be here because the population manager lists might contain sub-population models which will skip Population_Manager functionality. More...
|
|
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...
|
|
virtual TAnimal * | SupplyAnimalPtr (unsigned int a_index, unsigned int a_animal) |
| Return the animal pointer for the give life stage and number. More...
|
|
Base class for all population managers.
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_Base()
Population_Manager_Base::Population_Manager_Base |
( |
Landscape * |
L | ) |
|
◆ ~Population_Manager_Base()
Population_Manager_Base::~Population_Manager_Base |
( |
| ) |
|
|
protecteddefault |
◆ Catastrophe()
virtual void Population_Manager_Base::Catastrophe |
( |
int |
| ) |
|
|
inlinevirtual |
Must be re-implemented in descendent classes.
◆ FindClosest()
virtual TAnimal* Population_Manager_Base::FindClosest |
( |
int |
, |
|
|
int |
, |
|
|
unsigned |
|
|
) |
| |
|
inlinevirtual |
A stub for identifying an individual at a location.
◆ GetAphidDensity()
virtual double Population_Manager_Base::GetAphidDensity |
( |
int |
, |
|
|
int |
|
|
) |
| |
|
inlinevirtual |
◆ GetLiveArraySize()
virtual unsigned Population_Manager_Base::GetLiveArraySize |
( |
int |
a_listindex | ) |
|
|
inlinevirtual |
◆ GetPopulationSize()
virtual unsigned Population_Manager_Base::GetPopulationSize |
( |
int |
a_listindex | ) |
|
|
inlinevirtual |
◆ GetStepCounterInADay()
int Population_Manager_Base::GetStepCounterInADay |
( |
void |
| ) |
|
|
inline |
◆ OpenTheAOROutputProbe()
virtual void Population_Manager_Base::OpenTheAOROutputProbe |
( |
const string & |
a_string | ) |
|
|
inlinevirtual |
◆ ProbeFileInput()
int Population_Manager_Base::ProbeFileInput |
( |
char * |
p_Filename, |
|
|
int |
p_ProbeNo |
|
) |
| |
|
virtual |
A stub to build specfic probes and functions.
Default probe file input
677 FILE* PFile = fopen(p_Filename,
"r");
683 fgets(S, 255, PFile);
684 fgets(S, 255, PFile);
685 fscanf(PFile,
"%d\n", &data);
687 fgets(S, 255, PFile);
688 fscanf(PFile,
"%d\n", &data);
691 fgets(S, 255, PFile);
694 fscanf(PFile,
"%d", &data);
699 fgets(S, 255, PFile);
700 fgets(S, 255, PFile);
701 fscanf(PFile,
"%d", &data);
703 fgets(S, 255, PFile);
704 fgets(S, 255, PFile);
705 fscanf(PFile,
"%d", &data2);
706 fgets(S, 255, PFile);
707 fgets(S, 255, PFile);
708 fscanf(PFile,
"%d", &data);
715 fgets(S, 255, PFile);
716 fgets(S, 255, PFile);
723 fscanf(PFile,
"%d", &data);
726 fscanf(PFile,
"%d", &data);
729 fscanf(PFile,
"%d", &data);
732 fscanf(PFile,
"%d", &data);
736 fgets(S, 255, PFile);
737 fgets(S, 255, PFile);
738 if (
TheProbe[p_ProbeNo]->m_NoVegTypes > 0)
740 for (
int i = 0; i < 25; i++)
742 fscanf(PFile,
"%d", &data);
746 else if (
TheProbe[p_ProbeNo]->m_NoFarms > 0)
748 for (
int i = 0; i < 25; i++)
750 fscanf(PFile,
"%d", &data);
756 for (
int i = 0; i < 25; i++)
758 fscanf(PFile,
"%d", &data);
References cfg_ProbeMaxAreas, cfg_ProbeTargetTypesNo, Probe_Data::m_FileRecord, 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, Probe_Data::m_ReportInterval, Probe_Data::m_TargetTypes, m_TheLandscape, rectangle::m_x1, rectangle::m_x2, rectangle::m_y1, rectangle::m_y2, TheProbe, Landscape::TranslateEleTypes(), Landscape::TranslateVegTypes(), CfgInt::value(), and Landscape::Warn().
◆ Run()
virtual void Population_Manager_Base::Run |
( |
int |
a_NoTSteps | ) |
|
|
inlinevirtual |
◆ SetNoProbesAndSpeciesSpecificFunctions()
virtual void Population_Manager_Base::SetNoProbesAndSpeciesSpecificFunctions |
( |
int |
| ) |
|
|
inlinevirtual |
◆ SetStepCounterInADay()
void Population_Manager_Base::SetStepCounterInADay |
( |
int |
a_counter | ) |
|
|
inline |
◆ SpeciesSpecificReporting()
virtual char* Population_Manager_Base::SpeciesSpecificReporting |
( |
int |
, |
|
|
int |
|
|
) |
| |
|
inlinevirtual |
◆ SupplyAnimalPtr()
virtual TAnimal* Population_Manager_Base::SupplyAnimalPtr |
( |
unsigned int |
a_index, |
|
|
unsigned int |
a_animal |
|
) |
| |
|
inlinevirtual |
Return the animal pointer for the give life stage and number.
Reimplemented in Population_Manager.
◆ SupplyListName()
const char* Population_Manager_Base::SupplyListName |
( |
int |
a_i | ) |
const |
|
inline |
◆ SupplyListNameLength()
int Population_Manager_Base::SupplyListNameLength |
( |
| ) |
const |
|
inline |
◆ SupplyLocXY()
virtual void Population_Manager_Base::SupplyLocXY |
( |
unsigned |
, |
|
|
unsigned |
, |
|
|
int & |
, |
|
|
int & |
|
|
) |
| |
|
inlinevirtual |
◆ SupplySimH()
int Population_Manager_Base::SupplySimH |
( |
| ) |
const |
|
inline |
Returns landscape height in m.
References SimH.
Referenced by Vole_Base::CopyMyself(), Skylark_Male::EstablishingATerritory(), Skylark_Female::EstablishTerritory(), THare::GetPegDistance(), Vole_Base::Init(), Beetle_Adult::MoveToNoList(), Beetle_Adult::MoveToWithPlacesList(), THare::Run(), Skylark_Female::st_Floating(), Skylark_Male::st_Floating(), Vole_Female::st_Lactating(), and Skylark_Female::st_Laying().
◆ SupplySimHH()
int Population_Manager_Base::SupplySimHH |
( |
| ) |
const |
|
inline |
◆ SupplySimulationName()
std::string Population_Manager_Base::SupplySimulationName |
( |
| ) |
|
|
inline |
◆ SupplySimW()
int Population_Manager_Base::SupplySimW |
( |
| ) |
const |
|
inline |
Returns landscape width in m.
References SimW.
Referenced by Vole_Base::CopyMyself(), Skylark_Male::EstablishingATerritory(), Skylark_Female::EstablishTerritory(), THare::GetPegDistance(), Vole_Base::Init(), Beetle_Adult::MoveToNoList(), Beetle_Adult::MoveToWithPlacesList(), THare::Run(), Skylark_Female::st_Floating(), Skylark_Male::st_Floating(), Vole_Female::st_Lactating(), and Skylark_Female::st_Laying().
◆ SupplySimWH()
int Population_Manager_Base::SupplySimWH |
( |
| ) |
const |
|
inline |
◆ m_AORProbeFileName
std::string Population_Manager_Base::m_AORProbeFileName {"AOR_Probe.txt"} |
|
protected |
◆ m_ListNameLength
int Population_Manager_Base::m_ListNameLength {} |
|
protected |
the number of life-stages simulated in the population manager
Referenced by Beetle_Population_Manager::Beetle_Population_Manager(), Erigone_Population_Manager::Erigone_Population_Manager(), Vole_Population_Manager::Init(), Skylark_Population_Manager::Init(), THare_Population_Manager::Init(), Aphid_Population_Manager::initialisePopulation(), Ladybird_Population_Manager::Ladybird_Population_Manager(), None_Population_Manager::None_Population_Manager(), Oedothorax_Population_Manager::Oedothorax_Population_Manager(), Osmia_Population_Manager::Osmia_Population_Manager(), Spider_Population_Manager::Spider_Population_Manager(), SubPopulation_Population_Manager::SubPopulation_Population_Manager(), SupplyListNameLength(), and TPredator_Population_Manager::TPredator_Population_Manager().
◆ m_ListNames
const char* Population_Manager_Base::m_ListNames[32] {} |
|
protected |
A list of life-stage names.
Referenced by Beetle_Population_Manager::Beetle_Population_Manager(), Erigone_Population_Manager::Erigone_Population_Manager(), Vole_Population_Manager::Init(), Skylark_Population_Manager::Init(), THare_Population_Manager::Init(), Aphid_Population_Manager::initialisePopulation(), SubPopulation_Population_Manager::initialisePopulation(), Ladybird_Population_Manager::Ladybird_Population_Manager(), Population_Manager::LOG(), Oedothorax_Population_Manager::Oedothorax_Population_Manager(), Osmia_Population_Manager::Osmia_Population_Manager(), Population_Manager::Population_Manager(), Spider_Population_Manager::Spider_Population_Manager(), SupplyListName(), and TPredator_Population_Manager::TPredator_Population_Manager().
◆ m_ProbeFileName
std::string Population_Manager_Base::m_ProbeFileName {"Probe.res"} |
|
protected |
◆ m_SimulationName
string Population_Manager_Base::m_SimulationName |
|
protected |
stores the simulation name
Referenced by Beetle_Population_Manager::Beetle_Population_Manager(), Bembidion_Population_Manager::Bembidion_Population_Manager(), Erigone_Population_Manager::Init(), Oedothorax_Population_Manager::Init(), Vole_Population_Manager::Init(), Skylark_Population_Manager::Init(), THare_Population_Manager::Init(), Aphid_Population_Manager::initialisePopulation(), SubPopulation_Population_Manager::initialisePopulation(), Ladybird_Population_Manager::Ladybird_Population_Manager(), Osmia_Population_Manager::Osmia_Population_Manager(), PoecilusCupreus_Population_Manager::PoecilusCupreus_Population_Manager(), SupplySimulationName(), and TPredator_Population_Manager::TPredator_Population_Manager().
◆ m_step_counter_in_a_day
int Population_Manager_Base::m_step_counter_in_a_day |
|
protected |
◆ m_TheLandscape
Landscape* Population_Manager_Base::m_TheLandscape |
|
protected |
holds an internal pointer to the landscape
Referenced by Vole_Population_Manager::AssessHabitat(), Vole_Population_Manager::BarrierSearch(), Beetle_Population_Manager::Beetle_Population_Manager(), Population_Manager::BeginningOfMonth(), Bembidion_Population_Manager::Bembidion_Population_Manager(), Aphid_Population_Manager::calOffspringStageBBandPP(), 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::CreateNest(), Vole_Population_Manager::CreateObjectsInit(), PoecilusCupreus_Population_Manager::DayDegreeCalculations(), Ladybird_Population_Manager::DayDegreeCalculations(), Beetle_Population_Manager::DayDegreeCalculations(), Beetle_Population_Manager::DoBeetleActiveProbe(), Osmia_Population_Manager::DoBefore(), SubPopulation_Population_Manager::doDevelopment(), Erigone_Population_Manager::DoFirst(), Oedothorax_Population_Manager::DoFirst(), Vole_Population_Manager::DoFirst(), Bembidion_Population_Manager::DoFirst(), Skylark_Population_Manager::DoFirst(), Osmia_Population_Manager::DoFirst(), THare_Population_Manager::DoFirst(), Beetle_Population_Manager::DoFirst(), Osmia_Population_Manager::DoLast(), THare_Population_Manager::DoLast(), THare_Population_Manager::ExtraPopMort(), Skylark_Population_Manager::FledgelingProbeOutput(), Vole_Population_Manager::GeneticsOutputFile(), Vole_Population_Manager::GeneticsResultsOutput(), Ladybird_Population_Manager::GetFlyingWeather(), THare_Population_Manager::GetGrowthEfficiency(), THare_Population_Manager::GetGrowthEfficiencyF(), THare_Population_Manager::GetGrowthEfficiencyP(), THare_Population_Manager::GetKJperM(), THare_Population_Manager::GetLitterSize(), THare_Population_Manager::GetMaxDailyGrowthEnergy(), THare_Population_Manager::GetMaxDailyGrowthEnergyF(), THare_Population_Manager::GetMaxDailyGrowthEnergyP(), THare_Population_Manager::GetRMR(), Vole_Population_Manager::ImpactedProbe(), Erigone_Population_Manager::Init(), Oedothorax_Population_Manager::Init(), Vole_Population_Manager::Init(), Osmia_Population_Manager::Init(), Skylark_Population_Manager::Init(), THare_Population_Manager::Init(), SubPopulation_Population_Manager::initialisePopulation(), Aphid_Population_Manager::initialiseSimWithEggs(), Beetle_Population_Manager::IsStartHabitat(), Vole_Population_Manager::IsTrap(), Ladybird_Population_Manager::Ladybird_Population_Manager(), Vole_Population_Manager::LandscapeQuadrantOutputProbe(), Population_Manager::LOG(), THare_Population_Manager::MRROutputs(), Bembidion_Population_Manager::OnFarmEvent(), Ladybird_Population_Manager::OnFarmEvent(), Vole_Population_Manager::OpenResistanceOutput(), Population_Manager::OpenTheAOROutputProbe(), Beetle_Population_Manager::OpenTheAOROutputProbe(), Skylark_Population_Manager::OpenTheFledgelingProbe(), Osmia_Population_Manager::Osmia_Population_Manager(), PoecilusCupreus_Population_Manager::PoecilusCupreus_Population_Manager(), THare_Population_Manager::POMOutputs(), TPredator_Population_Manager::PredAutumnSample(), TPredator_Population_Manager::PredSampleFile(), TPredator_Population_Manager::PredSpringAutumnSample(), TPredator_Population_Manager::PredSpringSample(), Beetle_Population_Manager::Probe(), ProbeFileInput(), Osmia_Population_Manager::ReleaseOsmiaNest(), Vole_Population_Manager::ResistanceOutput(), TPredator_Population_Manager::Run(), SubPopulation_Population_Manager::Run(), Population_Manager::Run(), Vole_Population_Manager::SendMessage(), SubPopulation_Population_Manager::SetNoProbesAndSpeciesSpecificFunctions(), Population_Manager::SetNoProbesAndSpeciesSpecificFunctions(), Population_Manager::Shuffle_or_Sort(), Population_Manager::SpeciesSpecificReporting(), Spider_Population_Manager::Spider_Population_Manager(), SubPopulation_Population_Manager::SubPopulation_Population_Manager(), Vole_Population_Manager::SuitableStartingLocation(), Vole_Population_Manager::TheAgeSexLocationProbe(), 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(), Vole_Population_Manager::TheSexRatiosProbe(), TPredator_Population_Manager::TPredator_Population_Manager(), and Aphid_Population_Manager::updateDevelopmentSeason().
◆ SimH
int Population_Manager_Base::SimH |
|
protected |
stores the simulation height
Referenced by Vole_Population_Manager::FindClosestFemale(), Vole_Population_Manager::FindClosestMale(), Vole_Population_Manager::FindOutsideRadiusMale(), THare_Population_Manager::HuntingGrid(), Vole_Population_Manager::Init(), Osmia_Population_Manager::Init(), THare_Population_Manager::Init(), SubPopulation_Population_Manager::initialisePopulation(), Aphid_Population_Manager::initialiseSimWithEggs(), Vole_Population_Manager::InSquare(), Spider_Population_Manager::InSquare(), Vole_Population_Manager::ListClosestFemales(), Vole_Population_Manager::ListClosestMales(), Population_Manager::Population_Manager(), Vole_Population_Manager::SendMessage(), SubPopulation_Population_Manager::SubPopulation_Population_Manager(), Vole_Population_Manager::SupplyCountFemales(), Vole_Population_Manager::SupplyHowManyVoles(), Vole_Population_Manager::SupplyInOlderTerr(), Vole_Population_Manager::SupplyOlderFemales(), SupplySimH(), Vole_Population_Manager::SupplyVoleList(), and TPredator_Population_Manager::TPredator_Population_Manager().
◆ SimHH
int Population_Manager_Base::SimHH |
|
protected |
◆ SimW
int Population_Manager_Base::SimW |
|
protected |
stores the simulation width
Referenced by Vole_Population_Manager::FindClosestFemale(), Vole_Population_Manager::FindClosestMale(), Vole_Population_Manager::FindOutsideRadiusMale(), THare_Population_Manager::HuntingGrid(), Vole_Population_Manager::Init(), Osmia_Population_Manager::Init(), THare_Population_Manager::Init(), SubPopulation_Population_Manager::initialisePopulation(), Aphid_Population_Manager::initialiseSimWithEggs(), Vole_Population_Manager::InSquare(), Spider_Population_Manager::InSquare(), Vole_Population_Manager::ListClosestFemales(), Vole_Population_Manager::ListClosestMales(), Population_Manager::Population_Manager(), Vole_Population_Manager::SendMessage(), SubPopulation_Population_Manager::SubPopulation_Population_Manager(), Vole_Population_Manager::SupplyCountFemales(), Vole_Population_Manager::SupplyHowManyVoles(), Vole_Population_Manager::SupplyInOlderTerr(), Vole_Population_Manager::SupplyOlderFemales(), SupplySimW(), Vole_Population_Manager::SupplyVoleList(), and TPredator_Population_Manager::TPredator_Population_Manager().
◆ SimWH
int Population_Manager_Base::SimWH |
|
protected |
◆ TheProbe
Probe_Data* Population_Manager_Base::TheProbe[100] = {nullptr} |
The documentation for this class was generated from the following files:
static void SetSimulationWidth(int a_value)
Sets the simulation width.
Definition: PopulationManager.h:321
TTypesOfVegetation TranslateVegTypes(int VegReference)
Returns vegetation type translated from the ALMaSS reference number.
Definition: Landscape.h:2326
bool m_TargetTypes[16]
Definition: PopulationManager.h:441
CfgInt cfg_ProbeTargetTypesNo("PROBE_TARGET_TYPES_NO", CFG_CUSTOM, 10, 1, 16)
bool m_FullLandscapeProbe
Definition: PopulationManager.h:429
static void setLandscapePointer(Landscape *a_landscape)
The function to set the static landscape pointer.
Definition: PesticideToxicity.h:60
const char * m_ListNames[32]
A list of life-stage names.
Definition: PopulationManager.h:628
int SimHH
stores the simulation height halved
Definition: PopulationManager.h:618
unsigned m_y1
Definition: PopulationManager.h:117
int m_ListNameLength
the number of life-stages simulated in the population manager
Definition: PopulationManager.h:626
unsigned m_x2
Definition: PopulationManager.h:118
Landscape * m_TheLandscape
holds an internal pointer to the landscape
Definition: PopulationManager.h:624
int SimWH
stores the simulation width halved
Definition: PopulationManager.h:620
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
int SimH
stores the simulation height
Definition: PopulationManager.h:614
int SupplySimAreaHeight(void)
Gets the simulation landscape height.
Definition: Landscape.h:2302
int SupplySimAreaWidth(void)
Gets the simulation landscape width.
Definition: Landscape.h:2297
TTypesOfLandscapeElement TranslateEleTypes(int EleReference)
Returns element type translated from the ALMaSS reference number.
Definition: Landscape.h:2313
unsigned m_NoEleTypes
Definition: PopulationManager.h:434
static void SetSimulationHeight(int a_value)
Sets the simulation height.
Definition: PopulationManager.h:325
rectangle m_Rect[16]
Definition: PopulationManager.h:433
unsigned m_y2
Definition: PopulationManager.h:119
unsigned m_ReportInterval
Definition: PopulationManager.h:431
int value() const
Definition: Configurator.h:116
unsigned m_NoVegTypes
Definition: PopulationManager.h:435
Probe_Data * TheProbe[100]
Holds a list of pointers to standard output probes.
Definition: PopulationManager.h:588
int SimW
stores the simulation width
Definition: PopulationManager.h:616
unsigned m_NoAreas
Definition: PopulationManager.h:432
bool m_FileRecord
Definition: PopulationManager.h:428
unsigned m_RefFarms[25]
Definition: PopulationManager.h:439
unsigned m_x1
Definition: PopulationManager.h:116
string m_SimulationName
stores the simulation name
Definition: PopulationManager.h:622
unsigned m_NoFarms
Definition: PopulationManager.h:436
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
CfgInt cfg_ProbeMaxAreas("PROBE_MAX_AREAS", CFG_CUSTOM, 10, 1, 16)
static void SetOurLandscape(Landscape *a_value)
Sets the landscape pointer.
Definition: PopulationManager.h:333