File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/extensions/ams.js
ALMaSS  1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Hare_Young Class Reference

Class for young hares (low mobility, milk and solid food inputs) More...

#include <Hare_All.h>

Inheritance diagram for Hare_Young:
Hare_Infant THare TAnimal TALMaSSObject

Public Member Functions

void BeginStep (void) override
 BeginStep for Hare_Young. More...
 
void Step (void) override
 Step code for Hare_Young. More...
 
void EndStep (void) override
 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 ReInit (struct_Hare a_data)
 Young object reinitiation. More...
 
void Init (double p_weight)
 Object initiation. More...
 
 ~Hare_Young () override
 Destructor for Hare_Young. More...
 
void ON_Dead () override
 This hare has been killed. More...
 
- Public Member Functions inherited from Hare_Infant
 Hare_Infant (int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM)
 Hare infant constructor. More...
 
void ReInit (struct_Hare a_data)
 Infant object reinitiation. More...
 
void Init ()
 Object initiation. More...
 
 ~Hare_Infant () override
 Hare infant destructor. More...
 
void ON_BeingFed (double a_someMilk)
 Get energy from milk given. More...
 
void SetWeight (double w)
 Set the weight. More...
 
void SetMum (Hare_Female *a_af)
 Set the mother pointer. More...
 
- Public Member Functions inherited from THare
 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...
 
 ~THare () override
 Destructor. More...
 
double GetWeight ()
 
double GetTotalWeight ()
 Provide the wet weight of the hare. More...
 
int GetAge ()
 Provide the age of the hare. More...
 
void ON_MumDead (Hare_Female *a_Mum)
 Inform Mum that we are dead. More...
 
Hare_FemaleGetMum ()
 Get the mother pointer. More...
 
double GetRMR ()
 Get todays RMR. More...
 
virtual bool WasPredated ()
 Test for predation. More...
 
int GetRefNum ()
 Get the refnum for this hare. More...
 
void loadVegPalatability (void)
 Loads static member m_vegPalatability with data. More...
 
- Public Member Functions inherited from TAnimal
 TAnimal (int x, int y, Landscape *L)
 The TAnimal constructor saving the x,y, location and the landscape pointer. More...
 
 TAnimal (int x, int y)
 The TAnimal constructor saving the x,y used if landscape is already set. More...
 
void SetGuardMapIndex (int a_index_x, int a_index_y)
 Set the guard map index, this is used to avoid two animals operating in the same location when using multithread. More...
 
unsigned SupplyFarmOwnerRef () const
 Get the current location farm ref if any. More...
 
AnimalPosition SupplyPosition () const
 Returns the objects location and habitat type and veg type. More...
 
APoint SupplyPoint () const
 Returns the objects location in ALMaSS coordinates. More...
 
int SupplyPolygonRef () const
 Returns the polygon reference where the object is located. More...
 
TTypesOfLandscapeElement SupplyPolygonType () const
 Returns the polygon type where the object is located. More...
 
int Supply_m_Location_x () const
 Returns the ALMaSS x-coordinate. More...
 
int Supply_m_Location_y () const
 Returns the ALMaSS y-coordinate. More...
 
int SupplyGuardCellX () const
 Returns the x-index to the guard cell. More...
 
int SupplyGuardCellY () const
 Returns the y-index to the guard cell. More...
 
int SupplyAge () const
 Returns the animals age in days. More...
 
void SetAge (int a_age)
 Sets the animals age in days. More...
 
virtual void KillThis ()
 Sets all parameters ready for object destruction. More...
 
virtual void CopyMyself ()
 Used to copy the object details to another in descendent classes. More...
 
void SetX (const int a_x)
 Sets the x-coordinate. More...
 
void SetY (const int a_y)
 Sets the y-coordinate. More...
 
virtual void ReinitialiseObject (int a_x, int a_y, Landscape *a_l_ptr)
 
virtual void ReinitialiseObject (int a_x, int a_y)
 Used to re-use an object - must be implemented in descendent classes. More...
 
virtual int WhatState ()
 Returns the objects current state number. More...
 
virtual void Dying ()
 A wrapped for KillThis - ideally should not be used. More...
 
void CheckManagement ()
 Used to start a check for any management related effects at the objects current location. More...
 
void CheckManagementXY (int a_x, int a_y)
 Used to start a check for any management related effects at x,y. More...
 
- Public Member Functions inherited from TALMaSSObject
int GetCurrentStateNo () const
 Returns the current state number. More...
 
void SetCurrentStateNo (int a_num)
 Sets the current state number. More...
 
bool GetStepDone () const
 Returns the step done indicator flag. More...
 
void SetStepDone (bool a_bool)
 Sets the step done indicator flag. More...
 
void ReinitialiseObjectBase ()
 Used to initialise an object. More...
 
 TALMaSSObject ()
 The constructor for TALMaSSObject. More...
 
virtual ~TALMaSSObject ()=default
 The destructor for TALMaSSObject. More...
 

Protected Member Functions

TTypeOfHareState st_Developing ()
 Developmental code for the young hare. More...
 
TTypeOfHareState st_Dispersal () override
 Not used. More...
 
TTypeOfHareState st_Foraging ()
 Young foraging. More...
 
void st_NextStage ()
 Maturation to Hare_Juvenile. More...
 
TTypeOfHareState st_Resting ()
 Resting. More...
 
bool OnFarmEvent (FarmToDo event) override
 Response to farm actions. More...
 
