ALMaSS Partridge ODdox
1.1
The partridge model description following ODdox protocol
|
The population manager for partridge objects. More...
#include <Partridge_Population_Manager.h>
Public Member Functions | |
bool | FillCoveyNeigbourList (Partridge_Covey *a_covey, int a_distance, int a_x, int a_y) |
Get a list of neighbour covies. More... | |
double | TerrEvalPoly (TTypesOfLandscapeElement a_cet, int a_poly) |
Habitat evaluation. More... | |
int | ClutchDensity (int x, int y, int radius) |
Returns clutch density at x,y with radius radius. More... | |
void | AddStarved () |
Record starvation event. More... | |
void | WriteParAdMort (int a_min, int a_age, int a_sex, int a_cause) |
Output method. More... | |
void | WriteParJuvMort (int yr, int a_min, int a_age, int a_cause) |
Output method. More... | |
void | WriteParNoB (int a_min, int a_nob) |
Output method. More... | |
void | WriteParUnpairedMale (int a_min, int a_num) |
Output method. More... | |
void | WriteParClutches (int a_min, int a_num1, int a_num2) |
Output method. More... | |
void | WriteParFlocks (int a_min, int a_size, int a_young) |
Output method. More... | |
void | WriteNoHatchedPerYear (int a_min, int a_num) |
Output method. More... | |
void | AddHatchSuccess (int sz) |
More... | |
int | SupplyPegPosx (int j) |
More... | |
int | SupplyPegPosy (int j) |
More... | |
int | SupplyCovPosx (int j) |
More... | |
int | SupplyCovPosy (int j) |
More... | |
void | ObjectLoopInit (int ob_type) |
More... | |
TAnimal * | ObjectLoopFetch (void) |
More... | |
void | CreateObjects (int ob_type, Partridge_struct *data, int number) |
More... | |
void | CreateInitialObjects (int ob_type, int number) |
More... | |
void | CreateCloneObjects (int ob_type, AdultPartridge_struct *as) |
More... | |
void | AddObject (int ob_type, TAnimal *pTAo) |
More... | |
virtual void | Init (void) |
More... | |
Partridge_Population_Manager (Landscape *a_map) | |
More... | |
virtual | ~Partridge_Population_Manager (void) |
More... | |
void | UpdateNestingCoverMap () |
More... | |
double | GetNestingCoverDensity (int x, int y) |
More... | |
double | GetTerrQual (int x, int y) |
More... | |
unsigned int | GetNewID () |
More... | |
bool | SupplyShouldFlock () |
More... | |
void | DissolveCovey (Partridge_Covey *a_covey) |
More... | |
bool | CoveyDissolveWeather () |
More... | |
void | DoSanityCheck () |
Debug only. More... | |
void | DoMaleSanityCheck () |
Debug only. More... | |
virtual void | TheAOROutputProbe () |
Output method. More... | |
virtual void | TheRipleysOutputProbe (FILE *a_prb) |
Output method. More... | |
double | GetHabitatQuality (int a_day) |
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 | 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 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) |
Public Attributes | |
Partridge_Male * | bad_guys [500] |
Debug. More... | |
PartridgeCommunicationData * | m_comms_data |
Message data. More... | |
Partridge_Communication | m_messagecentre |
Message class pointer. More... | |
CoverTempMap * | m_territoryqualmap |
Pointer to territory quality map. More... | |
CoverTempMap * | m_nestingcovermap |
Pointer to nesting cover map. More... | |
k_factors * | m_Ourkfactors |
Pointer to kfactors object. More... | |
int | m_Starved |
No starvation events. More... | |
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 |
Private Member Functions | |
virtual void | DoFirst () |
Utility method called before BeginStep. More... | |
virtual void | DoBefore () |
Utility method called before Step. More... | |
virtual void | DoAfter () |
Utility method called before EndStep. More... | |
virtual void | DoAlmostLast () |
Utility method called after EndStep. More... | |
virtual void | DoLast () |
Ultility method called at the end of the time-step. More... | |
void | TestShouldFlock () |
Should the birds start to flock? More... | |
void | Hunting (int p_chance) |
Global hunting. More... | |
void | HuntingGrid (int p_chance) |
Density grid-based hunting. More... | |
void | HuntingDifferentiatedBeetleBankArea (int a_pct) |
Differentiated hunting in beetlebank areas. More... | |
void | CreateNestingCoverDensityMap () |
Intitialises the nesting cover map. More... | |
bool | OpenParOutputFiles () |
Opens the partridge output files. More... | |
bool | CloseParOutputFiles () |
Closes the partridge output files. More... | |
void | FillInFoodArray () |
Precalculated food values with age. More... | |
int | HabitatEvalPolyField (int a_field) |
Part of habitat quality map evaluation. More... | |
double | EvalHabitatQual (TTypesOfLandscapeElement a_cet, int a_poly) |
Part of habitat quality map evaluation. More... | |
virtual void | Catastrophe () |
Kill/clone a configuragle proportion of population. More... | |
void | MaleImmigration (void) |
If male immigration is needed - Unused. More... | |
Private Attributes | |
unsigned int | m_loop_index |
More... | |
unsigned int | m_loop_limit |
More... | |
int | m_loop_ob_type |
More... | |
unsigned int | m_Partridge_IDs |
More... | |
bool | m_ShouldFlock |
Flag for flocking or not. More... | |
int | m_HatchSuccess |
No hatch success. More... | |
int | m_maxx |
internal variables More... | |
int | m_maxy |
int | m_halfwidth |
FILE * | ParAdMort |
Adult mortality record. More... | |
FILE * | ParJuvMort |
Juvenile mortaltiy record. More... | |
FILE * | ParNoB |
No of breeding Pairs. More... | |
FILE * | ParClutches |
For each clutch, clutch no. & size. More... | |
FILE * | ParFlocks |
Covey size 1st oct, + no. chicks. More... | |
FILE * | ParUnpairedMale |
No unparied males 1st Jun. More... | |
FILE * | NoHatchedPerYear |
No. successful hatches per year. More... | |
double | m_HabitatQuality [300] |
Part of habitat quality map evaluation. More... | |
Additional Inherited Members | |
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... | |
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) |
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] |
The population manager for partridge objects.
Definition at line 83 of file Partridge_Population_Manager.h.
Partridge_Population_Manager::Partridge_Population_Manager | ( | Landscape * | a_map | ) |
Definition at line 156 of file Partridge_Population_Manager.cpp.
References Init(), m_comms_data, m_Starved, and Population_Manager::TheArray.
|
virtual |
Definition at line 177 of file Partridge_Population_Manager.cpp.
References CloseParOutputFiles(), m_comms_data, m_nestingcovermap, m_Ourkfactors, and m_territoryqualmap.
|
inline |
Definition at line 228 of file Partridge_Population_Manager.h.
References m_HatchSuccess.
Referenced by Partridge_Clutch::ClDeveloping().
void Partridge_Population_Manager::AddObject | ( | int | ob_type, |
TAnimal * | pTAo | ||
) |
Definition at line 457 of file Partridge_Population_Manager.cpp.
References Population_Manager::TheArray.
Referenced by Partridge_Covey::Partridge_Covey().
|
inline |
Record starvation event.
Definition at line 186 of file Partridge_Population_Manager.h.
References m_Starved.
|
privatevirtual |
Kill/clone a configuragle proportion of population.
This version simply alters populations on 1st January - it is very dangerous to add individuals in many of the models so beware!!!!
4th October 2007 - Implemented only to work with ADULT Males and Females
Reimplemented from Population_Manager.
Definition at line 1731 of file Partridge_Population_Manager.cpp.
References cfg_pm_eventfrequency, cfg_pm_eventsize, Partridge_Base::CopyMyself(), Population_Manager::m_catastrophestartyear, Population_Manager::m_TheLandscape, pars_FDying, pars_MDying, pob_Female, pob_Male, Partridge_Base::SetState(), Landscape::SupplyDayInYear(), Landscape::SupplyYearNumber(), Population_Manager::TheArray, and CfgInt::value().
|
private |
Closes the partridge output files.
Definition at line 1631 of file Partridge_Population_Manager.cpp.
References g_msg, NoHatchedPerYear, ParAdMort, ParClutches, ParFlocks, ParJuvMort, ParNoB, ParUnpairedMale, and MapErrorMsg::Warn().
Referenced by ~Partridge_Population_Manager().
int Partridge_Population_Manager::ClutchDensity | ( | int | x, |
int | y, | ||
int | radius | ||
) |
Returns clutch density at x,y with radius radius.
Definition at line 569 of file Partridge_Population_Manager.cpp.
References m_halfwidth, AnimalPosition::m_x, AnimalPosition::m_y, pob_Clutch, and Population_Manager::TheArray.
Referenced by Partridge_Female::FIncubating().
bool Partridge_Population_Manager::CoveyDissolveWeather | ( | ) |
Unused at present.
Definition at line 1422 of file Partridge_Population_Manager.cpp.
Referenced by TestShouldFlock().
void Partridge_Population_Manager::CreateCloneObjects | ( | int | ob_type, |
AdultPartridge_struct * | as | ||
) |
Definition at line 535 of file Partridge_Population_Manager.cpp.
References AdultPartridge_struct::age, Partridge_struct::bx, Partridge_struct::by, Partridge_struct::family_counter, Population_Manager::m_TheLandscape, Partridge_Base::SetAge(), Partridge_Base::SetCovey(), AdultPartridge_struct::sex, TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Population_Manager::TheArray, Partridge_struct::x, and Partridge_struct::y.
Referenced by Partridge_Base::CopyMyself().
void Partridge_Population_Manager::CreateInitialObjects | ( | int | ob_type, |
int | number | ||
) |
Definition at line 465 of file Partridge_Population_Manager.cpp.
References Population_Manager::m_TheLandscape, pob_Female, pob_Male, Partridge_Base::SetCovey(), TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Landscape::SupplyElementType(), Landscape::SupplySimAreaHeight(), Landscape::SupplySimAreaWidth(), Population_Manager::TheArray, tole_AmenityGrass, tole_BareRock, tole_Building, tole_BuiltUpWithParkland, tole_Carpark, tole_Churchyard, tole_Coast, tole_Copse, tole_Fence, tole_Freshwater, tole_Garden, tole_HeritageSite, tole_MetalledPath, tole_Parkland, tole_Pond, tole_River, tole_Saltmarsh, tole_Saltwater, tole_SandDune, tole_StoneWall, tole_Stream, tole_UrbanNoVeg, and tole_UrbanPark.
Referenced by Init().
|
private |
Intitialises the nesting cover map.
Definition at line 778 of file Partridge_Population_Manager.cpp.
References CoverTempMap::AddQual(), EvalHabitatQual(), CoverTempMap::GetQualIndexed(), m_maxx, m_maxy, m_nestingcovermap, m_territoryqualmap, Population_Manager::m_TheLandscape, CoverTempMap::SetQualIndexed(), Landscape::SupplyElementSubType(), Landscape::SupplyElementType(), Landscape::SupplyPolyRef(), Landscape::SupplySimAreaHeight(), Landscape::SupplySimAreaWidth(), tole_HedgeBank, and CoverTempMap::ZeroQual().
Referenced by Init().
void Partridge_Population_Manager::CreateObjects | ( | int | ob_type, |
Partridge_struct * | data, | ||
int | number | ||
) |
Definition at line 368 of file Partridge_Population_Manager.cpp.
References Partridge_struct::bx, Partridge_struct::by, Partridge_struct::family_counter, Covey_struct::first_member, population_attributes::incNoChicksHatched(), population_attributes::incNoChicksSixWeeks(), population_attributes::incNoClutches(), population_attributes::incNoClutchesHatched(), PartridgeCommunicationData::m_clutch, m_comms_data, Partridge_struct::m_covey, PartridgeCommunicationData::m_female, m_messagecentre, m_Ourkfactors, Population_Manager::m_TheLandscape, k_factors::m_ThisYear, Clutch_struct::Mum, Chick_struct::Mum, Clutch_struct::No, Partridge_Communication::PassMessage(), pcomm_SetClutch, pob_Chick, Chick_struct::sex, Landscape::SupplyElementType(), Landscape::SupplyVegType(), Landscape::SupplyYearNumber(), Population_Manager::TheArray, Covey_struct::x, Partridge_struct::x, Covey_struct::y, and Partridge_struct::y.
Referenced by Partridge_Chick::ChMaturing(), Partridge_Chick2::ChMaturing(), Partridge_Clutch::ClDeveloping(), and Partridge_Female::FMakingNest().
void Partridge_Population_Manager::DissolveCovey | ( | Partridge_Covey * | a_covey | ) |
21/03/06 New information makes the males obtain visiting permission from another covey close to them. So that they are not alone. They can do this if the covey is not one formed from their parent covey. Movement from one covey to the next is not subject to alone mortality.
17/02/06 It seems that our behaviour here was not quite right. We need females to stay in the covey until found by a male.
So the sequence of events is:
1) Covery break up message received
2) Pairing in the covey where possible
3) Pairs leave and start repro
4) Single males leave and start to look for females
5) Females wait until a male comes along then they leave
6) When the last females dies or is paired this process is ended.
Definition at line 1475 of file Partridge_Population_Manager.cpp.
References Partridge_Covey::AllFlocking2(), Partridge_Covey::ArePaired(), Partridge_Base::GetCovey(), Partridge_Covey::GetCoveySize(), TALMaSSObject::GetCurrentStateNo(), Partridge_Covey::GetMaleInCovey(), Partridge_Covey::GetMember(), Partridge_Base::GetObjectType(), Partridge_Female::GetOldMate(), Partridge_Base::GetUncleStatus(), Partridge_Covey::GetUnpairedFemale(), m_comms_data, PartridgeCommunicationData::m_covey, PartridgeCommunicationData::m_female, PartridgeCommunicationData::m_male, m_messagecentre, Population_Manager::m_TheLandscape, Partridge_Base::MakeCovey(), Partridge_Communication::PassMessage(), pcomm_Mating, pcomm_MatingM, pcomm_WaitForMale, pob_Female, pob_Male, Partridge_Covey::RemoveMember(), Partridge_Covey::SanityCheck(), Partridge_Base::SetUncleStatus(), Partridge_Male::StartBreedingBehaviour(), and Landscape::Warn().
Referenced by Partridge_Covey::BeginStep().
|
privatevirtual |
Utility method called before EndStep.
Reimplemented from Population_Manager.
Definition at line 1307 of file Partridge_Population_Manager.cpp.
References cfg_ParHuntingType, cfg_ParShootStartYear, cfg_ParShotMax, cfg_ParShotMin, Hunting(), HuntingDifferentiatedBeetleBankArea(), HuntingGrid(), Population_Manager::m_TheLandscape, September, Landscape::SupplyDayInYear(), Landscape::SupplyYearNumber(), and CfgInt::value().
|
privatevirtual |
Utility method called after EndStep.
Reimplemented from Population_Manager.
Definition at line 1335 of file Partridge_Population_Manager.cpp.
References cfg_breedingpairs_date, cfg_flockdata_date, cfg_unpaireddata_date, m_HatchSuccess, Population_Manager::m_TheLandscape, pob_Covey, pob_Female, pob_Male, Landscape::SupplyDayInYear(), Landscape::SupplyGlobalDate(), Population_Manager::TheArray, CfgInt::value(), WriteNoHatchedPerYear(), WriteParFlocks(), WriteParNoB(), and WriteParUnpairedMale().
|
privatevirtual |
Utility method called before Step.
Reimplemented from Population_Manager.
Definition at line 1297 of file Partridge_Population_Manager.cpp.
References DoSanityCheck().
|
privatevirtual |
Utility method called before BeginStep.
One of the primary methods where output and control activities can occur. Since this is the first method called before BeginStep there are no internal inconsistencies and it is certain that all extant objects will be counted/informed.
Reimplemented from Population_Manager.
Definition at line 590 of file Partridge_Population_Manager.cpp.
References population_attributes::AddToChicks6wks(), August, CoveyManager::BroodGeoMean(), k_factors::calcDickPottsk(), k_factors::calcreal_1(), k_factors::calcreal_2(), k_factors::calcreal_3(), cfg_Emigration, cfg_FemalePopSizeMaxCutoff, cfg_par_male_gives_up, cfg_par_start_dissolve, cfg_springcensusdate, December, g_covey_manager, Partridge_Base::GetAge(), Partridge_Male::KillThis(), Partridge_Female::KillThis(), m_Ourkfactors, Population_Manager::m_TheLandscape, k_factors::m_ThisYear, March, May, November, k_factors::Output_kfactors(), pob_Chick, pob_Chick2, pob_Covey, pob_Female, pob_Male, September, population_attributes::SetBirdsInApril(), population_attributes::SetBroodGeoMean(), population_attributes::SetFemalesInApril(), population_attributes::SetMalesInApril(), population_attributes::setNoChick1sAug(), population_attributes::setNoChick2sAug(), population_attributes::setNoChicksSept(), population_attributes::setNoFemalesDec(), population_attributes::setNoFemalesSept(), population_attributes::setNoFemsAug(), population_attributes::setNoMalesAug(), population_attributes::setNoMalesDec(), population_attributes::setNoMalesSept(), population_attributes::SetNonTerritorialFemalesInMay(), population_attributes::setNoOldFemales(), population_attributes::setNoOldMales(), population_attributes::SetPairsInApril(), population_attributes::SetTerritorialFemalesInApril(), population_attributes::SetTerritorialFemalesInMay(), Landscape::SupplyDayInYear(), Landscape::SupplyYearNumber(), TestShouldFlock(), Population_Manager::TheArray, CoveyManager::Tick(), UpdateNestingCoverMap(), and CfgInt::value().
|
privatevirtual |
Ultility method called at the end of the time-step.
Reimplemented from Population_Manager.
Definition at line 1326 of file Partridge_Population_Manager.cpp.
References Population_Manager::DoLast(), and DoSanityCheck().
void Partridge_Population_Manager::DoMaleSanityCheck | ( | ) |
Debug only.
A debug function.
Definition at line 1274 of file Partridge_Population_Manager.cpp.
References Partridge_Male::AmIaMember(), bad_guys, Population_Manager::m_TheLandscape, pars_Destroy, pob_Male, Population_Manager::TheArray, Landscape::Warn(), and TAnimal::WhatState().
void Partridge_Population_Manager::DoSanityCheck | ( | ) |
Debug only.
A debug function.
Definition at line 1252 of file Partridge_Population_Manager.cpp.
References Population_Manager::m_TheLandscape, pob_Covey, Landscape::SupplyDayInYear(), and Population_Manager::TheArray.
Referenced by DoBefore(), and DoLast().
|
private |
Part of habitat quality map evaluation.
Definition at line 837 of file Partridge_Population_Manager.cpp.
References cfg_nest_hedgebank0, cfg_nest_hedgebank1, cfg_nest_hedgebank2, g_msg, HabitatEvalPolyField(), Population_Manager::m_TheLandscape, Landscape::SupplyElementSubType(), 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_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_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_UnsprayedFieldMargin, tole_UrbanNoVeg, tole_UrbanPark, tole_Vildtager, tole_WindTurbine, tole_WoodlandMargin, tole_WoodyEnergyCrop, tole_YoungForest, CfgInt::value(), MapErrorMsg::Warn(), and WARN_BUG.
Referenced by CreateNestingCoverDensityMap(), and UpdateNestingCoverMap().
bool Partridge_Population_Manager::FillCoveyNeigbourList | ( | Partridge_Covey * | a_covey, |
int | a_distance, | ||
int | a_x, | ||
int | a_y | ||
) |
Get a list of neighbour covies.
Definition at line 1571 of file Partridge_Population_Manager.cpp.
References Partridge_Covey::m_neighbourlist, Partridge_Covey::m_neighbourlist_size, pob_Covey, and Population_Manager::TheArray.
Referenced by Partridge_Male::MFindingMate().
|
private |
Precalculated food values with age.
Rather than calculate it every time we need it, this method fills in the values required for each age in days.
The rain scaling factor decreases the energy needed if there is no rain which is compensated for by increased demands when there is rain - overall we maintain our fit to Damerham data.
Definition at line 1390 of file Partridge_Population_Manager.cpp.
References cfg_par_energyslope_perday, cfg_par_mature_threshold, cfg_rainscaling, g_FoodNeed, g_MaxWalk, CfgInt::value(), and CfgFloat::value().
Referenced by Init().
|
inline |
Definition at line 304 of file Partridge_Population_Manager.h.
References m_HabitatQuality.
Referenced by Partridge_Female::FFindingTerritory().
double Partridge_Population_Manager::GetNestingCoverDensity | ( | int | x, |
int | y | ||
) |
Definition at line 754 of file Partridge_Population_Manager.cpp.
References CoverTempMap::GetQual(), and m_nestingcovermap.
Referenced by Partridge_Female::GetNestingCoverDensity().
|
inline |
double Partridge_Population_Manager::GetTerrQual | ( | int | x, |
int | y | ||
) |
Definition at line 766 of file Partridge_Population_Manager.cpp.
References CoverTempMap::GetQual(), and m_territoryqualmap.
|
private |
Part of habitat quality map evaluation.
Definition at line 943 of file Partridge_Population_Manager.cpp.
References Population_Manager::m_TheLandscape, Landscape::SupplyVegPatchy(), Landscape::SupplyVegType(), tov_AgroChemIndustryCereal, tov_BroadBeans, tov_Carrots, tov_CloverGrassGrazed1, tov_CloverGrassGrazed2, tov_FieldPeas, tov_FodderBeet, tov_FodderGrass, tov_Heath, tov_Maize, tov_NaturalGrass, tov_NoGrowth, tov_None, tov_Oats, tov_OBarleyPeaCloverGrass, tov_OCarrots, tov_OCloverGrassGrazed1, tov_OCloverGrassGrazed2, tov_OCloverGrassSilage1, tov_OFieldPeas, tov_OFieldPeasSilage, tov_OFirstYearDanger, tov_OFodderBeet, tov_OGrazingPigs, tov_OOats, tov_OPermanentGrassGrazed, tov_OPotatoes, tov_OSBarleySilage, tov_OSeedGrass1, tov_OSeedGrass2, tov_OSetaside, tov_OSpringBarley, tov_OSpringBarleyClover, tov_OSpringBarleyExt, tov_OSpringBarleyGrass, tov_OSpringBarleyPigs, tov_OTriticale, tov_OWinterBarley, tov_OWinterBarleyExt, tov_OWinterRape, tov_OWinterRye, tov_OWinterWheat, tov_OWinterWheatUndersown, tov_PermanentGrassGrazed, tov_PermanentGrassLowYield, tov_PermanentGrassTussocky, tov_PermanentSetaside, tov_Potatoes, tov_PotatoesIndustry, tov_SeedGrass1, tov_SeedGrass2, tov_Setaside, tov_SpringBarley, tov_SpringBarleyCloverGrass, tov_SpringBarleyGrass, tov_SpringBarleyPTreatment, tov_SpringBarleySeed, tov_SpringBarleySilage, tov_SpringBarleySKManagement, tov_SpringBarleySpr, tov_SpringRape, tov_SpringWheat, tov_SugarBeet, tov_Triticale, tov_Undefined, tov_WinterBarley, tov_WinterRape, tov_WinterRye, tov_WinterWheat, tov_WinterWheatShort, tov_WWheatPControl, tov_WWheatPToxicControl, tov_WWheatPTreatment, and tov_YoungForest.
Referenced by EvalHabitatQual().
|
private |
Global hunting.
Implements a global mortality probability per bird on a single day of the year. Only adults and Chick2 objects are affected.
Definition at line 1116 of file Partridge_Population_Manager.cpp.
References population_attributes::incNoShotBirds(), population_attributes::incNoShotFemales(), m_Ourkfactors, k_factors::m_ThisYear, pob_Chick2, pob_Female, pob_Male, and Population_Manager::TheArray.
Referenced by DoAfter().
|
private |
Differentiated hunting in beetlebank areas.
Differential hunting inside a specific area designated as beetlebank addition area. Takes a fixed proportion of the population (input variable for inside and outside), in the middle of the hunting season
Definition at line 1204 of file Partridge_Population_Manager.cpp.
References cfg_BeetleBankInvert, cfg_BeetleBankMaxX, cfg_BeetleBankMaxY, cfg_BeetleBankMinX, cfg_BeetleBankMinY, cfg_ParHuntingBeetleBankArea, population_attributes::incNoShotBirds(), m_Ourkfactors, k_factors::m_ThisYear, pob_Chick2, pob_Female, Population_Manager::TheArray, CfgInt::value(), and CfgBool::value().
Referenced by DoAfter().
|
private |
Density grid-based hunting.
The hunting pressure is applied in a grid of variable size and only when densities in the grid are above a specified threshold.
Definition at line 1159 of file Partridge_Population_Manager.cpp.
References cfg_ParHuntingGridSize, cfg_ParHuntingThreshold, population_attributes::incNoShotBirds(), m_Ourkfactors, k_factors::m_ThisYear, AnimalPosition::m_x, AnimalPosition::m_y, pob_Chick2, pob_Female, Population_Manager::SimW, Population_Manager::TheArray, and CfgInt::value().
Referenced by DoAfter().
|
virtual |
Definition at line 207 of file Partridge_Population_Manager.cpp.
References Population_Manager::BeforeStepActions, cfg_par_last_brood_date, cfg_par_max_terr_qual, cfg_par_min_terr_qual, cfg_par_rainfactor, cfg_par_start_dissolve, cfg_ReallyBigOutput_used, cfg_RipleysOutput_used, cfg_StartingNumberFemalePartridges, cfg_StartingNumberMalePartridges, k_factors::CreateInfoDatabaseFile(), CreateInitialObjects(), CreateNestingCoverDensityMap(), FillInFoodArray(), g_msg, g_par_rainfactor, m_HabitatQuality, m_halfwidth, m_HatchSuccess, Population_Manager::m_ListNameLength, Population_Manager::m_ListNames, m_maxx, m_maxy, m_nestingcovermap, m_Ourkfactors, m_Partridge_IDs, Population_Manager::m_population_type, m_ShouldFlock, Population_Manager::m_SimulationName, m_territoryqualmap, Population_Manager::m_TheLandscape, k_factors::m_ThisYear, OpenParOutputFiles(), Population_Manager::OpenTheReallyBigProbe(), Population_Manager::OpenTheRipleysOutputProbe(), pars_ChDeveloping, pars_ChDying, pars_ChMaturing, pars_ClDeveloping, pars_ClDying, pars_ClHatching, pars_CMoving, pars_CoveyBeing, pars_CoveyDissolve, pars_Destroy, pars_FAttractingMate, pars_FBuildingUpResources, pars_FCaringForYoung, pars_FDying, pars_FFindingTerritory, pars_FFlocking, pars_FIncubating, pars_FLaying, pars_FMakingNest, pars_FStartingNewBrood, pars_Initiation, pars_MCaringForYoung, pars_MDying, pars_MFindingMate, pars_MFlocking, pars_MFollowingMate, pars_MGuardingMate, pars_MPairing, pob_Female, pob_Male, Population_Manager::ReallyBigOutputPrb, population_attributes::setNoMalesSept(), Population_Manager::StateNames, Population_Manager::StateNamesLength, Landscape::SupplySimAreaHeight(), Landscape::SupplySimAreaWidth(), TOP_Partridge, CfgInt::value(), CfgFloat::value(), CfgBool::value(), MapErrorMsg::Warn(), Landscape::Warn(), and WARN_BUG.
Referenced by Partridge_Population_Manager().
|
private |
If male immigration is needed - Unused.
Unused at present
Definition at line 1813 of file Partridge_Population_Manager.cpp.
References cfg_MaleImmigration, Partridge_Base::CopyMyself(), Population_Manager::m_TheLandscape, pob_Male, Landscape::SupplyDayInYear(), Population_Manager::TheArray, and CfgInt::value().
TAnimal * Partridge_Population_Manager::ObjectLoopFetch | ( | void | ) |
Definition at line 196 of file Partridge_Population_Manager.cpp.
References m_loop_index, m_loop_limit, m_loop_ob_type, and Population_Manager::TheArray.
Referenced by Partridge_Covey::FindMateInArea().
void Partridge_Population_Manager::ObjectLoopInit | ( | int | ob_type | ) |
Definition at line 187 of file Partridge_Population_Manager.cpp.
References m_loop_index, m_loop_limit, m_loop_ob_type, and Population_Manager::TheArray.
Referenced by Partridge_Covey::FindMateInArea().
|
private |
Opens the partridge output files.
Definition at line 1612 of file Partridge_Population_Manager.cpp.
References NoHatchedPerYear, ParAdMort, ParClutches, ParFlocks, ParJuvMort, ParNoB, and ParUnpairedMale.
Referenced by Init().
|
inlinevirtual |
Reimplemented from Population_Manager.
Definition at line 243 of file Partridge_Population_Manager.h.
References pob_Covey, and Population_Manager::TheArray.
|
inlinevirtual |
Reimplemented from Population_Manager.
Definition at line 248 of file Partridge_Population_Manager.h.
References pob_Covey, and Population_Manager::TheArray.
|
inlinevirtual |
Reimplemented from Population_Manager.
Definition at line 233 of file Partridge_Population_Manager.h.
References pob_Covey, and Population_Manager::TheArray.
|
inlinevirtual |
Reimplemented from Population_Manager.
Definition at line 238 of file Partridge_Population_Manager.h.
References pob_Covey, and Population_Manager::TheArray.
|
inline |
Definition at line 286 of file Partridge_Population_Manager.h.
References m_ShouldFlock.
Referenced by Partridge_Chick2::DailyMortality(), Partridge_Male::DailyMortality(), Partridge_Female::FAttractingMate(), Partridge_Female::FFindingTerritory(), and Partridge_Male::MFindingMate().
double Partridge_Population_Manager::TerrEvalPoly | ( | TTypesOfLandscapeElement | a_cet, |
int | a_poly | ||
) |
Habitat evaluation.
|
private |
Should the birds start to flock?
Called every day. The aim here is to get covey dissolve after a spedified date, and reflocking after a later date.
Definition at line 1435 of file Partridge_Population_Manager.cpp.
References cfg_par_male_gives_up, cfg_par_start_dissolve, CoveyDissolveWeather(), m_ShouldFlock, Population_Manager::m_TheLandscape, pob_Covey, Landscape::SupplyDayInYear(), Population_Manager::TheArray, and CfgInt::value().
Referenced by DoFirst().
|
virtual |
Output method.
Reimplemented from Population_Manager.
Definition at line 1705 of file Partridge_Population_Manager.cpp.
References Population_Manager::m_AOR_Probe, and pob_Female.
|
virtual |
Output method.
An output designed to be used as an input to calculating Ripley's k in R.
Reimplemented from Population_Manager.
Definition at line 1713 of file Partridge_Population_Manager.cpp.
References Population_Manager::m_TheLandscape, pob_Female, TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Landscape::SupplySimAreaWidth(), and Population_Manager::TheArray.
void Partridge_Population_Manager::UpdateNestingCoverMap | ( | ) |
Definition at line 1084 of file Partridge_Population_Manager.cpp.
References CoverTempMap::AddQual(), EvalHabitatQual(), m_territoryqualmap, Population_Manager::m_TheLandscape, Landscape::SupplyElementType(), Landscape::SupplyPolyRef(), Landscape::SupplySimAreaHeight(), Landscape::SupplySimAreaWidth(), and CoverTempMap::ZeroQual().
Referenced by DoFirst().
void Partridge_Population_Manager::WriteNoHatchedPerYear | ( | int | a_min, |
int | a_num | ||
) |
Output method.
Definition at line 1696 of file Partridge_Population_Manager.cpp.
References NoHatchedPerYear.
Referenced by DoAlmostLast().
void Partridge_Population_Manager::WriteParAdMort | ( | int | a_min, |
int | a_age, | ||
int | a_sex, | ||
int | a_cause | ||
) |
Output method.
Definition at line 1658 of file Partridge_Population_Manager.cpp.
References ParAdMort.
void Partridge_Population_Manager::WriteParClutches | ( | int | a_min, |
int | a_num1, | ||
int | a_num2 | ||
) |
Output method.
Definition at line 1682 of file Partridge_Population_Manager.cpp.
References ParClutches.
Referenced by Partridge_Female::FLaying().
void Partridge_Population_Manager::WriteParFlocks | ( | int | a_min, |
int | a_size, | ||
int | a_young | ||
) |
Output method.
Definition at line 1688 of file Partridge_Population_Manager.cpp.
References ParFlocks.
Referenced by DoAlmostLast().
void Partridge_Population_Manager::WriteParJuvMort | ( | int | yr, |
int | a_min, | ||
int | a_age, | ||
int | a_cause | ||
) |
Output method.
Definition at line 1664 of file Partridge_Population_Manager.cpp.
References ParJuvMort.
void Partridge_Population_Manager::WriteParNoB | ( | int | a_min, |
int | a_nob | ||
) |
Output method.
Definition at line 1670 of file Partridge_Population_Manager.cpp.
References ParNoB.
Referenced by DoAlmostLast().
void Partridge_Population_Manager::WriteParUnpairedMale | ( | int | a_min, |
int | a_num | ||
) |
Output method.
Definition at line 1676 of file Partridge_Population_Manager.cpp.
References ParUnpairedMale.
Referenced by DoAlmostLast().
Partridge_Male* Partridge_Population_Manager::bad_guys[500] |
Debug.
Definition at line 159 of file Partridge_Population_Manager.h.
Referenced by DoMaleSanityCheck().
PartridgeCommunicationData* Partridge_Population_Manager::m_comms_data |
Message data.
Definition at line 161 of file Partridge_Population_Manager.h.
Referenced by Partridge_Clutch::AgDying(), Partridge_Clutch::ClDeveloping(), CreateObjects(), DissolveCovey(), Partridge_Female::FDying(), Partridge_Female::FFindingTerritory(), Partridge_Female::FIncubating(), Partridge_Female::FLaying(), Partridge_Female::FMakingNest(), Partridge_Female::FStartingNewBrood(), Partridge_Male::MDying(), Partridge_Male::MFindingMate(), Partridge_Covey::OnChickDeath(), Partridge_Covey::OnChickMature(), Partridge_Population_Manager(), and ~Partridge_Population_Manager().
|
private |
Part of habitat quality map evaluation.
Definition at line 151 of file Partridge_Population_Manager.h.
Referenced by GetHabitatQuality(), and Init().
|
private |
Definition at line 129 of file Partridge_Population_Manager.h.
Referenced by ClutchDensity(), and Init().
|
private |
No hatch success.
Definition at line 127 of file Partridge_Population_Manager.h.
Referenced by AddHatchSuccess(), DoAlmostLast(), and Init().
|
private |
Definition at line 110 of file Partridge_Population_Manager.h.
Referenced by ObjectLoopFetch(), and ObjectLoopInit().
|
private |
Definition at line 112 of file Partridge_Population_Manager.h.
Referenced by ObjectLoopFetch(), and ObjectLoopInit().
|
private |
Definition at line 114 of file Partridge_Population_Manager.h.
Referenced by ObjectLoopFetch(), and ObjectLoopInit().
|
private |
internal variables
Definition at line 129 of file Partridge_Population_Manager.h.
Referenced by CreateNestingCoverDensityMap(), and Init().
|
private |
Definition at line 129 of file Partridge_Population_Manager.h.
Referenced by CreateNestingCoverDensityMap(), and Init().
Partridge_Communication Partridge_Population_Manager::m_messagecentre |
Message class pointer.
Definition at line 163 of file Partridge_Population_Manager.h.
Referenced by Partridge_Clutch::AgDying(), Partridge_Clutch::ClDeveloping(), CreateObjects(), DissolveCovey(), Partridge_Female::FDying(), Partridge_Female::FFindingTerritory(), Partridge_Female::FIncubating(), Partridge_Female::FLaying(), Partridge_Female::FMakingNest(), Partridge_Female::FStartingNewBrood(), Partridge_Male::MDying(), Partridge_Male::MFindingMate(), Partridge_Covey::OnChickDeath(), and Partridge_Covey::OnChickMature().
CoverTempMap* Partridge_Population_Manager::m_nestingcovermap |
Pointer to nesting cover map.
Definition at line 167 of file Partridge_Population_Manager.h.
Referenced by CreateNestingCoverDensityMap(), GetNestingCoverDensity(), Init(), and ~Partridge_Population_Manager().
k_factors* Partridge_Population_Manager::m_Ourkfactors |
Pointer to kfactors object.
Definition at line 169 of file Partridge_Population_Manager.h.
Referenced by Partridge_Clutch::AgDying(), Partridge_Chick::ChDeveloping(), Partridge_Chick::ChDying(), Partridge_Clutch::ClDying(), CreateObjects(), DoFirst(), Partridge_Female::FDying(), Partridge_Female::FIncubating(), Partridge_Female::FLaying(), Partridge_Female::FMakingNest(), Hunting(), HuntingDifferentiatedBeetleBankArea(), HuntingGrid(), Init(), Partridge_Male::MDying(), and ~Partridge_Population_Manager().
|
private |
Definition at line 116 of file Partridge_Population_Manager.h.
Referenced by GetNewID(), and Init().
|
private |
Flag for flocking or not.
Definition at line 123 of file Partridge_Population_Manager.h.
Referenced by Init(), SupplyShouldFlock(), and TestShouldFlock().
int Partridge_Population_Manager::m_Starved |
No starvation events.
Definition at line 171 of file Partridge_Population_Manager.h.
Referenced by AddStarved(), and Partridge_Population_Manager().
CoverTempMap* Partridge_Population_Manager::m_territoryqualmap |
Pointer to territory quality map.
Definition at line 165 of file Partridge_Population_Manager.h.
Referenced by CreateNestingCoverDensityMap(), GetTerrQual(), Partridge_Covey::HabitatEvaluateFaster(), Init(), UpdateNestingCoverMap(), and ~Partridge_Population_Manager().
|
private |
No. successful hatches per year.
Definition at line 144 of file Partridge_Population_Manager.h.
Referenced by CloseParOutputFiles(), OpenParOutputFiles(), and WriteNoHatchedPerYear().
|
private |
Adult mortality record.
Definition at line 132 of file Partridge_Population_Manager.h.
Referenced by CloseParOutputFiles(), OpenParOutputFiles(), and WriteParAdMort().
|
private |
For each clutch, clutch no. & size.
Definition at line 138 of file Partridge_Population_Manager.h.
Referenced by CloseParOutputFiles(), OpenParOutputFiles(), and WriteParClutches().
|
private |
Covey size 1st oct, + no. chicks.
Definition at line 140 of file Partridge_Population_Manager.h.
Referenced by CloseParOutputFiles(), OpenParOutputFiles(), and WriteParFlocks().
|
private |
Juvenile mortaltiy record.
Definition at line 134 of file Partridge_Population_Manager.h.
Referenced by CloseParOutputFiles(), OpenParOutputFiles(), and WriteParJuvMort().
|
private |
No of breeding Pairs.
Definition at line 136 of file Partridge_Population_Manager.h.
Referenced by CloseParOutputFiles(), OpenParOutputFiles(), and WriteParNoB().
|
private |
No unparied males 1st Jun.
Definition at line 142 of file Partridge_Population_Manager.h.
Referenced by CloseParOutputFiles(), OpenParOutputFiles(), and WriteParUnpairedMale().