ALMaSS Rabbit ODdox
1.1
The rabbit model description following ODdox protocol
|
The class to handle all predator population related matters. More...
#include <Rabbit_Population_Manager.h>
Public Member Functions | |
Rabbit_Population_Manager (Landscape *L) | |
Rabbit_Population_Manager Constructor. More... | |
virtual | ~Rabbit_Population_Manager (void) |
Rabbit_Population_Manager Destructor. More... | |
void | CreateObjects (RabbitObjectTypes ob_type, TAnimal *pvo, struct_Rabbit *a_data, int a_number) |
Method for creating a new individual Rabbit. More... | |
TTypesOfRabbitHabitat | ClassifyHabitat (TTypesOfLandscapeElement a_tole) |
Classify a landscape element type according to the rabbit habitat classification. More... | |
Rabbit_Warren * | FindClosestWarren (int a_x, int a_y, int a_rank) |
Finds the closest warren as the crow flies. More... | |
void | CheckForRabbitBreedingConditions (void) |
Determines whether it is breeding season. More... | |
bool | IsBreedingSeason (void) |
Get whether it is breeding season. More... | |
void | PesticideDeathRecord (RabbitObjectTypes ob_type) |
Records pesticide poisoning incidents. More... | |
unsigned | SupplyAllBigRabbits () |
Returns the total number of rabbits. More... | |
double | GetGrowth (int a_age) |
Get method for the rabbit growth with age. More... | |
bool | GetForageDay () |
Get method for the forage day flag. More... | |
void | ReproOutputRecordOutput (Rabbit_Female *a_female) |
Print reproductive record to file. More... | |
void | NatalDispersalRecordOutput (Rabbit_Base *a_rabbit) |
Records the natal dispersal. More... | |
Public Member Functions inherited from Population_Manager | |
Population_Manager (Landscape *L) | |
virtual | ~Population_Manager (void) |
void | SetNoProbes (int a_pn) |
unsigned | GetLiveArraySize (int a_listindex) |
Gets the number of 'live' objects for a list index in the TheArray. More... | |
void | IncLiveArraySize (int a_listindex) |
Increments the number of 'live' objects for a list index in the TheArray. More... | |
virtual void | Catastrophe (int) |
unsigned int | FarmAnimalCensus (unsigned int a_farm, unsigned int a_typeofanimal) |
char * | SpeciesSpecificReporting (int a_species, int a_time) |
char * | ProbeReport (int a_time) |
char * | ProbeReportTimed (int a_time) |
void | ImpactProbeReport (int a_Time) |
bool | BeginningOfMonth () |
void | LOG (const char *fname) |
int | SupplyStepSize () |
int | SupplySimW () |
int | SupplySimH () |
virtual void | Run (int NoTSteps) |
virtual float | Probe (int ListIndex, probe_data *p_TheProbe) |
virtual void | ImpactedProbe () |
int | SupplyListNameLength () |
TAnimal * | SupplyAnimalPtr (int a_index, int a_animal) |
Returns the pointer indexed by a_index and a_animal. Note NO RANGE CHECK. More... | |
unsigned | SupplyListIndexSize () |
unsigned | SupplyListSize (unsigned listindex) |
bool | CheckXY (int l, int i) |
Debug method to test for out of bounds coordinates. More... | |
const char * | SupplyListName (int i) |
bool | IsLast (unsigned listindex) |
int | SupplyState (unsigned listindex, unsigned j) |
virtual void | SupplyLocXY (unsigned listindex, unsigned j, int &x, int &y) |
const char * | SupplyStateNames (int i) |
unsigned | SupplyStateNamesLength () |
virtual void | DisplayLocations () |
int | ProbeFileInput (char *p_Filename, int p_ProbeNo) |
TAnimal * | FindClosest (int x, int y, unsigned Type) |
bool | OpenTheRipleysOutputProbe (string a_NWordFilename) |
void | OpenTheAOROutputProbe (string a_AORFilename) |
bool | OpenTheMonthlyRipleysOutputProbe () |
bool | OpenTheReallyBigProbe () |
virtual void | TheRipleysOutputProbe (FILE *a_prb) |
virtual void | TheReallyBigOutputProbe () |
void | CloseTheMonthlyRipleysOutputProbe () |
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) |
Protected Member Functions | |
virtual void | DoFirst () |
Things to do before anything else at the start of a timestep More... | |
virtual void | DoBefore () |
Things to do before the Step. More... | |
virtual void | DoAfter () |
Things to do before the EndStep. More... | |
virtual void | DoLast () |
Things to do after the EndStep. More... | |
void | PreProcessWarrenLocations () |
This pre-scans the landscape and determines all potential warren locations on start-up. More... | |
bool | WarrenLegalPos (int &a_x, int a_y) |
Tests the warrens list to see if this position is legal. More... | |
void | SaveWarrenLocations (void) |
Save warren locations. More... | |
void | LoadWarrenLocations (void) |
Load warren locations. More... | |
double | AssessPctForage (int a_x, int a_y) |
Assesses the percentage of forage for a location assuming max warren size. More... | |
void | CreateLocalWarrenNetworkLists (void) |
Forms the local warren network list for this warren. More... | |
void | WarrenOccupancyRecordOutput () |
Print warren occupancy record to file. More... | |
void | PesticideDeathRecordOutput () |
Print pesticide death record to file. More... | |
void | PesticideDeathRecordOutputOpen () |
Opens pesticide death output file. More... | |
void | PesticideDeathRecordOutputClose () |
Closes the pesticide death output file. More... | |
void | WarrenOccupancyRecordOutputOpen () |
Opens the warren occupancy output file. More... | |
void | WarrenOccupancyRecordOutputClose () |
Closes the warren occupancy output file. More... | |
void | WarrenOutputAnalysis () |
Does analysis on the warren output file and saves the results to RabbitPOMSummary.txt. More... | |
void | LifetimeReproAnalysis () |
Does analysis on the lifetime reproductive output file and saves the results to RabbitPOMSummary.txt. More... | |
void | NatalDispersalAnalysis () |
Does analysis on the natal dispersal output file and saves the results to RabbitPOMSummary.txt. More... | |
void | ReproOutputRecordOutputOpen () |
Opens the reproductive output file. More... | |
void | ReproOutputRecordOutputClose () |
Closes the reproductive output file. More... | |
void | NatalDispersalRecordOutputOpen () |
Opens the reproductive output file. More... | |
void | NatalDispersalRecordOutputClose () |
Closes the reproductive output file. More... | |
void | AssignStaticVariables () |
Assigns any static variables needing config variable assignment. More... | |
void | TheAOROutputProbe () |
Protected Member Functions inherited from Population_Manager | |
virtual bool | StepFinished () |
Overrides the population manager StepFinished - there is no chance that hunters do not finish a step behaviour. More... | |
virtual void | DoAlmostLast () |
void | EmptyTheArray () |
Removes all objects from the TheArray by deleting them and clearing TheArray. More... | |
void | SortX (unsigned Type) |
void | SortXIndex (unsigned Type) |
void | SortY (unsigned Type) |
void | SortState (unsigned Type) |
void | SortStateR (unsigned Type) |
unsigned | PartitionLiveDead (unsigned Type) |
void | Shuffle_or_Sort (unsigned Type) |
void | Shuffle (unsigned Type) |
virtual void | Catastrophe () |
Protected Attributes | |
int | m_warrenfixedsize |
Holds an input variable for max warren size in m More... | |
int | m_warrenfixedsizediv2 |
Half max warren size in m - for speed More... | |
bool | m_rabbitBreedingSeason |
The breeding season flag. More... | |
int | m_reproswitchbuffer |
Prevents continuous breeding season switching. More... | |
double | m_RabbitGrowth [3650] |
Holds daily growth potential of rabbits for each day More... | |
int | m_PesticideDeaths [rob_foobar] |
Holds the number of rabbits killed each day by pesticides. More... | |
ofstream | m_WarrenOccupancyFile |
The warren occupancy output file. More... | |
ofstream | m_NatalDispersalFile |
For recording the natal dispersal of adults from birth to death. More... | |
ofstream | m_ReproOutputFile |
For recording the lifetime reproductive success. More... | |
ofstream | m_PesticideDeathOFile |
The pesticide death output file. More... | |
bool | m_forageday |
Flag to record whether today is a possible forage day. More... | |
Protected Attributes inherited from Population_Manager | |
vector< unsigned > | m_LiveArraySize |
int | m_NoProbes |
AOR_Probe * | m_AOR_Probe |
FILE * | m_GeneticsFile |
FILE * | m_AlleleFreqsFile |
FILE * | m_EasyPopRes |
const char * | StateNames [100] |
int | m_catastrophestartyear |
int | m_StepSize |
vector< TListOfAnimals > | TheArray |
unsigned | StateNamesLength |
const char * | m_ListNames [32] |
unsigned | m_ListNameLength |
FILE * | TestFile |
FILE * | TestFile2 |
unsigned | BeforeStepActions [12] |
int | m_SeasonNumber |
Holds the season number. Used when running goose and hunter sims. More... | |
TTypesOfPopulation | m_population_type |
ofstream * | AOROutputPrb |
FILE * | RipleysOutputPrb |
FILE * | RipleysOutputPrb1 |
FILE * | RipleysOutputPrb2 |
FILE * | RipleysOutputPrb3 |
FILE * | RipleysOutputPrb4 |
FILE * | RipleysOutputPrb5 |
FILE * | RipleysOutputPrb6 |
FILE * | RipleysOutputPrb7 |
FILE * | RipleysOutputPrb8 |
FILE * | RipleysOutputPrb9 |
FILE * | RipleysOutputPrb10 |
FILE * | RipleysOutputPrb11 |
FILE * | RipleysOutputPrb12 |
FILE * | ReallyBigOutputPrb |
long int | lamdagrid [2][257][257] |
Additional Inherited Members | |
Public Attributes inherited from Population_Manager | |
int | IndexArrayX [5][10000] |
probe_data * | TheProbe [100] |
int | SimH |
int | SimW |
unsigned | SimHH |
unsigned | SimWH |
char | m_SimulationName [255] |
bool | ProbesSet |
Landscape * | m_TheLandscape |
The class to handle all predator population related matters.
Definition at line 89 of file Rabbit_Population_Manager.h.
Rabbit_Population_Manager::Rabbit_Population_Manager | ( | Landscape * | L | ) |
Rabbit_Population_Manager Constructor.
Loads the list of Animal Classes.
Initialises global parameters/variables.
Creates some rabbits by introducing a number of male and female rabbits aged 100 to 365 days old. The number is defined by the input configuration variable cfg_StartNoRabbits.
The population manager needs to pre-process the landscape map for potential warren locations. This is very time consuming and so it is possible to read in a pre-processed list of locations. However, if this is done then it needs to be made very certain that the list being read in is the correct one for that landscape. No auto checking is possible.
Definition at line 120 of file Rabbit_Population_Manager.cpp.
References AssignStaticVariables(), cfg_dispersalmortperm, cfg_maxForageHeight, cfg_rabbitdailygrowthparam1, cfg_rabbitdailygrowthparam2, cfg_rabbitdailygrowthparam3, cfg_RabbitStartNos, cfg_RabbitUseNatalDispersalRecord, cfg_RabbitUseReproOutput, cfg_RipleysOutput_used, cfg_warrenfixedsize, cfg_warrenreadlocations, CreateLocalWarrenNetworkLists(), CreateObjects(), g_land_width, LoadWarrenLocations(), struct_Rabbit::m_age, Rabbit_Base::m_dispersalmortperm, struct_Rabbit::m_L, Population_Manager::m_ListNameLength, Population_Manager::m_ListNames, Rabbit_Warren::m_maxForageHeight, struct_Rabbit::m_NPM, m_rabbitBreedingSeason, m_RabbitGrowth, m_reproswitchbuffer, Population_Manager::m_SimulationName, Population_Manager::m_TheLandscape, struct_Rabbit::m_Warren, m_warrenfixedsize, m_warrenfixedsizediv2, struct_Rabbit::m_weightage, struct_Rabbit::m_x, struct_Rabbit::m_x2, struct_Rabbit::m_y, struct_Rabbit::m_y2, NatalDispersalRecordOutputOpen(), Population_Manager::OpenTheRipleysOutputProbe(), PesticideDeathRecordOutputOpen(), PreProcessWarrenLocations(), ReproOutputRecordOutputOpen(), rob_Female, rob_Male, SaveWarrenLocations(), Population_Manager::SimH, Population_Manager::SimW, Landscape::SupplySimAreaWidth(), CfgInt::value(), CfgFloat::value(), CfgBool::value(), and WarrenOccupancyRecordOutputOpen().
|
virtual |
Rabbit_Population_Manager Destructor.
Closes the output files created specially for rabbit output. Calls post run analysis routines and then empties any active rabbits from the TheArray deleting the respective rabbit objects.
Definition at line 225 of file Rabbit_Population_Manager.cpp.
References cfg_RabbitUseNatalDispersalRecord, cfg_RabbitUseReproOutput, LifetimeReproAnalysis(), NatalDispersalAnalysis(), NatalDispersalRecordOutputClose(), PesticideDeathRecordOutputClose(), ReproOutputRecordOutputClose(), Population_Manager::TheArray, CfgBool::value(), WarrenOccupancyRecordOutputClose(), and WarrenOutputAnalysis().
|
protected |
Assesses the percentage of forage for a location assuming max warren size.
/**
[in] | a_x | the x coordinate for the TL corner of the warren. |
[in] | a_y | the y coordinate for the TL corner of the warren. |
Loops through the potential warren area and find all the forage and sums this. Then calculate the percentage.
This is done by getting the polygon references and checking if we had this one already. If not save it with an area of 1 otherwise increment the correct record by 1.
Returns the total forage area divided by the total warren area.
Definition at line 552 of file Rabbit_Population_Manager.cpp.
References ClassifyHabitat(), Population_Manager::m_TheLandscape, m_warrenfixedsize, Landscape::SupplyElementType(), Landscape::SupplyPolyRef(), and torh_Forage.
Referenced by PreProcessWarrenLocations().
|
protected |
Assigns any static variables needing config variable assignment.
This is just needed to make the C++ work. Default variables are assigned to static members at start-up, but any that we actually want to get configuration variable values have to be dealt with here
Definition at line 203 of file Rabbit_Population_Manager.cpp.
References cfg_dispersalmortperm, cfg_maxForageHeight, cfg_minForageDigestability, cfg_rabbit_pesticidedegradationrate, cfg_rabbitmaxkits, cfg_rabbitminkits, struct_Rabbit::m_age, Rabbit_Base::m_dispersalmortperm, struct_Rabbit::m_L, Rabbit_Warren::m_maxForageHeight, Rabbit_Warren::m_minForageDigestability, struct_Rabbit::m_NPM, Rabbit_Base::m_pesticidedegradationrate, Population_Manager::m_TheLandscape, struct_Rabbit::m_Warren, Rabbit_Female::SetMaxKits(), Rabbit_Female::SetMinKits(), and CfgFloat::value().
Referenced by Rabbit_Population_Manager().
void Rabbit_Population_Manager::CheckForRabbitBreedingConditions | ( | void | ) |
Determines whether it is breeding season.
Definition at line 735 of file Rabbit_Population_Manager.cpp.
References cfg_rabbitminbreedingtemp, Calendar::Date(), Calendar::DayInYear(), g_date, Calendar::GetYearNumber(), m_rabbitBreedingSeason, m_reproswitchbuffer, Population_Manager::m_TheLandscape, Landscape::SupplyTempPeriod(), and CfgFloat::value().
Referenced by DoFirst().
TTypesOfRabbitHabitat Rabbit_Population_Manager::ClassifyHabitat | ( | TTypesOfLandscapeElement | a_tole | ) |
Classify a landscape element type according to the rabbit habitat classification.
[in] | a_tole | The type of landscape element |
This is basically a translation function from the element type from the landscape map to the type of habitat it represents for the rabbit. This makes no assessment of the vegetation on the element though.
Definition at line 457 of file Rabbit_Population_Manager.cpp.
References Population_Manager::m_TheLandscape, tole_ActivePit, tole_AmenityGrass, tole_BareRock, tole_BeetleBank, tole_Building, tole_BuiltUpWithParkland, tole_Carpark, tole_Churchyard, tole_Coast, tole_ConiferousForest, tole_Copse, tole_DeciduousForest, tole_Fence, tole_Field, tole_FieldBoundary, tole_FishFarm, tole_Freshwater, tole_Garden, tole_Heath, tole_HedgeBank, tole_Hedges, tole_HeritageSite, tole_IndividualTree, tole_LargeRoad, tole_Marsh, tole_MetalledPath, tole_MixedForest, tole_MownGrass, tole_NaturalGrassDry, tole_NaturalGrassWet, tole_Orchard, tole_OrchardBand, tole_Parkland, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPastureTussocky, tole_PermPastureTussockyWet, tole_PitDisused, tole_PlantNursery, tole_Pond, tole_Pylon, tole_Railway, tole_River, tole_RiversidePlants, tole_RiversideTrees, tole_RoadsideSlope, tole_RoadsideVerge, tole_Saltmarsh, tole_Saltwater, tole_SandDune, tole_Scrub, tole_SmallRoad, tole_StoneWall, tole_Stream, tole_Track, tole_UnknownGrass, tole_UnsprayedFieldMargin, tole_UrbanNoVeg, tole_UrbanPark, tole_Vildtager, tole_Wasteland, tole_WindTurbine, tole_WoodlandMargin, tole_WoodyEnergyCrop, tole_YoungForest, torh_Cover, torh_Forage, torh_Other, torh_TemporaryForage, and Landscape::Warn().
Referenced by AssessPctForage(), Rabbit_Warren::InitEvaluation(), and WarrenLegalPos().
|
protected |
Forms the local warren network list for this warren.
Loops through all warrens in a double loop and checks if any warrens are within maxWarrenNetworkDist of each other. If so then they are added to the warren local network for that warren. If no warrens are close, then the nearest one is added, so that the list is not empty. This is not optimised because it is only called once - of course it could be done faster.
Definition at line 640 of file Rabbit_Population_Manager.cpp.
References cfg_maxWarrenNetworkDist, LocalWarrenNewtorkEntry::m_aWarren, LocalWarrenNewtorkEntry::m_dist, rob_Warren, Population_Manager::SimH, Population_Manager::TheArray, and CfgInt::value().
Referenced by Rabbit_Population_Manager().
void Rabbit_Population_Manager::CreateObjects | ( | RabbitObjectTypes | ob_type, |
TAnimal * | pvo, | ||
struct_Rabbit * | a_data, | ||
int | a_number | ||
) |
Method for creating a new individual Rabbit.
[in] | ob_type | The type of rabbit to create. |
[in] | pvo | unused unless a young is created in which case this points to the mother. |
[in] | a_data | A data structure containing the information needed to create the rabbit object. |
[in] | a_number | The number of objects to create using a_data. |
Creates a_number of new rabbit objects of type ob_type using the information about the rabbit passed in a_data. All rabbit objects created are added to the appropriate rabbit lists held in TheArray. Note that rabbit warrens are also created here to take advantage of the code in TAnimal and population manager handling - I know they are not actually rabbits themselves :)
Warren size is assumed to be 4x the fixed area, this is because low fixed area means low change of less than 100% forage, and rabbits forage quite a distance from the burrow
Definition at line 250 of file Rabbit_Population_Manager.cpp.
References Rabbit_Warren::GetCarryingCapacity(), struct_Rabbit::m_age, struct_Rabbit::m_L, struct_Rabbit::m_NPM, struct_Rabbit::m_soil, struct_Rabbit::m_Warren, m_warrenfixedsize, struct_Rabbit::m_weightage, struct_Rabbit::m_x, struct_Rabbit::m_x2, struct_Rabbit::m_y, struct_Rabbit::m_y2, rob_Female, rob_Juvenile, rob_Male, rob_Warren, rob_Young, and Population_Manager::TheArray.
Referenced by DoFirst(), LoadWarrenLocations(), PreProcessWarrenLocations(), Rabbit_Population_Manager(), Rabbit_Juvenile::st_BecomeAdult(), Rabbit_Young::st_BecomeJuvenile(), and Rabbit_Female::st_GiveBirth().
|
inlineprotectedvirtual |
Things to do before the EndStep.
Reimplemented from Population_Manager.
Definition at line 156 of file Rabbit_Population_Manager.h.
|
inlineprotectedvirtual |
Things to do before the Step.
Reimplemented from Population_Manager.
Definition at line 154 of file Rabbit_Population_Manager.h.
|
protectedvirtual |
Things to do before anything else at the start of a timestep
Reimplemented from Population_Manager.
Definition at line 312 of file Rabbit_Population_Manager.cpp.
References cfg_rabbitdiseasedensitydependencedelay, cfg_rabbitmaxforagerainfall, cfg_rabbitminimumforagetemp, CheckForRabbitBreedingConditions(), CreateObjects(), struct_Rabbit::m_age, m_forageday, struct_Rabbit::m_L, struct_Rabbit::m_NPM, m_PesticideDeaths, Population_Manager::m_TheLandscape, struct_Rabbit::m_Warren, struct_Rabbit::m_weightage, struct_Rabbit::m_x, struct_Rabbit::m_x2, struct_Rabbit::m_y, struct_Rabbit::m_y2, rob_Female, rob_foobar, rob_Male, rob_Warren, rob_Young, Population_Manager::SimH, Population_Manager::SimW, Landscape::SupplyDayInYear(), Landscape::SupplyRain(), Landscape::SupplyTemp(), Landscape::SupplyYearNumber(), Population_Manager::TheArray, CfgInt::value(), and CfgFloat::value().
|
protectedvirtual |
Things to do after the EndStep.
For POM testing the following records have been added to the output:
Reimplemented from Population_Manager.
Definition at line 360 of file Rabbit_Population_Manager.cpp.
References cfg_warrenoccupancyrecordday, Population_Manager::m_TheLandscape, PesticideDeathRecordOutput(), Landscape::SupplyDayInYear(), CfgInt::value(), and WarrenOccupancyRecordOutput().
Rabbit_Warren * Rabbit_Population_Manager::FindClosestWarren | ( | int | a_x, |
int | a_y, | ||
int | a_rank | ||
) |
Finds the closest warren as the crow flies.
[in] | a_x | the x coordinate for the TL corner of the warren. |
[in] | a_y | the y coordinate for the TL corner of the warren. |
[in] | a_rank | the nth rank closest warren to return |
Loops through all warrens and calculates the distance to a_x, a_y. Returns the one ranked 'a_rank' closest as the crow flies. Can handle up to 10 ranks - it will cause an error to ask for more. This is used for the occaisions where the closest warren is one the rabbit knows already, so don't ask for that one.
Definition at line 692 of file Rabbit_Population_Manager.cpp.
References rob_Warren, Population_Manager::SimH, Population_Manager::SimW, and Population_Manager::TheArray.
Referenced by Rabbit_Male::st_EvaluateTerritory(), and Rabbit_Female::st_EvaluateTerritory().
|
inline |
Get method for the forage day flag.
Definition at line 123 of file Rabbit_Population_Manager.h.
References m_forageday.
Referenced by Rabbit_Adult::EndStep(), Rabbit_Young::st_Develop(), Rabbit_Juvenile::st_Develop(), and Rabbit_Warren::st_WarrenBeing().
|
inline |
Get method for the rabbit growth with age.
Definition at line 116 of file Rabbit_Population_Manager.h.
References m_RabbitGrowth.
Referenced by Rabbit_Adult::EndStep(), Rabbit_Adult::Rabbit_Adult(), Rabbit_Juvenile::Rabbit_Juvenile(), Rabbit_Young::st_Develop(), and Rabbit_Juvenile::st_Develop().
|
inline |
Get whether it is breeding season.
Definition at line 106 of file Rabbit_Population_Manager.h.
References m_rabbitBreedingSeason.
Referenced by Rabbit_Female::st_GiveBirth(), Rabbit_Female::st_UpdateBreedingStatus(), and Rabbit_Warren::st_WarrenBeing().
|
protected |
Does analysis on the lifetime reproductive output file and saves the results to RabbitPOMSummary.txt.
Definition at line 1061 of file Rabbit_Population_Manager.cpp.
Referenced by ~Rabbit_Population_Manager().
|
protected |
Load warren locations.
If warren locations are not to be calculated then they are loaded from a standard file called "RabbitWarrenLocations.txt". If the wrong file is used there is no error checking and the result is usually a mysterious crash or strange results. Great care must be taken to ensure this does not happen.
Definition at line 610 of file Rabbit_Population_Manager.cpp.
References cfg_warrenlocationsfile, CreateObjects(), g_msg, struct_Rabbit::m_L, struct_Rabbit::m_NPM, struct_Rabbit::m_soil, Population_Manager::m_TheLandscape, struct_Rabbit::m_x, struct_Rabbit::m_y, rob_Warren, CfgStr::value(), and MapErrorMsg::Warn().
Referenced by Rabbit_Population_Manager().
|
protected |
Does analysis on the natal dispersal output file and saves the results to RabbitPOMSummary.txt.
Definition at line 1133 of file Rabbit_Population_Manager.cpp.
Referenced by ~Rabbit_Population_Manager().
void Rabbit_Population_Manager::NatalDispersalRecordOutput | ( | Rabbit_Base * | a_rabbit | ) |
Records the natal dispersal.
If this method is called it records the current location as well as the location of birth to allow natal dispersal calculations.
Definition at line 912 of file Rabbit_Population_Manager.cpp.
References Rabbit_Base::GetBornLocation(), Rabbit_Base::GetRabbitType(), m_NatalDispersalFile, Population_Manager::m_TheLandscape, TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Landscape::SupplyDayInYear(), and Landscape::SupplyYear().
Referenced by Rabbit_Base::BeginStep().
|
protected |
Closes the reproductive output file.
Definition at line 931 of file Rabbit_Population_Manager.cpp.
References m_NatalDispersalFile.
Referenced by ~Rabbit_Population_Manager().
|
protected |
Opens the reproductive output file.
Definition at line 923 of file Rabbit_Population_Manager.cpp.
References m_NatalDispersalFile.
Referenced by Rabbit_Population_Manager().
void Rabbit_Population_Manager::PesticideDeathRecord | ( | RabbitObjectTypes | ob_type | ) |
Records pesticide poisoning incidents.
Definition at line 768 of file Rabbit_Population_Manager.cpp.
References m_PesticideDeaths.
Referenced by Rabbit_Base::GeneralOrganoPhosphate(), and Rabbit_Female::st_GiveBirth().
|
protected |
Print pesticide death record to file.
Simply records the number of different types of rabbits that died of direct pesticide poisoning and the date it happened.
Definition at line 852 of file Rabbit_Population_Manager.cpp.
References m_PesticideDeathOFile, m_PesticideDeaths, Population_Manager::m_TheLandscape, rob_foobar, rob_Young, Landscape::SupplyDayInYear(), and Landscape::SupplyYear().
Referenced by DoLast().
|
protected |
Closes the pesticide death output file.
Definition at line 882 of file Rabbit_Population_Manager.cpp.
References m_PesticideDeathOFile.
Referenced by ~Rabbit_Population_Manager().
|
protected |
Opens pesticide death output file.
Definition at line 866 of file Rabbit_Population_Manager.cpp.
References m_PesticideDeathOFile.
Referenced by Rabbit_Population_Manager().
|
protected |
This pre-scans the landscape and determines all potential warren locations on start-up.
Scans the landscape from random,random to width,height, then 0,0 to start location. Moves left to right, then top to bottom. At every location a rabbit warren is possible one is created with no population. Soil type determines the density of burrows possible and alters the requirements for fixed forage. Two options are availabe, 1. calculate the soiltype from the information present in the landscape (if this is present); 2. Read the soil type from a config variable and assume the whole landscape is of this type. see cfg_rabbit_fix_soiltype and cfg_rabbit_use_fixed_soiltype
Warrens cannot overlap their fixed areas (they can overlap forage though) and must contain a minimum proportion of fixed forage which varies with soil type.
If the warren position is possible then we need to assess the element contents. This should be above a minimum % fixed forage.
If forage percentages is OK then we can make a warren here, so an empty warren location is created. Note that the Rabbit_Warren constructor takes care of ensuring the warren is intiated to being 'virgin'.
Definition at line 378 of file Rabbit_Population_Manager.cpp.
References AssessPctForage(), cfg_rabbit_fix_soiltype, cfg_rabbit_use_fixed_soiltype, CreateObjects(), struct_Rabbit::m_L, struct_Rabbit::m_NPM, struct_Rabbit::m_soil, Population_Manager::m_TheLandscape, m_warrenfixedsize, struct_Rabbit::m_x, struct_Rabbit::m_y, rob_Warren, Population_Manager::SimH, Population_Manager::SimW, Landscape::SupplySoilTypeR(), Population_Manager::TheArray, CfgInt::value(), CfgBool::value(), and WarrenLegalPos().
Referenced by Rabbit_Population_Manager().
void Rabbit_Population_Manager::ReproOutputRecordOutput | ( | Rabbit_Female * | a_female | ) |
Print reproductive record to file.
Records the age and reproductive output of the rabbit and the date it died
Definition at line 888 of file Rabbit_Population_Manager.cpp.
References Rabbit_Base::GetAge(), Rabbit_Female::GetTotalLitters(), Rabbit_Female::GetTotalOffspring(), m_ReproOutputFile, Population_Manager::m_TheLandscape, Landscape::SupplyDayInYear(), and Landscape::SupplyYear().
Referenced by Rabbit_Female::st_Dying().
|
protected |
Closes the reproductive output file.
Definition at line 906 of file Rabbit_Population_Manager.cpp.
References m_ReproOutputFile.
Referenced by ~Rabbit_Population_Manager().
|
protected |
Opens the reproductive output file.
Definition at line 898 of file Rabbit_Population_Manager.cpp.
References m_ReproOutputFile.
Referenced by Rabbit_Population_Manager().
|
protected |
Save warren locations.
Save the warren locations to "RabbitWarrenLocations.txt" so that these can be loaded again without having to go through the pre-process warren network step each time a landscape is used.
Definition at line 588 of file Rabbit_Population_Manager.cpp.
References cfg_warrenlocationsfile, g_msg, Rabbit_Warren::GetSoilType(), m_warrenfixedsizediv2, rob_Warren, TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Population_Manager::TheArray, CfgStr::value(), and MapErrorMsg::Warn().
Referenced by Rabbit_Population_Manager().
|
inline |
Returns the total number of rabbits.
Definition at line 110 of file Rabbit_Population_Manager.h.
References rob_foobar, rob_Male, and Population_Manager::TheArray.
Referenced by Rabbit_Warren::CalcDisease().
|
protectedvirtual |
Calculates the AOR data for output for the Rabbit
Reimplemented from Population_Manager.
Definition at line 1163 of file Rabbit_Population_Manager.cpp.
References Population_Manager::m_AOR_Probe, and rob_Female.
|
protected |
Tests the warrens list to see if this position is legal.
[in] | a_x | The x-coordinate to assess |
[in] | a_y | The x-coordinate to assess |
Loops through all warrens and asks whether they are closer than m_warrenfixedsize, if so returns false. Must loop through all warrens to return true.
Definition at line 431 of file Rabbit_Population_Manager.cpp.
References ClassifyHabitat(), Population_Manager::m_TheLandscape, m_warrenfixedsize, m_warrenfixedsizediv2, rob_Warren, Landscape::SupplyElementType(), Population_Manager::TheArray, and torh_Forage.
Referenced by PreProcessWarrenLocations().
|
protected |
Print warren occupancy record to file.
Produces a record of mean warren occupancy, number of burrows, disease level, and a a measure of variation in occupancy (CV of occupancy).
For convenience some global stats on population numbers are also produced here.
Definition at line 774 of file Rabbit_Population_Manager.cpp.
References Rabbit_Warren::GetCarryingCapacity(), Rabbit_Warren::GetCarryingCapacityRatio(), Rabbit_Warren::GetDiseaseConstant(), Rabbit_Warren::GetLitterReabsortionConst(), Rabbit_Warren::GetLittersThisYear(), Rabbit_Warren::GetPopulationSize(), Rabbit_Warren::GetRabbitProductionRecord(), Rabbit_Warren::GetThisYears1yrOldFemales(), Rabbit_Warren::GetThisYearsBreeders(), Rabbit_Warren::GetThisYearsBreedersAv(), Rabbit_Warren::GetThisYearsNonBreeders(), Population_Manager::m_TheLandscape, Rabbit_Warren::ResetAllRabbitProductionRecord(), rob_Female, rob_Juvenile, rob_Male, rob_Warren, rob_Young, Landscape::SupplyDayInYear(), Landscape::SupplyYearNumber(), Population_Manager::TheArray, and Rabbit_Warren::UpdateThisYearsBreeders().
Referenced by DoLast().
|
protected |
Closes the warren occupancy output file.
Definition at line 937 of file Rabbit_Population_Manager.cpp.
References m_WarrenOccupancyFile.
Referenced by ~Rabbit_Population_Manager().
|
protected |
Opens the warren occupancy output file.
Definition at line 872 of file Rabbit_Population_Manager.cpp.
References m_WarrenOccupancyFile.
Referenced by Rabbit_Population_Manager().
|
protected |
Does analysis on the warren output file and saves the results to RabbitPOMSummary.txt.
Definition at line 943 of file Rabbit_Population_Manager.cpp.
Referenced by ~Rabbit_Population_Manager().
|
protected |
Flag to record whether today is a possible forage day.
Definition at line 149 of file Rabbit_Population_Manager.h.
Referenced by DoFirst(), and GetForageDay().
|
protected |
For recording the natal dispersal of adults from birth to death.
Definition at line 143 of file Rabbit_Population_Manager.h.
Referenced by NatalDispersalRecordOutput(), NatalDispersalRecordOutputClose(), and NatalDispersalRecordOutputOpen().
|
protected |
The pesticide death output file.
Definition at line 147 of file Rabbit_Population_Manager.h.
Referenced by PesticideDeathRecordOutput(), PesticideDeathRecordOutputClose(), and PesticideDeathRecordOutputOpen().
|
protected |
Holds the number of rabbits killed each day by pesticides.
Definition at line 139 of file Rabbit_Population_Manager.h.
Referenced by DoFirst(), PesticideDeathRecord(), and PesticideDeathRecordOutput().
|
protected |
The breeding season flag.
Definition at line 133 of file Rabbit_Population_Manager.h.
Referenced by CheckForRabbitBreedingConditions(), IsBreedingSeason(), and Rabbit_Population_Manager().
|
protected |
Holds daily growth potential of rabbits for each day
Definition at line 137 of file Rabbit_Population_Manager.h.
Referenced by GetGrowth(), and Rabbit_Population_Manager().
|
protected |
For recording the lifetime reproductive success.
Definition at line 145 of file Rabbit_Population_Manager.h.
Referenced by ReproOutputRecordOutput(), ReproOutputRecordOutputClose(), and ReproOutputRecordOutputOpen().
|
protected |
Prevents continuous breeding season switching.
Definition at line 135 of file Rabbit_Population_Manager.h.
Referenced by CheckForRabbitBreedingConditions(), and Rabbit_Population_Manager().
|
protected |
Holds an input variable for max warren size in m
Definition at line 129 of file Rabbit_Population_Manager.h.
Referenced by AssessPctForage(), CreateObjects(), PreProcessWarrenLocations(), Rabbit_Population_Manager(), and WarrenLegalPos().
|
protected |
Half max warren size in m - for speed
Definition at line 131 of file Rabbit_Population_Manager.h.
Referenced by Rabbit_Population_Manager(), SaveWarrenLocations(), and WarrenLegalPos().
|
protected |
The warren occupancy output file.
Definition at line 141 of file Rabbit_Population_Manager.h.
Referenced by WarrenOccupancyRecordOutputClose(), and WarrenOccupancyRecordOutputOpen().