Goose Management Model ODdox  1.02
GooseHunter Class Reference

The class for goose hunters encompsassing all their specific behaviours. More...

#include <Hunters_all.h>

Public Member Functions

 GooseHunter (struct_Hunter *p_data, Hunter_Population_Manager *p_PPM)
 GooseHunter constructor. More...
 
bool IsLeader ()
 Returns the leader flag. More...
 
void OnShotABird (int a_birdtype, int a_poly)
 Message received when a goose is successully shot. More...
 
virtual void ResetBag ()
 Sets the annual hunting bag to zero. More...
 
virtual void SaveMyData (ofstream *a_ofile)
 Each hunter needs to save different kinds of data, so we use a polymorphic method for this. More...
 
virtual void Step ()
 GooseHunter Step code. More...
 
virtual ~GooseHunter ()
 GooseHunter destructor. More...
 
- Public Member Functions inherited from Hunter
int GetBag ()
 Gets the annual hunting bag. More...
 
int GetClock ()
 Supplies the clock time. More...
 
FarmGetFarmerRef (unsigned a_ref)
 Provide our ref name. More...
 
APoint GetHome ()
 Provide our home coords. More...
 
int GetHuntField ()
 Get the polygon reference number to our current hunting field (which is at a hunting location) More...
 
int GetHuntingDays ()
 Gets the annual hunting attempts count. More...
 
APoint GetHuntLoc (unsigned a_ref)
 Provide our hunting location coords. More...
 
int GetRef ()
 Provide our ref name. More...
 
int GetShots ()
 Gets the number of shots this season to-date. More...
 
 Hunter (struct_Hunter *p_data, Hunter_Population_Manager *p_PPM)
 The constructor for the Hunter class. More...
 
bool IsOutHunting ()
 A debug function, but may be useful in other contexts. Returns true of currently out hunting. More...
 
void OnMorning ()
 Optimism in the morning, perhaps we should hunt? More...
 
void ResetClock ()
 Sets the clock back to zero. More...
 
void ResetHuntingOpportunities ()
 Sets the annual hunting attempts count to zero. More...
 
void ResetSeasonData ()
 Sets the bag and hunting counters to zero. More...
 
virtual ~Hunter ()
 The destructor for the Hunter class. More...
 

Protected Member Functions

virtual int CheckForGame (void)
 If the hunter checks for game at their hunting locations then this is done here. Must be overridden. More...
 
bool FindHuntingLocation (void)
 Locate the hunt for today. More...
 
virtual int GetSeasonLengthLeft (int day)
 Returns the length of the hunting season in days - MUST be overridden in descendent class. More...
 
virtual void Init ()
 Initiation of a specific goose hunter here. More...
 
virtual bool InSeason (int day)
 Is it goose hunting season? - MUST be overridden in descendent class. More...
 
virtual bool IsSeasonEnd (int day)
 Is it the end of the goose hunting season? - MUST be overridden in descendent class. More...
 
virtual void OnGoHome ()
 On gohome message handler. More...
 
virtual void OnShoot ()
 On shoot message handler. More...
 
TypeOfHunterState st_OutHunting (void)
 The basic hunting behaviour. More...
 
virtual TypeOfHunterState st_ShouldGoHunting (void)
 Behavior involved in deciding whether to go hunting. More...
 
- Protected Member Functions inherited from Hunter
virtual void Init (struct_Hunter *p_data)
 Initiation of a basic hunter here. More...
 
bool IsTodayAChosenHuntDay (int a_today)
 Uses a probability test to determine whether to go hunting today. More...
 
bool IsTodayAPreferredHuntDay (int a_today)
 Checks for the hunting day preference (weekday or any day) More...
 
TypeOfHunterState st_OutHunting (void)
 The basic hunting behaviour. More...
 
TypeOfHunterState st_Resting (void)
 Finished hunting and waiting for the next opportunity. More...
 

Protected Attributes

bool m_dugin
 Flag to show whether a hunting location has been found. More...
 
int m_goosebag [gst_foobar]
 A special bag data structure so the hunter knows what kind of geese he shot. More...
 
int m_greylagbaglimit
 Bag limit for greylag. More...
 
polylistm_huntfields
 Our list of possible hunting fields as polygon reference numbers as supplied by Landscape::SupplyPolyRef(int,int);. More...
 
