Loading [MathJax]/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
Vole_Male Class Reference

The class for male voles. More...

#include <vole_all.h>

Inheritance diagram for Vole_Male:
Vole_JuvenileMale Vole_Base TAnimal TALMaSSObject

Public Member Functions

 Vole_Male (struct_Vole_Adult *p_aVoleStruct)
 Vole_Male constructor. More...
 
void ReInit (struct_Vole_Adult *p_aVoleStruct) override
 
 ~Vole_Male () override
 
void Step () override
 Male vole Step. More...
 
void EndStep () override
 Male vole EndStep. More...
 
- Public Member Functions inherited from Vole_JuvenileMale
 Vole_JuvenileMale (struct_Vole_Adult *p_aVoleStruct)
 Vole_JuvenileMale constructor. More...
 
 ~Vole_JuvenileMale () override
 
bool OnFarmEvent (FarmToDo event) override
 JuvenileMale vole exernal event handler. More...
 
void BeginStep () override
 Juvenile Male vole BeginStep. 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 ()
 
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

VoleDispersalReturns Dispersal (double p_OldQual, int p_Distance)
 Male vole dispersal behaviour. More...
 
void DetermineTerritorySize ()
 Calculates the territory size needed for a vole of his weight. More...
 
bool CanFeed () const
 Currently not used. More...
 
int st_Maturation (void) const
 Male vole maturation control. More...
 
void st_Infanticide (void) const
 Male vole infanticide behaviour. More...
 
bool MortalityTest () override
 Do a mortality test. More...
 
TTypeOfVoleState st_Eval_n_Explore (void)
 Male vole main territory assessment behaviour. More...
 
- Protected Member Functions inherited from Vole_JuvenileMale
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 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_Male()

◆ ~Vole_Male()

Vole_Male::~Vole_Male ( )
override
2231  {
2232  // Nothing to do
2233 }

Member Function Documentation

◆ CanFeed()

bool Vole_Male::CanFeed ( ) const
inlineprotected

Currently not used.

Check whether our location is of sufficient quality to allow use to feed, ie. is it over or under min suitable quality (m_MinMVoleHabQual).

2583  {
2585  return false;
2586 }

References Vole_Base::CalculateCarryingCapacity(), cfg_VoleDDepConst, TAnimal::m_Location_x, TAnimal::m_Location_y, Vole_Base::m_MinMVoleHabQual, and CfgInt::value().

◆ DetermineTerritorySize()

void Vole_Male::DetermineTerritorySize ( )
inlineprotected

Calculates the territory size needed for a vole of his weight.

2568  {
2569  if (m_Weight < MinReproWeightM) return;
2571 }

References Vole_Base::m_MaleTerritoryRangeSlope, Vole_Base::m_MinMaleTerritorySize, Vole_Base::m_TerrRange, Vole_Base::m_Weight, and MinReproWeightM.

Referenced by EndStep().

◆ Dispersal()

VoleDispersalReturns Vole_Male::Dispersal ( double  p_OldQual,
int  p_Distance 
)
protected

Male vole dispersal behaviour.

Works like female dispersal - but a return code of 3 will trigger infanticide
Checks p_Distance away to see if it can find a territory in the next MHabQualThreshold 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 increase in the mortality chance when it does this.

