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

The class for juvenile male voles. More...

#include <vole_all.h>

Inheritance diagram for Vole_JuvenileMale:
Vole_Base TAnimal TALMaSSObject Vole_Male

Public Member Functions

 Vole_JuvenileMale (struct_Vole_Adult *p_aVoleStruct)
 Vole_JuvenileMale constructor. More...
 
 ~Vole_JuvenileMale () override
 
void ReInit (struct_Vole_Adult *p_aVoleStruct) override
 
bool OnFarmEvent (FarmToDo event) override
 JuvenileMale vole exernal event handler. More...
 
void BeginStep () override
 Juvenile Male vole BeginStep. More...
 
void Step () override
 Juvenile Male vole Step. More...
 
void EndStep () override
 Juvenile Male vole EndStep. More...
 
void OnKilled () override
 JuvenileMale vole death by 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

void SetLocation () override
 Map location function. More...
 
void FreeLocation () override
 Map location function. More...
 
bool GetLocation (int px, int py) override
 Map location function. More...
 
TTypeOfVoleState Dispersal (double p_OldQual, int p_Distance)
 JuvenileMale vole dispersal behaviour. More...
 
void DetermineTerritorySize ()
 
bool CanFeed ()
 
void st_JuvenileExplore (void)
 Extra movement on weaning. More...
 
void st_BecomeSubAdult (void)
 
TTypeOfVoleState st_Eval_n_Explore (void)
 JuvenileMale vole main territory assessment behaviour. 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 juvenile male voles.

Contains all the behaviour specific to the male vole. Only st_Infanticide and st_JuvenileExplore are specific to the male, other behaviours differ only in details from the female.

Constructor & Destructor Documentation

◆ Vole_JuvenileMale()

Vole_JuvenileMale::Vole_JuvenileMale ( struct_Vole_Adult p_aVoleStruct)

◆ ~Vole_JuvenileMale()

Vole_JuvenileMale::~Vole_JuvenileMale ( )
override
3105  {
3106  // Nothing to do
3107 }

Member Function Documentation

◆ BeginStep()

void Vole_JuvenileMale::BeginStep ( void  )
overridevirtual

Juvenile Male 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.

Reimplemented from Vole_Base.

2882  {
2883  if (MortalityTest())
2884  {
2887  m_StepDone = true;
2888  }
2889  else
2890  {
2891  if (--m_LifeSpan < 1)
2892  {
2895  m_StepDone = true;
2896  }
2897  }
2898 #ifdef __VOLEPESTICIDEON
2899  PesticideIngestion();
2900  ActOnPesticideDose();
2901 #endif
2902 }

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_MBck, tovmort_MLife, tovs_MDying, and CfgBool::value().

◆ CanFeed()

bool Vole_JuvenileMale::CanFeed ( )
inlineprotected

◆ DetermineTerritorySize()

void Vole_JuvenileMale::DetermineTerritorySize ( )
protected

◆ Dispersal()

TTypeOfVoleState Vole_JuvenileMale::Dispersal ( double  p_OldQual,
int  p_Distance 
)
protected

JuvenileMale vole dispersal behaviour.

3007  {
3009  {
3011  return tovs_MDying;
3012  }
3013  // Returns 1 for die, 0 for carry on
3014  if (m_DispVector == -1) m_DispVector = g_random_fnc(8); // Choose direction 0-7
3015  // Go that far in that direction (assuming it is possible to do that)
3016  const int oldx = m_Location_x;
3017  const int oldy = m_Location_y;
3018  MoveTo(m_DispVector, p_Distance, 10);
3019  // Now we are there so what is the new quality
3020  // 1. Get the carrying capacity
3022  if (CC <= p_OldQual)
3023  {
3024  // Don't want to move
3025  FreeLocation();
3026  m_Location_x = oldx;
3027  m_Location_y = oldy;
3029  SetLocation();
3030  }
3031  return tovs_MEvaluateExplore;
3032 }

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_MDisp, tovs_MDying, tovs_MEvaluateExplore, Population_Manager::UpdateGuardMap(), CfgInt::value(), and CfgBool::value().

Referenced by st_Eval_n_Explore().

◆ EndStep()

void Vole_JuvenileMale::EndStep ( void  )
overridevirtual

