ALMaSS Vole ODDox
1.1
The vole model description following ODdox protocol
|
The class to handle all vole population related matters. More...
#include <VolePopulationManager.h>
Public Member Functions | |
uint32 | GetVoleAllele (int a_list, int a_vole, int a_locus, int a_chromosome) |
used to get a specific vole allele from outside the population manager More... | |
virtual void | ImpactedProbe () |
bool | IsTrap (int p_x, int p_y) |
void | TheAgeSexLocationProbe () |
virtual void | TheAOROutputProbe () |
virtual void | TheRipleysOutputProbe (FILE *a_prb) |
virtual void | TheReallyBigOutputProbe () |
virtual void | TheSexRatiosProbe () |
virtual void | LandscapeQuadrantOutputProbe (int a_day) |
void | AddToFrag1Male () |
void | AddToFrag1Female () |
void | AddToFrag2Male () |
void | AddToFrag2Female () |
void | AddToFrag3Male () |
void | AddToFrag3Female () |
Vole_Population_Manager (Landscape *p_L) | |
virtual | ~Vole_Population_Manager () |
void | CreateObjects (VoleObject ob_type, TAnimal *pvo, struct_Vole_Adult *as, int number) |
void | CreateObjects_Init (VoleObject ob_type, TAnimal *pvo, struct_Vole_Adult *as, int number) |
virtual void | Init (void) |
bool | RecordGeneticsToday (int p_today, int p_year, int p_start_year, int p_interval) |
double | GetHabitatQuality (int a_index) |
bool | SupplyOlderFemales (unsigned p_x, unsigned p_y, unsigned p_Age, unsigned p_range) |
int | SupplyHowManyVoles (unsigned p_x, unsigned p_y, unsigned p_size) |
int | SupplyGrowthStartDate () |
int | SupplyInOlderTerr (unsigned p_x, unsigned p_y, unsigned p_Age, unsigned p_Range) |
int | SupplyCountFemales (unsigned p_x, unsigned p_y, unsigned p_TerrRange) |
void | SendMessage (TTypeOfVoleMessage p_message, unsigned p_x, unsigned p_y, unsigned p_range, bool p_sex, double p_Weight) |
vector< Vole_Base * > * | SupplyVoleList (unsigned x, unsigned y, unsigned range) |
bool | InSquare (int p_x, int p_y, int p_sqx, int p_sqy, int p_range) |
int | ListClosestFemales (int p_x, int p_y, int p_steps) |
int | ListClosestMales (int p_x, int p_y, int p_steps) |
Vole_Female * | FindClosestFemale (int p_x, int p_y, int p_steps) |
Vole_Male * | FindClosestMale (int p_x, int p_y, int p_steps) |
Vole_Male * | FindRandomMale () |
void | AddToYoung (int young) |
Vole_Male * | FindWithinRadiusMale (int p_x, int p_y) |
Vole_Male * | FindOutsideRadiusMale (int p_x, int p_y) |
bool | BarrierSearch (int F_x, int F_y, int M_x, int M_y) |
void | AddToYoungYr (int young) |
void | AddToJuvs (int juvs) |
void | AddToNoYoungInfanticideCount (int m_NoOfYoung, int m_YoungAge) |
void | ReproductionProbe () |
void | GeneticsOutputFile (unsigned listindex) |
virtual void | GeneticsResultsOutput (FILE *ofile, unsigned listindex) |
void | OpenResistanceOutput () |
Opens the output file ready for resistance results. More... | |
void | CloseResistanceOutput () |
Closes the output file ready for resistance results. More... | |
void | ResistanceOutput () |
Resistance results file output 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) |
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 () |
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 &) |
Public Attributes | |
VoleSummaryOutput * | m_VoleRecordMort |
FILE * | SexRatiosPrb |
int | ReproTable [4][12] |
unsigned | IDNumber |
Vole_FemaleList | FList |
Vole_MaleList | MList |
AlleleFreq * | AFreq |
int | YoungProducedToday |
int | JuvsProducedToday |
int | NoYoungKilledToday |
int | NoYoungKilledToday4 |
int | NoYoungKilledToday8 |
int | NoYoungKilledToday9 |
FILE * | YoungsFile |
IDMap< TAnimal * > * | m_VoleMap |
int | m_geneticproductfertilityeffect |
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 |
Protected Member Functions | |
void | DoFirst () |
virtual void | Catastrophe () |
bool | OpenSexRatiosProbe () |
void | CloseSexRatiosProbe () |
bool | SuitableStartingLocation (int a_x, int a_y) |
double | AssessHabitat (int p_Polyref) |
Assess the quality of habitat at p_Polyref. More... | |
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 | DoBefore () |
virtual void | DoAfter () |
virtual void | DoAlmostLast () |
virtual void | DoLast () |
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) |
The class to handle all vole population related matters.
Definition at line 151 of file VolePopulationManager.h.
Vole_Population_Manager::Vole_Population_Manager | ( | Landscape * | p_L | ) |
Class for managing lists of all voles in the simulation and responsible for generating output. Main functionality is the the base class Population_Manager
Definition at line 195 of file VolePopulationManager.cpp.
References AFreq, IDNumber, Init(), m_GrowthStartDate, m_VoleMap, Population_Manager::TheArray, thisYear, and YearsTotal.
|
virtual |
Vole_Population_Manager destructor
Only needed to close any potentially open output files
Definition at line 218 of file VolePopulationManager.cpp.
References AFreq, cfg_RecordVoleMort(), cfg_SexRatiosOutput_used(), cfg_useagesexlocation(), cfg_UseVoleTraplines(), cfg_VoleUseResistanceOuput(), CloseResistanceOutput(), CloseSexRatiosProbe(), Population_Manager::m_AlleleFreqsFile, Population_Manager::m_EasyPopRes, Population_Manager::m_GeneticsFile, m_Traplines, m_VoleMap, m_VoleRecordMort, and VoleSummaryOutput::OPrint().
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 255 of file VolePopulationManager.h.
References JuvsProducedToday.
Referenced by Vole_Female::st_Lactating().
|
inline |
Definition at line 256 of file VolePopulationManager.h.
References NoYoungKilledToday, NoYoungKilledToday4, NoYoungKilledToday8, and NoYoungKilledToday9.
Referenced by Vole_Female::OnInfanticideAttempt().
|
inline |
Definition at line 250 of file VolePopulationManager.h.
References YoungProducedToday.
Referenced by Vole_Female::st_GiveBirth().
|
inline |
|
protected |
Assess the quality of habitat at p_Polyref.
Each unit of area (1m2) is assigned a score based on the polygon type. These scores fall currently into a limited number of catagories, with 4, 3, 2.5, 2, 1, & 0 being the only scores currently used. 2.5 is only used by young forest which is a hybrid between 2 & 3 represented by grassland and forest respectively. 4 denotes the best possible conditions.
Once the score has been obtained it is modified by the digestability of the vegetation in terms of proportion of young green matter. This modifies the value by multiplication with 0.7-1.0
Definition at line 771 of file VolePopulationManager.cpp.
References Population_Manager::m_TheLandscape, Landscape::SupplyElementTypeFromVector(), Landscape::SupplyGrazingPressureVector(), Landscape::SupplyJustMownVector(), Landscape::SupplyVegCoverVector(), Landscape::SupplyVegHeightVector(), Landscape::SupplyVegTypeVector(), 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_Foobar, 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_UnknownGrass, tole_UnsprayedFieldMargin, tole_UrbanNoVeg, tole_UrbanPark, tole_Wasteland, tole_WindTurbine, tole_WoodlandMargin, tole_WoodyEnergyCrop, tole_YoungForest, tov_AgroChemIndustryCereal, tov_BroadBeans, tov_Carrots, tov_CloverGrassGrazed1, tov_CloverGrassGrazed2, tov_FieldPeas, tov_FieldPeasSilage, tov_FodderBeet, tov_FodderGrass, tov_Maize, tov_MaizeSilage, tov_NoGrowth, tov_Oats, tov_OBarleyPeaCloverGrass, tov_OCarrots, tov_OCloverGrassGrazed1, tov_OCloverGrassGrazed2, tov_OCloverGrassSilage1, tov_OFieldPeas, tov_OFieldPeasSilage, tov_OFodderBeet, tov_OGrazingPigs, tov_OMaizeSilage, tov_OOats, tov_OPermanentGrassGrazed, tov_OrchardCrop, tov_OSBarleySilage, tov_OSeedGrass1, tov_OSeedGrass2, tov_OSetaside, tov_OSpringBarley, tov_OSpringBarleyPigs, tov_OTriticale, tov_OWinterBarley, 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_SpringBarleyPeaCloverGrassStrigling, tov_SpringBarleyPTreatment, tov_SpringBarleySeed, tov_SpringBarleySilage, tov_SpringBarleySKManagement, tov_SpringBarleySpr, tov_SpringBarleyStrigling, tov_SpringBarleyStriglingCulm, tov_SpringBarleyStriglingSingle, tov_SpringRape, tov_SugarBeet, tov_Triticale, tov_WinterBarley, tov_WinterRape, tov_WinterRye, tov_WinterWheat, tov_WinterWheatShort, tov_WinterWheatStrigling, tov_WinterWheatStriglingCulm, tov_WinterWheatStriglingSingle, tov_WWheatPControl, tov_WWheatPToxicControl, tov_WWheatPTreatment, tov_YoungForest, and Landscape::Warn().
Referenced by DoFirst().
bool Vole_Population_Manager::BarrierSearch | ( | int | F_x, |
int | F_y, | ||
int | M_x, | ||
int | M_y | ||
) |
Prevents voles from mating with an individual on the other side of af barrier
Definition at line 1261 of file VolePopulationManager.cpp.
References Population_Manager::m_TheLandscape, Landscape::SupplyElementType(), Landscape::SupplyPolyRef(), tole_Building, tole_Carpark, tole_Churchyard, tole_Coast, tole_ConiferousForest, tole_DeciduousForest, tole_Freshwater, tole_HeritageSite, tole_LargeRoad, tole_MetalledPath, tole_Pond, tole_River, tole_Saltmarsh, tole_Saltwater, and tole_Stream.
Referenced by FindClosestMale().
|
protectedvirtual |
This version simply alters populations after 1st January - it is very dangerous to add individuals in many of the models so beware!!!!
Reimplemented from Population_Manager.
Definition at line 3630 of file VolePopulationManager.cpp.
References cfg_pm_eventfrequency, cfg_pm_eventsize, Vole_Base::CopyMyself(), Vole_Base::CurrentVState, Population_Manager::GetLiveArraySize(), Population_Manager::m_catastrophestartyear, Population_Manager::m_TheLandscape, Landscape::SupplyDayInYear(), Landscape::SupplyYearNumber(), Population_Manager::TheArray, tovs_FDying, tovs_MDying, vob_Female, vob_JuvenileMale, and vob_Male.
void Vole_Population_Manager::CloseResistanceOutput | ( | ) |
Closes the output file ready for resistance results.
Definition at line 4224 of file VolePopulationManager.cpp.
References m_VoleResistanceOutputFile.
Referenced by ~Vole_Population_Manager().
|
protected |
Close the sex ratio probe
Definition at line 3905 of file VolePopulationManager.cpp.
References SexRatiosPrb.
Referenced by ~Vole_Population_Manager().
void Vole_Population_Manager::CreateObjects | ( | VoleObject | ob_type, |
TAnimal * | pvo, | ||
struct_Vole_Adult * | as, | ||
int | number | ||
) |
Creates 'number' of vole objects of the type ob_type using 'as' for the base data
Definition at line 3455 of file VolePopulationManager.cpp.
References g_rand_uni, Population_Manager::GetLiveArraySize(), Population_Manager::IncLiveArraySize(), struct_Vole_Adult::m_dflag, struct_Vole_Adult::m_gflag, m_VoleMap, struct_Vole_Adult::misc_use, Vole_JuvenileFemale::ReInit(), Vole_Female::ReInit(), Vole_Base::SetDirectFlag(), Vole_Base::SetFertile(), Vole_Base::SetGeneticFlag(), Population_Manager::TheArray, Vole_Base::UnsetDirectFlag(), Vole_Base::UnsetGeneticFlag(), vob_Female, vob_JuvenileFemale, vob_JuvenileMale, vob_Male, struct_Vole_Adult::x, and struct_Vole_Adult::y.
Referenced by Vole_Base::CopyMyself(), Vole_JuvenileMale::st_BecomeSubAdult(), Vole_JuvenileFemale::st_BecomeSubAdult(), and Vole_Female::st_Lactating().
void Vole_Population_Manager::CreateObjects_Init | ( | VoleObject | ob_type, |
TAnimal * | pvo, | ||
struct_Vole_Adult * | data, | ||
int | number | ||
) |
Creates 'number' of vole objects of the type ob_type using 'as' for the base data for use at the beginning of a simulation.
A number of the attributes are set at defaults or randomised
Definition at line 3588 of file VolePopulationManager.cpp.
References struct_Vole_Adult::FatherId, struct_Vole_Adult::FatherStateAtBirth, Population_Manager::IncLiveArraySize(), Population_Manager::m_TheLandscape, struct_Vole_Adult::MotherId, Vole_Base::Set_Age(), Vole_Base::Set_BirthYear(), Vole_Base::SetFertile(), Vole_Base::Setm_Mature(), Vole_Base::SetWeight(), Landscape::SupplyYearNumber(), Population_Manager::TheArray, vob_Female, and vob_Male.
Referenced by Init().
|
protectedvirtual |
Can be used in descendent classes
This method is called before the BeginStep of the main program loop by the base class.
It controls when the grass starts to grow and therefore triggers start of reproduction but the primary role is as a safe location where outputs can be generated. At the time this is called there no chance that the voles are engaged in any kind of activity.
First job is to calculate a basic quality for each polygon. This is more efficient than getting the voles to do the calculation each time they need to know.
Reimplemented from Population_Manager.
Definition at line 549 of file VolePopulationManager.cpp.
References AssessHabitat(), cfg_extradispmort, cfg_genetetic_output_sample_size(), cfg_GeneticsResultOutputFirstYear(), cfg_GeneticsResultOutputInterval_1(), cfg_GrassStartGrowth(), cfg_GrassStartGrowthDay(), cfg_RecordVoleMort(), cfg_SexRatiosOutput_day(), cfg_SexRatiosOutput_interval(), cfg_SexRatiosOutput_used(), cfg_SexRatiosOutputFirstYear(), cfg_useagesexlocation(), cfg_UseVoleTraplines(), cfg_VoleBackgroundMort(), cfg_voleLandscapeGridOutputDay(), cfg_VoleResistanceDay(), cfg_VoleUseResistanceOuput(), g_DailyMortChance, g_DailyMortChanceMaleTerr, g_extradispmort, g_MaleReproductFinish, Population_Manager::GetLiveArraySize(), JuvsProducedToday, LandscapeQuadrantOutputProbe(), m_GrowthStartDate, Population_Manager::m_TheLandscape, m_Traplines, m_VoleRecordMort, NoYoungKilledToday, NoYoungKilledToday4, NoYoungKilledToday8, NoYoungKilledToday9, VoleSummaryOutput::OPrint(), TrapLineMap::Output(), RecordGeneticsToday(), VoleSummaryOutput::ResetData(), ResistanceOutput(), Vole_Base::SetFree(), Population_Manager::Shuffle(), TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Vole_Base::SupplyAge(), Vole_Base::SupplyAllele(), Landscape::SupplyDayInYear(), Landscape::SupplyGlobalDate(), SupplyGrowthStartDate(), Vole_Base::SupplyIDNo(), Vole_Base::SupplyInTrap(), Landscape::SupplyMeanTemp(), Landscape::SupplyNumberOfPolygons(), Vole_Base::SupplyTerritorial(), Vole_Base::SupplyTrapPosition(), Vole_Base::SupplyXBorn(), Vole_Base::SupplyYBorn(), Landscape::SupplyYearNumber(), TheAgeSexLocationProbe(), Population_Manager::TheArray, TheSexRatiosProbe(), vob_Female, vob_JuvenileFemale, vob_JuvenileMale, vob_Male, VoleHabitatBaseQualities, Landscape::Warn(), and YoungProducedToday.
Vole_Female * Vole_Population_Manager::FindClosestFemale | ( | int | p_x, |
int | p_y, | ||
int | p_steps | ||
) |
looks for the closest female within p_Steps of p_x,p_y
Definition at line 2227 of file VolePopulationManager.cpp.
References m_VoleMap, Population_Manager::SimH, Population_Manager::SimW, Vole_Base::SupplySex(), and Vole_Base::SupplyTerritorial().
Referenced by Vole_Male::st_Eval_n_Explore().
Vole_Male * Vole_Population_Manager::FindClosestMale | ( | int | p_x, |
int | p_y, | ||
int | p_steps | ||
) |
looks for the closest male within p_Steps of p_x,p_y
Definition at line 2686 of file VolePopulationManager.cpp.
References BarrierSearch(), m_VoleMap, Population_Manager::SimH, Population_Manager::SimW, Vole_Base::SupplySex(), and Vole_Base::SupplyTerritorial().
Referenced by Vole_Female::st_Mating().
Vole_Male * Vole_Population_Manager::FindOutsideRadiusMale | ( | int | p_x, |
int | p_y | ||
) |
Returns a pointer to a random male - he does not even have to have a territory
Definition at line 2399 of file VolePopulationManager.cpp.
References cfg_MateRadius(), TALMaSSObject::GetCurrentStateNo(), Population_Manager::GetLiveArraySize(), Population_Manager::SimH, Population_Manager::SimW, TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Vole_Base::SupplyTerritorial(), Population_Manager::TheArray, and vob_Male.
Vole_Male * Vole_Population_Manager::FindRandomMale | ( | ) |
Returns a pointer to a random male - he does not even have to have a territory
Definition at line 2880 of file VolePopulationManager.cpp.
References TALMaSSObject::GetCurrentStateNo(), Population_Manager::GetLiveArraySize(), Population_Manager::TheArray, and vob_Male.
Vole_Male * Vole_Population_Manager::FindWithinRadiusMale | ( | int | p_x, |
int | p_y | ||
) |
looks for males within cfg_MateRadius of p_x,p_y and returns a list of all males
Definition at line 2527 of file VolePopulationManager.cpp.
References cfg_MateRadius(), m_VoleMap, Population_Manager::SimH, Population_Manager::SimW, Vole_Base::SupplySex(), and Vole_Base::SupplyTerritorial().
void Vole_Population_Manager::GeneticsOutputFile | ( | unsigned | listindex | ) |
Used to output vole genetics at user-defined dates
Definition at line 4059 of file VolePopulationManager.cpp.
References Vole_Base::GetDirectFlag(), Vole_Base::GetGeneticFlag(), Population_Manager::GetLiveArraySize(), Population_Manager::m_TheLandscape, TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Vole_Base::SupplyAge(), Vole_Base::SupplyBirthYear(), Landscape::SupplyDayInYear(), Vole_Base::SupplyElemBorn(), Landscape::SupplyElementType(), Vole_Base::SupplyIDNo(), Vole_Base::SupplyMature(), Landscape::SupplyMonth(), Vole_Base::SupplyMyAllele(), Landscape::SupplyPolyRef(), Vole_Base::SupplyPolyRefBorn(), Vole_Base::SupplySex(), Landscape::SupplySimAreaWidth(), Vole_Base::SupplyTerritorial(), Vole_Base::SupplyVegBorn(), Landscape::SupplyVegType(), Vole_Base::SupplyXBorn(), Vole_Base::SupplyYBorn(), Landscape::SupplyYearNumber(), Population_Manager::TheArray, vob_Female, vob_Male, and Landscape::Warn().
|
virtual |
Output recording the genetic information for each individual in the population of listindex type
Reimplemented from Population_Manager.
Definition at line 4145 of file VolePopulationManager.cpp.
References Population_Manager::GetLiveArraySize(), Population_Manager::m_TheLandscape, TAnimal::Supply_m_Location_x(), Vole_Base::SupplyAllele(), Landscape::SupplyMonth(), Landscape::SupplyYear(), Population_Manager::TheArray, vob_Female, and vob_Male.
|
inline |
Definition at line 233 of file VolePopulationManager.h.
References VoleHabitatBaseQualities.
Referenced by Vole_Base::CalculateCarryingCapacity().
|
inline |
used to get a specific vole allele from outside the population manager
Definition at line 200 of file VolePopulationManager.h.
References Vole_Base::SupplyMyAllele(), and Population_Manager::TheArray.
|
virtual |
use for pesticide simulations only to determine the number of individual males currently impacted by pesticide Added April 2006
Reimplemented from Population_Manager.
Definition at line 523 of file VolePopulationManager.cpp.
References Vole_Base::GetDirectFlag(), Vole_Base::GetGeneticFlag(), Population_Manager::GetLiveArraySize(), Population_Manager::m_TheLandscape, Population_Manager::TheArray, vob_Male, and Landscape::Warn().
|
virtual |
autom. called by constructor.
Sets up output files and creates initial population
Definition at line 245 of file VolePopulationManager.cpp.
References AFreq, Population_Manager::BeforeStepActions, cfg_extradispmort, cfg_f1sterilitychance(), cfg_geneticproductfertilityeffect(), cfg_geneticsterilitychance(), cfg_MaxAllele(), cfg_MinReproAgeF, cfg_MinReproAgeM, cfg_MoveToLessFavourable(), cfg_MutationChance(), cfg_ReallyBigOutput_used, cfg_RecordVoleMort(), cfg_ResistanceStartFrequency(), cfg_RipleysOutput_used, cfg_SexRatiosOutput_used(), cfg_sigAgeDiff(), cfg_useagesexlocation(), cfg_UseVoleTraplines(), cfg_vole_reprofinishdate(), cfg_vole_starting_numberF(), cfg_vole_starting_numberM(), cfg_VoleBackgroundMort(), cfg_VoleFemaleMove(), cfg_voleLandscapeGridOutputUsed(), cfg_VoleRecordMortFile(), cfg_VoleTraplinesfile(), cfg_VoleTrapResolution(), cfg_VoleUseResistanceOuput(), CreateObjects_Init(), g_DailyMortChance, g_extradispmort, g_MaleReproductFinish, g_MaxAllele, g_NoFemalesMove, g_rand_uni, g_sigAgeDiff, struct_Vole_Adult::Genes, GeneticMaterial::Initiation(), struct_Vole_Adult::L, Population_Manager::m_AlleleFreqsFile, Population_Manager::m_EasyPopRes, m_geneticproductfertilityeffect, Population_Manager::m_GeneticsFile, Population_Manager::m_ListNameLength, Population_Manager::m_ListNames, Population_Manager::m_population_type, Population_Manager::m_SimulationName, Population_Manager::m_StepSize, Population_Manager::m_TheLandscape, m_Traplines, m_VoleAgeSexLocationFile, m_VoleRecordMort, MinReproAgeF, MinReproAgeM, MoveToLessFavourable, MutationChance, OpenResistanceOutput(), OpenSexRatiosProbe(), Population_Manager::OpenTheReallyBigProbe(), Population_Manager::OpenTheRipleysOutputProbe(), VoleSummaryOutput::OPrint(), VoleSummaryOutput::OPrintEndl(), Population_Manager::ReallyBigOutputPrb, ReproTable, ReproTable_base, GeneticMaterial::SetAllele(), Population_Manager::SimH, Population_Manager::SimW, Population_Manager::StateNames, SuitableStartingLocation(), Landscape::SupplyNumberOfPolygons(), Landscape::SupplyPesticideType(), Population_Manager::TestFile, Population_Manager::TestFile2, TOP_Vole, tovs_FDying, tovs_FEvaluateExplore, tovs_FMaturation, tovs_GiveBirth, tovs_Infanticide, tovs_InitialState, tovs_JuvenileExploration, tovs_Lactating, tovs_Mating, tovs_MDying, tovs_MEvaluateExplore, tovs_MMaturation, tovs_ReproBehaviour, tovs_SpecialExplore, tovs_UpdateGestation, vob_Female, vob_Male, VoleHabitatBaseQualities, struct_Vole_Adult::VPM, Landscape::Warn(), struct_Vole_Adult::x, and struct_Vole_Adult::y.
Referenced by Vole_Population_Manager().
bool Vole_Population_Manager::InSquare | ( | int | p_x, |
int | p_y, | ||
int | p_sqx, | ||
int | p_sqy, | ||
int | p_range | ||
) |
Determines if p_x,p_y is the in the square denoted by p_sqx,p_sqy + p_range
Definition at line 3230 of file VolePopulationManager.cpp.
References Population_Manager::SimH, and Population_Manager::SimW.
|
inline |
Definition at line 207 of file VolePopulationManager.h.
References Landscape::CorrectCoords(), TrapLineMap::IsTrap(), Population_Manager::m_TheLandscape, and m_Traplines.
Referenced by Vole_Base::CheckTraps().
|
virtual |
Output file facility added in January 2013
This output splits the landscape up into 16x16 cells which gives landscapes of 625x625m grids for 10x10 km.
All voles are counted in the landspape and assigned to a grid. The sum of all individials in the grid is then output to the output file separated by tabs and prefixed by the global simulation day.
NB this only works for square landscapes.
Definition at line 3698 of file VolePopulationManager.cpp.
References Population_Manager::GetLiveArraySize(), Population_Manager::m_TheLandscape, TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Landscape::SupplySimAreaWidth(), Population_Manager::TheArray, vob_Female, vob_JuvenileFemale, vob_JuvenileMale, and vob_Male.
Referenced by DoFirst().
int Vole_Population_Manager::ListClosestFemales | ( | int | p_x, |
int | p_y, | ||
int | p_steps | ||
) |
Lists all females within p_steps of p_x & p_y and returns the number in the list
Definition at line 2078 of file VolePopulationManager.cpp.
References FList, m_VoleMap, Population_Manager::SimH, Population_Manager::SimW, Vole_Base::SupplySex(), and Vole_Base::SupplyTerritorial().
int Vole_Population_Manager::ListClosestMales | ( | int | p_x, |
int | p_y, | ||
int | p_steps | ||
) |
Looks for males within p_Steps of p_x,p_y and returns the number of them. Pointers to these are saved in MList
Definition at line 1928 of file VolePopulationManager.cpp.
References m_VoleMap, MList, Population_Manager::SimH, Population_Manager::SimW, Vole_Base::SupplySex(), and Vole_Base::SupplyTerritorial().
void Vole_Population_Manager::OpenResistanceOutput | ( | ) |
Opens the output file ready for resistance results.
Definition at line 4212 of file VolePopulationManager.cpp.
References Population_Manager::m_TheLandscape, m_VoleResistanceOutputFile, and Landscape::Warn().
Referenced by Init().
|
protected |
Open the sex ratio probe
Definition at line 3890 of file VolePopulationManager.cpp.
References cfg_SexRatiosOutput_filename(), and SexRatiosPrb.
Referenced by Init().
bool Vole_Population_Manager::RecordGeneticsToday | ( | int | p_today, |
int | p_year, | ||
int | p_start_year, | ||
int | p_interval | ||
) |
void Vole_Population_Manager::ReproductionProbe | ( | ) |
Definition at line 1254 of file VolePopulationManager.cpp.
References JuvsProducedToday, YoungProducedToday, and YoungsFile.
void Vole_Population_Manager::ResistanceOutput | ( | ) |
Resistance results file output
Definition at line 4231 of file VolePopulationManager.cpp.
References cfg_ResistanceDominant, Population_Manager::GetLiveArraySize(), Population_Manager::m_TheLandscape, Landscape::SupplyDayInYear(), Vole_Base::SupplyMyAllele(), Landscape::SupplyYearNumber(), Population_Manager::TheArray, and vob_foobar.
Referenced by DoFirst().
void Vole_Population_Manager::SendMessage | ( | TTypeOfVoleMessage | p_message, |
unsigned | p_x, | ||
unsigned | p_y, | ||
unsigned | p_range, | ||
bool | p_sex, | ||
double | p_Weight | ||
) |
Passes a message to recipients. In this case the only one we use is infanticide sent to all females within an area
Definition at line 3404 of file VolePopulationManager.cpp.
References Population_Manager::GetLiveArraySize(), Population_Manager::m_TheLandscape, Vole_Female::OnInfanticideAttempt(), Population_Manager::SimH, Population_Manager::SimHH, Population_Manager::SimW, Population_Manager::SimWH, Vole_Base::SupplyX(), Vole_Base::SupplyY(), Population_Manager::TheArray, tovm_Infanticide, vob_Female, and Landscape::Warn().
Referenced by Vole_Male::st_Infanticide().
|
protected |
Two verisons of this exist, the first only lets voles start in good places, the second also allows fields and orchards.
Definition at line 460 of file VolePopulationManager.cpp.
References cfg_volestartinoptimalonly(), Population_Manager::m_TheLandscape, Landscape::SupplyElementType(), tole_BeetleBank, tole_Field, tole_FieldBoundary, tole_Garden, tole_HedgeBank, tole_MownGrass, tole_NaturalGrassDry, tole_NaturalGrassWet, tole_Orchard, tole_OrchardBand, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPastureTussocky, tole_PitDisused, tole_Railway, tole_RoadsideSlope, tole_RoadsideVerge, tole_Scrub, and tole_YoungForest.
Referenced by Init().
int Vole_Population_Manager::SupplyCountFemales | ( | unsigned | p_x, |
unsigned | p_y, | ||
unsigned | p_TerrRange | ||
) |
returns -1 if a male has p_x,p_y in his territory and is older than p_Age else returns the number of females present
Definition at line 2897 of file VolePopulationManager.cpp.
References m_VoleMap, Population_Manager::SimH, Population_Manager::SimW, Vole_Base::SupplySex(), and Vole_Base::SupplyTerritorial().
Referenced by Vole_JuvenileMale::st_Eval_n_Explore().
|
inline |
Definition at line 237 of file VolePopulationManager.h.
References m_GrowthStartDate.
Referenced by DoFirst(), Vole_Male::EndStep(), Vole_JuvenileFemale::EndStep(), and Vole_Male::st_Maturation().
int Vole_Population_Manager::SupplyHowManyVoles | ( | unsigned | p_x, |
unsigned | p_y, | ||
unsigned | p_range | ||
) |
Counts vole postions on the map from p_x-p_range,p-y-p_range to p_x+p_size, p_y+p_range
Definition at line 1162 of file VolePopulationManager.cpp.
References m_VoleMap, Population_Manager::SimH, and Population_Manager::SimW.
Referenced by Vole_Base::CalculateCarryingCapacity().
int Vole_Population_Manager::SupplyInOlderTerr | ( | unsigned | p_x, |
unsigned | p_y, | ||
unsigned | p_Age, | ||
unsigned | p_Range | ||
) |
returns -1 if a male has p_x,p_y in his territory and is older than p_Age
Definition at line 3043 of file VolePopulationManager.cpp.
References g_rand_uni, g_sigAgeDiff, m_VoleMap, Population_Manager::SimH, Population_Manager::SimW, Vole_Base::SupplyAge(), Vole_Base::SupplySex(), and Vole_Base::SupplyTerritorial().
Referenced by Vole_Male::Dispersal(), Vole_JuvenileMale::st_Eval_n_Explore(), and Vole_Male::st_Eval_n_Explore().
bool Vole_Population_Manager::SupplyOlderFemales | ( | unsigned | p_x, |
unsigned | p_y, | ||
unsigned | p_Age, | ||
unsigned | p_range | ||
) |
Returns false if there is an older female within the area p_x,p_y +/- range
Definition at line 1015 of file VolePopulationManager.cpp.
References m_VoleMap, Population_Manager::SimH, Population_Manager::SimW, Vole_Base::SupplyAge(), and Vole_Base::SupplySex().
Referenced by Vole_Female::st_Special_Explore().
vector< Vole_Base * > * Vole_Population_Manager::SupplyVoleList | ( | unsigned | x, |
unsigned | y, | ||
unsigned | range | ||
) |
returns a list of all voles in p_x,p_y, p_range square
Definition at line 3289 of file VolePopulationManager.cpp.
References m_VoleMap, Population_Manager::SimH, and Population_Manager::SimW.
Referenced by TPredator::st_Hunting().
void Vole_Population_Manager::TheAgeSexLocationProbe | ( | ) |
The code is separated into two loops and calls duplicated. This is because there may be sex-specific calls placed here which would be imcompatible with a single data input/output method.
This is called the Really Big Probe because 10yrs of daily output on 10x10km landscape can easily produce a >500MB text file. Use carefully.
Definition at line 3780 of file VolePopulationManager.cpp.
References Population_Manager::GetLiveArraySize(), Population_Manager::m_TheLandscape, TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Vole_Base::SupplyAge(), Landscape::SupplyDayInYear(), Landscape::SupplyYearNumber(), Population_Manager::TheArray, and vob_Female.
Referenced by DoFirst().
|
virtual |
This method must be overridden in descendent classes
Reimplemented from Population_Manager.
Definition at line 3758 of file VolePopulationManager.cpp.
References Population_Manager::m_AOR_Probe, and vob_Female.
|
virtual |
An output facility. This method can be re-written to provide any data necessary on a daily or annual basis e.g. for pattern oriented modelling purposes. Outputs can be altered and added to the print statement as necessary.
The code is separated into two loops and calls duplicated. This is because there may be sex-specific calls placed here which would be imcompatible with a single data input/output method.
This is called the Really Big Probe because 10yrs of daily output on 10x10km landscape can easily produce a >500MB text file. Use carefully.
Reimplemented from Population_Manager.
Definition at line 3814 of file VolePopulationManager.cpp.
References Population_Manager::GetLiveArraySize(), Population_Manager::m_TheLandscape, Population_Manager::ReallyBigOutputPrb, TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Vole_Base::SupplyAge(), Landscape::SupplyDayInYear(), Landscape::SupplyElementType(), Landscape::SupplyPolyRef(), Vole_Base::SupplyTerritorial(), Landscape::SupplyVegType(), Landscape::SupplyYearNumber(), Population_Manager::TheArray, vob_Female, vob_JuvenileFemale, vob_JuvenileMale, and vob_Male.
|
virtual |
This method must be overridden in descendent classes
Reimplemented from Population_Manager.
Definition at line 3763 of file VolePopulationManager.cpp.
References Population_Manager::GetLiveArraySize(), Population_Manager::m_TheLandscape, TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Landscape::SupplySimAreaWidth(), Population_Manager::TheArray, and vob_Female.
|
virtual |
This does the same as the ReallyBigProbe, but digests the data to produce a daily output instead of individual vole data. This only works for the whole population not a subset.
Definition at line 3916 of file VolePopulationManager.cpp.
References Population_Manager::GetLiveArraySize(), Population_Manager::m_TheLandscape, SexRatiosPrb, Vole_Base::SupplyBornLastYear(), Landscape::SupplyDayInYear(), Vole_Base::SupplyMature(), Landscape::SupplyYearNumber(), Population_Manager::TheArray, vob_Female, vob_JuvenileFemale, vob_JuvenileMale, and vob_Male.
Referenced by DoFirst().
AlleleFreq* Vole_Population_Manager::AFreq |
Definition at line 280 of file VolePopulationManager.h.
Referenced by Init(), Vole_Population_Manager(), and ~Vole_Population_Manager().
Vole_FemaleList Vole_Population_Manager::FList |
Used to store lists of females for further use
Definition at line 224 of file VolePopulationManager.h.
Referenced by ListClosestFemales().
unsigned Vole_Population_Manager::IDNumber |
Definition at line 222 of file VolePopulationManager.h.
Referenced by Vole_Base::Init(), and Vole_Population_Manager().
int Vole_Population_Manager::JuvsProducedToday |
Definition at line 281 of file VolePopulationManager.h.
Referenced by AddToJuvs(), DoFirst(), and ReproductionProbe().
|
protected |
Definition at line 160 of file VolePopulationManager.h.
Referenced by AddToFrag1Female().
|
protected |
Definition at line 164 of file VolePopulationManager.h.
Referenced by AddToFrag2Female().
|
protected |
Definition at line 168 of file VolePopulationManager.h.
Referenced by AddToFrag3Female().
int Vole_Population_Manager::m_geneticproductfertilityeffect |
Definition at line 285 of file VolePopulationManager.h.
Referenced by Init().
|
protected |
Definition at line 158 of file VolePopulationManager.h.
Referenced by DoFirst(), SupplyGrowthStartDate(), and Vole_Population_Manager().
|
protected |
Definition at line 159 of file VolePopulationManager.h.
Referenced by AddToFrag1Male().
|
protected |
Definition at line 163 of file VolePopulationManager.h.
Referenced by AddToFrag2Male().
|
protected |
Definition at line 167 of file VolePopulationManager.h.
Referenced by AddToFrag3Male().
|
protected |
Definition at line 161 of file VolePopulationManager.h.
|
protected |
Definition at line 165 of file VolePopulationManager.h.
|
protected |
Definition at line 169 of file VolePopulationManager.h.
|
protected |
Definition at line 171 of file VolePopulationManager.h.
Referenced by DoFirst(), Init(), IsTrap(), and ~Vole_Population_Manager().
|
protected |
Definition at line 194 of file VolePopulationManager.h.
Referenced by Init().
IDMap<TAnimal*>* Vole_Population_Manager::m_VoleMap |
Definition at line 284 of file VolePopulationManager.h.
Referenced by CreateObjects(), FindClosestFemale(), FindClosestMale(), FindWithinRadiusMale(), Vole_JuvenileMale::FreeLocation(), Vole_JuvenileFemale::FreeLocation(), Vole_JuvenileMale::GetLocation(), Vole_JuvenileFemale::GetLocation(), ListClosestFemales(), ListClosestMales(), Vole_Base::MoveQuality(), Vole_JuvenileMale::SetLocation(), Vole_JuvenileFemale::SetLocation(), SupplyCountFemales(), SupplyHowManyVoles(), SupplyInOlderTerr(), SupplyOlderFemales(), SupplyVoleList(), Vole_Population_Manager(), and ~Vole_Population_Manager().
VoleSummaryOutput* Vole_Population_Manager::m_VoleRecordMort |
Definition at line 197 of file VolePopulationManager.h.
Referenced by Vole_JuvenileMale::BeginStep(), Vole_JuvenileFemale::BeginStep(), Vole_JuvenileMale::Dispersal(), Vole_Male::Dispersal(), Vole_JuvenileFemale::Dispersal(), DoFirst(), Vole_Male::EndStep(), Vole_JuvenileFemale::EndStep(), Init(), Vole_JuvenileMale::OnFarmEvent(), Vole_JuvenileFemale::OnFarmEvent(), Vole_JuvenileMale::OnKilled(), Vole_JuvenileFemale::OnKilled(), Vole_JuvenileFemale::Step(), Vole_Female::Step(), and ~Vole_Population_Manager().
|
protected |
Definition at line 195 of file VolePopulationManager.h.
Referenced by CloseResistanceOutput(), and OpenResistanceOutput().
Vole_MaleList Vole_Population_Manager::MList |
Used to store lists of males for further use
Definition at line 226 of file VolePopulationManager.h.
Referenced by ListClosestMales().
int Vole_Population_Manager::NoYoungKilledToday |
Definition at line 282 of file VolePopulationManager.h.
Referenced by AddToNoYoungInfanticideCount(), and DoFirst().
int Vole_Population_Manager::NoYoungKilledToday4 |
Definition at line 282 of file VolePopulationManager.h.
Referenced by AddToNoYoungInfanticideCount(), and DoFirst().
int Vole_Population_Manager::NoYoungKilledToday8 |
Definition at line 282 of file VolePopulationManager.h.
Referenced by AddToNoYoungInfanticideCount(), and DoFirst().
int Vole_Population_Manager::NoYoungKilledToday9 |
Definition at line 282 of file VolePopulationManager.h.
Referenced by AddToNoYoungInfanticideCount(), and DoFirst().
int Vole_Population_Manager::ReproTable[4][12] |
Definition at line 221 of file VolePopulationManager.h.
Referenced by Init(), and Vole_Female::st_GiveBirth().
FILE* Vole_Population_Manager::SexRatiosPrb |
Definition at line 198 of file VolePopulationManager.h.
Referenced by CloseSexRatiosProbe(), OpenSexRatiosProbe(), and TheSexRatiosProbe().
|
protected |
Definition at line 155 of file VolePopulationManager.h.
Referenced by Vole_Population_Manager().
|
protected |
Definition at line 172 of file VolePopulationManager.h.
Referenced by DoFirst(), GetHabitatQuality(), and Init().
|
protected |
Definition at line 155 of file VolePopulationManager.h.
Referenced by Vole_Population_Manager().
int Vole_Population_Manager::YoungProducedToday |
Definition at line 281 of file VolePopulationManager.h.
Referenced by AddToYoung(), AddToYoungYr(), DoFirst(), and ReproductionProbe().
FILE* Vole_Population_Manager::YoungsFile |
Definition at line 283 of file VolePopulationManager.h.
Referenced by ReproductionProbe().