Goose Management Model ODdox  1.02
Goose_Base Class Reference

A class to describe the goose base. More...

#include <Goose_Base.h>

Public Member Functions

void AddBodyCondition (double a_condition)
 Alters body conditon by addition of a double value. More...
 
double AdjustIntakeRateToSnowDepth (double a_intakerate)
 When there is snow, the intake rate is decreased by 10 % per cm of snow. More...
 
virtual void BeginStep (void)
 The BeginStep is the first 'part' of the timestep that an animal can behave in. It is called once per timestep (10 minutes). More...
 
virtual void ChangeRoost ()
 Find the closest roost. More...
 
virtual APoint ChooseHopLoc ()
 Pick a hop location point within a_dist meters - must be overridden by descendent classes. More...
 
virtual void EndStep (void)
 The EndStep is the third 'part' of the timestep that an animal can behave in. It is called once per timestep. More...
 
void EvaluateForageToHopLoc (APoint a_HopLoc)
 Do a forage evaluation from current location to a_HopLoc. More...
 
void Explore ()
 Behavioural exploration of the area to find forage. More...
 
double GetBodyCondition ()
 Returns the current body condition. More...
 
double GetDailyEnergyBudget ()
 Returns the daily energy budget. More...
 
double GetDailyEnergyExpenditure ()
 Returns the daily energy expenditure. More...
 
double GetFlightCost ()
 Get the flight costs per m per g. More...
 
int GetFlightDistance ()
 Returns the total daily distance flown. More...
 
int GetFlightNumber ()
 Returns the total daily number of flights. More...
 
int GetForageLocIndex ()
 Gets for the forage location index. More...
 
int GetForagingTime (int a_EndForagingTime, double a_RoostLeaveTime)
 Returns the time spent foraging. More...
 
double GetGooseMinForageRate (GooseSpecies a_species)
 Returns the minimum forage rate for the species. More...
 
int GetGroupsize ()
 Returns the groupsize. More...
 
int GetMaxAppetiteHitTime ()
 Returns m_DailyMaxAppetiteHitTime. More...
 
double GetMaxForageRate (double a_grain, double a_maize, double a_grass, double a_interferenceComp, bool a_iscereal, TTypesOfVegetation a_veg, bool a_stubble, TTypesOfVegetation a_prevcrop)
 Returns the max forage rate of the three different types of forage The max rate is adjusted according to feeding time in the time budget, according to the interference competition value and to the current snow depth in the landscape. More...
 
double GetMaxIntakeRate (double a_grain, double a_maize, double a_grass)
 Returns the max intake rate of the three different types of intake. More...
 
TMaxIntakeSource GetMaxIntakeSource ()
 Supply the current max intake source. More...
 
APoint GetRoost ()
 Supply roost coords. More...
 
double GetRoostLeaveTime ()
 Returns the time when the goose leaves the roost. More...
 
bool GetSex ()
 Returns the sex. More...
 
GooseSpecies GetSpecies ()
 Returns the species. More...
 
double GetTotalWeight ()
 Returns the weight of the bird. More...
 
 Goose_Base (Landscape *p_L, Goose_Population_Manager *p_NPM, double a_weight, bool a_sex, APoint a_roost)
 Goose_Base constructor. More...
 
void Init (Goose_Population_Manager *p_NPM, double a_weight, bool a_sex, APoint a_roost)
 Intitialise object. More...
 
virtual void KillThis ()
 The bird is dead of some external cause. More...
 
void On_Bang (int a_polyid)
 The goose is scared by a bang at location. More...
 
void On_Bang (int a_polyid, double a_scare)
 The goose is scared by a bang at location. More...
 
virtual void On_Emigrate ()
 Cause the bird to immediately transition to Emigrate. More...
 
void On_Migrate (TTypeOfLeaveReason a_leavereason)
 The goose is told to leave the simulation area (poss due to bad weather) More...
 
void On_MoveTo (int a_x, int a_y)
 The goose is moved to the location specified by a_x, a_y - caused by group decision. More...
 
void ReInit (Landscape *p_L, Goose_Population_Manager *p_NPM, double a_weight, bool a_sex, APoint a_roost)
 ReInit for object pool. More...
 
double ScaleForageToGroupsize (double a_forage)
 Scales forage to groupsize. More...
 
void Set_GooseFattoKJConversion (double a_cost)
 Set the fat to kJ conversion constant for all geese. More...
 
void Set_GooseFieldForageDist (double sp1, double sp2, double sp3)
 Set the max forage distance from a field for all geese. More...
 
void Set_GooseFollowingLikelyhood (int a_likelyhood, GooseSpeciesType a_speciestype)
 Set the followinglikelyhood. More...
 
void Set_GooseForageDist (double sp1, double sp2, double sp3)
 Set the max forage distance from roost for all geese. More...
 
void Set_GooseKJtoFatConversion (double a_cost)
 Set the kJ to fat conversion constant for all geese. More...
 
void Set_GooseLeavingRoost (bool a_leaving)
 Set the flag to indicate if we are coming from the roost. More...
 
void Set_GooseLeavingThreshold (double a_threshold)
 Set the body condition threshold for leaving for all geese. More...
 
void Set_GooseMaxAppetiteScaler (double a_cost)
 Set the goose appetite scale used to calculate max intake for all geese. More...
 
void Set_GooseMaxEnergyReserveProportion (double a_prop)
 Set the maximum energy reserve proportion allowed for all geese. More...
 
void Set_GooseMinForageOpenness (double a_cost)
 Set the min forage openess for all geese. More...
 
void Set_Indivmingooseforagerate (double a_cost)
 Set the mimimum tolerated forage rate for the individual goose. More...
 
void Set_mingooseforagerate (double a_cost, GooseSpecies a_species)
 Set the mimimum tolerated forage rate for all geese. More...
 
void SetBodyCondition (double a_condition, unsigned a_index)
 Sets the current body condition. More...
 
void SetFlightCost (double a_cost)
 Set the flight cost per m per g. More...
 
void SetSex (bool a_sex)
 Sets the sex. More...
 
void st_Dying (void)
 Behavioural state dying. More...
 
TTypeOfGoose_BaseState st_Forage ()
 Behavioural forage. More...
 
TTypeOfGoose_BaseState st_Roost ()
 Roosting until next forage or next morning. More...
 
virtual TTypeOfGoose_BaseState st_ToRoost ()
 Return to roost and assess whether to forage again that day. More...
 
virtual void StartDay (void)
 Do any 'housekeeping' associated with the start of day. More...
 
virtual void Step (void)
 The Step is the second 'part' of the timestep that an animal can behave in. It is called continuously until all animals report that they are 'DONE'. More...
 
void SubtractBodyCondition (double a_condition)
 Alters body conditon by subtraction of a double value. More...
 
virtual ~Goose_Base ()
 Goose_Base destructor. More...
 

Protected Member Functions

void FlyTo (APoint a_pt)
 The goose flys to the location specified by a_pt. More...
 
void FlyTo (int a_x, int a_y)
 The goose flys to the location specified by a_x, a_y. More...
 
TTypeOfGoose_BaseState st_ChooseForageLocation (void)
 Selects a forage location based on past memory, or initiates an exploration. More...
 

Protected Attributes

TTypeOfGoose_BaseState CurrentGState
 Variable to record current behavioural state. More...
 
double m_BMR
 The daily BMR. More...
 
double m_BodyCondition [5]
 A variable describing current body condition over the past 5 days. More...
 
unsigned m_BodyConditionCounter
 A counter for the daily body condition. More...
 
double m_DailyMaxAppetite
 The daily max kJ possible to get as intake. More...
 
int m_DailyMaxAppetiteHitTime
 The time of day when m_DailyMaxAppetite was hit. More...
 
double m_DEB
 The daily energy budget excluding flying (kJ) More...
 
double m_energyReserve
 The bird's energy reserves in grams. More...
 
double m_energyToday
 The bird's daily energy account (kJ) More...
 
int m_FlightDistance
 Storage for the total distance flown per day. More...
 
int m_FlightNumber
 Counter for the number of flights per day. More...
 
int m_forageLocCount
 The number of forage locations visited today. More...
 
int m_groupsize
 The size of the group this bird represents. More...
 
double m_Indivmingooseforagerate
 The minimum tolerable forage rate in kJ/minute for the individual. More...
 
double m_LeaveRoostTime
 Controls the time when the goose will leave the roost. More...
 
bool m_LeavingRoost
 Flag to indicate that we are coming from the roost. Used to control code for "following". More...
 
TMaxIntakeSource m_MaxIntakeSource
 Holds information about the food source which gave max intake rate. More...
 
int m_myForageIndex
 Temporary storage for a forage location index - this is a speed optimisation. More...
 
GooseSpeciesType m_myGooseSpeciesType
 Holds the goose species type. More...
 
GooseMemoryMapm_MyMemory
 The Goose Memory. More...
 
int m_myMemPolyID
 Temporary storage for a memory location polygon id. More...
 
APoint m_MyRoost
 The current roost location. More...
 
GooseSpecies m_myspecies
 Holds goose species. More...
 
Goose_Population_Managerm_OurPopulationManager
 This is a time saving pointer to the correct population manager object. More...
 
bool m_sex
 Sex of bird, true = male false = female. More...
 
double m_TheBodyCondition
 A variable describing current body condition averaged over 5 days. More...
 
double m_weight
 The weight of the bird in gram excluding fat reserve. More...
 
double m_weightTotal
 The weight of the bird in g including fat reserve. More...
 

Static Protected Attributes

static double m_flightcost = -1
 The cost of flight per g per m in kJ. More...
 
static int m_followinglikelyhood [(int) gst_foobar] = { -1, -1, -1 , -1, -1, -1 }
 An attribute used to determine the chance of following or exploring when foraging. More...
 
static double m_GooseFattoKJConversion = -1
 Conversion rate fat to kJ. More...
 
static double m_GooseFieldForageDist [gs_foobar] = { -1, -1, -1 }
 The maximum distance travelled from roost to forage sites for each species of goose (m) More...
 
static double m_GooseFieldForageDistX2 [gs_foobar] = { -1, -1, -1 }
 Double the maximum distance travelled from roost to forage sites for each species of goose (m) - this is a speed optimisation. More...
 
static double m_GooseForageDist [gs_foobar] = { -1, -1, -1 }
 The maximum distance travelled from roost to forage sites for each species of goose (m) More...
 
static double m_GooseForageDistX2 [gs_foobar] = { -1, -1, -1 }
 Double the maximum distance travelled from roost to forage sites for each species of goose (m) - this is a speed optimisation. More...
 
static double m_GooseKJtoFatConversion = -1
 Conversion rate kJ to fat. More...
 
static double m_GooseLeavingThreshold = -1
 The trigger for leaving as a 5 day average of body condition. More...
 
static double m_GooseMaxAppetiteScaler = -1
 Scaler to determine the max kJ possible to eat per day based on non-energy reserve weight. More...
 
static double m_GooseMaxEnergyReserveProportion = -1
 Max proportion of weight that can be energy reserve. More...
 
static double m_GooseMinForageOpenness = -1
 The minimum openness value a goose will tolerate for forage. More...
 
static double m_mingooseforagerate [gs_foobar] = { -1, -1, -1 }
 The minimum tolerable forage rate in kJ/minute for the species. More...
 
static double m_SnowDepth = 0.0
 The current snow depth. Held here for speed optimization. More...
 

Detailed Description

A class to describe the goose base.

Definition at line 131 of file Goose_Base.h.

Constructor & Destructor Documentation

◆ Goose_Base()

Goose_Base::Goose_Base ( Landscape p_L,
Goose_Population_Manager p_NPM,
double  a_weight,
bool  a_sex,
APoint  a_roost 
)

Goose_Base constructor.

Definition at line 163 of file Goose_Base.cpp.

163  : TAnimal(0, 0, p_L)
164 {
165  Init(p_NPM, a_weight, a_sex, a_roost);
166 }

References Init().

◆ ~Goose_Base()

Goose_Base::~Goose_Base ( void  )
virtual

Goose_Base destructor.

Definition at line 176 of file Goose_Base.cpp.

177 {
178  if (m_MyMemory!=NULL) delete m_MyMemory;
179 }

References m_MyMemory.

Member Function Documentation

◆ AddBodyCondition()

void Goose_Base::AddBodyCondition ( double  a_condition)
inline

Alters body conditon by addition of a double value.

Definition at line 402 of file Goose_Base.h.

402 { m_TheBodyCondition += a_condition; }

References m_TheBodyCondition.

Referenced by StartDay().

◆ AdjustIntakeRateToSnowDepth()

double Goose_Base::AdjustIntakeRateToSnowDepth ( double  a_intakerate)

When there is snow, the intake rate is decreased by 10 % per cm of snow.

Definition at line 730 of file Goose_Base.cpp.

730  {
731  if (m_SnowDepth > 0.0) {
732  a_intakerate = a_intakerate * (1 - (m_SnowDepth * cfg_goose_snow_scaler.value()));
733  }
734  return a_intakerate;
735 }

References cfg_goose_snow_scaler, m_SnowDepth, and CfgFloat::value().

Referenced by GetMaxForageRate().

◆ BeginStep()

virtual void Goose_Base::BeginStep ( void  )
inlinevirtual

The BeginStep is the first 'part' of the timestep that an animal can behave in. It is called once per timestep (10 minutes).

Definition at line 375 of file Goose_Base.h.

375 { StartDay(); }

References StartDay().

◆ ChangeRoost()