2482  {
2483  // int retval = 0;
2484  // p_OldQuatells whether dispersal is conditional on quality or not
2485  // p_OldQual is set to old habitat quality or -1
2486  // p_Distance is the p_Distance used by the move function
2487  // aim is to move in a directed way traversing the landscape using the best
2488  // habitats
2489  // remember the old co-ordinates in case infanticide needs to be triggered
2490  const int oldx = m_Location_x;
2491  const int oldy = m_Location_y;
2492 #ifdef __VOLE_SMALL_LANDSCAPE
2493  m_DispVector = g_random_fnc(8); // Choose direction 0-7
2494 #else
2495  if (m_DispVector == -1) m_DispVector = random(8); // Choose direction 0-7
2496 #endif
2497  // Go that far in that direction (assuming it is possible to do that)
2498  MoveTo(m_DispVector, p_Distance, 10);
2499  // Now we are there so what is the new quality
2500  // 1. Get the carrying capacity
2501  int OldMales = 1;
2502  int NoFemales = 1;
2503  if (m_BreedingSeason)
2504  {
2506  NoFemales = OldMales; // If can be 0 or >0 if OldMales does not return 1
2507  }
2509  if (p_OldQual == -1)
2510  {
2511  // Do an extra mortality test if we are forced to disperse
2513  {
2515  return vdisp_Die;
2516  }
2517  }
2518 
2519  if (CC < p_OldQual || OldMales < 1 || NoFemales < 1)
2520  {
2521  // Don't want to move
2522  FreeLocation();
2523  m_Location_x = oldx;
2524  m_Location_y = oldy;
2526  SetLocation();
2527  return vdisp_CarryOn;
2528  }
2529  if (CC > m_MinMVoleHabQual)
2530  {
2531  m_Have_Territory = true;
2532  if (m_BreedingSeason)
2533  {
2534  if (!m_Mature)
2535  {
2536  return vdisp_Mature; // Will also trigger infanticde
2537  }
2538  if (abs(oldx - m_Location_x) > 2 * m_TerrRange || abs(oldy - m_Location_y) > 2 * m_TerrRange)
2539  {
2540  // Have we moved more than _TerrRange from old home
2541  return vdisp_Infanticide; // This will result in an infanticide attempt if females in the new territory have young and the male has moved outside his old terr range.
2542  }
2543  }
2544  }
2545  return vdisp_CarryOn;
2546 }

References Vole_Base::CalculateCarryingCapacity(), cfg_RecordVoleMort, cfg_VoleDDepConst, VoleSummaryOutput::ChangeData(), Vole_JuvenileMale::FreeLocation(), g_extradispmort, g_rand_uni_fnc(), g_random_fnc(), Vole_Base::m_Age, Vole_Base::m_BreedingSeason, Vole_Base::m_DispVector, TAnimal::m_guard_cell_x, TAnimal::m_guard_cell_y, Vole_Base::m_Have_Territory, TAnimal::m_Location_x, TAnimal::m_Location_y, Vole_Base::m_Mature, Vole_Base::m_MinMVoleHabQual, Vole_Base::m_OurPopulation, Vole_Base::m_TerrRange, Vole_Population_Manager::m_VoleRecordMort, Vole_Base::MoveTo(), Vole_JuvenileMale::SetLocation(), Vole_Population_Manager::SupplyInOlderTerr(), tovmort_MDisp, Population_Manager::UpdateGuardMap(), CfgInt::value(), CfgBool::value(), vdisp_CarryOn, vdisp_Die, vdisp_Infanticide, and vdisp_Mature.

Referenced by st_Eval_n_Explore().

◆ EndStep()

void Vole_Male::EndStep ( void  )
overridevirtual

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_JuvenileMale.

2286  {
2287 #ifdef __VoleStarvationDays
2288  if (m_Have_Territory) m_StarvationDays = 0;
2289  if ( m_StarvationDays > m_MaxStarvationDays)
2290  {
2291  st_Dying();
2293  }
2294  else
2295 #endif
2296  {
2297  CheckManagement();
2298  if (CurrentVState == tovs_MDying) { st_Dying(); }
2299  else
2300  {
2301  m_Age++;
2302  /* MALE GROWTH NOTES
2303 
2304  Male vole grows until 20g. After that he will only grow if he has matured
2305  Growth continues up to 60g.
2306 
2307  Reproduction cannot occur below 40g or 40 days
2308 
2309  Growth only occurs between 1 March and 1st August
2310  taken from Hanson L, 1977, Oikos 29.
2311  */
2312  const int today = m_OurLandscape->SupplyDayInYear();
2313  if (today < GrowStopDate && today > m_OurPopulation->SupplyGrowthStartDate())
2314  {
2315  if (m_Weight < 20) { m_Weight += growthperdayM; }
2316  else if (m_Mature == true && m_Weight < MaxWeightM) { m_Weight += growthperdayM; }
2317  }
2318  else if (today == 1)
2319  {
2320  m_BornLastYear = true;
2321  m_Mature = true;
2322  } // must be true if alive on 1st Jan.
2324  }
2325  }
2326 }

References cfg_RecordVoleMort, VoleSummaryOutput::ChangeData(), TAnimal::CheckManagement(), Vole_Base::CurrentVState, DetermineTerritorySize(), growthperdayM, Vole_Base::m_Age, Vole_Base::m_BornLastYear, Vole_Base::m_Have_Territory, Vole_Base::m_Mature, TAnimal::m_OurLandscape, Vole_Base::m_OurPopulation, Vole_Population_Manager::m_VoleRecordMort, Vole_Base::m_Weight, MaxWeightM, Vole_Base::st_Dying(), Landscape::SupplyDayInYear(), Vole_Population_Manager::SupplyGrowthStartDate(), tovmort_MStarve, tovs_MDying, and CfgBool::value().

