ALMaSS  1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
Vole_JuvenileFemale Class Reference

The class for female voles. More...

#include <vole_all.h>

Inheritance diagram for Vole_JuvenileFemale:
Vole_Base TAnimal TALMaSSObject Vole_Female

Public Member Functions

 Vole_JuvenileFemale (struct_Vole_Adult *p_aVoleStruct)
 Vole_JuvenileFemale constructor. More...
 
void ReInit (struct_Vole_Adult *p_aVoleStruct) override
 
 ~Vole_JuvenileFemale () override
 
bool OnFarmEvent (FarmToDo event) override
 External event handler. More...
 
void BeginStep () override
 Female vole BeginStep. More...
 
void Step () override
 JuvenileFemale vole Step. More...
 
void EndStep () override
 Female vole EndStep. More...
 
void OnKilled () override
 Death from external entity. More...
 
- Public Member Functions inherited from Vole_Base
 Vole_Base (struct_Vole_Adult *a_AVoleStruct_ptr)
 Constructor for Vole_Base. More...
 
 ~Vole_Base () override
 
virtual void Init (struct_Vole_Adult *a_AVoleStruct_ptr)
 
void st_Dying ()
 All voles end here on death. More...
 
void SetBreedingSeason (bool a_flag)
 Set Breeding Season flag. More...
 
void SetWeight (double W)
 
void Setm_Mature ()
 
void Set_BirthYear (int BirthYear)
 
void Set_MotherId (unsigned MotherIdNo)
 
void Set_FatherId (unsigned FatherIdNo)
 
void Set_NoYoungTot (int a_NoOfYoung)
 
void Set_XBorn (int a_Location_x)
 
void Set_YBorn (int a_Location_y)
 
void Set_ElemBorn (int a_Location_x, int a_Location_y)
 
void Set_VegBorn (int a_Location_x, int a_Location_y)
 
void Set_PolyRefBorn (int a_Location_x, int a_Location_y)
 
void Set_Age (int Age)
 
int WhatState () override
 
bool SupplyBornLastYear ()
 Were we born this year? More...
 
bool SupplyTerritorial ()
 
int SupplyFatherId ()
 
int SupplyMotherId ()
 
bool SupplySex ()
 
int SupplyBirthYear ()
 
int SupplyTotNoYoung ()
 
int SupplyXBorn ()
 
int SupplyYBorn ()
 
int SupplyPolyRefBorn ()
 
int SupplyElemBorn ()
 
TTypesOfLandscapeElement SupplyElemType ()
 
int SupplyVegBorn ()
 
int SupplyTerrRange ()
 
double SupplyWeight ()
 
int SupplyIDNo ()
 
bool SupplyMature ()
 
int SupplyDeathCause ()
 
unsigned SupplyAge ()
 
unsigned SupplyX ()
 
unsigned SupplyY ()
 
bool SupplyInTrap ()
 
InTrapPosition SupplyTrapPosition ()
 
void SetFree ()
 
int SupplyHomoZyg ()
 
int SupplyHeteroZyg ()
 
int SupplyAllele (int locus, int allele)
 
uint32 SupplyMyAllele (int i, int j)
 
int GetGeneticFlag ()
 
int GetDirectFlag ()
 
void SetGeneticFlag ()
 
void SetDirectFlag ()
 
void UnsetGeneticFlag ()
 
void UnsetDirectFlag ()
 
GeneticMaterial SupplyGenes ()
 
virtual bool MortalityTest ()
 Do a mortality test. More...
 
void CopyMyself (VoleObject a_vole)
 Duplicates a vole. More...
 
void SetFertile (bool f)
 Set the male vole fertility. More...
 
bool GetFertile ()
 Get the male vole fertility. 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 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

int Dispersal (double p_OldQual, int p_Distance)
 Female dispersal. More...
 
int st_Evaluate_n_Explore ()
 Main territory evaluation behaviour. More...
 
void st_BecomeSubAdult (void)
 
void SetLocation () override
 Location map function. More...
 
void FreeLocation () override
 Location map function. More...
 
bool GetLocation (int px, int py) override
 Location map function. More...
 
- Protected Member Functions inherited from Vole_Base
virtual void RodenticideIngestion (void)
 
double CalculateCarryingCapacity (int x, int y, int a_ddep) const
 
int MoveQuality (int p_x, int p_y) const
 Test a location for quality while moving. More...
 
void MoveTo (int p_Vector, int p_Distance, int iterations)
 Movement. More...
 
void DoWalking (int p_Distance, int &p_Vector, int &vx, int &vy) const
 Walking. More...
 
void DoWalkingCorrect (int p_Distance, int &p_Vector, int &vx, int &vy) const
 Walking where there is a danger of stepping off the world. More...
 
void Escape (int p_Vector, int p_Distance)
 Dispersal - directed movement. More...
 
void CheckTraps ()
 
- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 

Additional Inherited Members