virtual void Goose_Base::ChangeRoost ( )
inlinevirtual

Find the closest roost.

Reimplemented in Goose_Barnacle_Base, Goose_Greylag_Base, and Goose_Pinkfoot_Base.

Definition at line 355 of file Goose_Base.h.

355 { ; }

◆ ChooseHopLoc()

virtual APoint Goose_Base::ChooseHopLoc ( )
inlinevirtual

Pick a hop location point within a_dist meters - must be overridden by descendent classes.

Reimplemented in Goose_Barnacle_Base, Goose_Greylag_Base, and Goose_Pinkfoot_Base.

Definition at line 363 of file Goose_Base.h.

363 { return m_MyRoost; }

References m_MyRoost.

Referenced by Explore().

◆ EndStep()

virtual void Goose_Base::EndStep ( void  )
inlinevirtual

The EndStep is the third 'part' of the timestep that an animal can behave in. It is called once per timestep.

Reimplemented in Goose_Greylag_FamilyGroup, Goose_Barnacle_FamilyGroup, and Goose_Pinkfoot_FamilyGroup.

Definition at line 383 of file Goose_Base.h.

383 {} // NB this is not used in the Goose_Base code

◆ EvaluateForageToHopLoc()

void Goose_Base::EvaluateForageToHopLoc ( APoint  a_HopLoc)

Do a forage evaluation from current location to a_HopLoc.

Moves along the vector between the current location and a_HopLoc testing forage for each polygon encountered along the way. This will build up the goose' memory.

Parameters
[in]a_HopLocA point in the landscape.

Definition at line 593 of file Goose_Base.cpp.

594 {
595  double dx = a_HopLoc.m_x - m_Location_x;
596  double dy = a_HopLoc.m_y - m_Location_y;
597  int dist = g_AlmassMathFuncs.CalcDistPythagoras( a_HopLoc.m_x, a_HopLoc.m_y, m_Location_x, m_Location_y );
598  double tx = m_Location_x;
599  double ty = m_Location_y;
600  // We are looking for big things, so no need to move at 1m steps
601  double ddx = (dx/dist)*100;
602  double ddy = (dy/dist)*100;
603  int lastpoly = m_OurLandscape->SupplyPolyRef(m_Location_x, m_Location_y);
604  for (int d=0; d<dist/100; d++)
605  {
606  tx += ddx;
607  ty += ddy;
608  if (m_OurLandscape->SupplyPolyRef((int)tx, (int)ty) != lastpoly)
609  {
610  lastpoly = m_OurLandscape->SupplyPolyRef((int)tx, (int)ty);
611  int openness = (int)m_OurLandscape->SupplyOpenness(lastpoly); // Score calculated by Landscape::CaclulateOpenness
612  if (openness >= m_GooseMinForageOpenness)
613  {
614  GooseMemoryLocation aThought;
615  double grain = m_OurLandscape->SupplyBirdSeedForage(lastpoly); // grain/m2
616  double maize = m_OurLandscape->SupplyBirdMaizeForage(lastpoly); // kJ/m2
617  aThought.m_grain = m_OurPopulationManager->GetFeedingRate(grain, m_myspecies); // kJ/min
618  aThought.m_maize = m_OurPopulationManager->GetMaizeFeedingRate(maize, m_myspecies); // kJ/min
619  aThought.m_grazing = m_OurLandscape->GetActualGooseGrazingForage(lastpoly, m_myspecies); // kJ/min
620  aThought.m_foodresource = GetMaxIntakeRate(aThought.m_grain, aThought.m_maize, aThought.m_grazing);
621  if (aThought.m_foodresource > 0) // don't remember poor food locations
622  {
623  aThought.m_polygonid = lastpoly;
624  aThought.m_x = m_OurLandscape->SupplyCentroidX(lastpoly);
625  aThought.m_y = m_OurLandscape->SupplyCentroidY(lastpoly);
626  aThought.m_threat = 0;
627  int the_dist = g_AlmassMathFuncs.CalcDistPythagorasApprox(m_MyRoost.m_x, m_MyRoost.m_y, aThought.m_x, aThought.m_y);
628  aThought.m_score = m_MyMemory->CalcScore(the_dist, aThought.m_foodresource, aThought.m_threat);
629  m_MyMemory->MemAdd(aThought);
630  }
631  }
632  }
633  }
634 
635 }

References ALMaSS_MathFuncs::CalcDistPythagoras(), ALMaSS_MathFuncs::CalcDistPythagorasApprox(), GooseMemoryMap::CalcScore(), g_AlmassMathFuncs, Goose_Population_Manager::GetFeedingRate(), Goose_Population_Manager::GetMaizeFeedingRate(), GetMaxIntakeRate(), GooseMemoryLocation::m_foodresource, m_GooseMinForageOpenness, GooseMemoryLocation::m_grain, GooseMemoryLocation::m_grazing, GooseMemoryLocation::m_maize, m_MyMemory, m_MyRoost, m_myspecies, m_OurPopulationManager, GooseMemoryLocation::m_polygonid, GooseMemoryLocation::m_score, GooseMemoryLocation::m_threat, GooseMemoryLocation::m_x, GooseMemoryLocation::m_y, and GooseMemoryMap::MemAdd().

Referenced by Goose_Barnacle_Base::ChooseHopLoc(), Goose_Pinkfoot_Base::ChooseHopLoc(), and Goose_Greylag_Base::ChooseHopLoc().

◆ Explore()

void Goose_Base::Explore ( )

Behavioural exploration of the area to find forage.

This behaviour can be invoked either from the roost or from another location. If from another location then there is an initial move followed by an exploration of the area directly on route to the chosen location. If from the roost then a distance and direction is chosen for the explore. In both cases the movement has energetic costs associated with the flight.

Definition at line 571 of file Goose_Base.cpp.

572 {
579  APoint HopLoc;
580  for (int i = 0; i < 1; i++)
581  {
582  HopLoc = ChooseHopLoc(); // The distance moved is dependent on the species and this is controlled by the inherited ChooseHopLoc code.
583  }
584  FlyTo( HopLoc );
585 }

References ChooseHopLoc(), and FlyTo().

Referenced by st_ChooseForageLocation().

◆ FlyTo() [1/2]

void Goose_Base::FlyTo ( APoint  a_pt)
protected

The goose flys to the location specified by a_pt.

Definition at line 403 of file Goose_Base.cpp.

404 {
405  FlyTo(a_pt.m_x,a_pt.m_y);
406 }

References FlyTo().

◆ FlyTo() [2/2]

void Goose_Base::FlyTo ( int  a_x,
int  a_y 
)
protected

The goose flys to the location specified by a_x, a_y.

Moves the bird from m_Location_x,m_Location_y to a_x,a_y. Assumes that the cost of flight is directly proportional to the distance x bird weight. The cost is calcuated and removed from the energy reserve. To save some calculation costs (sqrt is expensive in time) we use an approximation to Pythagorus accurate to around 6%. m_weightTotal is in grams and m_flightcost the cost of moving 1 gram per m, all distances in meters. NB all flying trips are assumed to take 10 minutes but the energy used is determined by the distance.

and sets the new location

and finally store the information about flight number and distance

Definition at line 409 of file Goose_Base.cpp.

410 {
419  if ((m_Location_x == a_x) && (m_Location_y == a_y)) return;
420  int dist = g_AlmassMathFuncs.CalcDistPythagorasApprox( m_Location_x, m_Location_y, a_x, a_y );
421  double cost = dist * GetFlightCost();
422  m_energyToday-=cost;
424  m_Location_x = a_x;
425  m_Location_y = a_y;
427  m_FlightNumber++;
428  m_FlightDistance += dist;
429 
430 }

References ALMaSS_MathFuncs::CalcDistPythagorasApprox(), g_AlmassMathFuncs, GetFlightCost(), m_energyToday, m_FlightDistance, and m_FlightNumber.

Referenced by Explore(), FlyTo(), On_MoveTo(), st_ChooseForageLocation(), Goose_Greylag_Base::st_ToRoost(), Goose_Pinkfoot_Base::st_ToRoost(), and Goose_Barnacle_Base::st_ToRoost().

◆ GetBodyCondition()

double Goose_Base::GetBodyCondition ( )
inline

Returns the current body condition.

Definition at line 394 of file Goose_Base.h.

394 { return m_TheBodyCondition; }

References m_TheBodyCondition.

◆ GetDailyEnergyBudget()

double Goose_Base::GetDailyEnergyBudget ( )
inline

Returns the daily energy budget.

Definition at line 450 of file Goose_Base.h.

450  {
451  return m_DEB;
452  }

References m_DEB.

◆ GetDailyEnergyExpenditure()

double Goose_Base::GetDailyEnergyExpenditure ( )
inline

Returns the daily energy expenditure.

Definition at line 456 of file Goose_Base.h.

456  {
457  return m_energyToday;
458  }

References m_energyToday.

◆ GetFlightCost()

double Goose_Base::GetFlightCost ( )
inline

Get the flight costs per m per g.

Definition at line 568 of file Goose_Base.h.

568  {
569  return m_flightcost * m_weightTotal;
570  }

References m_flightcost, and m_weightTotal.

Referenced by FlyTo().

◆ GetFlightDistance()

int Goose_Base::GetFlightDistance ( )
inline

Returns the total daily distance flown.

Definition at line 444 of file Goose_Base.h.

444  {
445  return m_FlightDistance;
446  }

References m_FlightDistance.

◆ GetFlightNumber()

int Goose_Base::GetFlightNumber ( )
inline

Returns the total daily number of flights.

Definition at line 438 of file Goose_Base.h.

438  {
439  return m_FlightNumber;
440  }

References m_FlightNumber.

◆ GetForageLocIndex()

int Goose_Base::GetForageLocIndex ( )
inline

Gets for the forage location index.

Definition at line 418 of file Goose_Base.h.

418 { return m_myForageIndex; }

References m_myForageIndex.

Referenced by Goose_Population_Manager::GetLeader(), and st_ChooseForageLocation().

◆ GetForagingTime()

int Goose_Base::GetForagingTime ( int  a_EndForagingTime,
double  a_RoostLeaveTime 
)

Returns the time spent foraging.

Parameters
[in]a_EndForagingTimeThe time of day where a goose hits it's daily max intake
[in]a_RoostLeaveTimeThe time of day where a goose leaves the roost
Returns
The difference between roost leave time and end foraging time

Definition at line 738 of file Goose_Base.cpp.

739 {
740  int foraging_time = -1;
741  int day_length = m_OurLandscape->SupplyDaylength();
742  int roost_leave_time = (int)a_RoostLeaveTime;
743  if (roost_leave_time < 0) {
744  roost_leave_time = 0;
745  }
746  // If they never hit their daily max, they are assigned 1440.
747  if (a_EndForagingTime == 1440)
748  {
749  foraging_time = day_length - roost_leave_time;
750  }
751  else
752  {
753  foraging_time = a_EndForagingTime - roost_leave_time;
754  }
755  if (foraging_time == -1)
756  {
757  m_OurLandscape->Warn("Goose_Base::CalcForagingTime()","error in foraging time calculation");
758  exit(0);
759  }
760  return foraging_time;
761 }

Referenced by StartDay().

◆ GetGooseMinForageRate()

double Goose_Base::GetGooseMinForageRate ( GooseSpecies  a_species)
inline

Returns the minimum forage rate for the species.

Parameters
[in]a_speciesThe type of goose species
Returns
The minimum forage rate the goose will accept.

Definition at line 471 of file Goose_Base.h.

472  {
473  return m_mingooseforagerate[a_species];
474  }

References m_mingooseforagerate.

Referenced by st_Forage().

◆ GetGroupsize()

int Goose_Base::GetGroupsize ( )
inline

Returns the groupsize.

Definition at line 410 of file Goose_Base.h.

410 { return m_groupsize; }

References m_groupsize.

Referenced by Goose_Population_Manager::DoLast().

◆ GetMaxAppetiteHitTime()

int Goose_Base::GetMaxAppetiteHitTime ( )
inline

Returns m_DailyMaxAppetiteHitTime.

Definition at line 432 of file Goose_Base.h.

432  {
434  }

References m_DailyMaxAppetiteHitTime.

◆ GetMaxForageRate()

double Goose_Base::GetMaxForageRate ( double  a_grain,
double  a_maize,
double  a_grass,
double  a_interferenceComp,
bool  a_iscereal,
TTypesOfVegetation  a_veg,
bool  a_stubble,
TTypesOfVegetation  a_prevcrop 
)
inline

Returns the max forage rate of the three different types of forage The max rate is adjusted according to feeding time in the time budget, according to the interference competition value and to the current snow depth in the landscape.

Parameters
[in]a_grainThe intake rate from the grain resource
[in]a_maizeThe intake rate from the maize resource
[in]a_grassThe intake rate from the grazing resource
[in]a_interferenceCompThe scaler for interference competition
[in]a_iscerealFlag for a cereal crop or not (false)
[in]a_vegThe vegetation type
[in]a_stubbleFlag for a crop in stubble or not (false)
[in]a_prevcropThe previously sown crop
Returns
The max forage rate scaled to time budget and interference competetion

Definition at line 489 of file Goose_Base.h.

