ALMaSS Vole ODDox  1.1
The vole model description following ODdox protocol
Vole_all.cpp File Reference

This file contains the code for all vole lifestage classes
More...

#include <iostream>
#include <fstream>
#include "../Landscape/ls.h"
#include "../BatchALMaSS/PopulationManager.h"
#include "../BatchALMaSS/BinaryMapBase.h"
#include "../BatchALMaSS/MovementMap.h"
#include "../Vole/vole_all.h"
#include "../Vole/VolePopulationManager.h"
#include "../Vole/GeneticMaterial.h"
#include "../Vole/Predators.h"
#include "../BatchALMaSS/BoostRandomGenerators.h"

Go to the source code of this file.

Macros

#define _CRT_SECURE_NO_DEPRECATE
 

Functions

CfgFloat cfg_extradispmort ("VOLEDISPMORT", CFG_CUSTOM, 0.055)
 Input parameter for daily extra mortality chance while dispersing. More...
 
CfgFloat cfg_VoleResourceRegrowth ("VOLE_RESOURCEREGROWTH", CFG_CUSTOM, 0.5)
 A parameter determining the density dependence effect. Zero will have no density dependence effect, 1.0 will have infinite impact. More...
 
static CfgFloat cfg_volepcidebiodegredrate ("VOLE_PCIDE_BIODEGREDATIONRATE", CFG_CUSTOM, 0.0)
 
static CfgFloat cfg_InfanticideRangeRelToTerRange ("VOLE_IINFANTICIDERANGE_RELTO_TERRANGE", CFG_CUSTOM, 0.5)
 
static CfgBool cfg_VoleMortalityDataUsed ("VOLE_MORTALITY_DATA_USED", CFG_CUSTOM, false)
 
static CfgInt cfg_VoleEndoCrineDisruptionGestationLength ("VOLE_ENDOCRINEDISPRUPTORGESTATION", CFG_CUSTOM, 21)
 
static CfgFloat cfg_InfanticideProbability ("INFANTI_PROBA", CFG_CUSTOM, 0.01)
 
static CfgFloat cfg_vole_habqualscaler ("VOLE_HABQUALSCALER", CFG_CUSTOM, 2.1)
 
CfgInt cfg_MinFemaleTerritorySize ("VOLE_MINFEMALETERRITORYSIZE", CFG_CUSTOM, 8)
 
static CfgInt cfg_MaxFemaleTerrSize ("VOLE_MAXFEMALETERRITORYSIZE", CFG_CUSTOM, 8)
 
CfgInt cfg_MinMaleTerritorySize ("VOLE_MINMALETERRITORYSIZE", CFG_CUSTOM, 9)
 
static CfgInt cfg_MaxMaleTerrSize ("VOLE_MAXMALETERRITORYSIZE", CFG_CUSTOM, 23)
 
static CfgInt cfg_vole_LifeMonths ("VOLE_LIFEMONTHS", CFG_CUSTOM, 3)
 
static CfgInt cfg_MaxStarvationDays ("VOLE_MAXSTARVATIONDAYS", CFG_CUSTOM, 29)
 
static CfgFloat cfg_PesticideAccumulationThreshold ("VOLE_PESTICDEACCUMULATIONTHRESHOLD", CFG_CUSTOM, 20.0)
 
static CfgFloat cfg_PesticideAccumulationThresholdModelink2 ("VOLE_PESTICDEACCUMULATIONTHRESHOLD_MODELINKTWO", CFG_CUSTOM, 20.0)
 
static CfgFloat cfg_PesticideAccumulationThreshold2 ("VOLE_PESTICDEACCUMULATIONTHRESHOLDTWO", CFG_CUSTOM, 44.1)
 
static CfgFloat cfg_PesticideFemaleMaturityDelay ("VOLE_PCIDE_FEMALEMATURITYDELAY", CFG_CUSTOM, 0.0192)
 
