Loading [MathJax]/extensions/ams.js
ALMaSS  1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Skylark_Female Class Reference

#include <skylarks_all.h>

Inheritance diagram for Skylark_Female:
Skylark_Adult Skylark_Base TAnimal TALMaSSObject

Public Member Functions

 Skylark_Female (int x, int y, double size, int age, SkTerritories *Terrs, Landscape *L, Skylark_Population_Manager *SPM, int bx, int by, int mh)
 
void ReInit (int x, int y, double size, int age, SkTerritories *Terrs, Landscape *L, Skylark_Population_Manager *SPM, int bx, int by, int mh) override
 
void BeginStep (void) override
 BeingStep behaviour - must be implemented in descendent classes. More...
 
void Step (void) override
 Step behaviour - must be implemented in descendent classes. More...
 
void EndStep (void) override
 EndStep behaviour - must be implemented in descendent classes. More...
 
void EstablishTerritory ()
 
int Supply_NestTime () const
 
Skylark_ClutchSupplyMyClutch () const
 
int Supply_BreedingAttempts () const
 
int Supply_BreedingSuccess () const
 
void ResetBreedingSuccess ()
 
void OnSetMyClutch (Skylark_Clutch *p_C)
 
void OnEggsHatch ()
 
void OnClutchDeath ()
 
void OnBroodDeath ()
 
void OnBreedingSuccess ()
 
void OnStopFeedingChicks ()
 
void OnMateDying ()
 
void OnMateHomeless ()
 
void OnMaleNeverComesBack (const Skylark_Male *AMale)
 
void OnBreedSuccess ()
 
void SensibleCopy ()
 
- Public Member Functions inherited from 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)
 
 ~Skylark_Adult () override
 
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 (const int lifestage) const
 
int WhatState () override
 Returns the objects current state number. More...
 
bool InSquare (rectangle R) const
 
- 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...
 

Public Attributes

Skylark_MaleMyMate
 
- Public Attributes inherited from Skylark_Adult
bool Paired
 
- Public Attributes inherited from Skylark_Base
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

int st_Flocking ()
 
int st_Floating ()
 
bool st_Arriving ()
 
bool st_Immigrating ()
 
int st_Emigrating ()
 
int st_TempLeavingArea ()
 
int st_Finding_Territory ()
 
void st_Dying ()
 
int st_CaringForYoung ()
 
int st_BuildingUpResources ()
 
TTypesOfSkState st_MakingNest ()
 
int st_PreparingForBreeding ()
 
int st_GivingUpTerritory ()
 
TTypesOfSkState st_Laying ()
 
int st_StartingNewBrood ()
 
int st_EggHatching ()
 
int st_Incubating ()
 
int st_StoppingBreeding ()
 
double GetFood (int time)
 
int CalculateEggNumber () const
 
int CalcFoodTime (double target) const
 
int GetMigrationMortality ()
 
double CheckForFields () const
 
void FeedYoung ()
 
bool OnFarmEvent (FarmToDo event) override
 Must be reimplemented if used in descendent classes. Sets the action on a management event. More...
 
skSpiralResult Spiral (int x, int y, int radius)
 
skSpiralResult Spiral2 (int x, int y, int radius)
 
- Protected Member Functions inherited from Skylark_Adult
virtual double RemoveEM (double food)
 
double GetVegHindrance (int PolyRef) const
 
double GetWeatherHindrance () const
 
- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 

Protected Attributes

Skylark_ClutchMyClutch
 
int m_Counter1
 
int m_NestTime
 
bool NestLoc
 
double Resources
 
int EggCounter
 
int m_BreedingAttempts
 
int m_BreedingSuccess
 
int m_EggNumber
 
bool m_pesticide_sprayed_die
 
int m_toowet
 
double m_MinFemaleAcceptScore
 
- Protected Attributes inherited from Skylark_Adult
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
 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...
 

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...
 
- Static Protected Member Functions inherited from Skylark_Adult
static bool GetBadWeather ()
 Extreme weather conditions check. More...
 
- Static Protected Member Functions inherited from Skylark_Base
static bool DailyMortality (int mort)
 
- Static Protected Attributes inherited from TAnimal
static Landscapem_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...
 

Constructor & Destructor Documentation

◆ Skylark_Female()

Skylark_Female::Skylark_Female ( int  x,
int  y,
double  size,
int  age,
SkTerritories Terrs,
Landscape L,
Skylark_Population_Manager SPM,
int  bx,
int  by,
int  mh 
)
5018  : Skylark_Adult(x, y, size, age, Terrs, L, SPM, bx, by, mh) {
5019  MyMate = nullptr;
5020  MyClutch = nullptr;
5022  m_BreedingAttempts = 0;
5024 }

References m_BreedingAttempts, m_MinFemaleAcceptScore, MyClutch, MyMate, and ResetBreedingSuccess().

Member Function Documentation

◆ BeginStep()

void Skylark_Female::BeginStep ( void  )
overridevirtual

BeingStep behaviour - must be implemented in descendent classes.

Reimplemented from TALMaSSObject.

5209  {
5210 #ifdef __CJTDebug_5
5211  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
5212 #endif
5213  if (m_CurrentSkState == toss_Destroy) return;
5214  CheckManagement();
5216  switch (m_CurrentSkState)
5217  {
5218  case toss_FFloating: // Floating
5219  switch (st_Floating())
5220  {
5221  case 2:
5222  m_CurrentSkState = toss_FFlocking;
5223  break;
5224  case 3:
5225  m_CurrentSkState = toss_FTempLeavingArea; // -> temp.leave
5226  break;
5227  case 1:
5228  m_CurrentSkState = toss_FFindingTerritory; // -> find terr.
5229  break;
5230  case 0:
5231  break;
5232  }
5233  m_StepDone = true;
5234  break;
5235  case toss_FCaringForYoung: // CaringForYoung
5236  switch (st_CaringForYoung())
5237  {
5238  case 2: //StopBreeding
5239  m_CurrentSkState = toss_StoppingBreeding;
5240  break;
5241  case 1:
5242  m_CurrentSkState = toss_StartingNewBrood;
5243  break;
5244  default:
5245  break;
5246  }
5247  m_StepDone = true;
5248  break;
5249  default:
5250  /* char errornum[20]; sprintf(errornum, "%d", m_CurrentSkState );
5251  g_land->Warn("Skylark_Female::BeginStep(): Unknown state: ", errornum); exit(0); */
5252  break;
5253  }
5254 }

References TAnimal::CheckManagement(), Skylark_Base::m_CurrentSkState, m_MinFemaleAcceptScore, TALMaSSObject::m_StepDone, st_CaringForYoung(), and st_Floating().

◆ CalcFoodTime()

int Skylark_Female::CalcFoodTime ( double  target) const
protected
6523 {
6524  if (MyMate == nullptr)
6525  {
6526  g_msg->Warn(WARN_BUG, "Skylark_Female::CalcFoodTime(): No Mate!", "");
6527  exit(1);
6528  }
6529 
6530 #ifdef __CJTDebug_5
6531  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
6532 #endif
6533  // Must calcuate how much time it takes to get 'target' food
6534  double FoodGathered = 0.0;
6535  int FoodTime = 0; // How much time used
6536  int used = 0;
6537  // Starting with the best sources first, use time to get food
6538  // The male ought to have sorted the table already (or yesterday)
6539  while (FoodGathered < target && used < MyMate->SupplyNoHabitatRefs())
6540  {
6541  double available = MyMate->m_HabitatTable_Size[used] * MyMate->m_InsectTable[used];
6542  // calcualte for, weather and extraction rate
6543  available *= MyExtractEff;
6544  if (available < target - FoodGathered)
6545  {
6546  FoodGathered += available;
6547  //used++;
6548  // Calc time used
6549  FoodTime += MyMate->m_HabitatTable_Size[used++]; // assume 1 min per m2
6550  }
6551  else
6552  {
6553  // Enough Food here to reach target
6554  // foodpermin = available/area * ExtractionEff * VegHindrance
6555  // mins = (target-FoodGathered)/FoodperMin
6556  const double FoodPerMin = available / MyMate->m_HabitatTable_Size[used];
6557  FoodTime += static_cast<int>(floor(0.5 + (target - FoodGathered) / FoodPerMin));
6558  break;
6559  }
6560  }
6561  return FoodTime;
6562 }

References g_msg, MapErrorMsg::Warn(), and WARN_BUG.

Referenced by st_Incubating().

◆ CalculateEggNumber()

int Skylark_Female::CalculateEggNumber ( ) const
protected
6493  {
6494 #ifdef __CJTDebug_5
6495  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
6496 #endif
6497  // Data from PO/AP study at Kal
6498  int eggs;
6499  int chance;
6500  switch (m_BreedingAttempts)
6501  {
6502  case 1:
6503  chance = g_random_fnc(160);
6504  if (chance < 9) eggs = 2;
6505  else if (chance < 37 + 9) eggs = 3;
6506  else if (chance < 99 + 37 + 9) eggs = 4;
6507  else eggs = 5;
6508  break;
6509  default:
6510  chance = g_random_fnc(125);
6511  if (chance < 29) eggs = 3;
6512  else if (chance < 29 + 80) eggs = 4;
6513  else eggs = 5;
6514  break;
6515  }
6516  if (eggs < 1) eggs = 1;
6517  return eggs;
6518 }

References g_random_fnc(), and m_BreedingAttempts.

Referenced by st_Laying().

◆ CheckForFields()

double Skylark_Female::CheckForFields ( ) const
protected
6577  {
6578 #ifdef __CJTDebug_5
6579  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
6580 #endif
6581 
6582  // Checks each 1m in the territory and returns the proportion of field<4cm
6583  // Note only arable fields are returned as field - permanent pasture is not
6584  int TallFieldVeg = 0;
6585  for (int xx = MyTerritory.x; xx < MyTerritory.x + MyTerritory.size; xx++)
6586  {
6587  for (int yy = MyTerritory.y; yy < MyTerritory.y + MyTerritory.size; yy++)
6588  {
6589  int Cx = xx;
6590  int Cy = yy;
6591  m_OurLandscape->CorrectCoords(Cx, Cy);
6592  const int PolyRef = m_OurLandscape->SupplyPolyRef(Cx, Cy);
6593  if (m_OurLandscape->SupplyVegHeight(PolyRef) > 50.0 && (m_OurLandscape->SupplyElementType(PolyRef) == tole_Field || m_OurLandscape->
6594  SupplyElementType(PolyRef) == tole_UnsprayedFieldMargin)) TallFieldVeg++;
6595  }
6596  }
6597  return TallFieldVeg / static_cast<double>(MyTerritory.size * MyTerritory.size);
6598 }

References Landscape::CorrectCoords(), TAnimal::m_OurLandscape, Skylark_Adult::MyTerritory, skTerritory_struct::size, Landscape::SupplyElementType(), Landscape::SupplyPolyRef(), Landscape::SupplyVegHeight(), tole_Field, tole_UnsprayedFieldMargin, skTerritory_struct::x, and skTerritory_struct::y.

◆ EndStep()

void Skylark_Female::EndStep ( void  )
overridevirtual

EndStep behaviour - must be implemented in descendent classes.

Reimplemented from TALMaSSObject.

5446  {
5447 #ifdef __CJTDebug_5
5448  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
5449 #endif
5450  // Need to find out if it is poisoned
5451 #ifdef __PESTICIDE_RA
5452  PesticideResponse();
5453 #endif
5454 }

◆ EstablishTerritory()

void Skylark_Female::EstablishTerritory ( )

◆ FeedYoung()

void Skylark_Female::FeedYoung ( )
protected

Can only get food in daylight - dawn & dusk. Must keep them warm if the weather is bad - the quick version below catagorizes this into good or bad weather