bool m_leader
 When hunting this indicates whether the hunter is a team leader. More...
 
int m_pinkfootbaglimit
 Bag limit for pinkfoot. More...
 
Goose_Population_Managerm_preyPopulationManger
 Pointer to our game population, the geese. More...
 
- Protected Attributes inherited from Hunter
int m_bag
 The numbers of game items shot todate this year. More...
 
int m_baglimit
 Annual self-imposed limit on number shot - unused at present. More...
 
int m_clock
 Records the time spent hunting per day. More...
 
TypeOfHunterState m_CurrentHState
 The current hunter behavioural state. More...
 
double m_efficiency
 Probability of 'hitting' a game item. More...
 
double m_goosecountchance
 Probability of checking for geese in hunting area. More...
 
APoint m_Home
 
int m_huntfield_polyref
 The polygon reference number to our current hunting field (which is at a hunting location) More...
 
int m_huntingdays
 The numbers of days used for hunting this year. More...
 
int m_huntlimit
 Annual self-imposed limit on number of days spent hunting. More...
 
vector< int > m_HuntLocRefs
 
vector< APoint > m_HuntLocs
 
int m_lasthuntday
 The date for the last hunt day. More...
 
int m_myMagazine
 The number of shells in the magazine. More...
 
int m_myname
 A reference number unique to this hunter. More...
 
int m_myShots
 The numbers of shots to-date this year. More...
 
int m_NoHuntLocs
 
vector< Farm * > m_OurFarmers
 List of pointers to the farmers whose land the hunter hunts
More...
 
Hunter_Population_Managerm_OurPopulationManager
 Pointer to the population manager. More...
 
int m_weekend
 Code for weekly hunting activity. More...
 

Detailed Description

The class for goose hunters encompsassing all their specific behaviours.

Definition at line 268 of file Hunters_all.h.

Constructor & Destructor Documentation

◆ GooseHunter()

GooseHunter::GooseHunter ( struct_Hunter p_data,
Hunter_Population_Manager p_PPM 
)

◆ ~GooseHunter()

GooseHunter::~GooseHunter ( )
virtual

GooseHunter destructor.

Definition at line 1207 of file Hunters_all.cpp.

1208 {
1209  if (m_huntfields != NULL) delete m_huntfields;
1210 }

References m_huntfields.

Member Function Documentation

◆ CheckForGame()

int GooseHunter::CheckForGame ( void  )
protectedvirtual

If the hunter checks for game at their hunting locations then this is done here. Must be overridden.

Returns
int a polygon reference if we are to go hunting, or -1 = don't go hunting today

The hunter checks for legal game at their hunting fields if they are set to do so, otherwise they take a random shot at a place.
If they don't check then they automatically assume they can go out hunting.
Here we assume they check all their hunting locations and pick the best. We might also want as a later refinement to know how many geese because and only go out when there are a lot.

Reimplemented from Hunter.

Definition at line 1231 of file Hunters_all.cpp.

1231  {
1240  int sz = int(m_huntfields->size());
1241  if (g_rand_uni() >= m_goosecountchance) {
1242  int thepolyref = (*m_huntfields)[int(g_rand_uni()*sz)]; // returns 0 to sz-1;
1243  return thepolyref;
1244  }
1245  else {
1246  // We are checking today, so check out hunting fields
1247  int polyref = -1;
1248  int maxgeese = 0;
1249  for (int hfield = 0; hfield < sz; hfield++) {
1250  int geese = m_OurLandscape->GetQuarryNumbers((*m_huntfields)[hfield]);
1251  if (geese > maxgeese) {
1252  maxgeese = geese;
1253  polyref = (*m_huntfields)[hfield];
1254  }
1255  }
1256  return polyref;
1257  }
1258 }

References g_rand_uni, Hunter::m_goosecountchance, and m_huntfields.

Referenced by st_OutHunting().

◆ FindHuntingLocation()

bool GooseHunter::FindHuntingLocation ( void  )
protected

Locate the hunt for today.

◆ GetSeasonLengthLeft()

int GooseHunter::GetSeasonLengthLeft ( int  day)
protectedvirtual

Returns the length of the hunting season in days - MUST be overridden in descendent class.