- 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...
 
- Public Attributes inherited from Vole_Base
TTypeOfVoleState CurrentVState
 
Vole_Population_Managerm_OurPopulation
 
- Protected Attributes inherited from Vole_Base
int m_BirthYear
 
bool m_BornLastYear
 A flag set if the female was born the year before. More...
 
unsigned int m_MinTerrRange
 
unsigned m_MotherId
 
unsigned m_FatherId
 
int m_Death
 
int m_TerrRange
 
bool m_Sex
 
bool m_Mature
 
int m_Age
 
int m_XBorn
 
int m_YBorn
 
int m_PolyRefBorn
 
int m_ElemBorn
 
int m_VegBorn
 
int m_LifeSpan
 
double m_Weight
 
bool m_fertile
 Flag indicating the fertility state (true means fertile)
More...
 
int m_NoOfYoungTotal
 
int m_DispVector
 
bool m_Have_Territory
 
int m_Reserves
 
unsigned IDNo
 
int m_SimH
 
int m_SimW
 
GeneticMaterial m_MyGenes
 
InTrapPosition m_intrappos
 
- 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 Vole_Base
static unsigned int m_MaxMaleTerritorySize = 0
 
static unsigned int m_MaxFemaleTerritorySize = 0
 
static unsigned int m_MinMaleTerritorySize = 0
 
static unsigned int m_MinFemaleTerritorySize = 0
 
static double m_MinFVoleHabQual = 0
 
static double m_MinJMVoleHabQual = 0
 
static double m_MinMVoleHabQual = 0
 
static double m_MaleTerritoryRangeSlope = 0
 
static double m_FemaleTerritoryRangeSlope = 0
 
static double m_FHabQualThreshold3
 
static double m_FHabQualThreshold2
 
static double m_FHabQualThreshold1
 
static double m_MHabQualThreshold3
 
static double m_MHabQualThreshold2
 
static double m_MHabQualThreshold1
 
static bool m_BreedingSeason = false
 
- 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

The class for female voles.

Contains all the behaviour specific to the female vole. The differences between the male and female are primarily in female reproductive behaviour, but there are small differences in other behaviours requiring re-implementation of many of the behaviours (e.g. dispersal).

Constructor & Destructor Documentation

◆ Vole_JuvenileFemale()

Vole_JuvenileFemale::Vole_JuvenileFemale ( struct_Vole_Adult p_aVoleStruct)

Vole_JuvenileFemale constructor.

1202  : Vole_Base(p_aVoleStruct) {
1203  m_Sex = false;
1206  m_BornLastYear = false;
1208  m_Age = 14;
1209 #ifdef __VOLEPESTICIDEON
1210  m_maturitydelay = 0.0;
1211 #endif
1212 }

References Vole_Base::m_Age, Vole_Base::m_BornLastYear, Vole_Base::m_MinFemaleTerritorySize, Vole_Base::m_MinTerrRange, Vole_Base::m_Sex, Vole_Base::m_TerrRange, Vole_Base::m_Weight, and WeanedWeight.

◆ ~Vole_JuvenileFemale()

Vole_JuvenileFemale::~Vole_JuvenileFemale ( )
override
1231  {
1232  // Nothing to do
1233 }

Member Function Documentation

◆ BeginStep()

void Vole_JuvenileFemale::BeginStep ( void  )
overridevirtual

Female vole BeginStep.

The BeginStep is one of the three timestep divisions. This is called once for each vole before Step and EndStep.
The main function here is to remove voles that die before they take up CPU resources in the Step code.
Can also be used to check for pesticide accumulation levels in pesticide simulation

Reimplemented from Vole_Base.

1246  {
1247  if (MortalityTest())
1248  {
1250  m_StepDone = true;
1252  }
1253  else
1254  {
1255  if (--m_LifeSpan < 1)
1256  {
1259  m_StepDone = true;
1260  }
1261  }
1262 #ifdef __VOLEPESTICIDEON
1263  PesticideIngestion();
1264  ActOnPesticideDose();
1265 #endif
1266 }

References cfg_RecordVoleMort, VoleSummaryOutput::ChangeData(), Vole_Base::CurrentVState, Vole_Base::m_LifeSpan, Vole_Base::m_OurPopulation, TALMaSSObject::m_StepDone, Vole_Population_Manager::m_VoleRecordMort, Vole_Base::MortalityTest(), tovmort_FBck, tovmort_FLife, tovs_FDying, and CfgBool::value().

◆ Dispersal()

int Vole_JuvenileFemale::Dispersal ( double  p_OldQual,
int  p_Distance 
)
protected

Female dispersal.

Checks p_Distance away to see if it can find a territory in the next FHabQualThreshold category or with an improved quality of 1.1* p_OldQual if already in optimal habitat
This entails some risk though, so there is a fixed 2.5% increase in the mortality chance when it does this.