6344  {
6345 #ifdef __CJTDebug_5
6346  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
6347 #endif
6348 
6353  const double RainToday = m_OurLandscape->SupplyRain();
6354  if (RainToday > MaxFeedRain) return; // No feeding today
6355  const double TempToday = m_OurLandscape->SupplyTemp();
6356  const int food_time = m_OurLandscape->SupplyDaylength() - 120;
6357  const int BrSize = MyMate->SupplyBroodSize();
6358  m_NestTime = 24 * 60 - food_time; //add night time
6359  int FeedingProbs[16];
6360  double ChickFood[16];
6361 #ifdef __PESTICIDE_RA_CHICK
6362  double ChickPoison[ 16 ];
6363 #endif
6364  double spare;
6365  const double resources_all = GetFood(food_time /*, pcide*/); // kcal insects
6366  // remove metabolic requirements
6367  double resources = RemoveEM(resources_all);
6368  int HungryChicks = BrSize;
6369  if (resources > 0)
6370  {
6371  // Zero the feeding probabilities
6372  for (int i = 0; i < HungryChicks; i++)
6373  {
6374  FeedingProbs[i] = 0;
6375  ChickFood[i] = 0;
6376 #ifdef __PESTICIDE_RA_CHICK
6377  ChickPoison[ i ] = 0;
6378 #endif
6379  }
6380  // if the chicks are 1-4 days old then she must warm them with energy
6381  // From Mertens (1972)
6382  // M = 0.0719*power(brood_weight,0.613)*(BroodTemp-AmbientTemp); // Brood temp = 35 double broodweight=0;
6383  int BroodWeight = 0;
6384  for (int i = 0; i < HungryChicks; i++)
6385  {
6386  // Add up brood weight
6387  const int weight = static_cast<int>(floor(MyMate->SupplyBroodWeight(i) + 0.5));
6388  BroodWeight += weight;
6389  // While we are at it we might as well create the FeedinbProbs array too
6390  for (int j = i; j < HungryChicks; j++) FeedingProbs[j] += static_cast<int>(floor(0.5 + weight));
6391  }
6392  if (MyMate->SupplyBroodAge(0) < 6) { resources -= pow(BroodWeight, 0.613) * 0.0719 * (35 - TempToday); }
6393  // Now give the food to the chicks
6394  // The chance that a chick get a portion is proportional to their size
6395  resources /= FoodTripsPerDay; // Split into 30 portions (food trips per day)
6396 #ifdef __PESTICIDE_RA_CHICK
6397  double pcide_remain = resources * m_pcide_conc;
6398 #endif
6399  while (resources > 0.01 && HungryChicks > 0)
6400  {
6401  for (int portion = 0; portion < FoodTripsPerDay; portion++)
6402  {
6403  // For each portion
6404  const int choose = g_random_fnc(BroodWeight);
6405  for (int i = 0; i < BrSize; i++)
6406  {
6407  if (choose < FeedingProbs[i])
6408  {
6409  ChickFood[i] += resources; // store the food for that chick
6410 #ifdef __PESTICIDE_RA_CHICK
6411  ChickPoison[ i ] += pcide_remain;
6412 #endif
6413  break;
6414  }
6415  }
6416  }
6417  // Now give the food to the chicks
6418  // Better do this than feed each a portion at a time, it is more efficient
6419  // and stops problems with growth between portions
6420  spare = 0;
6421  for (int i = 0; i < BrSize; i++)
6422  {
6423 #ifdef __PESTICIDE_RA_CHICK
6424  double extra = MyMate->OnFoodMessage( i, ChickFood[ i ] , ChickPoison[i] );
6425 #else
6426  double extra = MyMate->OnFoodMessage(i, ChickFood[i]);
6427 #endif
6428  if (extra > 0) // chick must be full
6429  {
6430  FeedingProbs[i] = -1; // no chance of food
6431  HungryChicks--;
6432  spare += extra;
6433  }
6434  }
6435  resources = spare / FoodTripsPerDay;
6436  }
6437  }
6438 }

References FoodTripsPerDay, g_random_fnc(), GetFood(), m_NestTime, TAnimal::m_OurLandscape, MaxFeedRain, MyMate, Skylark_Male::OnFoodMessage(), Skylark_Adult::RemoveEM(), Skylark_Male::SupplyBroodAge(), Skylark_Male::SupplyBroodSize(), Skylark_Male::SupplyBroodWeight(), Landscape::SupplyDaylength(), Landscape::SupplyRain(), and Landscape::SupplyTemp().

Referenced by st_CaringForYoung(), and st_GivingUpTerritory().

◆ GetFood()

double Skylark_Female::GetFood ( int  time)
protected
6441  {
6442  // returns insects in g dry weight
6443 #ifdef __CJTDebug_5
6444  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
6445 #endif
6446  // Extract insects available from each habitat in the male's table
6447  // for as long as she spends searching
6448  double food = 0;
6449  int index = 0;
6450 #ifdef __PESTICIDE_RA
6451  m_pcide = 0.0;
6452 #endif
6453  double fd;
6454  while (time > 0)
6455  {
6456 #ifdef __CJTDebug_4
6457  if ( index > 249 )
6459 #endif
6460  const int area = MyMate->m_HabitatTable_Size[index];
6461  if (time > area)
6462  {
6463  time -= area;
6464  // Food+= area*WeatherHindrance*ExtractionEfficiency*Insects per m2
6465  fd = area * MyExtractEff * MyMate->m_InsectTable[index];
6466  food += fd;
6467 #ifdef __PESTICIDE_RA
6468  // m_pcide has total mg collected
6469  m_pcide += MyMate->m_PConcTable[index] * fd * KcalPerGInsect_kg_inv; // Food needs converting from kcal to kg
6470  //m_pcide += 53.0 * fd * KcalPerGInsect_kg_inv; // Food needs converting from kcal to kg
6471 #endif
6472  index++;
6473  if (index == MyMate->SupplyNoHabitatRefs()) time = 0; // Nowhere left to look
6474  }
6475  else
6476  {
6477  // Food+=
6478  // minutes left*WeatherHindrance*ExtractionEfficiency*Insects per m2
6479  fd = time * MyExtractEff * MyMate->m_InsectTable[index];
6480  food += fd;
6481 #ifdef __PESTICIDE_RA
6482  m_pcide += MyMate->m_PConcTable[index] * fd * KcalPerGInsect_kg_inv; // Food needs converting from kcal to kg
6483  //m_pcide += 53.0 * fd * KcalPerGInsect_kg_inv; // Food needs converting from kcal to kg
6484 #endif
6485  time = 0;
6486  }
6487  }
6488  return food;
6489 }

References KcalPerGInsect_kg_inv, Skylark_Male::m_HabitatTable_Size, Skylark_Male::m_InsectTable, Skylark_Adult::MyExtractEff, MyMate, TALMaSSObject::OnArrayBoundsError(), and Skylark_Male::SupplyNoHabitatRefs().

Referenced by FeedYoung(), and st_PreparingForBreeding().

◆ GetMigrationMortality()

int Skylark_Female::GetMigrationMortality ( )
protected
6566  {
6567 #ifdef __CJTDebug_5
6568  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
6569 #endif
6570  Age++; // Get one year older (if you live)
6571  if (Age == 1) return JuvenileReturnMort;
6573 }

References Skylark_Base::Age, JuvenileReturnMort, Skylark_Base::m_OurPopulationManager, and Skylark_Population_Manager::SupplyF_Mig_Mort().

Referenced by st_Immigrating().

◆ OnBreedingSuccess()

void Skylark_Female::OnBreedingSuccess ( )
5465  {
5466 #ifdef __CJTDebug_5
5467  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
5468 #endif
5469  BSuccess = true;
5470 }

References Skylark_Adult::BSuccess.

Referenced by Skylark_Male::OnPreFledgelingMature(), and Skylark_Male::st_ScaringOffChicks().

◆ OnBreedSuccess()

void Skylark_Female::OnBreedSuccess ( )
inline

◆ OnBroodDeath()

void Skylark_Female::OnBroodDeath ( )
5768  {
5769 #ifdef __CJTDebug_5
5770  if ( IsAlive() != 0xDEADC0DE )
5771  DEADCODEError();
5772 #endif
5773  if (Paired) // if !Paired then ignore them, must have deserted
5774  {
5775  // Start a new brood if not already done so naturally
5776  if (!MyClutch)
5777  {
5778  m_Counter1 = 5;
5779  m_CurrentSkState = toss_StartingNewBrood;
5780  }
5781  }
5782 }

References m_Counter1, Skylark_Base::m_CurrentSkState, MyClutch, and Skylark_Adult::Paired.

Referenced by Skylark_Male::OnBroodDeath().

◆ OnClutchDeath()

void Skylark_Female::OnClutchDeath ( )
5786  {
5787 #ifdef __CJTDebug_5
5788  if ( IsAlive() != 0xDEADC0DE )
5789  DEADCODEError();
5790 #endif
5791  if (Paired) // if !Paired then ignore the message, must have deserted
5792  {
5793 #ifdef __CJTDebug_7
5794  if (!MyClutch)
5795  {
5796  g_land->Warn("Skylark_Female::OnClutchDeat - No clutch to die ", nullptr);
5797  exit(1);
5798  }
5799 #endif
5800  MyClutch = nullptr;
5801  m_Counter1 = 5;
5802  m_CurrentSkState = toss_StartingNewBrood; //Go to new brood start
5803  }
5804 }

References g_land, m_Counter1, Skylark_Base::m_CurrentSkState, MyClutch, Skylark_Adult::Paired, and Landscape::Warn().

Referenced by Skylark_Clutch::st_Dying().

◆ OnEggsHatch()

void Skylark_Female::OnEggsHatch ( )
5808  {
5809 #ifdef __CJTDebug_5
5810  if ( IsAlive() != 0xDEADC0DE )
5811  DEADCODEError();
5812 #endif
5813  // This function must not be called until the nestling objects have been
5814  // created
5815 #ifdef __CJTDebug_7
5816  if (!MyClutch)
5817  {
5818  g_land->Warn("Skylark_Female::OnEggsHatch - No clutch to hatch ", nullptr);
5819  exit(1);
5820  }
5821 #endif
5822  MyClutch = nullptr;
5823  m_CurrentSkState = toss_EggHatching; //Go to EggHatching
5824  // Tell the male
5825  MyMate->OnEggHatch();
5826 }

References g_land, Skylark_Base::m_CurrentSkState, MyClutch, MyMate, Skylark_Male::OnEggHatch(), and Landscape::Warn().

Referenced by Skylark_Clutch::st_Hatching().

◆ OnFarmEvent()

bool Skylark_Female::OnFarmEvent ( FarmToDo  )
overrideprotectedvirtual

Must be reimplemented if used in descendent classes. Sets the action on a management event.

Reimplemented from TAnimal.