The goose hunting season is complicated because it runs over a year boundary (or it can)

Reimplemented from Hunter.

Definition at line 1296 of file Hunters_all.cpp.

1296  {
1297  if (m_OurPopulationManager->GetSeasonNumber() == 0) return 0; // We don't want them to start in January in the first year of the sim.
1298  int left;
1302  if (start > end) {
1303  // We have a year boundary issue, if the day is in the autumn then we have til the end of year + next year, otherwise we must be in next year already.
1304  if (day >= start) left = (365 - day) + end;
1305  else left = end - day;
1306  }
1307  else {
1308  left = end - day;
1309  }
1310  // We don't want to return a negative number of days, so rather want to say no days left, i.e. 0
1311  if (left < 0) return 0;
1312  return left;
1313 }

References Hunter_Population_Manager::GetHuntingSeasonEnd(), Hunter_Population_Manager::GetHuntingSeasonStart(), Hunter::m_OurPopulationManager, and start.

◆ Init()

void GooseHunter::Init ( void  )
protectedvirtual

Initiation of a specific goose hunter here.

Here we need to create a list of possible goose hunting fields in our hunting locations. So we ask for openness scores for any fields with at each of our hunting locations. This is provided by Farm::ListOpenFields

Definition at line 1212 of file Hunters_all.cpp.

1213 {
1219  m_huntfields = new polylist;
1220  for (int i = 0; i < m_NoHuntLocs; i++)
1221  {
1222  polylist* pl = m_OurFarmers[i]->ListOpenFields((int)cfg_goose_MinForageOpenness.value());
1223  m_huntfields->insert(m_huntfields->begin(), pl->begin(), pl->end()); // add the new one to the main polylist
1224  delete pl;
1225  }
1226  ResetClock();
1227  ResetSeasonData();
1228 }

References cfg_goose_MinForageOpenness, m_huntfields, Hunter::m_NoHuntLocs, Hunter::m_OurFarmers, Hunter::ResetClock(), Hunter::ResetSeasonData(), and CfgFloat::value().

Referenced by GooseHunter().

◆ InSeason()

bool GooseHunter::InSeason ( int  day)
protectedvirtual

Is it goose hunting season? - MUST be overridden in descendent class.

The goose hunting season is complicated because it runs over a year boundary (or it can) Particularly the first year of the simulation is tricky, because we start out in January which can be legal hunting season, but the geese don't arrive until the fall.

Reimplemented from Hunter.

Definition at line 1271 of file Hunters_all.cpp.

1271  {
1278  if (m_OurPopulationManager->GetSeasonNumber() == 0) {
1279 
1280  return false; // We don't want them to start in January in the first year of the sim.
1281  }
1282  if (start > end) {
1283  if ((day < start) && (day > end)) return false;
1284  else {
1285  return true; // must be in the first year after the start of season
1286  }
1287  }
1288  else {
1289  // Season all in one year
1290  if (day < start || day > end) return false;
1291  else {
1292  return true;
1293  }
1294  }
1295 }

References Hunter_Population_Manager::GetHuntingSeasonEnd(), Hunter_Population_Manager::GetHuntingSeasonStart(), Hunter::m_OurPopulationManager, and start.

◆ IsLeader()

bool GooseHunter::IsLeader ( )
inline

Returns the leader flag.

Definition at line 325 of file Hunters_all.h.

325  {
326  return m_leader;
327  }

References m_leader.

Referenced by Hunter_Population_Manager::DoFirst().

◆ IsSeasonEnd()

bool GooseHunter::IsSeasonEnd ( int  day)
protectedvirtual

Is it the end of the goose hunting season? - MUST be overridden in descendent class.

Reimplemented from Hunter.

Definition at line 1260 of file Hunters_all.cpp.

1260  {
1262  if (end == 365){
1263  m_OurLandscape->Warn("GooseHunter::IsSeasonEnd()", "Hunting season end at day 365. First day of the year is 0 hence last day of year is 364");
1264  exit(1);
1265  }
1266  if (day == 1 + end) return true;
1267  if (day == 0 && end == 364) return true; // if the hunting season ends at the end of the year, then day 0 is after it.
1268  return false;
1269 }

References Hunter_Population_Manager::GetHuntingSeasonEnd(), and Hunter::m_OurPopulationManager.

