ALMaSS Hare ODDox  1.1
The hare model description following ODdox protocol
Hare_Male Class Reference

Class for male hares. More...

#include <Hare_all.h>

Public Member Functions

virtual void BeginStep (void)
 BeginStep for Hare_Male. More...
 
virtual void EndStep (void)
 EndStep code for Hare_Male. More...
 
 Hare_Male (int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM, double p_weight, int a_age, int a_Ref)
 Constructor. More...
 
void Init (double p_weight, int a_age, int a_Ref)
 Object initiation. More...
 
virtual void ON_Dead ()
 
void ReInit (struct_Hare a_data)
 Male object reinitiation. More...
 
virtual void Step (void)
 Step for Hare_Male. More...
 
virtual ~Hare_Male ()
 Destructor. More...
 
- Public Member Functions inherited from 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. More...
 
void Init (double p_weight)
 Object initiation. More...
 
void ReInit (struct_Hare a_data)
 Juvenile object reinitiation. More...
 
virtual ~Hare_Juvenile ()
 Destructor for the juvenile hare object. More...
 
- Public Member Functions inherited from THare
int GetAge ()
 
Hare_FemaleGetMum ()
 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...
 
- Public Member Functions inherited from TAnimal
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 ()
 
- Public Member Functions inherited from TALMaSSObject
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

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...
 
virtual void InternalPesticideHandlingAndResponse ()
 Handles internal effects of pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes. More...
 
TTypeOfHareState st_Developing ()
 Male Development. More...
 
TTypeOfHareState st_Foraging ()
 Male Foraging. More...
 
TTypeOfHareState st_ReproBehaviour ()
 Currently Unused. More...
 
TTypeOfHareState st_Resting ()
 Male Resting. More...
 
- Protected Member Functions inherited from Hare_Juvenile
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...
 
- Protected Member Functions inherited from THare
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...
 
int GetPegDirection ()
 Get direction of peg. More...
 
int GetPegDistance ()
 Get peg distance. More...
 
int GetPegPull ()
 Get attractive force of peg. 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...
 
- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 

Additional Inherited Members

- Static Public Attributes inherited from THare
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...
 
- Protected Attributes inherited from THare
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_Femalem_MyMum
 Pointer to the hare's mum. More...
 
double m_old_weight
 State variale - last hare weight. More...
 
THare_Population_Managerm_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...
 
- Protected Attributes inherited from TAnimal
int m_Location_x
 
int m_Location_y
 
Landscapem_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...
 

Detailed Description

Class for male hares.

Definition at line 976 of file Hare_all.h.

Constructor & Destructor Documentation

◆ Hare_Male()

Hare_Male::Hare_Male ( int  p_x,
int  p_y,
Landscape p_L,
THare_Population_Manager p_PPM,
double  p_weight,
int  a_age,
int  a_Ref 
)

Constructor.

Hare_Male constructor.

Definition at line 2668 of file Hare_all.cpp.

2671  : Hare_Juvenile(p_x,p_y,p_L,p_PPM,p_weight)
2672 {
2673  Init(p_weight, a_age, a_Ref);
2674 }

References Init().

◆ ~Hare_Male()

Hare_Male::~Hare_Male ( )
virtual

Destructor.

Hare_Male destructor.

Definition at line 2699 of file Hare_all.cpp.

2700 {
2701  // Nothing to do
2702 }

Member Function Documentation

◆ BeginStep()

void Hare_Male::BeginStep ( void  )
virtual

BeginStep for Hare_Male.

Resets the day's activity counter and checks for default mortalities and potentially extra mortalities. Calculates energy usage for movement based on todays weight.
Also contains optional code designed to test for disease and size related death probabilities - part of the POM exercise
Unlike younger classes this method also tests for reaching the end of physiological lifespan

Reimplemented from Hare_Juvenile.

Definition at line 2715 of file Hare_all.cpp.

