Goose Management Model ODdox
1.02
|
Go to the documentation of this file.
36 #ifndef Goose_Population_ManagerH
37 #define Goose_Population_ManagerH
43 class AOR_Probe_Goose;
294 g_msg->
Warn(
"GooseActiveForageLocation::RemoveGeese - Negative birds at forage location", (
double)
m_BirdsPresent[a_type]);
568 void RecordWeight(
double a_weight, GooseSpecies a_species);
570 void RecordHabitatUse(
int a_habitatype, GooseSpecies a_species,
int a_count);
714 virtual void Init(
void);
824 void WriteHeaders(ofstream *a_file, std::vector<std::string> a_headers);
int GetDaylightLeft()
Get the daylight minutes left today.
double m_weight
The weight.
ofstream * m_GooseHabitatUseFieldObsFile
Pointer to an output file for goose habitat use data, field observation mimic version.
SimpleStatistics m_ForagingTimeStats[gs_foobar]
Statistics for the time spent foraging for the population.
SimpleStatistics m_DailyEnergyBudgetStats[gs_foobar]
Statistics for the daily energy budget in the population.
double GetGrazing(int gs)
Returns the current forage rate kJ/min assuming no other geese affect this.
ofstream * m_GoosePopDataFile
Pointer to an output file for goose population data.
void UpdateKJ()
Updates the grain or maize density based on the current total grain or maize amount.
int GetForageLocIndex(GooseSpecies a_species, int a_x, int a_y)
Get a forage location for my species (picked randomly among the active locations)
void BangAtPoly(int a_polyref)
Passes a 'Bang' message to birds near to the location specified by the polygon reference.
double m_maizedensity
The maize density in kJ/m2.
std::vector< int > m_youngdist
The observed distribution of young for pink feet.
void RecordHabitatUse(int a_habitatype, GooseSpecies a_species, int a_count)
Record the habitat use.
void GoosePopulationDescriptionOutput()
Produces output to a standard file describing the state of the goose populations.
SimpleStatistics m_WeightStats[gs_foobar]
Statistics for the weights of the population.
int GetDayTime()
Get the time of day (in minutes). For the goose model, sunrise is defined as m_daytime == 0....
bool InHuntingSeason(int a_day, GooseSpecies a_species)
Are we in the hunting season?
int m_HabitatUseFieldObsStats[gs_foobar *tomis_foobar]
Data for the habitat use, field observation mimic version.
double m_grainKJ_total
The total grain kJ.
ofstream * m_GooseWeightStatsFile
Pointer to an output file for goose weight stats data.
int GetHuntables(void)
Returns the number of huntable birds at the location.
int GetNumberOfForageLocs(void)
Get the number of forage locations.
Goose_Population_Manager(Landscape *L)
Goose_Population_Manager Constructor.
void XYDump()
Outputs x y data.
void AddGeeseToForageLocation(GooseSpeciesType a_type, int a_index, int a_number)
Adds a goose or geese to the forage location - requires an index.
void RecordWeight(double a_weight, GooseSpecies a_species)
Record the weight.
void SetGrainDensity(double a_density)
Sets forage density (grain/m2)
void GooseHabitatUseOutput()
Outputs simple stats for the goose habitat use.
std::vector< APoint > roostlist
a list of goose roosts as points
int m_MaxBirdsPresent[gst_foobar]
An array holding the maximum number of geese of different types and total i.e. Pinkfoot families,...
ofstream * m_GooseIndLocCountFile
Pointer to an output file for goose individual forage location count data.
void SetArea(int a_area)
Set the area in m.
Used for creation of a new Goose object.
void StateStatOutput()
Write simple stats for the states.
double GetMaizeDensity(void)
Returns the current maize forage density (kJ/m2)
int GetGooseNumbers(void)
Returns the total number of geese at the location.
void RemoveGrainKJ(double a_kJ)
Removes grain from the field as kJ.
void GooseWeightStatOutput()
Outputs simple stats for the weights in the population.
void SetDistToClosestRoost(int gs, double a_dist)
Sets the distance to the closest roost in meters.
virtual ~Goose_Population_Manager(void)
Goose_Population_Manager Destructor.
int GetIsDaylight()
Is it daylight hours? Daylight starts at m_daytime == 0.
void RecordDailyEnergyBudget(int a_deb, GooseSpecies a_species)
Record the daily energy budget.
double GetArea()
Get the area in m.
int m_polygonref
A landscape element ( LE ) reference number used by the Landscape class to identify this location.
void ClearGooseDailyEnergyBalanceStats()
Clear simple stats for daily energy balance in the population.
double GetForageGrazing(int a_index, int gs)
Returns the forage density for a forage location and goose type. This is species specific.
double GetMaizeFeedingRate(double a_maizedensity, GooseSpecies a_species)
Get the forage rate when feeding on maize.
void GooseEnergyRecordOutput()
Produces output to a standard file describing the number of birds foraging at each field and the fiel...
void RecordLeaveReason(TTypeOfLeaveReason a_leavereason, GooseSpeciesType a_speciestype)
Record the reason for leaving.
int GetPolygonref()
Get the landscape element ( LE ) reference number used by the Landscape class to identify this locati...
ofstream * m_GooseEnergeticsDataFile
Pointer to an output file for goose energetics data.
double GetGrainDensity(void)
Returns the current forage density (grain/m2)
ofstream * m_GooseFieldForageDataFile
Pointer to an output file for goose field forage data.
void RecordHabitatUseFieldObs(int a_habitatype, GooseSpecies a_species, int a_count)
Record the habitat use.
GooseActiveForageLocation(GooseSpeciesType a_type, int a_number, int a_polyref, int a_area, double a_graindensity, double a_maizedensity, double *a_grazing, Goose_Population_Manager *p_NPM)
Constructor for GooseActiveForageLocation.
void ClearGooseHabitatUseStats()
Clear simple stats for habitat use.
TTypeOfMaxIntakeSource m_HabitatType
Whether it is a cereal crop, grass etc.
Landscape * m_L
Landscape pointer.
APoint m_roost
Roost location.
Variate_gen * m_variate_generator
Function to be able to draw randomly from predefined distributions.
int GetBirds(GooseSpecies a_goose)
Get how many birds of a species.
Goose_Base * GetLeader(APoint a_homeloc, GooseSpecies a_species)
Asks for a pointer to a goose that can be followed.
The landscape class containing all environmental and topographical data.
void RecordForagingTime(int a_time, GooseSpecies a_species)
Record the time spent foraging.
double m_grazedbiomass
Contains the total amount of grazing eaten today.
void ClearStateStats()
Clear simple stats for the states.
bool m_daylight
Flag for in daylight hours. Sunrise is always at m_daytime == 0.
void ClearGooseWeightStats()
Clear simple stats for the weights in the population.
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.
SimpleStatistics m_StateStats
Debugging code. Statistics for the number of times a state method is called.
double GetRoostDist(int gs)
Returns the distance to the closest roost for gs.
void RecordIndForageLoc(double a_count, int a_groupsize, GooseSpecies a_species)
Record a forage location count.
double GetMaizeDensity(int a_index)
Returns the maize forage density for a forage location.
double GetFeedingRate(double a_graindensity, GooseSpecies a_species)
Get the forage rate based on the grain density.
double m_graindensity
The grain density in kJ/m2.
virtual void DoBefore()
Things to do before the Step.
virtual void TheAOROutputProbe()
The modified goose version of the standard output for creating AOR statistics.
HollingsDiscCurveClass * m_IntakeRateVSMaizeDensity_BN
Speed optimisation to hold all potential forage rates in the range 0-X maize density per m2.
ofstream * m_StateStatsFile
Pointer to an output file for state stats data.
HollingsDiscCurveClass * m_IntakeRateVSGrainDensity_PF
Speed optimisation to hold all potential forage rates in the range 0-X grain density per m2.
int ForageLocationInUse(int a_polyref)
Tests if a forage location is currently in use, if so returns the index to it.
double m_thermalcosts[3]
Temporary storage for daily goose energetic thermal costs constant for each species.
ofstream * m_GooseLeaveReasonStatsFile
Pointer to an output file for goose leave reason stats data.
std::vector< GooseActiveForageLocation > m_GooseForageLocations
Is a list of active goose forage locations where we have geese.
double GetThermalCosts(GooseSpecies a_goose)
Get daily thermal costs const.
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.
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
GooseActiveForageLocation * GetForageLocation(unsigned int a_index)
Returns a pointer to the forage location indexed by index.
ofstream * m_GooseHabitatUseFile
Pointer to an output file for goose habitat use data.
void GetImmigrationNumbers(GooseSpecies a_goose, bool a_season)
Get the numbers to immigrate.
void ClearGooseFlightDistanceStats()
Clear simple stats for flight distances in the population.
void Graze(double a_kJ, int a_index)
Removes KJ as grams veg biomass from a forage area.
void RecordFlightDistance(int a_distance, GooseSpecies a_species)
Record the flight distance.
void BirdsShot(int a_polyref, int a_numbershot, GooseHunter *a_Hunter)
Passes the message to shoot a number of birds at a forage location.
bool InGreylagSeason()
Are we in the greylag hunting season?
double GetGooseDensity(void)
Returns the density of geese at the location.
The class to handle all goose population related matters.
double m_dist_to_closest_roost[gs_foobar]
An array holding the distance to the closest roost.
int GetBirdsAtForageLoc(int a_index, GooseSpeciesType a_type)
Returns the number of birds at a forage location - given by a poly ref.
void RemoveGrainKJ(double a_kJ, int a_index)
Removes kJ eaten as grains from a forage area.
virtual void CloseTheReallyBigOutputProbe()
Does nothing, but we need it here because it automatically called by the Population_Manager if the NW...
AOR_Probe_Goose * m_AOR_Greylags
AOR Probe for greylags.
A class to hold an active goose foraging location and the number of birds of different types there.
void RemoveMaizeKJ(double a_kJ, int a_index)
Removes KJ eaten as maize from a forage area.
double GetGrainDensity(int a_index)
Returns the forage density for a forage location.
virtual void DoAfter()
Things to do before the EndStep.
double m_maizeKJ_total
The total maize kJ.
void ClearIndLocCountStats()
Clear simple stats for forage location counts.
int GetMaxSpBirdsPresent(GooseSpecies a_goose)
Sum of the maximum of each goose species present (this may not be the same as the real maximum)
void RemoveGeese(GooseSpeciesType a_type, int a_number)
Removes geese to the location.
SimpleStatistics m_LeaveReasonStats[gst_foobar][tolr_foobar]
Statistics for reasons for leaving the simulation.
ofstream * m_GooseXYDumpFile
Pointer to an output file for goose x y data.
void ClearGooseForagingTimeStats()
Clear simple stats for foraging times in the population.
AOR_Probe_Goose * m_AOR_Barnacles
AOR Probe for barnacles.
SimpleStatistics m_IndividualForageLocationData[gs_foobar]
Statistics for the number of forage locations visited per goose of the population.
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 t...
double GetGrazedBiomass(void)
Returns the current grazing forage eaten in g.
void ClearBirds()
Empties the bird recording arrays.
void CreateObjects(int ob_type, TAnimal *pvo, struct_Goose *data, int number)
Method for creating a new individual Goose.
int m_migrationnumbers[3][2]
Storage for goose numbers. Used when birds are immigrating.
bool m_GreylagSeason
Flag to indicate if we are in the greylag hunting season.
std::string IntakeSourceToString(TTypeOfMaxIntakeSource a_intake_source)
Translates tomis enum to string
double GetForageGooseDensity(int a_index)
Returns the total goose density for a forage location.
AOR_Probe_Goose * m_AOR_Pinkfeet
AOR Probe for pinkfeet.
void ClearGooseHabitatUseFieldObsStats()
Clear simple stats for field obs habitat use.
PettiforFeedingTimeCurveClass * m_ForageRateVSGooseDensity
Speed optimisation to hold all potential competition reductions in the range 0 - 1 goose/m2.
void ClearGooseLeaveReasonStats()
Clear simple stats for the reasons for leaving the simulation.
void RecordDailyEnergyBalance(int a_balance, GooseSpecies a_species)
Record the daily energy balance.
virtual void TheRipleysOutputProbe(FILE *)
Does nothing, but we need it here because it automatically called by the Population_Manager if the NW...
int m_daytime
Holds the time of day. Note that sunrise is at m_daytime == 0.
void SetPolygonref(int a_polyref)
Set the landscape element ( LE ) reference number used by the Landscape class to identify this locati...
std::string GooseTypeToString(GooseSpeciesType a_gst)
Translates gst enum to string
int m_grpsize
Size of family unit if any.
void WriteHeaders(ofstream *a_file, std::vector< std::string > a_headers)
Handy function for writing headers.
void ClearGooseDailyEnergyBudgetStats()
Clear simple stats for daily energy budget in the population.
bool GetHabitatType(void)
Returns whether the current crop is a cereal.
A class to describe the goose base.
void GooseIndLocCountOutput()
Outputs simple stats for the number of forage locations visited per goose.
Goose_Population_Manager * m_GPM
Goose_Population_Manager pointer.
MapErrorMsg * g_msg
This pointer provides access the to the internal ALMaSS error message system.
bool m_family
is part of a family
void GooseHabitatUseFieldObsOutput()
Outputs simple stats for the goose habitat use but using rules to mimic field observations.
bool m_PinkfootSeason
Flag to indicate if we are in the pinkfoot hunting season?
int m_daylightleft
Number of daylight minutes left.
Goose_Population_Manager * m_OurPopulationManager
This is a time saving pointer to the correct population manager object.
virtual void CloseTheRipleysOutputProbe()
Does nothing, but we need it here because it automatically called by the Population_Manager if the NW...
void WriteConfig()
Writes a file the values of the config variables used.
void RecordState()
Record the state.
virtual void DoFirst(void)
Things to do before anything else at the start of a timestep.
int GetMaxBirdsPresent()
Sum of the maximum of all geese present (this may not be the same as the real maximum)
void GooseFieldForageInfoOutput()
Produces output to a standard file describing the energetic state of all individuals of the goose pop...
void RemoveGeeseFromForageLocation(GooseSpeciesType a_type, int a_index, int a_number)
Removes a goose or geese to the forage location - requires an index.
void GooseLeaveReasonStatOutput()
Outputs simple stats for the reasons for leaving the simulation.
std::string LeaveReasonToString(TTypeOfLeaveReason a_leave_reason)
Translates tolr enum to string
int GetBirds(GooseSpeciesType a_type)
Get how many birds of a type.
std::string GooseToString(GooseSpecies a_gs)
Translates gs enum to string
void RemoveMaxForageKj(double a_forage, TTypeOfMaxIntakeSource a_maxintakesource, int m_myForageIndex)
Removes the forage eaten from the field.
bool InPinkfootSeason()
Are we in the pinkfoot hunting season?
SimpleStatistics m_DailyEnergyBalanceStats[gs_foobar]
Statistics for the daily energy balance in the population.
void ResetGrazing()
Sets grazed biomass to zero.
double GetDistToClosestRoost(int a_x, int a_y, unsigned a_type)
Returns the distance in to the nearest roost of a_type in meters.
virtual void Init(void)
Called upon initialization of the simulation. Sets up output files.
int BirdsToShootAtPoly(int a_poly)
Returns the number of birds at a forage location - given by a poly ref.
double m_area
The area of feeding location.
void SetMaizeDensity(double a_density)
Sets maize forage density (kJ/m2)
ofstream * m_GooseGitVersionFile
Pointer to an output file for almass version.
SimpleStatistics m_FlightDistanceStats[gs_foobar]
Statistics for the flight distances in the population.
void ObservedOpennessQuery()
Writes a file with the openness scores on places where geese have been observed in the field.
double m_grazingrate[gs_foobar]
The grazing intake rate in kJ/min.
The class for goose hunters encompsassing all their specific behaviours.
int m_BirdsPresent[gst_foobar]
An array holding the number of geese of different type i.e. Pinkfoot families, juvs,...
void AddGeese(GooseSpeciesType a_type, int a_number)
Adds geese to the location.
double GetForageRateDensity(double a_foragedensity)
Get the forage intake rate for a forage density.
void SetGrazing(int gs, double a_density)
Sets forage density (kJ/m2)
int m_HabitatUseStats[gs_foobar *tomis_foobar]
Data for the habitat use.
virtual void DoImmigration()
Controls immigration to the Danish simulation area.
virtual void DoLast()
Things to do after the EndStep.
void RemoveMaizeKJ(double a_kJ)
Removes maize from the field as kJ.
std::vector< roostlist > m_roosts
The list of roosts
virtual void DoEmigration()
Controls emigration from the Danish simulation area.
void Graze(double a_kJ)
Records forage removed as kJ from the field as grams.