Goose Management Model ODdox
1.02
|
The class to handle all goose population related matters. More...
#include <Goose_Population_Manager.h>
Public Member Functions | |
void | AddGeeseToForageLocation (GooseSpeciesType a_type, int a_index, int a_number) |
Adds a goose or geese to the forage location - requires an index. More... | |
void | AddGeeseToForageLocationP (GooseSpeciesType a_type, int a_polyref, int a_number) |
Adds a goose or geese to the forage location - uses polygon number as reference. More... | |
void | BangAtPoly (int a_polyref) |
Passes a 'Bang' message to birds near to the location specified by the polygon reference. More... | |
void | BirdsShot (int a_polyref, int a_numbershot, GooseHunter *a_Hunter) |
Passes the message to shoot a number of birds at a forage location. More... | |
int | BirdsToShootAtPoly (int a_poly) |
Returns the number of birds at a forage location - given by a poly ref. More... | |
void | CreateObjects (int ob_type, TAnimal *pvo, struct_Goose *data, int number) |
Method for creating a new individual Goose. More... | |
void | FindClosestRoost (int &a_x, int &a_y, unsigned a_type) |
Changes a_x & a_y to the location of the nearest roost of a_type to a_x, a_y. More... | |
int | ForageLocationInUse (int a_polyref) |
Tests if a forage location is currently in use, if so returns the index to it. More... | |
int | GetBirdsAtForageLoc (int a_index, GooseSpeciesType a_type) |
Returns the number of birds at a forage location - given by a poly ref. More... | |
int | GetDaylightLeft () |
Get the daylight minutes left today. More... | |
int | GetDayTime () |
Get the time of day (in minutes). For the goose model, sunrise is defined as m_daytime == 0. Hence this function returns the number of minutes since sunrise. More... | |
double | GetDistToClosestRoost (int a_x, int a_y, unsigned a_type) |
Returns the distance in to the nearest roost of a_type in meters. More... | |
double | GetFeedingRate (double a_graindensity, GooseSpecies a_species) |
Get the forage rate based on the grain density. More... | |
double | GetForageGooseDensity (int a_index) |
Returns the total goose density for a forage location. More... | |
double | GetForageGrazing (int a_index, int gs) |
Returns the forage density for a forage location and goose type. This is species specific. More... | |
GooseActiveForageLocation * | GetForageLocation (unsigned int a_index) |
Returns a pointer to the forage location indexed by index. More... | |
int | GetForageLocIndex (GooseSpecies a_species, int a_x, int a_y) |
Get a forage location for my species (picked randomly among the active locations) More... | |
double | GetForageRateDensity (double a_foragedensity) |
Get the forage intake rate for a forage density. More... | |
double | GetGrainDensity (int a_index) |
Returns the forage density for a forage location. More... | |
int | GetIsDaylight () |
Is it daylight hours? Daylight starts at m_daytime == 0. More... | |
Goose_Base * | GetLeader (APoint a_homeloc, GooseSpecies a_species) |
Asks for a pointer to a goose that can be followed. More... | |
double | GetMaizeDensity (int a_index) |
Returns the maize forage density for a forage location. More... | |
double | GetMaizeFeedingRate (double a_maizedensity, GooseSpecies a_species) |
Get the forage rate when feeding on maize. More... | |
int | GetNumberOfForageLocs (void) |
Get the number of forage locations. More... | |
double | GetThermalCosts (GooseSpecies a_goose) |
Get daily thermal costs const. More... | |
Goose_Population_Manager (Landscape *L) | |
Goose_Population_Manager Constructor. More... | |
void | Graze (double a_kJ, int a_index) |
Removes KJ as grams veg biomass from a forage area. More... | |
bool | InGreylagSeason () |
Are we in the greylag hunting season? More... | |
bool | InPinkfootSeason () |
Are we in the pinkfoot hunting season? More... | |
int | NewForageLocation (GooseSpeciesType a_type, int a_number, int a_polyref) |
Creates a new forage location and adds a goose or geese to the forage location. Returns an index to the forage location list. More... | |
void | RecordDailyEnergyBalance (int a_balance, GooseSpecies a_species) |
Record the daily energy balance. More... | |
void | RecordDailyEnergyBudget (int a_deb, GooseSpecies a_species) |
Record the daily energy budget. More... | |
void | RecordFlightDistance (int a_distance, GooseSpecies a_species) |
Record the flight distance. More... | |
void | RecordForagingTime (int a_time, GooseSpecies a_species) |
Record the time spent foraging. More... | |
void | RecordHabitatUse (int a_habitatype, GooseSpecies a_species, int a_count) |
Record the habitat use. More... | |
void | RecordHabitatUseFieldObs (int a_habitatype, GooseSpecies a_species, int a_count) |
Record the habitat use. More... | |
void | RecordIndForageLoc (double a_count, int a_groupsize, GooseSpecies a_species) |
Record a forage location count. More... | |
void | RecordLeaveReason (TTypeOfLeaveReason a_leavereason, GooseSpeciesType a_speciestype) |
Record the reason for leaving. More... | |
void | RecordState () |
Record the state. More... | |
void | RecordWeight (double a_weight, GooseSpecies a_species) |
Record the weight. More... | |
void | RemoveGeeseFromForageLocation (GooseSpeciesType a_type, int a_index, int a_number) |
Removes a goose or geese to the forage location - requires an index. More... | |
void | RemoveGrainKJ (double a_kJ, int a_index) |
Removes kJ eaten as grains from a forage area. More... | |
void | RemoveMaizeKJ (double a_kJ, int a_index) |
Removes KJ eaten as maize from a forage area. More... | |
void | RemoveMaxForageKj (double a_forage, TTypeOfMaxIntakeSource a_maxintakesource, int m_myForageIndex) |
Removes the forage eaten from the field. More... | |
virtual | ~Goose_Population_Manager (void) |
Goose_Population_Manager Destructor. More... | |
Public Attributes | |
std::vector< GooseActiveForageLocation > | m_GooseForageLocations |
Is a list of active goose forage locations where we have geese. More... | |
Variate_gen * | m_variate_generator |
Function to be able to draw randomly from predefined distributions. More... | |
Protected Member Functions | |
void | ClearGooseDailyEnergyBalanceStats () |
Clear simple stats for daily energy balance in the population. More... | |
void | ClearGooseDailyEnergyBudgetStats () |
Clear simple stats for daily energy budget in the population. More... | |
void | ClearGooseFlightDistanceStats () |
Clear simple stats for flight distances in the population. More... | |
void | ClearGooseForagingTimeStats () |
Clear simple stats for foraging times in the population. More... | |
void | ClearGooseHabitatUseFieldObsStats () |
Clear simple stats for field obs habitat use. More... | |
void | ClearGooseHabitatUseStats () |
Clear simple stats for habitat use. More... | |
void | ClearGooseLeaveReasonStats () |
Clear simple stats for the reasons for leaving the simulation. More... | |
void | ClearGooseWeightStats () |
Clear simple stats for the weights in the population. More... | |
void | ClearIndLocCountStats () |
Clear simple stats for forage location counts. More... | |
void | ClearStateStats () |
Clear simple stats for the states. More... | |
virtual void | CloseTheReallyBigOutputProbe () |
Does nothing, but we need it here because it automatically called by the Population_Manager if the NWordOutput is used. More... | |
virtual void | CloseTheRipleysOutputProbe () |
Does nothing, but we need it here because it automatically called by the Population_Manager if the NWordOutput is used. More... | |
virtual void | DoAfter () |
Things to do before the EndStep. More... | |
virtual void | DoBefore () |
Things to do before the Step. More... | |
virtual void | DoEmigration () |
Controls emigration from the Danish simulation area. More... | |
virtual void | DoFirst (void) |
Things to do before anything else at the start of a timestep. More... | |
virtual void | DoImmigration () |
Controls immigration to the Danish simulation area. More... | |
virtual void | DoLast () |
Things to do after the EndStep. More... | |
void | GetImmigrationNumbers (GooseSpecies a_goose, bool a_season) |
Get the numbers to immigrate. More... | |
void | GooseEnergyRecordOutput () |
Produces output to a standard file describing the number of birds foraging at each field and the field conditions. More... | |
void | GooseFieldForageInfoOutput () |
Produces output to a standard file describing the energetic state of all individuals of the goose populations. More... | |
void | GooseHabitatUseFieldObsOutput () |
Outputs simple stats for the goose habitat use but using rules to mimic field observations. More... | |
void | GooseHabitatUseOutput () |
Outputs simple stats for the goose habitat use. More... | |
void | GooseIndLocCountOutput () |
Outputs simple stats for the number of forage locations visited per goose. More... | |
void | GooseLeaveReasonStatOutput () |
Outputs simple stats for the reasons for leaving the simulation. More... | |
void | GoosePopulationDescriptionOutput () |
Produces output to a standard file describing the state of the goose populations. More... | |
std::string | GooseToString (GooseSpecies a_gs) |
Translates gs enum to string More... | |
std::string | GooseTypeToString (GooseSpeciesType a_gst) |
Translates gst enum to string More... | |
void | GooseWeightStatOutput () |
Outputs simple stats for the weights in the population. More... | |
bool | InHuntingSeason (int a_day, GooseSpecies a_species) |
Are we in the hunting season? More... | |
virtual void | Init (void) |
Called upon initialization of the simulation. Sets up output files. More... | |
std::string | IntakeSourceToString (TTypeOfMaxIntakeSource a_intake_source) |
Translates tomis enum to string More... | |
std::string | LeaveReasonToString (TTypeOfLeaveReason a_leave_reason) |
Translates tolr enum to string More... | |
void | ObservedOpennessQuery () |
Writes a file with the openness scores on places where geese have been observed in the field. More... | |
void | StateStatOutput () |
Write simple stats for the states. More... | |
virtual void | TheAOROutputProbe () |
The modified goose version of the standard output for creating AOR statistics. More... | |
virtual void | TheRipleysOutputProbe (FILE *) |
Does nothing, but we need it here because it automatically called by the Population_Manager if the NWordOutput is used. More... | |
void | WriteConfig () |
Writes a file the values of the config variables used. More... | |
void | WriteHeaders (ofstream *a_file, std::vector< std::string > a_headers) |
Handy function for writing headers. More... | |
void | XYDump () |
Outputs x y data. More... | |
Protected Attributes | |
AOR_Probe_Goose * | m_AOR_Barnacles |
AOR Probe for barnacles. More... | |
AOR_Probe_Goose * | m_AOR_Greylags |
AOR Probe for greylags. More... | |
AOR_Probe_Goose * | m_AOR_Pinkfeet |
AOR Probe for pinkfeet. More... | |
SimpleStatistics | m_DailyEnergyBalanceStats [gs_foobar] |
Statistics for the daily energy balance in the population. More... | |
SimpleStatistics | m_DailyEnergyBudgetStats [gs_foobar] |
Statistics for the daily energy budget in the population. More... | |
bool | m_daylight |
Flag for in daylight hours. Sunrise is always at m_daytime == 0. More... | |
int | m_daylightleft |
Number of daylight minutes left. More... | |
int | m_daytime |
Holds the time of day. Note that sunrise is at m_daytime == 0. More... | |
SimpleStatistics | m_FlightDistanceStats [gs_foobar] |
Statistics for the flight distances in the population. More... | |
PettiforFeedingTimeCurveClass * | m_ForageRateVSGooseDensity |
Speed optimisation to hold all potential competition reductions in the range 0 - 1 goose/m2. More... | |
SimpleStatistics | m_ForagingTimeStats [gs_foobar] |
Statistics for the time spent foraging for the population. More... | |
ofstream * | m_GooseEnergeticsDataFile |
Pointer to an output file for goose energetics data. More... | |
ofstream * | m_GooseFieldForageDataFile |
Pointer to an output file for goose field forage data. More... | |
ofstream * | m_GooseGitVersionFile |
Pointer to an output file for almass version. More... | |
ofstream * | m_GooseHabitatUseFieldObsFile |
Pointer to an output file for goose habitat use data, field observation mimic version. More... | |
ofstream * | m_GooseHabitatUseFile |
Pointer to an output file for goose habitat use data. More... | |
ofstream * | m_GooseIndLocCountFile |
Pointer to an output file for goose individual forage location count data. More... | |
ofstream * | m_GooseLeaveReasonStatsFile |
Pointer to an output file for goose leave reason stats data. More... | |
ofstream * | m_GoosePopDataFile |
Pointer to an output file for goose population data. More... | |
ofstream * | m_GooseWeightStatsFile |
Pointer to an output file for goose weight stats data. More... | |
ofstream * | m_GooseXYDumpFile |
Pointer to an output file for goose x y data. More... | |
bool | m_GreylagSeason |
Flag to indicate if we are in the greylag hunting season. More... | |
int | m_HabitatUseFieldObsStats [gs_foobar *tomis_foobar] |
Data for the habitat use, field observation mimic version. More... | |
int | m_HabitatUseStats [gs_foobar *tomis_foobar] |
Data for the habitat use. More... | |
SimpleStatistics | m_IndividualForageLocationData [gs_foobar] |
Statistics for the number of forage locations visited per goose of the population. More... | |
HollingsDiscCurveClass * | m_IntakeRateVSGrainDensity_PF |
Speed optimisation to hold all potential forage rates in the range 0-X grain density per m2. More... | |
HollingsDiscCurveClass * | m_IntakeRateVSMaizeDensity_BN |
Speed optimisation to hold all potential forage rates in the range 0-X maize density per m2. More... | |
SimpleStatistics | m_LeaveReasonStats [gst_foobar][tolr_foobar] |
Statistics for reasons for leaving the simulation. More... | |
int | m_migrationnumbers [3][2] |
Storage for goose numbers. Used when birds are immigrating. More... | |
bool | m_PinkfootSeason |
Flag to indicate if we are in the pinkfoot hunting season? More... | |
std::vector< roostlist > | m_roosts |
The list of roosts More... | |
SimpleStatistics | m_StateStats |
Debugging code. Statistics for the number of times a state method is called. More... | |
ofstream * | m_StateStatsFile |
Pointer to an output file for state stats data. More... | |
double | m_thermalcosts [3] |
Temporary storage for daily goose energetic thermal costs constant for each species. More... | |
SimpleStatistics | m_WeightStats [gs_foobar] |
Statistics for the weights of the population. More... | |
std::vector< int > | m_youngdist |
The observed distribution of young for pink feet. More... | |
The class to handle all goose population related matters.
Definition at line 392 of file Goose_Population_Manager.h.
Goose_Population_Manager::Goose_Population_Manager | ( | Landscape * | L | ) |
Goose_Population_Manager Constructor.
Set up before step action sorts This determines how we handle the arrays between steps
There is a mandatory file for goose populations that describe the roost locations for each goose type in the landscape - GooseRoosts.txt For each type of goose the x,y locations for roosts are listed
Read in a file with the distribution of the brood sizes as observed from the field. We only have data from Pinkfeet, so this distribution is recycled for the other species
Create curves for food intake rates and forage rates
Definition at line 550 of file Goose_Population_Manager.cpp.
References cfg_goose_bn_FieldForageDist, cfg_goose_bn_followinglikelyhood, cfg_goose_bn_ForageDist, cfg_goose_EnergyContentOfFat, cfg_goose_flightcost, cfg_goose_gl_FieldForageDist, cfg_goose_gl_followinglikelyhood, cfg_goose_gl_ForageDist, cfg_goose_LeavingThreshold, cfg_goose_MaxAppetiteScaler, cfg_goose_MaxEnergyReserveProportion, cfg_goose_MetabolicConversionCosts, cfg_goose_MinForageOpenness, cfg_goose_ModelExitDay, cfg_goose_pf_FieldForageDist, cfg_goose_pf_followinglikelyhood, cfg_goose_pf_ForageDist, cfg_goose_RoostLeaveDistMean, cfg_goose_RoostLeaveDistSD, cfg_H1A, cfg_H1B, cfg_H1C, cfg_H1D, cfg_H1E, cfg_H1F, cfg_H2A, cfg_H2B, cfg_H2C, cfg_H2D, cfg_H2E, cfg_H2F, cfg_Petti1A, cfg_Petti1B, cfg_Petti1C, cfg_Petti1D, cfg_Petti1E, cfg_Petti1F, cfg_Petti1G, cfg_WriteCurve, g_torun, gst_BarnacleFamilyGroup, gst_BarnacleNonBreeder, gst_GreylagFamilyGroup, gst_GreylagNonBreeder, gst_PinkfootFamilyGroup, gst_PinkfootNonBreeder, Init(), m_daytime, m_ForageRateVSGooseDensity, m_GreylagSeason, m_IntakeRateVSGrainDensity_PF, m_IntakeRateVSMaizeDensity_BN, m_PinkfootSeason, m_roosts, m_thermalcosts, m_variate_generator, m_youngdist, Goose_Base::Set_GooseFattoKJConversion(), Goose_Base::Set_GooseFieldForageDist(), Goose_Base::Set_GooseFollowingLikelyhood(), Goose_Base::Set_GooseForageDist(), Goose_Base::Set_GooseKJtoFatConversion(), Goose_Base::Set_GooseLeavingRoost(), Goose_Base::Set_GooseLeavingThreshold(), Goose_Base::Set_GooseMaxAppetiteScaler(), Goose_Base::Set_GooseMaxEnergyReserveProportion(), Goose_Base::Set_GooseMinForageOpenness(), Goose_Base::Set_Indivmingooseforagerate(), Goose_Base::Set_mingooseforagerate(), Goose_Base::SetFlightCost(), CfgInt::value(), CfgFloat::value(), CfgBool::value(), and CfgStr::value().
|
virtual |
Goose_Population_Manager Destructor.
Close files and delete pointers to them
Delete any memory constructs created by new
Definition at line 514 of file Goose_Population_Manager.cpp.
References cfg_AOROutput_used, l_map_print_git_version_info, m_AOR_Barnacles, m_AOR_Greylags, m_AOR_Pinkfeet, m_ForageRateVSGooseDensity, m_GooseEnergeticsDataFile, m_GooseFieldForageDataFile, m_GooseGitVersionFile, m_GooseHabitatUseFieldObsFile, m_GooseHabitatUseFile, m_GooseIndLocCountFile, m_GoosePopDataFile, m_GooseWeightStatsFile, m_GooseXYDumpFile, m_IntakeRateVSGrainDensity_PF, m_IntakeRateVSMaizeDensity_BN, m_variate_generator, and CfgBool::value().
void Goose_Population_Manager::AddGeeseToForageLocation | ( | GooseSpeciesType | a_type, |
int | a_index, | ||
int | a_number | ||
) |
Adds a goose or geese to the forage location - requires an index.
Definition at line 1806 of file Goose_Population_Manager.cpp.
References m_GooseForageLocations.
Referenced by Goose_Base::st_ChooseForageLocation().
void Goose_Population_Manager::AddGeeseToForageLocationP | ( | GooseSpeciesType | a_type, |
int | a_polyref, | ||
int | a_number | ||
) |
Adds a goose or geese to the forage location - uses polygon number as reference.
f First step is to get the forage location - then add the number of birds of a_type to it.
Definition at line 1819 of file Goose_Population_Manager.cpp.
References ForageLocationInUse(), m_GooseForageLocations, and NewForageLocation().
void Goose_Population_Manager::BangAtPoly | ( | int | a_polyref | ) |
Passes a 'Bang' message to birds near to the location specified by the polygon reference.
Here we have to find all the geese that are near to this polygon - then tell them they are scared of this location. Unfortunately there is no easy way to do this except trawl through all geese and test the distance they are from the bang at the moment this method is called. We assume the bang occurs at the centroid since we do not have a particular location for this within the polygon. Centroid distance to the location of each bird is checked and if under the maximum threat distance then we tell the bird they are scared. An alternative approach would be to link the size of scare to the distance. This is provided as an alternative assuming __LINKGOOSESCARETODISTANCE is defined.
Definition at line 1947 of file Goose_Population_Manager.cpp.
References ALMaSS_MathFuncs::CalcDistPythagorasApprox(), cfg_goose_MaxScareDistance, g_AlmassMathFuncs, Goose_Base::On_Bang(), and CfgInt::value().
Referenced by GooseHunter::st_OutHunting().
void Goose_Population_Manager::BirdsShot | ( | int | a_polyref, |
int | a_numbershot, | ||
GooseHunter * | a_Hunter | ||
) |
Passes the message to shoot a number of birds at a forage location.
First step is to get the forage location - the we pick a_numbershot birds to kill. This is a bit problematic since we know the type of birds but not exactly which ones are here. To speed things up as much as possible we first determine which birds will be shot by picking randomly from the birds here. Next we need to make some 'BANG's and scare the birds away from this location and nearby locations. Note that barnacle geese cannot be shot and are excluded by the loop below.
Definition at line 1862 of file Goose_Population_Manager.cpp.
References ForageLocationInUse(), g_land, g_msg, g_rand_uni, gst_foobar, gst_GreylagFamilyGroup, gst_GreylagNonBreeder, gst_PinkfootFamilyGroup, gst_PinkfootNonBreeder, InGreylagSeason(), InPinkfootSeason(), m_GooseForageLocations, m_GreylagSeason, m_PinkfootSeason, GooseHunter::OnShotABird(), Landscape::SupplyDayInYear(), Landscape::SupplyYear(), and MapErrorMsg::Warn().
Referenced by GooseHunter::OnShoot(), and GooseHunter::st_OutHunting().
int Goose_Population_Manager::BirdsToShootAtPoly | ( | int | a_poly | ) |
Returns the number of birds at a forage location - given by a poly ref.
Assumes that a_protectedpct is initialised to 0.0 on entry. First step is to get the forage location - the find out how many birds are there.
Definition at line 1833 of file Goose_Population_Manager.cpp.
References ForageLocationInUse(), g_msg, gst_GreylagFamilyGroup, gst_GreylagNonBreeder, gst_PinkfootFamilyGroup, gst_PinkfootNonBreeder, InGreylagSeason(), InPinkfootSeason(), m_GooseForageLocations, and MapErrorMsg::Warn().
Referenced by GooseHunter::OnShoot(), and GooseHunter::st_OutHunting().
|
protected |
Clear simple stats for daily energy balance in the population.
Definition at line 2250 of file Goose_Population_Manager.cpp.
References m_DailyEnergyBalanceStats.
Referenced by DoLast().
|
protected |
Clear simple stats for daily energy budget in the population.
Definition at line 2236 of file Goose_Population_Manager.cpp.
References m_DailyEnergyBudgetStats.
Referenced by DoLast().
|
protected |
Clear simple stats for flight distances in the population.
Definition at line 2222 of file Goose_Population_Manager.cpp.
References m_FlightDistanceStats.
Referenced by DoLast().
|
protected |
Clear simple stats for foraging times in the population.
Definition at line 2208 of file Goose_Population_Manager.cpp.
References m_ForagingTimeStats.
Referenced by DoLast().
|
protected |
Clear simple stats for field obs habitat use.
Definition at line 2195 of file Goose_Population_Manager.cpp.
References m_HabitatUseFieldObsStats, and tomis_foobar.
Referenced by GooseHabitatUseFieldObsOutput(), and Init().
|
protected |
Clear simple stats for habitat use.
Definition at line 2188 of file Goose_Population_Manager.cpp.
References m_HabitatUseStats, and tomis_foobar.
Referenced by GooseHabitatUseOutput(), and Init().
|
protected |
Clear simple stats for the reasons for leaving the simulation.
Definition at line 2284 of file Goose_Population_Manager.cpp.
References gst_foobar, m_LeaveReasonStats, and tolr_foobar.
Referenced by DoLast().
|
protected |
Clear simple stats for the weights in the population.
Definition at line 2169 of file Goose_Population_Manager.cpp.
References m_WeightStats.
Referenced by DoLast().
|
protected |
Clear simple stats for forage location counts.
Definition at line 2264 of file Goose_Population_Manager.cpp.
References m_IndividualForageLocationData.
Referenced by DoLast().
|
protected |
Clear simple stats for the states.
Definition at line 2276 of file Goose_Population_Manager.cpp.
References m_StateStats.
Referenced by DoLast().
|
inlineprotectedvirtual |
Does nothing, but we need it here because it automatically called by the Population_Manager if the NWordOutput is used.
Definition at line 832 of file Goose_Population_Manager.h.
|
inlineprotectedvirtual |
Does nothing, but we need it here because it automatically called by the Population_Manager if the NWordOutput is used.
Definition at line 830 of file Goose_Population_Manager.h.
void Goose_Population_Manager::CreateObjects | ( | int | ob_type, |
TAnimal * | pvo, | ||
struct_Goose * | data, | ||
int | number | ||
) |
Method for creating a new individual Goose.
Definition at line 898 of file Goose_Population_Manager.cpp.
References gst_BarnacleFamilyGroup, gst_BarnacleNonBreeder, gst_GreylagFamilyGroup, gst_GreylagNonBreeder, gst_PinkfootFamilyGroup, gst_PinkfootNonBreeder, struct_Goose::m_GPM, struct_Goose::m_grpsize, struct_Goose::m_L, struct_Goose::m_roost, struct_Goose::m_sex, struct_Goose::m_weight, Goose_Pinkfoot_FamilyGroup::ReInit(), Goose_Barnacle_FamilyGroup::ReInit(), Goose_Greylag_FamilyGroup::ReInit(), Goose_Barnacle_NonBreeder::ReInit(), Goose_Pinkfoot_NonBreeder::ReInit(), and Goose_Greylag_NonBreeder::ReInit().
Referenced by DoImmigration().
|
inlineprotectedvirtual |
Things to do before the EndStep.
Definition at line 724 of file Goose_Population_Manager.h.
|
inlineprotectedvirtual |
|
protectedvirtual |
Controls emigration from the Danish simulation area.
Definition at line 1651 of file Goose_Population_Manager.cpp.
References cfg_goose_bn_fallmig_probability, cfg_goose_bn_fallmigdateend, cfg_goose_bn_fallmigdatestart, cfg_goose_bn_fallmigrate, cfg_goose_bn_leavingdateend, cfg_goose_bn_leavingdatestart, cfg_goose_gl_fallmig_probability, cfg_goose_gl_fallmigdateend, cfg_goose_gl_fallmigdatestart, cfg_goose_gl_fallmigrate, cfg_goose_gl_leavingdateend, cfg_goose_gl_leavingdatestart, cfg_goose_pf_fallmig_probability, cfg_goose_pf_fallmigdateend, cfg_goose_pf_fallmigdatestart, cfg_goose_pf_fallmigrate, cfg_goose_pf_leavingdateend, cfg_goose_pf_leavingdatestart, g_rand_uni, gst_BarnacleFamilyGroup, gst_BarnacleNonBreeder, gst_GreylagFamilyGroup, gst_GreylagNonBreeder, gst_PinkfootFamilyGroup, gst_PinkfootNonBreeder, CfgInt::value(), CfgFloat::value(), and CfgBool::value().
Referenced by DoFirst().
|
protectedvirtual |
Things to do before anything else at the start of a timestep.
The Goose_Population_Manager DoFirst has three main functions. The first is to control the variables related to the goose timestep of 10 minutes. Here we assume the daylight hours start at time 0 and go on until the end of the daylength at any given date.
Then, if we are at start of day, then max goose numbers are relayed to the field elements.
Next checks the date and determines if we need to either migrate out of the area or into the area. If so calls the appropriate immigration or emigration code. Otherwise if we are in normal Danish simulation mode then at the start of each day the list of active forage locations is emptied ready to be refilled as the geese start foraging and some global energetic constants are calculated (thermal regulation costs).
Definition at line 1018 of file Goose_Population_Manager.cpp.
References cfg_goose_bn_Thermalconstant, cfg_goose_gl_Thermalconstant, cfg_goose_grain_and_maize_reset_day, cfg_goose_pf_Thermalconstant, cfg_goose_Thermalconstantb, DoEmigration(), DoImmigration(), InHuntingSeason(), m_daylight, m_daylightleft, m_daytime, m_GooseForageLocations, m_GreylagSeason, m_PinkfootSeason, m_thermalcosts, CfgInt::value(), and CfgFloat::value().
|
protectedvirtual |
Controls immigration to the Danish simulation area.
Here we need to determine the inputs in terms of birds to the Danish simulation area and create all the necessary objects and object relationships. This is a tiny bit tricky since it is important that all birds start the simulation with a sensible and complete characteristics.
The first step is to determine whether there are birds of each type to immigrate today, and if so how many. We have the numbers to immigrate and the range of days over which this happens. For sake of simplicity and because we don't have other information we will assume an even distribution of birds over this period.
Pinkfoot spring migration
Barnacle spring migration
Greylag spring migration
Definition at line 1494 of file Goose_Population_Manager.cpp.
References cfg_goose_bn_arrivedateend, cfg_goose_bn_arrivedatestart, cfg_goose_bn_baseweight, cfg_goose_bn_leavingdateend, cfg_goose_bn_sexratio, cfg_goose_bn_springmigdateend, cfg_goose_bn_springmigdatestart, cfg_goose_bn_springmigrate, cfg_goose_gl_arrivedateend, cfg_goose_gl_arrivedatestart, cfg_goose_gl_baseweight, cfg_goose_gl_leavingdateend, cfg_goose_gl_sexratio, cfg_goose_gl_springmigdateend, cfg_goose_gl_springmigdatestart, cfg_goose_gl_springmigrate, cfg_goose_pf_arrivedateend, cfg_goose_pf_arrivedatestart, cfg_goose_pf_baseweight, cfg_goose_pf_leavingdateend, cfg_goose_pf_sexratio, cfg_goose_pf_springmigdateend, cfg_goose_pf_springmigdatestart, cfg_goose_pf_springmigrate, CreateObjects(), g_rand_uni, GetImmigrationNumbers(), gst_BarnacleFamilyGroup, gst_BarnacleNonBreeder, gst_GreylagFamilyGroup, gst_GreylagNonBreeder, gst_PinkfootFamilyGroup, gst_PinkfootNonBreeder, struct_Goose::m_family, struct_Goose::m_GPM, struct_Goose::m_grpsize, struct_Goose::m_L, m_migrationnumbers, struct_Goose::m_roost, m_roosts, struct_Goose::m_sex, struct_Goose::m_weight, struct_Goose::m_x, struct_Goose::m_y, m_youngdist, CfgInt::value(), CfgFloat::value(), and CfgBool::value().
Referenced by DoFirst().
|
protectedvirtual |
Things to do after the EndStep.
The first job of DoLast is to update grain status in the forage locations.
If it is end of day, then max goose numbers are relayed to the field elements, then to inform the landscape of changes in grain and maize densities as a result of goose feeding. This is done here rather than have the geese interact directly with the landscape elements for efficiency, since landscape elements will only be updated once a day, and after the geese are finished. This also means fewer calculations and indirections.
If there is no grain or maize to deplete this does nothing.
Definition at line 1085 of file Goose_Population_Manager.cpp.
References cfg_goose_EnergyRecord, cfg_goose_FieldForageInfo, cfg_goose_IndLocCounts, cfg_goose_LeaveReasonStats, cfg_goose_PopulationDescriptionON, cfg_goose_StateStats, cfg_goose_TimedCounts, cfg_goose_WeightStats, cfg_gooseHabitatUsetime, ClearGooseDailyEnergyBalanceStats(), ClearGooseDailyEnergyBudgetStats(), ClearGooseFlightDistanceStats(), ClearGooseForagingTimeStats(), ClearGooseLeaveReasonStats(), ClearGooseWeightStats(), ClearIndLocCountStats(), ClearStateStats(), g_date, Calendar::GetDayInMonth(), GetDayTime(), GetGrainDensity(), Goose_Base::GetGroupsize(), GetMaizeDensity(), Goose_Base::GetMaxIntakeSource(), Goose_Base::GetSpecies(), GooseEnergyRecordOutput(), GooseFieldForageInfoOutput(), GooseHabitatUseFieldObsOutput(), GooseHabitatUseOutput(), GooseIndLocCountOutput(), GooseLeaveReasonStatOutput(), GoosePopulationDescriptionOutput(), GooseWeightStatOutput(), gst_foobar, m_daytime, m_GooseForageLocations, TMaxIntakeSource::m_instubble, TMaxIntakeSource::m_iscereal, TMaxIntakeSource::m_maxintakesource, TMaxIntakeSource::m_prevsowncrop, TMaxIntakeSource::m_veg, RecordHabitatUse(), RecordHabitatUseFieldObs(), StateStatOutput(), tomis_foobar, tomis_grain, tomis_grass, tomis_maize, tomis_sowncrop, tov_Maize, tov_MaizeSilage, CfgInt::value(), CfgBool::value(), and XYDump().
void Goose_Population_Manager::FindClosestRoost | ( | int & | a_x, |
int & | a_y, | ||
unsigned | a_type | ||
) |
Changes a_x & a_y to the location of the nearest roost of a_type to a_x, a_y.
Definition at line 1000 of file Goose_Population_Manager.cpp.
References ALMaSS_MathFuncs::CalcDistPythagoras(), g_AlmassMathFuncs, and m_roosts.
Referenced by Goose_Barnacle_Base::ChangeRoost(), Goose_Pinkfoot_Base::ChangeRoost(), and Goose_Greylag_Base::ChangeRoost().
int Goose_Population_Manager::ForageLocationInUse | ( | int | a_polyref | ) |
Tests if a forage location is currently in use, if so returns the index to it.
[in] | a_polyref | is the polygon reference number that identifies the field for foraging |
Definition at line 1752 of file Goose_Population_Manager.cpp.
References m_GooseForageLocations.
Referenced by AddGeeseToForageLocationP(), BirdsShot(), BirdsToShootAtPoly(), GetForageLocIndex(), and Goose_Base::st_ChooseForageLocation().
|
inline |
Returns the number of birds at a forage location - given by a poly ref.
Definition at line 530 of file Goose_Population_Manager.h.
References m_GooseForageLocations.
Referenced by Goose_Base::st_ChooseForageLocation(), and Goose_Base::st_Forage().
|
inline |
Get the daylight minutes left today.
Definition at line 412 of file Goose_Population_Manager.h.
References m_daylightleft.
|
inline |
Get the time of day (in minutes). For the goose model, sunrise is defined as m_daytime == 0. Hence this function returns the number of minutes since sunrise.
Definition at line 408 of file Goose_Population_Manager.h.
References m_daytime.
Referenced by DoLast(), Goose_Base::st_ChooseForageLocation(), Goose_Base::st_Forage(), Goose_Base::st_Roost(), Goose_Base::StartDay(), and TheAOROutputProbe().
double Goose_Population_Manager::GetDistToClosestRoost | ( | int | a_x, |
int | a_y, | ||
unsigned | a_type | ||
) |
Returns the distance in to the nearest roost of a_type in meters.
Definition at line 496 of file Goose_Population_Manager.cpp.
References ALMaSS_MathFuncs::CalcDistPythagoras(), g_AlmassMathFuncs, and m_roosts.
Referenced by NewForageLocation().
|
inline |
Get the forage rate based on the grain density.
[in] | a_graindensity | The grain density (grain/m2) on the forage location |
[in] | a_species | The type of goose species |
Unpublished curve from Nolet. o:/ST_GooseProject/Field data/Fugledata/Functional response pink-feet.xlsx This curve has already taken digestibility, energy content and assimilation into account.
Definition at line 457 of file Goose_Population_Manager.h.
References m_IntakeRateVSGrainDensity_PF.
Referenced by Goose_Base::EvaluateForageToHopLoc(), Goose_Base::st_ChooseForageLocation(), and Goose_Base::st_Forage().
|
inline |
Returns the total goose density for a forage location.
Definition at line 492 of file Goose_Population_Manager.h.
References m_GooseForageLocations.
Referenced by Goose_Base::st_ChooseForageLocation(), and Goose_Base::st_Forage().
|
inline |
Returns the forage density for a forage location and goose type. This is species specific.
Definition at line 496 of file Goose_Population_Manager.h.
References m_GooseForageLocations.
|
inline |
Returns a pointer to the forage location indexed by index.
Definition at line 448 of file Goose_Population_Manager.h.
References m_GooseForageLocations.
Referenced by Goose_Base::st_ChooseForageLocation(), and XYDump().
int Goose_Population_Manager::GetForageLocIndex | ( | GooseSpecies | a_species, |
int | a_x, | ||
int | a_y | ||
) |
Get a forage location for my species (picked randomly among the active locations)
Definition at line 2039 of file Goose_Population_Manager.cpp.
References ALMaSS_MathFuncs::CalcDistPythagoras(), cfg_goose_dist_weight_power, ForageLocationInUse(), g_AlmassMathFuncs, g_rand_uni, m_GooseForageLocations, and CfgFloat::value().
Referenced by Goose_Base::st_ChooseForageLocation().
|
inline |
Get the forage intake rate for a forage density.
Definition at line 488 of file Goose_Population_Manager.h.
References m_ForageRateVSGooseDensity.
Referenced by Goose_Base::st_ChooseForageLocation(), and Goose_Base::st_Forage().
|
inline |
Returns the forage density for a forage location.
Definition at line 500 of file Goose_Population_Manager.h.
References m_GooseForageLocations.
Referenced by DoLast().
|
protected |
Get the numbers to immigrate.
Definition at line 2092 of file Goose_Population_Manager.cpp.
References cfg_goose_bn_arrivedateend, cfg_goose_bn_arrivedatestart, cfg_goose_bn_springmigdateend, cfg_goose_bn_springmigdatestart, cfg_goose_bn_springmignos, cfg_goose_bn_startnos, cfg_goose_bn_young_proportion, cfg_goose_gl_arrivedateend, cfg_goose_gl_arrivedatestart, cfg_goose_gl_springmigdateend, cfg_goose_gl_springmigdatestart, cfg_goose_gl_springmignos, cfg_goose_gl_startnos, cfg_goose_gl_young_proportion, cfg_goose_pf_arrivedateend, cfg_goose_pf_arrivedatestart, cfg_goose_pf_springmigdateend, cfg_goose_pf_springmigdatestart, cfg_goose_pf_springmignos, cfg_goose_pf_startnos, cfg_goose_pf_young_proportion, m_migrationnumbers, start, CfgInt::value(), and CfgFloat::value().
Referenced by DoImmigration().
|
inline |
Is it daylight hours? Daylight starts at m_daytime == 0.
Definition at line 416 of file Goose_Population_Manager.h.
References m_daylight.
Referenced by Goose_Base::st_Roost().
Goose_Base * Goose_Population_Manager::GetLeader | ( | APoint | a_roost, |
GooseSpecies | a_species | ||
) |
Asks for a pointer to a goose that can be followed.
When leaving the roost in the morning we have the option to either follow another bird or go exploring on our own./n If we follow another bird this function will find a bird to follow (a leader). It is a prerequisite that the leader is from the same roost as the bird following and that the leader have found a suitable forage location.
[in] | a_roost | The roost of the follower as a point. |
[in] | a_species | The species of the follower. |
Definition at line 1989 of file Goose_Population_Manager.cpp.
References Goose_Base::GetForageLocIndex(), Goose_Base::GetRoost(), gst_BarnacleFamilyGroup, gst_BarnacleNonBreeder, gst_GreylagFamilyGroup, gst_GreylagNonBreeder, gst_PinkfootFamilyGroup, gst_PinkfootNonBreeder, and start.
Referenced by Goose_Base::st_ChooseForageLocation().
|
inline |
Returns the maize forage density for a forage location.
Definition at line 504 of file Goose_Population_Manager.h.
References m_GooseForageLocations.
Referenced by DoLast().
|
inline |
Get the forage rate when feeding on maize.
[in] | a_maizedensity | The maize density in kJ/m2 |
[in] | a_species | The type of goose species |
Functional response for geese feeding on maize is currently lacking. The curve used here is based on field observations of barnacle geese made with wildlife cameras in Jutland in 2015. Assimilation for energy is accounted for in the functional response curce. Value found for Bewick's swans from Nolet, B. unpubl. For greylag and pinkfeet the value is scaled based on the relationship between
Definition at line 474 of file Goose_Population_Manager.h.
References m_IntakeRateVSMaizeDensity_BN.
Referenced by Goose_Base::EvaluateForageToHopLoc(), Goose_Base::st_ChooseForageLocation(), and Goose_Base::st_Forage().
|
inline |
Get the number of forage locations.
Definition at line 560 of file Goose_Population_Manager.h.
References m_GooseForageLocations.
|
inline |
Get daily thermal costs const.
Definition at line 556 of file Goose_Population_Manager.h.
References m_thermalcosts.
Referenced by Goose_Barnacle_Base::Init(), Goose_Pinkfoot_Base::Init(), Goose_Greylag_Base::Init(), and Goose_Base::StartDay().
|
protected |
Produces output to a standard file describing the number of birds foraging at each field and the field conditions.
Definition at line 1371 of file Goose_Population_Manager.cpp.
References GooseToString(), m_DailyEnergyBalanceStats, m_DailyEnergyBudgetStats, m_FlightDistanceStats, and m_ForagingTimeStats.
Referenced by DoLast().
|
protected |
Produces output to a standard file describing the energetic state of all individuals of the goose populations.
The information needed here is in the landscape. We need to trawl through all the fields and record those that have suitable openness scores and food for geese
Definition at line 1302 of file Goose_Population_Manager.cpp.
References cfg_goose_MinForageOpenness, cfg_goose_runtime_reporting, CfgFloat::value(), and CfgBool::value().
Referenced by DoLast().
|
protected |
Outputs simple stats for the goose habitat use but using rules to mimic field observations.
Definition at line 1273 of file Goose_Population_Manager.cpp.
References ClearGooseHabitatUseFieldObsStats(), GooseToString(), m_HabitatUseFieldObsStats, and tomis_foobar.
Referenced by DoLast().
|
protected |
Outputs simple stats for the goose habitat use.
Definition at line 1244 of file Goose_Population_Manager.cpp.
References ClearGooseHabitatUseStats(), GooseToString(), m_HabitatUseStats, and tomis_foobar.
Referenced by DoLast().
|
protected |
Outputs simple stats for the number of forage locations visited per goose.
Definition at line 1412 of file Goose_Population_Manager.cpp.
References GooseToString(), and m_IndividualForageLocationData.
Referenced by DoLast().
|
protected |
Outputs simple stats for the reasons for leaving the simulation.
Definition at line 1436 of file Goose_Population_Manager.cpp.
References GooseTypeToString(), gst_foobar, LeaveReasonToString(), m_LeaveReasonStats, and tolr_foobar.
Referenced by DoLast().
|
protected |
Produces output to a standard file describing the state of the goose populations.
Here the first job is to correct the standard output and produce a more detailed description of the population, ie not counting families as one.
Definition at line 1457 of file Goose_Population_Manager.cpp.
References gst_BarnacleFamilyGroup, gst_BarnacleNonBreeder, gst_GreylagFamilyGroup, gst_GreylagNonBreeder, gst_PinkfootFamilyGroup, and gst_PinkfootNonBreeder.
Referenced by DoLast().
|
protected |
Translates gs enum to string
Definition at line 2463 of file Goose_Population_Manager.cpp.
Referenced by GooseEnergyRecordOutput(), GooseHabitatUseFieldObsOutput(), GooseHabitatUseOutput(), GooseIndLocCountOutput(), and GooseWeightStatOutput().
|
protected |
Translates gst enum to string
Definition at line 2442 of file Goose_Population_Manager.cpp.
References gst_BarnacleFamilyGroup, gst_BarnacleNonBreeder, gst_GreylagFamilyGroup, gst_GreylagNonBreeder, gst_PinkfootFamilyGroup, and gst_PinkfootNonBreeder.
Referenced by GooseLeaveReasonStatOutput().
|
protected |
Outputs simple stats for the weights in the population.
Definition at line 1395 of file Goose_Population_Manager.cpp.
References GooseToString(), and m_WeightStats.
Referenced by DoLast().
|
inline |
Removes KJ as grams veg biomass from a forage area.
Definition at line 519 of file Goose_Population_Manager.h.
References m_GooseForageLocations.
Referenced by RemoveMaxForageKj().
|
inline |
Are we in the greylag hunting season?
Definition at line 420 of file Goose_Population_Manager.h.
References m_GreylagSeason.
Referenced by BirdsShot(), BirdsToShootAtPoly(), and GooseActiveForageLocation::GetHuntables().
|
protected |
Are we in the hunting season?
The goose hunting season is complicated because it runs over a year boundary (or it can) Particularly the first year of the simulation is tricky, because we start out in January which can be legal hunting season, but the geese don't arrive until the fall.
Definition at line 2294 of file Goose_Population_Manager.cpp.
References cfg_goose_greylagopenseasonend, cfg_goose_greylagopenseasonstart, cfg_goose_pinkfootopenseasonend, cfg_goose_pinkfootopenseasonstart, g_msg, CfgInt::value(), MapErrorMsg::Warn(), and WARN_FILE.
Referenced by DoFirst().
|
protectedvirtual |
Called upon initialization of the simulation. Sets up output files.
Finally opens any output files needed
Definition at line 670 of file Goose_Population_Manager.cpp.
References cfg_AOROutput_used, cfg_goose_ObservedOpennessQuery, cfg_goose_runtime_reporting, cfg_goose_WriteConfig, cfg_ReallyBigOutput_used, ClearGooseHabitatUseFieldObsStats(), ClearGooseHabitatUseStats(), IntakeSourceToString(), l_map_print_git_version_info, m_AOR_Barnacles, m_AOR_Greylags, m_AOR_Pinkfeet, m_GooseEnergeticsDataFile, m_GooseFieldForageDataFile, m_GooseGitVersionFile, m_GooseHabitatUseFieldObsFile, m_GooseHabitatUseFile, m_GooseIndLocCountFile, m_GooseLeaveReasonStatsFile, m_GoosePopDataFile, m_GooseWeightStatsFile, m_GooseXYDumpFile, m_StateStatsFile, ObservedOpennessQuery(), tomis_foobar, CfgBool::value(), WriteConfig(), and WriteHeaders().
Referenced by Goose_Population_Manager().
|
inline |
Are we in the pinkfoot hunting season?
Definition at line 418 of file Goose_Population_Manager.h.
References m_PinkfootSeason.
Referenced by BirdsShot(), BirdsToShootAtPoly(), and GooseActiveForageLocation::GetHuntables().
|
protected |
Translates tomis enum to string
Definition at line 2478 of file Goose_Population_Manager.cpp.
References tomis_grain, tomis_grass, tomis_maize, and tomis_sowncrop.
Referenced by Init().
|
protected |
Translates tolr enum to string
Definition at line 2495 of file Goose_Population_Manager.cpp.
References tolr_bodycondition, tolr_leanweight, tolr_migration, and tomis_grain.
Referenced by GooseLeaveReasonStatOutput().
int Goose_Population_Manager::NewForageLocation | ( | GooseSpeciesType | a_type, |
int | a_number, | ||
int | a_polyref | ||
) |
Creates a new forage location and adds a goose or geese to the forage location. Returns an index to the forage location list.
[in] | a_type | is type of goose species to forage here in this first forage group |
[in] | a_number | is the number of geese in this first forarge group |
[in] | a_polyref | is the polygon reference number that identifies the field for foraging |
Adds the new forage location to the m_GooseForageLocations vector and adds the starting number of geese of the type specified. Calculates the distance to the closest roost for each species.
Definition at line 1773 of file Goose_Population_Manager.cpp.
References GetDistToClosestRoost(), m_GooseForageLocations, and GooseActiveForageLocation::ResetGrazing().
Referenced by AddGeeseToForageLocationP(), and Goose_Base::st_ChooseForageLocation().
|
protected |
Writes a file with the openness scores on places where geese have been observed in the field.
Here locations of geese observed in the field are read in from a file and the openness score for those locations are written to a file.
Definition at line 796 of file Goose_Population_Manager.cpp.
Referenced by Init().
void Goose_Population_Manager::RecordDailyEnergyBalance | ( | int | a_balance, |
GooseSpecies | a_species | ||
) |
Record the daily energy balance.
Definition at line 2245 of file Goose_Population_Manager.cpp.
References m_DailyEnergyBalanceStats.
Referenced by Goose_Base::StartDay().
void Goose_Population_Manager::RecordDailyEnergyBudget | ( | int | a_deb, |
GooseSpecies | a_species | ||
) |
Record the daily energy budget.
Definition at line 2231 of file Goose_Population_Manager.cpp.
References m_DailyEnergyBudgetStats.
Referenced by Goose_Base::StartDay().
void Goose_Population_Manager::RecordFlightDistance | ( | int | a_distance, |
GooseSpecies | a_species | ||
) |
Record the flight distance.
Definition at line 2217 of file Goose_Population_Manager.cpp.
References m_FlightDistanceStats.
Referenced by Goose_Base::StartDay().
void Goose_Population_Manager::RecordForagingTime | ( | int | a_time, |
GooseSpecies | a_species | ||
) |
Record the time spent foraging.
Definition at line 2203 of file Goose_Population_Manager.cpp.
References m_ForagingTimeStats.
Referenced by Goose_Base::StartDay().
void Goose_Population_Manager::RecordHabitatUse | ( | int | a_habitatype, |
GooseSpecies | a_species, | ||
int | a_count | ||
) |
Record the habitat use.
Definition at line 2177 of file Goose_Population_Manager.cpp.
References m_HabitatUseStats, and tomis_foobar.
Referenced by DoLast().
void Goose_Population_Manager::RecordHabitatUseFieldObs | ( | int | a_habitatype, |
GooseSpecies | a_species, | ||
int | a_count | ||
) |
Record the habitat use.
Definition at line 2183 of file Goose_Population_Manager.cpp.
References m_HabitatUseFieldObsStats, and tomis_foobar.
Referenced by DoLast().
void Goose_Population_Manager::RecordIndForageLoc | ( | double | a_count, |
int | a_groupsize, | ||
GooseSpecies | a_species | ||
) |
Record a forage location count.
Definition at line 2259 of file Goose_Population_Manager.cpp.
References m_IndividualForageLocationData.
Referenced by Goose_Base::StartDay().
void Goose_Population_Manager::RecordLeaveReason | ( | TTypeOfLeaveReason | a_leavereason, |
GooseSpeciesType | a_speciestype | ||
) |
Record the reason for leaving.
Definition at line 2280 of file Goose_Population_Manager.cpp.
References m_LeaveReasonStats.
Referenced by Goose_Base::On_Migrate().
void Goose_Population_Manager::RecordState | ( | ) |
Record the state.
Definition at line 2272 of file Goose_Population_Manager.cpp.
References m_StateStats.
Referenced by Goose_Base::st_ChooseForageLocation().
void Goose_Population_Manager::RecordWeight | ( | double | a_weight, |
GooseSpecies | a_species | ||
) |
Record the weight.
Definition at line 2164 of file Goose_Population_Manager.cpp.
References m_WeightStats.
Referenced by Goose_Base::StartDay().
void Goose_Population_Manager::RemoveGeeseFromForageLocation | ( | GooseSpeciesType | a_type, |
int | a_index, | ||
int | a_number | ||
) |
Removes a goose or geese to the forage location - requires an index.
Definition at line 1812 of file Goose_Population_Manager.cpp.
References m_GooseForageLocations.
Referenced by Goose_Barnacle_FamilyGroup::KillThis(), Goose_Pinkfoot_FamilyGroup::KillThis(), Goose_Greylag_FamilyGroup::KillThis(), Goose_Base::KillThis(), Goose_Base::On_Bang(), Goose_Base::st_Forage(), Goose_Barnacle_Base::st_ToRoost(), Goose_Greylag_Base::st_ToRoost(), and Goose_Pinkfoot_Base::st_ToRoost().
|
inline |
Removes kJ eaten as grains from a forage area.
Definition at line 508 of file Goose_Population_Manager.h.
References m_GooseForageLocations.
Referenced by RemoveMaxForageKj().
|
inline |
Removes KJ eaten as maize from a forage area.
Definition at line 513 of file Goose_Population_Manager.h.
References m_GooseForageLocations.
Referenced by RemoveMaxForageKj().
void Goose_Population_Manager::RemoveMaxForageKj | ( | double | a_forage, |
TTypeOfMaxIntakeSource | a_maxintakesource, | ||
int | m_myForageIndex | ||
) |
Removes the forage eaten from the field.
[in] | a_forage | The forage to be removed in Kj |
[in] | a_maxintakesource | The source of the max intake |
[in] | m_myForageIndex | Temporary storage for a forage location index |
Definition at line 2073 of file Goose_Population_Manager.cpp.
References Graze(), RemoveGrainKJ(), RemoveMaizeKJ(), tomis_foobar, tomis_grain, tomis_grass, and tomis_maize.
Referenced by Goose_Base::st_Forage().
|
protected |
Write simple stats for the states.
Definition at line 1430 of file Goose_Population_Manager.cpp.
References m_StateStats.
Referenced by DoLast().
|
protectedvirtual |
The modified goose version of the standard output for creating AOR statistics.
Here the problem is that we can't use the standard outputs because of the special goose population structures. So we need some special adaptions to the probe. This is done by extending the AOR_Probe class and using this, one for each species We also need to do this only once per day, so since the main calling loops use days as triggers we need to return doing nothing if the time is wrong.
Definition at line 2370 of file Goose_Population_Manager.cpp.
References cfg_gooseAORtime, GetDayTime(), m_AOR_Barnacles, m_AOR_Greylags, m_AOR_Pinkfeet, and CfgInt::value().
|
inlineprotectedvirtual |
Does nothing, but we need it here because it automatically called by the Population_Manager if the NWordOutput is used.
Definition at line 828 of file Goose_Population_Manager.h.
|
protected |
Writes a file the values of the config variables used.
Write out the values of the configs used Handy when compiling the result documents
Definition at line 839 of file Goose_Population_Manager.cpp.
References cfg_goose_BMRconstant1, cfg_goose_BMRconstant2, cfg_goose_bn_arrivedateend, cfg_goose_bn_arrivedatestart, cfg_goose_bn_baseweight, cfg_goose_bn_followinglikelyhood, cfg_goose_bn_ForageDist, cfg_goose_bn_leavingdateend, cfg_goose_bn_leavingdatestart, cfg_goose_bn_sexratio, cfg_goose_bn_Thermalconstant, cfg_goose_daytime_BMR_multiplier, cfg_goose_dist_weight_power, cfg_goose_EnergyContentOfFat, cfg_goose_flightcost, cfg_goose_gl_arrivedateend, cfg_goose_gl_arrivedatestart, cfg_goose_gl_baseweight, cfg_goose_gl_followinglikelyhood, cfg_goose_gl_ForageDist, cfg_goose_gl_leavingdateend, cfg_goose_gl_leavingdatestart, cfg_goose_gl_sexratio, cfg_goose_gl_Thermalconstant, cfg_goose_GrainDecayRateSpring, cfg_goose_GrainDecayRateWinter, cfg_goose_grass_to_winter_cereal_scaler, cfg_goose_InitialEnergyReserveProportion, cfg_goose_LeaveReasonStats, cfg_goose_MaxAppetiteScaler, cfg_goose_MaxEnergyReserveProportion, cfg_goose_MaxScareDistance, cfg_goose_MetabolicConversionCosts, cfg_goose_MinForageOpenness, cfg_goose_nighttime_BMR_multiplier, cfg_goose_pf_arrivedateend, cfg_goose_pf_arrivedatestart, cfg_goose_pf_baseweight, cfg_goose_pf_followinglikelyhood, cfg_goose_pf_ForageDist, cfg_goose_pf_leavingdateend, cfg_goose_pf_leavingdatestart, cfg_goose_pf_sexratio, cfg_goose_pf_Thermalconstant, cfg_goose_roostchangechance, cfg_goose_RoostLeaveDistMean, cfg_goose_RoostLeaveDistSD, cfg_goose_snow_scaler, cfg_goose_Thermalconstantb, cfg_PermanentVegGrowthMaxScaler, cfg_PermanentVegGrowthMinScaler, CfgInt::value(), CfgFloat::value(), and CfgBool::value().
Referenced by Init().
|
protected |
Handy function for writing headers.
Definition at line 2352 of file Goose_Population_Manager.cpp.
Referenced by Init().
|
protected |
Outputs x y data.
Definition at line 2386 of file Goose_Population_Manager.cpp.
References GetForageLocation(), GooseActiveForageLocation::GetPolygonref(), gst_PinkfootFamilyGroup, and gst_PinkfootNonBreeder.
Referenced by DoLast().
|
protected |
AOR Probe for barnacles.
Definition at line 702 of file Goose_Population_Manager.h.
Referenced by Init(), TheAOROutputProbe(), and ~Goose_Population_Manager().
|
protected |
AOR Probe for greylags.
Definition at line 706 of file Goose_Population_Manager.h.
Referenced by Init(), TheAOROutputProbe(), and ~Goose_Population_Manager().
|
protected |
AOR Probe for pinkfeet.
Definition at line 698 of file Goose_Population_Manager.h.
Referenced by Init(), TheAOROutputProbe(), and ~Goose_Population_Manager().
|
protected |
Statistics for the daily energy balance in the population.
Definition at line 686 of file Goose_Population_Manager.h.
Referenced by ClearGooseDailyEnergyBalanceStats(), GooseEnergyRecordOutput(), and RecordDailyEnergyBalance().
|
protected |
Statistics for the daily energy budget in the population.
Definition at line 682 of file Goose_Population_Manager.h.
Referenced by ClearGooseDailyEnergyBudgetStats(), GooseEnergyRecordOutput(), and RecordDailyEnergyBudget().
|
protected |
Flag for in daylight hours. Sunrise is always at m_daytime == 0.
Definition at line 590 of file Goose_Population_Manager.h.
Referenced by DoFirst(), and GetIsDaylight().
|
protected |
Number of daylight minutes left.
Definition at line 592 of file Goose_Population_Manager.h.
Referenced by DoFirst(), and GetDaylightLeft().
|
protected |
Holds the time of day. Note that sunrise is at m_daytime == 0.
Definition at line 588 of file Goose_Population_Manager.h.
Referenced by DoFirst(), DoLast(), GetDayTime(), and Goose_Population_Manager().
|
protected |
Statistics for the flight distances in the population.
Definition at line 678 of file Goose_Population_Manager.h.
Referenced by ClearGooseFlightDistanceStats(), GooseEnergyRecordOutput(), and RecordFlightDistance().
|
protected |
Speed optimisation to hold all potential competition reductions in the range 0 - 1 goose/m2.
Speed optimisation to hold all potential feeding time increases as a function of flock size
Definition at line 620 of file Goose_Population_Manager.h.
Referenced by GetForageRateDensity(), Goose_Population_Manager(), and ~Goose_Population_Manager().
|
protected |
Statistics for the time spent foraging for the population.
Definition at line 674 of file Goose_Population_Manager.h.
Referenced by ClearGooseForagingTimeStats(), GooseEnergyRecordOutput(), and RecordForagingTime().
|
protected |
Pointer to an output file for goose energetics data.
Definition at line 628 of file Goose_Population_Manager.h.
Referenced by Init(), and ~Goose_Population_Manager().
|
protected |
Pointer to an output file for goose field forage data.
Definition at line 652 of file Goose_Population_Manager.h.
Referenced by Init(), and ~Goose_Population_Manager().
std::vector<GooseActiveForageLocation> Goose_Population_Manager::m_GooseForageLocations |
Is a list of active goose forage locations where we have geese.
Definition at line 558 of file Goose_Population_Manager.h.
Referenced by AddGeeseToForageLocation(), AddGeeseToForageLocationP(), BirdsShot(), BirdsToShootAtPoly(), DoFirst(), DoLast(), ForageLocationInUse(), GetBirdsAtForageLoc(), GetForageGooseDensity(), GetForageGrazing(), GetForageLocation(), GetForageLocIndex(), GetGrainDensity(), GetMaizeDensity(), GetNumberOfForageLocs(), Graze(), NewForageLocation(), RemoveGeeseFromForageLocation(), RemoveGrainKJ(), RemoveMaizeKJ(), and Goose_Base::st_Forage().
|
protected |
Pointer to an output file for almass version.
Definition at line 654 of file Goose_Population_Manager.h.
Referenced by Init(), and ~Goose_Population_Manager().
|
protected |
Pointer to an output file for goose habitat use data, field observation mimic version.
Definition at line 636 of file Goose_Population_Manager.h.
Referenced by Init(), and ~Goose_Population_Manager().
|
protected |
Pointer to an output file for goose habitat use data.
Definition at line 632 of file Goose_Population_Manager.h.
Referenced by Init(), and ~Goose_Population_Manager().
|
protected |
Pointer to an output file for goose individual forage location count data.
Definition at line 640 of file Goose_Population_Manager.h.
Referenced by Init(), and ~Goose_Population_Manager().
|
protected |
Pointer to an output file for goose leave reason stats data.
Definition at line 648 of file Goose_Population_Manager.h.
Referenced by Init().
|
protected |
Pointer to an output file for goose population data.
Definition at line 624 of file Goose_Population_Manager.h.
Referenced by Init(), and ~Goose_Population_Manager().
|
protected |
Pointer to an output file for goose weight stats data.
Definition at line 644 of file Goose_Population_Manager.h.
Referenced by Init(), and ~Goose_Population_Manager().
|
protected |
Pointer to an output file for goose x y data.
Definition at line 710 of file Goose_Population_Manager.h.
Referenced by Init(), and ~Goose_Population_Manager().
|
protected |
Flag to indicate if we are in the greylag hunting season.
Definition at line 602 of file Goose_Population_Manager.h.
Referenced by BirdsShot(), DoFirst(), Goose_Population_Manager(), and InGreylagSeason().
|
protected |
Data for the habitat use, field observation mimic version.
Definition at line 662 of file Goose_Population_Manager.h.
Referenced by ClearGooseHabitatUseFieldObsStats(), GooseHabitatUseFieldObsOutput(), and RecordHabitatUseFieldObs().
|
protected |
Data for the habitat use.
Definition at line 658 of file Goose_Population_Manager.h.
Referenced by ClearGooseHabitatUseStats(), GooseHabitatUseOutput(), and RecordHabitatUse().
|
protected |
Statistics for the number of forage locations visited per goose of the population.
Definition at line 666 of file Goose_Population_Manager.h.
Referenced by ClearIndLocCountStats(), GooseIndLocCountOutput(), and RecordIndForageLoc().
|
protected |
Speed optimisation to hold all potential forage rates in the range 0-X grain density per m2.
Definition at line 608 of file Goose_Population_Manager.h.
Referenced by GetFeedingRate(), Goose_Population_Manager(), and ~Goose_Population_Manager().
|
protected |
Speed optimisation to hold all potential forage rates in the range 0-X maize density per m2.
Definition at line 612 of file Goose_Population_Manager.h.
Referenced by GetMaizeFeedingRate(), Goose_Population_Manager(), and ~Goose_Population_Manager().
|
protected |
Statistics for reasons for leaving the simulation.
Definition at line 694 of file Goose_Population_Manager.h.
Referenced by ClearGooseLeaveReasonStats(), GooseLeaveReasonStatOutput(), and RecordLeaveReason().
|
protected |
Storage for goose numbers. Used when birds are immigrating.
Definition at line 598 of file Goose_Population_Manager.h.
Referenced by DoImmigration(), and GetImmigrationNumbers().
|
protected |
Flag to indicate if we are in the pinkfoot hunting season?
Definition at line 600 of file Goose_Population_Manager.h.
Referenced by BirdsShot(), DoFirst(), Goose_Population_Manager(), and InPinkfootSeason().
|
protected |
The list of roosts
Definition at line 604 of file Goose_Population_Manager.h.
Referenced by DoImmigration(), FindClosestRoost(), GetDistToClosestRoost(), and Goose_Population_Manager().
|
protected |
Debugging code. Statistics for the number of times a state method is called.
Definition at line 690 of file Goose_Population_Manager.h.
Referenced by ClearStateStats(), RecordState(), and StateStatOutput().
|
protected |
Pointer to an output file for state stats data.
Definition at line 688 of file Goose_Population_Manager.h.
Referenced by Init().
|
protected |
Temporary storage for daily goose energetic thermal costs constant for each species.
Definition at line 594 of file Goose_Population_Manager.h.
Referenced by DoFirst(), GetThermalCosts(), and Goose_Population_Manager().
Variate_gen* Goose_Population_Manager::m_variate_generator |
Function to be able to draw randomly from predefined distributions.
Definition at line 564 of file Goose_Population_Manager.h.
Referenced by Goose_Population_Manager(), Goose_Base::StartDay(), and ~Goose_Population_Manager().
|
protected |
Statistics for the weights of the population.
Definition at line 670 of file Goose_Population_Manager.h.
Referenced by ClearGooseWeightStats(), GooseWeightStatOutput(), and RecordWeight().
|
protected |
The observed distribution of young for pink feet.
Definition at line 596 of file Goose_Population_Manager.h.
Referenced by DoImmigration(), and Goose_Population_Manager().