ALMaSS
1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
|
The class for juvenile male voles. More...
#include <vole_all.h>
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_Manager * | m_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 Landscape * | m_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... | |
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.
Vole_JuvenileMale::Vole_JuvenileMale | ( | struct_Vole_Adult * | p_aVoleStruct | ) |
Vole_JuvenileMale constructor.
References Vole_Base::m_Age, Vole_Base::m_MinMaleTerritorySize, Vole_Base::m_MinTerrRange, Vole_Base::m_Sex, Vole_Base::m_TerrRange, Vole_Base::m_Weight, and WeanedWeight.
|
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.
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().
|
inlineprotected |
|
protected |
|
protected |
JuvenileMale vole dispersal behaviour.
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().
|
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.
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.
|
inlineoverrideprotectedvirtual |
Map location function.
Reimplemented from Vole_Base.
References IDMap< a_type >::ClearMapValue(), TAnimal::m_Location_x, TAnimal::m_Location_y, Vole_Base::m_OurPopulation, and Vole_Population_Manager::m_VoleMap.
Referenced by Dispersal(), Vole_Male::Dispersal(), st_BecomeSubAdult(), Vole_Male::st_Eval_n_Explore(), Step(), and Vole_Male::Step().
|
inlineoverrideprotectedvirtual |
Map location function.
Reimplemented from Vole_Base.
References IDMap< a_type >::GetMapValue(), Vole_Base::m_OurPopulation, and Vole_Population_Manager::m_VoleMap.
Referenced by Vole_Male::st_Eval_n_Explore().
|
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.
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.
|
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().
|
overridevirtual |
Reimplemented from Vole_Base.
Reimplemented in Vole_Male.
References Vole_Base::Init(), Vole_Base::m_Age, Vole_Base::m_MinMaleTerritorySize, Vole_Base::m_MinTerrRange, Vole_Base::m_Sex, Vole_Base::m_TerrRange, Vole_Base::m_Weight, and WeanedWeight.
|
inlineoverrideprotectedvirtual |
Map location function.
Reimplemented from Vole_Base.
References TAnimal::m_Location_x, TAnimal::m_Location_y, Vole_Base::m_OurPopulation, Vole_Population_Manager::m_VoleMap, and IDMap< a_type >::SetMapValue().
Referenced by Dispersal(), Vole_Male::Dispersal(), and Vole_Male::st_Eval_n_Explore().
|
protected |
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().
|
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
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().
|
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.
References g_random_fnc(), MinMaleMovement, and Vole_Base::MoveTo().
Referenced by Step().
|
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.
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().