◆ OnGoHome()

void GooseHunter::OnGoHome ( )
protectedvirtual

On gohome message handler.

Reimplemented from Hunter.

Definition at line 1438 of file Hunters_all.cpp.

1438  {
1439  m_dugin = false; // End of the hunt, so no longer dugin
1440  m_leader = false; // Hunt is over, so nothing to lead.
1441  m_huntfield_polyref = -1; // This has to be reset. We find a new one next time we go hunting.
1442  m_CurrentHState = tohts_Resting; // Come home
1443 }

References Hunter::m_CurrentHState, m_dugin, Hunter::m_huntfield_polyref, m_leader, and tohts_Resting.

◆ OnShoot()

void GooseHunter::OnShoot ( )
protectedvirtual

On shoot message handler.

This is a message handler for the situation when a hunter is in a team but not the leader. When the leader decides to shoot the other team members hunter will shoot. When a bird is shot the message is sent to the goose population manager. This works out which birds are shot and removes them, calling back with an OnShotABird message so the hunter can record what has been shot. It is here that the bag record is kept.

Reimplemented from Hunter.

Definition at line 1419 of file Hunters_all.cpp.

1419  {
1426  int numbershot = 0;
1427  m_myShots++;
1428  if (g_rand_uni() < m_efficiency) numbershot++;
1429  if (birds > 1){
1430  if (g_rand_uni() < m_efficiency) numbershot++;
1431  m_myShots++;
1432  }
1433  if (numbershot > 0) {
1435  }
1436 }

References Goose_Population_Manager::BirdsShot(), Goose_Population_Manager::BirdsToShootAtPoly(), g_rand_uni, Hunter::m_efficiency, Hunter::m_huntfield_polyref, Hunter::m_myShots, and m_preyPopulationManger.

◆ OnShotABird()

void GooseHunter::OnShotABird ( int  a_birdtype,
int  a_poly 
)

Message received when a goose is successully shot.

Definition at line 1413 of file Hunters_all.cpp.

1413  {
1414  m_bag++;
1415  m_goosebag[a_birdtype]++;
1417 }

References cfg_Hunters_RecordBag, Hunter::m_bag, m_goosebag, Hunter::m_myname, Hunter::m_OurPopulationManager, Hunter_Population_Manager::RecordHuntingSuccess(), and CfgBool::value().

Referenced by Goose_Population_Manager::BirdsShot().

◆ ResetBag()

virtual void GooseHunter::ResetBag ( )
inlinevirtual

Sets the annual hunting bag to zero.

Reimplemented from Hunter.

Definition at line 320 of file Hunters_all.h.

320  {
322  for (int i = 0; i < gst_foobar; i++) m_goosebag[ i ] = 0;
323  }

References gst_foobar, m_goosebag, and Hunter::ResetBag().

◆ SaveMyData()

void GooseHunter::SaveMyData ( ofstream *  a_ofile)
virtual

Each hunter needs to save different kinds of data, so we use a polymorphic method for this.

Reimplemented from Hunter.

Definition at line 1469 of file Hunters_all.cpp.

1469  {
1470  (*a_ofile) << m_myname << '\t' << GetHuntingDays() << '\t' << GetBag() << '\t' << GetShots();
1471  for (int i = 0; i < gst_foobar; i++) {
1472  (*a_ofile) << '\t' << m_goosebag[ i ];
1473  }
1474  (*a_ofile) << endl;
1475 
1476 }

References Hunter::GetBag(), Hunter::GetHuntingDays(), Hunter::GetShots(), gst_foobar, m_goosebag, and Hunter::m_myname.

◆ st_OutHunting()

TypeOfHunterState GooseHunter::st_OutHunting ( void  )
protected

The basic hunting behaviour.

First at last check if the hunter checks for geese before going, if there are none he does not go out. Simulates a 10 minute hunting timestep. Must determine the time spent hunting and the time of day. Then wait for geese, and determine the probability of shooting them. Once the hunting time is used up, then come home.

We have a place to hunt - so look and see if there is anything to shoot Must assess a range from our location - we will be centrally placed in a field - so the real location is not precise beyond this resolution. Birds will also be located at the field level, so a simplifying assumption here is that a bird in the same field is 'fair game', outside the field it is not. Once we determine that there is something to shoot at, then we need to determine whether, we try and shoot, if so whether we hit the bird. If we shoot this must be registered in the system as an event, and any goose near enough to be affected will need to be told of this.