static CfgFloat cfg_PesticideLitterSizeReduction ("VOLE_PCIDE_LITTERSIZEREDUCTION", CFG_CUSTOM, 0.0038)
 
static CfgFloat cfg_PesticideWeaningReduction ("VOLE_PCIDE_WEANINGREDUCTION", CFG_CUSTOM, 0.0017)
 
CfgBool cfg_ResistanceDominant ("VOLE_RESISTANCEDOMINANT", CFG_CUSTOM, false)
 
CfgInt cfg_VoleDDepConst ("VOLE_DDEPCONST", CFG_CUSTOM, 4)
 
CfgInt cfg_MinReproAgeM ("VOLE_MINREPROAGEM", CFG_CUSTOM, 30)
 
CfgInt cfg_MinReproAgeF ("VOLE_MINREPROAGEF", CFG_CUSTOM, 23)
 

Variables

boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
 
CfgBool cfg_RecordVoleMort
 
CfgFloat l_pest_daily_mort
 
const int Vector_x [8]
 
const int Vector_y [8]
 
double MoveToLessFavourable
 
double g_SpeedyDivides [2001]
 A generally useful array of fast divide calculators by multiplication. More...
 
CfgInt cfg_productapplicstartyear
 
CfgInt cfg_productapplicendyear
 
CfgBool cfg_ReallyBigOutputMonthly_used
 
CfgBool cfg_RipleysOutput_used
 
CfgBool cfg_AOROutput_used
 
CfgBool l_pest_enable_pesticide_engine
 
CfgBool cfg_pest_residue_or_rate
 
const int FemNoMature = September
 
const unsigned TheGestationPeriod = 21
 
const unsigned WeanedAge = 13
 
const int WeanedWeight =5
 
const double MaxWeightM =60
 
const double MaxWeightF =55
 
const double DaysAtMaxGrowth =90.0
 
const double growthperdayM =(MaxWeightM-WeanedWeight)/DaysAtMaxGrowth
 
const double growthperdayF =(MaxWeightF-WeanedWeight)/DaysAtMaxGrowth
 
const int GrowStopDate = August
 
int MinReproAgeM
 
int MinReproAgeF
 
const unsigned MinReproWeightM =40
 
const int MinReproWeightF =20
 
int g_sigAgeDiff = 30
 
const double FemaleResourceReq [13]
 
const unsigned FemaleMovement = 50
 
const unsigned MinFemaleMovement = 5
 
const unsigned VoleMoveInterval = 30
 
const unsigned MaleMovement [4] = {10,40,70,110}
 
const unsigned MinMaleMovement = 5
 
int g_MaleReproductFinish = 0
 
const double InfanticideChanceByAge [9] = {0.97,0.86,0.75,0.64,0.54,0.43,0.32,0.21,0.11}
 
double g_DailyMortChance = 0.003
 
double g_DailyMortChanceMaleTerr = 0.003
 
const double VoleHarvestMort =0.20
 
const double VoleStriglingMort =0.50
 
const double VoleSoilCultivationMort =0.75
 
const double VolePigGrazingMort =0.25
 
const double VoleHerbicicideMort = 0.0
 
const double VoleInsecticideMort = 0.0
 
double g_extradispmort
 
double g_NoFemalesMove = 0.01
 

Detailed Description

This file contains the code for all vole lifestage classes

by Chris J. Topping
Version of 28th Jan 2001

With additions as noted in:
April 2006
November 2007
Doxygen formatted comments in May 2008

Definition in file Vole_all.cpp.

Macro Definition Documentation

◆ _CRT_SECURE_NO_DEPRECATE

#define _CRT_SECURE_NO_DEPRECATE

Definition at line 39 of file Vole_all.cpp.

Function Documentation

◆ cfg_extradispmort()

CfgFloat cfg_extradispmort ( "VOLEDISPMORT"  ,
CFG_CUSTOM  ,
0.  055 
)

Input parameter for daily extra mortality chance while dispersing.

◆ cfg_InfanticideProbability()

