ALMaSS Skylark ODDox  1.1
The skylark model description following ODdox protocol
Skylark_Adult Class Reference

#include <skylarks_all.h>

Public Member Functions

 Skylark_Adult (int x, int y, double size, int age, SkTerritories *Terrs, Landscape *L, Skylark_Population_Manager *SPM, int bx, int by, int mh)
 
virtual void ReInit (int x, int y, double size, int age, SkTerritories *Terrs, Landscape *L, Skylark_Population_Manager *SPM, int bx, int by, int mh)
 
virtual ~Skylark_Adult ()
 
virtual void CopyMyself (int a_sktype)
 
- Public Member Functions inherited from Skylark_Base
 Skylark_Base (int x, int y, SkTerritories *Terrs, Landscape *L, Skylark_Population_Manager *SPM, int bx, int by, int mh)
 
virtual void ReInit (int x, int y, SkTerritories *Terrs, Landscape *L, Skylark_Population_Manager *SPM, int bx, int by, int mh)
 
virtual double On_FoodSupply (double)
 
void AddStriglingMort (int lifestage)
 
virtual int WhatState ()
 
bool InSquare (rectangle R)
 
- 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 BeginStep (void)
 BeingStep behaviour - must be implemented in descendent classes. More...
 
virtual void Step (void)
 Step behaviour - must be implemented in descendent classes. More...
 
virtual void EndStep (void)
 EndStep behaviour - must be implemented in descendent classes. More...
 
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)
 
virtual bool OnFarmEvent (FarmToDo)
 
- 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...
 

Public Attributes

bool Paired
 
- Public Attributes inherited from Skylark_Base
double m_pesticide_accumulation
 
double m_pcide_conc
 
TTypesOfSkState m_CurrentSkState
 
int Age
 
double m_Size
 
int m_Born_x
 
int m_Born_y
 
int m_MyHome
 The vegetation type where the skylark was born. More...
 
SkTerritoriesm_OurTerritories
 
Skylark_Population_Managerm_OurPopulationManager
 

Protected Member Functions

virtual double RemoveEM (double food)
 
double GetVegHindrance (int PolyRef)
 
double GetWeatherHindrance ()
 
bool GetBadWeather ()
 Extreme weather conditions check. More...
 
- Protected Member Functions inherited from Skylark_Base
bool DailyMortality (int mort)
 
virtual void PesticideResponse ()
 
- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 

Protected Attributes

int GoodWeather
 
bool BSuccess
 
double MyExtractEff
 
int m_pesticide_affected
 
skTerritory_struct MyTerritory
 
vector< APoint > * m_aTerrlist
 
- Protected Attributes inherited from TAnimal
int m_Location_x
 
int m_Location_y
 
Landscapem_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...
 

Constructor & Destructor Documentation

◆ Skylark_Adult()

Skylark_Adult::Skylark_Adult ( int  x,
int  y,
double  size,
int  age,
SkTerritories Terrs,
Landscape L,
Skylark_Population_Manager SPM,
int  bx,
int  by,
int  mh 
)
3678  : Skylark_Base(x, y, Terrs, L, SPM, bx, by, mh) {
3679  m_Size = size;
3680  Age = age;
3681  BSuccess = false;
3682  MyExtractEff = (0.90 + double(random(21) / 100.0)) * MeanExtractionRatePerMinute;
3683  GoodWeather = 0;
3684  Paired = false;
3685  MyTerritory.ref = -1;
3687  m_pesticide_affected = -1;
3688 }

References Skylark_Base::Age, BSuccess, GoodWeather, m_aTerrlist, m_pesticide_affected, Skylark_Base::m_Size, MeanExtractionRatePerMinute, MyExtractEff, MyTerritory, Paired, and skTerritory_struct::ref.

◆ ~Skylark_Adult()

Skylark_Adult::~Skylark_Adult ( )
virtual
3704  {
3705  delete m_aTerrlist;
3706 }