m_huntloc_index holds the polyref, from which we can get access to the forage locations in the goose manager - this has a list of who is there at any one moment in time.

When assessing whether to shoot the mix of the birds present will be critical. If it is primarily Barnacles then these are protected so the hunter will not shoot if not he can go ahead. The current solution just ignores barnacle geese - they cannot be shot and are not counted in the number of geese on a field.

A further consideration is whether the geese land near to the hunter. If too far away then they will not shoot. This depends on the area of the field. We assume that any field of less than 2Ha, then the geese are close enough, but if over this then there is a cfg_largefieldgooseproximity chance of shooting.

To Determine if we try to shoot and the chance of hitting, right now we assume we always shoot and the chance of hitting something is our skill - held in m_efficiency. The hunter has as many shots as is in his magazine (determined by the member variable m_myMagazine)

When a bird is shot the message is sent to the goose population manager. This works out which birds are shot and removes them, calling back with an OnShotABird message so the hunter can record what has been shot. It is here that the bag record is kept.

Definition at line 1332 of file Hunters_all.cpp.

1333 {
1341  m_clock += 10; // this is not strictly necessary, but makes useful debug info (only leader cares)
1342  if (!m_dugin) {
1344  if (m_huntfield_polyref == -1) return tohts_Resting;
1345  else {
1346  m_huntingdays++;
1347  m_dugin = true;
1349  m_lasthuntday = m_OurLandscape->SupplyGlobalDate();
1350  return tohts_OutHunting;
1351  }
1352  }
1353  if (m_leader) {
1354  // Only the leader assesses this
1355  if (m_clock > cfg_huntlength.value())
1356  {
1357  m_dugin = false;
1359  m_huntfield_polyref = -1;
1360  return tohts_Resting; // Come home
1361  }
1377  double fieldsize = m_OurLandscape->SupplyPolygonArea( m_huntfield_polyref );
1378  double shootingchance = 1.0;
1379  if (fieldsize > cfg_largefieldgooseproximitysizecutoff.value()) {
1380  shootingchance = cfg_largefieldgooseproximity.value();
1381  }
1382  /*double pct = 0.0;*/
1384 
1385  if ((birds > 0) && (g_rand_uni() < shootingchance) /* && (pct<cfg_huntermaxprotectedpct.value())*/ ) {
1393  int numbershot = 0;
1394  for (int i = 0; i < m_myMagazine; ++i) {
1395  if ((birds > i) || (numbershot == 0))
1396  {
1397  if (g_rand_uni() < m_efficiency) numbershot++;
1398  m_myShots++;
1399  }
1400  }
1401  if (numbershot > 0) {
1403  }
1405  // All shots are fired then make some sound
1406  // Must scare any birds off that are near here and get them to remember the event
1408  }
1409  }
1410  return tohts_OutHunting;
1411 }

References Hunter_Population_Manager::AddHunterHunting(), Goose_Population_Manager::BangAtPoly(), Goose_Population_Manager::BirdsShot(), Goose_Population_Manager::BirdsToShootAtPoly(), cfg_huntlength, cfg_largefieldgooseproximity, cfg_largefieldgooseproximitysizecutoff, CheckForGame(), g_rand_uni, hlm_gohome, hlm_shoot, Hunter_Population_Manager::HunterLeaderMessage(), Hunter::m_clock, m_dugin, Hunter::m_efficiency, Hunter::m_huntfield_polyref, Hunter::m_huntingdays, Hunter::m_lasthuntday, m_leader, Hunter::m_myMagazine, Hunter::m_myShots, Hunter::m_OurPopulationManager, m_preyPopulationManger, tohts_OutHunting, tohts_Resting, CfgInt::value(), and CfgFloat::value().

Referenced by Step().

◆ st_ShouldGoHunting()

TypeOfHunterState GooseHunter::st_ShouldGoHunting ( void  )
protectedvirtual

Behavior involved in deciding whether to go hunting.

Here we check for any goose specific bag limits

Otherwise we want to find out if we should hunt today - this depends on the season for our game species, and whether we want to hunt today - which depends on whether it is a weekend or not - and then how eager we are.