static CfgFloat cfg_InfanticideProbability ( "INFANTI_PROBA"  ,
CFG_CUSTOM  ,
0.  01 
)
static

◆ cfg_InfanticideRangeRelToTerRange()

static CfgFloat cfg_InfanticideRangeRelToTerRange ( "VOLE_IINFANTICIDERANGE_RELTO_TERRANGE"  ,
CFG_CUSTOM  ,
0.  5 
)
static

◆ cfg_MaxFemaleTerrSize()

static CfgInt cfg_MaxFemaleTerrSize ( "VOLE_MAXFEMALETERRITORYSIZE"  ,
CFG_CUSTOM  ,
 
)
static

Maximum territory size for females

Referenced by Vole_Base::Init().

◆ cfg_MaxMaleTerrSize()

static CfgInt cfg_MaxMaleTerrSize ( "VOLE_MAXMALETERRITORYSIZE"  ,
CFG_CUSTOM  ,
23   
)
static

Maximum territory size for males

Referenced by Vole_Base::Init().

◆ cfg_MaxStarvationDays()

static CfgInt cfg_MaxStarvationDays ( "VOLE_MAXSTARVATIONDAYS"  ,
CFG_CUSTOM  ,
29   
)
static

The max number of starvation days before death

Referenced by Vole_Base::Init().

◆ cfg_MinFemaleTerritorySize()

CfgInt cfg_MinFemaleTerritorySize ( "VOLE_MINFEMALETERRITORYSIZE"  ,
CFG_CUSTOM  ,
 
)

Minimum territory size for females

Referenced by Vole_Base::Init().

◆ cfg_MinMaleTerritorySize()

CfgInt cfg_MinMaleTerritorySize ( "VOLE_MINMALETERRITORYSIZE"  ,
CFG_CUSTOM  ,
 
)

Minimum territory size for males

Referenced by Vole_Base::Init().

◆ cfg_MinReproAgeF()

CfgInt cfg_MinReproAgeF ( "VOLE_MINREPROAGEF"  ,
CFG_CUSTOM  ,
23   
)

◆ cfg_MinReproAgeM()

CfgInt cfg_MinReproAgeM ( "VOLE_MINREPROAGEM"  ,
CFG_CUSTOM  ,
30   
)

◆ cfg_PesticideAccumulationThreshold()

static CfgFloat cfg_PesticideAccumulationThreshold ( "VOLE_PESTICDEACCUMULATIONTHRESHOLD"  ,
CFG_CUSTOM  ,
20.  0 
)
static

Toxicological variable for specific pesticide effects

Referenced by Vole_Female::st_GiveBirth(), and Vole_Female::st_Lactating().

◆ cfg_PesticideAccumulationThreshold2()

static CfgFloat cfg_PesticideAccumulationThreshold2 ( "VOLE_PESTICDEACCUMULATIONTHRESHOLDTWO"  ,
CFG_CUSTOM  ,
44.  1 
)
static

◆ cfg_PesticideAccumulationThresholdModelink2()

static CfgFloat cfg_PesticideAccumulationThresholdModelink2 ( "VOLE_PESTICDEACCUMULATIONTHRESHOLD_MODELINKTWO"  ,
CFG_CUSTOM  ,
20.  0 
)
static

◆ cfg_PesticideFemaleMaturityDelay()

static CfgFloat cfg_PesticideFemaleMaturityDelay ( "VOLE_PCIDE_FEMALEMATURITYDELAY"  ,
CFG_CUSTOM  ,
0.  0192 
)
static

◆ cfg_PesticideLitterSizeReduction()

static CfgFloat cfg_PesticideLitterSizeReduction ( "VOLE_PCIDE_LITTERSIZEREDUCTION"  ,
CFG_CUSTOM  ,
0.  0038 
)
static

◆ cfg_PesticideWeaningReduction()

static CfgFloat cfg_PesticideWeaningReduction ( "VOLE_PCIDE_WEANINGREDUCTION"  ,
CFG_CUSTOM  ,
0.  0017 
)
static