References m_aTerrlist.

Member Function Documentation

◆ CopyMyself()

void Skylark_Adult::CopyMyself ( int  a_sktype)
virtual

◆ GetBadWeather()

bool Skylark_Adult::GetBadWeather ( )
protected

◆ GetVegHindrance()

double Skylark_Adult::GetVegHindrance ( int  PolyRef)
protected
3760  {
3761 #ifdef __CJTDebug_5
3762  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
3763 #endif
3764  /* CJT Changed in favour of a function of veg density double veg_biomass = m_OurLandscape->SupplyVegBiomass(polyref);
3765  double veg_height = m_OurLandscape->SupplyVegHeight(polyref); int bio = (int)floor(0.5+veg_biomass/(VeryHighDensityVeg/
3766  double(HindranceBiomassCategories))); // 0-24, 25-49, 50-74,74-100 categories
3767  int hei=(int)floor(0.5+veg_height/(100.0/double(HindranceHeightCategories)));
3768  if (hei>HindranceHeightCategories-1) hei=HindranceHeightCategories-1;
3769  if (bio>HindranceBiomassCategories-1) bio=HindranceBiomassCategories-1; return VegHindrance[hei][bio]; */
3770  if ( m_OurLandscape->SupplyVegPatchy( polyref ) ) return 1.0;
3771  int veg_height = ( int )floor( 0.5 + m_OurLandscape->SupplyVegHeight( polyref ) );
3772  if ( veg_height < 26 ) return 1.0;
3773  int veg_dens = m_OurLandscape->SupplyVegDensity( polyref );
3774  // double vh = ( VegHindranceH[ veg_height ] * 2 + VegHindranceD[ veg_dens ] ) / 3.0;
3775  //double vh = (0.33*( DensityScore[ veg_dens ] + 2 * HeightScore[ ( int )veg_height ] ) * 0.33333333)+0.67;
3776  double vh = ( VegHindranceD[ veg_dens ] + 2 * VegHindranceH[ veg_height ] ) * 0.3333;
3777 #ifdef __TRAMLINES_ON
3778  // Tramlines affect the amount of veg hindrance only
3779  // vh must be increased by a factor corresponding to the tramline effect
3780  // IF USING SKLARK SCRAPES !
3781  if ( m_OurLandscape->SupplySkScrapes( polyref )) {
3782  vh += ( ( 1.0 - vh ) * cfg_tramline_foraging.value() );
3783  }
3784  else if ( m_OurLandscape->SupplyHasTramlines( polyref )) {
3785  vh += ( ( 1.0 - vh ) * cfg_tramline_foraging.value() );
3786  }
3787 #endif
3788  return vh;
3789 }

References cfg_tramline_foraging, TAnimal::m_OurLandscape, Landscape::SupplyHasTramlines(), Landscape::SupplySkScrapes(), Landscape::SupplyVegDensity(), Landscape::SupplyVegHeight(), Landscape::SupplyVegPatchy(), VegHindranceD, and VegHindranceH.

Referenced by Skylark_Male::GetFood().

◆ GetWeatherHindrance()

double Skylark_Adult::GetWeatherHindrance ( )
protected
3740  {
3741 #ifdef __CJTDebug_5
3742  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
3743 #endif
3744  double hind;
3745  int rain = (int) m_OurLandscape->SupplyRain()/2;
3746  // Assume half of this falls at night
3747  // Make sure the indices remain in bounds
3748  if ( rain > 10 ) rain = 10;
3749  int temp = (int) (floor( 0.5 + m_OurLandscape->SupplyTemp() ));
3750  if ( temp < 0 ) temp = 0;
3751  if ( temp > 20 ) temp = 20;
3752  hind = RainHindrance[rain];
3753  hind *= TempHindrance[ temp ];
3754  return hind;
3755 }

References TAnimal::m_OurLandscape, RainHindrance, Landscape::SupplyRain(), Landscape::SupplyTemp(), and TempHindrance.