489  {
490  double MaxRate = 0.0;
491  if (a_grain > MaxRate) {
492  MaxRate = a_grain;
494  }
495  else if (a_maize > MaxRate) {
496  MaxRate = a_maize;
498  }
499  else if (a_grass > MaxRate) {
500  MaxRate = a_grass;
502  }
503  else
504  {
505  MaxRate = 0;
507  }
508  MaxRate *= a_interferenceComp;
509  MaxRate = AdjustIntakeRateToSnowDepth(MaxRate);
510  m_MaxIntakeSource.m_iscereal = a_iscereal;
511  m_MaxIntakeSource.m_instubble = a_stubble;
512  m_MaxIntakeSource.m_veg = a_veg;
513  m_MaxIntakeSource.m_prevsowncrop = a_prevcrop;
514  /**** CJT DEBUG ****
515  if ((a_stubble) && (!a_iscereal) && (m_MaxIntakeSource.m_maxintakesource == tomis_grain))
516  {
517  g_msg->WarnAddInfo(WARN_BUG, "Day ", m_OurLandscape->SupplyDayInYear());
518  g_msg->WarnAddInfo(WARN_BUG, "Veg ", a_veg);
519  g_msg->WarnAddInfo(WARN_BUG, "Prev Crop ", a_prevcrop);
520  g_msg->WarnAddInfo(WARN_BUG, "Grain ", a_grain);
521  g_msg->WarnAddInfo(WARN_BUG, "******** ", 0);
522  }
523  //**** END ****/
524 
525 
526  return MaxRate;
527  }

References AdjustIntakeRateToSnowDepth(), TMaxIntakeSource::m_instubble, TMaxIntakeSource::m_iscereal, TMaxIntakeSource::m_maxintakesource, m_MaxIntakeSource, TMaxIntakeSource::m_prevsowncrop, TMaxIntakeSource::m_veg, tomis_foobar, tomis_grain, tomis_grass, tomis_maize, and tomis_sowncrop.

Referenced by st_ChooseForageLocation(), and st_Forage().

◆ GetMaxIntakeRate()

double Goose_Base::GetMaxIntakeRate ( double  a_grain,
double  a_maize,
double  a_grass 
)
inline

Returns the max intake rate of the three different types of intake.

Parameters
[in]a_grainThe intake rate from the grain resource kJ/min
[in]a_maizeThe intake rate from the maize resource kJ/min
[in]a_grassThe intake rate from the grazing resource kJ/min
Returns
The max intake rate kJ/min

Definition at line 536 of file Goose_Base.h.

536  {
537  double MaxRate = 0.0;
538  if (a_grain > MaxRate) {
539  MaxRate = a_grain;
540  }
541  if (a_maize > MaxRate) {
542  MaxRate = a_maize;
543  }
544  if (a_grass > MaxRate) {
545  MaxRate = a_grass;
546  }
547  return MaxRate;
548  }

Referenced by EvaluateForageToHopLoc(), and st_ChooseForageLocation().

◆ GetMaxIntakeSource()

TMaxIntakeSource Goose_Base::GetMaxIntakeSource ( )
inline

Supply the current max intake source.

Definition at line 349 of file Goose_Base.h.

349  {
350  return m_MaxIntakeSource;
351  }

References m_MaxIntakeSource.

Referenced by Goose_Population_Manager::DoLast().

◆ GetRoost()

APoint Goose_Base::GetRoost ( )
inline

Supply roost coords.

Definition at line 345 of file Goose_Base.h.

345 { return m_MyRoost; }

References m_MyRoost.

Referenced by Goose_Population_Manager::GetLeader().

◆ GetRoostLeaveTime()

double Goose_Base::GetRoostLeaveTime ( )
inline

Returns the time when the goose leaves the roost.

Definition at line 560 of file Goose_Base.h.

560 { return m_LeaveRoostTime; }

References m_LeaveRoostTime.

◆ GetSex()

bool Goose_Base::GetSex ( )
inline

Returns the sex.

Definition at line 428 of file Goose_Base.h.

428 { return m_sex; }

References m_sex.

◆ GetSpecies()

GooseSpecies Goose_Base::GetSpecies ( )
inline

Returns the species.

Definition at line 422 of file Goose_Base.h.

422  {
423  return m_myspecies;
424  }

References m_myspecies.

Referenced by Goose_Population_Manager::DoLast().

◆ GetTotalWeight()

double Goose_Base::GetTotalWeight ( )
inline

Returns the weight of the bird.

Definition at line 558 of file Goose_Base.h.

558 {return m_weightTotal;}

References m_weightTotal.

◆ Init()

void Goose_Base::Init ( Goose_Population_Manager p_NPM,
double  a_weight,
bool  a_sex,
APoint  a_roost 
)

Intitialise object.

Assigns the pointer to the population manager.

Sets the initial state.

Sets the sex.

Sets the weight.

Todo:
Quick fix for spring migration weights

Calculates BMR

Definition at line 111 of file Goose_Base.cpp.

111  {
113  m_OurPopulationManager = p_NPM;
117  SetSex(a_sex);
119  m_weight = a_weight;
120  m_DailyMaxAppetite = 0.0;
123  int today = m_OurLandscape->SupplyDayInYear();
125  m_energyReserve = m_weight * 0.22;
126  }
129  m_BMR = pow(m_weightTotal / 1000, cfg_goose_BMRconstant2.value())*cfg_goose_BMRconstant1.value(); // BMR is used to scale other energetic costs on a daily basis
130  m_energyToday = 0.0;
132  m_TheBodyCondition = 0.0;
133  for (unsigned i = 0; i < 5; i++)
134  {
135  double condition = m_weightTotal / m_weight; // total weight divided by lean weight.
136  SetBodyCondition(condition, i);
138  }
139  m_LeaveRoostTime = 0; // intialisation
140  m_myForageIndex = -1; // -1 signals not currently foraging
141  m_MaxIntakeSource.m_maxintakesource = tomis_foobar; // The source of the max forage intake rate has not been determined yet.
142  // Assume a default groupsize of 1, if otherwise it needs setting in descendent classes
143  m_groupsize = 1;
144  // Set the roost and location
145  m_Location_x = a_roost.m_x;
146  m_Location_y = a_roost.m_y;
147  m_MyRoost.m_x = a_roost.m_x;
148  m_MyRoost.m_y = a_roost.m_y;
149 
150  // Any other intialisation will be done by descendent class constructors
151  m_MyMemory = new GooseMemoryMap(this);
152  // the species must be reset by the goose constructor
153  m_myspecies = gs_foobar;
154  // Must calculate the DEB now or risk use of an undefined m_DEB in StartDay
155  m_DEB = 0;
156  // Set the individual minimum forage rate acceptable. Overwritten later in StartDay
158  m_FlightNumber = 0;
159  m_FlightDistance = 0;
160  m_forageLocCount = 0;
161 }

References cfg_goose_BMRconstant1, cfg_goose_BMRconstant2, cfg_goose_InitialEnergyReserveProportion, cfg_goose_pf_springmigdateend, cfg_goose_pf_springmigdatestart, togs_InitialState, tomis_foobar, CfgInt::value(), and CfgFloat::value().

Referenced by Goose_Base(), Goose_Pinkfoot_Base::Init(), Goose_Greylag_Base::Init(), Goose_Barnacle_Base::Init(), and ReInit().

◆ KillThis()

void Goose_Base::KillThis ( void  )
virtual

The bird is dead of some external cause.

Kill this for single animal agents is straightforward. We need to remove the bird from the forage area if any.

Reimplemented in Goose_Greylag_FamilyGroup, Goose_Barnacle_FamilyGroup, and Goose_Pinkfoot_FamilyGroup.

Definition at line 703 of file Goose_Base.cpp.

704 {
708  if (m_myForageIndex != -1)
709  {
711  }
712  TAnimal::KillThis(); // Sets CurrentStateNo to -1, and StepDone to true
713 }

References m_myForageIndex, m_myGooseSpeciesType, m_OurPopulationManager, and Goose_Population_Manager::RemoveGeeseFromForageLocation().

◆ On_Bang() [1/2]

void Goose_Base::On_Bang ( int  a_polyid)

The goose is scared by a bang at location.

The goose has heard a shot. It remembers the location the shot came from as bad and flies away to find another place to forage. This version assumes the scare value is a constant 1.0. The first test is because the shot might have killed it already!

Parameters
[in]a_polyidThe polygon id from where the shot was fired.

We have been scared off, so we the correct number of geese at that location before we fly off to find a new forage location

Definition at line 638 of file Goose_Base.cpp.

639 {
646  if (m_CurrentStateNo == -1) return;
647  if (!m_MyMemory->ChangeAddThreat(a_polyid, 1.0))
648  {
649  GooseMemoryLocation aThought;
650  aThought.m_polygonid = a_polyid;
651  aThought.m_x = m_OurLandscape->SupplyCentroidX(a_polyid);
652  aThought.m_y = m_OurLandscape->SupplyCentroidY(a_polyid);
653  aThought.m_threat = 1;
654  int dist = g_AlmassMathFuncs.CalcDistPythagorasApprox( m_MyRoost.m_x, m_MyRoost.m_y, aThought.m_x, aThought.m_y );
655  aThought.m_score = m_MyMemory->CalcScore( dist, aThought.m_foodresource, aThought.m_threat );
656  m_MyMemory->MemAdd(aThought);
657  }
661  if (m_myForageIndex != -1)
662  {
664  }
665  m_myForageIndex = -1;
667 }

References ALMaSS_MathFuncs::CalcDistPythagorasApprox(), GooseMemoryMap::CalcScore(), GooseMemoryMap::ChangeAddThreat(), CurrentGState, g_AlmassMathFuncs, GooseMemoryLocation::m_foodresource, m_groupsize, m_myForageIndex, m_myGooseSpeciesType, m_MyMemory, m_MyRoost, m_OurPopulationManager, GooseMemoryLocation::m_polygonid, GooseMemoryLocation::m_score, GooseMemoryLocation::m_threat, GooseMemoryLocation::m_x, GooseMemoryLocation::m_y, GooseMemoryMap::MemAdd(), Goose_Population_Manager::RemoveGeeseFromForageLocation(), and st_ChooseForageLocation().

Referenced by Goose_Population_Manager::BangAtPoly().

◆ On_Bang() [2/2]

void Goose_Base::On_Bang ( int  a_polyid,
double  a_scare 
)

The goose is scared by a bang at location.

The goose has heard a shot. It remembers the location the shot came from as bad and flies away to find another place to forage. This version allows a variable scare value to be remembered. The first test is because the shot might have killed it already!

Parameters
[in]a_polyidThe polygon id from where the shot was fired.
[in]a_scareThe scare value.

We have been scared off, so we the correct number of geese at that location before we fly off to find a new forage location

Definition at line 670 of file Goose_Base.cpp.

671 {
679  if (m_CurrentStateNo == -1) return;
680  if (!m_MyMemory->ChangeAddThreat(a_polyid, a_scare))
681  {
682  GooseMemoryLocation aThought;
683  aThought.m_polygonid = a_polyid;
684  aThought.m_x = m_OurLandscape->SupplyCentroidX(a_polyid);
685  aThought.m_y = m_OurLandscape->SupplyCentroidY(a_polyid);
686  aThought.m_threat = a_scare;
687  int dist = g_AlmassMathFuncs.CalcDistPythagorasApprox( m_MyRoost.m_x, m_MyRoost.m_y, aThought.m_x, aThought.m_y );
688  aThought.m_score = m_MyMemory->CalcScore( dist, aThought.m_foodresource, aThought.m_threat );
689  m_MyMemory->MemAdd(aThought);
690  }
694  if (m_myForageIndex != -1)
695  {
697  }
698  m_myForageIndex = -1;
700 }

References ALMaSS_MathFuncs::CalcDistPythagorasApprox(), GooseMemoryMap::CalcScore(), GooseMemoryMap::ChangeAddThreat(), CurrentGState, g_AlmassMathFuncs, GooseMemoryLocation::m_foodresource, m_groupsize, m_myForageIndex, m_myGooseSpeciesType, m_MyMemory, m_MyRoost, m_OurPopulationManager, GooseMemoryLocation::m_polygonid, GooseMemoryLocation::m_score, GooseMemoryLocation::m_threat, GooseMemoryLocation::m_x, GooseMemoryLocation::m_y, GooseMemoryMap::MemAdd(), Goose_Population_Manager::RemoveGeeseFromForageLocation(), and st_ChooseForageLocation().

◆ On_Emigrate()

virtual void Goose_Base::On_Emigrate ( )
inlinevirtual

Cause the bird to immediately transition to Emigrate.

Definition at line 387 of file Goose_Base.h.

388  {
390  }

References CurrentGState, and togs_Emigrate.

◆ On_Migrate()

void Goose_Base::On_Migrate ( TTypeOfLeaveReason  a_leavereason)

The goose is told to leave the simulation area (poss due to bad weather)

We need to migrate out of the simulation and record the reason for leaving. This is currently done by killing the bird. No birds are migrating back into the simulation.

Parameters
[in]a_leavereasonThe reason for leaving. One of the values in the enum TTypeOfLeaveReason.

Definition at line 722 of file Goose_Base.cpp.

References CurrentGState, m_myGooseSpeciesType, m_OurPopulationManager, Goose_Population_Manager::RecordLeaveReason(), and togs_Die.

Referenced by StartDay(), Goose_Barnacle_FamilyGroup::Step(), Goose_Pinkfoot_FamilyGroup::Step(), Goose_Greylag_FamilyGroup::Step(), Goose_Pinkfoot_NonBreeder::Step(), Goose_Barnacle_NonBreeder::Step(), and Goose_Greylag_NonBreeder::Step().

◆ On_MoveTo()

