ALMaSS  1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
skylarks_all.cpp File Reference
#include <string.h>
#include <cmath>
#include <vector>
#include <algorithm>
#include <iostream>
#include <fstream>
#include "../Landscape/ls.h"
#include "../BatchALMaSS/PopulationManager.h"
#include "../BatchALMaSS/AOR_Probe.h"
#include "../Skylark/skylarks_all.h"
#include "../Skylark/skylarks_toletov.h"

Macros

#define __CJTDebug_7
 

Functions

bool CompareDist (const APoint i, const APoint j)
 

Variables

int g_stopdate = July + 14
 
Landscapeg_land
 
FILE * StriglingMort
 
const string SimulationName = "Skylark"
 
CfgInt cfg_SkStartNos
 The number of skylarks that start in the simulation. More...
 
CfgInt cfg_PmEventfrequency
 
CfgInt cfg_PmEventsize
 
CfgInt cfg_CatastropheEventStartYear
 
CfgFloat cfg_Skylark_nestling_NOEL
 Can be used to trigger a response to pesticides for the nestlings. More...
 
CfgFloat cfg_Skylark_nestling_Biodegredation
 The proportion of pesticide accumulated from one day to the next. More...
 
CfgFloat cfg_Skylark_prefledegling_NOEL
 Used for determining the pesticide response for prefledglings. More...
 
CfgFloat cfg_Skylark_prefledegling_Biodegredation
 The proportion of pesticide remaining from one day to the next for prefledglings. More...
 
CfgFloat cfg_Skylark_male_NOEL
 Can be used to trigger a response to pesticides for the males. More...
 
CfgFloat cfg_Skylark_male_Biodegredation
 The proportion of pesticide remaining from one day to the next for males. More...
 
CfgFloat cfg_Skylark_female_NOEL
 Can be used to trigger a response to pesticides for the females. More...
 
CfgFloat cfg_Skylark_female_Biodegredation
 The proportion of pesticide remaining from one day to the next for females. More...
 
CfgInt cfg_fecundity_reduc
 
CfgInt cfg_fecundity_reduc_chance
 
CfgInt cfg_insecticide_direct_mortE
 
CfgInt cfg_insecticide_direct_mortN
 
CfgInt cfg_insecticide_direct_mortP
 
CfgInt cfg_insecticide_direct_mortM
 
CfgInt cfg_insecticide_direct_mortF
 
CfgFloat cfg_skylark_pesticide_globaleggshellreduction
 The proportion of eggs assumed to crack from pesticide effects as a global effect. More...
 
CfgFloat cfg_skylark_pesticide_eggshellreduction
 The proportion of eggs assumed to crack from pesticide effects. More...
 
CfgBool cfg_skylark_pesticide_eggshellreduction_perclutch
 If true egg shell reduction works at clutch level, if false it is considered per egg. More...
 
CfgFloat cfg_MaleSplitScale
 
CfgFloat cfg_MinDaysToHatch
 The time taken to egg hatch under optimal conditions. More...
 
CfgFloat cfg_PEmax
 
CfgInt cfg_NestLeavingChance
 
CfgFloat cfg_NestLeavingWeight
 
CfgInt cfg_ClutchMortProb
 
CfgInt cfg_NestlingMortProb
 
CfgInt cfg_PreFledgeMortProb
 
CfgFloat cfg_MeanHatchingWeight
 
CfgFloat cfg_tramline_foraging
 
CfgFloat cfg_Cooling_Rate_Eggs
 Maximum immigration mortality for females. More...
 
CfgFloat cfg_EggTemp
 
CfgFloat cfg_MD_Threshold
 
CfgFloat cfg_MeanExtractionRatePerMinute
 
CfgFloat cfg_SK_hindrance_scale
 
CfgInt cfg_FoodTripsPerDay
 
CfgFloat cfg_sk_triplength
 
CfgInt cfg_Breed_Res_Thresh1
 
CfgFloat cfg_ConversionEffReduc
 
CfgFloat cfg_EM_Nestling_a
 