1639  {
1640  // Returns 1 for die, 0 for carry on
1641  if (m_DispVector == -1) m_DispVector = g_random_fnc(8); // Choose direction 0-7
1642  // Go that far in that direction (assuming it is possible to do that)
1643  const int oldx = m_Location_x;
1644  const int oldy = m_Location_y;
1645  MoveTo(m_DispVector, p_Distance, 10);
1646  // Now we are there so what is the new quality
1647  // 1. Get the carrying capacity
1649  if (CC <= p_OldQual)
1650  {
1651  // Don't want to move
1652  FreeLocation();
1653  m_Location_x = oldx;
1654  m_Location_y = oldy;
1656  SetLocation();
1657  }
1658  else
1659  {
1661  {
1663  return 1;
1664  }
1665  }
1666  return 0;
1667 }

References Vole_Base::CalculateCarryingCapacity(), cfg_RecordVoleMort, cfg_VoleDDepConst, VoleSummaryOutput::ChangeData(), FreeLocation(), g_extradispmort, g_rand_uni_fnc(), g_random_fnc(), Vole_Base::m_DispVector, TAnimal::m_guard_cell_x, TAnimal::m_guard_cell_y, TAnimal::m_Location_x, TAnimal::m_Location_y, Vole_Base::m_OurPopulation, Vole_Population_Manager::m_VoleRecordMort, Vole_Base::MoveTo(), SetLocation(), tovmort_FDisp, Population_Manager::UpdateGuardMap(), CfgInt::value(), and CfgBool::value().

Referenced by st_Evaluate_n_Explore(), and Vole_Female::st_Evaluate_n_Explore().

◆ EndStep()

void Vole_JuvenileFemale::EndStep ( void  )
overridevirtual

Female vole EndStep.

The EndStep one of the three timestep divisions. This is called once for each vole after BeginStep and Step.
The main function here is to remove voles that have died during step and otherwise to grow if not at max weight. It also checks if the vole was killed due to human management and determines the potential territory size.

Reimplemented from Vole_Base.

