ALMaSS
1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
|
The class for female voles. More...
#include <vole_all.h>
Public Member Functions | |
Vole_JuvenileFemale (struct_Vole_Adult *p_aVoleStruct) | |
Vole_JuvenileFemale constructor. More... | |
void | ReInit (struct_Vole_Adult *p_aVoleStruct) override |
~Vole_JuvenileFemale () override | |
bool | OnFarmEvent (FarmToDo event) override |
External event handler. More... | |
void | BeginStep () override |
Female vole BeginStep. More... | |
void | Step () override |
JuvenileFemale vole Step. More... | |
void | EndStep () override |
Female vole EndStep. More... | |
void | OnKilled () override |
Death from external entity. More... | |
Public Member Functions inherited from Vole_Base | |
Vole_Base (struct_Vole_Adult *a_AVoleStruct_ptr) | |
Constructor for Vole_Base. More... | |
~Vole_Base () override | |
virtual void | Init (struct_Vole_Adult *a_AVoleStruct_ptr) |
void | st_Dying () |
All voles end here on death. More... | |
void | SetBreedingSeason (bool a_flag) |
Set Breeding Season flag. More... | |
void | SetWeight (double W) |
void | Setm_Mature () |
void | Set_BirthYear (int BirthYear) |
void | Set_MotherId (unsigned MotherIdNo) |
void | Set_FatherId (unsigned FatherIdNo) |
void | Set_NoYoungTot (int a_NoOfYoung) |
void | Set_XBorn (int a_Location_x) |
void | Set_YBorn (int a_Location_y) |
void | Set_ElemBorn (int a_Location_x, int a_Location_y) |
void | Set_VegBorn (int a_Location_x, int a_Location_y) |
void | Set_PolyRefBorn (int a_Location_x, int a_Location_y) |
void | Set_Age (int Age) |
int | WhatState () override |
bool | SupplyBornLastYear () |
Were we born this year? More... | |
bool | SupplyTerritorial () |
int | SupplyFatherId () |
int | SupplyMotherId () |
bool | SupplySex () |
int | SupplyBirthYear () |
int | SupplyTotNoYoung () |
int | SupplyXBorn () |
int | SupplyYBorn () |
int | SupplyPolyRefBorn () |
int | SupplyElemBorn () |
TTypesOfLandscapeElement | SupplyElemType () |
int | SupplyVegBorn () |
int | SupplyTerrRange () |
double | SupplyWeight () |
int | SupplyIDNo () |
bool | SupplyMature () |
int | SupplyDeathCause () |
unsigned | SupplyAge () |
unsigned | SupplyX () |
unsigned | SupplyY () |
bool | SupplyInTrap () |
InTrapPosition | SupplyTrapPosition () |
void | SetFree () |
int | SupplyHomoZyg () |
int | SupplyHeteroZyg () |
int | SupplyAllele (int locus, int allele) |
uint32 | SupplyMyAllele (int i, int j) |
int | GetGeneticFlag () |
int | GetDirectFlag () |
void | SetGeneticFlag () |
void | SetDirectFlag () |
void | UnsetGeneticFlag () |
void | UnsetDirectFlag () |
GeneticMaterial | SupplyGenes () |
virtual bool | MortalityTest () |
Do a mortality test. More... | |
void | CopyMyself (VoleObject a_vole) |
Duplicates a vole. More... | |
void | SetFertile (bool f) |
Set the male vole fertility. More... | |
bool | GetFertile () |
Get the male vole fertility. More... | |
Public Member Functions inherited from TAnimal | |
TAnimal (int x, int y, Landscape *L) | |
The TAnimal constructor saving the x,y, location and the landscape pointer. More... | |
TAnimal (int x, int y) | |
The TAnimal constructor saving the x,y used if landscape is already set. More... | |
void | SetGuardMapIndex (int a_index_x, int a_index_y) |
Set the guard map index, this is used to avoid two animals operating in the same location when using multithread. More... | |
unsigned | SupplyFarmOwnerRef () const |
Get the current location farm ref if any. More... | |
AnimalPosition | SupplyPosition () const |
Returns the objects location and habitat type and veg type. More... | |
APoint | SupplyPoint () const |
Returns the objects location in ALMaSS coordinates. More... | |
int | SupplyPolygonRef () const |
Returns the polygon reference where the object is located. More... | |
TTypesOfLandscapeElement | SupplyPolygonType () const |
Returns the polygon type where the object is located. More... | |
int | Supply_m_Location_x () const |
Returns the ALMaSS x-coordinate. More... | |
int | Supply_m_Location_y () const |
Returns the ALMaSS y-coordinate. More... | |
int | SupplyGuardCellX () const |
Returns the x-index to the guard cell. More... | |
int | SupplyGuardCellY () const |
Returns the y-index to the guard cell. More... | |
int | SupplyAge () const |
Returns the animals age in days. More... | |
void | SetAge (int a_age) |
Sets the animals age in days. More... | |
virtual void | KillThis () |
Sets all parameters ready for object destruction. More... | |
virtual void | CopyMyself () |
Used to copy the object details to another in descendent classes. More... | |
void | SetX (const int a_x) |
Sets the x-coordinate. More... | |
void | SetY (const int a_y) |
Sets the y-coordinate. More... | |
virtual void | ReinitialiseObject (int a_x, int a_y, Landscape *a_l_ptr) |
virtual void | ReinitialiseObject (int a_x, int a_y) |
Used to re-use an object - must be implemented in descendent classes. More... | |
virtual void | Dying () |
A wrapped for KillThis - ideally should not be used. More... | |
void | CheckManagement () |
Used to start a check for any management related effects at the objects current location. More... | |
void | CheckManagementXY (int a_x, int a_y) |
Used to start a check for any management related effects at x,y. More... | |
Public Member Functions inherited from TALMaSSObject | |
int | GetCurrentStateNo () const |
Returns the current state number. More... | |
void | SetCurrentStateNo (int a_num) |
Sets the current state number. More... | |
bool | GetStepDone () const |
Returns the step done indicator flag. More... | |
void | SetStepDone (bool a_bool) |
Sets the step done indicator flag. More... | |
void | ReinitialiseObjectBase () |
Used to initialise an object. More... | |
TALMaSSObject () | |
The constructor for TALMaSSObject. More... | |
virtual | ~TALMaSSObject ()=default |
The destructor for TALMaSSObject. More... | |
Protected Member Functions | |
int | Dispersal (double p_OldQual, int p_Distance) |
Female dispersal. More... | |
int | st_Evaluate_n_Explore () |
Main territory evaluation behaviour. More... | |
void | st_BecomeSubAdult (void) |
void | SetLocation () override |
Location map function. More... | |
void | FreeLocation () override |
Location map function. More... | |
bool | GetLocation (int px, int py) override |
Location map function. More... | |
Protected Member Functions inherited from Vole_Base | |
virtual void | RodenticideIngestion (void) |
double | CalculateCarryingCapacity (int x, int y, int a_ddep) const |
int | MoveQuality (int p_x, int p_y) const |
Test a location for quality while moving. More... | |
void | MoveTo (int p_Vector, int p_Distance, int iterations) |
Movement. More... | |
void | DoWalking (int p_Distance, int &p_Vector, int &vx, int &vy) const |
Walking. More... | |
void | DoWalkingCorrect (int p_Distance, int &p_Vector, int &vx, int &vy) const |
Walking where there is a danger of stepping off the world. More... | |
void | Escape (int p_Vector, int p_Distance) |
Dispersal - directed movement. More... | |
void | CheckTraps () |
Protected Member Functions inherited from TAnimal | |
void | CorrectWrapRound () |
Corrects wrap around co-ordinate problems. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from TAnimal | |
static void | SetSimulationWidth (int a_value) |
Sets the simulation width. More... | |
static void | SetSimulationHeight (int a_value) |
Sets the simulation height. More... | |
static void | SetDayInYear (int a_value) |
Sets the day in year attribute. More... | |
static void | SetOurLandscape (Landscape *a_value) |
Sets the landscape pointer. More... | |
static void | SetTempToday (double a_value) |
Sets the temperature today attribute. More... | |
Static Public Member Functions inherited from TALMaSSObject | |
static void | OnArrayBoundsError () |
Used for debugging only, tests basic object properties. More... | |
Public Attributes inherited from Vole_Base | |
TTypeOfVoleState | CurrentVState |
Vole_Population_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 female voles.
Contains all the behaviour specific to the female vole. The differences between the male and female are primarily in female reproductive behaviour, but there are small differences in other behaviours requiring re-implementation of many of the behaviours (e.g. dispersal).
Vole_JuvenileFemale::Vole_JuvenileFemale | ( | struct_Vole_Adult * | p_aVoleStruct | ) |
|
overridevirtual |
Female vole BeginStep.
The BeginStep is one of the three timestep divisions. This is called once for each vole before Step and EndStep.
The main function here is to remove voles that die before they take up CPU resources in the Step code.
Can also be used to check for pesticide accumulation levels in pesticide simulation
Reimplemented from Vole_Base.
References cfg_RecordVoleMort, VoleSummaryOutput::ChangeData(), Vole_Base::CurrentVState, Vole_Base::m_LifeSpan, Vole_Base::m_OurPopulation, TALMaSSObject::m_StepDone, Vole_Population_Manager::m_VoleRecordMort, Vole_Base::MortalityTest(), tovmort_FBck, tovmort_FLife, tovs_FDying, and CfgBool::value().
|
protected |
Female dispersal.
Checks p_Distance away to see if it can find a territory in the next FHabQualThreshold category or with an improved quality of 1.1* p_OldQual if already in optimal habitat
This entails some risk though, so there is a fixed 2.5% increase in the mortality chance when it does this.
References Vole_Base::CalculateCarryingCapacity(), cfg_RecordVoleMort, cfg_VoleDDepConst, VoleSummaryOutput::ChangeData(), FreeLocation(), g_extradispmort, g_rand_uni_fnc(), g_random_fnc(), Vole_Base::m_DispVector, TAnimal::m_guard_cell_x, TAnimal::m_guard_cell_y, TAnimal::m_Location_x, TAnimal::m_Location_y, Vole_Base::m_OurPopulation, Vole_Population_Manager::m_VoleRecordMort, Vole_Base::MoveTo(), SetLocation(), tovmort_FDisp, Population_Manager::UpdateGuardMap(), CfgInt::value(), and CfgBool::value().
Referenced by st_Evaluate_n_Explore(), and Vole_Female::st_Evaluate_n_Explore().
|
overridevirtual |
Female vole EndStep.
The EndStep one of the three timestep divisions. This is called once for each vole after BeginStep and Step.
The main function here is to remove voles that have died during step and otherwise to grow if not at max weight. It also checks if the vole was killed due to human management and determines the potential territory size.
Reimplemented from Vole_Base.
References cfg_RecordVoleMort, VoleSummaryOutput::ChangeData(), TAnimal::CheckManagement(), Vole_Base::CurrentVState, growthperdayF, Vole_Base::m_Age, Vole_Base::m_BornLastYear, Vole_Base::m_FemaleTerritoryRangeSlope, Vole_Base::m_Mature, Vole_Base::m_MinFemaleTerritorySize, TAnimal::m_OurLandscape, Vole_Base::m_OurPopulation, Vole_Base::m_TerrRange, Vole_Population_Manager::m_VoleRecordMort, Vole_Base::m_Weight, MaxWeightF, MinReproWeightF, Vole_Base::st_Dying(), Landscape::SupplyDayInYear(), Vole_Population_Manager::SupplyGrowthStartDate(), tovmort_FStarve, tovs_FDying, and CfgBool::value().
|
inlineoverrideprotectedvirtual |
Location map 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(), st_BecomeSubAdult(), Vole_Female::st_Special_Explore(), Step(), and Vole_Female::Step().
|
inlineoverrideprotectedvirtual |
Location map function.
Reimplemented from Vole_Base.
References IDMap< a_type >::GetMapValue(), Vole_Base::m_OurPopulation, and Vole_Population_Manager::m_VoleMap.
|
overridevirtual |
External event handler.
This method evaluates external events and chooses a suitable response (in this case a probability of dying because other effects will be taken up by the evaluate and explore state.
Reimplemented from TAnimal.
References autumn_harrow, autumn_or_spring_plough, autumn_plough, autumn_roll, autumn_sow, autumn_sow_with_ferti, bed_forming, biocide, bulb_harvest, burn_straw_stubble, burn_top, cattle_out, cattle_out_low, cfg_RecordVoleMort, VoleSummaryOutput::ChangeData(), Vole_Base::CurrentVState, cut_to_hay, cut_to_silage, cut_weeds, deep_ploughing, Landscape::EventtypeToString(), fa_ammoniumsulphate, fa_boron, fa_calcium, fa_cu, fa_greenmanure, fa_k, fa_manganesesulphate, fa_manure, fa_n, fa_nk, fa_npk, fa_npks, fa_p, fa_pk, fa_pks, fa_rsm, fa_sk, fa_sludge, fa_slurry, fiber_covering, fiber_removal, flammebehandling, flower_cutting, fp_ammoniumsulphate, fp_boron, fp_calcium, fp_cu, fp_greenmanure, fp_k, fp_liquidNH3, fp_manganesesulphate, fp_manure, fp_n, fp_nc, fp_nk, fp_npk, fp_npks, fp_ns, fp_p, fp_pk, fp_pks, fp_rsm, fp_sk, fp_sludge, fp_slurry, fungicide_treat, g_msg, g_rand_uni_fnc(), glyphosate, green_harvest, growth_regulator, harvest, harvest_bushfruit, harvestshoots, hay_bailing, hay_turning, heavy_cultivator_aggregate, herbicide_treat, hilling_up, insecticide_treat, last_treatment, TAnimal::m_OurLandscape, Vole_Base::m_OurPopulation, Vole_Population_Manager::m_VoleRecordMort, manual_weeding, molluscicide, mow, org_fungicide, org_herbicide, org_insecticide, pheromone, pigs_out, preseeding_cultivator, preseeding_cultivator_sow, product_treat, pruning, row_cultivation, shallow_harrow, shredding, sleep_all_day, spring_harrow, spring_plough, spring_roll, spring_sow, spring_sow_with_ferti, straw_chopping, straw_covering, straw_removal, strigling, strigling_hill, strigling_sow, stubble_cultivator_heavy, stubble_harrowing, stubble_plough, suckering, summer_harrow, summer_plough, summer_sow, swathing, syninsecticide_treat, tovmort_FFarm, tovs_FDying, trial_control, trial_insecticidetreat, trial_toxiccontrol, CfgBool::value(), VoleHarvestMort, VoleHerbicicideMort, VoleInsecticideMort, VolePigGrazingMort, VoleSoilCultivationMort, VoleStriglingMort, MapErrorMsg::Warn(), WARN_FILE, water, winter_harrow, and winter_plough.
|
overridevirtual |
Death from external entity.
External event has caused death - probably eaten by a explicitly modelled predator
Reimplemented from Vole_Base.
References cfg_RecordVoleMort, VoleSummaryOutput::ChangeData(), Vole_Base::CurrentVState, Vole_Base::m_OurPopulation, Vole_Population_Manager::m_VoleRecordMort, tovmort_FPred, tovs_FDying, and CfgBool::value().
|
overridevirtual |
Reimplemented from Vole_Base.
Reimplemented in Vole_Female.
References Vole_Base::Init(), Vole_Base::m_Age, Vole_Base::m_BornLastYear, Vole_Base::m_MinFemaleTerritorySize, Vole_Base::m_MinTerrRange, Vole_Base::m_Sex, Vole_Base::m_TerrRange, Vole_Base::m_Weight, and WeanedWeight.
|
inlineoverrideprotectedvirtual |
Location map 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(), and Vole_Female::st_Special_Explore().
|
protected |
References Vole_Population_Manager::CreateObjects(), Vole_Base::CurrentVState, FreeLocation(), Vole_Base::m_Age, TALMaSSObject::m_CurrentStateNo, Vole_Base::m_FatherId, TAnimal::m_Location_x, TAnimal::m_Location_y, Vole_Base::m_MotherId, Vole_Base::m_MyGenes, TAnimal::m_OurLandscape, Vole_Base::m_OurPopulation, TALMaSSObject::m_StepDone, Vole_Base::m_Weight, Landscape::SupplyElementType(), Landscape::SupplyPolyRef(), Landscape::SupplyVegType(), tovs_FDying, vob_Female, and struct_Vole_Adult::VPM.
Referenced by Step().
|
protected |
Main territory evaluation behaviour.
Evaluates the quality of her habitat and does some limited exploration in the surrounding area to see if she can improve it by moving.
References Vole_Base::CalculateCarryingCapacity(), cfg_VoleDDepConst, Vole_Base::CheckTraps(), Dispersal(), FemaleMovement, g_random_fnc(), Vole_Base::m_DispVector, TAnimal::m_Location_x, TAnimal::m_Location_y, Vole_Base::m_MinFVoleHabQual, and CfgInt::value().
Referenced by Step().
|
overridevirtual |
JuvenileFemale vole Step.
The Step is one of the three timestep divisions. This is called repeatedly after BeginStep and before EndStep, until all voles report that they are done with Step.
Most of the behaviours are controlled by moving voles between behavioural states in Step (for other models this is also done in BeginStep and EndStep).
When a vole is done for the day it will signal this by setting m_StepDone==true. NB that a call to one behaviour may trigger a call to another behaviour on the next call to step inside the same timestep. In this way a daily cycle of activity can be undertaken (i.e. do reproduction and explore)
Reimplemented from Vole_Base.
Reimplemented in Vole_Female.
References cfg_RecordVoleMort, VoleSummaryOutput::ChangeData(), Vole_Base::CurrentVState, FreeLocation(), Vole_Base::m_Age, TAnimal::m_OurLandscape, Vole_Base::m_OurPopulation, TALMaSSObject::m_StepDone, Vole_Population_Manager::m_VoleRecordMort, MinReproAgeF, st_BecomeSubAdult(), st_Evaluate_n_Explore(), tovmort_FStarve, tovs_FDying, tovs_FEvaluateExplore, CfgBool::value(), and Landscape::Warn().