CfgFloat cfg_EM_Nestling_b
 
CfgInt cfg_strigling_preflg
 
CfgInt cfg_strigling_nestling
 
CfgInt cfg_strigling_clutch
 
CfgFloat cfg_FemaleMinTerritoryAcceptScore
 
CfgFloat cfg_NestPlacementMinQual
 
CfgInt cfg_HQualityOpenTallVeg
 
CfgInt cfg_HQualityTall
 
CfgInt cfg_HQualityTall2
 
CfgInt cfg_HQualityTrack
 
CfgInt cfg_HQualityMetalRoad
 
CfgInt cfg_HQualityHedgeScrub
 
CfgInt cfg_HQualityNeutral
 
CfgInt cfg_HQualityHedge
 
CfgInt cfg_HQualityTallVeg
 
CfgInt cfg_HQualityWater
 
CfgInt cfg_HQualityVeg30cm
 
CfgInt cfg_HQualityBareEarth
 
CfgInt cfg_PatchyPremium
 
CfgInt cfg_SkTramlinesPremium
 
CfgFloat cfg_SkScrapesPremiumII
 
CfgFloat cfg_hindconstantH_b
 
CfgFloat cfg_hindconstantD_b
 
CfgFloat cfg_densityconstant_a
 
CfgFloat cfg_densityconstant_b
 
CfgInt cfg_densityconstant_c
 
CfgFloat cfg_heightconstant_a
 
CfgFloat cfg_heightconstant_b
 
CfgInt cfg_heightconstant_c
 
CfgInt cfg_SkylarkFirstBreedingDate
 The date at which breeding start can happen. More...
 
CfgFloat cfg_ReturnProbability
 Used to change the timing of start of arrival in the landscape. More...
 
CfgInt cfg_juvreturnmort
 Immigration mortality for juveniles. More...
 
CfgInt cfg_adultreturnmort
 Immigration mortality for juveniles. More...
 
CfgFloat cfg_maxfeedrain
 
CfgInt cfg_rainhindpow
 
CfgInt cfg_temphindpow
 
CfgBool cfg_ReallyBigOutputMonthly_used
 
CfgBool cfg_CfgRipleysOutputUsed
 
CfgBool cfg_AorOutput_used
 
CfgBool cfg_ReallyBigOutputUsed
 
const double EM_nest_T [14]
 
const double CE_nest [15]
 
static double NestLeavingWeight
 
static int ClutchMortProb
 
static int NestlingMortProb
 
static int PreFledgeMortProb
 
static double MeanHatchingWeight
 
static double Cooling_Rate_Eggs
 
static double EggTemp
 
static double MD_Threshold
 
static double MeanExtractionRatePerMinute
 
static int FoodTripsPerDay
 
static int Breed_Res_Thresh1
 
static double MD_Hatch
 
const int terrnos [6] = {0, 1, 2, 4, 5, 10}
 
const int terrsize [6] = {0, 500, 250, 125, 100, 50}
 
const double VegQuality [31]
 
const double KcalPerGInsect = 5.0
 
const double KcalPerGInsect_inv = 1.0 / KcalPerGInsect
 
const double KcalPerGInsect_kg_inv = KcalPerGInsect_inv / 1000.0
 
const double EM_coldblood1 = 0.4257
 
const double EM_coldblood2 = 0.482
 
const double EM_warmblood1 = 0.3456
 
const double EM_warmblood2 = 5.9856
 
const int HomeRangeDiameter = 280
 
const int HomeRangeDiameterDiv20 = 14
 
double RainHindrance [21]
 
double TempHindrance [31]
 
double VegHindranceH [111]
 
double VegHindranceD [111]
 
double DensityScore [111]
 
double HeightScore [111]
 
double TerrHeterogeneity [1000]
 
const double VeryHighDensityVeg = 2200.0
 
double MaxFeedRain
 
int JuvenileReturnMort
 
const double Breed_Res_Thresh2 = Breed_Res_Thresh1 * 4
 