◆ cfg_ResistanceDominant()

CfgBool cfg_ResistanceDominant ( "VOLE_RESISTANCEDOMINANT"  ,
CFG_CUSTOM  ,
false   
)

◆ cfg_vole_habqualscaler()

static CfgFloat cfg_vole_habqualscaler ( "VOLE_HABQUALSCALER"  ,
CFG_CUSTOM  ,
2.  1 
)
static

Scales to the average minimum territory quality acceptable

Referenced by Vole_Base::Init().

◆ cfg_vole_LifeMonths()

static CfgInt cfg_vole_LifeMonths ( "VOLE_LIFEMONTHS"  ,
CFG_CUSTOM  ,
 
)
static

Average physiological ifespan in months above 1 yr

Referenced by Vole_Base::Init().

◆ cfg_VoleDDepConst()

◆ cfg_VoleEndoCrineDisruptionGestationLength()

static CfgInt cfg_VoleEndoCrineDisruptionGestationLength ( "VOLE_ENDOCRINEDISPRUPTORGESTATION"  ,
CFG_CUSTOM  ,
21   
)
static

◆ cfg_VoleMortalityDataUsed()

static CfgBool cfg_VoleMortalityDataUsed ( "VOLE_MORTALITY_DATA_USED"  ,
CFG_CUSTOM  ,
false   
)
static

◆ cfg_volepcidebiodegredrate()

static CfgFloat cfg_volepcidebiodegredrate ( "VOLE_PCIDE_BIODEGREDATIONRATE"  ,
CFG_CUSTOM  ,
0.  0 
)
static

Referenced by Vole_Base::Init().

◆ cfg_VoleResourceRegrowth()

CfgFloat cfg_VoleResourceRegrowth ( "VOLE_RESOURCEREGROWTH"  ,
CFG_CUSTOM  ,
0.  5 
)

A parameter determining the density dependence effect. Zero will have no density dependence effect, 1.0 will have infinite impact.

Variable Documentation

◆ cfg_AOROutput_used

CfgBool cfg_AOROutput_used

◆ cfg_pest_residue_or_rate

CfgBool cfg_pest_residue_or_rate

◆ cfg_productapplicendyear

CfgInt cfg_productapplicendyear

◆ cfg_productapplicstartyear

CfgInt cfg_productapplicstartyear

Toxicological variable for specific pesticide effects

◆ cfg_ReallyBigOutputMonthly_used

CfgBool cfg_ReallyBigOutputMonthly_used

◆ cfg_RecordVoleMort

◆ cfg_RipleysOutput_used

CfgBool cfg_RipleysOutput_used

◆ DaysAtMaxGrowth

const double DaysAtMaxGrowth =90.0

How long it takes to get to max weight at max rate of growth

Definition at line 137 of file Vole_all.cpp.

◆ FemaleMovement

const unsigned FemaleMovement = 50

Max distance between fix distance in Mols radiotracking data was 48m

Definition at line 174 of file Vole_all.cpp.

Referenced by Vole_JuvenileFemale::st_Evaluate_n_Explore(), Vole_Female::st_Evaluate_n_Explore(), and Vole_Female::st_Special_Explore().

◆ FemaleResourceReq

const double FemaleResourceReq[13]
Initial value:
=
{
0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0,
1.0
}

This is only here in case the resource requirement ought to change per month - it is not currently used.
Need 13 below because SupplyMonth() returns 1-12

Definition at line 156 of file Vole_all.cpp.

◆ FemNoMature

const int FemNoMature = September

1st september female voles cannot mature after this

Definition at line 123 of file Vole_all.cpp.

◆ g_DailyMortChance

double g_DailyMortChance = 0.003

Mortality per day as a background mortality encompassing all things not directly modelled. This may include specialist predators if they are not simulated - if they are then reduce this value

Definition at line 189 of file Vole_all.cpp.