void Goose_Base::On_MoveTo ( int  a_x,
int  a_y 
)
inline

The goose is moved to the location specified by a_x, a_y - caused by group decision.

Definition at line 640 of file Goose_Base.h.

640 { FlyTo( a_x, a_y); }

References FlyTo().

◆ ReInit()

void Goose_Base::ReInit ( Landscape p_L,
Goose_Population_Manager p_NPM,
double  a_weight,
bool  a_sex,
APoint  a_roost 
)

ReInit for object pool.

Definition at line 168 of file Goose_Base.cpp.

168  {
169  TAnimal::ReinitialiseObject(0, 0, p_L);
170  // Assign the pointer to the population manager
171  Init(p_NPM, a_weight, a_sex, a_roost);
172 }

References Init().

Referenced by Goose_Barnacle_Base::ReInit(), Goose_Pinkfoot_Base::ReInit(), and Goose_Greylag_Base::ReInit().

◆ ScaleForageToGroupsize()

double Goose_Base::ScaleForageToGroupsize ( double  a_forage)
inline

Scales forage to groupsize.

Definition at line 414 of file Goose_Base.h.

414 { return m_groupsize * a_forage; }

References m_groupsize.

Referenced by st_Forage().

◆ Set_GooseFattoKJConversion()

void Goose_Base::Set_GooseFattoKJConversion ( double  a_cost)
inline

Set the fat to kJ conversion constant for all geese.

Definition at line 600 of file Goose_Base.h.

600 { m_GooseFattoKJConversion = a_cost; }

References m_GooseFattoKJConversion.

Referenced by Goose_Population_Manager::Goose_Population_Manager().

◆ Set_GooseFieldForageDist()

void Goose_Base::Set_GooseFieldForageDist ( double  sp1,
double  sp2,
double  sp3 
)
inline

Set the max forage distance from a field for all geese.

Definition at line 622 of file Goose_Base.h.

623  {
624  //Dist
625  m_GooseFieldForageDist[gs_Pinkfoot] = sp1;
626  m_GooseFieldForageDist[gs_Barnacle] = sp2;
627  m_GooseFieldForageDist[gs_Greylag] = sp3;
628  // DistX2
629  m_GooseFieldForageDistX2[gs_Pinkfoot] = sp1 * 2.0;
630  m_GooseFieldForageDistX2[gs_Barnacle] = sp2 * 2.0;
631  m_GooseFieldForageDistX2[gs_Greylag] = sp3 * 2.0;
632  }

References m_GooseFieldForageDist, and m_GooseFieldForageDistX2.

Referenced by Goose_Population_Manager::Goose_Population_Manager().

◆ Set_GooseFollowingLikelyhood()

void Goose_Base::Set_GooseFollowingLikelyhood ( int  a_likelyhood,
GooseSpeciesType  a_speciestype 
)
inline

Set the followinglikelyhood.

Definition at line 634 of file Goose_Base.h.

634 { m_followinglikelyhood[a_speciestype] = a_likelyhood;}

References m_followinglikelyhood.

Referenced by Goose_Population_Manager::Goose_Population_Manager().

◆ Set_GooseForageDist()

void Goose_Base::Set_GooseForageDist ( double  sp1,
double  sp2,
double  sp3 
)
inline

Set the max forage distance from roost for all geese.

Definition at line 608 of file Goose_Base.h.

609  {
610  //Dist
611  m_GooseForageDist[gs_Pinkfoot] = sp1;
612  m_GooseForageDist[gs_Barnacle] = sp2;
613  m_GooseForageDist[gs_Greylag] = sp3;
614  // DistX2
615  m_GooseForageDistX2[gs_Pinkfoot] = sp1 * 2.0;
616  m_GooseForageDistX2[gs_Barnacle] = sp2 * 2.0;
617  m_GooseForageDistX2[gs_Greylag] = sp3 * 2.0;
618  }

References m_GooseForageDist, and m_GooseForageDistX2.

Referenced by Goose_Population_Manager::Goose_Population_Manager().

◆ Set_GooseKJtoFatConversion()

void Goose_Base::Set_GooseKJtoFatConversion ( double  a_cost)
inline

Set the kJ to fat conversion constant for all geese.

Definition at line 596 of file Goose_Base.h.

596 { m_GooseKJtoFatConversion = a_cost; }

References m_GooseKJtoFatConversion.

Referenced by Goose_Population_Manager::Goose_Population_Manager().

◆ Set_GooseLeavingRoost()

void Goose_Base::Set_GooseLeavingRoost ( bool  a_leaving)
inline

Set the flag to indicate if we are coming from the roost.

Definition at line 636 of file Goose_Base.h.

636 {m_LeavingRoost = a_leaving;}

References m_LeavingRoost.

Referenced by Goose_Population_Manager::Goose_Population_Manager(), st_ChooseForageLocation(), and st_Roost().

◆ Set_GooseLeavingThreshold()

void Goose_Base::Set_GooseLeavingThreshold ( double  a_threshold)
inline

Set the body condition threshold for leaving for all geese.

Definition at line 584 of file Goose_Base.h.

584 { m_GooseLeavingThreshold = a_threshold; }

References m_GooseLeavingThreshold.

Referenced by Goose_Population_Manager::Goose_Population_Manager().

◆ Set_GooseMaxAppetiteScaler()

void Goose_Base::Set_GooseMaxAppetiteScaler ( double  a_cost)
inline

Set the goose appetite scale used to calculate max intake for all geese.

Definition at line 588 of file Goose_Base.h.

588 { m_GooseMaxAppetiteScaler = a_cost; }

References m_GooseMaxAppetiteScaler.

Referenced by Goose_Population_Manager::Goose_Population_Manager().

◆ Set_GooseMaxEnergyReserveProportion()

void Goose_Base::Set_GooseMaxEnergyReserveProportion ( double  a_prop)
inline

Set the maximum energy reserve proportion allowed for all geese.

Definition at line 592 of file Goose_Base.h.

References m_GooseMaxEnergyReserveProportion.

Referenced by Goose_Population_Manager::Goose_Population_Manager().

◆ Set_GooseMinForageOpenness()

void Goose_Base::Set_GooseMinForageOpenness ( double  a_cost)
inline

Set the min forage openess for all geese.

Definition at line 604 of file Goose_Base.h.

604 { m_GooseMinForageOpenness = a_cost; }

References m_GooseMinForageOpenness.

Referenced by Goose_Population_Manager::Goose_Population_Manager().

◆ Set_Indivmingooseforagerate()

void Goose_Base::Set_Indivmingooseforagerate ( double  a_cost)
inline

Set the mimimum tolerated forage rate for the individual goose.

Definition at line 578 of file Goose_Base.h.

578  {
579  m_Indivmingooseforagerate = a_cost;
580  }

References m_Indivmingooseforagerate.

Referenced by Goose_Population_Manager::Goose_Population_Manager(), st_Forage(), and StartDay().

◆ Set_mingooseforagerate()

void Goose_Base::Set_mingooseforagerate ( double  a_cost,
GooseSpecies  a_species 
)
inline

Set the mimimum tolerated forage rate for all geese.

Definition at line 574 of file Goose_Base.h.

574 { m_mingooseforagerate[a_species] = a_cost; }

References m_mingooseforagerate.

Referenced by Goose_Population_Manager::Goose_Population_Manager(), and StartDay().

◆ SetBodyCondition()

void Goose_Base::SetBodyCondition ( double  a_condition,
unsigned  a_index 
)
inline

Sets the current body condition.

Definition at line 398 of file Goose_Base.h.

398 { m_BodyCondition[a_index] = a_condition; }

References m_BodyCondition.

Referenced by StartDay().

◆ SetFlightCost()

void Goose_Base::SetFlightCost ( double  a_cost)
inline

Set the flight cost per m per g.

Definition at line 564 of file Goose_Base.h.

564 { m_flightcost = a_cost; }

References m_flightcost.

Referenced by Goose_Population_Manager::Goose_Population_Manager().

◆ SetSex()

void Goose_Base::SetSex ( bool  a_sex)
inline

Sets the sex.

Definition at line 552 of file Goose_Base.h.

552  {
553  m_sex = a_sex;
554  }

References m_sex.

◆ st_ChooseForageLocation()

TTypeOfGoose_BaseState Goose_Base::st_ChooseForageLocation ( void  )
protected

Selects a forage location based on past memory, or initiates an exploration.

  1. If we are following then find a good location from the main list of birds held by the population manager. If no such location is available then default to explore.

Depending on the rules in force we probably only want to follow geese from our own species, and maybe from our own roost

First searches memory for the best forage location remembered. If it finds one then it flies there and calculates the energetic cost. If no suitable memory is found then initiates an exploration.

Once the goose arrives at a forage location it needs to add itself to the geese already there, or initiate a forage location if one does not exist.

Definition at line 258 of file Goose_Base.cpp.

259 {
260  // Debugging
262  int today = m_OurLandscape->SupplyDayInYear();
263  int dtime = m_OurPopulationManager->GetDayTime();
264  int daylength = m_OurLandscape->SupplyDaylength();
265  if (dtime >= daylength + cfg_goose_AfterDarkTime.value())
266  {
267 #ifdef __DEBUG_GOOSE
268  if (m_myForageIndex != -1)
269  {
271  g_msg->Warn("Goose_Base::st_ChooseForageLocation - Removing negative geese from forage location", (double)(m_OurPopulationManager->GetBirdsAtForageLoc(m_myForageIndex, m_myGooseSpeciesType) - m_groupsize));
272  exit(0);
273  }
274  }
275 #endif
276  return togs_ToRoost;
277  }
278 
280  {
289 #ifdef __FOLLOW_FIELD
290  int index = -1;
291  int forageindex = m_OurPopulationManager->GetForageLocIndex( m_myspecies, m_Location_x, m_Location_y );
292  if (forageindex > -1) {
293  index = forageindex;
294  }
295 #endif
296 
297 #ifdef __FOLLOW_BIRD
299  if (leader != NULL) {
300  int index = leader->GetForageLocIndex();
301  }
302 #endif
303 
304  if (index > -1)
305  {
306 
308  FlyTo( m_OurLandscape->SupplyCentroid( gafl->GetPolygonref() ) );
309  Set_GooseLeavingRoost(false); // We've left the roost now, so reset
310  GooseMemoryLocation aThought;
311  int poly = gafl->GetPolygonref();
312  double grain = gafl->GetGrainDensity(); // grain/m2
313  double maize = gafl->GetMaizeDensity(); // kJ/m2
314  aThought.m_grain = m_OurPopulationManager->GetFeedingRate(grain, m_myspecies); // kJ/min
315  aThought.m_maize = m_OurPopulationManager->GetMaizeFeedingRate(maize, m_myspecies); // kJ/min
316  aThought.m_grazing = gafl->GetGrazing( (int)m_myspecies ); // kJ/min
317  aThought.m_foodresource = GetMaxIntakeRate(aThought.m_grain, aThought.m_maize, aThought.m_grazing);
318  aThought.m_polygonid = poly;
319  aThought.m_x = m_OurLandscape->SupplyCentroidX( poly );
320  aThought.m_y = m_OurLandscape->SupplyCentroidY( poly );
321  aThought.m_threat = 0;
322  int dist = g_AlmassMathFuncs.CalcDistPythagorasApprox( m_MyRoost.m_x, m_MyRoost.m_y, aThought.m_x, aThought.m_y );
323  aThought.m_score = m_MyMemory->CalcScore(dist, aThought.m_foodresource, aThought.m_threat);
324  if (!m_MyMemory->IsKnownArea( gafl->GetPolygonref() )) m_MyMemory->MemAdd( aThought );
325  // Once the goose arrives at a forage location it needs to add itself to the geese already there, or initiate a forage location if one does not exist
328  else {
329  g_msg->Warn( "TTypeOfGoose_BaseState Goose_Base::st_ChooseForageLocation() : No geese at foraging location when following", "" );
330  exit( 0 );
331  }
332  // some stats recording
334  m_myMemPolyID = aThought.m_polygonid;
335  return togs_Forage;
336  }
337  }
345  if (m_LeavingRoost) Explore(); // Go for an exploration trip to initialise the memory.
347  if (aThought.m_score<=0)
348  {
349  Explore(); // Go for an exploration trip
350  aThought = m_MyMemory->GetBestFeedingScore();
351  // Did we find anything suitable?:
352  if (aThought.m_score <= 0) {
353  // if not, start this method over again.
355  }
356  }
357  m_Location_x = aThought.m_x;
358  m_Location_y = aThought.m_y;
359  int polyref = m_OurLandscape->SupplyPolyRef(m_Location_x, m_Location_y);
360  double grazing = m_OurLandscape->GetActualGooseGrazingForage(polyref, m_myspecies); // kJ/min
361  double grain = m_OurLandscape->SupplyBirdSeedForage(polyref); // kJ/m2
362  double maize = m_OurLandscape->SupplyBirdMaizeForage(polyref); // kJ/m2
363  bool instubble = m_OurLandscape->SupplyInStubble(polyref);
364  TTypesOfVegetation veg = m_OurLandscape->SupplyVegType(polyref);
365  TTypesOfVegetation lastsowncrop = m_OurLandscape->SupplyLastSownVeg(polyref);
366  bool iscereal = m_OurLandscape->SupplyIsCereal2(lastsowncrop);
367  // Here we make a test to see if the forage location is in use before going further
369  // Here we do the forage calculation.The intake rate depends on :
370  // -1 The grain or grazing resource available in grain and grazing
371  double grain_intake = m_OurPopulationManager->GetFeedingRate(grain, m_myspecies); // kJ/min
372  double maize_intake = m_OurPopulationManager->GetMaizeFeedingRate(maize, m_myspecies); // kJ/min
373  m_MyMemory->ChangeSetFoodRes(aThought.m_polygonid, grain_intake, maize_intake, grazing); // Remember these
374 // -2 The relationship between resource and intake rate.This is dependent on the species and family or non - breeder. It also depends on the
375  // type of resource, i.e. the response for grain is different than for grazing.
376  // -3 The number of geese which will determine an interference competition factor, which reduces intake rate
377  double geese = m_groupsize; // if m_myForageIndex = -1, nobody else is there.
379  // -4 The interference factor is a look-up from a pre-calculated curve in the goose population manager
380  double interferenceComp = m_OurPopulationManager->GetForageRateDensity(geese);
381  // A simplification here is to assume that they either eat grain or graze but not both
382  double myforagerate;
383  myforagerate = GetMaxForageRate( grain_intake, maize_intake, grazing, interferenceComp, iscereal, veg, instubble, lastsowncrop); // GetMaxForageRate determines the source of max intake rate and adjust intake for snow cover if needed.
384  // Now decide if this is OK or not. The intake rate is compared to the current minimum intake rate for the individual.
385  if (myforagerate < m_Indivmingooseforagerate)
386  {
387  m_myForageIndex = -1; // If we don't do this we will get a negative number of geese on the forage location later unless they find somewhere else to go.
389  }
390  // OK we are staying
392  if (m_myForageIndex != -1){
394  }
395  else {
397  }
398  m_myMemPolyID = aThought.m_polygonid;
399  return togs_Forage;
400 }