const double Breed_Temp_Thresh = 5.0
 
const double ExtraBroodHeat = 2.4 / KcalPerGInsect
 
double IsTramline
 
double NotTramline
 
double FemaleNestAcceptScore
 
double XFNestAcceptScore
 
double NestPlacementMinQual = 15
 The minimum quality for nest placement. More...
 
int HQualityOpenTallVeg = 16
 
int HQualityTall = 0
 
int HQualityTall2 = -1000
 
int HQualityTrack = 10
 
int HQualityMetalRoad = -10
 
int HQualityHedgeScrub = 0
 
int HQualityNeutral = 0
 
int HQualityHedge = -1050
 
int HQualityWater = 0
 
int HQualityVeg30cm = 11
 
int PatchyPremium = 10
 
int HQualityTallVeg = 1
 
int HQualityBareEarth = 0
 
int TramlinePremium = 5
 
int HQualityGood = 30
 
CfgInt g_map_maxpolyref
 

Macro Definition Documentation

◆ __CJTDebug_7

#define __CJTDebug_7

Function Documentation

◆ CompareDist()

bool CompareDist ( const APoint  i,
const APoint  j 
)
142 { return i.m_y > j.m_y; }

References APoint::m_y.

Referenced by SkTerritories::GetTerritoriesByDistance().

Variable Documentation

◆ Breed_Res_Thresh1

int Breed_Res_Thresh1
static

◆ Breed_Res_Thresh2

const double Breed_Res_Thresh2 = Breed_Res_Thresh1 * 4

◆ Breed_Temp_Thresh

const double Breed_Temp_Thresh = 5.0

◆ CE_nest

const double CE_nest[15]
Initial value:
=
{
0, 0, 0.91082709, 0.827867467, 0.752463941, 0.683928293, 0.621634983, 0.565015451, 0.513552918, 0.466777677, 0.424262801, 0.38562025,
0.350497326, 0.318573455, 0.289557263
}

Referenced by Skylark_Nestling::On_FoodSupply().

◆ cfg_adultreturnmort

CfgInt cfg_adultreturnmort

Immigration mortality for juveniles.

Referenced by Skylark_Population_Manager::DoFirst().

◆ cfg_AorOutput_used

◆ cfg_Breed_Res_Thresh1

CfgInt cfg_Breed_Res_Thresh1

◆ cfg_CatastropheEventStartYear

CfgInt cfg_CatastropheEventStartYear

The first year for catastrophes

Referenced by Skylark_Population_Manager::Catastrophe().

◆ cfg_CfgRipleysOutputUsed

CfgBool cfg_CfgRipleysOutputUsed

◆ cfg_ClutchMortProb

CfgInt cfg_ClutchMortProb

◆ cfg_ConversionEffReduc

CfgFloat cfg_ConversionEffReduc

◆ cfg_Cooling_Rate_Eggs

CfgFloat cfg_Cooling_Rate_Eggs

Maximum immigration mortality for females.

Minimum immigration mortality for females

Maximum immigration mortality for males

Minimum immigration mortality for males

Referenced by Skylark_Population_Manager::LoadParameters().

◆ cfg_densityconstant_a

CfgFloat cfg_densityconstant_a

◆ cfg_densityconstant_b

CfgFloat cfg_densityconstant_b

◆ cfg_densityconstant_c

CfgInt cfg_densityconstant_c

◆ cfg_EggTemp

◆ cfg_EM_Nestling_a

CfgFloat cfg_EM_Nestling_a

◆ cfg_EM_Nestling_b

CfgFloat cfg_EM_Nestling_b

◆ cfg_fecundity_reduc

CfgInt cfg_fecundity_reduc

◆ cfg_fecundity_reduc_chance

CfgInt cfg_fecundity_reduc_chance

◆ cfg_FemaleMinTerritoryAcceptScore

◆ cfg_FoodTripsPerDay

CfgInt cfg_FoodTripsPerDay

◆ cfg_heightconstant_a

CfgFloat cfg_heightconstant_a