◆ MortalityTest()

bool Vole_Male::MortalityTest ( )
overrideprotectedvirtual

Do a mortality test.

Takes both physiological lifespan and background mortality into account to determine whether the vole should die - repeated calls increase the risk of dying

Reimplemented from Vole_Base.

2556  {
2557  // returns true if the vole should die
2558  if (m_Have_Territory) { if (g_rand_uni_fnc() < g_DailyMortChanceMaleTerr) return true; }
2559  else if (g_rand_uni_fnc() < g_DailyMortChance) return true;
2560  return false;
2561 }

References g_DailyMortChance, g_DailyMortChanceMaleTerr, g_rand_uni_fnc(), and Vole_Base::m_Have_Territory.

◆ ReInit()

void Vole_Male::ReInit ( struct_Vole_Adult p_aVoleStruct)
overridevirtual

◆ st_Eval_n_Explore()

TTypeOfVoleState Vole_Male::st_Eval_n_Explore ( void  )
protected

Male vole main territory assessment behaviour.

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

2375  {
2377 
2378  unsigned MovementIndex;
2379  if (m_Age > 90) MovementIndex = 3;
2380  else if (m_Age > 60) MovementIndex = 2;
2381  else if (m_Age > 30) MovementIndex = 1;
2382  else MovementIndex = 0;
2383  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
2384  const int NoFemales = OldMales;
2385  const double Qual = CalculateCarryingCapacity(m_Location_x, m_Location_y, 10000);
2386  //if (OldMales>1) Qual/=OldMales; // Share resources with the females, but no-one else
2387  if (m_BreedingSeason)
2388  {
2389  if (m_Have_Territory) // Must be mature
2390  {
2391 #ifdef __USINGTRAPLINES
2392  CheckTraps();
2393 #endif
2394  if (!m_Mature)
2395  {
2396  return tovs_MMaturation; // Special case, immature male in breeding season with territory will mature
2397  }
2398  // If he his mature then he must move if in an older males territory
2399  bool NoMates = false;
2400  if (NoFemales < 1)
2401  {
2403  {
2405  if (af != nullptr)
2406  {
2407  const AnimalPosition ap = af->SupplyPosition();
2408  int tx = (m_SimW + ap.m_x + (g_random_fnc(2) - 1)) % m_SimW;
2409  int ty = (m_SimH + ap.m_y + (g_random_fnc(2) - 1)) % m_SimH;
2410  while (GetLocation(tx, ty) && MoveQuality(tx, ty) < 1)
2411  {
2412  tx = (m_SimW + tx + (g_random_fnc(2) - 1)) % m_SimW;
2413  ty = (m_SimH + ty + (g_random_fnc(2) - 1)) % m_SimH;
2414  }
2415  FreeLocation();
2416  m_Location_x = tx;
2417  m_Location_y = ty;
2419  SetLocation();
2420  }
2421  else NoMates = true;
2422  }
2423  }
2424  else if ((OldMales < 1 || Qual < m_MinFVoleHabQual || NoMates) && !m_BornLastYear) // In larger males territory, must move or are no females
2425  {
2426  m_Have_Territory = false;
2428  retval = Dispersal(Qual, MaleMovement[MovementIndex]);
2429  }
2430  }
2431  else
2432  {
2433  // No territory & Breeding season
2434 #ifdef __USINGTRAPLINES
2435  CheckTraps();
2436 #endif
2437  // Not quality dependent dispersal, very directed
2438  retval = Dispersal(-1, MaleMovement[MovementIndex]);
2439  }
2440  }
2441  else // Not breeding season
2442  {
2443 #ifdef __USINGTRAPLINES
2444  CheckTraps();
2445 #endif
2446  if (OldMales < 1 || Qual < m_MinFVoleHabQual)
2447  {
2448 #ifdef __VoleStarvationDays
2449  m_StarvationDays++;
2450 #endif
2451  retval = Dispersal(-1, 1 + g_random_fnc(MaleMovement[MovementIndex]));
2452  }
2453  }
2454  // retval now holds the answer to the returning state
2455  switch (retval)
2456  {
2457  case vdisp_Mature:
2458  Setm_Mature();
2459  return tovs_Infanticide;
2460  case vdisp_Infanticide:
2461  return tovs_Infanticide;
2462  case vdisp_Die:
2463  return tovs_MDying;
2464  case vdisp_CarryOn:
2465  default:
2466  return CurrentVState;
2467  }
2468 }