- Protected Member Functions inherited from Hare_Infant
TTypeOfHareState st_Developing ()
 Developmental behaviour for the infant hare. More...
 
void st_NextStage ()
 'mature' to become a young More...
 
- Protected Member Functions inherited from THare
bool Run (int a_dist, int a_direction)
 Run a distance in a direction. More...
 
void EnergyBalance (TTypeOfActivity a_activity, int dist)
 Adjust energy balance for an activity. More...
 
void TimeBudget (TTypeOfActivity a_activity, int dist)
 Adjust time budger for an activity. More...
 
void st_Dying ()
 Tidy up before removing the object on death. More...
 
virtual void Running (int a_max_dist)
 Run. More...
 
void Walking (int a_dist, int a_direction)
 Walking. More...
 
double Forage (int &time)
 Foraging. More...
 
double ForageP (int &time)
 Foraging but also incorporating pesticide exposure. 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...
 
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...
 
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 GetPegDistance ()
 Get peg distance. More...
 
int GetPegPull ()
 Get attractive force of peg. More...
 
int GetPegDirection ()
 Get direction of peg. More...
 
void MovePeg ()
 Move the peg according to attraction forces. More...
 
- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from THare
static void SetMum (Hare_Female *)
 Set the mother pointer. Reimplemented in Hare_Infant. More...
 
- Static Public Member Functions inherited from TAnimal
static void SetSimulationWidth (int a_value)
 Sets the simulation width. More...
 
static void SetSimulationHeight (int a_value)
 Sets the simulation height. More...
 
static void SetDayInYear (int a_value)
 Sets the day in year attribute. More...
 
static void SetOurLandscape (Landscape *a_value)
 Sets the landscape pointer. More...
 
static void SetTempToday (double a_value)
 Sets the temperature today attribute. More...
 
- Static Public Member Functions inherited from TALMaSSObject
static void OnArrayBoundsError ()
 Used for debugging only, tests basic object properties. More...
 
- Static Public Attributes inherited from THare
static double * m_vegPalatability = nullptr
 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
TTypeOfHareState m_CurrentHState
 Defines the current activity. More...
 
int m_Age = 0
 State variale - hare age. More...
 
Hare_Object m_Type
 State variale - the type of hare. More...
 
double m_weight = 0.0
 State variale - hare weight g. More...
 
double m_old_weight = 0.0
 State variale - last hare weight. More...
 
Hare_Femalem_MyMum = nullptr
 Pointer to the hare's mum. More...
 
THare_Population_Managerm_OurPopulationManager
 Pointer to the hare population manager. More...
 
int m_Lifespan = 0
 Physiolocal lifespan, assuming nothing else kills the hare (unlikely to reach this age) More...
 
int m_ActivityTime = 0
 Minutes of potential activity time per day. More...
 
int m_StarvationDays = 0
 State variable - the number of consecutive days in negative energy balance. More...
 
double m_fatReserve = 0.0
 State variable - the energy reserve of the hare. More...
 
double m_TodaysEnergy = 0.0
 State variable - the amount of energy available today, can be in deficit. More...
 
double m_EnergyMax = 0.0
 State variable - the amount of energy it is possible to eat as a multiplyer or RMR. More...
 
double m_KJRunning = 0.0
 KJ/m cost of running per kg hare. More...
 
double m_KJWalking = 0.0
 KJ/m cost of walking per kg hare. More...
 
double m_KJForaging = 0.0
 KJ/m cost of foraging per kg hare. More...
 
double m_SpeedRunning = 0.0
 m/min speed of running per kg hare More...
 
double m_SpeedWalking = 0.0
 m/min speed of walking per kg hare More...
 
double m_foragingenergy = 0.0
 Energy obtained from foraging/feeding. More...
 
int m_peg_x = 0
 peg x-coordinate More...
 
int m_peg_y = 0
 peg y-coordinate More...
 
int m_RefNum = 0
 Unique hare reference number, also functions as sex flag. More...
 
int m_experiencedDensity = 0
 State variable used in alternative density-dependent configurations. More...
 
int m_lastYearsDensity = 0
 State variable used in alternative density-dependent configurations. More...
 
int m_ddindex = 0
 State variable used in alternative density-dependent configurations. More...
 
int m_expDensity [365] = {}
 State variable used in alternative density-dependent configurations. More...
 
int m_DensitySum = 0
 State variable used in alternative density-dependent configurations. More...
 
bool m_IamSick = false
 flag for sickness - used in conjunction with disease configurations More...
 
double m_pesticide_burden = 0.0
 State variable used to hold the current body-burden of pesticide. More...
 
double m_pesticidedegradationrate = 0.0
 State variable used to hold the daily degredation rate of the pesticide in the body. More...
 
bool m_pesticideInfluenced1 = false
 Flag to indicate pesticide effects (e.g. can be used for endocrine distruptors with delayed effects until birth). More...
 
- Protected Attributes inherited from TAnimal
int m_Location_x
 The objects ALMaSS x coordinate. More...
 
int m_Location_y
 The objects ALMaSS y coordinate. More...
 
int m_guard_cell_x
 The index x to the guard cell. More...
 
int m_guard_cell_y
 The index y to the guard cell. More...
 
int m_AgeDays {0}
 To hold the age in days. More...
 
PesticideToxicity m_my_pesticide
 
- 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...
 