2716 {
2717  m_ActivityTime=1440; // Start the day
2721  m_foragingenergy=0;
2722 #ifdef __SIZERELATEDDEATH
2724  if (m_Age>365) {
2726  ON_Dead();
2727  m_StepDone=true; // We need to skip the step code, we are dead
2728  return;
2729  }
2730  }
2731  }
2732 #endif
2733 #ifdef __DISEASEDDMORTALITY
2734  if (m_IamSick) {
2735  ON_Dead();
2736  m_StepDone=true; // We need to skip the step code, we are dead
2737  return;
2738  }
2739 #endif
2740  if (WasPredated()) {
2741  ON_Dead();
2742  m_StepDone=true; // We need to skip the step code, we are dead
2743  return;
2744  }
2745  // Age physiolocally
2746  if (++m_Age > m_Lifespan) {
2747  ON_Dead();
2748  m_StepDone=true; // We need to skip the step code, we are dead
2749  return;
2750  }
2751 #ifdef __DISEASEDDM
2753  if (m_OurLandscape->SupplyDayInYear()==0) {
2756  // Now assume that if there are 100 hares on average that there is 100% chance of getting sick
2758  m_IamSick=true;
2759  }
2760  else m_IamSick=false;
2761  }
2762 #endif
2763  if (g_rand_uni()<cfg_hare_proximity_alert.value()) {
2764  Running(cfg_hare_escape_dist.value());
2765  }
2766 
2767 #ifdef __DISEASEDDM2
2769  if (m_OurLandscape->SupplyDayInYear()==0) {
2772  }
2773 #endif
2774 #ifdef __DISEASEDDM3
2775  m_ddindex++;
2776  if (m_ddindex==365) {
2777  m_ddindex=0;
2778  }
2782  m_lastYearsDensity= int(m_DensitySum * (1.0/365.0));
2783 #endif
2784  // Set the maximum possible energy intake
2786  CheckManagement();
2787 }

References cfg_hare_escape_dist(), cfg_hare_minimum_breeding_weight(), cfg_hare_proximity_alert(), cfg_HareFemaleSicknessDensityDepValue(), cfg_MaxEnergyIntakeScaler(), TAnimal::CheckManagement(), g_rand_uni, THare_Population_Manager::GetKJperM(), THare::GetRMR(), THare_Population_Manager::GetTotalDensity(), THare::m_ActivityTime, THare::m_Age, THare::m_ddindex, THare::m_DensitySum, THare::m_EnergyMax, THare::m_expDensity, THare::m_experiencedDensity, THare::m_foragingenergy, THare::m_IamSick, THare::m_KJForaging, THare::m_KJRunning, THare::m_KJWalking, THare::m_lastYearsDensity, THare::m_Lifespan, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, THare::m_OurPopulationManager, TALMaSSObject::m_StepDone, THare::m_weight, ON_Dead(), THare::Running(), Landscape::SupplyDayInYear(), and Hare_Juvenile::WasPredated().

◆ EndStep()

void Hare_Male::EndStep ( void  )
virtual

EndStep code for Hare_Male.

In EndStep, the home-range centre peg gravitates a little way towards the daily activity area for today.

Reimplemented from Hare_Juvenile.

Definition at line 2859 of file Hare_all.cpp.

2860 {
2864  MovePeg();
2866 }

References cfg_hare_pesticideresponse_on(), InternalPesticideHandlingAndResponse(), and THare::MovePeg().

◆ GeneralEndocrineDisruptor()

void Hare_Male::GeneralEndocrineDisruptor ( double  )
protectedvirtual

Handles internal effects of endocrine distrupter pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes.

Reimplemented from THare.

Definition at line 3090 of file Hare_all.cpp.

3091 {
3092  return;
3093 }

Referenced by InternalPesticideHandlingAndResponse().

◆ GeneralOrganoPhosphate()

void Hare_Male::GeneralOrganoPhosphate ( double  )
protectedvirtual

Handles internal effects of organophosphate pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes.

Reimplemented from THare.

Definition at line 3099 of file Hare_all.cpp.

3100 {
3101  if (g_rand_uni() > l_pest_daily_mort.value()) return;
3103  m_StepDone = true;
3104  return;
3105 }

References g_rand_uni, l_pest_daily_mort, THare::m_CurrentHState, TALMaSSObject::m_StepDone, and tohs_Dying.

Referenced by InternalPesticideHandlingAndResponse().

◆ Init()

void Hare_Male::Init ( double  p_weight,
int  a_age,
int  a_Ref 
)

Object initiation.

Definition at line 2686 of file Hare_all.cpp.

2687 {
2688  m_Type = hob_Male;
2689  m_fatReserve = p_weight*0.04;
2690  m_weight = p_weight;
2691  m_Age=a_age;
2692  m_RefNum=a_Ref;
2693 }

References hob_Male, THare::m_Age, THare::m_fatReserve, THare::m_RefNum, THare::m_Type, and THare::m_weight.

Referenced by Hare_Male(), and ReInit().

◆ InternalPesticideHandlingAndResponse()

void Hare_Male::InternalPesticideHandlingAndResponse ( )
protectedvirtual