References Vole_Base::CalculateCarryingCapacity(), Vole_Base::CheckTraps(), Vole_Base::CurrentVState, Dispersal(), Vole_Population_Manager::FindClosestFemale(), Vole_JuvenileMale::FreeLocation(), g_NoFemalesMove, g_rand_uni_fnc(), g_random_fnc(), Vole_JuvenileMale::GetLocation(), Vole_Base::m_Age, Vole_Base::m_BornLastYear, Vole_Base::m_BreedingSeason, Vole_Base::m_DispVector, TAnimal::m_guard_cell_x, TAnimal::m_guard_cell_y, Vole_Base::m_Have_Territory, TAnimal::m_Location_x, TAnimal::m_Location_y, Vole_Base::m_Mature, Vole_Base::m_MinFVoleHabQual, Vole_Base::m_OurPopulation, Vole_Base::m_SimH, Vole_Base::m_SimW, Vole_Base::m_TerrRange, AnimalPosition::m_x, AnimalPosition::m_y, MaleMovement, Vole_Base::MoveQuality(), Vole_JuvenileMale::SetLocation(), Vole_Base::Setm_Mature(), Vole_Population_Manager::SupplyInOlderTerr(), TAnimal::SupplyPosition(), tovs_Infanticide, tovs_MDying, tovs_MMaturation, Population_Manager::UpdateGuardMap(), vdisp_CarryOn, vdisp_Die, vdisp_Infanticide, and vdisp_Mature.

Referenced by Step().

◆ st_Infanticide()

void Vole_Male::st_Infanticide ( void  ) const
protected

Male vole infanticide behaviour.

Will only enter here if have taken over a new area a reasonable distance from the old one and will only commit infanticide in 10% of his attempts in his minimum territory range.
Tells the population manager to send an infanticide message to all females in the territory.

2358  {
2360  {
2361  // int SearchInf =(int) m_TerrRange*cfg_InfanticideRangeRelToTerRange.value();
2363  }
2364 }

References cfg_InfanticideProbability, g_rand_uni_fnc(), TAnimal::m_Location_x, TAnimal::m_Location_y, Vole_Base::m_MinTerrRange, Vole_Base::m_OurPopulation, Vole_Base::m_Weight, Vole_Population_Manager::SendMessage(), tovm_Infanticide, and CfgFloat::value().

Referenced by Step().

◆ st_Maturation()

int Vole_Male::st_Maturation ( void  ) const
protected

Male vole maturation control.

Decide whether to become mature or not

2337  {
2340  return 0; // don't mature
2341  return 1;
2342  // matures
2343 }

References TAnimal::m_OurLandscape, Vole_Base::m_OurPopulation, Landscape::SupplyDayInYear(), and Vole_Population_Manager::SupplyGrowthStartDate().

Referenced by Step().

◆ Step()

void Vole_Male::Step ( void  )
overridevirtual

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_JuvenileMale.

2246  {
2247  if (m_StepDone || m_CurrentStateNo == -1) return;
2248  switch (CurrentVState)
2249  {
2250  case tovs_InitialState: //initial state
2252  break;
2253  case tovs_MMaturation: // Maturation
2254  if (st_Maturation()) Setm_Mature();
2255  CurrentVState = tovs_MEvaluateExplore; // Eval and Explore
2256  break;
2257  case tovs_MEvaluateExplore: // Eval&Explore
2259  m_StepDone = true;
2260  break;
2261  case tovs_Infanticide: // Infanticide
2262  st_Infanticide();
2264  break;
2265  case tovs_MDying:
2266  FreeLocation();
2267  m_StepDone = true;
2268  break;
2269  default:
2270  m_OurLandscape->Warn("Vole_Male::Step - unknown return error", nullptr);
2271  exit(1);
2272  }
2273 }