5038  {
5039  switch (event)
5040  {
5041  case sleep_all_day:
5042  break;
5043 // Here begins events that destroy the nest
5044  case preseeding_cultivator:
5045  case summer_harrow:
5046  case strigling_sow:
5047  case strigling:
5048  case strigling_hill:
5049  // If she is in nest building then the nest is destroyed
5050  if (m_CurrentSkState == toss_MakingNest || m_CurrentSkState == toss_PreparingForBreeding)
5051  {
5052  // Make a state change
5053  m_CurrentSkState = toss_StartingNewBrood;
5054  AddStriglingMort(0);
5055  }
5056  break;
5057  case autumn_plough:
5058  case stubble_plough:
5060  case row_cultivation:
5061  case autumn_harrow:
5064  case autumn_sow:
5065  case autumn_sow_with_ferti:
5066  case winter_plough:
5067  case deep_ploughing:
5068  case summer_plough:
5069  case summer_sow:
5070  case winter_harrow:
5071  case spring_plough:
5072  case spring_harrow:
5073  case shallow_harrow:
5074  case spring_sow:
5075  case spring_sow_with_ferti:
5077  case bed_forming:
5078  case stubble_harrowing:
5079  // If she is in nest building then the nest is destroyed
5080  if (m_CurrentSkState == toss_MakingNest || m_CurrentSkState == toss_PreparingForBreeding)
5081  {
5082  // Make a state change
5083  m_CurrentSkState = toss_StartingNewBrood;
5084  }
5085  break;
5086 // Here begins non-mortality events
5087  case spring_roll:
5088  case autumn_roll:
5089  case fa_boron: //AHA
5090  case fp_npks:
5091  case molluscicide:
5092  case fp_npk:
5093  case fp_pk:
5094  case fp_k:
5095  case fp_sk: //AHA
5096  case fp_p:
5097  case fa_calcium:
5098  case fa_pks:
5099  case fiber_covering:
5100  case fp_n: //AHA
5101  case fp_liquidNH3:
5102  case fp_slurry:
5103  case fp_ammoniumsulphate:
5104  case fp_manganesesulphate:
5105  case fp_manure:
5106  case fp_greenmanure:
5107  case fp_sludge:
5108  case fp_rsm:
5109  case fp_calcium:
5110  case fp_boron: //AHA
5111  case fp_cu:
5112  case fp_nc:
5113  case fp_nk:
5114  case fp_ns:
5115  case fp_pks:
5116  case fa_cu: //AHA
5117  case fa_npk:
5118  case fa_npks:
5119  case fa_pk:
5120  case fa_k:
5121  case fa_sk: //AHA
5122  case fa_p:
5123  case fa_n:
5124  case fa_nk: //AHA
5125  case fa_slurry:
5126  case fa_ammoniumsulphate:
5127  case fa_manganesesulphate:
5128  case fa_manure:
5129  case fa_greenmanure:
5130  case fa_sludge:
5131  case fa_rsm:
5132  case cut_weeds:
5133  case herbicide_treat:
5134  case growth_regulator:
5135  case fungicide_treat:
5136  case insecticide_treat:
5137  case org_insecticide:
5138  case hilling_up:
5139  case water:
5140  case swathing:
5141  case harvest:
5142  case harvest_bushfruit: //AHA
5143  case green_harvest:
5144  case harvestshoots:
5145  case pruning: //AHA
5146  case fiber_removal: //AHA
5147  case shredding: //AHA
5148  case manual_weeding: //AHA
5149  case cattle_out:
5150  case cattle_out_low:
5151  case cut_to_hay:
5152  case cut_to_silage:
5153  case straw_chopping:
5154  case hay_turning:
5155  case hay_bailing:
5157  case burn_straw_stubble:
5158  case flammebehandling:
5159  case burn_top: //AHA
5160  case flower_cutting:
5161  case bulb_harvest:
5162  case straw_covering:
5163  case straw_removal:
5164  case mow:
5165  case last_treatment:
5166  case org_fungicide:
5167  case org_herbicide:
5168  case pheromone:
5169  case suckering:
5170  case trial_control:
5171  case trial_toxiccontrol:
5172  case product_treat:
5173  case glyphosate:
5174  case biocide:
5175  break;
5176 // Here begins spray mortality
5177  case syninsecticide_treat:
5179  {
5180 #ifdef TEST_ISSUE_DEATH_WARRANT
5181  printf( "Skylark_Female::OnFarmEvent() : %d : %d\n", event, ( int )g_date->Date() );
5182 #endif
5183  m_CurrentSkState = toss_FDying;
5184  }
5185  break;
5186 // Here begins events that cause females to give up territory
5187  case pigs_out:
5188 #ifndef __NoPigsOutEffect
5189  if (Paired)
5190  {
5191  if (g_random_fnc(100) < 2) // 2%
5192  {
5193  // Too much disturbance so give up
5194  m_CurrentSkState = toss_GivingUpTerritory;
5195  }
5196  }
5197 #endif
5198  break;
5199  default:
5200  g_land->Warn("Skylark_Female::OnFarmEvent(): ""Unknown event type:", m_OurLandscape->EventtypeToString(event));
5201  exit(1);
5202  }
5203  if (m_CurrentSkState == toss_FDying) return true;
5204  return false;
5205 }

References Skylark_Base::AddStriglingMort(), 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_insecticide_direct_mortF, cut_to_hay, cut_to_silage, cut_weeds, Calendar::Date(), 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_date, g_land, g_random_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, Skylark_Base::m_CurrentSkState, TAnimal::m_OurLandscape, manual_weeding, molluscicide, mow, org_fungicide, org_herbicide, org_insecticide, Skylark_Adult::Paired, 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, trial_control, trial_insecticidetreat, trial_toxiccontrol, CfgInt::value(), Landscape::Warn(), water, winter_harrow, and winter_plough.

◆ OnMaleNeverComesBack()

void Skylark_Female::OnMaleNeverComesBack ( const Skylark_Male AMale)
5879  {
5880 #ifdef __CJTDebug_5
5881  if ( IsAlive() != 0xDEADC0DE )
5882  DEADCODEError();
5883 #endif
5884  if (MyMate == AMale)
5885  {
5886  MyMate = nullptr;
5887  Paired = false;
5888  BSuccess = false;
5889  } //This could cause problems if this function is called late
5890 }

References Skylark_Adult::BSuccess, MyMate, and Skylark_Adult::Paired.

Referenced by Skylark_Male::OnPairing(), and Skylark_Male::st_Immigrating().

◆ OnMateDying()

void Skylark_Female::OnMateDying ( )
5830  {
5831 #ifdef __CJTDebug_5
5832  if ( IsAlive() != 0xDEADC0DE )
5833  DEADCODEError();
5834 #endif
5835  // Assumes that she forgets about any active brood
5836  MyMate = nullptr;
5837  if (MyClutch)
5838  {
5839  MyClutch->OnMumGone();
5840  MyClutch = nullptr;
5841  }
5842  if (MyTerritory.ref != -1)
5843  {
5845  MyTerritory.ref = -1;
5846 #ifdef __SKPOM
5848 #endif
5849  }
5850  if (m_OurLandscape->SupplyDayInYear() > g_stopdate) m_CurrentSkState = toss_FFlocking;
5851  else m_CurrentSkState = toss_FFloating;
5852 }

References g_stopdate, Skylark_Base::m_CurrentSkState, TAnimal::m_OurLandscape, Skylark_Base::m_OurPopulationManager, Skylark_Base::m_OurTerritories, MyClutch, MyMate, Skylark_Adult::MyTerritory, Skylark_Clutch::OnMumGone(), skTerritory_struct::ref, SkTerritories::RemoveFemale(), Landscape::SupplyDayInYear(), and Skylark_Population_Manager::WriteSKPOM1().

Referenced by Skylark_Male::st_Dying().

◆ OnMateHomeless()

void Skylark_Female::OnMateHomeless ( )
5856  {
5857 #ifdef __CJTDebug_5
5858  if ( IsAlive() != 0xDEADC0DE )
5859  DEADCODEError();
5860 #endif
5861  if (MyClutch)
5862  {
5863  MyClutch->OnMumGone();
5864  MyClutch = nullptr;
5865 #ifdef __SKPOM
5867 #endif
5868  }
5869  MyMate = nullptr;
5870  Paired = false;
5871  BSuccess = false;
5872  MyTerritory.ref = -1;
5873  if (m_OurLandscape->SupplyDayInYear() > g_stopdate) m_CurrentSkState = toss_FFlocking;
5874  else m_CurrentSkState = toss_FFloating;
5875 }

References Skylark_Adult::BSuccess, g_stopdate, Skylark_Base::m_CurrentSkState, TAnimal::m_OurLandscape, Skylark_Base::m_OurPopulationManager, MyClutch, MyMate, Skylark_Adult::MyTerritory, Skylark_Clutch::OnMumGone(), Skylark_Adult::Paired, skTerritory_struct::ref, Landscape::SupplyDayInYear(), and Skylark_Population_Manager::WriteSKPOM1().

Referenced by Skylark_Male::OnReHouse().

◆ OnSetMyClutch()

void Skylark_Female::OnSetMyClutch ( Skylark_Clutch p_C)
inline
744 { MyClutch = p_C; }

Referenced by Skylark_Population_Manager::CreateObjects().

◆ OnStopFeedingChicks()

void Skylark_Female::OnStopFeedingChicks ( )
5458  {
5459  // Only a problem if she has to be told to stop feeding
5460  if (m_CurrentSkState == toss_FCaringForYoung) m_CurrentSkState = toss_StartingNewBrood;
5461 }

References Skylark_Base::m_CurrentSkState.

Referenced by Skylark_Male::OnPreFledgelingMature(), and Skylark_Male::st_ScaringOffChicks().

◆ ReInit()

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

Reimplemented from Skylark_Adult.

5028  {
5029  Skylark_Adult::ReInit(x, y, size, age, Terrs, L, SPM, bx, by, mh);
5030  MyMate = nullptr;
5031  MyClutch = nullptr;
5033  m_BreedingAttempts = 0;
5035 }

References m_BreedingAttempts, m_MinFemaleAcceptScore, MyClutch, MyMate, Skylark_Adult::ReInit(), and ResetBreedingSuccess().

◆ ResetBreedingSuccess()

void Skylark_Female::ResetBreedingSuccess ( )
5914  {
5915 #ifdef __CJTDebug_5
5916  if ( IsAlive() != 0xDEADC0DE )
5917  DEADCODEError();
5918 #endif
5919  m_BreedingSuccess = -1;
5920 }

References m_BreedingSuccess.

Referenced by ReInit(), Skylark_Female(), and st_Immigrating().

◆ SensibleCopy()

void Skylark_Female::SensibleCopy ( )
6620  {
6621  // This is called if a new bird is made as a copy of another and needs to have some sensible information added
6622  m_CurrentSkState = toss_FEmigrating;
6623 }

References Skylark_Base::m_CurrentSkState.

Referenced by Skylark_Population_Manager::CreateObjects().

◆ Spiral()

skSpiralResult Skylark_Female::Spiral ( int  x,
int  y,
int  radius 
)
protected

◆ Spiral2()

skSpiralResult Skylark_Female::Spiral2 ( int  x,
int  y,
int  radius 
)
protected

◆ st_Arriving()

bool Skylark_Female::st_Arriving ( )
protected

Ensures that the bird is not paired on arrival and checks the weather status. If bad weather then returns initiates a transition to st_TempLeaveArea otherwise to st_FindTerritory.

5500  {
5505 #ifdef __CJTDebug_5
5506  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
5507 #endif
5508  Paired = false;
5509  if (GetBadWeather()) return false;
5510  m_Location_y = static_cast<int>(floor(g_rand_uni_fnc() * m_OurLandscape->SupplySimAreaHeight()));
5511  m_Location_x = static_cast<int>(floor(g_rand_uni_fnc() * m_OurLandscape->SupplySimAreaWidth()));
5512  return true; // TransferToState(FindTerritory)
5513 }

References g_rand_uni_fnc(), Skylark_Adult::GetBadWeather(), TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, Skylark_Adult::Paired, Landscape::SupplySimAreaHeight(), and Landscape::SupplySimAreaWidth().

Referenced by Step().

◆ st_BuildingUpResources()

int Skylark_Female::st_BuildingUpResources ( )
protected

The female forages from her home range each day. On 1st April she will make a transition to preparing for breeding which determines the time needed for egg production and nest building.

5924  {
5929 #ifdef __CJTDebug_5
5930  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
5931 #endif
5932  const int today = m_OurLandscape->SupplyDayInYear();
5933  if (today >= g_stopdate)
5934  {
5935  return 2; // GiveUpTerritory
5936  }
5937  if (GetBadWeather()) return 2;
5939  {
5940  const double qual = MyMate->Supply_TerritoryQual();
5941  if (qual < m_MinFemaleAcceptScore)
5942  {
5943  // May need to give up territory or might be because the crop has not
5944  // started growing in which case she will wait until May
5945  if (today >= May + 14) return 2; // GiveUpTerritory
5946  }
5947  EggCounter = 0;
5948  if (today > cfg_SkylarkFirstBreedingDate.value()) return 1; // transferToState(PrepareForBreeding)
5949  }
5950  return 0; // just wait
5951 }

References Breed_Temp_Thresh, cfg_SkylarkFirstBreedingDate, EggCounter, g_stopdate, Skylark_Adult::GetBadWeather(), m_MinFemaleAcceptScore, TAnimal::m_OurLandscape, May, MyMate, Skylark_Male::Supply_TerritoryQual(), Landscape::SupplyDayInYear(), Landscape::SupplyTemp(), and CfgInt::value().

Referenced by Step().

◆ st_CaringForYoung()

int Skylark_Female::st_CaringForYoung ( )
protected

Calls Skylark_Female::FeedYoung to get food and give it to the chicks. Once the chicks reach 18 days of age if more breeding is possible then the bird will start a new brood unless it is late in the season or there have been too many breeding attempts in which case she will stop breeding when the chicks are 30 days old. In previous versions there was a bad weather component, but this has been removed since it did not contribute to the POM fit. If future analysis finds a relationship it should be incorporated here.

6316  {
6324 #ifdef __CJTDebug_5
6325  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
6326 #endif
6327  FeedYoung(); // get food and give it to the young
6328  const int ch_age = MyMate->SupplyBroodAge(0);
6329  if (ch_age == 18)
6330  // Must stop feeding and start to build a nest. She is ready to
6331  // build nest when the young are 18 days old
6332  {
6333  if (m_BreedingAttempts < 4 && m_OurLandscape->SupplyDayInYear() < g_stopdate)
6334  {
6335  NestLoc = false; // no nest location now
6336  return 1; //Start a new brood
6337  }
6338  if (ch_age == 30) return 2;
6339  }
6340  return 0;
6341 }