References Goose_Population_Manager::AddGeeseToForageLocation(), ALMaSS_MathFuncs::CalcDistPythagorasApprox(), GooseMemoryMap::CalcScore(), cfg_goose_AfterDarkTime, GooseMemoryMap::ChangeSetFoodRes(), Explore(), FlyTo(), Goose_Population_Manager::ForageLocationInUse(), g_AlmassMathFuncs, g_msg, g_rand_uni2, GooseMemoryMap::GetBestFeedingScore(), Goose_Population_Manager::GetBirdsAtForageLoc(), Goose_Population_Manager::GetDayTime(), Goose_Population_Manager::GetFeedingRate(), Goose_Population_Manager::GetForageGooseDensity(), Goose_Population_Manager::GetForageLocation(), GetForageLocIndex(), Goose_Population_Manager::GetForageLocIndex(), Goose_Population_Manager::GetForageRateDensity(), GooseActiveForageLocation::GetGrainDensity(), GooseActiveForageLocation::GetGrazing(), Goose_Population_Manager::GetLeader(), GooseActiveForageLocation::GetMaizeDensity(), Goose_Population_Manager::GetMaizeFeedingRate(), GetMaxForageRate(), GetMaxIntakeRate(), GooseActiveForageLocation::GetPolygonref(), GooseMemoryMap::IsKnownArea(), m_followinglikelyhood, GooseMemoryLocation::m_foodresource, m_forageLocCount, GooseMemoryLocation::m_grain, GooseMemoryLocation::m_grazing, m_groupsize, m_Indivmingooseforagerate, m_LeavingRoost, GooseMemoryLocation::m_maize, m_myForageIndex, m_myGooseSpeciesType, m_MyMemory, m_myMemPolyID, m_MyRoost, m_myspecies, m_OurPopulationManager, GooseMemoryLocation::m_polygonid, GooseMemoryLocation::m_score, GooseMemoryLocation::m_threat, GooseMemoryLocation::m_x, GooseMemoryLocation::m_y, GooseMemoryMap::MemAdd(), Goose_Population_Manager::NewForageLocation(), Goose_Population_Manager::RecordState(), Set_GooseLeavingRoost(), togs_ChooseForageLocation, togs_Forage, togs_ToRoost, CfgInt::value(), and MapErrorMsg::Warn().

Referenced by On_Bang(), Goose_Barnacle_FamilyGroup::Step(), Goose_Pinkfoot_FamilyGroup::Step(), Goose_Greylag_FamilyGroup::Step(), Goose_Pinkfoot_NonBreeder::Step(), Goose_Barnacle_NonBreeder::Step(), and Goose_Greylag_NonBreeder::Step().

◆ st_Dying()

void Goose_Base::st_Dying ( void  )

Behavioural state dying.

Definition at line 251 of file Goose_Base.cpp.

252 {
253  m_CurrentStateNo = -1; // this will kill the animal object and free up space
254  m_StepDone = true;
255  delete m_MyMemory; // this is reinitisalised in the object pool.
256 }

References m_MyMemory.

Referenced by Goose_Barnacle_FamilyGroup::Step(), Goose_Pinkfoot_FamilyGroup::Step(), Goose_Greylag_FamilyGroup::Step(), Goose_Pinkfoot_NonBreeder::Step(), Goose_Barnacle_NonBreeder::Step(), and Goose_Greylag_NonBreeder::Step().

◆ st_Forage()

TTypeOfGoose_BaseState Goose_Base::st_Forage ( )

Behavioural forage.

Must assess the competition status here (must be at a forage location to call this state). If the forage rate resulting from competition and forage availability is too low then the bird will move the flock/family, otherwise it will signal feeding at a certain rate. The forage loss will need to be calculated and sent to the LE polygon (foragae location) in question. This is done immediately since it will influence the forage assessment of birds not yet considered in this step (assumed to come later).

The first things is to check if we are near the end of daylight, if so then fly to roost.

If the goose has eaten all it can in a day, then it just rests on the field until evening.
Get the grain and forage density - NB is in KJ, which needs to be to needs to be remembered.
Here we do the forage calculation.The intake rate depends on : -1 The grain or grazing resource available -2 The relationship between resource and intake rate.This is dependent on the species and family or non - breeder. It also depends on the type of resource, i.e. the response for grain is different than for grazing. -3 The number of geese which will determine an interference competition factor, which reduces intake rate

Then decide if this is OK or not. The simplest here is to compare to a standard intake rate threshold for the species/type combination.

If can't get our required forage rate then try to find somewhere that we can, and if we find a place that cannot meet our requirements then we want to forget this place fast.

No food here, so lower the acceptable level of MFR

If the goose decides to move on immediately then it must deregister itself or group with the population manager at this forage location. This is done by using RemoveGeeseFromForageLocation

If OK then how long should we feed?
There are three constraints:

  • End of day
  • Crop full
  • Energy reserves a maximum

Definition at line 433 of file Goose_Base.cpp.

434 {
456  int dtime = m_OurPopulationManager->GetDayTime();
457  int daylength = m_OurLandscape->SupplyDaylength();
458  if (dtime >= daylength + cfg_goose_AfterDarkTime.value())
459  {
460 #ifdef __DEBUG_GOOSE
461  if (m_myForageIndex != -1)
462  {
464  g_msg->Warn("Goose_Base::st_Forage - Removing negative geese from forage location", (double)(m_OurPopulationManager->GetBirdsAtForageLoc(m_myForageIndex, m_myGooseSpeciesType) - m_groupsize));
465  exit(0);
466  }
467  }
468 #endif
469  return togs_ToRoost;
470  }
472  {
473  if (m_DailyMaxAppetiteHitTime > dtime) {
475  }
476  return togs_Forage;
477  }
478  //
479  // Get the grain and forage density - NB grain/m2 and maize in kJ/m2, which needs to be to needs to be remembered.
480  //
481  int polyref = m_OurPopulationManager->m_GooseForageLocations[m_myForageIndex].GetPolygonref();
482  double grazing = m_OurLandscape->GetActualGooseGrazingForage(polyref, m_myspecies); // kJ/min
483  double grain = m_OurLandscape->SupplyBirdSeedForage(polyref); // kJ/m2
484  double maize = m_OurLandscape->SupplyBirdMaizeForage(polyref); // kJ/m2
485  bool instubble = m_OurLandscape->SupplyInStubble(polyref);
486  TTypesOfVegetation veg = m_OurLandscape->SupplyVegType(polyref);
487  TTypesOfVegetation lastsowncrop = m_OurLandscape->SupplyLastSownVeg(polyref);
488  bool iscereal = m_OurLandscape->SupplyIsCereal2(lastsowncrop);
489  // Here we do the forage calculation.The intake rate depends on :
490  // -1 The grain, maize or grazing resource available in grain, maize and grazing
491  double grain_intake = m_OurPopulationManager->GetFeedingRate( grain, m_myspecies ); // KJ/min
492  double maize_intake = m_OurPopulationManager->GetMaizeFeedingRate(maize, m_myspecies); // KJ/min
493  m_MyMemory->ChangeSetFoodRes(m_myMemPolyID, grain_intake, maize_intake, grazing); // Remember these
494  // -2 The relationship between resource and intake rate. This is dependent on the species and family or non-breeder. It also depends on the
495  // type of resource, i.e. the response for grain or maize is different than for grazing.
496  // -3 The number of geese which will determine an interference competition factor, which reduces intake rate
498  // -4 The interfence factor is a look-up from a pre-calculated curve in the goose population manager
499  double interferenceComp = m_OurPopulationManager->GetForageRateDensity(geese);
500  // A simplification here is to assume that they either eat grain, maize or graze but any combination
501  double myforagerate;
502  myforagerate = GetMaxForageRate( grain_intake, maize_intake, grazing, interferenceComp, iscereal, veg, instubble, lastsowncrop); // GetMaxForageRate determines the source of max intake rate and adjust intake for snow cover if needed.
503  // Now decide if this is OK or not. The simplest here is to compare to a standard intake rate threshold for the species/type combination.
504  if (myforagerate < m_Indivmingooseforagerate)
505  {
513 
519  m_myForageIndex = -1;
521  }
529  // We have lots of food, stay and eat until full.
530  double forage = myforagerate * 10; // 10 for 10 minutes
531  m_energyToday += forage;
532  // Scale the amount of forage removed from the field to the size of the group (1 for non-breeders)
533  forage = ScaleForageToGroupsize(forage);
535  if (dtime >= daylength + cfg_goose_AfterDarkTime.value())
536  {
537  Set_Indivmingooseforagerate( GetGooseMinForageRate(m_myspecies) ); // Okay, we found food today, so reset the minimum acceptable MFR.
538  return togs_ToRoost;
539  }
540  return togs_Forage;
541 }

References cfg_goose_AfterDarkTime, cfg_goose_MinForageRateDecayRate, GooseMemoryMap::ChangeSetFoodRes(), g_msg, Goose_Population_Manager::GetBirdsAtForageLoc(), Goose_Population_Manager::GetDayTime(), Goose_Population_Manager::GetFeedingRate(), Goose_Population_Manager::GetForageGooseDensity(), Goose_Population_Manager::GetForageRateDensity(), GetGooseMinForageRate(), Goose_Population_Manager::GetMaizeFeedingRate(), GetMaxForageRate(), m_DailyMaxAppetite, m_DailyMaxAppetiteHitTime, m_energyToday, Goose_Population_Manager::m_GooseForageLocations, m_groupsize, m_Indivmingooseforagerate, TMaxIntakeSource::m_maxintakesource, m_MaxIntakeSource, m_myForageIndex, m_myGooseSpeciesType, m_MyMemory, m_myMemPolyID, m_myspecies, m_OurPopulationManager, GooseMemoryMap::MemDel(), Goose_Population_Manager::RemoveGeeseFromForageLocation(), Goose_Population_Manager::RemoveMaxForageKj(), ScaleForageToGroupsize(), Set_Indivmingooseforagerate(), togs_ChooseForageLocation, togs_Forage, togs_ToRoost, CfgInt::value(), CfgFloat::value(), and MapErrorMsg::Warn().

Referenced by Goose_Barnacle_FamilyGroup::Step(), Goose_Pinkfoot_FamilyGroup::Step(), Goose_Greylag_FamilyGroup::Step(), Goose_Pinkfoot_NonBreeder::Step(), Goose_Barnacle_NonBreeder::Step(), and Goose_Greylag_NonBreeder::Step().

◆ st_Roost()

TTypeOfGoose_BaseState Goose_Base::st_Roost ( )

Roosting until next forage or next morning.

Assesses whether it is daylight and time to leave the roost. If not it continues to roost.

m_LeaveRoostTime is a way to stagger the birds leaving the roost. Each birds has its own leave time set each day.

Definition at line 550 of file Goose_Base.cpp.

551 {
556  {
557  return togs_Roost;
558  }
563  {
564  return togs_Roost;
565  }
566  Set_GooseLeavingRoost( true ); // Indicate that we are coming from the roost. Used to trigger memory initialisation via explore.
568 }

References Goose_Population_Manager::GetDayTime(), Goose_Population_Manager::GetIsDaylight(), m_LeaveRoostTime, m_OurPopulationManager, Set_GooseLeavingRoost(), togs_ChooseForageLocation, and togs_Roost.

Referenced by Goose_Barnacle_FamilyGroup::Step(), Goose_Pinkfoot_FamilyGroup::Step(), Goose_Greylag_FamilyGroup::Step(), Goose_Pinkfoot_NonBreeder::Step(), Goose_Barnacle_NonBreeder::Step(), and Goose_Greylag_NonBreeder::Step().

◆ st_ToRoost()

TTypeOfGoose_BaseState Goose_Base::st_ToRoost ( )
virtual