References Vole_Base::CurrentVState, Vole_JuvenileMale::FreeLocation(), TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, Vole_Base::Setm_Mature(), st_Eval_n_Explore(), st_Infanticide(), st_Maturation(), tovs_Infanticide, tovs_InitialState, 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
g_rand_uni_fnc
double g_rand_uni_fnc()
Definition: ALMaSS_Random.cpp:56
TAnimal::SupplyPosition
AnimalPosition SupplyPosition() const
Returns the objects location and habitat type and veg type.
Definition: PopulationManager.cpp:1533
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
tovs_MDying
Definition: vole_all.h:61
Vole_Base::m_MinTerrRange
unsigned int m_MinTerrRange
Definition: vole_all.h:156
Vole_Base::MoveTo
void MoveTo(int p_Vector, int p_Distance, int iterations)
Movement.
Definition: Vole_all.cpp:883
Vole_Base::m_BirthYear
int m_BirthYear
Definition: vole_all.h:149
Vole_Base::CheckTraps
void CheckTraps()
Definition: Vole_all.cpp:2590
Vole_Base::MoveQuality
int MoveQuality(int p_x, int p_y) const
Test a location for quality while moving.
Definition: Vole_all.cpp:1186
Vole_Population_Manager::FindClosestFemale
Vole_Female * FindClosestFemale(int p_x, int p_y, int p_steps) const
Definition: VolePopulationManager.cpp:1602
Vole_Base::m_Mature
bool m_Mature
Definition: vole_all.h:168
tovm_Infanticide
Definition: VolePopulationManager.h:64
TAnimal::m_guard_cell_y
int m_guard_cell_y
The index y to the guard cell.
Definition: PopulationManager.h:374
MinReproWeightM
const unsigned MinReproWeightM
Definition: Vole_all.cpp:143
Vole_Base::Setm_Mature
void Setm_Mature()
Definition: vole_all.h:297
VoleSummaryOutput::ChangeData
void ChangeData(int a_data, int a_value)
Definition: VolePopulationManager.cpp:3302
CfgFloat::value
double value() const
Definition: Configurator.h:142
cfg_InfanticideProbability
static CfgFloat cfg_InfanticideProbability("INFANTI_PROBA", CFG_CUSTOM, 0.01)
MaleMovement
const unsigned MaleMovement[4]
Definition: Vole_all.cpp:173
g_extradispmort
double g_extradispmort
Definition: Vole_all.cpp:198
AnimalPosition::m_x
unsigned m_x
Definition: PopulationManager.h:173
tovs_Infanticide
Definition: vole_all.h:60
g_NoFemalesMove
double g_NoFemalesMove
Definition: Vole_all.cpp:199
Vole_Population_Manager::SendMessage
void SendMessage(TTypeOfVoleMessage p_message, unsigned p_x, unsigned p_y, unsigned p_range, bool p_sex, double p_Weight)
Definition: VolePopulationManager.cpp:2711
struct_Vole_Adult::weight
double weight
Definition: vole_all.h:120
Vole_JuvenileMale::FreeLocation
void FreeLocation() override
Map location function.
Definition: Vole_all.cpp:2861
tovs_InitialState
Definition: vole_all.h:55
Vole_Base::m_Have_Territory
bool m_Have_Territory
Definition: vole_all.h:196
Vole_Base::m_Weight
double m_Weight
Definition: vole_all.h:184
CfgBool::value
bool value() const
Definition: Configurator.h:164
MaxWeightM
const double MaxWeightM
Definition: Vole_all.cpp:127
Vole_Female
The class for female voles.
Definition: vole_all.h:578
Vole_Male::st_Maturation
int st_Maturation(void) const
Male vole maturation control.
Definition: Vole_all.cpp:2337
VoleDispersalReturns
VoleDispersalReturns
Definition: vole_all.h:74
Vole_Base::m_SimH
int m_SimH
Definition: vole_all.h:202
Vole_Base::CalculateCarryingCapacity
double CalculateCarryingCapacity(int x, int y, int a_ddep) const
Definition: Vole_all.cpp:369
Vole_Base::m_MaleTerritoryRangeSlope
static double m_MaleTerritoryRangeSlope
Definition: vole_all.h:222
cfg_RecordVoleMort
CfgBool cfg_RecordVoleMort
TAnimal::m_Location_y
int m_Location_y
The objects ALMaSS y coordinate.
Definition: PopulationManager.h:366
g_DailyMortChance
double g_DailyMortChance
Definition: Vole_all.cpp:183
TAnimal::m_OurLandscape
static Landscape * m_OurLandscape
A pointer to the landscape object shared with all TAnimal objects.
Definition: PopulationManager.h:342
vdisp_CarryOn
Definition: vole_all.h:75
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
vdisp_Die
Definition: vole_all.h:76
AnimalPosition
A class defining an animals position.
Definition: PopulationManager.h:169
Vole_Base::m_DispVector
int m_DispVector
Definition: vole_all.h:194
Vole_JuvenileMale::SetLocation
void SetLocation() override
Map location function.
Definition: Vole_all.cpp:2854
tovmort_MDisp
Definition: VolePopulationManager.h:78
struct_Vole_Adult::BirthYear
int BirthYear
Definition: vole_all.h:126
Vole_Base::m_MinFVoleHabQual
static double m_MinFVoleHabQual
Definition: vole_all.h:216
Landscape::SupplyDayInYear
int SupplyDayInYear(void)
Passes a request on to the associated Calendar class function, the day in the year.
Definition: Landscape.h:2267
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
Vole_Base::m_SimW
int m_SimW
Definition: vole_all.h:202
Vole_Base::m_Sex
bool m_Sex
Definition: vole_all.h:166
CfgInt::value
int value() const
Definition: Configurator.h:116
Vole_Male::st_Infanticide
void st_Infanticide(void) const
Male vole infanticide behaviour.
Definition: Vole_all.cpp:2358
AnimalPosition::m_y
unsigned m_y
Definition: PopulationManager.h:174
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_Male::DetermineTerritorySize
void DetermineTerritorySize()
Calculates the territory size needed for a vole of his weight.
Definition: Vole_all.cpp:2568
vdisp_Infanticide
Definition: vole_all.h:78
Vole_JuvenileMale::Vole_JuvenileMale
Vole_JuvenileMale(struct_Vole_Adult *p_aVoleStruct)
Vole_JuvenileMale constructor.
Definition: Vole_all.cpp:3084
Vole_Base::m_OurPopulation
Vole_Population_Manager * m_OurPopulation
Definition: vole_all.h:407
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
Vole_Base::m_MinMVoleHabQual
static double m_MinMVoleHabQual
Definition: vole_all.h:220
Vole_Population_Manager::SupplyInOlderTerr
int SupplyInOlderTerr(unsigned p_x, unsigned p_y, unsigned p_Age, unsigned p_Range) const
Definition: VolePopulationManager.cpp:2370
Vole_Population_Manager::m_VoleRecordMort
VoleSummaryOutput * m_VoleRecordMort
Definition: VolePopulationManager.h:193
Vole_JuvenileMale::GetLocation
bool GetLocation(int px, int py) override
Map location function.
Definition: Vole_all.cpp:2868
Vole_Base::m_BornLastYear
bool m_BornLastYear
A flag set if the female was born the year before.
Definition: vole_all.h:154
g_random_fnc
int g_random_fnc(const int a_range)
Definition: ALMaSS_Random.cpp:74
TALMaSSObject::m_CurrentStateNo
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:131
Vole_Population_Manager::SupplyGrowthStartDate
int SupplyGrowthStartDate() const
Definition: VolePopulationManager.h:233
tovs_MMaturation
Definition: vole_all.h:58
tovmort_MStarve
Definition: VolePopulationManager.h:72
g_DailyMortChanceMaleTerr
double g_DailyMortChanceMaleTerr
Definition: Vole_all.cpp:184
vdisp_Mature
Definition: vole_all.h:77
Landscape::Warn
void Warn(std::string a_msg1, std::string a_msg2)
Wrapper for the g_msg Warn function.
Definition: Landscape.h:2250
struct_Vole_Adult::age
int age
Definition: vole_all.h:119
Vole_Male::st_Eval_n_Explore
TTypeOfVoleState st_Eval_n_Explore(void)
Male vole main territory assessment behaviour.
Definition: Vole_all.cpp:2375
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
Vole_Male::Dispersal
VoleDispersalReturns Dispersal(double p_OldQual, int p_Distance)
Male vole dispersal behaviour.
Definition: Vole_all.cpp:2482
Vole_Base::m_BreedingSeason
static bool m_BreedingSeason
Definition: vole_all.h:239
cfg_VoleDDepConst
CfgInt cfg_VoleDDepConst("VOLE_DDEPCONST", CFG_CUSTOM, 4)
tovs_MEvaluateExplore
Definition: vole_all.h:59