◆ cfg_heightconstant_b

CfgFloat cfg_heightconstant_b

◆ cfg_heightconstant_c

CfgInt cfg_heightconstant_c

◆ cfg_hindconstantD_b

CfgFloat cfg_hindconstantD_b

◆ cfg_hindconstantH_b

CfgFloat cfg_hindconstantH_b

◆ cfg_HQualityBareEarth

CfgInt cfg_HQualityBareEarth

◆ cfg_HQualityHedge

CfgInt cfg_HQualityHedge

◆ cfg_HQualityHedgeScrub

CfgInt cfg_HQualityHedgeScrub

◆ cfg_HQualityMetalRoad

CfgInt cfg_HQualityMetalRoad

◆ cfg_HQualityNeutral

CfgInt cfg_HQualityNeutral

◆ cfg_HQualityOpenTallVeg

CfgInt cfg_HQualityOpenTallVeg

◆ cfg_HQualityTall

CfgInt cfg_HQualityTall

◆ cfg_HQualityTall2

CfgInt cfg_HQualityTall2

◆ cfg_HQualityTallVeg

CfgInt cfg_HQualityTallVeg

◆ cfg_HQualityTrack

CfgInt cfg_HQualityTrack

◆ cfg_HQualityVeg30cm

CfgInt cfg_HQualityVeg30cm

◆ cfg_HQualityWater

CfgInt cfg_HQualityWater

◆ cfg_insecticide_direct_mortE

CfgInt cfg_insecticide_direct_mortE

◆ cfg_insecticide_direct_mortF

CfgInt cfg_insecticide_direct_mortF

◆ cfg_insecticide_direct_mortM

CfgInt cfg_insecticide_direct_mortM

◆ cfg_insecticide_direct_mortN

CfgInt cfg_insecticide_direct_mortN

◆ cfg_insecticide_direct_mortP

CfgInt cfg_insecticide_direct_mortP

◆ cfg_juvreturnmort

CfgInt cfg_juvreturnmort

Immigration mortality for juveniles.

Referenced by Skylark_Population_Manager::Skylark_Population_Manager().

◆ cfg_MaleSplitScale

CfgFloat cfg_MaleSplitScale

Referenced by SkTerritories::Split().

◆ cfg_maxfeedrain

◆ cfg_MD_Threshold

CfgFloat cfg_MD_Threshold

◆ cfg_MeanExtractionRatePerMinute

CfgFloat cfg_MeanExtractionRatePerMinute

◆ cfg_MeanHatchingWeight

CfgFloat cfg_MeanHatchingWeight

◆ cfg_MinDaysToHatch

CfgFloat cfg_MinDaysToHatch

The time taken to egg hatch under optimal conditions.

Referenced by Skylark_Population_Manager::LoadParameters().

◆ cfg_NestLeavingChance

CfgInt cfg_NestLeavingChance

◆ cfg_NestLeavingWeight

CfgFloat cfg_NestLeavingWeight

◆ cfg_NestlingMortProb

CfgInt cfg_NestlingMortProb

◆ cfg_NestPlacementMinQual

CfgFloat cfg_NestPlacementMinQual

◆ cfg_PatchyPremium

CfgInt cfg_PatchyPremium

◆ cfg_PEmax

◆ cfg_PmEventfrequency

CfgInt cfg_PmEventfrequency

The frequency of catastrophes

Referenced by Skylark_Population_Manager::Catastrophe().

◆ cfg_PmEventsize

CfgInt cfg_PmEventsize

The size of catastrophes

Referenced by Skylark_Population_Manager::Catastrophe().

◆ cfg_PreFledgeMortProb

CfgInt cfg_PreFledgeMortProb

◆ cfg_rainhindpow

CfgInt cfg_rainhindpow

◆ cfg_ReallyBigOutputMonthly_used

CfgBool cfg_ReallyBigOutputMonthly_used

◆ cfg_ReallyBigOutputUsed

CfgBool cfg_ReallyBigOutputUsed