Reimplemented from Hunter.

Definition at line 1315 of file Hunters_all.cpp.

1316 {
1324  else
1325  {
1326  return(Hunter::st_ShouldGoHunting());
1327  }
1328 
1329 }

References gst_PinkfootFamilyGroup, gst_PinkfootNonBreeder, m_goosebag, m_pinkfootbaglimit, Hunter::st_ShouldGoHunting(), and tohts_Resting.

Referenced by Step().

◆ Step()

void GooseHunter::Step ( void  )
virtual

GooseHunter Step code.

Definition at line 1446 of file Hunters_all.cpp.

1447 {
1448  if (m_StepDone || m_CurrentStateNo == -1) return;
1449  switch (m_CurrentHState)
1450  {
1451  case tohts_InitialState: // Initial state always starts by setting the behaviour to tohts_Hunting
1453  break;
1454  case tohts_Hunting:
1456  break;
1457  case tohts_OutHunting:
1459  break;
1460  case tohts_Resting:
1462  break;
1463  default:
1464  m_OurLandscape->Warn("GooseHunter::Step()","unknown state - default");
1465  exit(1);
1466  }
1467 }

References Hunter::m_CurrentHState, st_OutHunting(), Hunter::st_Resting(), st_ShouldGoHunting(), tohts_Hunting, tohts_InitialState, tohts_OutHunting, and tohts_Resting.

Member Data Documentation

◆ m_dugin

bool GooseHunter::m_dugin
protected

Flag to show whether a hunting location has been found.

Definition at line 277 of file Hunters_all.h.

Referenced by OnGoHome(), and st_OutHunting().

◆ m_goosebag

int GooseHunter::m_goosebag[gst_foobar]
protected

A special bag data structure so the hunter knows what kind of geese he shot.

Definition at line 279 of file Hunters_all.h.

Referenced by OnShotABird(), ResetBag(), SaveMyData(), and st_ShouldGoHunting().

◆ m_greylagbaglimit

int GooseHunter::m_greylagbaglimit
protected

Bag limit for greylag.

Definition at line 283 of file Hunters_all.h.

Referenced by GooseHunter().

◆ m_huntfields

polylist* GooseHunter::m_huntfields
protected

Our list of possible hunting fields as polygon reference numbers as supplied by Landscape::SupplyPolyRef(int,int);.

Definition at line 275 of file Hunters_all.h.

Referenced by CheckForGame(), Init(), and ~GooseHunter().

◆ m_leader

bool GooseHunter::m_leader
protected

When hunting this indicates whether the hunter is a team leader.

Definition at line 285 of file Hunters_all.h.

Referenced by GooseHunter(), IsLeader(), OnGoHome(), and st_OutHunting().

◆ m_pinkfootbaglimit

int GooseHunter::m_pinkfootbaglimit
protected

Bag limit for pinkfoot.

Definition at line 281 of file Hunters_all.h.

Referenced by GooseHunter(), and st_ShouldGoHunting().

◆ m_preyPopulationManger

Goose_Population_Manager* GooseHunter::m_preyPopulationManger
protected

Pointer to our game population, the geese.

Definition at line 273 of file Hunters_all.h.

Referenced by GooseHunter(), OnShoot(), and st_OutHunting().


