ALMaSS Vole ODDox
1.1
The vole model description following ODdox protocol
|
The class for male voles. More...
#include <vole_all.h>
Public Member Functions | |
Vole_Male (struct_Vole_Adult *p_aVoleStruct) | |
Vole_Male constructor. More... | |
virtual void | ReInit (struct_Vole_Adult *p_aVoleStruct) |
virtual | ~Vole_Male () |
virtual void | Step () |
Male vole Step. More... | |
virtual void | EndStep () |
Male vole EndStep. More... | |
Public Member Functions inherited from Vole_JuvenileMale | |
Vole_JuvenileMale (struct_Vole_Adult *p_aVoleStruct) | |
Vole_JuvenileMale constructor. More... | |
virtual | ~Vole_JuvenileMale () |
virtual bool | OnFarmEvent (FarmToDo event) |
JuvenileMale vole exernal event handler. More... | |
virtual void | BeginStep () |
Juvenile Male vole BeginStep. More... | |
virtual void | OnKilled () |
JuvenileMale vole death by external entity. More... | |
Public Member Functions inherited from Vole_Base | |
Vole_Base (struct_Vole_Adult *p_aVoleStruct) | |
Constructor for Vole_Base. More... | |
virtual | ~Vole_Base () |
virtual void | Init (struct_Vole_Adult *p_aVoleStruct) |
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) |
virtual int | WhatState () |
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 | |
unsigned | SupplyFarmOwnerRef () |
AnimalPosition | SupplyPosition () |
APoint | SupplyPoint () |
int | SupplyPolygonRef () |
int | Supply_m_Location_x () |
int | Supply_m_Location_y () |
virtual void | KillThis () |
virtual void | CopyMyself () |
void | SetX (int a_x) |
void | SetY (int a_y) |
TAnimal (int x, int y, Landscape *L) | |
virtual void | ReinitialiseObject (int x, int y, Landscape *L) |
Used to re-use an object - must be implemented in descendent classes. More... | |
virtual void | Dying () |
void | CheckManagement (void) |
void | CheckManagementXY (int x, int y) |
Public Member Functions inherited from TALMaSSObject | |
int | GetCurrentStateNo () |
Returns the current state number. More... | |
void | SetCurrentStateNo (int a_num) |
Sets the current state number. More... | |
bool | GetStepDone () |
Returns the step done indicator flag. More... | |
void | SetStepDone (bool a_bool) |
Sets the step done indicator flag. More... | |
virtual void | ReinitialiseObject () |
Used to re-use an object - must be implemented in descendent classes. More... | |
TALMaSSObject () | |
The constructor for TALMaSSObject. More... | |
virtual | ~TALMaSSObject () |
The destructor for TALMaSSObject. More... | |
void | OnArrayBoundsError () |
Used for debugging only, tests basic object properties. 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 () |
Currently not used. More... | |
int | st_Maturation (void) |
Male vole maturation control. More... | |
void | st_Infanticide (void) |
Male vole infanticide behaviour. More... | |
virtual bool | MortalityTest () |
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 | |
virtual void | SetLocation () |
Map location function. More... | |
virtual void | FreeLocation () |
Map location function. More... | |
virtual bool | GetLocation (int px, int py) |
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) |
int | MoveQuality (int p_x, int p_y) |
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) |
Walking. More... | |
void | DoWalkingCorrect (int p_Distance, int &p_Vector, int &vx, int &vy) |
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 | |
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 | SimH |
int | SimW |
GeneticMaterial | m_MyGenes |
InTrapPosition | m_intrappos |
Protected Attributes inherited from TAnimal | |
int | m_Location_x |
int | m_Location_y |
Landscape * | m_OurLandscape |
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 |
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.
Definition at line 492 of file vole_all.h.
Vole_Male::Vole_Male | ( | struct_Vole_Adult * | p_aVoleStruct | ) |
Vole_Male constructor.
Definition at line 2413 of file Vole_all.cpp.
References struct_Vole_Adult::age, struct_Vole_Adult::BirthYear, Vole_Base::m_Age, Vole_Base::m_BirthYear, Vole_Base::m_MinMaleTerritorySize, Vole_Base::m_MinTerrRange, Vole_Base::m_Sex, Vole_Base::m_TerrRange, Vole_Base::m_Weight, and struct_Vole_Adult::weight.
|
virtual |
Definition at line 2435 of file Vole_all.cpp.
|
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).
Definition at line 2793 of file Vole_all.cpp.
References Vole_Base::CalculateCarryingCapacity(), cfg_VoleDDepConst(), TAnimal::m_Location_x, TAnimal::m_Location_y, and Vole_Base::m_MinMVoleHabQual.
|
inlineprotected |
Calculates the territory size needed for a vole of his weight.
Definition at line 2778 of file Vole_all.cpp.
References Vole_Base::m_MaleTerritoryRangeSlope, Vole_Base::m_MinMaleTerritorySize, Vole_Base::m_TerrRange, Vole_Base::m_Weight, and MinReproWeightM.
Referenced by EndStep().
|
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.
Definition at line 2689 of file Vole_all.cpp.
References Vole_Base::CalculateCarryingCapacity(), cfg_RecordVoleMort, cfg_VoleDDepConst(), VoleSummaryOutput::ChangeData(), Vole_JuvenileMale::FreeLocation(), g_extradispmort, g_rand_uni, Vole_Base::m_Age, Vole_Base::m_BreedingSeason, Vole_Base::m_DispVector, 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, vdisp_CarryOn, vdisp_Die, vdisp_Infanticide, and vdisp_Mature.
Referenced by st_Eval_n_Explore().
|
virtual |
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.
Definition at line 2490 of file Vole_all.cpp.
References cfg_RecordVoleMort, VoleSummaryOutput::ChangeData(), TAnimal::CheckManagement(), Vole_Base::CurrentVState, DetermineTerritorySize(), GrowStopDate, 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, and tovs_MDying.
|
protectedvirtual |
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.
Definition at line 2763 of file Vole_all.cpp.
References g_DailyMortChance, g_DailyMortChanceMaleTerr, g_rand_uni, and Vole_Base::m_Have_Territory.
|
virtual |
Reimplemented from Vole_JuvenileMale.
Definition at line 2424 of file Vole_all.cpp.
References struct_Vole_Adult::age, struct_Vole_Adult::BirthYear, Vole_Base::Init(), Vole_Base::m_Age, Vole_Base::m_BirthYear, Vole_Base::m_MinMaleTerritorySize, Vole_Base::m_MinTerrRange, Vole_Base::m_Sex, Vole_Base::m_TerrRange, Vole_Base::m_Weight, and struct_Vole_Adult::weight.
|
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.
Definition at line 2584 of file Vole_all.cpp.
References Vole_Base::CalculateCarryingCapacity(), Vole_Base::CheckTraps(), Vole_Base::CurrentVState, Dispersal(), Vole_Population_Manager::FindClosestFemale(), Vole_JuvenileMale::FreeLocation(), g_NoFemalesMove, g_rand_uni, Vole_JuvenileMale::GetLocation(), Vole_Base::m_Age, Vole_Base::m_BornLastYear, Vole_Base::m_BreedingSeason, Vole_Base::m_DispVector, 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_TerrRange, AnimalPosition::m_x, AnimalPosition::m_y, MaleMovement, Vole_Base::MoveQuality(), Vole_JuvenileMale::SetLocation(), Vole_Base::Setm_Mature(), Vole_Base::SimH, Vole_Base::SimW, Vole_Population_Manager::SupplyInOlderTerr(), TAnimal::SupplyPosition(), tovs_Infanticide, tovs_MDying, tovs_MMaturation, vdisp_CarryOn, vdisp_Die, vdisp_Infanticide, and vdisp_Mature.
Referenced by Step().
|
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.
Definition at line 2568 of file Vole_all.cpp.
References cfg_InfanticideProbability(), g_rand_uni, TAnimal::m_Location_x, TAnimal::m_Location_y, Vole_Base::m_MinTerrRange, Vole_Base::m_OurPopulation, Vole_Base::m_Weight, Vole_Population_Manager::SendMessage(), and tovm_Infanticide.
Referenced by Step().
|
protected |
Male vole maturation control.
Decide whether to become mature or not
Definition at line 2549 of file Vole_all.cpp.
References TAnimal::m_OurLandscape, Vole_Base::m_OurPopulation, Landscape::SupplyDayInYear(), and Vole_Population_Manager::SupplyGrowthStartDate().
Referenced by Step().
|
virtual |
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.
Definition at line 2450 of file Vole_all.cpp.
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().