- Static Protected Attributes inherited from TAnimal
static Landscapem_OurLandscape = nullptr
 A pointer to the landscape object shared with all TAnimal objects. More...
 
static int m_SimulationWidth = 0
 A static member for the simulation width because it is often used by descendent classes. More...
 
static int m_SimulationHeight = 0
 A static member for the simulation height because it is often used by descendent classes. More...
 
static double m_TemperatureToday = 0.0
 A holder for the temperature today shared with all TAnimal objects. More...
 
static int m_DayInYear = 0
 A holder for the day in year shared with all TAnimal objects. More...
 

Detailed Description

Class for young hares (low mobility, milk and solid food inputs)

Constructor & Destructor Documentation

◆ Hare_Young()

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.

1557  : Hare_Infant(p_x, p_y, p_L, p_PPM) { Init(p_weight); }

References Hare_Infant::Init().

◆ ~Hare_Young()

Hare_Young::~Hare_Young ( )
override

Destructor for Hare_Young.

1578  {
1579  //Nothing to do
1580 }

Member Function Documentation

◆ BeginStep()

void Hare_Young::BeginStep ( void  )
overridevirtual

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.

1587  {
1588  if (m_CurrentStateNo == -1) return;
1590  st_NextStage();
1591  return;
1592  }
1594  // These are all the same value - this may change to so I have kept all three
1595  // for now ver 00005
1596  m_KJWalking = m_OurPopulationManager->GetKJperM(static_cast<int>(floor(0.5 + m_weight)));
1597  m_KJRunning = m_KJWalking * 2;
1603  m_ActivityTime = 1440; // Start the day
1604 #ifdef __DDEPMORT
1606 #ifdef __THRESHOLD_DD
1607  if (dens<m_OurPopulationManager->m_HareThresholdDD) dens=0;
1609 #endif
1610  double inter=m_OurPopulationManager->GetInterference(dens);
1611  if (g_rand_uni() > inter) {
1612  ON_Dead();
1613  m_StepDone=true; // We need to skip the step code, we are dead
1614  return;
1615  }
1616 #endif
1618  {
1619  ON_Dead();
1620  m_StepDone = true; // We need to skip the step code, we are dead
1621  return;
1622  }
1623  // Set the maximum possible energy intake
1625  // Move the hares about if they get scared by a random proximity event
1627  CheckManagement();
1628 }

References cfg_hare_escape_dist, cfg_hare_proximity_alert, cfg_MaxEnergyIntakeScaler, TAnimal::CheckManagement(), g_rand_uni_fnc(), THare_Population_Manager::GetInterference(), THare_Population_Manager::GetKJperM(), THare::GetRMR(), THare_Population_Manager::GetTotalDensity(), THare::m_ActivityTime, THare::m_CurrentHState, 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(), THare::Running(), st_NextStage(), tohs_NextStage, CfgInt::value(), and CfgFloat::value().

◆ EndStep()

void Hare_Young::EndStep ( void  )
overridevirtual

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.

1684  {
1687  {
1688  // Legal returns are:
1689  // tohs_Developing
1690  // tohs_NextStage
1691  // tohs_Dying
1693  }
1694  if (m_CurrentHState == tohs_Dying) { ON_Dead(); }
1695  else MovePeg();
1696 }

References cfg_hare_pesticideresponse_on, THare::InternalPesticideHandlingAndResponse(), THare::m_CurrentHState, THare::MovePeg(), ON_Dead(), st_Developing(), tohs_Developing, tohs_Dying, and CfgBool::value().

◆ Init()

void Hare_Young::Init ( double  p_weight)

Object initiation.

1568  {
1569  m_Type = hob_Young;
1570  m_weight = p_weight;
1571  m_Age = 11; // By definition we are 11 days old today
1572 }

References hob_Young, THare::m_Age, THare::m_Type, and THare::m_weight.

◆ ON_Dead()

void Hare_Young::ON_Dead ( void  )
overridevirtual

This hare has been killed.

Housekeeping for removal of the object, lets Mum know if there is a Mum

Reimplemented from Hare_Infant.

1962 { st_Dying(); }

References THare::st_Dying().

Referenced by BeginStep(), EndStep(), and OnFarmEvent().

◆ OnFarmEvent()

bool Hare_Young::OnFarmEvent ( FarmToDo  event)
overrideprotectedvirtual

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.