Handles internal effects of pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes.

This method is re-implemented ffrom THare for any class which has pesticide response behaviour. If the body burden exceeds the trigger then call pesticide-specific actions by dose

Reimplemented from THare.

Definition at line 3051 of file Hare_all.cpp.

3052 {
3058  double pesticideInternalConc = m_pesticide_burden / m_weight;
3060 
3061  if (pesticideInternalConc > cfg_HarePesticideAccumulationThreshold.value())
3062  {
3063  switch (tp)
3064  {
3065  case ttop_NoPesticide:
3066  break;
3068  GeneralEndocrineDisruptor(pesticideInternalConc); // Calls the EndocrineDisruptor action code
3069  break;
3070  case ttop_AcuteEffects:
3071  GeneralOrganoPhosphate(pesticideInternalConc); // Calls the GeneralOrganophosphate action code
3072  break;
3073  default:
3074  exit(47);
3075  }
3076  }
3077  m_pesticide_burden *= m_pesticidedegradationrate; // Does nothing by default except internal degredation of the pesticide
3078 }

References THare_Population_Manager::BodyBurdenOut(), cfg_HarePesticideAccumulationThreshold(), GeneralEndocrineDisruptor(), GeneralOrganoPhosphate(), TAnimal::m_OurLandscape, THare::m_OurPopulationManager, THare::m_pesticide_burden, THare::m_pesticidedegradationrate, THare::m_weight, Landscape::SupplyDayInYear(), Landscape::SupplyPesticideType(), Landscape::SupplyYearNumber(), ttop_AcuteEffects, ttop_NoPesticide, and ttop_ReproductiveEffects.

Referenced by EndStep().

◆ ON_Dead()

void Hare_Male::ON_Dead ( void  )
virtual

Minimal housekeeping for dying for the male

Reimplemented from Hare_Juvenile.

Definition at line 3044 of file Hare_all.cpp.

3045 {
3047  m_CurrentStateNo=-1;
3048  m_StepDone=true;
3049 }

References THare::m_CurrentHState, TALMaSSObject::m_CurrentStateNo, TALMaSSObject::m_StepDone, and tohs_Dying.

Referenced by BeginStep(), THare_Population_Manager::Hunting(), THare_Population_Manager::HuntingGrid(), and Step().

◆ ReInit()

void Hare_Male::ReInit ( struct_Hare  a_data)

Male object reinitiation.

Definition at line 2675 of file Hare_all.cpp.

2676 {
2677  m_Location_x = a_data.x;
2678  m_Location_y = a_data.y;
2679  m_OurLandscape = a_data.L;
2680  m_CurrentStateNo = 0;
2681  THareInit(a_data.x, a_data.y, a_data.HM);
2682  Init(a_data.weight, a_data.age, a_data.RefNum);
2683 }

References struct_Hare::age, struct_Hare::HM, Init(), struct_Hare::L, TALMaSSObject::m_CurrentStateNo, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, struct_Hare::RefNum, THare::THareInit(), struct_Hare::weight, struct_Hare::x, and struct_Hare::y.

Referenced by THare_Population_Manager::CreateObjects().

◆ st_Developing()

TTypeOfHareState Hare_Male::st_Developing ( )
protected

Male Development.

Definition at line 2946 of file Hare_all.cpp.

