ALMaSS Hare ODDox
1.1
The hare model description following ODdox protocol
|
Class for juvenile hares (after 5 weeks old, fully mobile) More...
#include <Hare_all.h>
Public Member Functions | |
virtual void | BeginStep (void) |
BeginStep for Hare_Juvenile. More... | |
virtual void | EndStep (void) |
BeginStep for Hare_Juvenile. More... | |
Hare_Juvenile (int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM, double p_weight) | |
Constructor for the juvenile hare object. More... | |
void | Init (double p_weight) |
Object initiation. More... | |
virtual void | ON_Dead () |
void | ReInit (struct_Hare a_data) |
Juvenile object reinitiation. More... | |
virtual void | Step (void) |
Step for Hare_Juvenile. More... | |
virtual | ~Hare_Juvenile () |
Destructor for the juvenile hare object. More... | |
![]() | |
int | GetAge () |
Hare_Female * | GetMum () |
Get the mother pointer. More... | |
int | GetRefNum () |
Get the refnum for this hare. More... | |
double | GetRMR () |
Get todays RMR. More... | |
double | GetTotalWeight () |
Provide the wet weight of the hare. More... | |
double | GetWeight () |
void | loadVegPalatability (void) |
Loads static member m_vegPalatability with data. More... | |
void | ON_MumDead (Hare_Female *a_Mum) |
Inform Mum that we are dead. More... | |
void | SetMum (Hare_Female *) |
Set the mother pointer. Reimplemented in Hare_Infant. More... | |
THare (int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM) | |
Constructor. More... | |
void | THareInit (int p_x, int p_y, THare_Population_Manager *p_PPM) |
Object Initiation. More... | |
virtual | ~THare () |
Destructor. More... | |
![]() | |
void | CheckManagement (void) |
void | CheckManagementXY (int x, int y) |
virtual void | CopyMyself () |
virtual void | Dying () |
virtual void | KillThis () |
virtual void | ReinitialiseObject (int x, int y, Landscape *L) |
Used to re-use an object - must be implemented in descendent classes. More... | |
void | SetX (int a_x) |
void | SetY (int a_y) |
int | Supply_m_Location_x () |
int | Supply_m_Location_y () |
unsigned | SupplyFarmOwnerRef () |
APoint | SupplyPoint () |
int | SupplyPolygonRef () |
AnimalPosition | SupplyPosition () |
TAnimal (int x, int y, Landscape *L) | |
virtual int | WhatState () |
![]() | |
int | GetCurrentStateNo () |
Returns the current state number. More... | |
bool | GetStepDone () |
Returns the step done indicator flag. More... | |
void | OnArrayBoundsError () |
Used for debugging only, tests basic object properties. More... | |
virtual void | ReinitialiseObject () |
Used to re-use an object - must be implemented in descendent classes. More... | |
void | SetCurrentStateNo (int a_num) |
Sets the current state number. More... | |
void | SetStepDone (bool a_bool) |
Sets the step done indicator flag. More... | |
TALMaSSObject () | |
The constructor for TALMaSSObject. More... | |
virtual | ~TALMaSSObject () |
The destructor for TALMaSSObject. More... | |
Protected Member Functions | |
bool | ShouldMature () |
Test for maturation. More... | |
TTypeOfHareState | st_Developing () |
The development code for Hare_Juvenile. More... | |
TTypeOfHareState | st_Dispersal () |
Juvenile Dispersal. More... | |
TTypeOfHareState | st_Foraging () |
Juvenile foraging. More... | |
void | st_NextStage () |
Maturation to Hare_Male or Hare_Female. More... | |
TTypeOfHareState | st_Resting () |
Juvenile Resting. More... | |
virtual bool | WasPredated () |
Test for mortality. More... | |
![]() | |
void | EnergyBalance (TTypeOfActivity a_activity, int dist) |
Adjust energy balance for an activity. More... | |
double | Forage (int &time) |
Foraging. More... | |
double | ForageP (int &time) |
Foraging but also incorporating pesticide exposure. More... | |
double | ForageSquare (int a_x, int a_y) |
Forage from an area. More... | |
double | ForageSquareP (int a_x, int a_y, double *a_pestexposure) |
Forage from an area and resturn pesticide exposure as well as food. More... | |
virtual void | GeneralEndocrineDisruptor (double) |
Handles internal effects of endocrine distrupter pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes. More... | |
virtual void | GeneralOrganoPhosphate (double) |
Handles internal effects of organophosphate pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes. More... | |
int | GetPegDirection () |
Get direction of peg. More... | |
int | GetPegDistance () |
Get peg distance. More... | |
int | GetPegPull () |
Get attractive force of peg. More... | |
virtual void | InternalPesticideHandlingAndResponse () |
Handles internal effects of pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes. More... | |
void | MovePeg () |
Move the peg according to attraction forces. More... | |
bool | OnFarmEvent (FarmToDo event) |
Do we require a response to a farm event. More... | |
bool | Run (int a_dist, int a_direction) |
Run a distance in a direction. More... | |
virtual void | Running (int a_max_dist) |
Run. More... | |
void | st_Dying () |
Tidy up before removing the object on death. More... | |
void | TimeBudget (TTypeOfActivity a_activity, int dist) |
Adjust time budger for an activity. More... | |
void | Walking (int a_dist, int a_direction) |
Walking. More... | |
![]() | |
void | CorrectWrapRound () |
Corrects wrap around co-ordinate problems. More... | |
Additional Inherited Members | |
![]() | |
static double * | m_vegPalatability = NULL |
Will hold and array of palatability for hare for each tov type. Most are 1, but unpalatable vegetation can be specified here. More... | |
![]() | |
int | m_ActivityTime |
Minutes of potential activity time per day. More... | |
int | m_Age |
State variale - hare age. More... | |
TTypeOfHareState | m_CurrentHState |
Defines the current activity. More... | |
int | m_ddindex |
State variable used in alternative density-dependent configurations. More... | |
int | m_DensitySum |
State variable used in alternative density-dependent configurations. More... | |
double | m_EnergyMax |
State variable - the amount of energy it is possible to eat as a multiplyer or RMR. More... | |
int | m_expDensity [365] |
State variable used in alternative density-dependent configurations. More... | |
int | m_experiencedDensity |
State variable used in alternative density-dependent configurations. More... | |
double | m_fatReserve |
State variable - the energy reserve of the hare. More... | |
double | m_foragingenergy |
Energy obtained from foraging/feeding. More... | |
bool | m_IamSick |
flag for sickness - used in conjunction with disease configurations More... | |
double | m_KJForaging |
KJ/m cost of foraging per kg hare. More... | |
double | m_KJRunning |
KJ/m cost of running per kg hare. More... | |
double | m_KJWalking |
KJ/m cost of walking per kg hare. More... | |
int | m_lastYearsDensity |
State variable used in alternative density-dependent configurations. More... | |
int | m_Lifespan |
Physiolocal lifespan, assuming nothing else kills the hare (unlikely to reach this age) More... | |
Hare_Female * | m_MyMum |
Pointer to the hare's mum. More... | |
double | m_old_weight |
State variale - last hare weight. More... | |
THare_Population_Manager * | m_OurPopulationManager |
Pointer to the hare population manager. More... | |
int | m_peg_x |
peg x-coordinate More... | |
int | m_peg_y |
peg y-coordinate More... | |
double | m_pesticide_burden |
State variable used to hold the current body-burden of pesticide. More... | |
double | m_pesticidedegradationrate |
State variable used to hold the daily degredation rate of the pesticide in the body. More... | |
bool | m_pesticideInfluenced1 |
Flag to indicate pesticide effects (e.g. can be used for endocrine distruptors with delayed effects until birth). More... | |
int | m_RefNum |
Unique hare reference number, also functions as sex flag. More... | |
double | m_SpeedRunning |
m/min speed of running per kg hare More... | |
double | m_SpeedWalking |
m/min speed of walking per kg hare More... | |
int | m_StarvationDays |
State variable - the number of consecutive days in negative energy balance. More... | |
double | m_TodaysEnergy |
State variable - the amount of energy available today, can be in deficit. More... | |
Hare_Object | m_Type |
State variale - the type of hare. More... | |
double | m_weight |
State variale - hare weight g. More... | |
![]() | |
int | m_Location_x |
int | m_Location_y |
Landscape * | m_OurLandscape |
![]() | |
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... | |
Class for juvenile hares (after 5 weeks old, fully mobile)
Definition at line 924 of file Hare_all.h.
Hare_Juvenile::Hare_Juvenile | ( | int | p_x, |
int | p_y, | ||
Landscape * | p_L, | ||
THare_Population_Manager * | p_PPM, | ||
double | p_weight | ||
) |
Constructor for the juvenile hare object.
Definition at line 2219 of file Hare_all.cpp.
References Init().
|
virtual |
Destructor for the juvenile hare object.
Definition at line 2247 of file Hare_all.cpp.
|
virtual |
BeginStep for Hare_Juvenile.
Resets the day's activity counter and checks for default mortalities and potentially extra mortalities. Calculates energy usage for movement based on todays weight
Reimplemented from THare.
Reimplemented in Hare_Female, and Hare_Male.
Definition at line 2261 of file Hare_all.cpp.
References cfg_hare_escape_dist(), cfg_hare_proximity_alert(), cfg_MaxEnergyIntakeScaler(), TAnimal::CheckManagement(), g_rand_uni, THare_Population_Manager::GetInterference(), THare_Population_Manager::GetKJperM(), THare::GetRMR(), THare_Population_Manager::GetTotalDensity(), THare::m_ActivityTime, TALMaSSObject::m_CurrentStateNo, THare::m_ddindex, THare::m_DensitySum, THare::m_EnergyMax, THare::m_expDensity, THare_Population_Manager::m_HareThresholdDD, THare_Population_Manager::m_JuvMortRate, THare::m_KJForaging, THare::m_KJRunning, THare::m_KJWalking, THare::m_lastYearsDensity, TAnimal::m_Location_x, TAnimal::m_Location_y, THare::m_old_weight, THare::m_OurPopulationManager, TALMaSSObject::m_StepDone, THare::m_weight, ON_Dead(), and THare::Running().
|
virtual |
BeginStep for Hare_Juvenile.
Just moves the homerange centre peg closer to where the hare has been active today
Reimplemented from THare.
Reimplemented in Hare_Female, and Hare_Male.
Definition at line 2379 of file Hare_all.cpp.
References cfg_hare_pesticideresponse_on(), THare::InternalPesticideHandlingAndResponse(), and THare::MovePeg().
void Hare_Juvenile::Init | ( | double | p_weight | ) |
Object initiation.
Definition at line 2236 of file Hare_all.cpp.
References hob_Juvenile, THare::m_Age, THare::m_Type, and THare::m_weight.
Referenced by Hare_Juvenile(), and ReInit().
|
virtual |
Do the housekeeping necessary for removal of the object - in this case minimal.
Reimplemented from THare.
Reimplemented in Hare_Female, and Hare_Male.
Definition at line 2654 of file Hare_all.cpp.
References THare::m_CurrentHState, TALMaSSObject::m_CurrentStateNo, TALMaSSObject::m_StepDone, and tohs_DestroyObject.
Referenced by BeginStep(), THare_Population_Manager::Hunting(), THare_Population_Manager::HuntingGrid(), and Step().
void Hare_Juvenile::ReInit | ( | struct_Hare | a_data | ) |
Juvenile object reinitiation.
Definition at line 2225 of file Hare_all.cpp.
References struct_Hare::HM, Init(), struct_Hare::L, TALMaSSObject::m_CurrentStateNo, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, THare::THareInit(), struct_Hare::weight, struct_Hare::x, and struct_Hare::y.
Referenced by THare_Population_Manager::CreateObjects().
|
protected |
Test for maturation.
This method will be used to determine whether the hare becomes sexually active - and therefore needs to become an adult hare.
Definition at line 2630 of file Hare_all.cpp.
References THare::m_Age, TAnimal::m_OurLandscape, and Landscape::SupplyDayInYear().
Referenced by st_Developing().
|
protected |
The development code for Hare_Juvenile.
Tests for the onset of maturation. Also tests for minimum growth attainment if this is switched on - too low growth results in death.
Assumes that the fatReserve has been added to by st_Foraging from yesterday.
This is the last behaviour state called each day, so we can use this to sort out the energetics.
Definition at line 2522 of file Hare_all.cpp.
References cfg_AdultMaxFat(), cfg_juv_starve(), cfg_juvenile_starvation_threshold(), g_rand_uni, THare_Population_Manager::GetGrowthEfficiencyF(), THare_Population_Manager::GetGrowthEfficiencyP(), THare_Population_Manager::GetMaxDailyGrowthEnergyF(), THare_Population_Manager::GetMaxDailyGrowthEnergyP(), THare::m_Age, THare::m_fatReserve, THare::m_OurPopulationManager, THare::m_StarvationDays, THare::m_TodaysEnergy, THare::m_weight, ShouldMature(), tohs_Dying, tohs_Foraging, and tohs_NextStage.
Referenced by Step().
|
protectedvirtual |
Juvenile Dispersal.
Makes a test of habitat quality (basically food) in 8 directions, then moves to the best one. This is basically a teleport move, so testing for barriers is not done. This will need to be added if it becomes a problem (e.g. hares appearing on islands they could not otherwise get too), however, this will also confer an extreme performance penalty!
Reimplemented from THare.
Reimplemented in Hare_Female.
Definition at line 2449 of file Hare_all.cpp.
References activity_Dispersal, THare_Population_Manager::AddHareDensity(), cfg_hare_max_dispersal(), THare::EnergyBalance(), THare_Population_Manager::GetAdultDensity(), Landscape::GetHareFoodQuality(), THare_Population_Manager::GetInterference(), TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, THare::m_OurPopulationManager, THare::m_Type, THare::m_vegPalatability, THare_Population_Manager::SubtractHareDensity(), Landscape::SupplyPolyRef(), Landscape::SupplyVegType(), THare::TimeBudget(), tohs_Dying, tohs_Foraging, THare::Walking(), and WasPredated().
Referenced by Hare_Female::st_Dispersal(), Step(), and Hare_Male::Step().
|
protected |
Juvenile foraging.
Given the time we have then we need to feed, which will return an energy value obtained.
Definition at line 2385 of file Hare_all.cpp.
References activity_Foraging, cfg_ForageRestingRatio(), cfg_hare_pesticideresponse_on(), cfg_JuvDDScale(), THare::Forage(), THare::ForageP(), g_rand_uni, THare_Population_Manager::GetInterference(), THare::m_ActivityTime, THare_Population_Manager::m_HareThresholdDD, THare::m_OurPopulationManager, THare::m_TodaysEnergy, THare::TimeBudget(), tohs_Dispersal, and tohs_Resting.
Referenced by Step().
|
protected |
Maturation to Hare_Male or Hare_Female.
This creates a Hare_Juvenile object via a call to create objects, then sets the flag for destruction of this object.
Definition at line 2607 of file Hare_all.cpp.
References struct_Hare::age, THare_Population_Manager::CreateObjects(), struct_Hare::HM, struct_Hare::L, THare::m_Age, THare::m_CurrentHState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, THare::m_OurPopulationManager, THare::m_RefNum, THare::m_weight, struct_Hare::Mum, struct_Hare::RefNum, tohs_DestroyObject, struct_Hare::weight, struct_Hare::x, and struct_Hare::y.
Referenced by Step().
|
protected |
Juvenile Resting.
The hare spends some time resting (using time and a little energy)
Definition at line 2507 of file Hare_all.cpp.
References activity_Resting, THare::EnergyBalance(), THare::m_ActivityTime, THare::TimeBudget(), and tohs_Developing.
Referenced by Step().
|
virtual |
Step for Hare_Juvenile.
As with all other ALMaSS animal objects, Step is where the primary state/transtion work is done
Reimplemented from THare.
Reimplemented in Hare_Female, and Hare_Male.
Definition at line 2316 of file Hare_all.cpp.
References cfg_hare_juvenile_predation(), g_rand_uni, THare::m_CurrentHState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, ON_Dead(), st_Developing(), st_Dispersal(), st_Foraging(), st_NextStage(), st_Resting(), tohs_Developing, tohs_Dispersal, tohs_Dying, tohs_Foraging, tohs_InitialState, tohs_NextStage, tohs_Resting, and Landscape::Warn().
|
protectedvirtual |
Test for mortality.
Reimplemented from THare.
Definition at line 2645 of file Hare_all.cpp.
References g_rand_uni, THare_Population_Manager::m_JuvMortRate, and THare::m_OurPopulationManager.
Referenced by Hare_Male::BeginStep(), Hare_Female::BeginStep(), and st_Dispersal().