References FeedYoung(), g_stopdate, MyMate, NestLoc, and Skylark_Male::SupplyBroodAge().

Referenced by BeginStep().

◆ st_Dying()

void Skylark_Female::st_Dying ( void  )
protected
5735  {
5736 #ifdef __CJTDebug_5
5737  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
5738 #endif
5739  if (MyMate)
5740  {
5741  if (MyMate->MyMate != this)
5742  {
5743  g_land->Warn("Skylark_Female::st_Dying - Debug1 ", nullptr);
5744  exit(1);
5745  }
5746  MyMate->OnMateDying();
5747  MyMate = nullptr;
5748  }
5749  if (MyTerritory.ref != -1)
5750  {
5752  MyTerritory.ref = -1;
5753  }
5754  if (MyClutch)
5755  {
5756  MyClutch->OnMumGone();
5757  MyClutch = nullptr;
5758 #ifdef __SKPOM
5760 #endif
5761  }
5762  m_CurrentSkState = toss_Destroy; // will kill it at end of step!
5763  m_CurrentStateNo = -1;
5764 }

References g_land, Skylark_Base::m_CurrentSkState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, Skylark_Base::m_OurPopulationManager, Skylark_Base::m_OurTerritories, MyClutch, MyMate, Skylark_Male::MyMate, Skylark_Adult::MyTerritory, Skylark_Male::OnMateDying(), Skylark_Clutch::OnMumGone(), skTerritory_struct::ref, SkTerritories::RemoveFemale(), Landscape::SupplyDayInYear(), Landscape::Warn(), and Skylark_Population_Manager::WriteSKPOM1().

Referenced by Step().

◆ st_EggHatching()

int Skylark_Female::st_EggHatching ( )
protected

A transition is made to Care for Young.

6273  {
6277 #ifdef __CJTDebug_5
6278  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
6279 #endif
6280  m_toowet = 0;
6281  return 1; // TransferToState(CareForYoung)
6282 }

References m_toowet.

Referenced by Step().

◆ st_Emigrating()

int Skylark_Female::st_Emigrating ( )
protected

Is called once a day. This state determines the return to breeding areas based on probabilities that alter with date. Once suitable conditions prevail there will be a transition to st_Immigrating.

5556  {
5557 #ifdef __CJTDebug_5
5558  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
5559 #endif
5560 #ifdef __PESTICIDE_RA_ADULT
5561  // If using reset pesticide affect
5562  m_pesticide_affected = -1;
5563 #endif
5564 
5568  const int today = m_OurLandscape->SupplyDayInYear();
5569  if (today >= g_stopdate) return 0; //don't come back this year
5570  if (m_OurLandscape->SupplyTemp() > 0.0) GoodWeather++;
5571  else GoodWeather = 0;
5572 
5573  if (GoodWeather >= 7) // 7 days of good weather
5574  {
5575  const int chance = g_random_fnc(cfg_ReturnProbability.value()); // number between 0-9999 as default
5576  if (Age < 1) // if first year
5577  {
5578  if (chance < 300 && today >= March + 15) return 1;
5579  if (today >= April + 15) return 1;
5580  }
5581  else
5582  {
5583  if (chance < 7 && today >= January + 14) return 1;
5584  if (chance < 33 && today >= February + 14) return 1;
5585  if (chance < 400 && today >= March + 14) return 1;
5586  if (chance < 1000 && today >= April + 14) return 1;
5587  if (today > May) return 1;
5588  }
5589  }
5590  return 0; // return value of 0 do nothing, 1 go to immigration
5591 }

References Skylark_Base::Age, April, cfg_ReturnProbability, February, g_random_fnc(), g_stopdate, Skylark_Adult::GoodWeather, January, TAnimal::m_OurLandscape, Skylark_Adult::m_pesticide_affected, March, May, Landscape::SupplyDayInYear(), Landscape::SupplyTemp(), and CfgFloat::value().

Referenced by Step().

◆ st_Finding_Territory()

int Skylark_Female::st_Finding_Territory ( )
protected
5631  {
5632 #ifdef __CJTDebug_5
5633  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
5634 #endif
5635  if (GetBadWeather()) return 3;
5636  double score = 0;
5637  skTerritory_struct testTerr;
5638  // First tries to find old mate if breeding was successful
5639  if (BSuccess == true && MyMate != nullptr)
5640  {
5641  // Check if mate has a territory
5642  if (MyMate->HaveTerritory == true && MyMate->Paired == false)
5643  {
5644  testTerr = MyMate->Supply_Territory();
5645  // **CJT** Changed below to EvaluateHabitatNest 10/05/04
5646  //score = m_OurTerritories->EvaluateHabitatNest( m_OurTerritories->Supply_terr( testTerr.ref ), true );
5647  score = testTerr.nqual;
5648  }
5649  if (score > m_MinFemaleAcceptScore)
5650  {
5651  //Establish the territory
5653  return 1; // TransferToState(BuildUpResources)
5654  }
5655  }
5656  // If old-mate did not have a good territory or was not there
5657  // then start a search for a good unoccupied territory
5658  {
5659  // Male't territory was not good so lie to him and say we did not
5660  // come back
5661  if (MyMate) if (MyMate->Paired == false) MyMate->OnMateNeverComesBack(this);
5662  MyMate = nullptr; // Forget him he is no good!
5663  // Sorts through the list of territories until it finds a suitable one
5664  // will remember the last 'one' until if finds a vacant really good one
5665  const int NoTerrs = m_OurTerritories->SupplyNoTerritories();
5666  int remember = -1;
5667  for (int i = 0; i < NoTerrs; i++)
5668  {
5670  // Is territory occupied?
5671  if (A_Male != nullptr)
5672  {
5673  // Check if a female is already present
5674  if (m_OurTerritories->Supply_F_Owner(i) == nullptr)
5675  {
5676 #ifdef __CJTDebug_5
5677  if ( A_Male->Paired ) {
5678  g_msg->Warn( WARN_BUG, "Skylark_Female::st_Finding_Territory(): Male already paired!", "" );
5679  exit( 1 ); // Inconsistency
5680  }
5681 #endif
5682  testTerr = A_Male->Supply_Territory();
5683  /* *** CJT *** Changed 4/6/2009. Now requires the male to set the value in his m_MyTerritory
5684  **CJT** Changed below to EvaluateHabitatNest 10/05/04
5685  score = m_OurTerritories->EvaluateHabitatNest( m_OurTerritories->Supply_terr( testTerr.ref ), true );
5686  */
5687  if (testTerr.nqual >= m_MinFemaleAcceptScore + 5)
5688  {
5689  //Pair with this one
5690  //Establish the territory
5691  MyMate = A_Male;
5693  Paired = true;
5694  return 1; // TransferToState(BuildUpResources)
5695  }
5696  if (testTerr.nqual >= m_MinFemaleAcceptScore) remember = i;
5697  }
5698  }
5699  }
5700  if (remember == -1)
5701  {
5702 #ifdef FOR_DEMONSTRATION
5703  m_Location_x = 0;
5704  m_Location_y = 0;
5705 #endif
5706  return 2; // TransferToState(Floating);
5707  }
5708  //Pair with the male remember
5709  MyMate = m_OurTerritories->Supply_Owner(remember);
5710  //Establish the territory
5712  return 1; // TransferToState(BuildUpResources)
5713  }
5714 }

References Skylark_Adult::BSuccess, EstablishTerritory(), g_msg, Skylark_Adult::GetBadWeather(), Skylark_Male::HaveTerritory, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MinFemaleAcceptScore, Skylark_Base::m_OurTerritories, MyMate, skTerritory_struct::nqual, Skylark_Male::OnMateNeverComesBack(), Skylark_Adult::Paired, SkTerritories::Supply_F_Owner(), SkTerritories::Supply_Owner(), Skylark_Male::Supply_Territory(), SkTerritories::SupplyNoTerritories(), MapErrorMsg::Warn(), and WARN_BUG.

Referenced by Step().

◆ st_Floating()

int Skylark_Female::st_Floating ( )
protected
5614  {
5615 #ifdef __CJTDebug_5
5616  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
5617 #endif
5618  if (GetBadWeather()) return 3;
5621  if (m_OurLandscape->SupplyDayInYear() > g_stopdate) { return 2; }
5622 #ifdef FOR_DEMONSTRATION
5623  m_Location_x = 0;
5624  m_Location_y = 0;
5625 #endif
5626  return 1; //TransferToState(FindTerritory);
5627 }

References g_random_fnc(), g_stopdate, Skylark_Adult::GetBadWeather(), TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, Skylark_Base::m_OurPopulationManager, Landscape::SupplyDayInYear(), Population_Manager_Base::SupplySimH(), and Population_Manager_Base::SupplySimW().

Referenced by BeginStep().

◆ st_Flocking()

int Skylark_Female::st_Flocking ( )
protected

The bird is assumed to move around the area waiting until weather conditions are suitable to begin Emigration, depending upon the time of year. Only arrives here after breeding, so poor conditions will trigger a transition to Emigration. A transition to Emigration will also occur if the bird has not emigrated before October.

5473  {
5474 #ifdef __CJTDebug_5
5475  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
5476 #endif
5477 
5482 #ifdef FOR_DEMONSTRATION
5483  // Removes itinerant dots from the screen, but has no effect on simulation
5484  m_Location_x = 0;
5485  m_Location_y = 0;
5486 #endif
5487 
5489  {
5490  GoodWeather = 0;
5491  return 1; //TransferToState(Emigration);
5492  }
5493  const bool bad = GetBadWeather();
5494  if (bad && m_OurLandscape->SupplyDayInYear() >= September) return 1; //TransferToState(Emigration);
5495  return 0; // Carry on
5496 }

References Skylark_Adult::GetBadWeather(), Skylark_Adult::GoodWeather, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, October, September, and Landscape::SupplyDayInYear().

Referenced by Step().

◆ st_GivingUpTerritory()

int Skylark_Female::st_GivingUpTerritory ( )
protected
6166  {
6167 #ifdef __CJTDebug_5
6168  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
6169 #endif
6170  // If she is incubating give a message to the clutch that she is gone
6171  if (MyClutch)
6172  {
6173  MyClutch->OnMumGone();
6174  MyClutch = nullptr;
6175 #ifdef __SKPOM
6177 #endif
6178  }
6179  // Will carry on feeding the young whilst they are needing fed
6180  if (MyMate->SupplyBroodSize() > 0)
6181  {
6182  FeedYoung();
6183  return 0; // carry on
6184  }
6185  // No young to look after so leave the territory
6186  EggCounter = 0;
6187  NestLoc = false;
6188  // No longer paired
6189  Paired = false;
6190  // Tell the male you are leaving
6191  MyMate->OnMateLeaving();
6192  // if no breeding success then forget him
6193  if (!BSuccess) MyMate = nullptr;
6194  // de-register the territory ownership (if she owns one)
6196  MyTerritory.ref = -1; // No territory
6197  return 1; // TransferToState(Floating);
6198 }

References Skylark_Adult::BSuccess, EggCounter, FeedYoung(), TAnimal::m_OurLandscape, Skylark_Base::m_OurPopulationManager, Skylark_Base::m_OurTerritories, MyClutch, MyMate, Skylark_Adult::MyTerritory, NestLoc, Skylark_Male::OnMateLeaving(), Skylark_Clutch::OnMumGone(), Skylark_Adult::Paired, skTerritory_struct::ref, SkTerritories::RemoveFemale(), Skylark_Male::SupplyBroodSize(), Landscape::SupplyDayInYear(), and Skylark_Population_Manager::WriteSKPOM1().

Referenced by Step().

◆ st_Immigrating()

bool Skylark_Female::st_Immigrating ( )
protected

An instantaneous state which determines the chanve of migration mortality. If she does die then she has to inform any old mate that she has gone. If he is already paired with another bird then can just forget him. If not dying then breeding success for this year is reset and the bird transitions to st_Arrival.

5517  {
5523 #ifdef __CJTDebug_5
5524  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
5525 #endif
5526  if (g_random_fnc(100) < GetMigrationMortality() || Age > 5)
5527  {
5528  if (MyMate != nullptr)
5529  {
5530  // if she has no mate she don't care
5531  // Otherwise he receives a bogus on Mate death message
5532  if (!MyMate->Paired)
5533  {
5534  //Not paired so he is told to forget her
5536  }
5537  // He is paired so don't need to tell him anything - forget him
5538  // or have already told him so forget him anyway
5539  MyMate = nullptr;
5540 #ifdef __CJTDebug_8
5541  if ( MyClutch != NULL )
5542  int rubbish = 0;
5543 #endif
5544  }
5545  return false; // TransfertoState(Die)
5546  }
5548  m_BreedingAttempts = 0;
5549  m_pesticide_affected = -1; // reset the sprayed flag
5551  return true; // TransferToState(Arrival)
5552 }

