Goose Management Model ODdox
1.02
|
Go to the documentation of this file.
349 void RuleSet10Based(
int a_no_hunters, vector<int>* a_farmsizes, vector<HunterInfo>* a_hunterlist, vector<APoint>* a_roostlocs,
int a_ruleset );
353 void SaveFarmHunters( vector<HunterInfo>* a_hunterlist,
int a_no_hunters );
365 bool CheckDensity(
int a_ref, vector<int> *a_illegalfarms, vector<FarmOccupcancyData>* a_FarmOccupancy);
int m_pinkfootbaglimit
Bag limit for pinkfoot.
unsigned GetNoHuntLocs()
Calculates the number of hunting locations based on a distribution.
Goose_Population_Manager * m_preyPopulationManger
Pointer to our game population, the geese.
virtual void ResetBag()
Sets the annual hunting bag to zero.
bool IsOutHunting()
A debug function, but may be useful in other contexts. Returns true of currently out hunting.
virtual void DoLast()
Available for hunter management - not used currently.
vector< unsigned > polylist
void SetHuntingSeason()
This returns the number of geese which are legal quarry on the polygon the day before.
virtual void OnShoot()
On shoot message handler.
virtual void Init()
Initiation of a specific goose hunter here.
virtual void DoAfter()
Available for hunter management - not used currently.
bool m_leader
When hunting this indicates whether the hunter is a team leader.
int m_baglimit
Annual self-imposed limit on number shot - unused at present.
int m_HuntingSeasonStart
Start of the overall hunting season.
int m_weekend
Code for weekly hunting activity.
The class to handle all predator population related matters.
virtual void ResetBag()
Sets the annual hunting bag to zero.
bool IsTodayAPreferredHuntDay(int a_today)
Checks for the hunting day preference (weekday or any day)
int m_huntfield_polyref
The polygon reference number to our current hunting field (which is at a hunting location)
void DistributeHunters(void)
Distributes hunters to hunting locations (farms).
virtual bool IsSeasonEnd(int)
Is it the end of the hunting season? - MUST be overridden in descendent class.
GooseHunter(struct_Hunter *p_data, Hunter_Population_Manager *p_PPM)
GooseHunter constructor.
APoint GetHome()
Provide our home coords.
bool IsLeader()
Returns the leader flag.
Population_Manager * m_preyPM
vector< int > m_huntlocrefs
TypeOfHunterState st_OutHunting(void)
The basic hunting behaviour.
virtual bool IsSeasonEnd(int day)
Is it the end of the goose hunting season? - MUST be overridden in descendent class.
void HunterLeaderMessage(TypeOfHunterLeaderMessage a_signal, int a_polyref)
A message system to rely messages from the leader hunter to others in his team.
int m_huntingdays
The numbers of days used for hunting this year.
int GetShots()
Gets the number of shots this season to-date.
int m_lasthuntday
The date for the last hunt day.
bool m_dugin
Flag to show whether a hunting location has been found.
int m_huntlimit
Annual self-imposed limit on number of days spent hunting.
int GetBag()
Gets the annual hunting bag.
TypeOfHunterState
Hunters like other ALMaSS animals work using a state/transition concept. These are the hunter behavio...
virtual TypeOfHunterState st_ShouldGoHunting(void)
Decide whether to go out hunting on a specific day.
vector< Farm * > m_OurFarmers
List of pointers to the farmers whose land the hunter hunts
TypeOfHunterLeaderMessage
Types of message a hunter leader can pass on to team members.
Hunter(struct_Hunter *p_data, Hunter_Population_Manager *p_PPM)
The constructor for the Hunter class.
virtual int CheckForGame(void)
If the hunter checks for game at their hunting locations then this is done here. Must be overridden.
The landscape class containing all environmental and topographical data.
APoint GetHunterHuntLoc(int a_index, int a_list, unsigned a_ref)
Returns the hunter hunting location location.
virtual ~Hunter()
The destructor for the Hunter class.
virtual void SaveMyData(ofstream *a_ofile)
Each hunter needs to save different kinds of data, so we use a polymorphic method for this.
virtual void OnGoHome()
On gohome message handler - must be overidden in descendent classes.
int GetRef()
Provide our ref name.
virtual ~Hunter_Population_Manager(void)
Hunter population manager destructor.
void CreateObjects(int ob_type, TAnimal *, struct_Hunter *data, int number)
Creates hunter objects and assigns them to the population manager lists.
bool IsPolyrefOnActiveList(int a_polyref)
Debugging check method.
TypeOfHunterState st_OutHunting(void)
The basic hunting behaviour.
virtual int GetSeasonLengthLeft(int day)
Returns the length of the hunting season in days - MUST be overridden in descendent class.
Hunter_Population_Manager * m_OurPopulationManager
Pointer to the population manager.
vector< APoint > m_HuntLocs
virtual TypeOfHunterState st_ShouldGoHunting(void)
Behavior involved in deciding whether to go hunting.
void Init(void)
Create the initial hunter population and initializes any output options.
polylist * m_huntfields
Our list of possible hunting fields as polygon reference numbers as supplied by Landscape::SupplyPoly...
int m_myMagazine
The number of shells in the magazine.
vector< int > m_ActiveHuntingLocationsPolyrefs
Lists of polygon reference numbers for all active hunting locations (updated daily)
int GetClock()
Supplies the clock time.
int GetHuntField()
Get the polygon reference number to our current hunting field (which is at a hunting location)
int GetHuntingDays()
Gets the annual hunting attempts count.
void SaveDistributedHunters(vector< HunterInfo > *a_hunterlist, int a_no_hunters)
Saves the results of the hunter distribution to an output file.
int m_myname
A reference number unique to this hunter.
void SaveFarmHunters(vector< HunterInfo > *a_hunterlist, int a_no_hunters)
Saves the results of the hunter distribution to an output file by farm.
The class to handle all goose population related matters.
double m_goosecountchance
Probability of checking for geese in hunting area.
The base class for hunters encompsassing all their general behaviours.
virtual ~GooseHunter()
GooseHunter destructor.
virtual void DoFirst()
Does general daily tasks e.g. reset time of day, reset bag lists if start of year etc....
virtual void OnShoot()
On shoot message handler - must be overidden in descendent classes.
void OnMorning()
Optimism in the morning, perhaps we should hunt?
Farm * GetFarmerRef(unsigned a_ref)
Provide our ref name.
virtual int GetSeasonLengthLeft(int)
Returns the length of the hunting season in days - MUST be overridden in descendent class.
int m_goosebag[gst_foobar]
A special bag data structure so the hunter knows what kind of geese he shot.
int m_myShots
The numbers of shots to-date this year.
vector< APoint > m_huntlocs
int m_greylagbaglimit
Bag limit for greylag.
virtual void Step()
GooseHunter Step code.
vector< Hunter * > HunterList
virtual void OnGoHome()
On gohome message handler.
vector< int > m_HuntLocRefs
unsigned m_daytime
Used to follow the time of day in 10 minute steps.
TypeOfHunterState m_CurrentHState
The current hunter behavioural state.
void RecordHuntingSuccess(int poly, int birds, int a_hunter)
Hunting bag output.
int GetHuntingSeasonEnd()
Get the end of the overall hunting season.
int GetHuntingSeasonStart()
Get the start of the overall hunting season.
Used for creation of a new hunter object.
bool IsTodayAChosenHuntDay(int a_today)
Uses a probability test to determine whether to go hunting today.
The base class for all farm types.
ofstream * m_HuntingBagRecord
Output file for hunting bag record.
APoint GetHunterHome(int a_index, int a_list)
Returns the hunter home location.
virtual bool StepFinished()
void RuleSet10Based(int a_no_hunters, vector< int > *a_farmsizes, vector< HunterInfo > *a_hunterlist, vector< APoint > *a_roostlocs, int a_ruleset)
Used to implement rule sets based on rule set 10.
void ResetHuntingOpportunities()
Sets the annual hunting attempts count to zero.
double m_goosecountchance
void ResetSeasonData()
Sets the bag and hunting counters to zero.
Hunter_Population_Manager(Landscape *p_L)
Hunter population manager constructor.
bool FindHuntingLocation(void)
Locate the hunt for today.
APoint GetHuntLoc(unsigned a_ref)
Provide our hunting location coords.
bool CheckDensity(int a_ref, vector< int > *a_illegalfarms, vector< FarmOccupcancyData > *a_FarmOccupancy)
helper method to reduce code size in hunter rules - checks density rules
int m_HuntingSeasonEnd
End of the overall hunting season.
vector< HunterList * > m_ActiveHuntingLocationsHunters
Lists of hunters at all active hunting locations (updated daily)
virtual int CheckForGame(void)
If the hunter checks for game at their hunting locations then this is done here. Must be overridden.
void ResetClock()
Sets the clock back to zero.
int m_clock
Records the time spent hunting per day.
int m_bag
The numbers of game items shot todate this year.
TypeOfHunterState st_Resting(void)
Finished hunting and waiting for the next opportunity.
double m_efficiency
Probability of 'hitting' a game item.
virtual void SaveMyData(ofstream *)
Each hunter needs to save different kinds of data, so we use a polymorphic method for this.
The class for goose hunters encompsassing all their specific behaviours.
bool AddHunterHunting(int a_polyref, Hunter *a_hunter)
Adds a hunter hunting, returns true if that hunter is the leader otherwise false.
virtual bool InSeason(int day)
Is it goose hunting season? - MUST be overridden in descendent class.
void OnShotABird(int a_birdtype, int a_poly)
Message received when a goose is successully shot.
virtual void DoBefore()
Available for hunter management - not used currently.
virtual void Init(struct_Hunter *p_data)
Initiation of a basic hunter here.
void DistributeHuntersByRules(vector< HunterInfo > *a_hunterlist, int a_no_hunters, int a_ruleset)
Implements the rule sets to distributes hunters to hunting locations (farms).
virtual bool InSeason(int)
Is it hunting season? - MUST be overridden in descendent class.