2947 {
2948  //Assumes that the fatReserve has been added to by st_Foraging from yesterday
2949  //
2950  // This is the last behaviour state called each day, so we can use this to sort out
2951  // the energetics
2952  //Assumes that the fatReserve has been added to by st_Foraging from yesterday
2953  //
2954 
2955  EnergyBalance(activity_Resting, 1440); // calculates the energy use by BMR
2956  if (m_TodaysEnergy<0) {
2957  m_fatReserve+=(m_TodaysEnergy * (1.0/42.7));
2958  m_TodaysEnergy=0;
2959  }
2960  // Grow
2961  // Solid food absorption is already taken into account by this time
2962  if (m_Age<365) {
2964  if (m_TodaysEnergy<Target) Target=m_TodaysEnergy;
2965  double addedtoday=Target*m_OurPopulationManager->GetGrowthEfficiencyP(m_Age);
2966  m_weight+=addedtoday;
2967  m_TodaysEnergy-=Target;
2969  if (m_TodaysEnergy<Target) Target=m_TodaysEnergy;
2971  m_weight+=addedtoday;
2972  m_TodaysEnergy-=Target;
2973  } else {
2975  if (m_TodaysEnergy<Target) Target=m_TodaysEnergy;
2977  double addedtoday=Target*gf;
2978  m_weight+=addedtoday;
2979  m_TodaysEnergy-=Target;
2980  }
2981  if (m_TodaysEnergy>0) {
2982  // Put what remains back into fat reserve
2983  m_fatReserve+=m_TodaysEnergy*m_OurPopulationManager->GetGrowthEfficiencyF(366); // 366 is the fat conversion efficiency
2984  m_TodaysEnergy=0;
2985  // Cap the fat reserve and store surplus energy for today
2986  if (m_fatReserve>(cfg_AdultMaxFat.value() * m_weight)) {
2988  }
2989  m_StarvationDays=0; // Not starving
2990  return tohs_Foraging;
2991  }
2992  else {
2993  m_fatReserve+=m_TodaysEnergy*m_OurPopulationManager->GetGrowthEfficiencyF(366); // 366 is the fat conversion efficiency
2994  if (m_fatReserve<0) {
2996  m_fatReserve=0.0;
2997  }
2998  else m_TodaysEnergy=0;
2999 // double rmr=m_OurPopulationManager->GetRMR(m_Age, GetTotalWeight());
3000 // if (m_TodaysEnergy<(0.0-(rmr*0.25)))
3001  if (m_TodaysEnergy<0.0)
3002  {
3003  // Oh oh, we are starving need to lose body weight and maybe we will die?
3004 #ifdef __ADULT_WT_STARVE_CHANCE
3005  int testval=0;
3006  if (m_Age<cfg_fixadult_starve.value()) {
3007  // Somewhere between juvenile and adult so use in between values
3008  int diff = cfg_adult_starve.value() - cfg_juv_starve.value();
3009  testval=cfg_adult_starve.value()-(int)((1.0-(cfg_fixadult_starve.value()/(double)m_Age))*diff);
3010 
3011  } else testval=cfg_adult_starve.value();
3013  if (random(10000)> testval) {
3014  return tohs_Dying;
3015  }
3016  }
3017 #else
3019  return tohs_Dying;
3020  }
3021 #endif
3022  }
3023  else {
3024  m_StarvationDays--; // Not starving
3026  m_TodaysEnergy=0;
3027  }
3028  if (random(3)==0) return tohs_Dispersal; // We are hungry, we need to disperse
3029  }
3030  return tohs_Foraging;
3031 }

References activity_Resting, cfg_adult_starvation_threshold(), cfg_adult_starve(), cfg_AdultMaxFat(), cfg_fixadult_starve(), cfg_juv_starve(), THare::EnergyBalance(), 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, tohs_Dispersal, tohs_Dying, and tohs_Foraging.

Referenced by Step().

◆ st_Foraging()

TTypeOfHareState Hare_Male::st_Foraging ( )
protected

Male Foraging.

Foraging code for the Hare_Male.

Foraging time is reduced dependent upon the density of hares in the local area. There are a number of options for calculting this effect used in the POM

Definition at line 2872 of file Hare_all.cpp.

2873 {
2877  double time = (double)m_ActivityTime*cfg_ForageRestingRatio.value();;
2878  // We need to rest if there is no more time
2879  if (time < 30 ) return tohs_Resting;
2880  // If there are more hares here then interference reduces the activity time
2881 #ifdef __DELAYEDDD
2883 #else
2885 #endif
2886 #ifdef __THRESHOLD_AD_DD
2887  if (hares<m_OurPopulationManager->m_HareThresholdDD) hares=0;
2889 #endif
2890  //double interference=(1-(hares*hares)*cfg_HareMaleDensityDepValue.value());
2891  //if (interference<0) interference=0;
2892 #ifdef __DISEASEDDM2
2894 #else
2895 #ifdef __DISEASEDDM3
2897 #else
2898 #ifndef __DDEPMORT
2899  double inter=m_OurPopulationManager->GetInterference(hares);
2900 #else
2901  #ifndef __DISEASEDDM
2902  double inter=m_OurPopulationManager->GetInterference(hares);
2903  #else
2904  double inter=1.0;
2905  #endif
2906 #endif
2907 #endif
2908 #endif
2909  if ((inter<0.5) && (time > 300))
2910  {
2911  if (g_rand_uni() > inter*2) // added to reduce rate of dispersal
2912  {
2913  // m_ActivityTime = (int)(time / cfg_ForageRestingRatio.value()); removed because it is superfluous
2914  return tohs_Dispersal; // Added Sat 15th Dec 2007
2915  }
2916  }
2917  time*=inter;
2918  // Given the time we have then we need to feed, which will return an energy
2919  // Value obtained.
2920  int a_time = (int) time;
2921  if (cfg_hare_pesticideresponse_on.value())
2922  {
2923  m_TodaysEnergy = ForageP(a_time);
2924  }
2925  else
2926  {
2927  m_TodaysEnergy = Forage(a_time);
2928  }
2929  // We need to spend energy on foraging and associated movement - but this is done in ForageSquare()
2930  TimeBudget(activity_Foraging, (int)time-a_time);
2931  // We need to rest
2932  return tohs_Resting;
2933 }