Return to roost and assess whether to forage again that day.

Reimplemented in Goose_Barnacle_Base, Goose_Greylag_Base, and Goose_Pinkfoot_Base.

Definition at line 544 of file Goose_Base.cpp.

545 {
546  return togs_foobar;
547 }

References togs_foobar.

◆ StartDay()

void Goose_Base::StartDay ( void  )
virtual

Do any 'housekeeping' associated with the start of day.

Definition at line 181 of file Goose_Base.cpp.

182 {
183  // Adjust the energy reserves
184  if (m_OurPopulationManager->GetDayTime() == 0)
185  {
186  // Remove our DEB from our net energy collection for the day
187  m_energyToday -= m_DEB;
188  if (m_energyToday > 0)
189  {
191  }
193 
195  if (m_weightTotal < m_weight) {
197  }
198  // Some goose output recording
206  m_forageLocCount = 0;
207 
208  // Set the body condition as % by weight of fat. This is a running sum over the last 5 days.
211  double condition = m_weightTotal / m_weight;
214  // Here we limit the maximum growth possible
217  }
219  {
221  }
222  // Reset energy intake
223  m_energyToday = 0;
224  m_FlightNumber = 0;
225  m_FlightDistance = 0;
226  // Reset the roost leaving time
228  // Reset the time when m_DailyMaxAppetite was hit. If reaching dailymaxappetite takes less than a whole day, the time is recorded. Therefore we "reset" to 1440, not 0.
230  // Decay all memories before adding new information today
232  // Calculate the new DEB
233  double daylightprop = m_OurLandscape->SupplyDaylightProp();
234  double nighttimeprop = m_OurLandscape->SupplyNightProp();
235  double multiplier = cfg_goose_daytime_BMR_multiplier.value() * daylightprop + cfg_goose_nighttime_BMR_multiplier.value() * nighttimeprop;
237  double minforagerate = (m_DEB / (1440 * daylightprop)); // They accept forage rates so they can optain positive energy balance
238  Set_mingooseforagerate( minforagerate, m_myspecies );
239  Set_Indivmingooseforagerate( minforagerate ); // At the start of the day, give the individual the MFR for the species
240  m_SnowDepth = m_OurLandscape->SupplySnowDepth(); // We store the current snow depth here for speed optimization.
241  }
242 }

References AddBodyCondition(), cfg_goose_daytime_BMR_multiplier, cfg_goose_nighttime_BMR_multiplier, GooseMemoryMap::DecayAllMemory(), Goose_Population_Manager::GetDayTime(), GetForagingTime(), Goose_Population_Manager::GetThermalCosts(), m_BMR, m_BodyCondition, m_BodyConditionCounter, m_DailyMaxAppetiteHitTime, m_DEB, m_energyReserve, m_energyToday, m_FlightDistance, m_FlightNumber, m_forageLocCount, m_GooseFattoKJConversion, m_GooseKJtoFatConversion, m_GooseLeavingThreshold, m_GooseMaxEnergyReserveProportion, m_groupsize, m_LeaveRoostTime, m_MyMemory, m_myspecies, m_OurPopulationManager, m_SnowDepth, m_TheBodyCondition, Goose_Population_Manager::m_variate_generator, m_weight, m_weightTotal, On_Migrate(), Goose_Population_Manager::RecordDailyEnergyBalance(), Goose_Population_Manager::RecordDailyEnergyBudget(), Goose_Population_Manager::RecordFlightDistance(), Goose_Population_Manager::RecordForagingTime(), Goose_Population_Manager::RecordIndForageLoc(), Goose_Population_Manager::RecordWeight(), Set_Indivmingooseforagerate(), Set_mingooseforagerate(), SetBodyCondition(), SubtractBodyCondition(), tolr_bodycondition, tolr_leanweight, and CfgFloat::value().

Referenced by BeginStep().

◆ Step()

void Goose_Base::Step ( void  )
virtual

The Step is the second 'part' of the timestep that an animal can behave in. It is called continuously until all animals report that they are 'DONE'.

Reimplemented in Goose_Greylag_NonBreeder, Goose_Barnacle_NonBreeder, Goose_Pinkfoot_NonBreeder, Goose_Greylag_FamilyGroup, Goose_Barnacle_FamilyGroup, and Goose_Pinkfoot_FamilyGroup.

Definition at line 244 of file Goose_Base.cpp.

245 {
246  m_OurLandscape->Warn("Goose_Base::Step()","attempt to instantiate and use the base class!");
247  exit(1);
248 }

◆ SubtractBodyCondition()

void Goose_Base::SubtractBodyCondition ( double  a_condition)
inline

Alters body conditon by subtraction of a double value.

Definition at line 406 of file Goose_Base.h.

406 { m_TheBodyCondition -= a_condition; }

References m_TheBodyCondition.

Referenced by StartDay().

Member Data Documentation

◆ CurrentGState

TTypeOfGoose_BaseState Goose_Base::CurrentGState
protected

Variable to record current behavioural state.

A Goose_Base must have some simple functionality: Inititation Movement Dying

Inherits m_Location_x, m_Location_y, m_OurLandscape from TAnimal NB All areas are squares of size length X length

Definition at line 147 of file Goose_Base.h.

Referenced by On_Bang(), On_Emigrate(), On_Migrate(), Goose_Pinkfoot_FamilyGroup::Step(), Goose_Barnacle_FamilyGroup::Step(), Goose_Greylag_FamilyGroup::Step(), Goose_Pinkfoot_NonBreeder::Step(), Goose_Barnacle_NonBreeder::Step(), and Goose_Greylag_NonBreeder::Step().

◆ m_BMR

double Goose_Base::m_BMR
protected

The daily BMR.

Definition at line 187 of file Goose_Base.h.

Referenced by Goose_Barnacle_Base::Init(), Goose_Pinkfoot_Base::Init(), Goose_Greylag_Base::Init(), and StartDay().

◆ m_BodyCondition

double Goose_Base::m_BodyCondition[5]
protected

A variable describing current body condition over the past 5 days.

Definition at line 279 of file Goose_Base.h.

Referenced by SetBodyCondition(), and StartDay().

◆ m_BodyConditionCounter

unsigned Goose_Base::m_BodyConditionCounter
protected

A counter for the daily body condition.

Definition at line 287 of file Goose_Base.h.

Referenced by StartDay().

◆ m_DailyMaxAppetite

double Goose_Base::m_DailyMaxAppetite
protected

The daily max kJ possible to get as intake.

Definition at line 195 of file Goose_Base.h.

Referenced by Goose_Barnacle_Base::Init(), Goose_Pinkfoot_Base::Init(), Goose_Greylag_Base::Init(), and st_Forage().

◆ m_DailyMaxAppetiteHitTime

int Goose_Base::m_DailyMaxAppetiteHitTime
protected

The time of day when m_DailyMaxAppetite was hit.

Definition at line 203 of file Goose_Base.h.

Referenced by GetMaxAppetiteHitTime(), st_Forage(), and StartDay().

◆ m_DEB

double Goose_Base::m_DEB
protected

The daily energy budget excluding flying (kJ)

Definition at line 191 of file Goose_Base.h.

Referenced by GetDailyEnergyBudget(), Goose_Pinkfoot_Base::Init(), Goose_Greylag_Base::Init(), Goose_Barnacle_Base::Init(), and StartDay().

◆ m_energyReserve

double Goose_Base::m_energyReserve
protected

The bird's energy reserves in grams.

Definition at line 223 of file Goose_Base.h.

Referenced by StartDay().

◆ m_energyToday

double Goose_Base::m_energyToday
protected

The bird's daily energy account (kJ)

Definition at line 207 of file Goose_Base.h.

Referenced by FlyTo(), GetDailyEnergyExpenditure(), st_Forage(), and StartDay().

◆ m_flightcost

double Goose_Base::m_flightcost = -1
staticprotected

The cost of flight per g per m in kJ.

but with correct values.

Definition at line 227 of file Goose_Base.h.

Referenced by GetFlightCost(), and SetFlightCost().

◆ m_FlightDistance

int Goose_Base::m_FlightDistance
protected

Storage for the total distance flown per day.

Definition at line 311 of file Goose_Base.h.

Referenced by FlyTo(), GetFlightDistance(), and StartDay().

◆ m_FlightNumber

int Goose_Base::m_FlightNumber
protected

Counter for the number of flights per day.

Definition at line 307 of file Goose_Base.h.

Referenced by FlyTo(), GetFlightNumber(), and StartDay().

◆ m_followinglikelyhood

int Goose_Base::m_followinglikelyhood = { -1, -1, -1 , -1, -1, -1 }
staticprotected

An attribute used to determine the chance of following or exploring when foraging.

Definition at line 303 of file Goose_Base.h.

Referenced by Set_GooseFollowingLikelyhood(), and st_ChooseForageLocation().

◆ m_forageLocCount

int Goose_Base::m_forageLocCount
protected

The number of forage locations visited today.

Definition at line 183 of file Goose_Base.h.

Referenced by st_ChooseForageLocation(), and StartDay().

◆ m_GooseFattoKJConversion

double Goose_Base::m_GooseFattoKJConversion = -1
staticprotected

Conversion rate fat to kJ.

Definition at line 271 of file Goose_Base.h.

Referenced by Set_GooseFattoKJConversion(), and StartDay().

◆ m_GooseFieldForageDist

double Goose_Base::m_GooseFieldForageDist = { -1, -1, -1 }
staticprotected

The maximum distance travelled from roost to forage sites for each species of goose (m)

Definition at line 247 of file Goose_Base.h.

Referenced by Goose_Barnacle_Base::ChooseHopLoc(), Goose_Pinkfoot_Base::ChooseHopLoc(), and Set_GooseFieldForageDist().

◆ m_GooseFieldForageDistX2

double Goose_Base::m_GooseFieldForageDistX2 = { -1, -1, -1 }
staticprotected

Double the maximum distance travelled from roost to forage sites for each species of goose (m) - this is a speed optimisation.

Definition at line 251 of file Goose_Base.h.

Referenced by Goose_Barnacle_Base::ChooseHopLoc(), Goose_Pinkfoot_Base::ChooseHopLoc(), and Set_GooseFieldForageDist().

◆ m_GooseForageDist

double Goose_Base::m_GooseForageDist = { -1, -1, -1 }
staticprotected

The maximum distance travelled from roost to forage sites for each species of goose (m)

Definition at line 239 of file Goose_Base.h.

Referenced by Goose_Barnacle_Base::ChooseHopLoc(), Goose_Pinkfoot_Base::ChooseHopLoc(), Goose_Greylag_Base::ChooseHopLoc(), and Set_GooseForageDist().

◆ m_GooseForageDistX2

double Goose_Base::m_GooseForageDistX2 = { -1, -1, -1 }
staticprotected

Double the maximum distance travelled from roost to forage sites for each species of goose (m) - this is a speed optimisation.

Definition at line 243 of file Goose_Base.h.

Referenced by Goose_Barnacle_Base::ChooseHopLoc(), Goose_Pinkfoot_Base::ChooseHopLoc(), Goose_Greylag_Base::ChooseHopLoc(), and Set_GooseForageDist().

◆ m_GooseKJtoFatConversion

double Goose_Base::m_GooseKJtoFatConversion = -1
staticprotected

Conversion rate kJ to fat.

Definition at line 267 of file Goose_Base.h.

Referenced by Set_GooseKJtoFatConversion(), and StartDay().

◆ m_GooseLeavingThreshold

double Goose_Base::m_GooseLeavingThreshold = -1
staticprotected

The trigger for leaving as a 5 day average of body condition.

Definition at line 255 of file Goose_Base.h.

Referenced by Set_GooseLeavingThreshold(), and StartDay().

◆ m_GooseMaxAppetiteScaler

double Goose_Base::m_GooseMaxAppetiteScaler = -1
staticprotected

Scaler to determine the max kJ possible to eat per day based on non-energy reserve weight.

Definition at line 259 of file Goose_Base.h.

Referenced by Goose_Barnacle_Base::Init(), Goose_Pinkfoot_Base::Init(), Goose_Greylag_Base::Init(), and Set_GooseMaxAppetiteScaler().

◆ m_GooseMaxEnergyReserveProportion

double Goose_Base::m_GooseMaxEnergyReserveProportion = -1
staticprotected

Max proportion of weight that can be energy reserve.

Definition at line 263 of file Goose_Base.h.

Referenced by Set_GooseMaxEnergyReserveProportion(), and StartDay().

◆ m_GooseMinForageOpenness

double Goose_Base::m_GooseMinForageOpenness = -1
staticprotected

The minimum openness value a goose will tolerate for forage.

Definition at line 275 of file Goose_Base.h.

Referenced by EvaluateForageToHopLoc(), and Set_GooseMinForageOpenness().

◆ m_groupsize

◆ m_Indivmingooseforagerate

double Goose_Base::m_Indivmingooseforagerate
protected

The minimum tolerable forage rate in kJ/minute for the individual.

Definition at line 231 of file Goose_Base.h.

Referenced by Set_Indivmingooseforagerate(), st_ChooseForageLocation(), and st_Forage().

◆ m_LeaveRoostTime

double Goose_Base::m_LeaveRoostTime
protected

Controls the time when the goose will leave the roost.

Definition at line 215 of file Goose_Base.h.

Referenced by GetRoostLeaveTime(), st_Roost(), and StartDay().

◆ m_LeavingRoost

bool Goose_Base::m_LeavingRoost
protected