1327  {
1328 #ifdef __VoleStarvationDays
1329  if ( m_StarvationDays > m_MaxStarvationDays)
1330  {
1331  st_Dying();
1333  }
1334 #endif
1335  CheckManagement();
1336  if (CurrentVState == tovs_FDying) { st_Dying(); }
1337 
1338  else
1339  {
1340  m_Age++;
1341  /* FEMALE GROWTH NOTES
1342 
1343  Female vole grows until 20g.
1344  After that she will only grow if he has matured
1345  Growth continues up to 55g.
1346 
1347  Reproduction cannot occur below 20g or 20 days
1348 
1349  Growth only occurs between 1 March and 1st August
1350 
1351  taken from Hanson L, 1977, Oikos 29.
1352  */
1353  const int today = m_OurLandscape->SupplyDayInYear();
1354  if (today < GrowStopDate && today >
1356  {
1357  if (m_Weight < 20) { m_Weight += growthperdayF; }
1358  else if (m_Mature == true && m_Weight < MaxWeightF)
1359  {
1362  }
1363  }
1364  else if (today == 1) m_BornLastYear = true; // must be true if alive on 1st Jan.
1365  }
1366 }

References cfg_RecordVoleMort, VoleSummaryOutput::ChangeData(), TAnimal::CheckManagement(), Vole_Base::CurrentVState, growthperdayF, Vole_Base::m_Age, Vole_Base::m_BornLastYear, Vole_Base::m_FemaleTerritoryRangeSlope, Vole_Base::m_Mature, Vole_Base::m_MinFemaleTerritorySize, TAnimal::m_OurLandscape, Vole_Base::m_OurPopulation, Vole_Base::m_TerrRange, Vole_Population_Manager::m_VoleRecordMort, Vole_Base::m_Weight, MaxWeightF, MinReproWeightF, Vole_Base::st_Dying(), Landscape::SupplyDayInYear(), Vole_Population_Manager::SupplyGrowthStartDate(), tovmort_FStarve, tovs_FDying, and CfgBool::value().

◆ FreeLocation()

◆ GetLocation()

bool Vole_JuvenileFemale::GetLocation ( int  px,
int  py 
)
inlineoverrideprotectedvirtual

Location map function.

Reimplemented from Vole_Base.

1622  {
1623  if (m_OurPopulation->m_VoleMap->GetMapValue(px, py) != nullptr) return true;
1624  return false;
1625 };

References IDMap< a_type >::GetMapValue(), Vole_Base::m_OurPopulation, and Vole_Population_Manager::m_VoleMap.

◆ OnFarmEvent()

bool Vole_JuvenileFemale::OnFarmEvent ( FarmToDo  event)
overridevirtual

External event handler.

This method evaluates external events and chooses a suitable response (in this case a probability of dying because other effects will be taken up by the evaluate and explore state.

Reimplemented from TAnimal.

1377  {
1378  switch (event)
1379  {
1380 //Here begins soilcultivation mortality
1381  case sleep_all_day: break;
1382  case autumn_harrow:
1384  case autumn_plough:
1385  case autumn_roll:
1386  case autumn_sow:
1387  case autumn_sow_with_ferti:
1388  case burn_straw_stubble:
1389  case burn_top:
1390  case flammebehandling:
1391  case deep_ploughing:
1393  case hilling_up:
1394  case preseeding_cultivator:
1396  case row_cultivation:
1397  case spring_harrow:
1398  case spring_plough:
1399  case spring_roll:
1400  case spring_sow:
1401  case spring_sow_with_ferti:
1402  case strigling_hill:
1403  case strigling_sow:
1405  case stubble_harrowing:
1406  case stubble_plough:
1407  case summer_harrow:
1408  case summer_plough:
1409  case summer_sow:
1410  case winter_harrow:
1411  case winter_plough:
1412  case bed_forming:
1413  case shallow_harrow:
1414  case shredding:
1417  break;
1418 //Here begins harvest mortality
1419  case swathing:
1420  case straw_removal:
1421  case straw_chopping:
1422  case straw_covering:
1423  case fiber_covering:
1424  case fiber_removal:
1425  case mow:
1426  case hay_bailing:
1427  case hay_turning:
1428  case harvest:
1429  case cut_to_hay:
1430  case cut_to_silage:
1431  case cut_weeds:
1432  case bulb_harvest:
1433  case flower_cutting:
1434  case green_harvest:
1435  case harvest_bushfruit:
1436  case harvestshoots:
1439  break;
1440 //Here begins grazing mortality
1441  case pigs_out:
1444  break;
1445 //Here begins strigling mortality
1446  case strigling:
1449  break;
1450 // Here begins insecticide mortality
1451  case syninsecticide_treat: /*\todo I added it because it was so for male, was there a reason it wasn't a mortality for female? */
1452  case insecticide_treat:
1455  break;
1456 // Here begins herbicide mortality
1457  case herbicide_treat: /*\todo I added it because it was so for male, was there a reason it wasn't a mortality for female? */
1460  break;
1461 //Here begins non-mortality events
1462  case biocide:
1463  case fa_ammoniumsulphate:
1464  case fa_boron:
1465  case fa_calcium:
1466  case fa_cu:
1467  case fa_greenmanure:
1468  case fa_k:
1469  case fa_manganesesulphate:
1470  case fa_manure:
1471  case fa_n:
1472  case fa_nk:
1473  case fa_npk:
1474  case fa_npks:
1475  case fa_p:
1476  case fa_pk:
1477  case fa_pks:
1478  case fa_rsm:
1479  case fa_sk:
1480  case fa_sludge:
1481  case fa_slurry:
1482  case fp_ammoniumsulphate:
1483  case fp_boron:
1484  case fp_calcium:
1485  case fp_cu:
1486  case fp_greenmanure:
1487  case fp_k:
1488  case fp_liquidNH3:
1489  case fp_manganesesulphate:
1490  case fp_manure:
1491  case fp_n:
1492  case fp_nc:
1493  case fp_nk:
1494  case fp_npk:
1495  case fp_npks:
1496  case fp_ns:
1497  case fp_p:
1498  case fp_pk:
1499  case fp_pks:
1500  case fp_rsm:
1501  case fp_sk:
1502  case fp_sludge:
1503  case fp_slurry:
1504  case fungicide_treat:
1505  case glyphosate:
1506  case molluscicide:
1507  case org_fungicide:
1508  case org_herbicide:
1509  case org_insecticide:
1510  case last_treatment:
1511  case pheromone:
1512  case trial_control:
1514  case trial_toxiccontrol:
1515  case product_treat:
1516  case cattle_out:
1517  case cattle_out_low:
1518  case water:
1519  case manual_weeding:
1520  case pruning:
1521  case suckering:
1522  case growth_regulator:
1523  break;
1524  default:
1525  g_msg->Warn(WARN_FILE, "Vole_Female::OnFarmEvent(): Unknown event type:",
1527  exit(1);
1528  }
1529  if (CurrentVState == tovs_FDying)
1530  {
1532  return true;
1533  }
1534  return false;
1535 }

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_RecordVoleMort, VoleSummaryOutput::ChangeData(), Vole_Base::CurrentVState, 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_msg, g_rand_uni_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, Vole_Base::m_OurPopulation, Vole_Population_Manager::m_VoleRecordMort, manual_weeding, molluscicide, mow, 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, tovmort_FFarm, tovs_FDying, trial_control, trial_insecticidetreat, trial_toxiccontrol, CfgBool::value(), VoleHarvestMort, VoleHerbicicideMort, VoleInsecticideMort, VolePigGrazingMort, VoleSoilCultivationMort, VoleStriglingMort, MapErrorMsg::Warn(), WARN_FILE, water, winter_harrow, and winter_plough.

◆ OnKilled()

void Vole_JuvenileFemale::OnKilled ( )
overridevirtual

Death from external entity.

External event has caused death - probably eaten by a explicitly modelled predator

Reimplemented from Vole_Base.

References cfg_RecordVoleMort, VoleSummaryOutput::ChangeData(), Vole_Base::CurrentVState, Vole_Base::m_OurPopulation, Vole_Population_Manager::m_VoleRecordMort, tovmort_FPred, tovs_FDying, and CfgBool::value().

◆ ReInit()

void Vole_JuvenileFemale::ReInit ( struct_Vole_Adult p_aVoleStruct)
overridevirtual

Reimplemented from Vole_Base.

Reimplemented in Vole_Female.

1216  {
1217  Init(p_aVoleStruct);
1218  m_Sex = false;
1221  m_BornLastYear = false;
1223  m_Age = 14;
1224 #ifdef __VOLEPESTICIDEON
1225  m_maturitydelay = 0.0;
1226 #endif
1227 }

References Vole_Base::Init(), Vole_Base::m_Age, Vole_Base::m_BornLastYear, Vole_Base::m_MinFemaleTerritorySize, Vole_Base::m_MinTerrRange, Vole_Base::m_Sex, Vole_Base::m_TerrRange, Vole_Base::m_Weight, and WeanedWeight.

◆ SetLocation()

void Vole_JuvenileFemale::SetLocation ( )
inlineoverrideprotectedvirtual

◆ st_BecomeSubAdult()

void Vole_JuvenileFemale::st_BecomeSubAdult ( void  )
protected
1553  {
1554  const auto av = new struct_Vole_Adult;
1555  av->VPM = m_OurPopulation;
1556  av->L = m_OurLandscape;
1557  av->m_flag = true; // Used to signal pesticide effect to CreateObjects
1558  // Create the new voles (50% chance of male/female)
1562  av->FatherId = m_FatherId;
1563  av->MotherId = m_MotherId;
1564  av->x = m_Location_x;
1565  av->y = m_Location_y;
1566  av->weight = m_Weight;
1567  // Do the genetics
1568  av->Genes = m_MyGenes;
1569  av->age = m_Age;
1570  m_OurPopulation->CreateObjects(vob_Female, this, av, 1);
1571  // Remove the current object
1573  FreeLocation();
1574  m_CurrentStateNo = -1;
1575  m_StepDone = true;
1576 }

References Vole_Population_Manager::CreateObjects(), Vole_Base::CurrentVState, FreeLocation(), Vole_Base::m_Age, TALMaSSObject::m_CurrentStateNo, Vole_Base::m_FatherId, TAnimal::m_Location_x, TAnimal::m_Location_y, Vole_Base::m_MotherId, Vole_Base::m_MyGenes, TAnimal::m_OurLandscape, Vole_Base::m_OurPopulation, TALMaSSObject::m_StepDone, Vole_Base::m_Weight, Landscape::SupplyElementType(), Landscape::SupplyPolyRef(), Landscape::SupplyVegType(), tovs_FDying, vob_Female, and struct_Vole_Adult::VPM.

Referenced by Step().

◆ st_Evaluate_n_Explore()

int Vole_JuvenileFemale::st_Evaluate_n_Explore ( )
protected

Main territory evaluation behaviour.

Evaluates the quality of her habitat and does some limited exploration in the surrounding area to see if she can improve it by moving.

1587  {
1588 #ifdef __USINGTRAPLINES
1589  CheckTraps();
1590 #endif
1592  // This function determines whether he must leave and whether he does
1593  // an explore. He will do this if he is not in optimal conditions
1594 
1595  if (Qual < m_MinFVoleHabQual)
1596  {
1597  // check an area MinFemaleMovement to FemaleMovement metres away
1599  // Not quality dependent dispersal, very directed
1600  return Dispersal(-1, g_random_fnc(FemaleMovement) + 1);
1601  }
1602  return Dispersal(Qual, 1 + g_random_fnc(FemaleMovement) + 1);
1603  // returns 1 if it has died of extra dispersal mortality or starvation
1604 }

References Vole_Base::CalculateCarryingCapacity(), cfg_VoleDDepConst, Vole_Base::CheckTraps(), Dispersal(), FemaleMovement, g_random_fnc(), Vole_Base::m_DispVector, TAnimal::m_Location_x, TAnimal::m_Location_y, Vole_Base::m_MinFVoleHabQual, and CfgInt::value().

Referenced by Step().

◆ Step()

void Vole_JuvenileFemale::Step ( void  )
overridevirtual

JuvenileFemale vole Step.

The Step is one of the three timestep divisions. This is called repeatedly after BeginStep and before EndStep, until all voles report that they are done with Step.

Most of the behaviours are controlled by moving voles between behavioural states in Step (for other models this is also done in BeginStep and EndStep).
When a vole is done for the day it will signal this by setting m_StepDone==true. NB that a call to one behaviour may trigger a call to another behaviour on the next call to step inside the same timestep. In this way a daily cycle of activity can be undertaken (i.e. do reproduction and explore)

Reimplemented from Vole_Base.

Reimplemented in Vole_Female.

1279  {
1280  if (m_StepDone) return;
1281  switch (CurrentVState)
1282  {
1283  case 0: // Initial state
1285  break;
1286  case tovs_FEvaluateExplore: // Evaluate & Explore
1287  switch (st_Evaluate_n_Explore())
1288  {
1289  case 1: // Dead from dispersal mortality
1290  CurrentVState = tovs_FDying; // Die
1291  break;
1292  case 2: // Starved
1294  CurrentVState = tovs_FDying; // Die
1295  break;
1296  default:
1297  ; // Do nothing
1298  }
1299 #ifdef __VOLEPESTICIDEON
1300  if (m_Age >= MinReproAgeF+ m_maturitydelay ) st_BecomeSubAdult();
1301 #else
1303 #endif
1304  m_StepDone = true;
1305  break;
1306  case tovs_FDying: // Die
1307  FreeLocation();
1308  m_StepDone = true;
1309  break;
1310  default:
1311  m_OurLandscape->Warn("Vole_Female::Step - unknown state", nullptr);
1312  exit(9);
1313  }
1314 }

References cfg_RecordVoleMort, VoleSummaryOutput::ChangeData(), Vole_Base::CurrentVState, FreeLocation(), Vole_Base::m_Age, TAnimal::m_OurLandscape, Vole_Base::m_OurPopulation, TALMaSSObject::m_StepDone, Vole_Population_Manager::m_VoleRecordMort, MinReproAgeF, st_BecomeSubAdult(), st_Evaluate_n_Explore(), tovmort_FStarve, tovs_FDying, tovs_FEvaluateExplore, CfgBool::value(), and Landscape::Warn().


The documentation for this class was generated from the following files:
Vole_Base::m_LifeSpan
int m_LifeSpan
Definition: vole_all.h:182
fiber_removal
Definition: Treatment.h:129
fp_rsm
Definition: Treatment.h:64
Vole_Base::m_MotherId
unsigned m_MotherId
Definition: vole_all.h:158
org_insecticide
Definition: Treatment.h:84
fa_sk
Definition: Treatment.h:71
row_cultivation
Definition: Treatment.h:88
fa_pk
Definition: Treatment.h:68
WARN_FILE
Definition: MapErrorMsg.h:37
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
MinReproAgeF
int MinReproAgeF
Definition: Vole_all.cpp:141
insecticide_treat
Definition: Treatment.h:83
Vole_Base::CurrentVState
TTypeOfVoleState CurrentVState
Definition: vole_all.h:406
Vole_Base::Init
virtual void Init(struct_Vole_Adult *a_AVoleStruct_ptr)
Definition: Vole_all.cpp:228
straw_chopping
Definition: Treatment.h:99
Landscape::SupplyVegType
TTypesOfVegetation SupplyVegType(int a_x, int a_y)
Returns the vegetation type of the polygon using the polygon reference number a_polyref or coordinate...
Definition: Landscape.h:1925
fa_greenmanure
Definition: Treatment.h:76
Landscape::SupplyElementType
TTypesOfLandscapeElement SupplyElementType(int a_polyref)
Returns the landscape type of the polygon using the polygon reference number a_polyref or coordinates...
Definition: Landscape.h:1732
stubble_plough
Definition: Treatment.h:35
Vole_Base::m_MinTerrRange
unsigned int m_MinTerrRange
Definition: vole_all.h:156
growth_regulator
Definition: Treatment.h:81
MinReproWeightF
const int MinReproWeightF
Definition: Vole_all.cpp:145
deep_ploughing
Definition: Treatment.h:43
hilling_up
Definition: Treatment.h:91
Vole_Base::MoveTo
void MoveTo(int p_Vector, int p_Distance, int iterations)
Movement.
Definition: Vole_all.cpp:883
green_harvest
Definition: Treatment.h:127
autumn_or_spring_plough
Definition: Treatment.h:103
flower_cutting
Definition: Treatment.h:121
vob_Female
Definition: vole_all.h:98
Vole_Base::CheckTraps
void CheckTraps()
Definition: Vole_all.cpp:2590
spring_plough
Definition: Treatment.h:44
fp_sk
Definition: Treatment.h:56
pruning
Definition: Treatment.h:125
tovs_FEvaluateExplore
Definition: vole_all.h:63
Vole_Base::m_Mature
bool m_Mature
Definition: vole_all.h:168
TAnimal::m_guard_cell_y
int m_guard_cell_y
The index y to the guard cell.
Definition: PopulationManager.h:374
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
VoleSoilCultivationMort
const double VoleSoilCultivationMort
Definition: Vole_all.cpp:190
fp_boron
Definition: Treatment.h:131
VoleSummaryOutput::ChangeData
void ChangeData(int a_data, int a_value)
Definition: VolePopulationManager.cpp:3302
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
WeanedWeight
const int WeanedWeight
Definition: Vole_all.cpp:125
burn_top
Definition: Treatment.h:143
g_extradispmort
double g_extradispmort
Definition: Vole_all.cpp:198
struct_Vole_Adult
A struct for passing data to create a new vole.
Definition: vole_all.h:115
fp_nk
Definition: Treatment.h:133
burn_straw_stubble
Definition: Treatment.h:104
org_herbicide
Definition: Treatment.h:85
Vole_Base::m_MyGenes
GeneticMaterial m_MyGenes
Definition: vole_all.h:205
fa_cu
Definition: Treatment.h:140
autumn_roll
Definition: Treatment.h:38
strigling_hill
Definition: Treatment.h:117
heavy_cultivator_aggregate
Definition: Treatment.h:120
VoleHarvestMort
const double VoleHarvestMort
Definition: Vole_all.cpp:186
fp_manganesesulphate
Definition: Treatment.h:59
tovmort_FDisp
Definition: VolePopulationManager.h:79
hay_turning
Definition: Treatment.h:100
last_treatment
Definition: Treatment.h:150
straw_removal
Definition: Treatment.h:124
fa_n
Definition: Treatment.h:139
shredding
Definition: Treatment.h:126
Vole_Base::m_Weight
double m_Weight
Definition: vole_all.h:184
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
Vole_JuvenileFemale::st_Evaluate_n_Explore
int st_Evaluate_n_Explore()
Main territory evaluation behaviour.
Definition: Vole_all.cpp:1587
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
Vole_JuvenileFemale::Dispersal
int Dispersal(double p_OldQual, int p_Distance)
Female dispersal.
Definition: Vole_all.cpp:1639
VoleStriglingMort
const double VoleStriglingMort
Definition: Vole_all.cpp:188
MaxWeightF
const double MaxWeightF
Definition: Vole_all.cpp:129
fa_sludge
Definition: Treatment.h:77
pigs_out
Definition: Treatment.h:96
Vole_Base::CalculateCarryingCapacity
double CalculateCarryingCapacity(int x, int y, int a_ddep) const
Definition: Vole_all.cpp:369
Vole_JuvenileFemale::st_BecomeSubAdult
void st_BecomeSubAdult(void)
Definition: Vole_all.cpp:1553
fp_p
Definition: Treatment.h:54
IDMap::SetMapValue
void SetMapValue(unsigned x, unsigned y, a_type p)
Definition: MovementMap.h:143
suckering
Definition: Treatment.h:130
cut_to_hay
Definition: Treatment.h:97
fa_boron
Definition: Treatment.h:141
IDMap::GetMapValue
a_type GetMapValue(unsigned x, unsigned y)
Definition: MovementMap.h:140
Vole_JuvenileFemale::SetLocation
void SetLocation() override
Location map function.
Definition: Vole_all.cpp:1612
cfg_RecordVoleMort
CfgBool cfg_RecordVoleMort
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
tovs_FDying
Definition: vole_all.h:71
TAnimal::m_OurLandscape
static Landscape * m_OurLandscape
A pointer to the landscape object shared with all TAnimal objects.
Definition: PopulationManager.h:342
VoleHerbicicideMort
const double VoleHerbicicideMort
Definition: Vole_all.cpp:194
TAnimal::CheckManagement
void CheckManagement()
Used to start a check for any management related effects at the objects current location.
Definition: PopulationManager.cpp:1591
syninsecticide_treat
Definition: Treatment.h:111
fp_nc
Definition: Treatment.h:135
fungicide_treat
Definition: Treatment.h:82
struct_Vole_Adult::VPM
Vole_Population_Manager * VPM
Definition: vole_all.h:131
fp_sludge
Definition: Treatment.h:63
Vole_Base::m_DispVector
int m_DispVector
Definition: vole_all.h:194
tovmort_FBck
Definition: VolePopulationManager.h:75
fp_greenmanure
Definition: Treatment.h:62
shallow_harrow
Definition: Treatment.h:119
fa_slurry
Definition: Treatment.h:72
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
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
fa_pks
Definition: Treatment.h:145
tovmort_FLife
Definition: VolePopulationManager.h:83
Vole_Base::m_MinFVoleHabQual
static double m_MinFVoleHabQual
Definition: vole_all.h:216
org_fungicide
Definition: Treatment.h:86
summer_harrow
Definition: Treatment.h:49
Landscape::SupplyDayInYear
int SupplyDayInYear(void)
Passes a request on to the associated Calendar class function, the day in the year.
Definition: Landscape.h:2267
cattle_out
Definition: Treatment.h:95
harvestshoots
Definition: Treatment.h:147
stubble_cultivator_heavy
Definition: Treatment.h:36
Vole_Base::st_Dying
void st_Dying()
All voles end here on death.
Definition: Vole_all.cpp:335
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
Vole_Base::m_Sex
bool m_Sex
Definition: vole_all.h:166
Vole_JuvenileFemale::FreeLocation
void FreeLocation() override
Location map function.
Definition: Vole_all.cpp:1617
glyphosate
Definition: Treatment.h:114
VoleInsecticideMort
const double VoleInsecticideMort
Definition: Vole_all.cpp:196
IDMap::ClearMapValue
void ClearMapValue(unsigned x, unsigned y)
Definition: MovementMap.h:146
CfgInt::value
int value() const
Definition: Configurator.h:116
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
Landscape::EventtypeToString
std::string EventtypeToString(int a_event)
Returns the text representation of a treatment type.
Definition: Landscape.cpp:6024
Population_Manager::UpdateGuardMap
void UpdateGuardMap(int a_x, int a_y, int &a_index_x, int &a_index_y)
Get the index of the guard map for the given location.
Definition: PopulationManager.h:768
Vole_Population_Manager::CreateObjects
void CreateObjects(VoleObject a_obType, TAnimal *a_pvo, struct_Vole_Adult *a_as, int a_number)
Definition: VolePopulationManager.cpp:2756
fp_pks
Definition: Treatment.h:146
fp_ns
Definition: Treatment.h:134
growthperdayF
const double growthperdayF
Definition: Vole_all.cpp:135
bed_forming
Definition: Treatment.h:118
product_treat
Definition: Treatment.h:113
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
tovmort_FStarve
Definition: VolePopulationManager.h:73
autumn_sow
Definition: Treatment.h:41
autumn_harrow
Definition: Treatment.h:37
Vole_Base::m_OurPopulation
Vole_Population_Manager * m_OurPopulation
Definition: vole_all.h:407
fa_calcium
Definition: Treatment.h:79
TAnimal::m_guard_cell_x
int m_guard_cell_x
The index x to the guard cell.
Definition: PopulationManager.h:370
Vole_Base::m_Age
int m_Age
Definition: vole_all.h:170
VolePigGrazingMort
const double VolePigGrazingMort
Definition: Vole_all.cpp:192
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
Vole_Population_Manager::m_VoleRecordMort
VoleSummaryOutput * m_VoleRecordMort
Definition: VolePopulationManager.h:193
Vole_Base::m_BornLastYear
bool m_BornLastYear
A flag set if the female was born the year before.
Definition: vole_all.h:154
fa_rsm
Definition: Treatment.h:78
Vole_Base::m_FemaleTerritoryRangeSlope
static double m_FemaleTerritoryRangeSlope
Definition: vole_all.h:224
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
Vole_Base::m_FatherId
unsigned m_FatherId
Definition: vole_all.h:160
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
Vole_Population_Manager::SupplyGrowthStartDate
int SupplyGrowthStartDate() const
Definition: VolePopulationManager.h:233
fa_manganesesulphate
Definition: Treatment.h:73
Vole_Base::Vole_Base
Vole_Base(struct_Vole_Adult *a_AVoleStruct_ptr)
Constructor for Vole_Base.
Definition: Vole_all.cpp:222
fp_k
Definition: Treatment.h:55
tovmort_FPred
Definition: VolePopulationManager.h:81
Landscape::Warn
void Warn(std::string a_msg1, std::string a_msg2)
Wrapper for the g_msg Warn function.
Definition: Landscape.h:2250
Vole_Base::m_MinFemaleTerritorySize
static unsigned int m_MinFemaleTerritorySize
Definition: vole_all.h:214
autumn_plough
Definition: Treatment.h:34
Vole_Base::MortalityTest
virtual bool MortalityTest()
Do a mortality test.
Definition: Vole_all.cpp:349
Vole_Base::m_TerrRange
int m_TerrRange
Definition: vole_all.h:164
TAnimal::m_Location_x
int m_Location_x
The objects ALMaSS x coordinate.
Definition: PopulationManager.h:362
Landscape::SupplyPolyRef
int SupplyPolyRef(int a_x, int a_y)
Get the in map polygon reference number from the x, y location.
Definition: Landscape.h:2157
fp_slurry
Definition: Treatment.h:58
tovmort_FFarm
Definition: VolePopulationManager.h:77
fiber_covering
Definition: Treatment.h:128
cfg_VoleDDepConst
CfgInt cfg_VoleDDepConst("VOLE_DDEPCONST", CFG_CUSTOM, 4)
summer_sow
Definition: Treatment.h:50
spring_sow_with_ferti
Definition: Treatment.h:115
sleep_all_day
Definition: Treatment.h:33
Vole_Population_Manager::m_VoleMap
IDMap< TAnimal * > * m_VoleMap
Definition: VolePopulationManager.h:276
FemaleMovement
const unsigned FemaleMovement
Definition: Vole_all.cpp:168
strigling_sow
Definition: Treatment.h:107