References Skylark_Base::Age, cfg_FemaleMinTerritoryAcceptScore, g_random_fnc(), GetMigrationMortality(), m_BreedingAttempts, m_MinFemaleAcceptScore, Skylark_Adult::m_pesticide_affected, MyClutch, MyMate, Skylark_Male::OnMateNeverComesBack(), Skylark_Adult::Paired, ResetBreedingSuccess(), and CfgFloat::value().

Referenced by Step().

◆ st_Incubating()

int Skylark_Female::st_Incubating ( )
protected

Incubation occurs as described in development below. The female spends that time off the nest required to find energy to cover her basal metabolic requirements, plus that energy required to warm the eggs. Incubation continues until the eggs hatch and there is a transition to Care For Young, or the incubation period (MID) is exceeded, at which point the female will Start New Brood. This state can only be left by a call to OnEggHatch being altered on creation of a nestling or to StartNewBrood

6237  {
6238 #ifdef __CJTDebug_5
6239  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
6240 #endif
6241 
6248  // Must calculate time needed to feed
6249  // will ignore time off nest due to disturbance
6250  m_NestTime = 0;
6251  if (--m_Counter1 > 0)
6252  {
6253  // ExtraBroodHeat extra because of heat for eggs
6254  const double calories_needed = m_OurPopulationManager->SupplyEMi();
6255  int foodtime = CalcFoodTime(calories_needed);
6256  const int Daylength = m_OurLandscape->SupplyDaylength();
6257  const double rain = m_OurLandscape->SupplyRain();
6258  if (rain > MaxFeedRain) { m_toowet++; }
6259  if (m_toowet > 2)
6260  {
6261  //m_OurPopulationManager->WriteToTest2File( m_OurLandscape->SupplyDayInYear(), 1003 );
6262  return 3; //TransferToState(StartNewBrood);
6263  }
6264  if (foodtime > Daylength) foodtime = Daylength;
6265  m_NestTime = 24 * 60 - foodtime; //add night time
6266  return 0; // wait
6267  }
6268  //m_OurPopulationManager->WriteToTest2File( m_OurLandscape->SupplyDayInYear(), 1002 );
6269  return 3; // TransferToState(StartNewBrood);
6270 }

References CalcFoodTime(), m_Counter1, m_NestTime, TAnimal::m_OurLandscape, Skylark_Base::m_OurPopulationManager, m_toowet, MaxFeedRain, Landscape::SupplyDaylength(), Skylark_Population_Manager::SupplyEMi(), and Landscape::SupplyRain().

Referenced by Step().

◆ st_Laying()

TTypesOfSkState Skylark_Female::st_Laying ( )
protected
6060  {
6061  if (MyMate == nullptr)
6062  {
6063  g_msg->Warn(WARN_BUG, "Skylark_Female::st_Laying(): No mate!", "");
6064  exit(1);
6065  }
6066 #ifdef __CJTDebug_5
6067  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
6068 #endif
6069  // Timing called Once each day
6070  // lays 1 egg per day until the correct number of eggs are laid
6071  // Counter1 must be set to -1 on first time called
6072  if (m_Counter1 == -1)
6073  {
6074  // If we have not calculated how many eggs we need do that
6077 #ifdef __PESTICIDE_RA_ADULT
6078  // If pesticide affected then breeding is delayed
6079  if (m_pesticide_affected > -1)
6080  {
6082  {
6083  if (m_OurLandscape->SupplyDayInYear() - m_pesticide_affected < 10) return toss_PreparingForBreeding;
6084  }
6086  {
6088  {
6090  }
6091  else
6092  {
6093  // This code assumes egg independence
6094  for (int e = 0; e < m_EggNumber; e++)
6095  {
6097  }
6098  }
6099  if (m_EggNumber < 1)
6100  {
6102  return toss_PreparingForBreeding;
6103  }
6104  }
6106  // this is needed in case we adjusted the egg number (m_counter is used to count down the number of days of laying.
6107  }
6108 #endif
6109  // This code is a special test for egg shell thickness effects - it can be linked to the pesticide effect above, or assumed to be
6110  // a general effect
6112  {
6113  /* // This code assumes egg independence
6114  for (int e = 0; e < m_EggNumber; e++)
6115  {
6116  if (g_rand_uni() <= cfg_skylark_pesticide_eggshellreduction.value()) m_Counter1--;
6117  }
6118  m_EggNumber = m_Counter1;
6119  */
6120  // this code assumes clutch effects of thin egg shells
6122  if (m_EggNumber < 1)
6123  {
6125  return toss_PreparingForBreeding;
6126  }
6127  }
6128 
6129  // The line below counts breeding attempts as at least one egg
6131  auto cs = new skClutch_struct;
6132  cs->L = m_OurLandscape;
6133  cs->Mum = this;
6134  cs->No = 0;
6135  cs->Terrs = m_OurTerritories;
6136 #ifdef FOR_DEMONSTRATION
6137  cs->x = m_Location_x + 3;
6138  cs->y = m_Location_y + 3;
6139 #else
6140  cs->x = m_Location_x;
6141  cs->y = m_Location_y;
6142 #endif
6143  cs->bx = m_Location_x;
6144  cs->by = m_Location_y;
6145  // This sets the veg type for ever for the life of this nest and any eggs it contains
6149  m_OurPopulationManager->CreateObjects(0, this, nullptr, cs, 1);
6150  delete cs;
6151  }
6152  // Put an egg in the clutch
6153  MyClutch->AddEgg();
6154  if (--m_Counter1 == 0)
6155  {
6156  // All eggs must be laid
6157  m_Counter1 = 18; // This will count how many day spent incubating
6159  return toss_Incubating; //TransferToState(Incubation);
6160  }
6161  return toss_Laying;
6162 }

References Skylark_Clutch::AddEgg(), CalculateEggNumber(), cfg_skylark_pesticide_eggshellreduction, cfg_skylark_pesticide_eggshellreduction_perclutch, cfg_skylark_pesticide_globaleggshellreduction, Skylark_Population_Manager::CreateObjects(), g_msg, g_rand_uni_fnc(), Skylark_struct::L, m_BreedingAttempts, m_Counter1, m_EggNumber, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, Skylark_Base::m_OurPopulationManager, Skylark_Base::m_OurTerritories, Skylark_Adult::m_pesticide_affected, MyClutch, MyMate, Skylark_Clutch::StartDeveloping(), Landscape::SupplyDayInYear(), Landscape::SupplyPesticideType(), Population_Manager_Base::SupplySimH(), Population_Manager_Base::SupplySimW(), Landscape::SupplyVegType(), Landscape::SupplyYearNumber(), ttop_eggshellthinning, ttop_ReproductiveEffects, CfgFloat::value(), CfgBool::value(), MapErrorMsg::Warn(), and WARN_BUG.

Referenced by Step().

◆ st_MakingNest()

TTypesOfSkState Skylark_Female::st_MakingNest ( )
protected

Tests for the necessary territory quality, if OK finds a nest location and builds the nest. Nest attempts are assumed to be breeding attempts.

5992  {
5997 #ifdef __PESTICIDE_RA_ADULT
5998  // If pesticide affected then breeding is delayed
5999  if (m_pesticide_affected > -1)
6000  {
6002  {
6003  NestLoc = false;
6004  return toss_PreparingForBreeding;
6005  }
6006  }
6007 #endif
6008 
6009  if (MyMate == nullptr)
6010  {
6011  g_msg->Warn(WARN_BUG, "Skylark_Female::st_MakingNest(): No mate!", "");
6012  exit(1);
6013  }
6014  const int today = m_OurLandscape->SupplyDayInYear();
6015  if (!NestLoc)
6016  {
6017  // First make a test whether territory is still OK
6018  const double qual = MyMate->Supply_TerritoryQual();
6019  if (qual < m_MinFemaleAcceptScore)
6020  {
6021  // May need to give up territory or might be because the crop has not
6022  // started growing in which case she will wait until May
6023  if (today >= June)
6024  {
6025  return toss_GivingUpTerritory; // GiveUpTerritory
6026  }
6027  return toss_MakingNest;
6028  }
6029 
6030  // Everything OK so find a nest location
6031  const bool valid = MyMate->SupplyNestValid();
6032  if (valid)
6033  {
6034  const APoint p = MyMate->SupplyNestLoc();
6035  m_Location_x = p.m_x;
6036  m_Location_y = p.m_y;
6037  // Must tell the male
6038  if (MyMate) MyMate->OnNestLocation(p.m_x, p.m_y);
6039  }
6040  else
6041  {
6042  if (today >= May + 14)
6043  {
6044  return toss_GivingUpTerritory; // GiveUpTerritory
6045  }
6046  return toss_MakingNest;
6047  }
6048  // The line below counts breeding attempts as nest building
6049  // the alternative is to count this from one egg laid in St_Laying()
6050  if (m_BreedingSuccess == -1) m_BreedingSuccess = 0; //Signal breeding was possible
6051  //m_BreedingAttempts++;
6052  }
6053  // Nest location must exist
6054  if (m_Counter1-- > 0) return toss_MakingNest;
6055  m_Counter1 = -1; // Code for deciding many days before laying starts
6056  return toss_Laying; //TransferToState Laying;
6057 }

References g_msg, June, m_BreedingSuccess, m_Counter1, TAnimal::m_Location_x, TAnimal::m_Location_y, m_MinFemaleAcceptScore, TAnimal::m_OurLandscape, Skylark_Adult::m_pesticide_affected, APoint::m_x, APoint::m_y, May, MyMate, NestLoc, Skylark_Male::OnNestLocation(), Skylark_Male::Supply_TerritoryQual(), Landscape::SupplyDayInYear(), Skylark_Male::SupplyNestLoc(), Skylark_Male::SupplyNestValid(), MapErrorMsg::Warn(), and WARN_BUG.

Referenced by Step().

◆ st_PreparingForBreeding()

int Skylark_Female::st_PreparingForBreeding ( )
protected

Builds up resources whilst waiting for good enough weather to begin nest building. Transitions to MakingNest or GiveUpTerritory (if too late in the season).

5955  {
5960 #ifdef __CJTDebug_5
5961  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
5962 #endif
5963  // Timing: Called once per day
5964  // EggCounter was set to Zero on leaving building up resources
5965  // Egg counter is the refraction period for producing the
5966  // eggs - nesbuilding time
5967  long today = m_OurLandscape->SupplyDayInYear();
5968  if (today > g_stopdate) return 2; // too late give up
5970  if (EggCounter++ > 5)
5971  {
5972  // if ( ( Resources < Breed_Res_Thresh2 ) || ( m_OurLandscape->SupplySnowcover() ) == true ) return 0; // snow or not enough resources
5973  if (m_OurLandscape->SupplySnowcover() == true) return 0; // snow
5974  // Check that the temp is above 5 for the last three days
5975  today = m_OurLandscape->SupplyGlobalDate();
5976  double t = m_OurLandscape->SupplyTemp(today);
5977  if (t < 5.0) return 0; // too cold
5978  t = m_OurLandscape->SupplyTemp(today - 1);
5979  if (t < 5.0) return 0; // too cold
5980  t = m_OurLandscape->SupplyTemp(today - 2);
5981  if (t < 5.0) return 0; // too cold
5982  // Everything is OK so build
5983  // takes one day less to build nest on first attempt (3 rather than 4)
5984  if (m_BreedingAttempts > 0) m_Counter1 = 4;
5985  else { m_Counter1 = 3; }
5986  return 1; // TransferToState(MakeNest)
5987  }
5988  return 0;
5989 }

References EggCounter, g_stopdate, GetFood(), m_BreedingAttempts, m_Counter1, TAnimal::m_OurLandscape, Skylark_Adult::RemoveEM(), Resources, Landscape::SupplyDayInYear(), Landscape::SupplyDaylength(), Landscape::SupplyGlobalDate(), Landscape::SupplySnowcover(), and Landscape::SupplyTemp().

Referenced by Step().

◆ st_StartingNewBrood()

int Skylark_Female::st_StartingNewBrood ( )
protected

