ALMaSS Partridge ODdox
1.1
The partridge model description following ODdox protocol
|
Go to the documentation of this file.
39 #ifndef PopulationManagerH
40 #define PopulationManagerH
158 void DEADCODEError();
302 void FileOutput(
int No,
int time,
int ProbeNo );
310 if (!(*m_MyFile).is_open())
367 if (
m_n == 0)
return -1;
442 unsigned int FarmAnimalCensus(
unsigned int a_farm,
unsigned int a_typeofanimal);
448 void LOG(
const char* fname);
458 virtual void Run(
int NoTSteps);
472 return (
unsigned)
TheArray[listindex].size();
482 if (
TheArray[listindex].size() > 1)
return false;
else
491 return TheArray[listindex][j]->WhatState();
493 virtual void SupplyLocXY(
unsigned listindex,
unsigned j,
int & x,
int & y) {
494 x =
TheArray[listindex][j]->Supply_m_Location_x();
495 y =
TheArray[listindex][j]->Supply_m_Location_y();
506 #ifdef __ALMASS_VISUAL
507 ALMaSSGUI * m_MainForm;
555 void SortX(
unsigned Type);
557 void SortY(
unsigned Type);
601 lamdagrid[1][x / __lgridsize][y / __lgridsize]++;
604 lamdagrid[0][x / __lgridsize][y / __lgridsize]++;
607 lamdagrid[0][x / __lgridsize][y / __lgridsize] += z;
610 for (
int i = 0; i < 257; i++) {
611 for (
int j = 0; j < 257; j++) {
const char * SupplyStateNames(int i)
void EmptyTheArray()
Removes all objects from the TheArray by deleting them and clearing TheArray.
char * SpeciesSpecificReporting(int a_species, int a_time)
void SetStepDone(bool a_bool)
Sets the step done indicator flag.
double get_N()
Returns the number of values.
int ProbeFileInput(char *p_Filename, int p_ProbeNo)
int m_catastrophestartyear
double get_SD()
Returns the sample standard deviation.
void CloseTheMonthlyRipleysOutputProbe()
void Shuffle_or_Sort(unsigned Type)
vector< TListOfAnimals > TheArray
unsigned StateNamesLength
TTypesOfPopulation m_population_type
virtual ~TALMaSSObject()
The destructor for TALMaSSObject.
Population_Manager(Landscape *L)
virtual float Probe(int ListIndex, probe_data *p_TheProbe)
virtual void Run(int NoTSteps)
virtual int TheBreedingFemalesProbe(int)
A small class to hold the pointers to active population managers.
TTypesOfPopulation
An enum to hold all the possible types of population handled by a Population_Manager class.
The base class of all ALMaSS objects requiring Step code.
ofstream * OpenFile(char *Nme)
virtual void TheRipleysOutputProbe(FILE *a_prb)
FILE * ReallyBigOutputPrb
virtual int SupplyCovPosy(int)
Landscape * m_OurLandscape
void SetFile(ofstream *F)
TAnimal * FindClosest(int x, int y, unsigned Type)
probe_data * TheProbe[100]
virtual int SupplyCovPosx(int)
virtual void BreedingSuccessProbeOutput(double, int, int, int, int, int, int, int)
bool OpenTheRipleysOutputProbe(string a_NWordFilename)
virtual void CloseTheRipleysOutputProbe()
char m_SimulationName[255]
unsigned GetLiveArraySize(int a_listindex)
Gets the number of 'live' objects for a list index in the TheArray.
bool CheckXY(int l, int i)
Debug method to test for out of bounds coordinates.
const char * SupplyListName(int i)
double get_Total()
Returns the mean.
int Supply_m_Location_x()
void SortXIndex(unsigned Type)
int IndexArrayX[5][10000]
void ImpactProbeReport(int a_Time)
virtual bool OpenTheFledgelingProbe()
void SortState(unsigned Type)
class MapErrorMsg * g_msg
bool OpenForAppendToFile()
TAnimal(int x, int y, Landscape *L)
int GetSeasonNumber()
Get the season number.
TAnimal * SupplyAnimalPtr(int a_index, int a_animal)
Returns the pointer indexed by a_index and a_animal. Note NO RANGE CHECK.
unsigned m_ReportInterval
virtual void EndStep(void)
EndStep behaviour - must be implemented in descendent classes.
void FileOutput(int No, int time, int ProbeNo)
TTypesOfLandscapeElement m_RefEle[25]
The landscape class containing all environmental and topographical data.
void LamdaBirth(int x, int y)
double get_SE()
Returns the sample standard error.
virtual void Step(void)
Step behaviour - must be implemented in descendent classes.
void FileAppendOutput(int No, int time)
Part of the basic ALMaSS system (obselete)
A struct defining two x,y coordinate sets of positive co-ords only.
TTypesOfVegetation m_RefVeg[25]
int SupplySimAreaHeight(void)
int SupplySimAreaWidth(void)
virtual void TheReallyBigOutputProbe()
FILE * RipleysOutputPrb10
void LamdaBirth(int x, int y, int z)
virtual void SupplyLocXY(unsigned listindex, unsigned j, int &x, int &y)
virtual bool OnFarmEvent(FarmToDo)
unsigned SupplyListIndexSize()
The base class for all ALMaSS animal classes.
int m_SeasonNumber
Holds the season number. Used when running goose and hunter sims.
A class defining an animals position.
unsigned BeforeStepActions[12]
virtual void ReinitialiseObject(int x, int y, Landscape *L)
Used to re-use an object - must be implemented in descendent classes.
virtual void EndStep(void)
EndStep behaviour - must be implemented in descendent classes.
virtual void ImpactedProbe()
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
void SetCurrentStateNo(int a_num)
Sets the current state number.
int SupplyState(unsigned listindex, unsigned j)
Data structure to hold & output probe data probe data is designed to be used to return the number of ...
Base class for all population managers.
SimpleStatistics()
SimpleStatistics constructor.
FILE * RipleysOutputPrb11
long int lamdagrid[2][257][257]
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
void CheckManagementXY(int x, int y)
virtual int SupplyPegPosx(int)
double get_varianceS()
Returns the sample variance.
AnimalPosition SupplyPosition()
double get_varianceP()
Returns the population variance.
virtual int TheFledgelingProbe()
virtual void BeginStep(void)
BeingStep behaviour - must be implemented in descendent classes.
double get_meanvalue()
Returns the mean.
TTypesOfLandscapeElement m_EleType
unsigned SupplyStateNamesLength()
void SetPopulation(Population_Manager *p_pm, TTypesOfPopulation a_pt)
char * ProbeReportTimed(int a_time)
virtual int SupplyPegPosy(int)
void remove_variable(double x)
Remove a value.
virtual void CopyMyself()
int SupplyListNameLength()
const char * StateNames[100]
unsigned int FarmAnimalCensus(unsigned int a_farm, unsigned int a_typeofanimal)
virtual int TheBreedingSuccessProbe(int &, int &, int &, int &, int &, int &)
Landscape * m_TheLandscape
TTypesOfPopulation GetPopulationType()
virtual void FledgelingProbeOutput(int, int)
char * ProbeReport(int a_time)
bool OpenTheReallyBigProbe()
virtual void DisplayLocations()
bool OpenTheMonthlyRipleysOutputProbe()
unsigned SupplyFarmOwnerRef()
Population_Manager * m_populationlist[TOP_foobar]
FILE * RipleysOutputPrb12
virtual void GeneticsResultsOutput(FILE *, unsigned)
void OnArrayBoundsError()
Used for debugging only, tests basic object properties.
virtual void TheGeneticProbe(unsigned, int, unsigned &)
vector< TAnimal * > TListOfAnimals
virtual void BreedingPairsOutput(int)
unsigned m_ListNameLength
int GetCurrentStateNo()
Returns the current state number.
void SortStateR(unsigned Type)
virtual void BeginStep(void)
BeingStep behaviour - must be implemented in descendent classes.
void SortX(unsigned Type)
void CheckManagement(void)
int Supply_m_Location_y()
unsigned PartitionLiveDead(unsigned Type)
virtual void Catastrophe(int)
unsigned SupplyListSize(unsigned listindex)
void add_variable(double x)
Add a value.
virtual ~Population_Manager(void)
virtual bool StepFinished()
Overrides the population manager StepFinished - there is no chance that hunters do not finish a step ...
void CorrectWrapRound()
Corrects wrap around co-ordinate problems.
virtual void DoAlmostLast()
virtual void CloseTheReallyBigOutputProbe()
virtual void ReinitialiseObject()
Used to re-use an object - must be implemented in descendent classes.
void Shuffle(unsigned Type)
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
virtual void Step(void)
Step behaviour - must be implemented in descendent classes.
virtual bool OpenTheBreedingSuccessProbe()
void OpenTheAOROutputProbe(string a_AORFilename)
const char * m_ListNames[32]
void SetNoProbes(int a_pn)
virtual bool OpenTheBreedingPairsProbe()
void LOG(const char *fname)
virtual void TheAOROutputProbe()
int SupplyPolyRef(int a_x, int a_y)
bool GetStepDone()
Returns the step done indicator flag.
void SortY(unsigned Type)
void ClearData()
Clears the data.
Population_Manager * GetPopulation(TTypesOfPopulation a_pt)
TALMaSSObject()
The constructor for TALMaSSObject.
vector< unsigned > m_LiveArraySize
void LamdaDeath(int x, int y)
virtual void Catastrophe()
bool IsLast(unsigned listindex)
TTypesOfVegetation m_VegType
void IncLiveArraySize(int a_listindex)
Increments the number of 'live' objects for a list index in the TheArray.