References activity_Foraging, cfg_ForageRestingRatio(), cfg_hare_pesticideresponse_on(), THare::Forage(), THare::ForageP(), g_rand_uni, THare_Population_Manager::GetAdultDensity(), THare_Population_Manager::GetDelayedAdultDensity(), THare_Population_Manager::GetInterference(), THare::m_ActivityTime, THare_Population_Manager::m_HareThresholdDD, THare::m_lastYearsDensity, TAnimal::m_Location_x, TAnimal::m_Location_y, THare::m_OurPopulationManager, THare::m_TodaysEnergy, THare::TimeBudget(), tohs_Dispersal, and tohs_Resting.

Referenced by Step().

◆ st_ReproBehaviour()

TTypeOfHareState Hare_Male::st_ReproBehaviour ( )
protected

Currently Unused.

Definition at line 3034 of file Hare_all.cpp.

3035 {
3036  // TODO - this will need implementing if we have to simulate male reproduction (e.g. for genetic effects) or if we find we need this to alter survival in some way.
3037  return tohs_Resting;
3038 }

References tohs_Resting.

Referenced by Step().

◆ st_Resting()

TTypeOfHareState Hare_Male::st_Resting ( )
protected

Male Resting.

This method uses up the rest of the day in resting

Definition at line 2937 of file Hare_all.cpp.

2938 {
2942  return tohs_Developing;
2943 }

References tohs_Developing.

Referenced by Step().

◆ Step()

void Hare_Male::Step ( void  )
virtual

Step for Hare_Male.

Step controls all the state/transition behaviour for the male hare.
Has some optional code for dispersal related mortality for use in POM testing.

Reimplemented from Hare_Juvenile.

Definition at line 2798 of file Hare_all.cpp.

2799 {
2800  if (m_StepDone || m_CurrentStateNo == -1) return;
2801  switch (m_CurrentHState)
2802  {
2803  case tohs_InitialState: // Initial state
2805  break;
2806  case tohs_Dispersal:
2807  // Legal returns are:
2808  // tohs_MResting
2809  // tohs_MReproBehaviour
2810  // Dispersal is risky therefore take a test again
2811 #ifdef __DISPERSALDDM
2812  if (g_rand_uni()<(cfg_hare_adult_predation.value())) {
2813  ON_Dead();
2814  m_StepDone=true; // We need to skip the step code, we are dead
2815  return;
2816  }
2817 #endif
2819  break;
2820  case tohs_Foraging:
2821  // Legal returns are:
2822  // tohs_MDispersal
2823  // tohs_MResting
2824  // tohs_MReproBehaviour
2826  break;
2827  case tohs_Resting:
2828  // Legal returns are:
2829  // tohs_MDeveloping
2831  break;
2832  case tohs_ReproBehaviour:
2833  // Legal returns are:
2834  // tohs_MResting
2835  // tohs_MDeveloping
2837  break;
2838  case tohs_Developing:
2839  // Legal returns are:
2840  // tohs_Dying
2841  // tohs_MForaging
2843  m_StepDone=true;
2844  break;
2845  case tohs_Dying:
2846  ON_Dead();
2847  m_StepDone=true;
2848  break;
2849  default:
2850  m_OurLandscape->Warn("Hare_Male::Step - unknown state",NULL);
2851  exit(1);
2852  }
2853 }

References cfg_hare_adult_predation(), g_rand_uni, THare::m_CurrentHState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, ON_Dead(), st_Developing(), Hare_Juvenile::st_Dispersal(), st_Foraging(), st_ReproBehaviour(), st_Resting(), tohs_Developing, tohs_Dispersal, tohs_Dying, tohs_Foraging, tohs_InitialState, tohs_ReproBehaviour, tohs_Resting, and Landscape::Warn().