Raw data for spatial output for calculating Ripley's spatial statistics with additional information about habitat and physiology

Referenced by Skylark_Population_Manager::Init(), Population_Manager::Run(), and Population_Manager::~Population_Manager().

◆ cfg_ReturnProbability

CfgFloat cfg_ReturnProbability

Used to change the timing of start of arrival in the landscape.

Referenced by Skylark_Female::st_Emigrating(), and Skylark_Male::st_Emigrating().

◆ cfg_SK_hindrance_scale

CfgFloat cfg_SK_hindrance_scale

◆ cfg_sk_triplength

CfgFloat cfg_sk_triplength

◆ cfg_SkScrapesPremiumII

CfgFloat cfg_SkScrapesPremiumII

◆ cfg_SkStartNos

CfgInt cfg_SkStartNos

The number of skylarks that start in the simulation.

Parameters under control of the config file *******************

Referenced by Skylark_Population_Manager::Init().

◆ cfg_SkTramlinesPremium

CfgInt cfg_SkTramlinesPremium

◆ cfg_Skylark_female_Biodegredation

CfgFloat cfg_Skylark_female_Biodegredation

The proportion of pesticide remaining from one day to the next for females.

◆ cfg_Skylark_female_NOEL

CfgFloat cfg_Skylark_female_NOEL

Can be used to trigger a response to pesticides for the females.

◆ cfg_Skylark_male_Biodegredation

CfgFloat cfg_Skylark_male_Biodegredation

The proportion of pesticide remaining from one day to the next for males.

◆ cfg_Skylark_male_NOEL

CfgFloat cfg_Skylark_male_NOEL

Can be used to trigger a response to pesticides for the males.

◆ cfg_Skylark_nestling_Biodegredation

CfgFloat cfg_Skylark_nestling_Biodegredation

The proportion of pesticide accumulated from one day to the next.

◆ cfg_Skylark_nestling_NOEL

CfgFloat cfg_Skylark_nestling_NOEL

Can be used to trigger a response to pesticides for the nestlings.

◆ cfg_skylark_pesticide_eggshellreduction

CfgFloat cfg_skylark_pesticide_eggshellreduction

The proportion of eggs assumed to crack from pesticide effects.

Referenced by Skylark_Female::st_Laying().

◆ cfg_skylark_pesticide_eggshellreduction_perclutch

CfgBool cfg_skylark_pesticide_eggshellreduction_perclutch

If true egg shell reduction works at clutch level, if false it is considered per egg.

Referenced by Skylark_Female::st_Laying().

◆ cfg_skylark_pesticide_globaleggshellreduction

CfgFloat cfg_skylark_pesticide_globaleggshellreduction

The proportion of eggs assumed to crack from pesticide effects as a global effect.

Referenced by Skylark_Female::st_Laying().

◆ cfg_Skylark_prefledegling_Biodegredation

CfgFloat cfg_Skylark_prefledegling_Biodegredation

The proportion of pesticide remaining from one day to the next for prefledglings.

◆ cfg_Skylark_prefledegling_NOEL

CfgFloat cfg_Skylark_prefledegling_NOEL

Used for determining the pesticide response for prefledglings.

◆ cfg_SkylarkFirstBreedingDate

CfgInt cfg_SkylarkFirstBreedingDate

The date at which breeding start can happen.

Referenced by Skylark_Female::st_BuildingUpResources().

◆ cfg_strigling_clutch

CfgInt cfg_strigling_clutch

◆ cfg_strigling_nestling

CfgInt cfg_strigling_nestling

◆ cfg_strigling_preflg

CfgInt cfg_strigling_preflg

◆ cfg_temphindpow

CfgInt cfg_temphindpow

◆ cfg_tramline_foraging

◆ ClutchMortProb

◆ Cooling_Rate_Eggs

double Cooling_Rate_Eggs
static

◆ DensityScore

◆ EggTemp

◆ EM_coldblood1

const double EM_coldblood1 = 0.4257

◆ EM_coldblood2

const double EM_coldblood2 = 0.482