Any current nests or clutches are removed. The female assesses the habitat quality of the territory. If still suitable (i.e. above MTQ) she will make a transition to Make Nest, otherwise she will go to Give Up Territory.

6202  {
6207 #ifdef __CJTDebug_5
6208  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
6209 #endif
6210  NestLoc = false;
6211  if (MyClutch)
6212  {
6213  MyClutch->OnMumGone();
6214  MyClutch = nullptr;
6215 #ifdef __SKPOM
6217 #endif
6218  }
6219  const double qual = MyMate->Supply_TerritoryQual();
6220  if (qual < m_MinFemaleAcceptScore)
6221  {
6222  return 2; // transferToState(GiveUpTerritory)
6223  }
6224  if (m_BreedingAttempts < 4 && m_OurLandscape->SupplyDayInYear() < g_stopdate)
6225  {
6226  // Was July-4
6227  if (m_BreedingAttempts > 0) m_Counter1 = 4;
6228  else m_Counter1 = 3;
6229  m_toowet = 0;
6230  return 1; // TransferToState(MakeNest)
6231  }
6233  return 3; // Transfer to state flocking
6234 }

References g_stopdate, m_BreedingAttempts, m_Counter1, m_MinFemaleAcceptScore, TAnimal::m_OurLandscape, Skylark_Base::m_OurPopulationManager, m_toowet, MyClutch, MyMate, NestLoc, Skylark_Clutch::OnMumGone(), st_StoppingBreeding(), Skylark_Male::Supply_TerritoryQual(), Landscape::SupplyDayInYear(), and Skylark_Population_Manager::WriteSKPOM1().

Referenced by Step().

◆ st_StoppingBreeding()

int Skylark_Female::st_StoppingBreeding ( )
protected

Called when the female stops breeding for the year. Removes the pair bond and tell the male she is leaving. She deregisters her territory ownership and if there has been no breeding success then she forgets the male.

6286  {
6291 #ifdef __CJTDebug_5
6292  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
6293 #endif
6294  if (MyClutch)
6295  {
6296  MyClutch->OnMumGone();
6297  MyClutch = nullptr;
6298 #ifdef __SKPOM
6300 #endif
6301  }
6302  // No longer paired
6303  Paired = false;
6304  // Tell the male you are leaving
6305  MyMate->OnMateLeaving();
6306  // if no breeding success then forget him
6307  if (!BSuccess) MyMate = nullptr;
6308  // de-register the territory ownership
6310  MyTerritory.ref = -1; // No territory
6311  // TransferToState(Flocking)
6312  return 3;
6313 }

References Skylark_Adult::BSuccess, TAnimal::m_OurLandscape, Skylark_Base::m_OurPopulationManager, Skylark_Base::m_OurTerritories, MyClutch, MyMate, Skylark_Adult::MyTerritory, Skylark_Male::OnMateLeaving(), Skylark_Clutch::OnMumGone(), Skylark_Adult::Paired, skTerritory_struct::ref, SkTerritories::RemoveFemale(), Landscape::SupplyDayInYear(), and Skylark_Population_Manager::WriteSKPOM1().

Referenced by st_StartingNewBrood(), and Step().

◆ st_TempLeavingArea()

int Skylark_Female::st_TempLeavingArea ( )
protected

Waits for one week of weather not classified as bad by Skylark_Adult::GetBadWeather

5595  {
5599 #ifdef __CJTDebug_5
5600  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
5601 #endif
5602  // Timing - called once per day
5603  if (!GetBadWeather()) GoodWeather++;
5604  else GoodWeather = 0;
5605  if (GoodWeather >= 7) // Week of not terrible weather
5606  {
5607  return 1; // comeback to the area
5608  }
5609  return 0; // return value of 0 do nothing, 1 go to Arrival
5610 }

References Skylark_Adult::GetBadWeather(), and Skylark_Adult::GoodWeather.

Referenced by Step().

◆ Step()

void Skylark_Female::Step ( void  )
overridevirtual

Step behaviour - must be implemented in descendent classes.

Reimplemented from TALMaSSObject.

5258  {
5259 #ifdef __CJTDebug_5
5260  if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
5261 #endif
5262  if (m_StepDone || m_CurrentSkState == toss_Destroy) return;
5263 #ifdef __CJTDebug_5
5264  if ( MyClutch ) {
5265  if ( MyClutch->Mother != this ) {
5266  g_land->Warn( "Skylark_Female::Step: DeBug5 ", NULL ); exit( 1 );
5267  }
5268  }
5269 #endif
5270  switch (m_CurrentSkState)
5271  {
5272  case toss_Initiation: // Initial
5273  m_CurrentSkState = toss_FFlocking;
5274  break;
5275  case toss_FFlocking: // Flocking
5276  switch (st_Flocking())
5277  {
5278  case 1:
5279  // use 0,0 as a default location
5280  m_Location_x = 0;
5281  m_Location_y = 0;
5282  m_CurrentSkState = toss_FEmigrating; // -> Emigration
5283  break;
5284  }
5285  m_StepDone = true;
5286  break;
5287  case toss_FFloating: // Floating
5288  m_StepDone = true;
5289  break;
5290  case toss_FArriving: // Arriving - instant
5291  if (st_Arriving()) m_CurrentSkState = toss_FFindingTerritory; // -> find terr.
5292  else { m_CurrentSkState = toss_FTempLeavingArea; }
5293  m_StepDone = true;
5294  break;
5295  case toss_FImmigrating: // Immigration - instant
5296  if (st_Immigrating()) m_CurrentSkState = toss_FArriving; // -> arrival
5297  else
5298  {
5299 #ifdef TEST_ISSUE_DEATH_WARRANT
5300  printf( "Skylark_Female::Step() : st_Immigrating() : %d\n", ( int )g_date->Date() );
5301 #endif
5302  m_CurrentSkState = toss_FDying; // -> die
5303  }
5304  break;
5305  case toss_FEmigrating: // Emigration
5306  if (st_Emigrating() == 1) m_CurrentSkState = toss_FImmigrating; // -> immigr.
5307  m_StepDone = true;
5308  break;
5309  case toss_FTempLeavingArea: // temp.leave.area
5310  if (st_TempLeavingArea()) m_CurrentSkState = toss_FArriving; // -> arrival
5311  m_StepDone = true;
5312  break;
5313  case toss_FFindingTerritory: // FindingTerritory
5314  switch (st_Finding_Territory())
5315  {
5316  case 1:
5317  m_CurrentSkState = toss_BuildingUpResources; // -> building res.
5318 #ifdef __CJTDebug_5
5319  if ( !Paired ) {
5320  g_land->Warn( "Skylark_Female::Step: !Paired ", NULL ); exit( 1 );
5321  }
5322 #endif
5323  break;
5324  case 2:
5325  // Should never be paired here
5326  m_CurrentSkState = toss_FFloating; // -> floating
5327  break;
5328  case 3:
5329  m_CurrentSkState = toss_FTempLeavingArea;
5330  break;
5331  }
5332  m_StepDone = true; // will now go one to EndStep
5333  break;
5334  case toss_BuildingUpResources: // Building Resources
5335 #ifdef __CJTDebug_5
5336  if ( !Paired ) {
5337  g_land->Warn( "Skylark_Female::Step: !Paired ", NULL ); exit( 1 );
5338  }
5339 #endif
5340  switch (st_BuildingUpResources())
5341  {
5342  case 1:
5343  m_CurrentSkState = toss_PreparingForBreeding; // -> prepare for breed.
5344  break;
5345  case 2:
5346  m_CurrentSkState = toss_GivingUpTerritory; // -> give up territory
5347  break;
5348  }
5349  m_StepDone = true;
5350  break;
5351  case toss_MakingNest: // Making nest
5353  m_StepDone = true; // will now go one to EndStep
5354  break;
5355  case toss_PreparingForBreeding: // PreparingForBreeding
5356 #ifdef __CJTDebug_5
5357  if ( !Paired ) {
5358  g_land->Warn( "Skylark_Female::Step: !Paired ", NULL ); exit( 1 );
5359  }
5360 #endif
5361  switch (st_PreparingForBreeding())
5362  {
5363  case 0: // Do nothing
5364  break;
5365  case 1:
5366  m_CurrentSkState = toss_MakingNest; // -> make nest
5367  NestLoc = false; // no nest location yet
5368  break;
5369  case 2: // Too late -> give up for this year
5370  m_CurrentSkState = toss_GivingUpTerritory;
5371  break;
5372  }
5373  m_StepDone = true; // will now go one to EndStep
5374  break;
5375  case toss_Laying: // Laying
5377  if (m_CurrentSkState == toss_Incubating) m_toowet = 0;
5378  m_StepDone = true;
5379  break;
5380  case toss_StartingNewBrood: // StartingNewBrood
5381  switch (st_StartingNewBrood())
5382  {
5383  case 1:
5384  m_CurrentSkState = toss_MakingNest; // -> make nest
5385  break;
5386  case 2:
5387  m_CurrentSkState = toss_GivingUpTerritory; // -> give up terr.
5388  break;
5389  case 3:
5390  m_CurrentSkState = toss_FFlocking; // -> flocking
5391  break;
5392  }
5393  m_StepDone = true; // will now go one to EndStep
5394  break;
5395  case toss_EggHatching: // EggHatching - happens after the young hatch at 1 min to midnight
5396  if (st_EggHatching()) m_CurrentSkState = toss_FCaringForYoung; // -> care for young
5397  m_StepDone = true;
5398  break;
5399  case toss_Incubating: // Incubation
5400  switch (st_Incubating())
5401  {
5402  case 1:
5403  {
5404  g_land->Warn("Skylark_Female::Step: EggHatching ", nullptr);
5405  exit(1);
5406  }
5407  //m_CurrentSkState=35; // -> egg hatch
5408  break;
5409  case 2:
5410  g_land->Warn("Skylark_Female::Step: Illegal Return Value ", nullptr);
5411  exit(1);
5412  case 3:
5413  m_CurrentSkState = toss_StartingNewBrood; // -> start new brood
5414  MyClutch->OnMumGone();
5415  MyClutch = nullptr;
5416 #ifdef __SKPOM
5418 #endif
5419  break;
5420  }
5421  m_StepDone = true; // will now go one to EndStep
5422  break;
5423  case toss_StoppingBreeding: // StopBreed. - instant
5424  if (st_StoppingBreeding())
5425  {
5426  m_CurrentSkState = toss_FFlocking; // -> flocking
5427  }
5428  break;
5429  case toss_FDying: // Dying
5430  st_Dying();
5431  m_StepDone = true;
5432  break;
5433  case toss_GivingUpTerritory: // giving up terr. - one day
5434  if (st_GivingUpTerritory() == 1) m_CurrentSkState = toss_FFloating; // -> floating
5435  m_StepDone = true;
5436  break;
5437  default:
5439  g_land->Warn("Skylark_Female::Step: Unknown State", st.c_str());
5440  exit(1);
5441  }
5442 }

References Calendar::Date(), g_date, g_land, Skylark_Base::m_CurrentSkState, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, Skylark_Base::m_OurPopulationManager, TALMaSSObject::m_StepDone, m_toowet, Skylark_Clutch::Mother, MyClutch, NestLoc, Skylark_Clutch::OnMumGone(), Skylark_Adult::Paired, st_Arriving(), st_BuildingUpResources(), st_Dying(), st_EggHatching(), st_Emigrating(), st_Finding_Territory(), st_Flocking(), st_GivingUpTerritory(), st_Immigrating(), st_Incubating(), st_Laying(), st_MakingNest(), st_PreparingForBreeding(), st_StartingNewBrood(), st_StoppingBreeding(), st_TempLeavingArea(), Landscape::SupplyDayInYear(), Population_Manager::SupplyStateNames(), Landscape::Warn(), and Skylark_Population_Manager::WriteSKPOM1().

◆ Supply_BreedingAttempts()

int Skylark_Female::Supply_BreedingAttempts ( ) const
5894  {
5895 #ifdef __CJTDebug_5
5896  if ( IsAlive() != 0xDEADC0DE )
5897  DEADCODEError();
5898 #endif
5899  return m_BreedingAttempts;
5900 }

References m_BreedingAttempts.

◆ Supply_BreedingSuccess()

int Skylark_Female::Supply_BreedingSuccess ( ) const
5904  {
5905 #ifdef __CJTDebug_5
5906  if ( IsAlive() != 0xDEADC0DE )
5907  DEADCODEError();
5908 #endif
5909  return m_BreedingSuccess;
5910 }

References m_BreedingSuccess.