Juvenile Male vole EndStep.

The EndStep is 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.

Reimplemented in Vole_Male.

2955  {
2956  CheckManagement();
2957  if (CurrentVState == tovs_MDying) { st_Dying(); }
2958  else
2959  {
2960  m_Age++;
2963  if (m_OurLandscape->SupplyDayInYear() == 1)
2964  {
2965  m_BornLastYear = true; // must be true if alive on 1st Jan.
2966  }
2967  }
2968 }

References TAnimal::CheckManagement(), Vole_Base::CurrentVState, growthperdayM, Vole_Base::m_Age, Vole_Base::m_BornLastYear, TAnimal::m_OurLandscape, Vole_Base::m_Weight, MinReproAgeM, Vole_Base::st_Dying(), Landscape::SupplyDayInYear(), tovs_MDying, and tovs_MMaturation.

◆ FreeLocation()

◆ GetLocation()

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

Map location function.

Reimplemented from Vole_Base.

2868  {
2869  if (m_OurPopulation->m_VoleMap->GetMapValue(px, py) != nullptr) return true;
2870  return false;
2871 };

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

Referenced by Vole_Male::st_Eval_n_Explore().

◆ OnFarmEvent()

bool Vole_JuvenileMale::OnFarmEvent ( FarmToDo  event)
overridevirtual

JuvenileMale vole exernal 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.
This method is inherited by the adult male class

Reimplemented from TAnimal.