1817  {
1818  bool result = false;
1819  switch (event)
1820  {
1821  case sleep_all_day:
1822  break;
1823 // Here begins cutting and soil cultivation mortality
1824  case autumn_harrow:
1826  case autumn_plough:
1827  case autumn_roll:
1828  case autumn_sow:
1829  case autumn_sow_with_ferti:
1830  case bed_forming:
1831  case bulb_harvest:
1832  case burn_straw_stubble:
1833  case burn_top: /*\todo is this alright? */
1834  case cut_to_hay:
1835  case cut_to_silage:
1836  case cut_weeds:
1837  case deep_ploughing:
1838  case flammebehandling: /*\todo is this alright? */
1839  case flower_cutting:
1840  case green_harvest: /*\todo is this alright? */
1841  case harvest:
1842  case harvest_bushfruit: /*\todo is this alright? */
1843  case harvestshoots: /*\todo is this alright? */
1844  case hay_bailing:
1845  case hay_turning:
1847  case hilling_up: /*\todo is this alright? */
1848  case mow:
1849  case preseeding_cultivator:
1851  case row_cultivation: /*\todo is this alright? */
1852  case shallow_harrow:
1853  case shredding:
1854  case spring_harrow:
1855  case spring_plough:
1856  case spring_roll:
1857  case spring_sow:
1858  case spring_sow_with_ferti:
1859  case straw_chopping:
1860  case strigling:
1861  case strigling_hill:
1862  case strigling_sow:
1864  case stubble_harrowing:
1865  case stubble_plough:
1866  case summer_harrow:
1867  case summer_plough:
1868  case summer_sow:
1869  case swathing:
1870  case winter_harrow:
1871  case winter_plough:
1872  case fa_sludge:
1873  case fa_slurry:
1874  case fiber_covering:
1875  case fiber_removal:
1876  case straw_covering:
1877  case straw_removal:
1878  case fa_greenmanure:
1879  case fp_greenmanure:
1880  if (g_random_fnc(100) < cfg_hare_y_cut.value()) result = true;
1881  break;
1882 // Here begins grazing mortality
1883  case pigs_out:
1884  result = true;
1885  break;
1886  // Here begin low-mortality events
1887  case biocide:
1888  case fa_ammoniumsulphate:
1889  case fa_boron:
1890  case fa_calcium:
1891  case fa_cu:
1892  case fa_k:
1893  case fa_manganesesulphate:
1894  case fa_manure:
1895  case fa_n:
1896  case fa_nk:
1897  case fa_npk:
1898  case fa_npks:
1899  case fa_p:
1900  case fa_pk:
1901  case fa_pks:
1902  case fa_rsm:
1903  case fa_sk:
1904  case fp_ammoniumsulphate:
1905  case fp_boron:
1906  case fp_calcium:
1907  case fp_cu:
1908  case fp_k:
1909  case fp_liquidNH3:
1910  case fp_manganesesulphate:
1911  case fp_manure:
1912  case fp_n:
1913  case fp_nc:
1914  case fp_nk:
1915  case fp_npk:
1916  case fp_npks:
1917  case fp_ns:
1918  case fp_p:
1919  case fp_pk:
1920  case fp_pks:
1921  case fp_rsm:
1922  case fp_sk:
1923  case fp_sludge:
1924  case fp_slurry:
1925  case fungicide_treat:
1926  case glyphosate:
1927  case growth_regulator:
1928  case herbicide_treat:
1929  case insecticide_treat:
1930  case last_treatment:
1931  case manual_weeding:
1932  case molluscicide:
1933  case org_fungicide:
1934  case org_herbicide:
1935  case org_insecticide:
1936  case pheromone:
1937  case product_treat:
1938  case pruning:
1939  case suckering:
1940  case syninsecticide_treat:
1941  case trial_control:
1943  case trial_toxiccontrol:
1944  case water:
1945  case cattle_out:
1946  case cattle_out_low:
1947  // Here we need to give them a low mortality chance
1948  if (g_random_fnc(100) < cfg_hare_y_tractor.value()) result = true;
1949  break;
1950  default:
1951  m_OurLandscape->Warn("Hare_Young::OnFarmEvent(): Unknown event type:",
1953  exit(1);
1954  }
1955  if (result) { ON_Dead(); }
1956  return result;
1957 }

References autumn_harrow, autumn_or_spring_plough, autumn_plough, autumn_roll, autumn_sow, autumn_sow_with_ferti, bed_forming, biocide, bulb_harvest, burn_straw_stubble, burn_top, cattle_out, cattle_out_low, cfg_hare_y_cut, cfg_hare_y_tractor, cut_to_hay, cut_to_silage, cut_weeds, deep_ploughing, Landscape::EventtypeToString(), fa_ammoniumsulphate, fa_boron, fa_calcium, fa_cu, fa_greenmanure, fa_k, fa_manganesesulphate, fa_manure, fa_n, fa_nk, fa_npk, fa_npks, fa_p, fa_pk, fa_pks, fa_rsm, fa_sk, fa_sludge, fa_slurry, fiber_covering, fiber_removal, flammebehandling, flower_cutting, fp_ammoniumsulphate, fp_boron, fp_calcium, fp_cu, fp_greenmanure, fp_k, fp_liquidNH3, fp_manganesesulphate, fp_manure, fp_n, fp_nc, fp_nk, fp_npk, fp_npks, fp_ns, fp_p, fp_pk, fp_pks, fp_rsm, fp_sk, fp_sludge, fp_slurry, fungicide_treat, g_random_fnc(), glyphosate, green_harvest, growth_regulator, harvest, harvest_bushfruit, harvestshoots, hay_bailing, hay_turning, heavy_cultivator_aggregate, herbicide_treat, hilling_up, insecticide_treat, last_treatment, TAnimal::m_OurLandscape, manual_weeding, molluscicide, mow, ON_Dead(), org_fungicide, org_herbicide, org_insecticide, pheromone, pigs_out, preseeding_cultivator, preseeding_cultivator_sow, product_treat, pruning, row_cultivation, shallow_harrow, shredding, 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, suckering, summer_harrow, summer_plough, summer_sow, swathing, syninsecticide_treat, trial_control, trial_insecticidetreat, trial_toxiccontrol, CfgInt::value(), Landscape::Warn(), water, winter_harrow, and winter_plough.

◆ ReInit()

void Hare_Young::ReInit ( struct_Hare  a_data)

Young object reinitiation.

1558  {
1559  m_Location_x = a_data.x;
1560  m_Location_y = a_data.y;
1561  m_OurLandscape = a_data.L;
1562  m_CurrentStateNo = 0;
1563  THareInit(a_data.x, a_data.y, a_data.HM);
1564  Init(a_data.weight);
1565 }

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.

◆ st_Developing()

TTypeOfHareState Hare_Young::st_Developing ( )
protected

Developmental code for the young hare.

1761  {
1762  // This code must be called by the EndStep
1763  // NB foraged food and milk are in the same energetic currency
1765  if (m_TodaysEnergy > me) m_TodaysEnergy = me;
1767  m_weight += growth;
1768  // We need to know whether the growth rate is positive or negative
1769  //#ifndef __MINGROWTHATTAIN
1771  else m_StarvationDays = 0;
1773  //#endif
1774  // Make sure m_TodaysEnergy is zero;
1775  m_TodaysEnergy = 0;
1776 #ifdef __MINGROWTHATTAIN
1777  // Take a check on our growth - if we are below 90% of the min repro weight, assume we died
1778  //if (m_weight < (cfg_hare_minimum_breeding_weight.value()*cfg_min_growth_attain.value())) return tohs_Dying;
1779  if (m_weight < m_OurPopulationManager->m_DMWeight[m_Age]) return tohs_Dying;
1780 #endif
1781  if (++m_Age > 34) { return tohs_NextStage; }
1782  return tohs_Foraging;
1783 }

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, tohs_NextStage, and CfgInt::value().

Referenced by EndStep().

◆ st_Dispersal()

TTypeOfHareState Hare_Young::st_Dispersal ( void  )
overrideprotectedvirtual

Not used.

Unused at present

Reimplemented from THare.

1741  {
1742  // This behavioural state is not used at present
1743  return tohs_Foraging;
1744 }

References tohs_Foraging.

Referenced by Step().

◆ st_Foraging()

TTypeOfHareState Hare_Young::st_Foraging ( )
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.

1708  {
1709  double time = m_ActivityTime;
1711  // We need to rest if there is no more time
1712  if (time < 30) return tohs_Resting;
1713  //time+=m_TimePerForageSquare;
1714  // time now has the time to use foraging
1715  // Given the time we have then we need to feed, which will return an energy
1716  // Value obtained.
1717  // m_TodaysEnergy is zero on entry, except in the case where the young were
1718  // created today. So we can't use m_TodaysEnergy directly
1719  int a_time = static_cast<int>(time);
1720  double ForageEnergy;
1721  if (cfg_hare_pesticideresponse_on.value()) { ForageEnergy = ForageP(a_time); }
1722  else { ForageEnergy = Forage(a_time); }
1723  // We need to spend energy on foraging and associated movement
1724  //
1725  TimeBudget(activity_Foraging, static_cast<int>(time) - a_time);
1726  //
1729  // If we got too much then cap it
1730  if (ForageEnergy > Target) ForageEnergy = Target;
1731 #ifdef __NOSTARVE
1732  ForageEnergy=Target;
1733 #endif
1734  m_TodaysEnergy += ForageEnergy; // pre-calculated in the ForageEnergy // *cfg_solidAsbsorption.value();
1735  return tohs_Resting;
1736 }

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(), tohs_Resting, CfgFloat::value(), and CfgBool::value().

Referenced by Step().

◆ st_NextStage()

void Hare_Young::st_NextStage ( )
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.

1789  {
1794  auto sp = new struct_Hare;
1795  sp->HM = m_OurPopulationManager;
1796  sp->L = m_OurLandscape;
1797  sp->x = m_Location_x;
1798  sp->y = m_Location_y;
1799  sp->weight = m_weight;
1800  // Mum no longer cares about the young, it is too old
1801  // Removal of the young from Mum's list
1802  if (m_MyMum != nullptr) m_MyMum->ON_RemoveYoung(this);
1803  // If m_MyMum is NULL then it means that she deserted the young but they survived anyway
1804  m_MyMum = nullptr;
1805  m_OurPopulationManager->CreateObjects(2, this, nullptr, sp, 1);
1806  // Clean-up
1808  m_StepDone = true;
1809  m_CurrentStateNo = -1;
1810  delete sp;
1811 }

References THare_Population_Manager::CreateObjects(), struct_Hare::HM, THare::m_CurrentHState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_Location_x, TAnimal::m_Location_y, THare::m_MyMum, TAnimal::m_OurLandscape, THare::m_OurPopulationManager, TALMaSSObject::m_StepDone, THare::m_weight, Hare_Female::ON_RemoveYoung(), and tohs_DestroyObject.

Referenced by BeginStep().

◆ st_Resting()

TTypeOfHareState Hare_Young::st_Resting ( )
protected

Resting.

Just uses some time and energy sitting around. The time used is important because it removes time for foraging.

1750  {
1751  // TODO Need to find a position - use some energy walking too?
1752  EnergyBalance(activity_Resting, 0); // Just removes a days BMR
1754  return tohs_Developing;
1755 }

References activity_Resting, THare::EnergyBalance(), THare::m_ActivityTime, THare::TimeBudget(), and tohs_Developing.

Referenced by Step().

◆ Step()

void Hare_Young::Step ( void  )
overridevirtual

Step code for Hare_Young.

Reimplemented from Hare_Infant.

1635  {
1636  if (m_StepDone || m_CurrentStateNo == -1) return;
1637  switch (m_CurrentHState)
1638  {
1639  case tohs_InitialState: // Initial state
1641  break;
1642  case tohs_Dispersal:
1643  // Legal returns are:
1644  // tohs_YResting
1645  // tohs_YForaging
1647  break;
1648  case tohs_Foraging:
1649  // Legal returns are:
1650  // tohs_YResting
1652  break;
1653  case tohs_Resting:
1654  // Legal returns are:
1655  // tohs_YDeveloping
1657  break;
1658  case tohs_Developing:
1659  m_StepDone = true;
1660  break;
1661  //case tohs_NextStage:
1662  // Legal returns are:
1663  // NONE
1664  //st_NextStage();
1665  //m_StepDone = true;
1666  //break;
1667  case tohs_Dying:
1668  m_StepDone = true;
1669  break;
1670  default:
1671  m_OurLandscape->Warn("Hare_Young::Step - unknown state", nullptr);
1672  exit(1);
1673  }
1674 }

References THare::m_CurrentHState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, st_Dispersal(), st_Foraging(), st_Resting(), tohs_Developing, tohs_Dispersal, tohs_Dying, tohs_Foraging, tohs_InitialState, tohs_Resting, and Landscape::Warn().


The documentation for this class was generated from the following files:
Hare_Young::ON_Dead
void ON_Dead() override
This hare has been killed.
Definition: Hare_All.cpp:1962
tohs_Dying
Definition: Hare_All.h:80
struct_Hare::x
int x
Definition: Hare_All.h:138
fiber_removal
Definition: Treatment.h:129
fp_rsm
Definition: Treatment.h:64
org_insecticide
Definition: Treatment.h:84
THare_Population_Manager::CreateObjects
void CreateObjects(int ob_type, TAnimal *pvo, void *null, struct_Hare *data, int number)
Method used to create new hares.
Definition: Hare_All.cpp:873
fa_sk
Definition: Treatment.h:71
row_cultivation
Definition: Treatment.h:88
fa_pk
Definition: Treatment.h:68
winter_harrow
Definition: Treatment.h:144
fp_npk
Definition: Treatment.h:52
strigling
Definition: Treatment.h:89
g_rand_uni_fnc
double g_rand_uni_fnc()
Definition: ALMaSS_Random.cpp:56
harvest
Definition: Treatment.h:94
fa_nk
Definition: Treatment.h:142
insecticide_treat
Definition: Treatment.h:83
straw_chopping
Definition: Treatment.h:99
struct_Hare::y
int y
Definition: Hare_All.h:139
Hare_Young::st_Foraging
TTypeOfHareState st_Foraging()
Young foraging.
Definition: Hare_All.cpp:1708
fa_greenmanure
Definition: Treatment.h:76
stubble_plough
Definition: Treatment.h:35
growth_regulator
Definition: Treatment.h:81
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...
deep_ploughing
Definition: Treatment.h:43
cfg_young_starvation_threshold
static CfgInt cfg_young_starvation_threshold("HARE_YOUNG_STARVE_THRESHOLD", CFG_CUSTOM, 4)
hilling_up
Definition: Treatment.h:91
green_harvest
Definition: Treatment.h:127
autumn_or_spring_plough
Definition: Treatment.h:103
flower_cutting
Definition: Treatment.h:121
spring_plough
Definition: Treatment.h:44
fp_sk
Definition: Treatment.h:56
pruning
Definition: Treatment.h:125
THare_Population_Manager::GetKJperM
double GetKJperM(int a_size)
Get the cost of moving 1m in KJ dependent upon mass (.
Definition: Hare_All.h:628
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
fp_manure
Definition: Treatment.h:61
herbicide_treat
Definition: Treatment.h:80
fp_ammoniumsulphate
Definition: Treatment.h:60
flammebehandling
Definition: Treatment.h:90
straw_covering
Definition: Treatment.h:123
fp_boron
Definition: Treatment.h:131
cfg_hare_y_tractor
CfgInt cfg_hare_y_tractor("HARE_TRACTOR_MORT_YOUNG", CFG_CUSTOM, 2)
cfg_MaxEnergyIntakeScaler
static CfgFloat cfg_MaxEnergyIntakeScaler("HARE_MAXENERGYINTAKESCALER", CFG_CUSTOM, 1.825)
fp_cu
Definition: Treatment.h:138
bulb_harvest
Definition: Treatment.h:122
preseeding_cultivator
Definition: Treatment.h:39
trial_control
Definition: Treatment.h:110
fp_npks
Definition: Treatment.h:51
CfgFloat::value
double value() const
Definition: Configurator.h:142
tohs_InitialState
Definition: Hare_All.h:72
THare::InternalPesticideHandlingAndResponse
virtual void InternalPesticideHandlingAndResponse()
Handles internal effects of pesticide exposure. If any effects are needed this method must be re-impl...
Definition: HareForagenPeg.cpp:559
burn_top
Definition: Treatment.h:143
THare::m_ActivityTime
int m_ActivityTime
Minutes of potential activity time per day.
Definition: Hare_All.h:203
fp_nk
Definition: Treatment.h:133
burn_straw_stubble
Definition: Treatment.h:104
org_herbicide
Definition: Treatment.h:85
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:142
Hare_Young::st_Dispersal
TTypeOfHareState st_Dispersal() override
Not used.
Definition: Hare_All.cpp:1741
fa_cu
Definition: Treatment.h:140
Hare_Infant::Init
void Init()
Object initiation.
Definition: Hare_All.cpp:1193
autumn_roll
Definition: Treatment.h:38
strigling_hill
Definition: Treatment.h:117
heavy_cultivator_aggregate
Definition: Treatment.h:120
fp_manganesesulphate
Definition: Treatment.h:59
cfg_ForageRestingRatio
CfgFloat cfg_ForageRestingRatio("HARE_FORAGERESTRATIO", CFG_CUSTOM, 0.67)
THare::m_KJForaging
double m_KJForaging
KJ/m cost of foraging per kg hare.
Definition: Hare_All.h:238
hay_turning
Definition: Treatment.h:100
last_treatment
Definition: Treatment.h:150
g_PropSolidFood
const double g_PropSolidFood[36]
Definition: Hare_All.cpp:306
THare_Population_Manager::m_HareThresholdDD
int m_HareThresholdDD
Input variable - Threshold density dependence level.
Definition: Hare_All.h:757
straw_removal
Definition: Treatment.h:124
THare::GetRMR
double GetRMR()
Get todays RMR.
Definition: Hare_THare.cpp:333
fa_n
Definition: Treatment.h:139
shredding
Definition: Treatment.h:126
THare::Forage
double Forage(int &time)
Foraging.
Definition: HareForagenPeg.cpp:52
THare::THareInit
void THareInit(int p_x, int p_y, THare_Population_Manager *p_PPM)
Object Initiation.
Definition: Hare_THare.cpp:70
pheromone
Definition: Treatment.h:149
fp_n
Definition: Treatment.h:132
manual_weeding
Definition: Treatment.h:148
CfgBool::value
bool value() const
Definition: Configurator.h:164
fa_npk
Definition: Treatment.h:67
winter_plough
Definition: Treatment.h:42
fp_calcium
Definition: Treatment.h:65
spring_harrow
Definition: Treatment.h:45
cut_to_silage
Definition: Treatment.h:98
fa_sludge
Definition: Treatment.h:77
THare::m_KJWalking
double m_KJWalking
KJ/m cost of walking per kg hare.
Definition: Hare_All.h:233
pigs_out
Definition: Treatment.h:96
fp_p
Definition: Treatment.h:54
suckering
Definition: Treatment.h:130
tohs_Dispersal
Definition: Hare_All.h:75
cut_to_hay
Definition: Treatment.h:97
fa_boron
Definition: Treatment.h:141
tohs_DestroyObject
Definition: Hare_All.h:81
THare::m_KJRunning
double m_KJRunning
KJ/m cost of running per kg hare.
Definition: Hare_All.h:228
TAnimal::m_Location_y
int m_Location_y
The objects ALMaSS y coordinate.
Definition: PopulationManager.h:366
fa_k
Definition: Treatment.h:70
spring_roll
Definition: Treatment.h:46
Hare_Young::st_Resting
TTypeOfHareState st_Resting()
Resting.
Definition: Hare_All.cpp:1750
TAnimal::m_OurLandscape
static Landscape * m_OurLandscape
A pointer to the landscape object shared with all TAnimal objects.
Definition: PopulationManager.h:342
g_MaxLeveretGrowthEnergy
const double g_MaxLeveretGrowthEnergy[36]
Definition: Hare_All.cpp:315
TAnimal::CheckManagement
void CheckManagement()
Used to start a check for any management related effects at the objects current location.
Definition: PopulationManager.cpp:1591
struct_Hare::L
Landscape * L
Definition: Hare_All.h:141
syninsecticide_treat
Definition: Treatment.h:111
fp_nc
Definition: Treatment.h:135
fungicide_treat
Definition: Treatment.h:82
activity_Foraging
Definition: Hare_All.h:92
fp_sludge
Definition: Treatment.h:63
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:563
THare::MovePeg
void MovePeg()
Move the peg according to attraction forces.
Definition: HareForagenPeg.cpp:535
hob_Young
Definition: Hare_All.h:60
fp_greenmanure
Definition: Treatment.h:62
shallow_harrow
Definition: Treatment.h:119
fa_slurry
Definition: Treatment.h:72
THare_Population_Manager::GetRMR
double GetRMR(int a_age, double a_size)
Returns the RMR given a specific age and mass.
Definition: Hare_All.cpp:932
cattle_out_low
Definition: Treatment.h:112
harvest_bushfruit
Definition: Treatment.h:137
preseeding_cultivator_sow
Definition: Treatment.h:40
fp_pk
Definition: Treatment.h:53
cfg_hare_escape_dist
CfgInt cfg_hare_escape_dist("HARE_ESCAPE_DIST", CFG_CUSTOM, 100)
THare::m_old_weight
double m_old_weight
State variale - last hare weight.
Definition: Hare_All.h:185
fa_pks
Definition: Treatment.h:145
org_fungicide
Definition: Treatment.h:86
THare::m_TodaysEnergy
double m_TodaysEnergy
State variable - the amount of energy available today, can be in deficit.
Definition: Hare_All.h:218
summer_harrow
Definition: Treatment.h:49
cattle_out
Definition: Treatment.h:95
Hare_Young::st_NextStage
void st_NextStage()
Maturation to Hare_Juvenile.
Definition: Hare_All.cpp:1789
harvestshoots
Definition: Treatment.h:147
cfg_hare_y_cut
CfgInt cfg_hare_y_cut("HARE_CUTTING_MORT_YOUNG", CFG_CUSTOM, 10)
stubble_cultivator_heavy
Definition: Treatment.h:36
TALMaSSObject::m_StepDone
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
Definition: PopulationManager.h:133
biocide
Definition: Treatment.h:116
swathing
Definition: Treatment.h:93
THare::EnergyBalance
void EnergyBalance(TTypeOfActivity a_activity, int dist)
Adjust energy balance for an activity.
Definition: Hare_THare.cpp:261
tohs_NextStage
Definition: Hare_All.h:73
glyphosate
Definition: Treatment.h:114
Hare_Female::ON_RemoveYoung
void ON_RemoveYoung(THare *a_young)
A leveret has matured.
Definition: Hare_All.cpp:3590
CfgInt::value
int value() const
Definition: Configurator.h:116
THare_Population_Manager::m_YoungMortRate
double m_YoungMortRate
Input variable - Young mortality rate.
Definition: Hare_All.h:745
fa_manure
Definition: Treatment.h:75
spring_sow
Definition: Treatment.h:47
cut_weeds
Definition: Treatment.h:106
trial_toxiccontrol
Definition: Treatment.h:109
summer_plough
Definition: Treatment.h:48
THare::st_Dying
void st_Dying()
Tidy up before removing the object on death.
Definition: Hare_THare.cpp:165
Landscape::EventtypeToString
std::string EventtypeToString(int a_event)
Returns the text representation of a treatment type.
Definition: Landscape.cpp:6024
fp_pks
Definition: Treatment.h:146
fp_ns
Definition: Treatment.h:134
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:179
bed_forming
Definition: Treatment.h:118
product_treat
Definition: Treatment.h:113
tohs_Developing
Definition: Hare_All.h:74
THare::m_CurrentHState
TTypeOfHareState m_CurrentHState
Defines the current activity.
Definition: Hare_All.h:165
struct_Hare
Class used to pass hare information to CreateObjects.
Definition: Hare_All.h:136
THare_Population_Manager::GetInterference
double GetInterference(int h)
Return the proportion of time used in communicating with con-specifics.
Definition: Hare_All.h:707
autumn_sow
Definition: Treatment.h:41
autumn_harrow
Definition: Treatment.h:37
fa_calcium
Definition: Treatment.h:79
THare::m_StarvationDays
int m_StarvationDays
State variable - the number of consecutive days in negative energy balance.
Definition: Hare_All.h:208
fa_ammoniumsulphate
Definition: Treatment.h:74
autumn_sow_with_ferti
Definition: Treatment.h:136
trial_insecticidetreat
Definition: Treatment.h:108
fa_p
Definition: Treatment.h:69
mow
Definition: Treatment.h:105
THare::GetTotalWeight
double GetTotalWeight()
Provide the wet weight of the hare.
Definition: Hare_All.h:370
Hare_Infant::Hare_Infant
Hare_Infant(int p_x, int p_y, Landscape *p_L, THare_Population_Manager *p_PPM)
Hare infant constructor.
Definition: Hare_All.cpp:1183
fa_rsm
Definition: Treatment.h:78
THare::Running
virtual void Running(int a_max_dist)
Run.
Definition: Hare_THare.cpp:136
THare::m_MyMum
Hare_Female * m_MyMum
Pointer to the hare's mum.
Definition: Hare_All.h:190
g_random_fnc
int g_random_fnc(const int a_range)
Definition: ALMaSS_Random.cpp:74
fa_npks
Definition: Treatment.h:66
water
Definition: Treatment.h:92
stubble_harrowing
Definition: Treatment.h:102
THare::m_weight
double m_weight
State variale - hare weight g.
Definition: Hare_All.h:180
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
tohs_Resting
Definition: Hare_All.h:77
fp_liquidNH3
Definition: Treatment.h:57
molluscicide
Definition: Treatment.h:87
TALMaSSObject::m_CurrentStateNo
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:131
hay_bailing
Definition: Treatment.h:101
Hare_Young::st_Developing
TTypeOfHareState st_Developing()
Developmental code for the young hare.
Definition: Hare_All.cpp:1761
fa_manganesesulphate
Definition: Treatment.h:73
struct_Hare::weight
double weight
Definition: Hare_All.h:145
fp_k
Definition: Treatment.h:55
THare::TimeBudget
void TimeBudget(TTypeOfActivity a_activity, int dist)
Adjust time budger for an activity.
Definition: Hare_THare.cpp:298
Landscape::Warn
void Warn(std::string a_msg1, std::string a_msg2)
Wrapper for the g_msg Warn function.
Definition: Landscape.h:2250
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:683
autumn_plough
Definition: Treatment.h:34
cfg_hare_proximity_alert
static CfgFloat cfg_hare_proximity_alert("HARE_PROXIMITY_ALERT", CFG_CUSTOM, 0.05)
TAnimal::m_Location_x
int m_Location_x
The objects ALMaSS x coordinate.
Definition: PopulationManager.h:362
fp_slurry
Definition: Treatment.h:58
fiber_covering
Definition: Treatment.h:128
summer_sow
Definition: Treatment.h:50
spring_sow_with_ferti
Definition: Treatment.h:115
activity_Resting
Definition: Hare_All.h:90
tohs_Foraging
Definition: Hare_All.h:76
sleep_all_day
Definition: Treatment.h:33
strigling_sow
Definition: Treatment.h:107