![]() |
ALMaSS
1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
|
#include <Osmia_Population_Manager.h>
Public Member Functions | |
OsmiaParasitoid_Population_Manager (Landscape *a_landscape, int a_cellsize) | |
~OsmiaParasitoid_Population_Manager () | |
void | AddDispersers (int a_ref, double a_dispersers) |
void | RemoveParasitoids (int a_ref, double a_dispersers) |
double | GetSize (int a_ref) |
double | GetSize (int a_x, int a_y) |
array< double, static_cast< unsigned >TTypeOfOsmiaParasitoids::topara_foobar)> | GetParasitoidNumbers (int a_x, int a_y) |
returns an array with the parasitoid numbers in the cell at the location given by a_x, a_y More... | |
void | AddParasitoid (TTypeOfOsmiaParasitoids a_type, int a_x, int a_y) |
![]() | |
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... | |
Protected Attributes | |
vector< OsmiaParasitoidSubPopulation * > | m_SubPopulations |
The array storing the sub-populations of parasitoids. More... | |
Landscape * | m_TheLandscape |
A useful pointer to the lanscape object. More... | |
unsigned | m_Wide |
the number of subpopulation cells wide More... | |
unsigned | m_High |
the number of subpopulation cells high More... | |
unsigned | m_CellSize |
Width of the cell in m (they are square) More... | |
unsigned | m_Size |
Total cells. More... | |
![]() | |
vector< unsigned > | m_LiveArraySize |
int | m_NoProbes = 0 |
std::vector< std::vector< omp_nest_lock_t * > > | m_MapGuard |
This is used to make sure animals will not behaviour at the same area - multi threads. More... | |
int | m_guard_cell_height_num |
int | m_guard_cell_width_num |
int | m_guard_cell_size |
bool | m_is_paralleled |
This is used to indicate whether the species is paralleled. More... | |
const char * | StateNames [100] {} |
int | m_StepSize {} |
vector< vector< forward_list< TAnimal * > * > > | TheSubArrays |
Hold all the animal pointers. More... | |
vector< vector< int > > | TheSubArraysSizes |
Hold all the animal sizes in each thread. More... | |
vector< int > | m_LifeStageOrderVec |
The vector to store the life stage order for looping specie life stages. More... | |
vector< forward_list< TAnimal * >::iterator > | TheSubArraysIterators |
the iterator from last time called for SupplyAnimalPtr(), this for fast loop all the animals in the derived class. More... | |
vector< int > | TheSubArrayPreviousIndex |
the animal index number from last time called for SupplyAnimalPtr(), this for fast loop all the animals in the derived class. More... | |
vector< int > | TheSubArrayThreadIndex |
the thread index number from last time called for SupplyAnimalPtr(), this for fast loop all the animals in the derived class. More... | |
unsigned | StateNamesLength |
FILE * | TestFile {} |
FILE * | TestFile2 {} |
vector< unsigned > | BeforeStepActions |
Holds the season list of possible before step actions. More... | |
int | m_SeasonNumber |
Holds the season number. Used when running goose and hunter sims. More... | |
TTypesOfPopulation | m_population_type {TOP_NoSpecies} |
ofstream * | AOROutputPrb {} |
ofstream * | RipleysOutputPrb {} |
ofstream * | RipleysOutputPrb1 {} |
ofstream * | RipleysOutputPrb2 {} |
ofstream * | RipleysOutputPrb3 {} |
ofstream * | RipleysOutputPrb4 {} |
ofstream * | RipleysOutputPrb5 {} |
ofstream * | RipleysOutputPrb6 {} |
ofstream * | RipleysOutputPrb7 {} |
ofstream * | RipleysOutputPrb8 {} |
ofstream * | RipleysOutputPrb9 {} |
ofstream * | RipleysOutputPrb10 {} |
ofstream * | RipleysOutputPrb11 {} |
ofstream * | RipleysOutputPrb12 {} |
ofstream * | ReallyBigOutputPrb {} |
AOR_Probe * | m_AOR_Probe {} |
A pointer to the AOR probe. More... | |
long int | lamdagrid [2][257][257] {} |
![]() | |
int | SimH |
stores the simulation height More... | |
int | SimW |
stores the simulation width More... | |
int | SimHH |
stores the simulation height halved More... | |
int | SimWH |
stores the simulation width halved More... | |
string | m_SimulationName |
stores the simulation name More... | |
Landscape * | m_TheLandscape |
holds an internal pointer to the landscape More... | |
int | m_ListNameLength {} |
the number of life-stages simulated in the population manager More... | |
const char * | m_ListNames [32] {} |
A list of life-stage names. More... | |
std::string | m_AORProbeFileName {"AOR_Probe.txt"} |
name of the AOR Probe file More... | |
std::string | m_ProbeFileName {"Probe.res"} |
name of the Probe file More... | |
int | m_step_counter_in_a_day |
Step counter in a day, this is used for the animals with finer step size other than one day. More... | |
Additional Inherited Members | |
![]() | |
bool | ProbesSet {} |
![]() | |
Probe_Data * | TheProbe [100] = {nullptr} |
Holds a list of pointers to standard output probes. More... | |
![]() | |
virtual bool | StepFinished () |
Methods to run the simulations. More... | |
virtual void | DoFirst () |
virtual void | DoBefore () |
virtual void | DoAfter () |
virtual void | DoLast () |
virtual void | DoSpecialBetweenLifeStages (int a_life_stage) |
virtual void | SortX (unsigned Type) |
void | SortXIndex (unsigned Type) |
virtual void | SortY (unsigned Type) |
void | SortState (unsigned Type) |
void | SortStateR (unsigned Type) |
virtual unsigned | PartitionLiveDead (unsigned Type) |
virtual void | Shuffle_or_Sort (unsigned Type) |
virtual void | Shuffle (unsigned Type) |
virtual void | Catastrophe () |
![]() | |
~Population_Manager_Base ()=default | |
OsmiaParasitoid_Population_Manager::OsmiaParasitoid_Population_Manager | ( | Landscape * | a_landscape, |
int | a_cellsize | ||
) |
Intialises each subpopulation of Osmia parasitoids. Creates subpopulation maps and intialises each population Parasitoid populations are described by the enum TTypeOfOsmiaParasitoids
References cfg_OsmiaParasDailyMort, cfg_OsmiaParasDispersal, cfg_OsmiaParasStartHighLow, g_rand_uni_fnc(), m_CellSize, m_High, m_Size, m_SubPopulations, m_TheLandscape, m_Wide, Landscape::SupplySimAreaHeight(), Landscape::SupplySimAreaWidth(), topara_foobar, and CfgArray_Double::value().
OsmiaParasitoid_Population_Manager::~OsmiaParasitoid_Population_Manager | ( | ) |
References m_SubPopulations.
|
inline |
References m_SubPopulations.
Referenced by OsmiaParasitoidSubPopulation::Dispersal().
|
inline |
References m_CellSize, m_Size, m_SubPopulations, and m_Wide.
array< double, static_cast< unsigned >TTypeOfOsmiaParasitoids::topara_foobar)> OsmiaParasitoid_Population_Manager::GetParasitoidNumbers | ( | int | a_x, |
int | a_y | ||
) |
returns an array with the parasitoid numbers in the cell at the location given by a_x, a_y
References m_CellSize, m_Size, m_SubPopulations, m_Wide, and topara_foobar.
Referenced by Osmia_Female::CalcParaistised().
|
inline |
References m_SubPopulations.
|
inline |
References m_SubPopulations, and m_Wide.
|
inline |
References m_SubPopulations.
|
protected |
Width of the cell in m (they are square)
Referenced by AddParasitoid(), GetParasitoidNumbers(), and OsmiaParasitoid_Population_Manager().
|
protected |
the number of subpopulation cells high
Referenced by OsmiaParasitoid_Population_Manager().
|
protected |
Total cells.
Referenced by AddParasitoid(), GetParasitoidNumbers(), and OsmiaParasitoid_Population_Manager().
|
protected |
The array storing the sub-populations of parasitoids.
Referenced by AddDispersers(), AddParasitoid(), GetParasitoidNumbers(), GetSize(), OsmiaParasitoid_Population_Manager(), RemoveParasitoids(), and ~OsmiaParasitoid_Population_Manager().
|
protected |
A useful pointer to the lanscape object.
Referenced by OsmiaParasitoid_Population_Manager().
|
protected |
the number of subpopulation cells wide
Referenced by AddParasitoid(), GetParasitoidNumbers(), GetSize(), and OsmiaParasitoid_Population_Manager().