2687  {
2688  switch (event)
2689  {
2690  case sleep_all_day:
2691  break;
2692 //Here begins soilcultivation mortality
2693  case autumn_harrow:
2695  case autumn_plough:
2696  case autumn_roll:
2697  case autumn_sow:
2698  case autumn_sow_with_ferti:
2699  case burn_straw_stubble:
2700  case burn_top:
2701  case flammebehandling:
2702  case deep_ploughing:
2704  case hilling_up:
2705  case preseeding_cultivator:
2707  case row_cultivation:
2708  case spring_harrow:
2709  case spring_plough:
2710  case spring_roll:
2711  case spring_sow:
2712  case spring_sow_with_ferti:
2713  case strigling_hill:
2714  case strigling_sow:
2716  case stubble_harrowing:
2717  case stubble_plough:
2718  case summer_harrow:
2719  case summer_plough:
2720  case summer_sow:
2721  case winter_harrow:
2722  case winter_plough:
2723  case bed_forming:
2724  case shallow_harrow:
2725  case shredding:
2728  break;
2729  //Here begins harvest mortality
2730  case swathing:
2731  case straw_removal:
2732  case straw_chopping:
2733  case straw_covering:
2734  case fiber_covering:
2735  case fiber_removal:
2736  case mow:
2737  case hay_bailing:
2738  case hay_turning:
2739  case harvest:
2740  case cut_to_hay:
2741  case cut_to_silage:
2742  case cut_weeds:
2743  case bulb_harvest:
2744  case flower_cutting:
2745  case green_harvest:
2746  case harvest_bushfruit:
2747  case harvestshoots:
2750  break;
2751  //Here begins grazing mortality
2752  case pigs_out:
2755  break;
2756  //Here begins strigling mortality
2757  case strigling:
2760  break;
2761  // Here begins insecticide mortality
2762  case syninsecticide_treat: /*\todo I added it because it was so for male, was there a reason it wasn't a mortality for female? */
2763  case insecticide_treat:
2766  break;
2767  // Here begins herbicide mortality
2768  case herbicide_treat: /*\todo I added it because it was so for male, was there a reason it wasn't a mortality for female? */
2771  break;
2772  //Here begins non-mortality events
2773  case biocide:
2774  case fa_ammoniumsulphate:
2775  case fa_boron:
2776  case fa_calcium:
2777  case fa_cu:
2778  case fa_greenmanure:
2779  case fa_k:
2780  case fa_manganesesulphate:
2781  case fa_manure:
2782  case fa_n:
2783  case fa_nk:
2784  case fa_npk:
2785  case fa_npks:
2786  case fa_p:
2787  case fa_pk:
2788  case fa_pks:
2789  case fa_rsm:
2790  case fa_sk:
2791  case fa_sludge:
2792  case fa_slurry:
2793  case fp_ammoniumsulphate:
2794  case fp_boron:
2795  case fp_calcium:
2796  case fp_cu:
2797  case fp_greenmanure:
2798  case fp_k:
2799  case fp_liquidNH3:
2800  case fp_manganesesulphate:
2801  case fp_manure:
2802  case fp_n:
2803  case fp_nc:
2804  case fp_nk:
2805  case fp_npk:
2806  case fp_npks:
2807  case fp_ns:
2808  case fp_p:
2809  case fp_pk:
2810  case fp_pks:
2811  case fp_rsm:
2812  case fp_sk:
2813  case fp_sludge:
2814  case fp_slurry:
2815  case fungicide_treat:
2816  case glyphosate:
2817  case molluscicide:
2818  case org_fungicide:
2819  case org_herbicide:
2820  case org_insecticide:
2821  case last_treatment:
2822  case pheromone:
2823  case trial_control:
2825  case trial_toxiccontrol:
2826  case product_treat:
2827  case cattle_out:
2828  case cattle_out_low:
2829  case water:
2830  case manual_weeding:
2831  case pruning:
2832  case suckering:
2833  case growth_regulator:
2834  break;
2835  default:
2836  g_msg->Warn(WARN_FILE, "Vole_JuvenileMale::OnFarmEvent(): Unknown event type:",
2838  exit(1);
2839  }
2840  if (CurrentVState == tovs_MDying)
2841  {
2843  return true;
2844  }
2845  return false;
2846 }

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_MFarm, tovs_MDying, 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_JuvenileMale::OnKilled ( )
overridevirtual

JuvenileMale vole death by external entity.

Response to external death event - most likely 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_MPred, tovs_MDying, and CfgBool::value().

◆ ReInit()

void Vole_JuvenileMale::ReInit ( struct_Vole_Adult p_aVoleStruct)
overridevirtual

◆ SetLocation()

void Vole_JuvenileMale::SetLocation ( )
inlineoverrideprotectedvirtual

◆ st_BecomeSubAdult()

void Vole_JuvenileMale::st_BecomeSubAdult ( void  )
protected
3035  {
3036  const auto av = new struct_Vole_Adult;
3037  av->VPM = m_OurPopulation;
3038  av->L = m_OurLandscape;
3039  if (m_MyGenes.GetDirectFlag() == 0) av->m_dflag = false;
3040  else av->m_flag = true;
3041  if (m_MyGenes.GetGeneticFlag() == 0) av->m_gflag = false;
3042  else av->m_gflag = true;
3043  av->m_flag = true; // Used to signal pesticide effect to CreateObjects
3044  // Create the new voles (50% chance of male/female)
3048  av->FatherId = m_FatherId;
3049  av->MotherId = m_MotherId;
3050  av->x = m_Location_x;
3051  av->y = m_Location_y;
3052  av->weight = m_Weight;
3053  // Do the genetics
3054  av->Genes = m_MyGenes;
3055  av->age = m_Age;
3056  m_OurPopulation->CreateObjects(vob_Male, this, av, 1);
3057  // Remove the current object
3059  FreeLocation();
3060  m_CurrentStateNo = -1;
3061  m_StepDone = true;
3062 }

References Vole_Population_Manager::CreateObjects(), Vole_Base::CurrentVState, FreeLocation(), GeneticMaterial::GetDirectFlag(), GeneticMaterial::GetGeneticFlag(), 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_MDying, vob_Male, and struct_Vole_Adult::VPM.

Referenced by Step().

◆ st_Eval_n_Explore()

TTypeOfVoleState Vole_JuvenileMale::st_Eval_n_Explore ( void  )
protected

JuvenileMale vole main territory assessment behaviour.

Evaluates the quality of his habitat and does some limited exploration in the surrounding area to see if he can improve it by moving.
Returns 1 if it has died of extra dispersal mortality or starvation

2981  {
2982 #ifdef __USINGTRAPLINES
2983  CheckTraps();
2984 #endif
2987  bool NoMates = false;
2988  if (NoFemales < 1) if (g_rand_uni_fnc() < g_NoFemalesMove) NoMates = true;
2989  //if (NoFemales<1) NoMates = true;
2990  const int OldMales = m_OurPopulation->SupplyInOlderTerr(m_Location_x, m_Location_y, m_Age, m_TerrRange); // returns -1 if a male has p_x,p_y in his territory and is older than p_Age else returns the number of females present
2991  if (Qual < m_MinJMVoleHabQual || OldMales < 1 || NoMates)
2992  //if ((Qual < m_MinJMVoleHabQual) || (OldMales < 1))
2993  {
2995  // Not quality dependent dispersal, very directed
2996  return Dispersal(-1, g_random_fnc(MaleMovement[0]) + 1);
2997  }
2998  return Dispersal(Qual, 1 + g_random_fnc(MaleMovement[0]) + 1);
2999 }

References Vole_Base::CalculateCarryingCapacity(), cfg_VoleDDepConst, Vole_Base::CheckTraps(), Dispersal(), g_NoFemalesMove, g_rand_uni_fnc(), g_random_fnc(), Vole_Base::m_Age, Vole_Base::m_DispVector, TAnimal::m_Location_x, TAnimal::m_Location_y, Vole_Base::m_MinJMVoleHabQual, Vole_Base::m_OurPopulation, Vole_Base::m_TerrRange, MaleMovement, Vole_Population_Manager::SupplyCountFemales(), Vole_Population_Manager::SupplyInOlderTerr(), and CfgInt::value().

Referenced by Step().

◆ st_JuvenileExplore()

void Vole_JuvenileMale::st_JuvenileExplore ( void  )
protected

Extra movement on weaning.

Cause the vole to do some exploration on maturity, just to move him away from the litter centre.
After this first day he will go into the normal Eval_n_Explore.

2673  {
2674  // Just do some movement at first
2676 }

References g_random_fnc(), MinMaleMovement, and Vole_Base::MoveTo().

Referenced by Step().

◆ Step()

void Vole_JuvenileMale::Step ( void  )
overridevirtual

Juvenile Male 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.

Reimplemented from Vole_Base.

Reimplemented in Vole_Male.

2915  {
2916  if (m_StepDone || m_CurrentStateNo == -1) return;
2917  switch (CurrentVState)
2918  {
2919  case tovs_InitialState: //initial state
2921  break;
2922  case tovs_JuvenileExploration: // Juvenile Exploration
2925  m_StepDone = true;
2926  break;
2927  case tovs_MEvaluateExplore: // Eval&Explore
2929  m_StepDone = true;
2930  break;
2931  case tovs_MMaturation:
2933  break;
2934  case tovs_MDying:
2935  FreeLocation();
2936  m_StepDone = true;
2937  break;
2938  default:
2939  m_OurLandscape->Warn("Vole_JuvenileMale::Step - unknown return error", nullptr);
2940  exit(1);
2941  }
2942 }

References Vole_Base::CurrentVState, FreeLocation(), TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, st_BecomeSubAdult(), st_Eval_n_Explore(), st_JuvenileExplore(), tovs_InitialState, tovs_JuvenileExploration, tovs_MDying, tovs_MEvaluateExplore, tovs_MMaturation, and Landscape::Warn().


The documentation for this class was generated from the following files:
growthperdayM
const double growthperdayM
Definition: Vole_all.cpp:133
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
MinReproAgeM
int MinReproAgeM
Definition: Vole_all.cpp:139
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
tovmort_MPred
Definition: VolePopulationManager.h:80
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
tovs_MDying
Definition: vole_all.h:61
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
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
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
Vole_JuvenileMale::st_Eval_n_Explore
TTypeOfVoleState st_Eval_n_Explore(void)
JuvenileMale vole main territory assessment behaviour.
Definition: Vole_all.cpp:2981
TAnimal::m_guard_cell_y
int m_guard_cell_y
The index y to the guard cell.
Definition: PopulationManager.h:374
Vole_JuvenileMale::Dispersal
TTypeOfVoleState Dispersal(double p_OldQual, int p_Distance)
JuvenileMale vole dispersal behaviour.
Definition: Vole_all.cpp:3007
fp_manure
Definition: Treatment.h:61
herbicide_treat
Definition: Treatment.h:80
fp_ammoniumsulphate
Definition: Treatment.h:60
flammebehandling
Definition: Treatment.h:90
tovmort_MLife
Definition: VolePopulationManager.h:82
straw_covering
Definition: Treatment.h:123
VoleSoilCultivationMort
const double VoleSoilCultivationMort
Definition: Vole_all.cpp:190
fp_boron
Definition: Treatment.h:131
tovmort_MFarm
Definition: VolePopulationManager.h:76
vob_Male
Definition: vole_all.h:97
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
Vole_Base::m_MinJMVoleHabQual
static double m_MinJMVoleHabQual
Definition: vole_all.h:218
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
MaleMovement
const unsigned MaleMovement[4]
Definition: Vole_all.cpp:173
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
g_NoFemalesMove
double g_NoFemalesMove
Definition: Vole_all.cpp:199
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
Vole_JuvenileMale::FreeLocation
void FreeLocation() override
Map location function.
Definition: Vole_all.cpp:2861
hay_turning
Definition: Treatment.h:100
last_treatment
Definition: Treatment.h:150
straw_removal
Definition: Treatment.h:124
tovs_InitialState
Definition: vole_all.h:55
GeneticMaterial::GetDirectFlag
uint32 GetDirectFlag()
Definition: GeneticMaterial.cpp:188
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
tovs_JuvenileExploration
Definition: vole_all.h:57
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
VoleStriglingMort
const double VoleStriglingMort
Definition: Vole_all.cpp:188
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
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
cfg_RecordVoleMort
CfgBool cfg_RecordVoleMort
Vole_Population_Manager::SupplyCountFemales
int SupplyCountFemales(unsigned p_x, unsigned p_y, unsigned p_TerrRange) const
Definition: VolePopulationManager.cpp:2238
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
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
Vole_Base::m_MinMaleTerritorySize
static unsigned int m_MinMaleTerritorySize
Definition: vole_all.h:212
syninsecticide_treat
Definition: Treatment.h:111
MinMaleMovement
const unsigned MinMaleMovement
Definition: Vole_all.cpp:175
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
fp_greenmanure
Definition: Treatment.h:62
shallow_harrow
Definition: Treatment.h:119
fa_slurry
Definition: Treatment.h:72
GeneticMaterial::GetGeneticFlag
uint32 GetGeneticFlag()
Definition: GeneticMaterial.cpp:184
Vole_JuvenileMale::SetLocation
void SetLocation() override
Map location function.
Definition: Vole_all.cpp:2854
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
tovmort_MDisp
Definition: VolePopulationManager.h:78
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
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
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
bed_forming
Definition: Treatment.h:118
Vole_JuvenileMale::st_BecomeSubAdult
void st_BecomeSubAdult(void)
Definition: Vole_all.cpp:3035
product_treat
Definition: Treatment.h:113
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
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
Vole_Population_Manager::SupplyInOlderTerr
int SupplyInOlderTerr(unsigned p_x, unsigned p_y, unsigned p_Age, unsigned p_Range) const
Definition: VolePopulationManager.cpp:2370
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
tovmort_MBck
Definition: VolePopulationManager.h:74
fa_rsm
Definition: Treatment.h:78
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
fa_manganesesulphate
Definition: Treatment.h:73
tovs_MMaturation
Definition: vole_all.h:58
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
Landscape::Warn
void Warn(std::string a_msg1, std::string a_msg2)
Wrapper for the g_msg Warn function.
Definition: Landscape.h:2250
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
fiber_covering
Definition: Treatment.h:128
cfg_VoleDDepConst
CfgInt cfg_VoleDDepConst("VOLE_DDEPCONST", CFG_CUSTOM, 4)
summer_sow
Definition: Treatment.h:50
tovs_MEvaluateExplore
Definition: vole_all.h:59
spring_sow_with_ferti
Definition: Treatment.h:115
Vole_JuvenileMale::st_JuvenileExplore
void st_JuvenileExplore(void)
Extra movement on weaning.
Definition: Vole_all.cpp:2673
sleep_all_day
Definition: Treatment.h:33
Vole_Population_Manager::m_VoleMap
IDMap< TAnimal * > * m_VoleMap
Definition: VolePopulationManager.h:276
strigling_sow
Definition: Treatment.h:107