ALMaSS Partridge ODdox
1.1
The partridge model description following ODdox protocol
|
The collective for a family of partridges
More...
#include <Partridge_Covey.h>
Public Member Functions | |
bool | NestFindSlow (int a_min_x_incl, int a_max_x_excl, int a_min_y_incl, int a_max_y_excl) |
Find nest location (wrap around) More... | |
bool | CoveyEmigrate () |
Test for covey emigration. More... | |
void | CoveyIndividualEmigrate () |
Test for individuals from covey emigrating. More... | |
bool | TooClose () |
Test for another covey too close. More... | |
bool | HaveWeChicks (void) |
Check if covey contains chicks. More... | |
int | GetUncleNumber () |
Returns the number of uncles. More... | |
int | GetmaxAllowedMove () |
Return the max possible move distance today. More... | |
double | GetmaxFoodNeedToday () |
Return the maximum food need today. More... | |
void | OnAddChick (Partridge_Female *a_pf) |
Add a chick. More... | |
void | OnChickDeath () |
Remove a dead chick. More... | |
void | OnChickMature () |
Remove a matured chick. More... | |
void | ChickExtraMortality () |
Apply extra chick mortality. More... | |
void | SetCoveyDissolveDate (int date) |
Set the dissolve date. More... | |
Partridge_Female * | FindMeAMateInCovey (int a_family_counter) |
Is their a suitable female mate in the covey? More... | |
Partridge_Female * | GetUnpairedFemale () |
Finds the first unpaired female in the covey. More... | |
Partridge_Female * | GetUnpairedFemale_virgin () |
Finds the first never paired female in the covey. More... | |
Partridge_Male * | GetMaleInCovey () |
Find a male in the covey. More... | |
Partridge_Base * | GetMember (int a_member) |
Returns pointer to a_member. More... | |
Partridge_Base * | GetAMember () |
Returns a random member. More... | |
Partridge_Covey * | FindNeighbour () |
Finds the closest other covey. More... | |
void | OnDissolve (int date) |
Dissolve message handler. More... | |
bool | AllFlocking () |
Debug method. More... | |
bool | AllFlocking2 () |
Debug method. More... | |
bool | ArePaired () |
Debug method. More... | |
void | SanityCheck () |
Debug method. More... | |
void | SanityCheck3 () |
Debug method. More... | |
void | SanityCheck4 () |
Debug method. More... | |
void | SanityCheck2 (int no_chicks) |
Debug method. More... | |
void | RemoveExtraChick () |
Decrement the chick number. More... | |
int | GetOurChicks () |
Return the number of chicks. More... | |
unsigned int | GetCoveySize () |
Return the covey size. More... | |
void | SetChickAge (int age) |
Set chick age. More... | |
int | GetChickAge () |
Return chick age. More... | |
bool | CanWeMerge (int a_NoUncles) |
Merging test. More... | |
bool | ManagerCheckMerge (int a_noOfUncles) |
Merging test for uncle number. More... | |
void | SetUncle () |
Swap uncle to alhpha. More... | |
void | KillExcessChicks (int remaining) |
Kill extra chicks. More... | |
void | ActOnParentDeath () |
Determine the chick mortality on parent death. More... | |
bool | NestFindLocation (void) |
Try to locate a suitable nesting location. More... | |
bool | NestOnNest (void) |
Are we nesting? More... | |
void | NestLeave (void) |
Leave the nest More... | |
int | NestGetX (void) |
Return nest x-coord. More... | |
int | NestGetY (void) |
Return nest y-coord. More... | |
double | SupplyFoodToday (void) |
Return the food obtained today. More... | |
double | SupplyDistanceMoved (void) |
Return the distance moved today. More... | |
double | AssessHabitatQuality (int &a_sz) |
Assess habitat quality (with checks) More... | |
double | AssessHabitatQualityFaster () |
Assess habitat quality (efficient) More... | |
int | AssessGetSize (void) |
Get the size ('radius') used during territory evaluation. More... | |
void | FixHabitat (void) |
Accept this breeding location. More... | |
double | SupplyHabitatQuality () |
Return habitat quality at our location. More... | |
void | SetFixed (bool a_is_fixed) |
Prevent/enable peg drift. More... | |
bool | IsFixed (void) |
Wonder whether the peg is fixed? More... | |
Partridge_Object | GetObjectType (void) |
Return object type. More... | |
void | MoveDistance (int a_max_distance, int a_step_size, double a_food_density_needed) |
Entry point for movement. More... | |
int | MoveCanMove (int a_x, int a_y) |
Test of movement step. More... | |
bool | FlyTo (int a_distance) |
Fly to More... | |
void | MoveTo (int a_x, int a_y) |
unused More... | |
Partridge_Male * | FindMeAHusband (Partridge_Female *a_female) |
Find mate in covey. More... | |
Partridge_Female * | FindMeAWife (Partridge_Male *a_male) |
Find mate in covey. More... | |
Partridge_Base * | GetUncle () |
Find uncle in covey. More... | |
Partridge_Female * | FindMateInArea (int a_max_distance) |
Find mate in area. More... | |
void | BeginStep (void) |
Covey BeginStep. More... | |
void | Step (void) |
Covey Step. More... | |
void | EndStep (void) |
Covey EndStep. More... | |
void | AddMember (Partridge_Base *a_new_member) |
More... | |
bool | IsMember (Partridge_Base *a_possible_member) |
More... | |
int | RemoveMember (Partridge_Base *a_former_member) |
Remove a member from the covey. More... | |
unsigned int | Memberships (void) |
Get covey size. More... | |
bool | LifeEssenceLow (void) |
More... | |
bool | ForceLow (void) |
More... | |
unsigned int | X (void) |
More... | |
unsigned int | Y (void) |
More... | |
unsigned int | XCenter (void) |
More... | |
unsigned int | YCenter (void) |
More... | |
double | XCenterF (void) |
More... | |
double | YCenterF (void) |
More... | |
unsigned int | ID (void) |
More... | |
void | ManagerCheckMerge (void) |
More... | |
void | ManagerRethinkPos (void) |
More... | |
void | ManagerDriftPos (void) |
More... | |
void | ManagerUpdatePos (void) |
More... | |
void | ManagerSetPermanent (void) |
Unused More... | |
bool | ManagerIsPermanant (void) |
Unused More... | |
Partridge_Covey (Partridge_Base *a_first_member, Partridge_Population_Manager *a_manager, unsigned int a_center_x, unsigned int a_center_y, Landscape *a_map) | |
Constructor. More... | |
virtual | ~Partridge_Covey (void) |
Destructor. More... | |
Public Member Functions inherited from TAnimal | |
unsigned | SupplyFarmOwnerRef () |
AnimalPosition | SupplyPosition () |
APoint | SupplyPoint () |
int | SupplyPolygonRef () |
int | Supply_m_Location_x () |
int | Supply_m_Location_y () |
virtual void | KillThis () |
virtual void | CopyMyself () |
void | SetX (int a_x) |
void | SetY (int a_y) |
TAnimal (int x, int y, Landscape *L) | |
virtual void | ReinitialiseObject (int x, int y, Landscape *L) |
Used to re-use an object - must be implemented in descendent classes. More... | |
virtual int | WhatState () |
virtual void | Dying () |
void | CheckManagement (void) |
void | CheckManagementXY (int x, int y) |
virtual bool | OnFarmEvent (FarmToDo) |
Public Member Functions inherited from TALMaSSObject | |
int | GetCurrentStateNo () |
Returns the current state number. More... | |
void | SetCurrentStateNo (int a_num) |
Sets the current state number. More... | |
bool | GetStepDone () |
Returns the step done indicator flag. More... | |
void | SetStepDone (bool a_bool) |
Sets the step done indicator flag. More... | |
virtual void | ReinitialiseObject () |
Used to re-use an object - must be implemented in descendent classes. More... | |
TALMaSSObject () | |
The constructor for TALMaSSObject. More... | |
virtual | ~TALMaSSObject () |
The destructor for TALMaSSObject. More... | |
void | OnArrayBoundsError () |
Used for debugging only, tests basic object properties. More... | |
Public Attributes | |
Partridge_Covey * | m_neighbourlist [50] |
List of coveys close to this covey. More... | |
int | m_neighbourlist_size |
Number of coveys close to this covey. More... | |
Protected Member Functions | |
void | CoveyUpdateMemberPositions (int a_x, int a_y) |
Update all covey members x,y coords. More... | |
bool | NestGoodSpot (int a_x, int a_y) |
Evaluate x,y as a nest location. More... | |
bool | NestFindFast (int a_min_x_incl, int a_max_x_excl, int a_min_y_incl, int a_max_y_excl) |
Find nest location. More... | |
int | Norm (int a_coord, int a_size) |
Wrap-around utility function. More... | |
int | NormInc (int a_coord, int a_size) |
Wrap-around utility function. More... | |
int | NormDec (int a_coord, int a_size) |
Wrap-around utility function. More... | |
bool | NestNearBadAreas (int a_x, int a__y) |
Test for proximity to unacceptable areas. More... | |
bool | NestBadArea (int a_x, int a__y) |
Nest location evaluation function. More... | |
bool | NestNearNests (int a_x, int a_y, int a_min_dist_sq) |
Nest location evaluation function. More... | |
bool | NestBadAreasScanSlow (int a_min_x, int a_min_y, int a_length, int a_x, int a_y) |
Nest location evaluation function. More... | |
bool | NestBadAreasScanFast (int a_min_x, int a_min_y, int a_length, int a_x, int a_y) |
Nest location evaluation function. More... | |
bool | FlyToFast (int a_distance) |
Move a_distance from current covey position. More... | |
bool | FlyToSlow (int a_distance) |
Move a_distance from current covey position (wraparound) More... | |
double | Pressure (double a_distance) |
Get the pressure force. More... | |
bool | PressureLimitExceeded (double a_pressure) |
Test for exceedence of pressure limit. More... | |
void | DistanceUpdate (void) |
Updates distance to nearest covey. More... | |
void | DistanceUpdate2 (void) |
Updates distance to fixed nearest covey. More... | |
double | DistanceToCovey (Partridge_Covey *a_covey) |
Get distance too covey. More... | |
double | HabitatEvaluate (int a_center_x, int a_center_y, int *a_size_used, bool a_rethink_size) |
Entry point for habitat evaluation. More... | |
double | HabitatEvaluateFaster (int a_center_x, int a_center_y) |
Evaluate habitat fast. More... | |
double | HabitatEvaluateFast (int a_min_x_incl, int a_max_x_excl, int a_min_y_incl, int a_max_y_excl) |
Evaluate habitat (wrap around) More... | |
double | HabitatEvaluateSlow (int a_min_x_incl, int a_max_x_excl, int a_min_y_incl, int a_max_y_excl) |
More... | |
double | HabitatEvalPoly (TTypesOfLandscapeElement a_cet, int a_poly) |
More... | |
int | HabitatEvalPolyField (int a_field) |
Evaluate a field's habitat quality. More... | |
bool | MoveTryExclude (int a_dist_sq) |
Uses the peg force to exclude possible movement directions. More... | |
bool | MoveTryExcludeHarder (int a_dist_sq) |
Uses the peg force to exclude possible movement directions. More... | |
void | MoveDirectionsAllowed (int a_x, int a_y) |
Test possible movement directions. More... | |
void | MoveOptimalDirectionSlow (int a_x, int a_y) |
Choose best foraging direction. More... | |
void | MoveOptimalDirectionFast (int a_x, int a_y) |
Choose best foraging direction (wrap around) More... | |
int | MoveWeighDirection (int a_x, int a_y) |
Weighted foraging walk. More... | |
void | MoveQualMemory (int a_qual) |
Make a move based on memory of quality. More... | |
double | MoveDoIt (int *a_x, int *a_y, int a_dir, int a_step_size) |
We know where we want to go. Now do it! More... | |
int | MoveCanMove (TTypesOfLandscapeElement a_ele) |
Test if we can go there. More... | |
double | MoveMagicVegToFood (int a_polygon) |
Move optimising food intake. More... | |
int | MoveEvalEdgesAndQual (int a_edges, double a_qual) |
Move evaluation taking edges into account. More... | |
int | MoveSelectFuzzy (void) |
Fuzzdy movement selection. More... | |
bool | MoveSelectLimit (int a_limit, int a_x, int a_y) |
Part of movement evaluation. More... | |
int | MoveSelect (void) |
Part of movement evaluation. More... | |
void | MoveVegConstInit (void) |
Part of movement evaluation. More... | |
void | OntheDadDead () |
Behaviour when alpha male is killed. More... | |
void | OntheMumDead () |
Behaviour when alpha female is killed. More... | |
void | KillChicks (int percent) |
Kill a proportion of the chicks. More... | |
int | SupplyChickAge (void) |
Returns the age of the chicks. More... | |
Protected Member Functions inherited from TAnimal | |
void | CorrectWrapRound () |
Corrects wrap around co-ordinate problems. More... | |
Protected Attributes | |
int | m_flyto_steps |
costly intermediate variable More... | |
int | m_flyto_dist |
costly intermediate variable More... | |
double | m_flyto_ts |
costly intermediate variable More... | |
bool | m_essence_low |
flag for excess density - unused More... | |
bool | m_peg_is_fixed |
flag for fixed homerange More... | |
bool | m_permanent_marker |
Unused More... | |
unsigned int | m_id |
Unique ID no- More... | |
Partridge_Base * | m_members [100] |
List of covey members More... | |
unsigned int | m_members_size |
Size of covey More... | |
bool | m_step_done |
Signals Step is done for today More... | |
bool | m_dist_done |
Signals distance updating is done for today More... | |
double | m_nearest_covey_dist |
Closest covey distance More... | |
bool | m_terr_done |
Signals homerange evaluation done More... | |
double | m_terr_qual |
Homerange evaluation score More... | |
bool | m_force_low |
unused More... | |
Partridge_State | m_state |
The current behavioural state. More... | |
Landscape * | m_map |
A pointer to the landscape. More... | |
int | m_width |
Landscape width. More... | |
int | m_height |
Landscape height. More... | |
Partridge_Population_Manager * | m_manager |
Covey's population manager. More... | |
double | m_center_x_float |
Covey centre as float. More... | |
double | m_center_y_float |
Covey centre as float. More... | |
double | m_new_center_x_float |
Covey centre as float. More... | |
double | m_new_center_y_float |
Covey centre as float. More... | |
int | m_center_x |
Covey centre. More... | |
int | m_center_y |
Covey centre. More... | |
int | m_covey_x |
Covey x-coord. More... | |
int | m_covey_y |
Covey y-coord. More... | |
int | m_terr_size |
Homerange width. More... | |
bool | m_nest_on_nest |
Nesting flag. More... | |
int | m_nest_x |
Nest coord-x. More... | |
int | m_nest_y |
Nest coord-y. More... | |
bool | m_assess_done |
Have assessed habitat quality? More... | |
double | m_assess_qual |
Habitat quality. More... | |
bool | m_move_done |
Have moved? More... | |
double | m_dist_moved |
Distance moved. More... | |
double | m_food_today |
Food collected. More... | |
int | m_assess_size |
Current homerange assessment radius. More... | |
int | m_move_get_index |
Internal variable. More... | |
int | m_move_get_size |
Internal variable. More... | |
int | m_move_qual_memory [4] |
Steps remembered. More... | |
int | m_move_qual_hist [4][MOVE_QUAL_HIST_SIZE] |
Internal variable. More... | |
int | m_move_whence_we_came |
Internal variable. More... | |
int | m_move_step_size |
Internal variable. More... | |
double | m_move_step_size_inv |
Internal variable. More... | |
Partridge_Female * | m_theMum |
Pointer to the alpha male. More... | |
Partridge_Male * | m_theDad |
Pointer to the alpha female. More... | |
int | m_ourChicks |
No chicks in covey. More... | |
int | m_CoveyDissolveDate |
Date for covey dissolve. More... | |
int | m_maxAllowedMove |
Max move distance today. More... | |
double | m_maxFoodNeedToday |
Food needed today. More... | |
int | m_ChickAge |
Age of chicks. More... | |
Protected Attributes inherited from TAnimal | |
int | m_Location_x |
int | m_Location_y |
Landscape * | m_OurLandscape |
Protected Attributes inherited from TALMaSSObject | |
int | m_CurrentStateNo |
The basic state number for all objects - '-1' indicates death. More... | |
bool | m_StepDone |
Indicates whether the iterative step code is done for this timestep. More... | |
The collective for a family of partridges
The partridge covey is contains all behaviour that is performed as a group of birds. In fact this group can be as small as 1 bird, but if the behaviour is the same as a family group it will appear here.
Note that the covey is treated just like a life-stage, and is handled by the Partridge_Population_Manager.
Each covey has a 'peg' position, which starts out as the center of a newly established territory. It also has a covey location, which may or may not coincide with the peg position. The covey can move some distance away from the peg, given by an 'elastic' function of distance between covey (physical) and the virtual territory center 'peg'. If a partridge would like to assess the quality of a hypothetial territory centeret at its current (covey) position, it will call Partridge_Covey::AssessHabitatQuality and make decisions on suitability depending on the value returned. The size of the potential territory evaluated is the minimum of the distance to the closest neighbour peg and a configurable maximum territory radius, Partridge_All.cpp::cfg_par_terr_max_width.
Definition at line 90 of file Partridge_Covey.h.
Partridge_Covey::Partridge_Covey | ( | Partridge_Base * | a_first_member, |
Partridge_Population_Manager * | a_manager, | ||
unsigned int | a_center_x, | ||
unsigned int | a_center_y, | ||
Landscape * | a_map | ||
) |
Constructor.
Definition at line 1977 of file Partridge_Covey.cpp.
References CoveyManager::AddCovey(), Partridge_Population_Manager::AddObject(), CoveyUpdateMemberPositions(), g_covey_id_counter, g_covey_manager, g_par_terr_max_width, m_assess_done, m_assess_size, m_center_x, m_center_x_float, m_center_y, m_center_y_float, m_covey_x, m_covey_y, m_CoveyDissolveDate, m_dist_done, m_dist_moved, m_essence_low, m_flyto_dist, m_food_today, m_force_low, m_height, m_id, m_manager, m_map, m_maxAllowedMove, m_maxFoodNeedToday, m_members, m_members_size, m_move_done, m_move_qual_hist, m_move_qual_memory, m_move_step_size, m_move_step_size_inv, m_move_whence_we_came, m_nearest_covey_dist, m_nest_on_nest, m_nest_x, m_nest_y, m_ourChicks, m_peg_is_fixed, m_permanent_marker, m_state, m_step_done, m_terr_done, m_terr_size, m_theDad, m_theMum, m_width, MoveVegConstInit(), pars_CoveyBeing, pob_Covey, Landscape::SupplySimAreaHeight(), Landscape::SupplySimAreaWidth(), and CfgInt::value().
|
virtual |
Destructor.
Definition at line 1971 of file Partridge_Covey.cpp.
References CoveyManager::DelCovey(), and g_covey_manager.
void Partridge_Covey::ActOnParentDeath | ( | void | ) |
Determine the chick mortality on parent death.
Determines the probability of mortality following the death of a parent. This will depend on the age of the chicks and whether it is one or both parents that die and whether there are aunts or uncles present.
If we need to use aunts and uncles or if there is only one parent left then we assume only 8 chicks max can be brooded. The rest die, and the 8 are subject to a mortality probability.
Definition at line 2516 of file Partridge_Covey.cpp.
References cfg_par_parentdead_age1, cfg_par_parentdead_age2, cfg_par_parentdead_mort, GetUncleNumber(), KillChicks(), KillExcessChicks(), m_theDad, m_theMum, SetUncle(), SupplyChickAge(), and CfgInt::value().
Referenced by OntheDadDead(), and OntheMumDead().
void Partridge_Covey::AddMember | ( | Partridge_Base * | a_new_member | ) |
Definition at line 1644 of file Partridge_Covey.cpp.
References g_msg, IsMember(), TALMaSSObject::m_CurrentStateNo, m_members, m_members_size, MapErrorMsg::Warn(), and WARN_BUG.
Referenced by ManagerCheckMerge(), Partridge_Base::Partridge_Base(), and Partridge_Base::SwitchCovey().
bool Partridge_Covey::AllFlocking | ( | ) |
Debug method.
Definition at line 2362 of file Partridge_Covey.cpp.
References m_members, m_members_size, pars_FFlocking, and pars_MFlocking.
Referenced by CanWeMerge().
bool Partridge_Covey::AllFlocking2 | ( | ) |
Debug method.
Definition at line 2373 of file Partridge_Covey.cpp.
References m_members, m_members_size, pars_FFlocking, and pars_MFlocking.
Referenced by Partridge_Population_Manager::DissolveCovey().
bool Partridge_Covey::ArePaired | ( | ) |
Debug method.
Definition at line 2384 of file Partridge_Covey.cpp.
References Partridge_Male::GetMate(), Partridge_Female::GetMate(), GetObjectType(), m_members, m_members_size, pob_Female, and pob_Male.
Referenced by CoveyIndividualEmigrate(), and Partridge_Population_Manager::DissolveCovey().
|
inline |
Get the size ('radius') used during territory evaluation.
Definition at line 554 of file Partridge_Covey.h.
References m_assess_size.
double Partridge_Covey::AssessHabitatQuality | ( | int & | a_sz | ) |
Assess habitat quality (with checks)
Definition at line 1059 of file Partridge_Covey.cpp.
References HabitatEvaluate(), m_assess_done, m_assess_qual, m_assess_size, m_covey_x, and m_covey_y.
Referenced by FixHabitat().
double Partridge_Covey::AssessHabitatQualityFaster | ( | ) |
Assess habitat quality (efficient)
Definition at line 1068 of file Partridge_Covey.cpp.
References HabitatEvaluateFaster(), m_assess_done, m_assess_qual, m_covey_x, and m_covey_y.
Referenced by Partridge_Female::FFindingTerritory().
|
virtual |
Covey BeginStep.
Reimplemented from TAnimal.
Definition at line 1583 of file Partridge_Covey.cpp.
References cfg_par_mature_threshold, Partridge_Population_Manager::DissolveCovey(), g_FoodNeed, GetOurChicks(), m_ChickAge, m_CoveyDissolveDate, TALMaSSObject::m_CurrentStateNo, m_manager, m_maxFoodNeedToday, TAnimal::m_OurLandscape, m_state, pars_CoveyBeing, pars_CoveyDissolve, Landscape::SupplyDayInYear(), and CfgInt::value().
bool Partridge_Covey::CanWeMerge | ( | int | a_NoUncles | ) |
Merging test.
Definition at line 1833 of file Partridge_Covey.cpp.
References AllFlocking(), GetUncleNumber(), June, m_map, m_ourChicks, and Landscape::SupplyDayInYear().
Referenced by ManagerCheckMerge().
void Partridge_Covey::ChickExtraMortality | ( | ) |
Apply extra chick mortality.
Definition at line 2671 of file Partridge_Covey.cpp.
References cfg_par_chick_extra_mort, GetObjectType(), m_members, m_members_size, pob_Chick, and CfgInt::value().
Referenced by Partridge_Chick::BeginStep().
bool Partridge_Covey::CoveyEmigrate | ( | void | ) |
Test for covey emigration.
Emigration is a loss to the system, so this just kills everyone in the covey.
Definition at line 2642 of file Partridge_Covey.cpp.
References TAnimal::Dying(), m_members, and m_members_size.
void Partridge_Covey::CoveyIndividualEmigrate | ( | void | ) |
Test for individuals from covey emigrating.
Chance of each individual emigrating if they are not paired (emigration kills them just to remove them from the system - this is safe because if unpaired there will be no knock-on effects).
Definition at line 2655 of file Partridge_Covey.cpp.
References ArePaired(), cfg_IndividualEmigration, TAnimal::Dying(), m_members, m_members_size, and CfgInt::value().
|
protected |
Update all covey members x,y coords.
Sets all covey members to the location a_x, a_y and sets the covey x,y coords to this too.
Definition at line 1093 of file Partridge_Covey.cpp.
References TAnimal::m_Location_x, TAnimal::m_Location_y, m_members, m_members_size, TAnimal::SetX(), and TAnimal::SetY().
Referenced by FlyTo(), MoveDistance(), MoveTo(), NestFindFast(), NestFindSlow(), and Partridge_Covey().
|
protected |
Get distance too covey.
Definition at line 1319 of file Partridge_Covey.cpp.
References m_center_x_float, m_center_y_float, m_height, m_width, XCenterF(), and YCenterF().
Referenced by DistanceUpdate(), and DistanceUpdate2().
|
protected |
Updates distance to nearest covey.
Sorts through the list of nearby coveys and finds the distance to the nearest. Stores the square root of this value.
Definition at line 1301 of file Partridge_Covey.cpp.
References DistanceToCovey(), g_covey_list, ID(), m_height, m_id, m_nearest_covey_dist, and m_width.
Referenced by HabitatEvaluate(), and MoveDistance().
|
protected |
Updates distance to fixed nearest covey.
Sorts through the list of nearby coveys and finds the distance to the nearest that is fixed. Stores the square root of this value.
Definition at line 1281 of file Partridge_Covey.cpp.
References DistanceToCovey(), g_covey_list, ID(), IsFixed(), m_height, m_id, m_nearest_covey_dist, and m_width.
Referenced by TooClose().
|
virtual |
Covey EndStep.
Reimplemented from TAnimal.
Definition at line 1616 of file Partridge_Covey.cpp.
References m_assess_done, TALMaSSObject::m_CurrentStateNo, m_move_done, m_step_done, and m_terr_done.
Partridge_Female * Partridge_Covey::FindMateInArea | ( | int | a_max_distance | ) |
Find mate in area.
Loops through the males in the simulation, find first one in state pars_FAttractingMate and within distance a_max_distance, NULL if none.
Definition at line 1561 of file Partridge_Covey.cpp.
References m_covey_x, m_covey_y, m_manager, Partridge_Population_Manager::ObjectLoopFetch(), Partridge_Population_Manager::ObjectLoopInit(), pars_FAttractingMate, pob_Female, TAnimal::Supply_m_Location_x(), and TAnimal::Supply_m_Location_y().
Referenced by Partridge_Male::MFindingMate().
Partridge_Male * Partridge_Covey::FindMeAHusband | ( | Partridge_Female * | a_female | ) |
Find mate in covey.
Find mate within the covey (if possible). Return NULL if not.
Definition at line 1534 of file Partridge_Covey.cpp.
References Partridge_Base::GetFamily(), Partridge_Male::GetMate(), GetObjectType(), m_members, m_members_size, and pob_Male.
Partridge_Female * Partridge_Covey::FindMeAMateInCovey | ( | int | a_family_counter | ) |
Is their a suitable female mate in the covey?
Definition at line 2334 of file Partridge_Covey.cpp.
References Partridge_Base::GetFamily(), Partridge_Female::GetMate(), GetObjectType(), m_members, m_members_size, and pob_Female.
Referenced by Partridge_Male::MFindingMate().
Partridge_Female * Partridge_Covey::FindMeAWife | ( | Partridge_Male * | a_male | ) |
Find mate in covey.
Find mate within the covey (if possible). Return NULL if not.
Definition at line 1518 of file Partridge_Covey.cpp.
References Partridge_Base::GetFamily(), Partridge_Female::GetMate(), GetObjectType(), m_members, m_members_size, and pob_Female.
Partridge_Covey * Partridge_Covey::FindNeighbour | ( | ) |
Finds the closest other covey.
Definition at line 2290 of file Partridge_Covey.cpp.
References m_neighbourlist, and m_neighbourlist_size.
Referenced by Partridge_Male::MFindingMate().
void Partridge_Covey::FixHabitat | ( | void | ) |
Accept this breeding location.
If the quality is found to be good enough, the animal can decide to use it for its own by calling this method.
This updates the peg position to that of the animal, and updates internal state in accordance with it. After FixTerritory() any subsequent calls to Partridge_Covey::SupplyHabitatQuality() will give the quality on the basis of the same size but possibly drifted pushed peg location from the values used in the recent call to Partridge_Covey::AssessTerritoryQuality.
Definition at line 1074 of file Partridge_Covey.cpp.
References AssessHabitatQuality(), m_assess_done, m_assess_qual, m_assess_size, m_center_x, m_center_x_float, m_center_y, m_center_y_float, m_covey_x, m_covey_y, m_move_done, m_terr_done, m_terr_qual, and m_terr_size.
Referenced by Partridge_Female::FFindingTerritory().
bool Partridge_Covey::FlyTo | ( | int | a_distance | ) |
Fly to
Fly to a random, new location a_distance away. Only allowed if the size of the covey is 1.
Definition at line 1484 of file Partridge_Covey.cpp.
References CoveyUpdateMemberPositions(), FlyToFast(), FlyToSlow(), m_assess_done, m_center_x, m_center_x_float, m_center_y, m_center_y_float, m_covey_x, m_covey_y, m_dist_done, m_height, m_move_done, m_terr_done, and m_width.
Referenced by Partridge_Female::FFindingTerritory(), and Partridge_Male::MFindingMate().
|
protected |
Move a_distance from current covey position.
Definition at line 1349 of file Partridge_Covey.cpp.
References cfg_par_flyto_stepsize, g_trig_cos, g_trig_sin, m_center_x, m_center_y, m_covey_x, m_covey_y, m_flyto_dist, m_flyto_steps, m_flyto_ts, m_map, MoveCanMove(), Landscape::SupplyElementType(), Landscape::SupplyPolyRef(), TRIG_TABLE_LENGTH, and CfgInt::value().
Referenced by FlyTo().
|
protected |
Move a_distance from current covey position (wraparound)
Definition at line 1422 of file Partridge_Covey.cpp.
References cfg_par_flyto_stepsize, g_trig_cos, g_trig_sin, m_center_x, m_center_y, m_covey_x, m_covey_y, m_flyto_dist, m_flyto_steps, m_flyto_ts, m_height, m_map, m_width, MoveCanMove(), Norm(), Landscape::SupplyElementType(), Landscape::SupplyPolyRef(), TRIG_TABLE_LENGTH, and CfgInt::value().
Referenced by FlyTo().
|
inline |
Partridge_Base * Partridge_Covey::GetAMember | ( | ) |
Returns a random member.
Definition at line 1634 of file Partridge_Covey.cpp.
References m_members.
Referenced by ManagerCheckMerge().
|
inline |
Return chick age.
Definition at line 486 of file Partridge_Covey.h.
References m_ChickAge.
Referenced by Partridge_Female::FCaringForYoung(), and Partridge_Male::MCaringForYoung().
|
inline |
Return the covey size.
Definition at line 476 of file Partridge_Covey.h.
References m_members_size.
Referenced by Partridge_Male::DailyMortality(), Partridge_Female::DailyMortality(), Partridge_Population_Manager::DissolveCovey(), ManagerCheckMerge(), and Partridge_Male::MFindingMate().
Partridge_Male * Partridge_Covey::GetMaleInCovey | ( | ) |
Find a male in the covey.
Definition at line 2323 of file Partridge_Covey.cpp.
References GetObjectType(), m_members, m_members_size, and pob_Male.
Referenced by Partridge_Population_Manager::DissolveCovey().
|
inline |
Return the max possible move distance today.
Definition at line 411 of file Partridge_Covey.h.
References m_maxAllowedMove.
Referenced by Partridge_Female::FFlocking().
|
inline |
Return the maximum food need today.
Definition at line 416 of file Partridge_Covey.h.
References m_maxFoodNeedToday.
Referenced by Partridge_Female::FFlocking().
Partridge_Base * Partridge_Covey::GetMember | ( | int | a_member | ) |
Returns pointer to a_member.
Definition at line 1638 of file Partridge_Covey.cpp.
References m_members.
Referenced by Partridge_Population_Manager::DissolveCovey().
|
inline |
Return object type.
Definition at line 582 of file Partridge_Covey.h.
References pob_Covey.
Referenced by ArePaired(), ChickExtraMortality(), FindMeAHusband(), FindMeAMateInCovey(), FindMeAWife(), GetMaleInCovey(), GetUnpairedFemale(), GetUnpairedFemale_virgin(), HaveWeChicks(), KillChicks(), KillExcessChicks(), SanityCheck2(), SanityCheck4(), SetUncle(), and SupplyChickAge().
|
inline |
Return the number of chicks.
Definition at line 471 of file Partridge_Covey.h.
References m_ourChicks.
Referenced by BeginStep(), and Partridge_Male::OnMateDying().
Partridge_Base* Partridge_Covey::GetUncle | ( | ) |
Find uncle in covey.
Searches the covey for any bird with the UncleStatus set as true. Or returns NULL if none.
int Partridge_Covey::GetUncleNumber | ( | void | ) |
Returns the number of uncles.
Definition at line 2560 of file Partridge_Covey.cpp.
References m_members, and m_members_size.
Referenced by ActOnParentDeath(), and CanWeMerge().
Partridge_Female * Partridge_Covey::GetUnpairedFemale | ( | ) |
Finds the first unpaired female in the covey.
Definition at line 2304 of file Partridge_Covey.cpp.
References GetObjectType(), Partridge_Female::GetOldMate(), IsMember(), m_members, m_members_size, pob_Female, and Partridge_Female::RemoveOldMate().
Referenced by Partridge_Population_Manager::DissolveCovey().
Partridge_Female * Partridge_Covey::GetUnpairedFemale_virgin | ( | ) |
Finds the first never paired female in the covey.
Definition at line 2350 of file Partridge_Covey.cpp.
References GetObjectType(), m_members, m_members_size, and pob_Female.
|
protected |
Definition at line 2769 of file Partridge_Covey.cpp.
References cfg_nest_hedgebank0, cfg_nest_hedgebank1, cfg_nest_hedgebank2, cfg_terr_qual_good, g_msg, HabitatEvalPolyField(), TAnimal::m_OurLandscape, Landscape::SupplyElementSubType(), tole_ActivePit, tole_AmenityGrass, tole_BareRock, tole_BeetleBank, tole_Building, tole_BuiltUpWithParkland, tole_Carpark, tole_Churchyard, tole_Coast, tole_ConiferousForest, tole_Copse, tole_DeciduousForest, tole_Fence, tole_Field, tole_FieldBoundary, tole_Freshwater, tole_Garden, tole_Heath, tole_HedgeBank, tole_Hedges, tole_HeritageSite, tole_IndividualTree, tole_LargeRoad, tole_Marsh, tole_MetalledPath, tole_MixedForest, tole_MownGrass, tole_NaturalGrassDry, tole_NaturalGrassWet, tole_Orchard, tole_OrchardBand, tole_Parkland, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPastureTussocky, tole_PitDisused, tole_PlantNursery, tole_Pond, tole_Pylon, tole_Railway, tole_River, tole_RiversidePlants, tole_RiversideTrees, tole_RoadsideSlope, tole_RoadsideVerge, tole_Saltmarsh, tole_Saltwater, tole_SandDune, tole_Scrub, tole_SmallRoad, tole_StoneWall, tole_Stream, tole_Track, tole_UnsprayedFieldMargin, tole_UrbanNoVeg, tole_UrbanPark, tole_Vildtager, tole_WindTurbine, tole_WoodlandMargin, tole_WoodyEnergyCrop, tole_YoungForest, CfgInt::value(), CfgFloat::value(), MapErrorMsg::Warn(), and WARN_BUG.
Referenced by HabitatEvaluateFast(), and HabitatEvaluateSlow().
|
protected |
Evaluate a field's habitat quality.
Definition at line 3028 of file Partridge_Covey.cpp.
References m_map, Landscape::SupplyVegType(), tov_AgroChemIndustryCereal, tov_BroadBeans, tov_Carrots, tov_CloverGrassGrazed1, tov_CloverGrassGrazed2, tov_FieldPeas, tov_FodderBeet, tov_FodderGrass, tov_Heath, tov_Maize, tov_MaizeSilage, tov_NaturalGrass, tov_NoGrowth, tov_None, tov_Oats, tov_OBarleyPeaCloverGrass, tov_OCarrots, tov_OCloverGrassGrazed1, tov_OCloverGrassGrazed2, tov_OCloverGrassSilage1, tov_OFieldPeas, tov_OFieldPeasSilage, tov_OFirstYearDanger, tov_OFodderBeet, tov_OGrazingPigs, tov_OMaizeSilage, tov_OOats, tov_OPermanentGrassGrazed, tov_OPotatoes, tov_OSBarleySilage, tov_OSeedGrass1, tov_OSeedGrass2, tov_OSetaside, tov_OSpringBarley, tov_OSpringBarleyClover, tov_OSpringBarleyExt, tov_OSpringBarleyGrass, tov_OSpringBarleyPigs, tov_OTriticale, tov_OWinterBarley, tov_OWinterBarleyExt, tov_OWinterRape, tov_OWinterRye, tov_OWinterWheat, tov_OWinterWheatUndersown, tov_PermanentGrassGrazed, tov_PermanentGrassLowYield, tov_PermanentGrassTussocky, tov_PermanentSetaside, tov_Potatoes, tov_PotatoesIndustry, tov_SeedGrass1, tov_SeedGrass2, tov_Setaside, tov_SpringBarley, tov_SpringBarleyCloverGrass, tov_SpringBarleyGrass, tov_SpringBarleyPTreatment, tov_SpringBarleySeed, tov_SpringBarleySilage, tov_SpringBarleySKManagement, tov_SpringBarleySpr, tov_SpringRape, tov_SpringWheat, tov_SugarBeet, tov_Triticale, tov_Undefined, tov_WinterBarley, tov_WinterRape, tov_WinterRye, tov_WinterWheat, tov_WinterWheatShort, tov_WWheatPControl, tov_WWheatPToxicControl, tov_WWheatPTreatment, and tov_YoungForest.
Referenced by HabitatEvalPoly().
|
protected |
Entry point for habitat evaluation.
Makes sure we have taken other covies into account then figures out which of the habitat evaluation functions to call depending how close to the edge of the world we are.
This way of doing things is used when we need to take other covies into account and cannot rely on the pre-assessed 10mgrid qualities of Partridge_Population_Manager::UpdateNestingCoverMap.
Definition at line 991 of file Partridge_Covey.cpp.
References DistanceUpdate(), g_par_terr_max_width, HabitatEvaluateFast(), HabitatEvaluateSlow(), m_dist_done, m_height, m_nearest_covey_dist, m_width, and CfgInt::value().
Referenced by AssessHabitatQuality(), and SupplyHabitatQuality().
|
protected |
Evaluate habitat (wrap around)
Definition at line 926 of file Partridge_Covey.cpp.
References HabitatEvalPoly(), m_map, Landscape::SupplyElementType(), and Landscape::SupplyPolyRef().
Referenced by HabitatEvaluate().
|
protected |
Evaluate habitat fast.
The search pattern for finding a territory is to find a place where the territory criteria are OK, then check that we are not too close to other coveys. This way of doing things is called when we want to do the job quickly using the pre-assessed qualmap array updated every week by Partridge_Population_Manager::UpdateNestingCoverMap.
Definition at line 1027 of file Partridge_Covey.cpp.
References CoverTempMap::GetQualIndexed(), m_height, m_manager, Partridge_Population_Manager::m_territoryqualmap, and m_width.
Referenced by AssessHabitatQualityFaster().
|
protected |
Definition at line 952 of file Partridge_Covey.cpp.
References ForIterator::GetLimit(), ForIterator::GetList(), HabitatEvalPoly(), m_height, m_map, m_width, Landscape::SupplyElementType(), and Landscape::SupplyPolyRef().
Referenced by HabitatEvaluate().
bool Partridge_Covey::HaveWeChicks | ( | void | ) |
Check if covey contains chicks.
Relies on the fact that a covey can only have one set of chicks at a time.
Definition at line 2626 of file Partridge_Covey.cpp.
References GetObjectType(), m_members, m_members_size, and pob_Chick.
|
inline |
Definition at line 738 of file Partridge_Covey.h.
References m_id.
Referenced by CoveyManager::DelCovey(), DistanceUpdate(), DistanceUpdate2(), ManagerCheckMerge(), ManagerRethinkPos(), and NestNearNests().
|
inline |
Wonder whether the peg is fixed?
Definition at line 577 of file Partridge_Covey.h.
References m_peg_is_fixed.
Referenced by DistanceUpdate2().
bool Partridge_Covey::IsMember | ( | Partridge_Base * | a_possible_member | ) |
Definition at line 1709 of file Partridge_Covey.cpp.
References m_members, and m_members_size.
Referenced by AddMember(), Partridge_Male::AmIaMember(), GetUnpairedFemale(), and RemoveMember().
|
protected |
Kill a proportion of the chicks.
Kills each chick if they fail a probability test.
Definition at line 2595 of file Partridge_Covey.cpp.
References GetObjectType(), m_members, m_members_size, and pob_Chick.
Referenced by ActOnParentDeath().
void Partridge_Covey::KillExcessChicks | ( | int | remaining | ) |
Kill extra chicks.
Kills chicks so that remaining remain.
Definition at line 2573 of file Partridge_Covey.cpp.
References GetObjectType(), m_members, m_members_size, m_ourChicks, Partridge_Chick::OnYouAreDead(), and pob_Chick.
Referenced by ActOnParentDeath().
|
inline |
bool Partridge_Covey::ManagerCheckMerge | ( | int | a_noOfUncles | ) |
Merging test for uncle number.
void Partridge_Covey::ManagerCheckMerge | ( | void | ) |
Definition at line 1794 of file Partridge_Covey.cpp.
References AddMember(), CanWeMerge(), cfg_min_merge_dist, cfg_par_merging_chance, g_covey_list, GetAMember(), GetCoveySize(), ID(), m_center_x_float, m_center_y_float, TALMaSSObject::m_CurrentStateNo, m_id, m_members_size, RemoveMember(), Partridge_Base::SetCovey(), Partridge_Base::SetUncleStatus(), CfgInt::value(), CfgFloat::value(), XCenterF(), and YCenterF().
void Partridge_Covey::ManagerDriftPos | ( | void | ) |
Definition at line 1745 of file Partridge_Covey.cpp.
References cfg_par_covey_drift_enable, cfg_par_covey_drift_speed, m_center_x_float, m_center_y_float, m_covey_x, m_covey_y, m_height, m_new_center_x_float, m_new_center_y_float, m_peg_is_fixed, m_permanent_marker, m_width, CfgFloat::value(), and CfgBool::value().
|
inline |
Unused
Is peg permanent
Not used at present
Definition at line 767 of file Partridge_Covey.h.
References m_permanent_marker.
Referenced by CoveyManager::DelCovey().
void Partridge_Covey::ManagerRethinkPos | ( | void | ) |
Definition at line 1855 of file Partridge_Covey.cpp.
References cfg_par_force_below, cfg_par_force_enable, cfg_par_force_ignore_dist_sq, cfg_par_force_speed, g_covey_list, g_covey_manager, CoveyManager::Getpar_force_ignore_below(), ID(), m_center_x_float, m_center_y_float, m_essence_low, m_force_low, m_height, m_id, m_new_center_x_float, m_new_center_y_float, m_peg_is_fixed, m_permanent_marker, m_width, Pressure(), PressureLimitExceeded(), CfgFloat::value(), and CfgBool::value().
|
inline |
Unused
This peg is not associated with a family entity and can never be be moved, nor deleted. It is, well, permanent.
Not used at present
Definition at line 758 of file Partridge_Covey.h.
References m_permanent_marker.
void Partridge_Covey::ManagerUpdatePos | ( | void | ) |
Definition at line 1948 of file Partridge_Covey.cpp.
References m_assess_done, m_center_x, m_center_x_float, m_center_y, m_center_y_float, m_dist_done, m_height, m_new_center_x_float, m_new_center_y_float, m_peg_is_fixed, m_permanent_marker, m_terr_done, and m_width.
|
inline |
int Partridge_Covey::MoveCanMove | ( | int | a_x, |
int | a_y | ||
) |
Test of movement step.
Returns:
-1: Cannot move here due to element type.
0: OK to go here.
1: Exceptionally favorable terrain (for detecting hedges etc.)
Definition at line 857 of file Partridge_Covey.cpp.
References m_map, MoveCanMove(), and Landscape::SupplyElementType().
|
protected |
Test if we can go there.
Returns a code for whether the partridges can take chicks onto this polygon type at all (-1), if necessary (0) or by choice (1).
Definition at line 3221 of file Partridge_Covey.cpp.
References g_msg, tole_ActivePit, tole_AmenityGrass, tole_BareRock, tole_BeetleBank, tole_Building, tole_BuiltUpWithParkland, tole_Carpark, tole_Churchyard, tole_Coast, tole_ConiferousForest, tole_Copse, tole_DeciduousForest, tole_Fence, tole_Field, tole_FieldBoundary, tole_Freshwater, tole_Garden, tole_Heath, tole_HedgeBank, tole_Hedges, tole_HeritageSite, tole_IndividualTree, tole_LargeRoad, tole_Marsh, tole_MetalledPath, tole_MixedForest, tole_MownGrass, tole_NaturalGrassDry, tole_NaturalGrassWet, tole_Orchard, tole_OrchardBand, tole_Parkland, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPastureTussocky, tole_PitDisused, tole_PlantNursery, tole_Pond, tole_Pylon, tole_Railway, tole_River, tole_RiversidePlants, tole_RiversideTrees, tole_RoadsideSlope, tole_RoadsideVerge, tole_Saltmarsh, tole_Saltwater, tole_SandDune, tole_Scrub, tole_SmallRoad, tole_StoneWall, tole_Stream, tole_Track, tole_UnsprayedFieldMargin, tole_UrbanNoVeg, tole_UrbanPark, tole_Vildtager, tole_WindTurbine, tole_WoodlandMargin, tole_WoodyEnergyCrop, tole_YoungForest, MapErrorMsg::Warn(), and WARN_BUG.
Referenced by FlyToFast(), FlyToSlow(), MoveCanMove(), MoveOptimalDirectionFast(), and MoveOptimalDirectionSlow().
|
protected |
Test possible movement directions.
Definition at line 397 of file Partridge_Covey.cpp.
References direction_e, direction_n, direction_ne, direction_nw, direction_s, direction_se, direction_sw, direction_w, m_center_x, m_center_y, m_height, m_move_allowed, m_width, MoveTryExclude(), and MoveTryExcludeHarder().
Referenced by MoveDistance(), and MoveTo().
void Partridge_Covey::MoveDistance | ( | int | a_max_distance, |
int | a_step_size, | ||
double | a_food_density_needed | ||
) |
Entry point for movement.
Move distance needs to take into accound the moves possible, the food available, the peg location, and the history of moves.
This is where the partridge model spends much of its time (when there are chicks to feed). It is possible that these routines could be optimised, but they are also the most likely to be modified in the future, so too much optimisation may be a waste of time.
Definition at line 652 of file Partridge_Covey.cpp.
References CoveyUpdateMemberPositions(), DistanceUpdate(), g_msg, m_assess_done, m_covey_x, m_covey_y, m_dist_done, m_dist_moved, m_food_today, m_height, m_move_allowed, m_move_dir_qual, m_move_done, m_move_get_index, m_move_list, m_move_qual_memory, m_move_step_size, m_move_step_size_inv, m_move_whence_we_came, m_nest_on_nest, MoveDirectionsAllowed(), MoveDoIt(), MoveOptimalDirectionFast(), MoveOptimalDirectionSlow(), MoveQualMemory(), MoveWeighDirection(), Norm(), MapErrorMsg::Warn(), and WARN_BUG.
Referenced by Partridge_Chick::BeginStep(), Partridge_Chick2::BeginStep(), Partridge_Female::FCaringForYoung(), Partridge_Female::FFlocking(), Partridge_Male::MCaringForYoung(), and Partridge_Male::MFlocking().
|
protected |
We know where we want to go. Now do it!
Definition at line 811 of file Partridge_Covey.cpp.
References direction_e, direction_n, direction_ne, direction_nw, direction_s, direction_se, direction_sw, direction_w, m_height, m_width, and Norm().
Referenced by MoveDistance(), and MoveTo().
|
protected |
Move evaluation taking edges into account.
This method must do an evaluation of this particular step given:
a_edges must be taken into account to ensure a preference of moving along field edges, hedges etc.
Values returned should be within the range of [1:3], 3 being most preferable.
Definition at line 2684 of file Partridge_Covey.cpp.
References cfg_par_highqualthreshold, m_move_step_size_inv, and CfgInt::value().
Referenced by MoveOptimalDirectionFast(), and MoveOptimalDirectionSlow().
|
protected |
Move optimising food intake.
This is the primary method responsible for generating food intake and local movement when chicks are present. The idea is to take each step optimally dependent on food availability, with occaisional mis-steps, and if no one direction is optimal then pick randomly. If there is no choice we can back-track.
This section determine the effect of modern landscapes on food availability. Here the problem is that we asume fields are low in food due to a lower insect biomass. The effects of structure should be the same as in the 1950s. However, the question is whether we should treat all habitats as impoverished or just the fields, all fields or just arable fields. The default position is all fields and then allow a scaling factor for patchiness, and assume non-field habitats are not affected - this is not perfect an may need to be revisited in future versions
Definition at line 3147 of file Partridge_Covey.cpp.
References cfg_NOT1950sinsects, cfg_par_bio_hindrance_inv, cfg_par_hei_hindrance_inv, cfg_parinsectScaler, m_map, Landscape::SupplyElementType(), Landscape::SupplyHasTramlines(), Landscape::SupplyInsects(), Landscape::SupplyVegDensity(), Landscape::SupplyVegHeight(), Landscape::SupplyVegPatchy(), tole_Field, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPastureTussocky, and CfgFloat::value().
Referenced by MoveOptimalDirectionFast(), and MoveOptimalDirectionSlow().
|
protected |
Choose best foraging direction (wrap around)
See MoveOptimalDirectionSlow for details
Rule: Preferred direction is the one, which gives the best food return.
Sum of distance times 'magic' vegetation2foodvaluepersitance() method.
Each tov type has a constant, which we can use to multiply the insect biomass with (default is now that all are 1.0). We then have to modify this value with some function() of vegetation structure. function() is a precalculated value from 0.0 to 1.0, given as a 4x4 array from vegetation height and biomass.
Also need to ensure the covey moves along the hedges etc.
Definition at line 3667 of file Partridge_Covey.cpp.
References direction_e, direction_n, direction_ne, direction_nw, direction_s, direction_se, direction_sw, direction_w, m_map, m_move_allowed, m_move_dir_qual, m_move_list, m_move_step_size, MoveCanMove(), MoveEvalEdgesAndQual(), MoveMagicVegToFood(), Landscape::SupplyElementType(), and Landscape::SupplyPolyRef().
Referenced by MoveDistance(), and MoveTo().
|
protected |
Choose best foraging direction.
Rule: Preferred direction is the one, which gives the best food return.
Sum of distance times 'magic' vegetation2foodvaluepersitance() method.
Each tov type has a constant, which we can use to multiply the insect biomass with (default is now that all are 1.0). We then have to modify this value with some function() of vegetation structure. function() is a precalculated value from 0.0 to 1.0, given as a 4x4 array from vegetation height and biomass.
Also need to ensure the covey moves along the hedges etc.
All this is done whilst checking for wrap-around - therefore SLOW!
Definition at line 3404 of file Partridge_Covey.cpp.
References direction_e, direction_n, direction_ne, direction_nw, direction_s, direction_se, direction_sw, direction_w, m_height, m_map, m_move_allowed, m_move_dir_qual, m_move_list, m_move_step_size, m_width, MoveCanMove(), MoveEvalEdgesAndQual(), MoveMagicVegToFood(), NormDec(), NormInc(), Landscape::SupplyElementType(), and Landscape::SupplyPolyRef().
Referenced by MoveDistance(), and MoveTo().
|
protected |
Make a move based on memory of quality.
Definition at line 538 of file Partridge_Covey.cpp.
References m_move_qual_hist, and m_move_qual_memory.
Referenced by MoveDistance(), and MoveTo().
|
protected |
Part of movement evaluation.
These methods:
bool MoveSelectLimit( int a_limit, int a_x, int a_y );
int MoveSelect( void );
void MoveVegConstInit( void );
build a list of possible directions we can move to from our present location, given we are only interested in directions with a quality evaluation equal to a_limit.
Definition at line 330 of file Partridge_Covey.cpp.
References m_move_select_list, and m_move_select_size.
Referenced by MoveWeighDirection().
|
protected |
Fuzzdy movement selection.
Select either 1 or -1 or fuzzy chance 0
Definition at line 244 of file Partridge_Covey.cpp.
References cfg_par_move_fuzzy_chance, and CfgInt::value().
Referenced by MoveWeighDirection().
|
protected |
Part of movement evaluation.
These methods:
bool MoveSelectLimit( int a_limit, int a_x, int a_y );
int MoveSelect( void );
void MoveVegConstInit( void );
build a list of possible directions we can move to from our present location, given we are only interested in directions with a quality evaluation equal to a_limit.
Select either 1 or -1 or fuzzy chance 0
Definition at line 261 of file Partridge_Covey.cpp.
References cfg_par_movequal_histlimit, m_move_list, m_move_qual_memory, m_move_select_list, m_move_select_size, m_move_whence_we_came, NormDec(), NormInc(), and CfgInt::value().
Referenced by MoveWeighDirection().
void Partridge_Covey::MoveTo | ( | int | a_x, |
int | a_y | ||
) |
unused
Definition at line 570 of file Partridge_Covey.cpp.
References CoveyUpdateMemberPositions(), m_assess_done, m_covey_x, m_covey_y, m_dist_moved, m_food_today, m_height, m_move_allowed, m_move_dir_qual, m_move_get_index, m_move_list, m_move_qual_memory, m_move_step_size, m_move_step_size_inv, m_move_whence_we_came, MoveDirectionsAllowed(), MoveDoIt(), MoveOptimalDirectionFast(), MoveOptimalDirectionSlow(), MoveQualMemory(), MoveWeighDirection(), and Norm().
|
protected |
Uses the peg force to exclude possible movement directions.
MoveTryExclude() should return a boolean distribution depending on the squared distance from the current location and the covey 'peg'. It is used when determining which directions we are allowed in, given the current location, and is called on for quadrants 'perpendicular' to the direction of the peg. Ie. moves toward the peg are always allowed, perpendicular is determined by this method, and those away by Partridge_Covey::MoveTryExcludeHarder().
If both methods always return true for distances below a certain threshold, the covey is allowed to roam freely within a circle of sqrt(threshold).
Note that in these methods a_dist_sq is treated linearly, meaning that the 'force' against moves away from the peg will automatically be a second order polynomial.
The implementation of these methods are currently quite rudimentary. One might want to incorporate such variables as the age of the chicks, size of the territory etc.
Definition at line 2735 of file Partridge_Covey.cpp.
References m_nearest_covey_dist.
Referenced by MoveDirectionsAllowed().
|
protected |
Uses the peg force to exclude possible movement directions.
Called for quadrants facing away from the peg - see Partridge_Covey::MoveTryExclude
Definition at line 2750 of file Partridge_Covey.cpp.
References m_nearest_covey_dist.
Referenced by MoveDirectionsAllowed().
|
protected |
Part of movement evaluation.
These methods:
bool MoveSelectLimit( int a_limit, int a_x, int a_y );
int MoveSelect( void );
void MoveVegConstInit( void );
build a list of possible directions we can move to from our present location, given we are only interested in directions with a quality evaluation equal to a_limit.
This was intended to be used to modify movement characteristics dependent on vegetation type, but lacking data all values are set to 1.0.
Definition at line 3304 of file Partridge_Covey.cpp.
References m_move_veg_const, m_move_veg_const_init_done, tov_AgroChemIndustryCereal, tov_BroadBeans, tov_Carrots, tov_CloverGrassGrazed1, tov_CloverGrassGrazed2, tov_FieldPeas, tov_FodderBeet, tov_FodderGrass, tov_Heath, tov_Maize, tov_MaizeSilage, tov_NaturalGrass, tov_NoGrowth, tov_None, tov_Oats, tov_OBarleyPeaCloverGrass, tov_OCarrots, tov_OCloverGrassGrazed1, tov_OCloverGrassGrazed2, tov_OCloverGrassSilage1, tov_OFieldPeas, tov_OFieldPeasSilage, tov_OFirstYearDanger, tov_OFodderBeet, tov_OGrazingPigs, tov_OMaizeSilage, tov_OOats, tov_OPermanentGrassGrazed, tov_OPotatoes, tov_OSBarleySilage, tov_OSeedGrass1, tov_OSeedGrass2, tov_OSetaside, tov_OSpringBarley, tov_OSpringBarleyClover, tov_OSpringBarleyExt, tov_OSpringBarleyGrass, tov_OSpringBarleyPigs, tov_OTriticale, tov_OWinterBarley, tov_OWinterRape, tov_OWinterRye, tov_OWinterWheat, tov_OWinterWheatUndersown, tov_PermanentGrassGrazed, tov_PermanentGrassLowYield, tov_PermanentGrassTussocky, tov_PermanentSetaside, tov_Potatoes, tov_PotatoesIndustry, tov_SeedGrass1, tov_SeedGrass2, tov_Setaside, tov_SpringBarley, tov_SpringBarleyCloverGrass, tov_SpringBarleyGrass, tov_SpringBarleyPTreatment, tov_SpringBarleySeed, tov_SpringBarleySilage, tov_SpringBarleySKManagement, tov_SpringBarleySpr, tov_SpringRape, tov_SpringWheat, tov_SugarBeet, tov_Triticale, tov_Undefined, tov_WinterBarley, tov_WinterRape, tov_WinterRye, tov_WinterWheat, tov_WinterWheatShort, tov_WWheatPControl, tov_WWheatPToxicControl, and tov_WWheatPTreatment.
Referenced by Partridge_Covey().
|
protected |
Weighted foraging walk.
Given our current location and m_move_list[], decide the direction to go next.
Do this by:
A) Remove directions from whence we came by calling Partridge_Coveh::MoveExcludedByPast()
B) Build list of possible move directions at a given limit (3 == best moves etc.)
C) Of those directions in the temporary select list, choose the previous direction we went to, or, if not present, a random direction.
D) If no valid directions could be found even at limit 1, try backtracking down the patch from where we came.
E) Try to fuzzy move from the choosen path (if not blocked).
Definition at line 344 of file Partridge_Covey.cpp.
References m_move_list, m_move_select_list, m_move_select_size, m_move_whence_we_came, MoveSelect(), MoveSelectFuzzy(), MoveSelectLimit(), Norm(), NormDec(), and NormInc().
Referenced by MoveDistance(), and MoveTo().
|
protected |
Nest location evaluation function.
Definition at line 2947 of file Partridge_Covey.cpp.
References g_msg, m_map, Landscape::SupplyElementType(), tole_ActivePit, tole_AmenityGrass, tole_BareRock, tole_BeetleBank, tole_Building, tole_BuiltUpWithParkland, tole_Carpark, tole_Churchyard, tole_Coast, tole_ConiferousForest, tole_Copse, tole_DeciduousForest, tole_Fence, tole_Field, tole_FieldBoundary, tole_Freshwater, tole_Garden, tole_Heath, tole_HedgeBank, tole_Hedges, tole_HeritageSite, tole_IndividualTree, tole_LargeRoad, tole_Marsh, tole_MetalledPath, tole_MixedForest, tole_MownGrass, tole_NaturalGrassDry, tole_NaturalGrassWet, tole_Orchard, tole_OrchardBand, tole_Parkland, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPastureTussocky, tole_PitDisused, tole_PlantNursery, tole_Pond, tole_Pylon, tole_Railway, tole_River, tole_RiversidePlants, tole_RiversideTrees, tole_RoadsideSlope, tole_RoadsideVerge, tole_Saltmarsh, tole_Saltwater, tole_SandDune, tole_Scrub, tole_SmallRoad, tole_StoneWall, tole_Stream, tole_Track, tole_UnsprayedFieldMargin, tole_UrbanNoVeg, tole_UrbanPark, tole_Vildtager, tole_WindTurbine, tole_WoodlandMargin, tole_WoodyEnergyCrop, tole_YoungForest, MapErrorMsg::Warn(), and WARN_BUG.
Referenced by NestBadAreasScanFast(), and NestBadAreasScanSlow().
|
protected |
Nest location evaluation function.
Definition at line 1170 of file Partridge_Covey.cpp.
References NestBadArea().
Referenced by NestNearBadAreas().
|
protected |
Nest location evaluation function.
Definition at line 1150 of file Partridge_Covey.cpp.
References m_height, m_width, NestBadArea(), Norm(), and NormInc().
Referenced by NestNearBadAreas().
|
protected |
Find nest location.
Definition at line 1207 of file Partridge_Covey.cpp.
References CoveyUpdateMemberPositions(), g_par_nest_min_dist_other_nest, m_map, m_nest_on_nest, NestGoodSpot(), NestNearBadAreas(), NestNearNests(), Landscape::SupplyPolyRef(), and CfgInt::value().
Referenced by NestFindLocation().
bool Partridge_Covey::NestFindLocation | ( | void | ) |
Try to locate a suitable nesting location.
Update covey position if we can find a suitable location and return true, or false if we failed to find a good spot.
Definition at line 1107 of file Partridge_Covey.cpp.
References g_par_terr_max_width, m_center_x, m_center_y, m_height, m_nearest_covey_dist, m_width, NestFindFast(), NestFindSlow(), and CfgInt::value().
Referenced by Partridge_Female::FMakingNest().
bool Partridge_Covey::NestFindSlow | ( | int | a_min_x_incl, |
int | a_max_x_excl, | ||
int | a_min_y_incl, | ||
int | a_max_y_excl | ||
) |
Find nest location (wrap around)
Definition at line 1236 of file Partridge_Covey.cpp.
References CoveyUpdateMemberPositions(), g_par_nest_min_dist_other_nest, ForIterator::GetLimit(), ForIterator::GetList(), m_height, m_map, m_nest_on_nest, m_width, NestGoodSpot(), NestNearBadAreas(), NestNearNests(), Landscape::SupplyPolyRef(), and CfgInt::value().
Referenced by NestFindLocation().
|
inline |
Return nest x-coord.
Definition at line 521 of file Partridge_Covey.h.
References m_nest_x.
Referenced by NestNearNests().
|
inline |
|
protected |
Evaluate x,y as a nest location.
Evaluate the given x,y, coord in terms of nesting quality. These qualities are set as configuration variables.
Definition at line 2876 of file Partridge_Covey.cpp.
References cfg_nest_field, cfg_nest_fieldboundary, cfg_nest_hedgebank0, cfg_nest_hedgebank1, cfg_nest_hedgebank2, cfg_nest_naturalgrass, cfg_nest_permpastlowyield, cfg_nest_permpasttussocky, cfg_nest_permsetaside, cfg_nest_railway, cfg_nest_roadside, m_map, TAnimal::m_OurLandscape, Landscape::SupplyElementSubType(), Landscape::SupplyElementType(), Landscape::SupplyVegPatchy(), tole_BeetleBank, tole_Field, tole_FieldBoundary, tole_Heath, tole_HedgeBank, tole_NaturalGrassDry, tole_PermanentSetaside, tole_PermPastureLowYield, tole_PermPastureTussocky, tole_Railway, tole_RoadsideVerge, and CfgInt::value().
Referenced by NestFindFast(), and NestFindSlow().
|
inline |
Leave the nest
Definition at line 516 of file Partridge_Covey.h.
References m_nest_on_nest.
Referenced by Partridge_Clutch::ClDeveloping(), Partridge_Female::FDying(), Partridge_Female::FIncubating(), Partridge_Female::FLaying(), Partridge_Female::OnClutchDeath(), Partridge_Female::OnEggsHatch(), and Partridge_Female::OnMateDying().
|
protected |
Test for proximity to unacceptable areas.
Determines if the x,y, positon is too close to something unacceptable
Definition at line 1131 of file Partridge_Covey.cpp.
References g_par_nest_min_dist_bad_areas, m_height, m_width, NestBadAreasScanFast(), NestBadAreasScanSlow(), and CfgInt::value().
Referenced by NestFindFast(), and NestFindSlow().
|
protected |
Nest location evaluation function.
Definition at line 1188 of file Partridge_Covey.cpp.
References g_covey_list, ID(), m_id, NestGetX(), and NestOnNest().
Referenced by NestFindFast(), and NestFindSlow().
|
inline |
Are we nesting?
Definition at line 511 of file Partridge_Covey.h.
References m_nest_on_nest.
Referenced by NestNearNests().
|
protected |
Wrap-around utility function.
A function to normalise co-ordinates that may have wrapped around and exceeded the landscape size (+/-)
Definition at line 866 of file Partridge_Covey.cpp.
Referenced by FlyToSlow(), MoveDistance(), MoveDoIt(), MoveTo(), MoveWeighDirection(), and NestBadAreasScanSlow().
|
protected |
Wrap-around utility function.
A function to normalise co-ordinates that may have wrapped around and become negative
Definition at line 882 of file Partridge_Covey.cpp.
Referenced by MoveOptimalDirectionSlow(), MoveSelectLimit(), and MoveWeighDirection().
|
protected |
Wrap-around utility function.
A function to normalise co-ordinates that may have wrapped around and exceeded the landscape maximum coord
Definition at line 895 of file Partridge_Covey.cpp.
Referenced by MoveOptimalDirectionSlow(), MoveSelectLimit(), MoveWeighDirection(), and NestBadAreasScanSlow().
void Partridge_Covey::OnAddChick | ( | Partridge_Female * | a_pf | ) |
Add a chick.
Definition at line 2451 of file Partridge_Covey.cpp.
References Partridge_Female::GetMate(), m_ourChicks, m_theDad, and m_theMum.
Referenced by Partridge_Chick::Partridge_Chick().
void Partridge_Covey::OnChickDeath | ( | void | ) |
Remove a dead chick.
Definition at line 2477 of file Partridge_Covey.cpp.
References Partridge_Population_Manager::m_comms_data, PartridgeCommunicationData::m_covey, PartridgeCommunicationData::m_female, PartridgeCommunicationData::m_male, m_manager, Partridge_Population_Manager::m_messagecentre, m_ourChicks, m_theDad, m_theMum, Partridge_Communication::PassMessage(), pcomm_AllChicksDead, and SetFixed().
Referenced by Partridge_Chick::ChDying().
void Partridge_Covey::OnChickMature | ( | void | ) |
Remove a matured chick.
Definition at line 2460 of file Partridge_Covey.cpp.
References Partridge_Population_Manager::m_comms_data, PartridgeCommunicationData::m_covey, PartridgeCommunicationData::m_female, PartridgeCommunicationData::m_male, m_manager, Partridge_Population_Manager::m_messagecentre, m_ourChicks, m_theDad, m_theMum, Partridge_Communication::PassMessage(), pcomm_ChicksMature, and SetFixed().
Referenced by Partridge_Chick2::ChMaturing().
void Partridge_Covey::OnDissolve | ( | int | date | ) |
Dissolve message handler.
Definition at line 1624 of file Partridge_Covey.cpp.
References m_state, pars_CoveyDissolve, and SetCoveyDissolveDate().
|
protected |
Behaviour when alpha male is killed.
Definition at line 2502 of file Partridge_Covey.cpp.
References ActOnParentDeath(), and m_theDad.
Referenced by RemoveMember().
|
protected |
Behaviour when alpha female is killed.
Definition at line 2494 of file Partridge_Covey.cpp.
References ActOnParentDeath(), and m_theMum.
Referenced by RemoveMember().
|
protected |
Get the pressure force.
Returns the reciprocal of a_distance above a threshold given by MIN_MATH_DIST_SQ. Note that the calling function is responsible for ensuring a_distance is transformed correctly (sqrt()).
Definition at line 1724 of file Partridge_Covey.cpp.
Referenced by ManagerRethinkPos().
|
protected |
Test for exceedence of pressure limit.
Definition at line 1737 of file Partridge_Covey.cpp.
References cfg_par_force_abs_limit, and CfgFloat::value().
Referenced by ManagerRethinkPos().
|
inline |
Decrement the chick number.
Definition at line 466 of file Partridge_Covey.h.
References m_ourChicks.
Referenced by Partridge_Chick2::Partridge_Chick2().
int Partridge_Covey::RemoveMember | ( | Partridge_Base * | a_former_member | ) |
Remove a member from the covey.
RemoveMember() causes the current Covey instance to be deleted! if a_former_member was the last one.
Definition at line 1664 of file Partridge_Covey.cpp.
References CoveyManager::DelCovey(), g_covey_manager, g_msg, Partridge_Base::GetID(), IsMember(), TALMaSSObject::m_CurrentStateNo, m_members, m_members_size, TALMaSSObject::m_StepDone, m_theDad, m_theMum, OntheDadDead(), OntheMumDead(), MapErrorMsg::Warn(), and WARN_BUG.
Referenced by Partridge_Chick::ChDying(), Partridge_Chick::ChMaturing(), Partridge_Chick2::ChMaturing(), Partridge_Clutch::ClDeveloping(), Partridge_Clutch::ClDying(), Partridge_Population_Manager::DissolveCovey(), Partridge_Female::FDying(), ManagerCheckMerge(), Partridge_Male::MDying(), Partridge_Male::MFindingMate(), and Partridge_Base::SwitchCovey().
void Partridge_Covey::SanityCheck | ( | ) |
Debug method.
Definition at line 2403 of file Partridge_Covey.cpp.
References g_msg, TALMaSSObject::m_CurrentStateNo, m_members, m_members_size, MapErrorMsg::Warn(), and WARN_BUG.
Referenced by Partridge_Population_Manager::DissolveCovey().
void Partridge_Covey::SanityCheck2 | ( | int | no_chicks | ) |
Debug method.
Definition at line 2416 of file Partridge_Covey.cpp.
References g_msg, GetObjectType(), m_members, m_members_size, pob_Chick, pob_Chick2, MapErrorMsg::Warn(), and WARN_BUG.
void Partridge_Covey::SanityCheck3 | ( | ) |
Debug method.
Definition at line 2430 of file Partridge_Covey.cpp.
References g_msg, m_move_list, MapErrorMsg::Warn(), and WARN_BUG.
void Partridge_Covey::SanityCheck4 | ( | ) |
Debug method.
Definition at line 2439 of file Partridge_Covey.cpp.
References g_msg, GetObjectType(), m_members, m_members_size, pob_Clutch, MapErrorMsg::Warn(), and WARN_BUG.
|
inline |
Set chick age.
Definition at line 481 of file Partridge_Covey.h.
References m_ChickAge.
Referenced by Partridge_Chick::BeginStep(), and Partridge_Chick2::BeginStep().
|
inline |
Set the dissolve date.
Definition at line 430 of file Partridge_Covey.h.
References m_CoveyDissolveDate.
Referenced by OnDissolve().
|
inline |
Prevent/enable peg drift.
Definition at line 572 of file Partridge_Covey.h.
References m_peg_is_fixed.
Referenced by Partridge_Female::FAttractingMate(), Partridge_Female::FFindingTerritory(), Partridge_Female::FMakingNest(), Partridge_Female::FStartingNewBrood(), Partridge_Male::MFindingMate(), OnChickDeath(), OnChickMature(), Partridge_Male::OnFemaleGivingUp(), Partridge_Female::OnMateDying(), and Partridge_Female::OnWaitForMale().
void Partridge_Covey::SetUncle | ( | void | ) |
Swap uncle to alhpha.
Called when both parents are dead but an uncle or aunt exist to take over the role.
Definition at line 2540 of file Partridge_Covey.cpp.
References g_msg, GetObjectType(), m_members, m_members_size, m_theDad, m_theMum, pars_FCaringForYoung, pars_MCaringForYoung, pob_Male, Partridge_Base::SetState(), Partridge_Base::SetUncleStatus(), MapErrorMsg::Warn(), and WARN_BUG.
Referenced by ActOnParentDeath().
|
virtual |
Covey Step.
Reimplemented from TAnimal.
Definition at line 1607 of file Partridge_Covey.cpp.
References TALMaSSObject::m_StepDone.
|
protected |
Returns the age of the chicks.
Definition at line 2608 of file Partridge_Covey.cpp.
References g_msg, Partridge_Base::GetAge(), GetObjectType(), m_members, m_members_size, pob_Chick, pob_Chick2, MapErrorMsg::Warn(), and WARN_BUG.
Referenced by ActOnParentDeath().
double Partridge_Covey::SupplyDistanceMoved | ( | void | ) |
Return the distance moved today.
Definition at line 914 of file Partridge_Covey.cpp.
References g_msg, m_dist_moved, m_move_done, MapErrorMsg::Warn(), and WARN_BUG.
double Partridge_Covey::SupplyFoodToday | ( | void | ) |
Return the food obtained today.
Definition at line 905 of file Partridge_Covey.cpp.
References g_msg, m_food_today, m_move_done, MapErrorMsg::Warn(), and WARN_BUG.
Referenced by Partridge_Chick::ChDeveloping().
double Partridge_Covey::SupplyHabitatQuality | ( | void | ) |
Return habitat quality at our location.
Definition at line 1050 of file Partridge_Covey.cpp.
References HabitatEvaluate(), m_center_x, m_center_y, m_terr_done, m_terr_qual, and m_terr_size.
bool Partridge_Covey::TooClose | ( | ) |
Test for another covey too close.
Definition at line 1271 of file Partridge_Covey.cpp.
References DistanceUpdate2(), and m_nearest_covey_dist.
Referenced by Partridge_Female::FFindingTerritory().
|
inline |
Definition at line 708 of file Partridge_Covey.h.
References m_covey_x.
Referenced by Partridge_Female::FIncubating().
|
inline |
|
inline |
Definition at line 728 of file Partridge_Covey.h.
References m_center_x_float.
Referenced by DistanceToCovey(), and ManagerCheckMerge().
|
inline |
Definition at line 713 of file Partridge_Covey.h.
References m_covey_y.
Referenced by Partridge_Female::FIncubating().
|
inline |
|
inline |
Definition at line 733 of file Partridge_Covey.h.
References m_center_y_float.
Referenced by DistanceToCovey(), and ManagerCheckMerge().
|
protected |
Have assessed habitat quality?
Definition at line 158 of file Partridge_Covey.h.
Referenced by AssessHabitatQuality(), AssessHabitatQualityFaster(), EndStep(), FixHabitat(), FlyTo(), ManagerUpdatePos(), MoveDistance(), MoveTo(), and Partridge_Covey().
|
protected |
Habitat quality.
Definition at line 160 of file Partridge_Covey.h.
Referenced by AssessHabitatQuality(), AssessHabitatQualityFaster(), and FixHabitat().
|
protected |
Current homerange assessment radius.
Definition at line 296 of file Partridge_Covey.h.
Referenced by AssessGetSize(), AssessHabitatQuality(), FixHabitat(), and Partridge_Covey().
|
protected |
Covey centre.
Definition at line 142 of file Partridge_Covey.h.
Referenced by FixHabitat(), FlyTo(), FlyToFast(), FlyToSlow(), ManagerUpdatePos(), MoveDirectionsAllowed(), NestFindLocation(), Partridge_Covey(), SupplyHabitatQuality(), and XCenter().
|
protected |
Covey centre as float.
Definition at line 134 of file Partridge_Covey.h.
Referenced by DistanceToCovey(), FixHabitat(), FlyTo(), ManagerCheckMerge(), ManagerDriftPos(), ManagerRethinkPos(), ManagerUpdatePos(), Partridge_Covey(), and XCenterF().
|
protected |
Covey centre.
Definition at line 144 of file Partridge_Covey.h.
Referenced by FixHabitat(), FlyTo(), FlyToFast(), FlyToSlow(), ManagerUpdatePos(), MoveDirectionsAllowed(), NestFindLocation(), Partridge_Covey(), SupplyHabitatQuality(), and YCenter().
|
protected |
Covey centre as float.
Definition at line 136 of file Partridge_Covey.h.
Referenced by DistanceToCovey(), FixHabitat(), FlyTo(), ManagerCheckMerge(), ManagerDriftPos(), ManagerRethinkPos(), ManagerUpdatePos(), Partridge_Covey(), and YCenterF().
|
protected |
Age of chicks.
Definition at line 397 of file Partridge_Covey.h.
Referenced by BeginStep(), GetChickAge(), and SetChickAge().
|
protected |
Covey x-coord.
Definition at line 146 of file Partridge_Covey.h.
Referenced by AssessHabitatQuality(), AssessHabitatQualityFaster(), FindMateInArea(), FixHabitat(), FlyTo(), FlyToFast(), FlyToSlow(), ManagerDriftPos(), MoveDistance(), MoveTo(), Partridge_Covey(), and X().
|
protected |
Covey y-coord.
Definition at line 148 of file Partridge_Covey.h.
Referenced by AssessHabitatQuality(), AssessHabitatQualityFaster(), FindMateInArea(), FixHabitat(), FlyTo(), FlyToFast(), FlyToSlow(), ManagerDriftPos(), MoveDistance(), MoveTo(), Partridge_Covey(), and Y().
|
protected |
Date for covey dissolve.
Definition at line 383 of file Partridge_Covey.h.
Referenced by BeginStep(), Partridge_Covey(), and SetCoveyDissolveDate().
|
protected |
Signals distance updating is done for today
Definition at line 114 of file Partridge_Covey.h.
Referenced by FlyTo(), HabitatEvaluate(), ManagerUpdatePos(), MoveDistance(), and Partridge_Covey().
|
protected |
Distance moved.
Definition at line 164 of file Partridge_Covey.h.
Referenced by MoveDistance(), MoveTo(), Partridge_Covey(), and SupplyDistanceMoved().
|
protected |
flag for excess density - unused
Definition at line 100 of file Partridge_Covey.h.
Referenced by LifeEssenceLow(), ManagerRethinkPos(), and Partridge_Covey().
|
protected |
costly intermediate variable
Definition at line 96 of file Partridge_Covey.h.
Referenced by FlyToFast(), FlyToSlow(), and Partridge_Covey().
|
protected |
costly intermediate variable
Definition at line 94 of file Partridge_Covey.h.
Referenced by FlyToFast(), and FlyToSlow().
|
protected |
costly intermediate variable
Definition at line 98 of file Partridge_Covey.h.
Referenced by FlyToFast(), and FlyToSlow().
|
protected |
Food collected.
Definition at line 166 of file Partridge_Covey.h.
Referenced by MoveDistance(), MoveTo(), Partridge_Covey(), and SupplyFoodToday().
|
protected |
unused
Definition at line 122 of file Partridge_Covey.h.
Referenced by ForceLow(), ManagerRethinkPos(), and Partridge_Covey().
|
protected |
Landscape height.
Definition at line 130 of file Partridge_Covey.h.
Referenced by DistanceToCovey(), DistanceUpdate(), DistanceUpdate2(), FlyTo(), FlyToSlow(), HabitatEvaluate(), HabitatEvaluateFaster(), HabitatEvaluateSlow(), ManagerDriftPos(), ManagerRethinkPos(), ManagerUpdatePos(), MoveDirectionsAllowed(), MoveDistance(), MoveDoIt(), MoveOptimalDirectionSlow(), MoveTo(), NestBadAreasScanSlow(), NestFindLocation(), NestFindSlow(), NestNearBadAreas(), and Partridge_Covey().
|
protected |
Unique ID no-
Definition at line 106 of file Partridge_Covey.h.
Referenced by DistanceUpdate(), DistanceUpdate2(), ID(), ManagerCheckMerge(), ManagerRethinkPos(), NestNearNests(), and Partridge_Covey().
|
protected |
Covey's population manager.
Definition at line 132 of file Partridge_Covey.h.
Referenced by BeginStep(), FindMateInArea(), HabitatEvaluateFaster(), OnChickDeath(), OnChickMature(), and Partridge_Covey().
|
protected |
A pointer to the landscape.
Definition at line 126 of file Partridge_Covey.h.
Referenced by CanWeMerge(), FlyToFast(), FlyToSlow(), HabitatEvalPolyField(), HabitatEvaluateFast(), HabitatEvaluateSlow(), MoveCanMove(), MoveMagicVegToFood(), MoveOptimalDirectionFast(), MoveOptimalDirectionSlow(), NestBadArea(), NestFindFast(), NestFindSlow(), NestGoodSpot(), and Partridge_Covey().
|
protected |
Max move distance today.
Determined at the end of the begin step and depending on the age of the chicks. If MoveDistance is called in the BeginStep then it will use yesterdays values.
Definition at line 390 of file Partridge_Covey.h.
Referenced by GetmaxAllowedMove(), and Partridge_Covey().
|
protected |
Food needed today.
Determined at the end of the begin step and depending on the age of the chicks. If MoveDistance is called in the BeginStep then it will use yesterdays values.
Definition at line 395 of file Partridge_Covey.h.
Referenced by BeginStep(), GetmaxFoodNeedToday(), and Partridge_Covey().
|
protected |
List of covey members
Definition at line 108 of file Partridge_Covey.h.
Referenced by AddMember(), AllFlocking(), AllFlocking2(), ArePaired(), ChickExtraMortality(), CoveyEmigrate(), CoveyIndividualEmigrate(), CoveyUpdateMemberPositions(), FindMeAHusband(), FindMeAMateInCovey(), FindMeAWife(), GetAMember(), GetMaleInCovey(), GetMember(), GetUncleNumber(), GetUnpairedFemale(), GetUnpairedFemale_virgin(), HaveWeChicks(), IsMember(), KillChicks(), KillExcessChicks(), Partridge_Covey(), RemoveMember(), SanityCheck(), SanityCheck2(), SanityCheck4(), SetUncle(), and SupplyChickAge().
|
protected |
Size of covey
Definition at line 110 of file Partridge_Covey.h.
Referenced by AddMember(), AllFlocking(), AllFlocking2(), ArePaired(), ChickExtraMortality(), CoveyEmigrate(), CoveyIndividualEmigrate(), CoveyUpdateMemberPositions(), FindMeAHusband(), FindMeAMateInCovey(), FindMeAWife(), GetCoveySize(), GetMaleInCovey(), GetUncleNumber(), GetUnpairedFemale(), GetUnpairedFemale_virgin(), HaveWeChicks(), IsMember(), KillChicks(), KillExcessChicks(), ManagerCheckMerge(), Memberships(), Partridge_Covey(), RemoveMember(), SanityCheck(), SanityCheck2(), SanityCheck4(), SetUncle(), and SupplyChickAge().
|
protected |
Have moved?
Definition at line 162 of file Partridge_Covey.h.
Referenced by EndStep(), FixHabitat(), FlyTo(), MoveDistance(), Partridge_Covey(), SupplyDistanceMoved(), and SupplyFoodToday().
|
protected |
Internal variable.
Definition at line 304 of file Partridge_Covey.h.
Referenced by MoveDistance(), and MoveTo().
|
protected |
Internal variable.
Definition at line 306 of file Partridge_Covey.h.
|
protected |
Internal variable.
Definition at line 310 of file Partridge_Covey.h.
Referenced by MoveQualMemory(), and Partridge_Covey().
|
protected |
Steps remembered.
Definition at line 308 of file Partridge_Covey.h.
Referenced by MoveDistance(), MoveQualMemory(), MoveSelectLimit(), MoveTo(), and Partridge_Covey().
|
protected |
Internal variable.
Definition at line 318 of file Partridge_Covey.h.
Referenced by MoveDistance(), MoveOptimalDirectionFast(), MoveOptimalDirectionSlow(), MoveTo(), and Partridge_Covey().
|
protected |
Internal variable.
Definition at line 320 of file Partridge_Covey.h.
Referenced by MoveDistance(), MoveEvalEdgesAndQual(), MoveTo(), and Partridge_Covey().
|
protected |
Internal variable.
The direction we came from in the previous move. Remembered across daily steps.
Definition at line 316 of file Partridge_Covey.h.
Referenced by MoveDistance(), MoveSelectLimit(), MoveTo(), MoveWeighDirection(), and Partridge_Covey().
|
protected |
Closest covey distance
Definition at line 116 of file Partridge_Covey.h.
Referenced by DistanceUpdate(), DistanceUpdate2(), HabitatEvaluate(), MoveTryExclude(), MoveTryExcludeHarder(), NestFindLocation(), Partridge_Covey(), and TooClose().
Partridge_Covey* Partridge_Covey::m_neighbourlist[50] |
List of coveys close to this covey.
Definition at line 284 of file Partridge_Covey.h.
Referenced by Partridge_Population_Manager::FillCoveyNeigbourList(), and FindNeighbour().
int Partridge_Covey::m_neighbourlist_size |
Number of coveys close to this covey.
Definition at line 286 of file Partridge_Covey.h.
Referenced by Partridge_Population_Manager::FillCoveyNeigbourList(), and FindNeighbour().
|
protected |
Nesting flag.
Definition at line 152 of file Partridge_Covey.h.
Referenced by MoveDistance(), NestFindFast(), NestFindSlow(), NestLeave(), NestOnNest(), and Partridge_Covey().
|
protected |
Nest coord-x.
Definition at line 154 of file Partridge_Covey.h.
Referenced by NestGetX(), and Partridge_Covey().
|
protected |
Nest coord-y.
Definition at line 156 of file Partridge_Covey.h.
Referenced by NestGetY(), and Partridge_Covey().
|
protected |
Covey centre as float.
Definition at line 138 of file Partridge_Covey.h.
Referenced by ManagerDriftPos(), ManagerRethinkPos(), and ManagerUpdatePos().
|
protected |
Covey centre as float.
Definition at line 140 of file Partridge_Covey.h.
Referenced by ManagerDriftPos(), ManagerRethinkPos(), and ManagerUpdatePos().
|
protected |
No chicks in covey.
Definition at line 381 of file Partridge_Covey.h.
Referenced by CanWeMerge(), GetOurChicks(), KillExcessChicks(), OnAddChick(), OnChickDeath(), OnChickMature(), Partridge_Covey(), and RemoveExtraChick().
|
protected |
flag for fixed homerange
Definition at line 102 of file Partridge_Covey.h.
Referenced by IsFixed(), ManagerDriftPos(), ManagerRethinkPos(), ManagerUpdatePos(), Partridge_Covey(), and SetFixed().
|
protected |
Unused
Definition at line 104 of file Partridge_Covey.h.
Referenced by ManagerDriftPos(), ManagerIsPermanant(), ManagerRethinkPos(), ManagerSetPermanent(), ManagerUpdatePos(), and Partridge_Covey().
|
protected |
The current behavioural state.
Definition at line 124 of file Partridge_Covey.h.
Referenced by BeginStep(), OnDissolve(), and Partridge_Covey().
|
protected |
Signals Step is done for today
Definition at line 112 of file Partridge_Covey.h.
Referenced by EndStep(), and Partridge_Covey().
|
protected |
Signals homerange evaluation done
Definition at line 118 of file Partridge_Covey.h.
Referenced by EndStep(), FixHabitat(), FlyTo(), ManagerUpdatePos(), Partridge_Covey(), and SupplyHabitatQuality().
|
protected |
Homerange evaluation score
Definition at line 120 of file Partridge_Covey.h.
Referenced by FixHabitat(), and SupplyHabitatQuality().
|
protected |
Homerange width.
Definition at line 150 of file Partridge_Covey.h.
Referenced by FixHabitat(), Partridge_Covey(), and SupplyHabitatQuality().
|
protected |
Pointer to the alpha female.
Definition at line 379 of file Partridge_Covey.h.
Referenced by ActOnParentDeath(), OnAddChick(), OnChickDeath(), OnChickMature(), OntheDadDead(), Partridge_Covey(), RemoveMember(), and SetUncle().
|
protected |
Pointer to the alpha male.
Definition at line 377 of file Partridge_Covey.h.
Referenced by ActOnParentDeath(), OnAddChick(), OnChickDeath(), OnChickMature(), OntheMumDead(), Partridge_Covey(), RemoveMember(), and SetUncle().
|
protected |
Landscape width.
Definition at line 128 of file Partridge_Covey.h.
Referenced by DistanceToCovey(), DistanceUpdate(), DistanceUpdate2(), FlyTo(), FlyToSlow(), HabitatEvaluate(), HabitatEvaluateFaster(), HabitatEvaluateSlow(), ManagerDriftPos(), ManagerRethinkPos(), ManagerUpdatePos(), MoveDirectionsAllowed(), MoveDoIt(), MoveOptimalDirectionSlow(), NestBadAreasScanSlow(), NestFindLocation(), NestFindSlow(), NestNearBadAreas(), and Partridge_Covey().