Flag to indicate that we are coming from the roost. Used to control code for "following".

Definition at line 219 of file Goose_Base.h.

Referenced by Set_GooseLeavingRoost(), and st_ChooseForageLocation().

◆ m_MaxIntakeSource

TMaxIntakeSource Goose_Base::m_MaxIntakeSource
protected

Holds information about the food source which gave max intake rate.

Definition at line 211 of file Goose_Base.h.

Referenced by GetMaxForageRate(), GetMaxIntakeSource(), and st_Forage().

◆ m_mingooseforagerate

double Goose_Base::m_mingooseforagerate = { -1, -1, -1 }
staticprotected

The minimum tolerable forage rate in kJ/minute for the species.

Definition at line 235 of file Goose_Base.h.

Referenced by GetGooseMinForageRate(), and Set_mingooseforagerate().

◆ m_myForageIndex

◆ m_myGooseSpeciesType

◆ m_MyMemory

◆ m_myMemPolyID

int Goose_Base::m_myMemPolyID
protected

Temporary storage for a memory location polygon id.

Definition at line 295 of file Goose_Base.h.

Referenced by st_ChooseForageLocation(), and st_Forage().

◆ m_MyRoost

◆ m_myspecies

GooseSpecies Goose_Base::m_myspecies
protected

◆ m_OurPopulationManager

◆ m_sex

bool Goose_Base::m_sex
protected

Sex of bird, true = male false = female.

Definition at line 155 of file Goose_Base.h.

Referenced by GetSex(), and SetSex().

◆ m_SnowDepth

double Goose_Base::m_SnowDepth = 0.0
staticprotected

The current snow depth. Held here for speed optimization.

Definition at line 199 of file Goose_Base.h.

Referenced by AdjustIntakeRateToSnowDepth(), and StartDay().

◆ m_TheBodyCondition

double Goose_Base::m_TheBodyCondition
protected

A variable describing current body condition averaged over 5 days.

Definition at line 283 of file Goose_Base.h.

Referenced by AddBodyCondition(), GetBodyCondition(), StartDay(), and SubtractBodyCondition().

◆ m_weight

double Goose_Base::m_weight
protected

The weight of the bird in gram excluding fat reserve.

Definition at line 175 of file Goose_Base.h.

Referenced by StartDay().

◆ m_weightTotal

double Goose_Base::m_weightTotal
protected

The weight of the bird in g including fat reserve.

Definition at line 179 of file Goose_Base.h.

Referenced by GetFlightCost(), GetTotalWeight(), and StartDay().