Referenced by Skylark_Male::GetFood().

◆ ReInit()

void Skylark_Adult::ReInit ( int  x,
int  y,
double  size,
int  age,
SkTerritories Terrs,
Landscape L,
Skylark_Population_Manager SPM,
int  bx,
int  by,
int  mh 
)
virtual

Reimplemented in Skylark_Male, and Skylark_Female.

3690  {
3691  Skylark_Base::ReInit(x, y, Terrs, L, SPM, bx, by, mh);
3692  m_Size = size;
3693  Age = age;
3694  BSuccess = false;
3695  MyExtractEff = (0.90 + double(random(21) / 100.0)) * MeanExtractionRatePerMinute;
3696  GoodWeather = 0;
3697  Paired = false;
3698  MyTerritory.ref = -1;
3700  m_pesticide_affected = -1;
3701 }

References Skylark_Base::Age, BSuccess, GoodWeather, m_aTerrlist, m_pesticide_affected, Skylark_Base::m_Size, MeanExtractionRatePerMinute, MyExtractEff, MyTerritory, Paired, skTerritory_struct::ref, and Skylark_Base::ReInit().

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

◆ RemoveEM()

double Skylark_Adult::RemoveEM ( double  food)
protectedvirtual
3717  {
3718 #ifdef __CJTDebug_5
3719  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
3720 #endif
3721  // remove metabolic requirements
3722  double used = m_OurPopulationManager->SupplyEMi();
3723 #ifdef __PESTICIDE_RA_ADULT
3724  // If using pesticide risk assessment then the total mg of pesticide collected that day are now in m_pcide
3725  // But, there well be more than we wanted, so now we take a mean as mg/kcal resource
3726  m_pcide_conc = m_pcide/food;
3727  // Note there is an assumption here that they only eat insects. We know this to be incorrect so depending upon the
3728  // aim of the assessment the line below may need to be modified (e.g. by scaling by the relative calorific content of
3729  // insects compared to plant matter.
3731 #endif
3732  food -=used;
3733  if ( food < 0 ) food = 0;
3734  return food; // Food still in gdw insects
3735 }

References Skylark_Base::m_OurPopulationManager, Skylark_Base::m_pcide_conc, Skylark_Base::m_pesticide_accumulation, and Skylark_Population_Manager::SupplyEMi().

Referenced by Skylark_Female::FeedYoung(), Skylark_Male::st_CaringForYoung(), and Skylark_Female::st_PreparingForBreeding().

Member Data Documentation

◆ BSuccess

◆ GoodWeather

◆ m_aTerrlist

◆ m_pesticide_affected

◆ MyExtractEff

double Skylark_Adult::MyExtractEff
protected

◆ MyTerritory

◆ Paired