The documentation for this class was generated from the following files:
GooseHunter::m_pinkfootbaglimit
int m_pinkfootbaglimit
Bag limit for pinkfoot.
Definition: Hunters_all.h:281
Goose_Population_Manager::BangAtPoly
void BangAtPoly(int a_polyref)
Passes a 'Bang' message to birds near to the location specified by the polygon reference.
Definition: Goose_Population_Manager.cpp:1947
GooseHunter::m_preyPopulationManger
Goose_Population_Manager * m_preyPopulationManger
Pointer to our game population, the geese.
Definition: Hunters_all.h:273
Hunter::ResetBag
virtual void ResetBag()
Sets the annual hunting bag to zero.
Definition: Hunters_all.h:201
polylist
vector< unsigned > polylist
Definition: farm.h:207
GooseHunter::Init
virtual void Init()
Initiation of a specific goose hunter here.
Definition: Hunters_all.cpp:1212
GooseHunter::m_leader
bool m_leader
When hunting this indicates whether the hunter is a team leader.
Definition: Hunters_all.h:285
Hunter::m_huntfield_polyref
int m_huntfield_polyref
The polygon reference number to our current hunting field (which is at a hunting location)
Definition: Hunters_all.h:157
g_rand_uni
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
cfg_largefieldgooseproximitysizecutoff
static CfgInt cfg_largefieldgooseproximitysizecutoff("HUNTER_LARGEFIELDGOOSEPROXIMITYCHANCESIZECUTOFF", CFG_CUSTOM, 20000)
The size of the field which will trigger the use of cfg_largefieldgooseproximity.
struct_Hunter::m_farms
vector< Farm * > m_farms
Definition: Hunters_all.h:89
struct_Hunter::m_preyPM
Population_Manager * m_preyPM
Definition: Hunters_all.h:95
start
Definition: treatment.h:32
Hunter_Population_Manager::HunterLeaderMessage
void HunterLeaderMessage(TypeOfHunterLeaderMessage a_signal, int a_polyref)
A message system to rely messages from the leader hunter to others in his team.
Definition: Hunters_all.cpp:1027
Hunter::m_huntingdays
int m_huntingdays
The numbers of days used for hunting this year.
Definition: Hunters_all.h:139
Hunter::GetShots
int GetShots()
Gets the number of shots this season to-date.
Definition: Hunters_all.h:197
Hunter::m_lasthuntday
int m_lasthuntday
The date for the last hunt day.
Definition: Hunters_all.h:141
GooseHunter::m_dugin
bool m_dugin
Flag to show whether a hunting location has been found.
Definition: Hunters_all.h:277
Hunter::GetBag
int GetBag()
Gets the annual hunting bag.
Definition: Hunters_all.h:193
Hunter::st_ShouldGoHunting
virtual TypeOfHunterState st_ShouldGoHunting(void)
Decide whether to go out hunting on a specific day.
Definition: Hunters_all.cpp:1109
Hunter::m_OurFarmers
vector< Farm * > m_OurFarmers
List of pointers to the farmers whose land the hunter hunts
Definition: Hunters_all.h:153
cfg_Hunters_RecordBag
static CfgBool cfg_Hunters_RecordBag("HUNTERS_RECORDBAG", CFG_CUSTOM, false)
Should we record the birds shot?
Hunter::m_NoHuntLocs
int m_NoHuntLocs
Definition: Hunters_all.h:159
cfg_hunter_pinkfootbaglimit
static CfgInt cfg_hunter_pinkfootbaglimit("HUNTER_PINKFOOTBAGLIMIT", CFG_CUSTOM, 9999)
The pinkfoot hunting bag limit.
Hunter::Hunter
Hunter(struct_Hunter *p_data, Hunter_Population_Manager *p_PPM)
The constructor for the Hunter class.
Definition: Hunters_all.cpp:1075
GooseHunter::CheckForGame
virtual int CheckForGame(void)
If the hunter checks for game at their hunting locations then this is done here. Must be overridden.
Definition: Hunters_all.cpp:1231
cfg_huntlength
static CfgInt cfg_huntlength("GOOSE_HUNTER_HUNT_LENGTH", CFG_CUSTOM, 180)
The default length of hunting.
hlm_shoot
Definition: Hunters_all.h:70
cfg_goose_MinForageOpenness
CfgFloat cfg_goose_MinForageOpenness
The minimum openness score that a goose will tolerate for foraging.
GooseHunter::st_OutHunting
TypeOfHunterState st_OutHunting(void)
The basic hunting behaviour.
Definition: Hunters_all.cpp:1332
Hunter::m_OurPopulationManager
Hunter_Population_Manager * m_OurPopulationManager
Pointer to the population manager.
Definition: Hunters_all.h:129
GooseHunter::st_ShouldGoHunting
virtual TypeOfHunterState st_ShouldGoHunting(void)
Behavior involved in deciding whether to go hunting.
Definition: Hunters_all.cpp:1315
GooseHunter::m_huntfields
polylist * m_huntfields
Our list of possible hunting fields as polygon reference numbers as supplied by Landscape::SupplyPoly...
Definition: Hunters_all.h:275
Hunter::m_myMagazine
int m_myMagazine
The number of shells in the magazine.
Definition: Hunters_all.h:137
Hunter::GetHuntingDays
int GetHuntingDays()
Gets the annual hunting attempts count.
Definition: Hunters_all.h:189
gst_PinkfootNonBreeder
Definition: Goose_Base.h:61
Hunter::m_myname
int m_myname
A reference number unique to this hunter.
Definition: Hunters_all.h:125
gst_foobar
Definition: Goose_Base.h:66
Goose_Population_Manager::BirdsShot
void BirdsShot(int a_polyref, int a_numbershot, GooseHunter *a_Hunter)
Passes the message to shoot a number of birds at a forage location.
Definition: Goose_Population_Manager.cpp:1862
Hunter::m_goosecountchance
double m_goosecountchance
Probability of checking for geese in hunting area.
Definition: Hunters_all.h:149
CfgFloat::value
double value(void)
Definition: configurator.h:118
GooseHunter::m_goosebag
int m_goosebag[gst_foobar]
A special bag data structure so the hunter knows what kind of geese he shot.
Definition: Hunters_all.h:279
Hunter::m_myShots
int m_myShots
The numbers of shots to-date this year.
Definition: Hunters_all.h:135
GooseHunter::m_greylagbaglimit
int m_greylagbaglimit
Bag limit for greylag.
Definition: Hunters_all.h:283
hlm_gohome
Definition: Hunters_all.h:71
tohts_Resting
Definition: Hunters_all.h:60
Hunter::m_CurrentHState
TypeOfHunterState m_CurrentHState
The current hunter behavioural state.
Definition: Hunters_all.h:127
Hunter_Population_Manager::RecordHuntingSuccess
void RecordHuntingSuccess(int poly, int birds, int a_hunter)
Hunting bag output.
Definition: Hunters_all.cpp:1002
Hunter_Population_Manager::GetHuntingSeasonEnd
int GetHuntingSeasonEnd()
Get the end of the overall hunting season.
Definition: Hunters_all.h:381
Hunter_Population_Manager::GetHuntingSeasonStart
int GetHuntingSeasonStart()
Get the start of the overall hunting season.
Definition: Hunters_all.h:379
gst_PinkfootFamilyGroup
Definition: Goose_Base.h:60
tohts_Hunting
Definition: Hunters_all.h:58
tohts_OutHunting
Definition: Hunters_all.h:59
CfgInt::value
int value(void)
Definition: configurator.h:98
Hunter::ResetSeasonData
void ResetSeasonData()
Sets the bag and hunting counters to zero.
Definition: Hunters_all.h:218
tohts_InitialState
Definition: Hunters_all.h:57
cfg_hunter_greylagbaglimit
static CfgInt cfg_hunter_greylagbaglimit("HUNTER_GREYLAGBAGLIMIT", CFG_CUSTOM, 9999)
The greylag hunting bag limit.
Hunter::ResetClock
void ResetClock()
Sets the clock back to zero.
Definition: Hunters_all.h:214
cfg_largefieldgooseproximity
static CfgFloat cfg_largefieldgooseproximity("HUNTER_LARGEFIELDGOOSEPROXIMITYCHANCE", CFG_CUSTOM, 0.5)
The likelihood that geese are close enough to shoot on large fields
Hunter::m_clock
int m_clock
Records the time spent hunting per day.
Definition: Hunters_all.h:131
Goose_Population_Manager::BirdsToShootAtPoly
int BirdsToShootAtPoly(int a_poly)
Returns the number of birds at a forage location - given by a poly ref.
Definition: Goose_Population_Manager.cpp:1833
Hunter::m_bag
int m_bag
The numbers of game items shot todate this year.
Definition: Hunters_all.h:133
Hunter::st_Resting
TypeOfHunterState st_Resting(void)
Finished hunting and waiting for the next opportunity.
Definition: Hunters_all.cpp:1185
CfgBool::value
bool value(void)
Definition: configurator.h:135
Hunter::m_efficiency
double m_efficiency
Probability of 'hitting' a game item.
Definition: Hunters_all.h:147
Hunter_Population_Manager::AddHunterHunting
bool AddHunterHunting(int a_polyref, Hunter *a_hunter)
Adds a hunter hunting, returns true if that hunter is the leader otherwise false.
Definition: Hunters_all.cpp:1478