Referenced by Vole_Population_Manager::DoFirst(), Vole_Population_Manager::Init(), Vole_Base::MortalityTest(), and Vole_Male::MortalityTest().

◆ g_DailyMortChanceMaleTerr

double g_DailyMortChanceMaleTerr = 0.003

Definition at line 190 of file Vole_all.cpp.

Referenced by Vole_Population_Manager::DoFirst(), and Vole_Male::MortalityTest().

◆ g_extradispmort

◆ g_MaleReproductFinish

int g_MaleReproductFinish = 0

1/10 deduced from Erlinge et al, 1983

Definition at line 183 of file Vole_all.cpp.

Referenced by Vole_Population_Manager::DoFirst(), and Vole_Population_Manager::Init().

◆ g_NoFemalesMove

double g_NoFemalesMove = 0.01

◆ g_rand_uni

◆ g_sigAgeDiff

int g_sigAgeDiff = 30

Age difference required before eviction by older male

Definition at line 153 of file Vole_all.cpp.

Referenced by Vole_Population_Manager::Init(), and Vole_Population_Manager::SupplyInOlderTerr().

◆ g_SpeedyDivides

double g_SpeedyDivides[2001]

A generally useful array of fast divide calculators by multiplication.

array of reciprocals to use instead of divding

Definition at line 250 of file Landscape.cpp.

Referenced by Landscape::Landscape().

◆ GrowStopDate

const int GrowStopDate = August

The day it is assumed that grass stops growing

Definition at line 143 of file Vole_all.cpp.

Referenced by Vole_Male::EndStep(), and Vole_JuvenileFemale::EndStep().

◆ growthperdayF

const double growthperdayF =(MaxWeightF-WeanedWeight)/DaysAtMaxGrowth

g per day during growing for females

Definition at line 141 of file Vole_all.cpp.

Referenced by Vole_JuvenileFemale::EndStep().

◆ growthperdayM

const double growthperdayM =(MaxWeightM-WeanedWeight)/DaysAtMaxGrowth

g per day during growing for males

Definition at line 139 of file Vole_all.cpp.

Referenced by Vole_JuvenileMale::EndStep(), and Vole_Male::EndStep().

◆ InfanticideChanceByAge

const double InfanticideChanceByAge[9] = {0.97,0.86,0.75,0.64,0.54,0.43,0.32,0.21,0.11}

Data from M.arvalis (Heise & Lippke 1997) on infanticide attempts success rate with age of litter

Definition at line 185 of file Vole_all.cpp.

Referenced by Vole_Female::OnInfanticideAttempt().

◆ l_pest_daily_mort

CfgFloat l_pest_daily_mort

◆ l_pest_enable_pesticide_engine

CfgBool l_pest_enable_pesticide_engine

◆ MaleMovement

const unsigned MaleMovement[4] = {10,40,70,110}

Max distance between fix distance in Mols radiotracking data was 110m. For the male the distance that he can move increases with size

Definition at line 179 of file Vole_all.cpp.

Referenced by Vole_JuvenileMale::st_Eval_n_Explore(), and Vole_Male::st_Eval_n_Explore().

◆ MaxWeightF

const double MaxWeightF =55

The maximum weight of adult females

Definition at line 135 of file Vole_all.cpp.

Referenced by Vole_JuvenileFemale::EndStep(), and Vole_Base::Init().

◆ MaxWeightM

const double MaxWeightM =60

The maximum weight of adult males

Definition at line 133 of file Vole_all.cpp.

Referenced by Vole_Male::EndStep(), and Vole_Base::Init().

◆ MinFemaleMovement

const unsigned MinFemaleMovement = 5

arbitrary minimum movement of 5 - because we need one

Definition at line 176 of file Vole_all.cpp.

Referenced by Vole_Female::st_Evaluate_n_Explore(), and Vole_Female::st_Special_Explore().

◆ MinMaleMovement

const unsigned MinMaleMovement = 5

arbitrary minimum movement of 5 - because we need one