◆ EM_nest_T

const double EM_nest_T[14]
Initial value:
= {
0.0, 0.04958283, 0.077473171, 0.117759221, 0.148748489, 0.179737758, 0.322288393, 0.362574442, 0.38426693, 0.409058345, 0.436948687,
0.399761565, 0.418355126, 0.440047614,
}

Referenced by Skylark_Nestling::st_Developing().

◆ EM_warmblood1

const double EM_warmblood1 = 0.3456

◆ EM_warmblood2

const double EM_warmblood2 = 5.9856

◆ ExtraBroodHeat

const double ExtraBroodHeat = 2.4 / KcalPerGInsect

◆ FemaleNestAcceptScore

double FemaleNestAcceptScore

◆ FoodTripsPerDay

◆ g_land

◆ g_map_maxpolyref

CfgInt g_map_maxpolyref

This is the maximum polygon reference number allowed in the 'a_polyfile' and 'a_mapfile' supplied to the Landscape object constructor.

◆ g_stopdate

◆ HeightScore

◆ HomeRangeDiameter

const int HomeRangeDiameter = 280

◆ HomeRangeDiameterDiv20

const int HomeRangeDiameterDiv20 = 14

◆ HQualityBareEarth

◆ HQualityGood

int HQualityGood = 30

◆ HQualityHedge

◆ HQualityHedgeScrub

◆ HQualityMetalRoad

◆ HQualityNeutral

int HQualityNeutral = 0

◆ HQualityOpenTallVeg

int HQualityOpenTallVeg = 16

◆ HQualityTall

◆ HQualityTall2

◆ HQualityTallVeg

◆ HQualityTrack

int HQualityTrack = 10

◆ HQualityVeg30cm

int HQualityVeg30cm = 11

◆ HQualityWater

◆ IsTramline

double IsTramline

◆ JuvenileReturnMort

◆ KcalPerGInsect

const double KcalPerGInsect = 5.0

◆ KcalPerGInsect_inv

const double KcalPerGInsect_inv = 1.0 / KcalPerGInsect

◆ KcalPerGInsect_kg_inv

const double KcalPerGInsect_kg_inv = KcalPerGInsect_inv / 1000.0

◆ MaxFeedRain

◆ MD_Hatch

◆ MD_Threshold

double MD_Threshold
static

◆ MeanExtractionRatePerMinute

double MeanExtractionRatePerMinute
static

◆ MeanHatchingWeight

◆ NestLeavingWeight

double NestLeavingWeight
static

◆ NestlingMortProb

◆ NestPlacementMinQual

double NestPlacementMinQual = 15

The minimum quality for nest placement.

Referenced by Skylark_Population_Manager::LoadParameters().

◆ NotTramline

double NotTramline

◆ PatchyPremium

◆ PreFledgeMortProb

◆ RainHindrance

◆ SimulationName

const string SimulationName = "Skylark"

◆ StriglingMort

FILE* StriglingMort

◆ TempHindrance

◆ TerrHeterogeneity

double TerrHeterogeneity[1000]

◆ terrnos

const int terrnos[6] = {0, 1, 2, 4, 5, 10}

◆ terrsize

const int terrsize[6] = {0, 500, 250, 125, 100, 50}

◆ TramlinePremium

int TramlinePremium = 5

◆ VegHindranceD

◆ VegHindranceH

◆ VegQuality

const double VegQuality[31]
Initial value:
= {
30, 30, 29.6, 27.2, 24.8, 23, 21.2, 19.6, 18.2, 17, 15.8, 15, 14.2, 13.6, 13, 12.6, 12.2, 12, 11.8, 11.6, 11.6, 11.6, 11.6, 11.6, 11.6, 11.6,
11.4, 11.4, 11.2, 11.2, 10.8
}

◆ VeryHighDensityVeg

const double VeryHighDensityVeg = 2200.0

◆ XFNestAcceptScore

double XFNestAcceptScore
APoint::m_y
int m_y
Definition: ALMaSS_Setup.h:56