The documentation for this class was generated from the following files:
TTypesOfPesticide
TTypesOfPesticide
Definition: Landscape.h:65
struct_Hare::x
int x
Definition: Hare_all.h:137
ttop_ReproductiveEffects
Definition: Landscape.h:69
cfg_hare_adult_predation
CfgFloat cfg_hare_adult_predation("HARE_ADULT_PREDATION", CFG_CUSTOM, 0.0023)
struct_Hare::y
int y
Definition: Hare_all.h:138
cfg_hare_minimum_breeding_weight
CfgInt cfg_hare_minimum_breeding_weight("HARE_MIN_BREEDING_WT", CFG_CUSTOM, 780)
cfg_hare_escape_dist
CfgInt cfg_hare_escape_dist("HARE_ESCAPE_DIST", CFG_CUSTOM, 100)
ttop_NoPesticide
Definition: Landscape.h:67
THare::m_pesticidedegradationrate
double m_pesticidedegradationrate
State variable used to hold the daily degredation rate of the pesticide in the body.
Definition: Hare_all.h:306
tohs_Foraging
Definition: Hare_all.h:75
cfg_HarePesticideAccumulationThreshold
CfgFloat cfg_HarePesticideAccumulationThreshold("HARE_PESTICIDEACCUMULATIONTHRESHOLD", CFG_CUSTOM, 0.0)
This is the value that triggers pesticide response, which may be a threshold, or if simply set to 0....
tohs_Resting
Definition: Hare_all.h:76
tohs_Developing
Definition: Hare_all.h:73
THare_Population_Manager::GetKJperM
double GetKJperM(int a_size)
Get the cost of moving 1m in KJ dependent upon mass (.
Definition: Hare_all.h:626
THare::m_EnergyMax
double m_EnergyMax
State variable - the amount of energy it is possible to eat as a multiplyer or RMR.
Definition: Hare_all.h:223
struct_Hare::age
int age
Definition: Hare_all.h:139
cfg_hare_proximity_alert
static CfgFloat cfg_hare_proximity_alert("HARE_PROXIMITY_ALERT", CFG_CUSTOM, 0.05)
THare::m_Lifespan
int m_Lifespan
Physiolocal lifespan, assuming nothing else kills the hare (unlikely to reach this age)
Definition: Hare_all.h:198
Hare_Juvenile::WasPredated
virtual bool WasPredated()
Test for mortality.
Definition: Hare_all.cpp:2645
TAnimal::m_OurLandscape
Landscape * m_OurLandscape
Definition: PopulationManager.h:229
Hare_Male::st_Developing
TTypeOfHareState st_Developing()
Male Development.
Definition: Hare_all.cpp:2946
THare::m_ActivityTime
int m_ActivityTime
Minutes of potential activity time per day.
Definition: Hare_all.h:203
cfg_adult_starve
CfgInt cfg_adult_starve("HARE_ADULT_STARVE", CFG_CUSTOM, 5000)
Hare_Male::InternalPesticideHandlingAndResponse
virtual void InternalPesticideHandlingAndResponse()
Handles internal effects of pesticide exposure. If any effects are needed this method must be re-impl...
Definition: Hare_all.cpp:3051
THare::m_OurPopulationManager
THare_Population_Manager * m_OurPopulationManager
Pointer to the hare population manager.
Definition: Hare_all.h:194
struct_Hare::HM
THare_Population_Manager * HM
Definition: Hare_all.h:141
cfg_HareFemaleSicknessDensityDepValue
CfgInt cfg_HareFemaleSicknessDensityDepValue("HARE_FEMALESICKNESSDENDEPVALUE", CFG_CUSTOM, 40)
THare_Population_Manager::GetMaxDailyGrowthEnergyF
double GetMaxDailyGrowthEnergyF(int a_age)
Get the maximum daily energy needed for growth for this a_age for use in fat construction.
Definition: Hare_all.h:578
THare::m_KJForaging
double m_KJForaging
KJ/m cost of foraging per kg hare.
Definition: Hare_all.h:238
THare_Population_Manager::m_HareThresholdDD
int m_HareThresholdDD
Input variable - Threshold density dependence level.
Definition: Hare_all.h:750
THare::GetRMR
double GetRMR()
Get todays RMR.
Definition: Hare_THare.cpp:349
THare::Forage
double Forage(int &time)
Foraging.
Definition: HareForagenPeg.cpp:54
THare::THareInit
void THareInit(int p_x, int p_y, THare_Population_Manager *p_PPM)
Object Initiation.
Definition: Hare_THare.cpp:72
struct_Hare::RefNum
int RefNum
Definition: Hare_all.h:143
Hare_Male::GeneralOrganoPhosphate
virtual void GeneralOrganoPhosphate(double)
Handles internal effects of organophosphate pesticide exposure. If any effects are needed this method...
Definition: Hare_all.cpp:3099
Hare_Male::ON_Dead
virtual void ON_Dead()
Definition: Hare_all.cpp:3044
THare::m_KJWalking
double m_KJWalking
KJ/m cost of walking per kg hare.
Definition: Hare_all.h:233
THare::m_fatReserve
double m_fatReserve
State variable - the energy reserve of the hare.
Definition: Hare_all.h:213
THare::m_lastYearsDensity
int m_lastYearsDensity
State variable used in alternative density-dependent configurations.
Definition: Hare_all.h:276
THare::m_experiencedDensity
int m_experiencedDensity
State variable used in alternative density-dependent configurations.
Definition: Hare_all.h:271
THare::m_KJRunning
double m_KJRunning
KJ/m cost of running per kg hare.
Definition: Hare_all.h:228
activity_Foraging
Definition: Hare_all.h:92
TAnimal::m_Location_y
int m_Location_y
Definition: PopulationManager.h:228
cfg_ForageRestingRatio
CfgFloat cfg_ForageRestingRatio("HARE_FORAGERESTRATIO", CFG_CUSTOM, 0.67)
THare::m_RefNum
int m_RefNum
Unique hare reference number, also functions as sex flag.
Definition: Hare_all.h:265
Hare_Male::st_ReproBehaviour
TTypeOfHareState st_ReproBehaviour()
Currently Unused.
Definition: Hare_all.cpp:3034
struct_Hare::L
Landscape * L
Definition: Hare_all.h:140
cfg_fixadult_starve
CfgInt cfg_fixadult_starve("HARE_FIXADULT_STARVE", CFG_CUSTOM, 360)
Hare_Male::Init
void Init(double p_weight, int a_age, int a_Ref)
Object initiation.
Definition: Hare_all.cpp:2686
THare_Population_Manager::GetMaxDailyGrowthEnergyP
double GetMaxDailyGrowthEnergyP(int a_age)
Get the maximum daily energy needed for growth for this a_age for use in protein construction.
Definition: Hare_all.h:565
THare::MovePeg
void MovePeg()
Move the peg according to attraction forces.
Definition: HareForagenPeg.cpp:527
THare_Population_Manager::GetGrowthEfficiencyF
double GetGrowthEfficiencyF(int a_age)
Get the growth efficiency for this a_age for creating fat.
Definition: Hare_all.h:614
hob_Male
Definition: Hare_all.h:60
THare::m_ddindex
int m_ddindex
State variable used in alternative density-dependent configurations.
Definition: Hare_all.h:281
THare::m_TodaysEnergy
double m_TodaysEnergy
State variable - the amount of energy available today, can be in deficit.
Definition: Hare_all.h:218
Landscape::SupplyDayInYear
int SupplyDayInYear(void)
Definition: Landscape.h:1596
TALMaSSObject::m_StepDone
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
Definition: PopulationManager.h:118
Landscape::SupplyPesticideType
TTypesOfPesticide SupplyPesticideType(void)
Definition: Landscape.h:433
tohs_Dying
Definition: Hare_all.h:79
THare::EnergyBalance
void EnergyBalance(TTypeOfActivity a_activity, int dist)
Adjust energy balance for an activity.
Definition: Hare_THare.cpp:277
Landscape::SupplyYearNumber
int SupplyYearNumber(void)
Definition: Landscape.h:1616
THare::m_foragingenergy
double m_foragingenergy
Energy obtained from foraging/feeding.
Definition: Hare_all.h:252
Hare_Male::st_Resting
TTypeOfHareState st_Resting()
Male Resting.
Definition: Hare_all.cpp:2937
tohs_InitialState
Definition: Hare_all.h:71
cfg_MaxEnergyIntakeScaler
static CfgFloat cfg_MaxEnergyIntakeScaler("HARE_MAXENERGYINTAKESCALER", CFG_CUSTOM, 3.0)
tohs_ReproBehaviour
Definition: Hare_all.h:77
Hare_Juvenile::st_Dispersal
TTypeOfHareState st_Dispersal()
Juvenile Dispersal.
Definition: Hare_all.cpp:2449
THare_Population_Manager::GetAdultDensity
int GetAdultDensity(int x, int y)
Density function - returns the density of adults in the square containing by x,y. Each square is 256x...
Definition: Hare_all.h:681
cfg_adult_starvation_threshold
static CfgInt cfg_adult_starvation_threshold("HARE_ADULT_STARVE_THRESHOLD", CFG_CUSTOM, 16)
THare::m_expDensity
int m_expDensity[365]
State variable used in alternative density-dependent configurations.
Definition: Hare_all.h:286
THare::m_DensitySum
int m_DensitySum
State variable used in alternative density-dependent configurations.
Definition: Hare_all.h:291
THare::m_pesticide_burden
double m_pesticide_burden
State variable used to hold the current body-burden of pesticide.
Definition: Hare_all.h:301
THare::m_Age
int m_Age
State variale - hare age.
Definition: Hare_all.h:170
THare::ForageP
double ForageP(int &time)
Foraging but also incorporating pesticide exposure.
Definition: HareForagenPeg.cpp:181
THare::m_CurrentHState
TTypeOfHareState m_CurrentHState
Defines the current activity.
Definition: Hare_all.h:165
THare::m_IamSick
bool m_IamSick
flag for sickness - used in conjunction with disease configurations
Definition: Hare_all.h:295
THare_Population_Manager::GetInterference
double GetInterference(int h)
Return the proportion of time used in communicating with con-specifics.
Definition: Hare_all.h:700
THare::m_StarvationDays
int m_StarvationDays
State variable - the number of consecutive days in negative energy balance.
Definition: Hare_all.h:208
TAnimal::CheckManagement
void CheckManagement(void)
Definition: PopulationManager.cpp:1404
THare::Running
virtual void Running(int a_max_dist)
Run.
Definition: Hare_THare.cpp:152
l_pest_daily_mort
CfgFloat l_pest_daily_mort
THare::m_weight
double m_weight
State variale - hare weight g.
Definition: Hare_all.h:180
cfg_hare_pesticideresponse_on
CfgBool cfg_hare_pesticideresponse_on("HARE_PESTICIDERESPONSE_ON", CFG_CUSTOM, false)
If set to true then hares will collect and respond to pesticide information. This will slow the simul...
THare_Population_Manager::GetGrowthEfficiencyP
double GetGrowthEfficiencyP(int a_age)
Get the growth efficiency for this a_age for creating protein.
Definition: Hare_all.h:602
THare::m_Type
Hare_Object m_Type
State variale - the type of hare.
Definition: Hare_all.h:175
g_rand_uni
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
ttop_AcuteEffects
Definition: Landscape.h:68
tohs_Dispersal
Definition: Hare_all.h:74
TALMaSSObject::m_CurrentStateNo
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:116
Hare_Male::st_Foraging
TTypeOfHareState st_Foraging()
Male Foraging.
Definition: Hare_all.cpp:2872
cfg_AdultMaxFat
static CfgFloat cfg_AdultMaxFat("HARE_ADULT_MAXFAT", CFG_CUSTOM, 0.04/(0.33 *0.88))
struct_Hare::weight
double weight
Definition: Hare_all.h:144
Hare_Juvenile::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: Hare_all.cpp:2219
THare::TimeBudget
void TimeBudget(TTypeOfActivity a_activity, int dist)
Adjust time budger for an activity.
Definition: Hare_THare.cpp:314
Landscape::Warn
void Warn(std::string a_msg1, std::string a_msg2)
Definition: Landscape.h:1579
THare_Population_Manager::GetTotalDensity
int GetTotalDensity(int x, int y)
Density function - returns the density of all hares in the square containing by x,...
Definition: Hare_all.h:676
TAnimal::m_Location_x
int m_Location_x
Definition: PopulationManager.h:225
Hare_Male::GeneralEndocrineDisruptor
virtual void GeneralEndocrineDisruptor(double)
Handles internal effects of endocrine distrupter pesticide exposure. If any effects are needed this m...
Definition: Hare_all.cpp:3090
THare_Population_Manager::BodyBurdenOut
void BodyBurdenOut(int a_year, int a_day, double a_bb, double a_mgkg)
BodyBurden output.
Definition: Hare_all.h:723
THare_Population_Manager::GetDelayedAdultDensity
int GetDelayedAdultDensity(int x, int y)
Density function - returns the density of adults in the square containing by x,y, but for last year a...
Definition: Hare_all.h:689
activity_Resting
Definition: Hare_all.h:90
cfg_juv_starve
CfgInt cfg_juv_starve("HARE_JUV_STARVE", CFG_CUSTOM, 2500)