ALMaSS Hare ODDox
1.1
The hare model description following ODdox protocol
|
Class for young hares (low mobility, milk and solid food inputs) More...
#include <Hare_all.h>
Public Member Functions | |
virtual void | BeginStep (void) |
BeginStep for Hare_Young. More... | |
virtual void | EndStep (void) |
EndStep code for Hare_Young. More... | |
Hare_Young (int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM, double p_weight) | |
Constructor for Hare_Young. More... | |
void | Init (double p_weight) |
Object initiation. More... | |
virtual void | ON_Dead () |
This hare has been killed. More... | |
void | ReInit (struct_Hare a_data) |
Young object reinitiation. More... | |
virtual void | Step (void) |
Step code for Hare_Young. More... | |
virtual | ~Hare_Young () |
Destructor for Hare_Young. More... | |
![]() | |
Hare_Infant (int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM) | |
Hare infant constructor. More... | |
void | Init () |
Object initiation. More... | |
void | ON_BeingFed (double a_someMilk) |
Get energy from milk given. More... | |
void | ReInit (struct_Hare a_data) |
Infant object reinitiation. More... | |
void | SetMum (Hare_Female *a_af) |
Set the mother pointer. More... | |
void | SetWeight (double w) |
Set the weight. More... | |
virtual | ~Hare_Infant () |
Hare infant destructor. 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 bool | WasPredated () |
Test for predation. 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 | OnFarmEvent (FarmToDo event) |
Response to farm actions. More... | |
TTypeOfHareState | st_Developing () |
Developmental code for the young hare. More... | |
TTypeOfHareState | st_Dispersal () |
Not used. More... | |
TTypeOfHareState | st_Foraging () |
Young foraging. More... | |
void | st_NextStage () |
Maturation to Hare_Juvenile. More... | |
TTypeOfHareState | st_Resting () |
Resting. More... | |
![]() | |
TTypeOfHareState | st_Developing () |
Developmental behaviour for the infant hare. More... | |
void | st_NextStage () |
'mature' to become a young 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 | 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 young hares (low mobility, milk and solid food inputs)
Definition at line 872 of file Hare_all.h.
Hare_Young::Hare_Young | ( | int | p_x, |
int | p_y, | ||
Landscape * | p_L, | ||
THare_Population_Manager * | p_PPM, | ||
double | p_weight | ||
) |
Constructor for Hare_Young.
Definition at line 1716 of file Hare_all.cpp.
References Hare_Infant::Init().
|
virtual |
Destructor for Hare_Young.
Definition at line 1744 of file Hare_all.cpp.
|
virtual |
BeginStep for Hare_Young.
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 Hare_Infant.
Definition at line 1754 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_EnergyMax, THare_Population_Manager::m_HareThresholdDD, THare::m_KJForaging, THare::m_KJRunning, THare::m_KJWalking, TAnimal::m_Location_x, TAnimal::m_Location_y, THare::m_old_weight, THare::m_OurPopulationManager, TALMaSSObject::m_StepDone, THare::m_weight, THare_Population_Manager::m_YoungMortRate, ON_Dead(), and THare::Running().
|
virtual |
EndStep code for Hare_Young.
NB development must be called here because they hares may be still getting milk from Mum.
In EndStep, the home-range centre peg gravitates a little way towards the daily activity area for today.
Reimplemented from Hare_Infant.
Definition at line 1851 of file Hare_all.cpp.
References cfg_hare_pesticideresponse_on(), THare::InternalPesticideHandlingAndResponse(), THare::m_CurrentHState, THare::MovePeg(), ON_Dead(), st_Developing(), tohs_Developing, and tohs_Dying.
void Hare_Young::Init | ( | double | p_weight | ) |
Object initiation.
Definition at line 1733 of file Hare_all.cpp.
References hob_Young, THare::m_Age, THare::m_Type, and THare::m_weight.
|
virtual |
This hare has been killed.
Housekeeping for removal of the object, lets Mum know if there is a Mum
Reimplemented from Hare_Infant.
Definition at line 2206 of file Hare_all.cpp.
References THare::st_Dying().
Referenced by BeginStep(), EndStep(), and OnFarmEvent().
|
protectedvirtual |
Response to farm actions.
Checks to see if any nasty farm event has caused the death of the infant.
Currently there is only one response to those events where death is possible. However, this may not always be the case so the code is structured as for the other ALMaSS animals (i.e. it could be a bit easier to overview if it were written differently).
Reimplemented from Hare_Infant.
Definition at line 1999 of file Hare_all.cpp.
References autumn_harrow, autumn_or_spring_plough, autumn_plough, autumn_roll, autumn_sow, bed_forming, biocide, bulb_harvest, burn_straw_stubble, cattle_out, cattle_out_low, cfg_hare_y_cut(), cut_to_hay, cut_to_silage, cut_weeds, deep_ploughing, Landscape::EventtypeToString(), fa_ammoniumsulphate, fa_calcium, fa_greenmanure, fa_manganesesulphate, fa_manure, fa_npk, fa_npks, fa_pk, fa_rsm, fa_sludge, fa_slurry, flower_cutting, fp_ammoniumsulphate, fp_calcium, fp_greenmanure, fp_liquidNH3, fp_manganesesulphate, fp_manure, fp_npk, fp_npks, fp_pk, fp_rsm, fp_sludge, fp_slurry, fungicide_treat, glyphosate, growth_regulator, harvest, hay_bailing, hay_turning, heavy_cultivator_aggregate, herbicide_treat, hilling_up, insecticide_treat, TAnimal::m_OurLandscape, molluscicide, mow, ON_Dead(), pigs_out, preseeding_cultivator, preseeding_cultivator_sow, product_treat, row_cultivation, shallow_harrow, sleep_all_day, spring_harrow, spring_plough, spring_roll, spring_sow, spring_sow_with_ferti, straw_chopping, straw_covering, straw_removal, strigling, strigling_hill, strigling_sow, stubble_cultivator_heavy, stubble_harrowing, stubble_plough, swathing, syninsecticide_treat, trial_control, trial_insecticidetreat, trial_toxiccontrol, Landscape::Warn(), water, and winter_plough.
void Hare_Young::ReInit | ( | struct_Hare | a_data | ) |
Young object reinitiation.
Definition at line 1722 of file Hare_all.cpp.
References struct_Hare::HM, Hare_Infant::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 |
Developmental code for the young hare.
Definition at line 1938 of file Hare_all.cpp.
References cfg_young_starvation_threshold(), THare_Population_Manager::GetGrowthEfficiencyP(), THare_Population_Manager::GetMaxDailyGrowthEnergyP(), THare::m_Age, THare::m_old_weight, THare::m_OurPopulationManager, THare::m_StarvationDays, THare::m_TodaysEnergy, THare::m_weight, tohs_Dying, tohs_Foraging, and tohs_NextStage.
Referenced by EndStep().
|
protectedvirtual |
Not used.
Unused at present
Reimplemented from THare.
Definition at line 1916 of file Hare_all.cpp.
References tohs_Foraging.
Referenced by Step().
|
protected |
Young foraging.
The amount of time spent on this is dependent upon age. They can take in food up to a proportion of their needs increasing with age. This gives us a little problem because we don't explicitly define their needs. We assume therefore that the milk supply is maximal and that the the time available is all day - but that the max solid food intake possible is defined by age, following the data from Hacklander - this gives no flexibility in the proportion of max food but will cause differential growth w.r.t. milk supply.
Definition at line 1876 of file Hare_all.cpp.
References activity_Foraging, cfg_ForageRestingRatio(), cfg_hare_pesticideresponse_on(), THare::Forage(), THare::ForageP(), g_MaxLeveretGrowthEnergy, g_PropSolidFood, THare_Population_Manager::GetRMR(), THare::GetTotalWeight(), THare::m_ActivityTime, THare::m_Age, THare::m_OurPopulationManager, THare::m_TodaysEnergy, THare::TimeBudget(), and tohs_Resting.
Referenced by Step().
|
protected |
Maturation to Hare_Juvenile.
Young 'matures' to become a Hare_Juvenile.
This creats a Hare_Juvenile object via a call to create objects, then sets the flag for destruction of this object.
Definition at line 1970 of file Hare_all.cpp.
References THare_Population_Manager::CreateObjects(), struct_Hare::HM, struct_Hare::L, THare::m_CurrentHState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_Location_x, TAnimal::m_Location_y, THare::m_MyMum, TAnimal::m_OurLandscape, THare::m_OurPopulationManager, THare::m_weight, Hare_Female::ON_RemoveYoung(), tohs_DestroyObject, struct_Hare::weight, struct_Hare::x, and struct_Hare::y.
Referenced by Step().
|
protected |
Resting.
Just uses some time and energy sitting around. The time used is important because it removes time for foraging.
Definition at line 1926 of file Hare_all.cpp.
References activity_Resting, THare::EnergyBalance(), THare::m_ActivityTime, THare::TimeBudget(), and tohs_Developing.
Referenced by Step().
|
virtual |
Step code for Hare_Young.
Reimplemented from Hare_Infant.
Definition at line 1801 of file Hare_all.cpp.
References THare::m_CurrentHState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, 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().