◆ Supply_NestTime()

int Skylark_Female::Supply_NestTime ( ) const
inline
736 { return m_NestTime; }

Referenced by Skylark_Clutch::st_Developing().

◆ SupplyMyClutch()

Skylark_Clutch* Skylark_Female::SupplyMyClutch ( ) const
inline
738 { return MyClutch; }

Referenced by Skylark_Clutch::Step().

Member Data Documentation

◆ EggCounter

int Skylark_Female::EggCounter
protected

◆ m_BreedingAttempts

◆ m_BreedingSuccess

int Skylark_Female::m_BreedingSuccess
protected

◆ m_Counter1

◆ m_EggNumber

int Skylark_Female::m_EggNumber
protected

Referenced by st_Laying().

◆ m_MinFemaleAcceptScore

double Skylark_Female::m_MinFemaleAcceptScore
protected

◆ m_NestTime

int Skylark_Female::m_NestTime
protected

Referenced by FeedYoung(), and st_Incubating().

◆ m_pesticide_sprayed_die

bool Skylark_Female::m_pesticide_sprayed_die
protected

◆ m_toowet

int Skylark_Female::m_toowet
protected

◆ MyClutch

◆ MyMate

◆ NestLoc

bool Skylark_Female::NestLoc
protected

◆ Resources

double Skylark_Female::Resources
protected