The documentation for this class was generated from the following files:
Landscape::SupplyTemp
double SupplyTemp(void)
Definition: Landscape.h:1386
AdultSkylark_struct::sex
bool sex
Definition: skylarks_all.h:254
Landscape::SupplySkScrapes
bool SupplySkScrapes(int a_polyref)
Definition: Landscape.h:981
Skylark_struct::L
Landscape * L
Definition: skylarks_all.h:203
TAnimal::m_OurLandscape
Landscape * m_OurLandscape
Definition: PopulationManager.h:229
AdultSkylark_struct::age
int age
Definition: skylarks_all.h:255
Skylark_struct::by
int by
Definition: skylarks_all.h:201
Skylark_Base::m_Born_y
int m_Born_y
Definition: skylarks_all.h:598
Skylark_struct::x
int x
Definition: skylarks_all.h:198
skTerritory_struct::ref
int ref
Definition: skylarks_all.h:311
Skylark_Base::m_OurTerritories
SkTerritories * m_OurTerritories
Definition: skylarks_all.h:602
RainHindrance
double RainHindrance[21]
Definition: skylarks_all.cpp:214
Landscape::SupplyVegDensity
int SupplyVegDensity(int a_polyref)
Definition: Landscape.h:975
Skylark_Adult::m_pesticide_affected
int m_pesticide_affected
Definition: skylarks_all.h:742
AdultSkylark_struct::size
double size
Definition: skylarks_all.h:253
Skylark_Base::m_MyHome
int m_MyHome
The vegetation type where the skylark was born.
Definition: skylarks_all.h:600
TAnimal::m_Location_y
int m_Location_y
Definition: PopulationManager.h:228
vector
Skylark_Base::Age
int Age
Definition: skylarks_all.h:595
VegHindranceH
double VegHindranceH[111]
Definition: skylarks_all.cpp:216
Landscape::SupplyVegPatchy
bool SupplyVegPatchy(int a_polyref)
Definition: Landscape.h:986
Skylark_Base::Skylark_Base
Skylark_Base(int x, int y, SkTerritories *Terrs, Landscape *L, Skylark_Population_Manager *SPM, int bx, int by, int mh)
Definition: skylarks_all.cpp:2435
Skylark_Population_Manager::SupplyEMi
double SupplyEMi()
Definition: skylarks_all.h:558
Skylark_struct::Terrs
SkTerritories * Terrs
Definition: skylarks_all.h:204
Landscape::SupplyHasTramlines
bool SupplyHasTramlines(int a_x, int a_y)
Definition: Landscape.h:1252
Skylark_Adult::Paired
bool Paired
Definition: skylarks_all.h:752
Skylark_Base::m_Born_x
int m_Born_x
Definition: skylarks_all.h:597
Skylark_Adult::m_aTerrlist
vector< APoint > * m_aTerrlist
Definition: skylarks_all.h:744
Landscape::SupplyRain
double SupplyRain(void)
Definition: Landscape.h:1365
Skylark_Base::m_pesticide_accumulation
double m_pesticide_accumulation
Definition: skylarks_all.h:592
Skylark_Adult::GoodWeather
int GoodWeather
Definition: skylarks_all.h:739
Skylark_Base::ReInit
virtual void ReInit(int x, int y, SkTerritories *Terrs, Landscape *L, Skylark_Population_Manager *SPM, int bx, int by, int mh)
Definition: skylarks_all.cpp:2449
Landscape::SupplyVegHeight
double SupplyVegHeight(int a_polyref)
Definition: Landscape.h:936
Skylark_Base::m_Size
double m_Size
Definition: skylarks_all.h:596
AdultSkylark_struct
Definition: skylarks_all.h:250
cfg_tramline_foraging
CfgFloat cfg_tramline_foraging
Skylark_Adult::MyExtractEff
double MyExtractEff
Definition: skylarks_all.h:741
Skylark_Base::m_OurPopulationManager
Skylark_Population_Manager * m_OurPopulationManager
Definition: skylarks_all.h:603
Skylark_struct::y
int y
Definition: skylarks_all.h:199
TempHindrance
double TempHindrance[31]
Definition: skylarks_all.cpp:215
Skylark_Population_Manager::CreateObjects
void CreateObjects(int ob_type, TAnimal *pTAo, void *null, Skylark_struct *data, int number)
Definition: skylarks_all.cpp:557
VegHindranceD
double VegHindranceD[111]
Definition: skylarks_all.cpp:217
Skylark_Base::m_pcide_conc
double m_pcide_conc
Definition: skylarks_all.h:593
Skylark_struct::mh
int mh
Definition: skylarks_all.h:202
Skylark_Adult::MyTerritory
skTerritory_struct MyTerritory
Definition: skylarks_all.h:743
MeanExtractionRatePerMinute
static double MeanExtractionRatePerMinute
Definition: skylarks_all.cpp:183
TAnimal::m_Location_x
int m_Location_x
Definition: PopulationManager.h:225
Skylark_struct::bx
int bx
Definition: skylarks_all.h:200
Skylark_Adult::BSuccess
bool BSuccess
Definition: skylarks_all.h:740