Definition at line 181 of file Vole_all.cpp.

Referenced by Vole_JuvenileMale::st_JuvenileExplore().

◆ MinReproAgeF

int MinReproAgeF

The youngest a female can be reproductive at.

Definition at line 147 of file Vole_all.cpp.

Referenced by Vole_Population_Manager::Init(), Vole_Female::ReInit(), Vole_Female::st_BecomeReproductive(), Vole_JuvenileFemale::Step(), and Vole_Female::Vole_Female().

◆ MinReproAgeM

int MinReproAgeM

The youngest a male can be reproductive at.

Definition at line 145 of file Vole_all.cpp.

Referenced by Vole_JuvenileMale::EndStep(), and Vole_Population_Manager::Init().

◆ MinReproWeightF

const int MinReproWeightF =20

The smallest a female can be reproductive at.

Definition at line 151 of file Vole_all.cpp.

Referenced by Vole_JuvenileFemale::EndStep(), and Vole_Base::Init().

◆ MinReproWeightM

const unsigned MinReproWeightM =40

The smallest a male can be reproductive at.

Definition at line 149 of file Vole_all.cpp.

Referenced by Vole_Male::DetermineTerritorySize(), and Vole_Base::Init().

◆ MoveToLessFavourable

double MoveToLessFavourable

This is specified as a global because it avoids costing time on look-ups.
This is needed because of the extreme CPU intensive movement functions

Definition at line 157 of file VolePopulationManager.cpp.

Referenced by Vole_Base::DoWalking(), Vole_Base::DoWalkingCorrect(), and Vole_Population_Manager::Init().

◆ TheGestationPeriod

const unsigned TheGestationPeriod = 21

Probability of maturing in each month of age - will do this if 5 months old unless it is winter 21 days gestation

Definition at line 127 of file Vole_all.cpp.

Referenced by Vole_Female::st_Mating().

◆ Vector_x

const int Vector_x[8]

◆ Vector_y

const int Vector_y[8]

◆ VoleHarvestMort

const double VoleHarvestMort =0.20

Farm operation Mortality

Definition at line 192 of file Vole_all.cpp.

Referenced by Vole_JuvenileMale::OnFarmEvent(), and Vole_JuvenileFemale::OnFarmEvent().

◆ VoleHerbicicideMort

const double VoleHerbicicideMort = 0.0

Vole herbicide diect mortality

Definition at line 200 of file Vole_all.cpp.

Referenced by Vole_JuvenileMale::OnFarmEvent().

◆ VoleInsecticideMort

const double VoleInsecticideMort = 0.0

Vole insecticide diect mortality

Definition at line 202 of file Vole_all.cpp.

Referenced by Vole_JuvenileMale::OnFarmEvent().

◆ VoleMoveInterval

const unsigned VoleMoveInterval = 30

Definition at line 177 of file Vole_all.cpp.

◆ VolePigGrazingMort

const double VolePigGrazingMort =0.25

Farm operation Mortality

Definition at line 198 of file Vole_all.cpp.

Referenced by Vole_JuvenileMale::OnFarmEvent(), and Vole_JuvenileFemale::OnFarmEvent().

◆ VoleSoilCultivationMort

const double VoleSoilCultivationMort =0.75

Farm operation Mortality

Definition at line 196 of file Vole_all.cpp.

Referenced by Vole_JuvenileMale::OnFarmEvent(), and Vole_JuvenileFemale::OnFarmEvent().

◆ VoleStriglingMort

const double VoleStriglingMort =0.50

Farm operation Mortality

Definition at line 194 of file Vole_all.cpp.

Referenced by Vole_JuvenileMale::OnFarmEvent(), and Vole_JuvenileFemale::OnFarmEvent().

◆ WeanedAge

const unsigned WeanedAge = 13

Age at weaning

Definition at line 129 of file Vole_all.cpp.

Referenced by Vole_Female::st_Lactating().

◆ WeanedWeight