The documentation for this class was generated from the following files:
Skylark_Female::NestLoc
bool NestLoc
Definition: skylarks_all.h:713
fiber_removal
Definition: Treatment.h:129
fp_rsm
Definition: Treatment.h:64
cfg_skylark_pesticide_globaleggshellreduction
CfgFloat cfg_skylark_pesticide_globaleggshellreduction
The proportion of eggs assumed to crack from pesticide effects as a global effect.
org_insecticide
Definition: Treatment.h:84
fa_sk
Definition: Treatment.h:71
row_cultivation
Definition: Treatment.h:88
fa_pk
Definition: Treatment.h:68
Skylark_Male::SupplyNestValid
bool SupplyNestValid() const
Definition: skylarks_all.h:873
winter_harrow
Definition: Treatment.h:144
fp_npk
Definition: Treatment.h:52
strigling
Definition: Treatment.h:89
g_rand_uni_fnc
double g_rand_uni_fnc()
Definition: ALMaSS_Random.cpp:56
harvest
Definition: Treatment.h:94
Skylark_Adult::RemoveEM
virtual double RemoveEM(double food)
Definition: skylarks_all.cpp:3527
fa_nk
Definition: Treatment.h:142
Skylark_Male::m_HabitatTable_Size
vector< int > m_HabitatTable_Size
Definition: skylarks_all.h:807
Skylark_Population_Manager::SupplyF_Mig_Mort
int SupplyF_Mig_Mort() const
Definition: skylarks_all.h:456
Skylark_Base::AddStriglingMort
void AddStriglingMort(const int lifestage) const
Definition: skylarks_all.h:531
Landscape::SupplyTemp
double SupplyTemp(void)
Passes a request on to the associated Weather class function, the temperature for the current day.
Definition: Landscape.h:1993
insecticide_treat
Definition: Treatment.h:83
straw_chopping
Definition: Treatment.h:99
Landscape::SupplyVegType
TTypesOfVegetation SupplyVegType(int a_x, int a_y)
Returns the vegetation type of the polygon using the polygon reference number a_polyref or coordinate...
Definition: Landscape.h:1925
Skylark_Female::m_NestTime
int m_NestTime
Definition: skylarks_all.h:712
fa_greenmanure
Definition: Treatment.h:76
Landscape::SupplyElementType
TTypesOfLandscapeElement SupplyElementType(int a_polyref)
Returns the landscape type of the polygon using the polygon reference number a_polyref or coordinates...
Definition: Landscape.h:1732
stubble_plough
Definition: Treatment.h:35
growth_regulator
Definition: Treatment.h:81
skTerritory_struct
Definition: skylarks_all.h:297
tole_UnsprayedFieldMargin
Definition: LandscapeFarmingEnums.h:94
cfg_skylark_pesticide_eggshellreduction
CfgFloat cfg_skylark_pesticide_eggshellreduction
The proportion of eggs assumed to crack from pesticide effects.
Population_Manager_Base::SupplySimH
int SupplySimH() const
Returns landscape height in m.
Definition: PopulationManager.h:569
deep_ploughing
Definition: Treatment.h:43
hilling_up
Definition: Treatment.h:91
green_harvest
Definition: Treatment.h:127
autumn_or_spring_plough
Definition: Treatment.h:103
cfg_ReturnProbability
CfgFloat cfg_ReturnProbability
Used to change the timing of start of arrival in the landscape.
flower_cutting
Definition: Treatment.h:121
Skylark_Male::SupplyNoHabitatRefs
int SupplyNoHabitatRefs() const
Definition: skylarks_all.h:830
Skylark_Male::SupplyBroodSize
int SupplyBroodSize() const
Definition: skylarks_all.h:832
FoodTripsPerDay
static int FoodTripsPerDay
Definition: skylarks_all.cpp:166
g_land
Landscape * g_land
Definition: skylarks_all.cpp:44
spring_plough
Definition: Treatment.h:44
fp_sk
Definition: Treatment.h:56
pruning
Definition: Treatment.h:125
Landscape::CorrectCoords
void CorrectCoords(int &x, int &y)
Function to prevent wrap around errors with co-ordinates using x/y pair.
Definition: Landscape.h:2206
Skylark_Base::m_CurrentSkState
TTypesOfSkState m_CurrentSkState
Definition: skylarks_all.h:517
fp_manure
Definition: Treatment.h:61
herbicide_treat
Definition: Treatment.h:80
fp_ammoniumsulphate
Definition: Treatment.h:60
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
flammebehandling
Definition: Treatment.h:90
Skylark_struct::L
Landscape * L
Definition: skylarks_all.h:214
straw_covering
Definition: Treatment.h:123
fp_boron
Definition: Treatment.h:131
Skylark_Population_Manager::WriteSKPOM1
void WriteSKPOM1(const int n, const int n2) const
Definition: skylarks_all.h:451
Skylark_Population_Manager::SupplyEMi
double SupplyEMi() const
Definition: skylarks_all.h:492
Skylark_Adult::GetBadWeather
static bool GetBadWeather()
Extreme weather conditions check.
Definition: skylarks_all.cpp:3521
fp_cu
Definition: Treatment.h:138
bulb_harvest
Definition: Treatment.h:122
preseeding_cultivator
Definition: Treatment.h:39
SkTerritories::RemoveFemale
void RemoveFemale(int ref) const
Definition: skylarks_all.cpp:2026
trial_control
Definition: Treatment.h:110
Landscape::SupplySnowcover
bool SupplySnowcover(void)
Passes a request on to the associated Weather class function, the snow cover for the current day.
Definition: Landscape.h:2091
Skylark_Male::OnFoodMessage
double OnFoodMessage(const int n, const double f) const
Definition: skylarks_all.h:842
fp_npks
Definition: Treatment.h:51
Skylark_Female::st_Incubating
int st_Incubating()
Definition: skylarks_all.cpp:6237
CfgFloat::value
double value() const
Definition: Configurator.h:142
Skylark_Male::SupplyBroodAge
int SupplyBroodAge(const int n) const
Definition: skylarks_all.h:834
burn_top
Definition: Treatment.h:143
fp_nk
Definition: Treatment.h:133
February
const int February
Julian start dates of the month of February.
Definition: Landscape.h:40
burn_straw_stubble
Definition: Treatment.h:104
org_herbicide
Definition: Treatment.h:85
skTerritory_struct::ref
int ref
Definition: skylarks_all.h:302
Skylark_Male::OnPairing
void OnPairing(Skylark_Female *female)
Definition: skylarks_all.cpp:4729
g_stopdate
int g_stopdate
Definition: skylarks_all.cpp:40
Skylark_Female::st_Emigrating
int st_Emigrating()
Definition: skylarks_all.cpp:5556
Skylark_Base::m_OurTerritories
SkTerritories * m_OurTerritories
Definition: skylarks_all.h:525
fa_cu
Definition: Treatment.h:140
autumn_roll
Definition: Treatment.h:38
strigling_hill
Definition: Treatment.h:117
JuvenileReturnMort
int JuvenileReturnMort
Definition: skylarks_all.cpp:199
heavy_cultivator_aggregate
Definition: Treatment.h:120
fp_manganesesulphate
Definition: Treatment.h:59
Skylark_Female::st_TempLeavingArea
int st_TempLeavingArea()
Definition: skylarks_all.cpp:5595
hay_turning
Definition: Treatment.h:100
skClutch_struct
Definition: skylarks_all.h:223
Skylark_Female::GetMigrationMortality
int GetMigrationMortality()
Definition: skylarks_all.cpp:6566
Skylark_Clutch::AddEgg
void AddEgg()
Definition: skylarks_all.h:573
last_treatment
Definition: Treatment.h:150
straw_removal
Definition: Treatment.h:124
fa_n
Definition: Treatment.h:139
Skylark_Female::st_BuildingUpResources
int st_BuildingUpResources()
Definition: skylarks_all.cpp:5924
shredding
Definition: Treatment.h:126
Skylark_Adult::m_pesticide_affected
int m_pesticide_affected
Definition: skylarks_all.h:659
Skylark_Female::st_PreparingForBreeding
int st_PreparingForBreeding()
Definition: skylarks_all.cpp:5955
pheromone
Definition: Treatment.h:149
skTerritory_struct::size
int size
Definition: skylarks_all.h:301
Skylark_Female::st_MakingNest
TTypesOfSkState st_MakingNest()
Definition: skylarks_all.cpp:5992
fp_n
Definition: Treatment.h:132
Skylark_Female::st_GivingUpTerritory
int st_GivingUpTerritory()
Definition: skylarks_all.cpp:6166
manual_weeding
Definition: Treatment.h:148
Skylark_Male::OnMateDying
void OnMateDying()
Definition: skylarks_all.cpp:4140
CfgBool::value
bool value() const
Definition: Configurator.h:164
fa_npk
Definition: Treatment.h:67
winter_plough
Definition: Treatment.h:42
fp_calcium
Definition: Treatment.h:65
spring_harrow
Definition: Treatment.h:45
cut_to_silage
Definition: Treatment.h:98
Skylark_Female::CalculateEggNumber
int CalculateEggNumber() const
Definition: skylarks_all.cpp:6493
Skylark_Male::OnMateNeverComesBack
void OnMateNeverComesBack(const Skylark_Female *AFemale)
Definition: skylarks_all.cpp:4357
June
const int June
Julian start dates of the month of June.
Definition: Landscape.h:48
fa_sludge
Definition: Treatment.h:77
pigs_out
Definition: Treatment.h:96
fp_p
Definition: Treatment.h:54
SkTerritories::Supply_F_Owner
Skylark_Female * Supply_F_Owner(int ref) const
Definition: skylarks_all.cpp:1386
suckering
Definition: Treatment.h:130
cut_to_hay
Definition: Treatment.h:97
fa_boron
Definition: Treatment.h:141
KcalPerGInsect_kg_inv
const double KcalPerGInsect_kg_inv
Definition: skylarks_all.cpp:177
Landscape::SupplySimAreaHeight
int SupplySimAreaHeight(void)
Gets the simulation landscape height.
Definition: Landscape.h:2302
Skylark_Female::CalcFoodTime
int CalcFoodTime(double target) const
Definition: skylarks_all.cpp:6521
Calendar::Date
long Date(void)
Definition: Calendar.h:57
Landscape::SupplySimAreaWidth
int SupplySimAreaWidth(void)
Gets the simulation landscape width.
Definition: Landscape.h:2297
TAnimal::m_Location_y
int m_Location_y
The objects ALMaSS y coordinate.
Definition: PopulationManager.h:366
fa_k
Definition: Treatment.h:70
SkTerritories::FemaleOccupy
void FemaleOccupy(int ref, Skylark_Female *Female) const
Definition: skylarks_all.cpp:2022
APoint
A simple class defining an x,y coordinate set.
Definition: ALMaSS_Setup.h:52
spring_roll
Definition: Treatment.h:46
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)
Definition: skylarks_all.cpp:3488
TAnimal::m_OurLandscape
static Landscape * m_OurLandscape
A pointer to the landscape object shared with all TAnimal objects.
Definition: PopulationManager.h:342
TAnimal::CheckManagement
void CheckManagement()
Used to start a check for any management related effects at the objects current location.
Definition: PopulationManager.cpp:1591
Skylark_Base::Age
int Age
Definition: skylarks_all.h:518
syninsecticide_treat
Definition: Treatment.h:111
Skylark_Female::st_StoppingBreeding
int st_StoppingBreeding()
Definition: skylarks_all.cpp:6286
Skylark_Female::st_Finding_Territory
int st_Finding_Territory()
Definition: skylarks_all.cpp:5631
fp_nc
Definition: Treatment.h:135
fungicide_treat
Definition: Treatment.h:82
Skylark_Clutch::StartDeveloping
void StartDeveloping()
Definition: skylarks_all.h:575
fp_sludge
Definition: Treatment.h:63
fp_greenmanure
Definition: Treatment.h:62
Skylark_Female::EggCounter
int EggCounter
Definition: skylarks_all.h:715
shallow_harrow
Definition: Treatment.h:119
SkTerritories::SupplyNoTerritories
int SupplyNoTerritories() const
Definition: skylarks_all.cpp:1362
fa_slurry
Definition: Treatment.h:72
cattle_out_low
Definition: Treatment.h:112
harvest_bushfruit
Definition: Treatment.h:137
preseeding_cultivator_sow
Definition: Treatment.h:40
fp_pk
Definition: Treatment.h:53
MaxFeedRain
double MaxFeedRain
Definition: skylarks_all.cpp:196
Population_Manager::SupplyStateNames
const char * SupplyStateNames(int i) const
Definition: PopulationManager.h:738
Skylark_Female::st_Immigrating
bool st_Immigrating()
Definition: skylarks_all.cpp:5517
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
fa_pks
Definition: Treatment.h:145
Skylark_Female::ResetBreedingSuccess
void ResetBreedingSuccess()
Definition: skylarks_all.cpp:5914
Skylark_Female::EstablishTerritory
void EstablishTerritory()
Definition: skylarks_all.cpp:5718
org_fungicide
Definition: Treatment.h:86
summer_harrow
Definition: Treatment.h:49
Skylark_Male::m_InsectTable
vector< double > m_InsectTable
Definition: skylarks_all.h:808
Landscape::SupplyDayInYear
int SupplyDayInYear(void)
Passes a request on to the associated Calendar class function, the day in the year.
Definition: Landscape.h:2267
cattle_out
Definition: Treatment.h:95
harvestshoots
Definition: Treatment.h:147
April
const int April
Julian start dates of the month of April.
Definition: Landscape.h:44
stubble_cultivator_heavy
Definition: Treatment.h:36
skTerritory_struct::y
int y
Definition: skylarks_all.h:300
TALMaSSObject::m_StepDone
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
Definition: PopulationManager.h:133
Skylark_Male
Definition: skylarks_all.h:760
Landscape::SupplyPesticideType
TTypesOfPesticide SupplyPesticideType(void)
Gets type of pesticide effect from a reference.
Definition: Landscape.h:788
APoint::m_x
int m_x
Definition: ALMaSS_Setup.h:55
biocide
Definition: Treatment.h:116
swathing
Definition: Treatment.h:93
Skylark_Adult::Paired
bool Paired
Definition: skylarks_all.h:670
Landscape::SupplyYearNumber
int SupplyYearNumber(void)
Passes a request on to the associated Calendar class function, returns m_simulationyear
Definition: Landscape.h:2287
glyphosate
Definition: Treatment.h:114
Skylark_Female::m_BreedingAttempts
int m_BreedingAttempts
Definition: skylarks_all.h:716
CfgInt::value
int value() const
Definition: Configurator.h:116
Skylark_Male::SupplyNestLoc
APoint SupplyNestLoc() const
Definition: skylarks_all.h:874
cfg_FemaleMinTerritoryAcceptScore
CfgFloat cfg_FemaleMinTerritoryAcceptScore
Skylark_Female::m_EggNumber
int m_EggNumber
Definition: skylarks_all.h:718
fa_manure
Definition: Treatment.h:75
Skylark_Female::st_Arriving
bool st_Arriving()
Definition: skylarks_all.cpp:5500
spring_sow
Definition: Treatment.h:47
ttop_eggshellthinning
Definition: LandscapeFarmingEnums.h:1067
cut_weeds
Definition: Treatment.h:106
Skylark_Male::OnEggHatch
void OnEggHatch()
Definition: skylarks_all.cpp:4630
trial_toxiccontrol
Definition: Treatment.h:109
summer_plough
Definition: Treatment.h:48
Landscape::EventtypeToString
std::string EventtypeToString(int a_event)
Returns the text representation of a treatment type.
Definition: Landscape.cpp:6024
Skylark_Male::Supply_Territory
skTerritory_struct Supply_Territory() const
Definition: skylarks_all.cpp:4373
Skylark_Female::GetFood
double GetFood(int time)
Definition: skylarks_all.cpp:6441
fp_pks
Definition: Treatment.h:146
fp_ns
Definition: Treatment.h:134
Landscape::SupplyRain
double SupplyRain(void)
Passes a request on to the associated Weather class function, the amount of rain for the current day.
Definition: Landscape.h:1971
Skylark_Female::m_Counter1
int m_Counter1
Definition: skylarks_all.h:711
Skylark_Adult::GoodWeather
int GoodWeather
Definition: skylarks_all.h:656
bed_forming
Definition: Treatment.h:118
May
const int May
Julian start dates of the month of May.
Definition: Landscape.h:46
January
const int January
Julian start dates of the month of January.
Definition: Landscape.h:38
product_treat
Definition: Treatment.h:113
Skylark_Male::OnNestLocation
void OnNestLocation(int x, int y)
Definition: skylarks_all.cpp:4717
Landscape::SupplyVegHeight
double SupplyVegHeight(int a_polyref)
Returns the height of the vegetation using the polygon reference number a_polyref or based on the x,...
Definition: Landscape.h:1527
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
Skylark_Adult::MyExtractEff
double MyExtractEff
Definition: skylarks_all.h:658
TALMaSSObject::OnArrayBoundsError
static void OnArrayBoundsError()
Used for debugging only, tests basic object properties.
Definition: PopulationManager.cpp:1614
ttop_ReproductiveEffects
Definition: LandscapeFarmingEnums.h:1061
autumn_sow
Definition: Treatment.h:41
Skylark_Female::st_Floating
int st_Floating()
Definition: skylarks_all.cpp:5614
Skylark_Male::Supply_TerritoryQual
double Supply_TerritoryQual() const
Definition: skylarks_all.h:837
Skylark_Base::m_OurPopulationManager
Skylark_Population_Manager * m_OurPopulationManager
Definition: skylarks_all.h:526
Skylark_Female::Resources
double Resources
Definition: skylarks_all.h:714
autumn_harrow
Definition: Treatment.h:37
SkTerritories::Supply_Owner
Skylark_Male * Supply_Owner(int ref) const
Definition: skylarks_all.cpp:1382
Skylark_Female::st_StartingNewBrood
int st_StartingNewBrood()
Definition: skylarks_all.cpp:6202
fa_calcium
Definition: Treatment.h:79
Skylark_Male::OnMateLeaving
void OnMateLeaving()
Definition: skylarks_all.cpp:4163
Skylark_Female::st_EggHatching
int st_EggHatching()
Definition: skylarks_all.cpp:6273
September
const int September
Julian start dates of the month of September.
Definition: Landscape.h:54
fa_ammoniumsulphate
Definition: Treatment.h:74
Skylark_Population_Manager::CreateObjects
void CreateObjects(int ob_type, TAnimal *pTAo, void *null, Skylark_struct *data, int number)
Definition: skylarks_all.cpp:539
tole_Field
Definition: LandscapeFarmingEnums.h:65
Population_Manager_Base::SupplySimW
int SupplySimW() const
Returns landscape width in m.
Definition: PopulationManager.h:567
March
const int March
Julian start dates of the month of March.
Definition: Landscape.h:42
Skylark_Male::HaveTerritory
bool HaveTerritory
Definition: skylarks_all.h:813
autumn_sow_with_ferti
Definition: Treatment.h:136
trial_insecticidetreat
Definition: Treatment.h:108
fa_p
Definition: Treatment.h:69
mow
Definition: Treatment.h:105
Skylark_Female::m_toowet
int m_toowet
Definition: skylarks_all.h:720
fa_rsm
Definition: Treatment.h:78
Skylark_Female::st_Flocking
int st_Flocking()
Definition: skylarks_all.cpp:5473
Skylark_Male::SupplyBroodWeight
int SupplyBroodWeight(const int n) const
Definition: skylarks_all.h:839
g_random_fnc
int g_random_fnc(const int a_range)
Definition: ALMaSS_Random.cpp:74
fa_npks
Definition: Treatment.h:66
water
Definition: Treatment.h:92
stubble_harrowing
Definition: Treatment.h:102
Skylark_Female::MyMate
Skylark_Male * MyMate
Definition: skylarks_all.h:724
fp_liquidNH3
Definition: Treatment.h:57
cfg_SkylarkFirstBreedingDate
CfgInt cfg_SkylarkFirstBreedingDate
The date at which breeding start can happen.
molluscicide
Definition: Treatment.h:87
TALMaSSObject::m_CurrentStateNo
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:131
hay_bailing
Definition: Treatment.h:101
Breed_Temp_Thresh
const double Breed_Temp_Thresh
Definition: skylarks_all.cpp:211
fa_manganesesulphate
Definition: Treatment.h:73
skTerritory_struct::nqual
double nqual
Definition: skylarks_all.h:303
Skylark_Clutch::Mother
Skylark_Female * Mother
Definition: skylarks_all.h:583
Skylark_Adult::ReInit
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)
Definition: skylarks_all.cpp:3502
fp_k
Definition: Treatment.h:55
Skylark_Clutch::OnMumGone
void OnMumGone()
Definition: skylarks_all.cpp:2342
Skylark_Adult::MyTerritory
skTerritory_struct MyTerritory
Definition: skylarks_all.h:660
Skylark_Female::FeedYoung
void FeedYoung()
Definition: skylarks_all.cpp:6344
Landscape::Warn
void Warn(std::string a_msg1, std::string a_msg2)
Wrapper for the g_msg Warn function.
Definition: Landscape.h:2250
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.
autumn_plough
Definition: Treatment.h:34
Skylark_Male::MyMate
Skylark_Female * MyMate
Definition: skylarks_all.h:798
Skylark_Female::st_Laying
TTypesOfSkState st_Laying()
Definition: skylarks_all.cpp:6060
TAnimal::m_Location_x
int m_Location_x
The objects ALMaSS x coordinate.
Definition: PopulationManager.h:362
Skylark_Female::m_MinFemaleAcceptScore
double m_MinFemaleAcceptScore
Definition: skylarks_all.h:721
skTerritory_struct::x
int x
Definition: skylarks_all.h:299
Skylark_Female::MyClutch
Skylark_Clutch * MyClutch
Definition: skylarks_all.h:710
Skylark_Female::st_CaringForYoung
int st_CaringForYoung()
Definition: skylarks_all.cpp:6316
Landscape::SupplyDaylength
int SupplyDaylength(void)
Passes a request on to the associated Weather class function, the day length for the current day.
Definition: Landscape.h:2201
Landscape::SupplyPolyRef
int SupplyPolyRef(int a_x, int a_y)
Get the in map polygon reference number from the x, y location.
Definition: Landscape.h:2157
cfg_insecticide_direct_mortF
CfgInt cfg_insecticide_direct_mortF
fp_slurry
Definition: Treatment.h:58
fiber_covering
Definition: Treatment.h:128
WARN_BUG
Definition: MapErrorMsg.h:34
APoint::m_y
int m_y
Definition: ALMaSS_Setup.h:56
Landscape::SupplyGlobalDate
long SupplyGlobalDate(void)
Passes a request on to the associated Calendar class function, returns the simulation global date for...
Definition: Landscape.h:2292
summer_sow
Definition: Treatment.h:50
spring_sow_with_ferti
Definition: Treatment.h:115
Skylark_Female::st_Dying
void st_Dying()
Definition: skylarks_all.cpp:5735
October
const int October
Julian start dates of the month of October.
Definition: Landscape.h:56
sleep_all_day
Definition: Treatment.h:33
Skylark_Female::m_BreedingSuccess
int m_BreedingSuccess
Definition: skylarks_all.h:717
strigling_sow
Definition: Treatment.h:107
Skylark_Adult::BSuccess
bool BSuccess
Definition: skylarks_all.h:657