The documentation for this class was generated from the following files:
cfg_goose_nighttime_BMR_multiplier
CfgFloat cfg_goose_nighttime_BMR_multiplier
To calculate daily energy budget. This is the multiple of BMR spent during nighttime.
Goose_Base::m_LeavingRoost
bool m_LeavingRoost
Flag to indicate that we are coming from the roost. Used to control code for "following".
Definition: Goose_Base.h:219
Goose_Base::GetMaxIntakeRate
double GetMaxIntakeRate(double a_grain, double a_maize, double a_grass)
Returns the max intake rate of the three different types of intake.
Definition: Goose_Base.h:536
Goose_Base::m_energyToday
double m_energyToday
The bird's daily energy account (kJ)
Definition: Goose_Base.h:207
Goose_Base::m_FlightNumber
int m_FlightNumber
Counter for the number of flights per day.
Definition: Goose_Base.h:307
Goose_Base::GetFlightCost
double GetFlightCost()
Get the flight costs per m per g.
Definition: Goose_Base.h:568
togs_Roost
Definition: Goose_Base.h:80
GooseActiveForageLocation::GetGrazing
double GetGrazing(int gs)
Returns the current forage rate kJ/min assuming no other geese affect this.
Definition: Goose_Population_Manager.h:334
Goose_Base::m_myForageIndex
int m_myForageIndex
Temporary storage for a forage location index - this is a speed optimisation.
Definition: Goose_Base.h:291
Goose_Population_Manager::GetForageLocIndex
int GetForageLocIndex(GooseSpecies a_species, int a_x, int a_y)
Get a forage location for my species (picked randomly among the active locations)
Definition: Goose_Population_Manager.cpp:2039
Goose_Base::m_DEB
double m_DEB
The daily energy budget excluding flying (kJ)
Definition: Goose_Base.h:191
Goose_Base::m_GooseLeavingThreshold
static double m_GooseLeavingThreshold
The trigger for leaving as a 5 day average of body condition.
Definition: Goose_Base.h:255
Goose_Population_Manager::GetDayTime
int GetDayTime()
Get the time of day (in minutes). For the goose model, sunrise is defined as m_daytime == 0....
Definition: Goose_Population_Manager.h:408
tolr_leanweight
Definition: Goose_Base.h:106
Goose_Base::m_groupsize
int m_groupsize
The size of the group this bird represents.
Definition: Goose_Base.h:171
GooseMemoryMap::MemDel
bool MemDel(int a_polyid)
Delete a memory location.
Definition: GooseMemoryMap.cpp:87
Goose_Base::m_LeaveRoostTime
double m_LeaveRoostTime
Controls the time when the goose will leave the roost.
Definition: Goose_Base.h:215
togs_Die
Definition: Goose_Base.h:81
GooseMemoryLocation
a data structure to hold goose memory location attributes
Definition: GooseMemoryMap.h:41
GooseMemoryLocation::m_score
double m_score
A score used to assess the location.
Definition: GooseMemoryMap.h:63
tomis_grass
Definition: Goose_Base.h:92
GooseMemoryLocation::m_grazing
double m_grazing
the grazing resource at the location as intake rate kJ/min
Definition: GooseMemoryMap.h:57
Goose_Population_Manager::AddGeeseToForageLocation
void AddGeeseToForageLocation(GooseSpeciesType a_type, int a_index, int a_number)
Adds a goose or geese to the forage location - requires an index.
Definition: Goose_Population_Manager.cpp:1806
Goose_Base::GetForagingTime
int GetForagingTime(int a_EndForagingTime, double a_RoostLeaveTime)
Returns the time spent foraging.
Definition: Goose_Base.cpp:738
Goose_Population_Manager::RecordWeight
void RecordWeight(double a_weight, GooseSpecies a_species)
Record the weight.
Definition: Goose_Population_Manager.cpp:2164
togs_ToRoost
Definition: Goose_Base.h:79
Goose_Base::m_GooseFieldForageDist
static double m_GooseFieldForageDist[gs_foobar]
The maximum distance travelled from roost to forage sites for each species of goose (m)
Definition: Goose_Base.h:247
Goose_Base::m_GooseFattoKJConversion
static double m_GooseFattoKJConversion
Conversion rate fat to kJ.
Definition: Goose_Base.h:271
Goose_Base::m_BodyCondition
double m_BodyCondition[5]
A variable describing current body condition over the past 5 days.
Definition: Goose_Base.h:279
Goose_Base::st_ChooseForageLocation
TTypeOfGoose_BaseState st_ChooseForageLocation(void)
Selects a forage location based on past memory, or initiates an exploration.
Definition: Goose_Base.cpp:258
Goose_Base::m_GooseMaxEnergyReserveProportion
static double m_GooseMaxEnergyReserveProportion
Max proportion of weight that can be energy reserve.
Definition: Goose_Base.h:263
GooseActiveForageLocation::GetMaizeDensity
double GetMaizeDensity(void)
Returns the current maize forage density (kJ/m2)
Definition: Goose_Population_Manager.h:313
GooseMemoryMap::ChangeSetFoodRes
bool ChangeSetFoodRes(int a_polyid, double a_grain, double a_maize, double a_grazing)
Set food at a memory location.
Definition: GooseMemoryMap.cpp:159
Goose_Population_Manager::GetIsDaylight
int GetIsDaylight()
Is it daylight hours? Daylight starts at m_daytime == 0.
Definition: Goose_Population_Manager.h:416
Goose_Base::SubtractBodyCondition
void SubtractBodyCondition(double a_condition)
Alters body conditon by subtraction of a double value.
Definition: Goose_Base.h:406
cfg_goose_snow_scaler
CfgFloat cfg_goose_snow_scaler
The decrease in intake rate resulting from snow.
Goose_Population_Manager::RecordDailyEnergyBudget
void RecordDailyEnergyBudget(int a_deb, GooseSpecies a_species)
Record the daily energy budget.
Definition: Goose_Population_Manager.cpp:2231
Goose_Base::m_SnowDepth
static double m_SnowDepth
The current snow depth. Held here for speed optimization.
Definition: Goose_Base.h:199
tolr_bodycondition
Definition: Goose_Base.h:105
togs_ChooseForageLocation
Definition: Goose_Base.h:77
Goose_Population_Manager::GetMaizeFeedingRate
double GetMaizeFeedingRate(double a_maizedensity, GooseSpecies a_species)
Get the forage rate when feeding on maize.
Definition: Goose_Population_Manager.h:474
TMaxIntakeSource::m_veg
TTypesOfVegetation m_veg
The vegetation type.
Definition: Goose_Base.h:121
Goose_Population_Manager::RecordLeaveReason
void RecordLeaveReason(TTypeOfLeaveReason a_leavereason, GooseSpeciesType a_speciestype)
Record the reason for leaving.
Definition: Goose_Population_Manager.cpp:2280
GooseActiveForageLocation::GetPolygonref
int GetPolygonref()
Get the landscape element ( LE ) reference number used by the Landscape class to identify this locati...
Definition: Goose_Population_Manager.h:190
Goose_Base::AdjustIntakeRateToSnowDepth
double AdjustIntakeRateToSnowDepth(double a_intakerate)
When there is snow, the intake rate is decreased by 10 % per cm of snow.
Definition: Goose_Base.cpp:730
tomis_maize
Definition: Goose_Base.h:94
GooseActiveForageLocation::GetGrainDensity
double GetGrainDensity(void)
Returns the current forage density (grain/m2)
Definition: Goose_Population_Manager.h:303
GooseMemoryMap::ChangeAddThreat
bool ChangeAddThreat(int a_polyid, double a_threat)
Add to threat at a memory location.
Definition: GooseMemoryMap.cpp:123
Goose_Base::Set_Indivmingooseforagerate
void Set_Indivmingooseforagerate(double a_cost)
Set the mimimum tolerated forage rate for the individual goose.
Definition: Goose_Base.h:578
Goose_Base::Set_mingooseforagerate
void Set_mingooseforagerate(double a_cost, GooseSpecies a_species)
Set the mimimum tolerated forage rate for all geese.
Definition: Goose_Base.h:574
Goose_Base::m_DailyMaxAppetiteHitTime
int m_DailyMaxAppetiteHitTime
The time of day when m_DailyMaxAppetite was hit.
Definition: Goose_Base.h:203
Goose_Base::m_myMemPolyID
int m_myMemPolyID
Temporary storage for a memory location polygon id.
Definition: Goose_Base.h:295
GooseMemoryMap::CalcScore
double CalcScore(int a_dist, double a_foodresource, double a_threat)
Inline function to calulate overall score for a distance, resource and threat.
Definition: GooseMemoryMap.cpp:273
Goose_Population_Manager::m_variate_generator
Variate_gen * m_variate_generator
Function to be able to draw randomly from predefined distributions.
Definition: Goose_Population_Manager.h:564
Goose_Base::m_GooseMaxAppetiteScaler
static double m_GooseMaxAppetiteScaler
Scaler to determine the max kJ possible to eat per day based on non-energy reserve weight.
Definition: Goose_Base.h:259
Goose_Population_Manager::GetLeader
Goose_Base * GetLeader(APoint a_homeloc, GooseSpecies a_species)
Asks for a pointer to a goose that can be followed.
Definition: Goose_Population_Manager.cpp:1989
Goose_Base::m_GooseForageDistX2
static double m_GooseForageDistX2[gs_foobar]
Double the maximum distance travelled from roost to forage sites for each species of goose (m) - this...
Definition: Goose_Base.h:243
Goose_Base::SetBodyCondition
void SetBodyCondition(double a_condition, unsigned a_index)
Sets the current body condition.
Definition: Goose_Base.h:398
TMaxIntakeSource::m_maxintakesource
TTypeOfMaxIntakeSource m_maxintakesource
The intake source which gave the maximum intake.
Definition: Goose_Base.h:117
Goose_Population_Manager::RecordForagingTime
void RecordForagingTime(int a_time, GooseSpecies a_species)
Record the time spent foraging.
Definition: Goose_Population_Manager.cpp:2203
TMaxIntakeSource::m_iscereal
bool m_iscereal
Flag for whether the intake source is a cereal.
Definition: Goose_Base.h:119
tomis_sowncrop
Definition: Goose_Base.h:93
Goose_Base::m_myspecies
GooseSpecies m_myspecies
Holds goose species.
Definition: Goose_Base.h:159
Goose_Base::m_FlightDistance
int m_FlightDistance
Storage for the total distance flown per day.
Definition: Goose_Base.h:311
TTypesOfVegetation
TTypesOfVegetation
Definition: tov_declaration.h:30
cfg_goose_BMRconstant2
CfgFloat cfg_goose_BMRconstant2
The cost of BMR per kg goose - constant 2.
Goose_Population_Manager::RecordIndForageLoc
void RecordIndForageLoc(double a_count, int a_groupsize, GooseSpecies a_species)
Record a forage location count.
Definition: Goose_Population_Manager.cpp:2259
GooseMemoryLocation::m_foodresource
double m_foodresource
The max food intake rate (kJ/min) at the location.
Definition: GooseMemoryMap.h:59
Goose_Population_Manager::GetFeedingRate
double GetFeedingRate(double a_graindensity, GooseSpecies a_species)
Get the forage rate based on the grain density.
Definition: Goose_Population_Manager.h:457
TMaxIntakeSource::m_instubble
bool m_instubble
Flag to indicate if the intake source was in stubble.
Definition: Goose_Base.h:123
tomis_grain
Definition: Goose_Base.h:95
GooseMemoryLocation::m_y
int m_y
y-coordinate
Definition: GooseMemoryMap.h:49
Goose_Base::GetGooseMinForageRate
double GetGooseMinForageRate(GooseSpecies a_species)
Returns the minimum forage rate for the species.
Definition: Goose_Base.h:471
TAnimal
g_AlmassMathFuncs
ALMaSS_MathFuncs g_AlmassMathFuncs
This variable provides access the to the internal ALMaSS math functions.
Goose_Population_Manager::ForageLocationInUse
int ForageLocationInUse(int a_polyref)
Tests if a forage location is currently in use, if so returns the index to it.
Definition: Goose_Population_Manager.cpp:1752
Goose_Base::m_DailyMaxAppetite
double m_DailyMaxAppetite
The daily max kJ possible to get as intake.
Definition: Goose_Base.h:195
togs_foobar
Definition: Goose_Base.h:83
Goose_Base::Init
void Init(Goose_Population_Manager *p_NPM, double a_weight, bool a_sex, APoint a_roost)
Intitialise object.
Definition: Goose_Base.cpp:111
cfg_goose_MinForageRateDecayRate
CfgFloat cfg_goose_MinForageRateDecayRate
The decay rate for the minimum forage rate.
GooseMemoryMap::GetBestFeedingScore
GooseMemoryLocation GetBestFeedingScore()
Find the current best feeding location.
Definition: GooseMemoryMap.cpp:236
Goose_Base::m_GooseKJtoFatConversion
static double m_GooseKJtoFatConversion
Conversion rate kJ to fat.
Definition: Goose_Base.h:267
Goose_Base::CurrentGState
TTypeOfGoose_BaseState CurrentGState
Variable to record current behavioural state.
Definition: Goose_Base.h:147
Goose_Base::m_forageLocCount
int m_forageLocCount
The number of forage locations visited today.
Definition: Goose_Base.h:183
Goose_Population_Manager::m_GooseForageLocations
std::vector< GooseActiveForageLocation > m_GooseForageLocations
Is a list of active goose forage locations where we have geese.
Definition: Goose_Population_Manager.h:558
Goose_Population_Manager::GetThermalCosts
double GetThermalCosts(GooseSpecies a_goose)
Get daily thermal costs const.
Definition: Goose_Population_Manager.h:556
Goose_Base::m_GooseForageDist
static double m_GooseForageDist[gs_foobar]
The maximum distance travelled from roost to forage sites for each species of goose (m)
Definition: Goose_Base.h:239
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: maperrormsg.cpp:59
Goose_Population_Manager::GetForageLocation
GooseActiveForageLocation * GetForageLocation(unsigned int a_index)
Returns a pointer to the forage location indexed by index.
Definition: Goose_Population_Manager.h:448
Goose_Population_Manager::RecordFlightDistance
void RecordFlightDistance(int a_distance, GooseSpecies a_species)
Record the flight distance.
Definition: Goose_Population_Manager.cpp:2217
g_rand_uni2
boost::variate_generator< base_generator_type &, boost::uniform_int<> > g_rand_uni2
A random number generator (0-9999)
Goose_Base::m_MyMemory
GooseMemoryMap * m_MyMemory
The Goose Memory.
Definition: Goose_Base.h:299
Goose_Base::On_Migrate
void On_Migrate(TTypeOfLeaveReason a_leavereason)
The goose is told to leave the simulation area (poss due to bad weather)
Definition: Goose_Base.cpp:722
Goose_Base::GetMaxForageRate
double GetMaxForageRate(double a_grain, double a_maize, double a_grass, double a_interferenceComp, bool a_iscereal, TTypesOfVegetation a_veg, bool a_stubble, TTypesOfVegetation a_prevcrop)
Returns the max forage rate of the three different types of forage The max rate is adjusted according...
Definition: Goose_Base.h:489
Goose_Population_Manager::GetBirdsAtForageLoc
int GetBirdsAtForageLoc(int a_index, GooseSpeciesType a_type)
Returns the number of birds at a forage location - given by a poly ref.
Definition: Goose_Population_Manager.h:530
Goose_Base::ScaleForageToGroupsize
double ScaleForageToGroupsize(double a_forage)
Scales forage to groupsize.
Definition: Goose_Base.h:414
GooseMemoryLocation::m_maize
double m_maize
the maize resource at the location as intake rate kJ/min
Definition: GooseMemoryMap.h:55
cfg_goose_AfterDarkTime
CfgInt cfg_goose_AfterDarkTime
The number of minutes that geese will be foraging after sunset.
TMaxIntakeSource::m_prevsowncrop
TTypesOfVegetation m_prevsowncrop
The previous sown crop on the forage location.
Definition: Goose_Base.h:125
GooseActiveForageLocation
A class to hold an active goose foraging location and the number of birds of different types there.
Definition: Goose_Population_Manager.h:103
togs_InitialState
Definition: Goose_Base.h:76
Goose_Base::Set_GooseLeavingRoost
void Set_GooseLeavingRoost(bool a_leaving)
Set the flag to indicate if we are coming from the roost.
Definition: Goose_Base.h:636
GooseMemoryLocation::m_x
int m_x
x-coordinate
Definition: GooseMemoryMap.h:47
CfgFloat::value
double value(void)
Definition: configurator.h:118
Goose_Population_Manager::NewForageLocation
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...
Definition: Goose_Population_Manager.cpp:1773
Goose_Base::m_followinglikelyhood
static int m_followinglikelyhood[(int) gst_foobar]
An attribute used to determine the chance of following or exploring when foraging.
Definition: Goose_Base.h:303
cfg_goose_daytime_BMR_multiplier
CfgFloat cfg_goose_daytime_BMR_multiplier
To calculate daily energy budget. This is the multiple of BMR spent during daytime Default is based o...
cfg_goose_BMRconstant1
CfgFloat cfg_goose_BMRconstant1
The cost of BMR per kg goose - constant 1.
Goose_Base::SetSex
void SetSex(bool a_sex)
Sets the sex.
Definition: Goose_Base.h:552
Goose_Base::m_MaxIntakeSource
TMaxIntakeSource m_MaxIntakeSource
Holds information about the food source which gave max intake rate.
Definition: Goose_Base.h:211
Goose_Base::FlyTo
void FlyTo(int a_x, int a_y)
The goose flys to the location specified by a_x, a_y.
Definition: Goose_Base.cpp:409
Goose_Base::m_BMR
double m_BMR
The daily BMR.
Definition: Goose_Base.h:187
Goose_Population_Manager::GetForageGooseDensity
double GetForageGooseDensity(int a_index)
Returns the total goose density for a forage location.
Definition: Goose_Population_Manager.h:492
Goose_Base::m_BodyConditionCounter
unsigned m_BodyConditionCounter
A counter for the daily body condition.
Definition: Goose_Base.h:287
GooseMemoryMap::DecayAllMemory
void DecayAllMemory()
Decay all memory.
Definition: GooseMemoryMap.cpp:295
Goose_Population_Manager::RecordDailyEnergyBalance
void RecordDailyEnergyBalance(int a_balance, GooseSpecies a_species)
Record the daily energy balance.
Definition: Goose_Population_Manager.cpp:2245
cfg_goose_InitialEnergyReserveProportion
CfgFloat cfg_goose_InitialEnergyReserveProportion
The initial proportion of weight that can be stored as energy reserves.
Goose_Base::m_Indivmingooseforagerate
double m_Indivmingooseforagerate
The minimum tolerable forage rate in kJ/minute for the individual.
Definition: Goose_Base.h:231
Goose_Base::m_sex
bool m_sex
Sex of bird, true = male false = female.
Definition: Goose_Base.h:155
Goose_Base::m_GooseMinForageOpenness
static double m_GooseMinForageOpenness
The minimum openness value a goose will tolerate for forage.
Definition: Goose_Base.h:275
Goose_Base::GetForageLocIndex
int GetForageLocIndex()
Gets for the forage location index.
Definition: Goose_Base.h:418
Goose_Base
A class to describe the goose base.
Definition: Goose_Base.h:131
Goose_Base::m_TheBodyCondition
double m_TheBodyCondition
A variable describing current body condition averaged over 5 days.
Definition: Goose_Base.h:283
Goose_Base::ChooseHopLoc
virtual APoint ChooseHopLoc()
Pick a hop location point within a_dist meters - must be overridden by descendent classes.
Definition: Goose_Base.h:363
Goose_Base::Explore
void Explore()
Behavioural exploration of the area to find forage.
Definition: Goose_Base.cpp:571
g_msg
MapErrorMsg * g_msg
This pointer provides access the to the internal ALMaSS error message system.
Definition: maperrormsg.cpp:41
ALMaSS_MathFuncs::CalcDistPythagorasApprox
int CalcDistPythagorasApprox(int a_x, int a_y, int a_x1, int a_y1)
Calculate distance using the Pythagoras approximation.
Definition: misc.cpp:49
GooseMemoryLocation::m_threat
double m_threat
the threat-level memory strength
Definition: GooseMemoryMap.h:61
GooseMemoryMap::IsKnownArea
bool IsKnownArea(int a_polyid)
Check if this location is known.
Definition: GooseMemoryMap.cpp:282
Goose_Base::m_myGooseSpeciesType
GooseSpeciesType m_myGooseSpeciesType
Holds the goose species type.
Definition: Goose_Base.h:163
GooseMemoryLocation::m_polygonid
int m_polygonid
the unique polygon identification
Definition: GooseMemoryMap.h:51
tomis_foobar
Definition: Goose_Base.h:96
Goose_Base::m_OurPopulationManager
Goose_Population_Manager * m_OurPopulationManager
This is a time saving pointer to the correct population manager object.
Definition: Goose_Base.h:151
CfgInt::value
int value(void)
Definition: configurator.h:98
Goose_Base::m_GooseFieldForageDistX2
static double m_GooseFieldForageDistX2[gs_foobar]
Double the maximum distance travelled from roost to forage sites for each species of goose (m) - this...
Definition: Goose_Base.h:251
Goose_Base::AddBodyCondition
void AddBodyCondition(double a_condition)
Alters body conditon by addition of a double value.
Definition: Goose_Base.h:402
Goose_Population_Manager::RecordState
void RecordState()
Record the state.
Definition: Goose_Population_Manager.cpp:2272
Goose_Base::m_mingooseforagerate
static double m_mingooseforagerate[gs_foobar]
The minimum tolerable forage rate in kJ/minute for the species.
Definition: Goose_Base.h:235
GooseMemoryMap::MemAdd
void MemAdd(GooseMemoryLocation a_gml)
Add a new memory location.
Definition: GooseMemoryMap.cpp:50
Goose_Population_Manager::RemoveGeeseFromForageLocation
void RemoveGeeseFromForageLocation(GooseSpeciesType a_type, int a_index, int a_number)
Removes a goose or geese to the forage location - requires an index.
Definition: Goose_Population_Manager.cpp:1812
Goose_Population_Manager::RemoveMaxForageKj
void RemoveMaxForageKj(double a_forage, TTypeOfMaxIntakeSource a_maxintakesource, int m_myForageIndex)
Removes the forage eaten from the field.
Definition: Goose_Population_Manager.cpp:2073
togs_Emigrate
Definition: Goose_Base.h:82
Goose_Base::m_weightTotal
double m_weightTotal
The weight of the bird in g including fat reserve.
Definition: Goose_Base.h:179
cfg_goose_pf_springmigdatestart
CfgInt cfg_goose_pf_springmigdatestart
Input: Date for onset of spring migration.
ALMaSS_MathFuncs::CalcDistPythagoras
int CalcDistPythagoras(int a_x, int a_y, int a_x1, int a_y1)
Calculate distance using Pythagoras.
Definition: misc.cpp:42
Goose_Base::StartDay
virtual void StartDay(void)
Do any 'housekeeping' associated with the start of day.
Definition: Goose_Base.cpp:181
cfg_goose_pf_springmigdateend
CfgInt cfg_goose_pf_springmigdateend
Input: Date for end of spring migration.
Goose_Base::m_MyRoost
APoint m_MyRoost
The current roost location.
Definition: Goose_Base.h:167
Goose_Population_Manager::GetForageRateDensity
double GetForageRateDensity(double a_foragedensity)
Get the forage intake rate for a forage density.
Definition: Goose_Population_Manager.h:488
togs_Forage
Definition: Goose_Base.h:78
GooseMemoryLocation::m_grain
double m_grain
the grain resource at the location as intake rate kJ/min
Definition: GooseMemoryMap.h:53
Goose_Base::m_energyReserve
double m_energyReserve
The bird's energy reserves in grams.
Definition: Goose_Base.h:223
Goose_Base::m_weight
double m_weight
The weight of the bird in gram excluding fat reserve.
Definition: Goose_Base.h:175
Goose_Base::m_flightcost
static double m_flightcost
The cost of flight per g per m in kJ.
Definition: Goose_Base.h:227
GooseMemoryMap
The class describing both local and seasonal goose memories and cognition.
Definition: GooseMemoryMap.h:93