File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/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_Population_Manager Class Reference

#include <skylarks_all.h>

Inheritance diagram for Skylark_Population_Manager:
Population_Manager Population_Manager_Base

Public Member Functions

void CreateObjects (int ob_type, TAnimal *pTAo, void *null, Skylark_struct *data, int number)
 
virtual void Init (void)
 
void WriteSKPOM1 (const int n, const int n2) const
 
void WriteSKPOM2 (const int n, const int n2) const
 
int SupplyM_Mig_Mort () const
 
int SupplyF_Mig_Mort () const
 
int SupplyNoTerritories () const
 
int TheSkylarkTerrsSupply_x (int) const
 
int TheSkylarkTerrsSupply_y (int) const
 
int TheSkylarkTerrsSupply_size (int) const
 
int TheSkylarkTerrsSupply_quality (int) const
 
void SetM_Mig_Mort (const int m)
 
void SetF_Mig_Mort (const int m)
 
 Skylark_Population_Manager (Landscape *L)
 
 ~Skylark_Population_Manager (void) override
 
int TheFledgelingProbe () override
 
void BreedingPairsOutput (int Time) override
 
void FledgelingProbeOutput (int Total, int Time) override
 
int TheBreedingFemalesProbe (int ProbeNo) override
 
bool OpenTheBreedingPairsProbe () override
 
bool OpenTheFledgelingProbe () override
 
void incNoFledgeDeaths ()
 
void incNoChickDeaths ()
 
void incNoPestEffects ()
 
void incTotalEggs (const int eggs)
 
void incTotalNestlings ()
 
void incTotalPrefledgelings ()
 
void AddStriglingMort (const int lifestage)
 
double SupplyEMi () const
 
bool IsBadWeather () const
 
bool OpenTheBreedingSuccessProbe () override
 
void BreedingSuccessProbeOutput (double, int, int, int, int, int, int, int) override
 
int TheBreedingSuccessProbe (int &BreedingFemales, int &YoungOfTheYear, int &TotalPop, int &TotalFemales, int &TotalMales, int &BreedingAttempts) override
 
void TheAOROutputProbe () override
 
virtual void TheRipleysOutputProbe (FILE *a_prb)
 
- Public Member Functions inherited from Population_Manager
 Population_Manager (Landscape *a_l_ptr, int a_numberLifeStages=12)
 
virtual ~Population_Manager (void)
 
void SetNoProbesAndSpeciesSpecificFunctions (int a_pn) override
 Sets up probe and species specifics. More...
 
void OpenTheAOROutputProbe (const string &a_AORFilename) override
 Opens the AOR output file. More...
 
unsigned GetLiveArraySize (int a_listindex) override
 Gets the number of 'live' objects for a list index in the TheArray. More...
 
unsigned GetPopulationSize (int a_listindex) override
 Gets the number of species objects by default it is the same as LiveArray, however it could be different. This function should be used/overriden when we are interested in the number of the objects for presentation and not in inner maintenance of the PopulationManager and or TheArray. More...
 
void IncLiveArraySize (int a_listindex)
 Increments the number of 'live' objects for a list index in the TheArray. More...
 
unsigned int FarmAnimalCensus (unsigned int a_farm, unsigned int a_typeofanimal)
 
char * SpeciesSpecificReporting (int a_species, int a_time) override
 
char * ProbeReport (int a_time)
 
char * ProbeReportTimed (int a_time)
 
void ImpactProbeReport (int a_Time)
 
bool BeginningOfMonth ()
 
void LOG (const char *fname)
 
int SupplyStepSize () const
 
void Run (int NoTSteps) override
 
virtual unsigned Probe (int ListIndex, Probe_Data *p_TheProbe)
 
virtual void ImpactedProbe ()
 
virtual TAnimalSupplyAnimalPtr (unsigned int a_index, unsigned int a_animal)
 Returns the pointer indexed by a_index and a_animal. Note NO RANGE CHECK. More...
 
virtual unsigned SupplyListIndexSize ()
 
unsigned SupplyListSize (unsigned listindex) const
 
void PushIndividual (const unsigned a_listindex, TAnimal *a_individual_ptr)
 
const char * SupplyStateNames (int i) const
 
unsigned SupplyStateNamesLength () const
 
virtual void DisplayLocations ()
 
TAnimalFindIndividual (unsigned Type, TAnimal *a_me)
 
virtual TAnimalFindClosest (int x, int y, unsigned Type, TAnimal *a_me)
 
omp_nest_lock_t * GetGuardMapElement (unsigned a_x_index, unsigned a_y_index)
 Return the guard map cell. More...
 
void SetGuardMapElement (unsigned a_x_index, unsigned a_y_index)
 Set the given guard map cell. More...
 
void UnsetGuardMapElement (unsigned a_x_index, unsigned a_y_index)
 Unset the given guard map cell. More...
 
void UpdateGuardMap (int a_x, int a_y, int &a_index_x, int &a_index_y)
 Get the index of the guard map for the given location. More...
 
bool OpenTheRipleysOutputProbe ()
 
bool OpenTheMonthlyRipleysOutputProbe ()
 
bool OpenTheReallyBigProbe ()
 
virtual void TheRipleysOutputProbe (ofstream *a_prb)
 Special output functionality. More...
 
virtual void TheReallyBigOutputProbe ()
 
void CloseTheMonthlyRipleysOutputProbe () const
 
virtual void CloseTheRipleysOutputProbe ()
 
virtual void CloseTheReallyBigOutputProbe ()
 
TTypesOfPopulation GetPopulationType ()
 
int GetSeasonNumber ()
 Get the season number. More...
 
void LamdaDeath (int x, int y)
 
void LamdaBirth (int x, int y)
 
void LamdaBirth (int x, int y, int z)
 
void LamdaClear ()
 
void LamdaDumpOutput ()
 
virtual int SupplyPegPosx (int)
 
virtual int SupplyPegPosy (int)
 
virtual int SupplyCovPosx (int)
 
virtual int SupplyCovPosy (int)
 
virtual void TheGeneticProbe (unsigned, int, unsigned &)
 
virtual void GeneticsResultsOutput (FILE *, unsigned)
 
void Debug_Shuffle (unsigned int Type)
 
virtual void RunStepMethods ()
 
- Public Member Functions inherited from Population_Manager_Base
 Population_Manager_Base (Landscape *L)
 The Population_Manager_Base constructor. More...
 
virtual void Catastrophe (int)
 Must be re-implemented in descendent classes. More...
 
int SupplySimW () const
 Returns landscape width in m. More...
 
int SupplySimH () const
 Returns landscape height in m. More...
 
int SupplySimWH () const
 Returns half the landscape width in m. More...
 
int SupplySimHH () const
 Returns half the landscape height in m. More...
 
virtual int ProbeFileInput (char *p_Filename, int p_ProbeNo)
 A stub to build specfic probes and functions. More...
 
int SupplyListNameLength () const
 
const char * SupplyListName (int a_i) const
 Get a list name from the list. More...
 
virtual void SupplyLocXY (unsigned, unsigned, int &, int &)
 A stub for identifying an individual at a location. More...
 
virtual TAnimalFindClosest (int, int, unsigned)
 A stub for identifying an individual at a location. More...
 
std::string SupplySimulationName ()
 
void SetStepCounterInADay (int a_counter)
 Set step counter in a day. More...
 
int GetStepCounterInADay (void)
 Return the sep counter in a day. More...
 
virtual double GetAphidDensity (int, int)
 Return the aphid density, it is only used when aphid simulations are running. More...
 

Public Attributes

SkTerritoriesTheSkylarkTerrs
 
int * VegTypeFledgelings
 
- Public Attributes inherited from Population_Manager
bool ProbesSet {}
 
- Public Attributes inherited from Population_Manager_Base
Probe_DataTheProbe [100] = {nullptr}
 Holds a list of pointers to standard output probes. More...
 

Protected Member Functions

void DoFirst () override
 
void ProbeReportPOM (int a_time)
 
float ProbePOM (int ListIndex, const Probe_Data *p_TheProbe)
 Modified probe for POM Output. More...
 
void LoadParameters ()
 
void Catastrophe () override
 
virtual void ReHouse ()
 
- Protected Member Functions inherited from Population_Manager
virtual bool StepFinished ()
 Methods to run the simulations. More...
 
virtual void DoBefore ()
 
virtual void DoAfter ()
 
virtual void DoLast ()
 
virtual void DoSpecialBetweenLifeStages (int a_life_stage)
 
virtual void SortX (unsigned Type)
 
void SortXIndex (unsigned Type)
 
virtual void SortY (unsigned Type)
 
void SortState (unsigned Type)
 
void SortStateR (unsigned Type)
 
virtual unsigned PartitionLiveDead (unsigned Type)
 
virtual void Shuffle_or_Sort (unsigned Type)
 
virtual void Shuffle (unsigned Type)
 
- Protected Member Functions inherited from Population_Manager_Base
 ~Population_Manager_Base ()=default
 

Protected Attributes

int M_Mig_Mort
 
int F_Mig_Mort
 
double EMi
 
int m_StriglingMort [4]
 
int m_TotalEggs
 
int m_TotalNestlings
 
int m_TotalPrefledgelings
 
int m_NoFledgeDeaths
 
int m_NoChickDeaths
 
int m_NoPestEffects
 
bool m_IsBadWeather
 
FILE * SKPOM1
 
FILE * SKPOM2
 
- Protected Attributes inherited from Population_Manager
vector< unsigned > m_LiveArraySize
 
int m_NoProbes = 0
 
std::vector< std::vector< omp_nest_lock_t * > > m_MapGuard
 This is used to make sure animals will not behaviour at the same area - multi threads. More...
 
int m_guard_cell_height_num
 
int m_guard_cell_width_num
 
int m_guard_cell_size
 
bool m_is_paralleled
 This is used to indicate whether the species is paralleled. More...
 
const char * StateNames [100] {}
 
int m_StepSize {}
 
vector< vector< forward_list< TAnimal * > * > > TheSubArrays
 Hold all the animal pointers. More...
 
vector< vector< int > > TheSubArraysSizes
 Hold all the animal sizes in each thread. More...
 
vector< int > m_LifeStageOrderVec
 The vector to store the life stage order for looping specie life stages. More...
 
vector< forward_list< TAnimal * >::iterator > TheSubArraysIterators
 the iterator from last time called for SupplyAnimalPtr(), this for fast loop all the animals in the derived class. More...
 
vector< int > TheSubArrayPreviousIndex
 the animal index number from last time called for SupplyAnimalPtr(), this for fast loop all the animals in the derived class. More...
 
vector< int > TheSubArrayThreadIndex
 the thread index number from last time called for SupplyAnimalPtr(), this for fast loop all the animals in the derived class. More...
 
unsigned StateNamesLength
 
FILE * TestFile {}
 
FILE * TestFile2 {}
 
vector< unsigned > BeforeStepActions
 Holds the season list of possible before step actions. More...
 
int m_SeasonNumber
 Holds the season number. Used when running goose and hunter sims. More...
 
TTypesOfPopulation m_population_type {TOP_NoSpecies}
 
ofstream * AOROutputPrb {}
 
ofstream * RipleysOutputPrb {}
 
ofstream * RipleysOutputPrb1 {}
 
ofstream * RipleysOutputPrb2 {}
 
ofstream * RipleysOutputPrb3 {}
 
ofstream * RipleysOutputPrb4 {}
 
ofstream * RipleysOutputPrb5 {}
 
ofstream * RipleysOutputPrb6 {}
 
ofstream * RipleysOutputPrb7 {}
 
ofstream * RipleysOutputPrb8 {}
 
ofstream * RipleysOutputPrb9 {}
 
ofstream * RipleysOutputPrb10 {}
 
ofstream * RipleysOutputPrb11 {}
 
ofstream * RipleysOutputPrb12 {}
 
ofstream * ReallyBigOutputPrb {}
 
AOR_Probem_AOR_Probe {}
 A pointer to the AOR probe. More...
 
long int lamdagrid [2][257][257] {}
 
- Protected Attributes inherited from Population_Manager_Base
int SimH
 stores the simulation height More...
 
int SimW
 stores the simulation width More...
 
int SimHH
 stores the simulation height halved More...
 
int SimWH
 stores the simulation width halved More...
 
string m_SimulationName
 stores the simulation name More...
 
Landscapem_TheLandscape
 holds an internal pointer to the landscape More...
 
int m_ListNameLength {}
 the number of life-stages simulated in the population manager More...
 
const char * m_ListNames [32] {}
 A list of life-stage names. More...
 
std::string m_AORProbeFileName {"AOR_Probe.txt"}
 name of the AOR Probe file More...
 
std::string m_ProbeFileName {"Probe.res"}
 name of the Probe file More...
 
int m_step_counter_in_a_day
 Step counter in a day, this is used for the animals with finer step size other than one day. More...
 

Constructor & Destructor Documentation

◆ Skylark_Population_Manager()

Skylark_Population_Manager::Skylark_Population_Manager ( Landscape L)
268  : Population_Manager(L, 5) {
269  // Five lists are needed:
270  // Clutches,Nestlings,PreFledgelings,Males,Females
271 
272  M_Mig_Mort = 0;
273  F_Mig_Mort = 0;
274  //
275  /*
276  F_Mig_Mort_min = cfg_femreturnmortmin.value();
277  F_Mig_Mort_max = cfg_femreturnmortmax.value();
278  M_Mig_Mort_min = cfg_malereturnmortmin.value();
279  M_Mig_Mort_max = cfg_malereturnmortmax.value();
280  */
281  //
283  //SkYoungWetDay = cfg_skyoungwetday.value();
284 
286 #ifdef __CJTDebug_10
287  refnum = 0;
288 #endif
289  Init();
290 
293  this->OpenTheFledgelingProbe();
294 }

References cfg_juvreturnmort, F_Mig_Mort, Init(), JuvenileReturnMort, M_Mig_Mort, OpenTheBreedingPairsProbe(), OpenTheBreedingSuccessProbe(), OpenTheFledgelingProbe(), TheSkylarkTerrs, and CfgInt::value().

◆ ~Skylark_Population_Manager()

Skylark_Population_Manager::~Skylark_Population_Manager ( void  )
override
527  {
528  // delete all lists
529  delete TheSkylarkTerrs;
530  delete []VegTypeFledgelings;
531 #ifdef __SKPOM
532  fclose(SKPOM1);
533  fclose(SKPOM2);
534 #endif
535 }

References SKPOM1, SKPOM2, TheSkylarkTerrs, and VegTypeFledgelings.

Member Function Documentation

◆ AddStriglingMort()

void Skylark_Population_Manager::AddStriglingMort ( const int  lifestage)
inline
490 { m_StriglingMort[lifestage]++; }

Referenced by Skylark_Base::AddStriglingMort().

◆ BreedingPairsOutput()

void Skylark_Population_Manager::BreedingPairsOutput ( int  Time)
overridevirtual

Reimplemented from Population_Manager.

718  {
719  FILE* MyFile = fopen("BreedingPairs.txt", "a");
720  if (!MyFile)
721  {
722  g_msg->Warn(WARN_FILE, "Skylark_Population_Manager::BreedingPairsOutput():", "Cannot open file for append: BreedingPairs.txt");
723  exit(0);
724  }
725  int no = 0;
726  const int szf = static_cast<int>(GetLiveArraySize(4));
727  const int szm = static_cast<int>(GetLiveArraySize(3));
728  for (int j = 0; j < szf; j++)
729  {
730  const auto FS = dynamic_cast<Skylark_Female*>(SupplyAnimalPtr(4, j));
731  if (FS->Paired)
732  {
733  // Below is a POM test for farm owner 50 - an identifier used to select a single experimental field or set of fields in the polyref file.
734  if (g_land->SupplyFarmOwner(FS->Supply_m_Location_x(), FS->Supply_m_Location_y()) == 50)
735  {
736  const TTypesOfSkState behav = FS->m_CurrentSkState;
737  switch (behav)
738  {
739  case toss_BuildingUpResources:
740  case toss_PreparingForBreeding:
741  case toss_MakingNest:
742  case toss_Laying:
743  case toss_EggHatching:
744  case toss_Incubating:
745  case toss_FCaringForYoung:
746  no++;
747  // g_MainForm->m_aMap->Spot( 3, FS->Supply_m_Location_x(), FS->Supply_m_Location_y() );
748  break;
749  default: ;
750  }
751  }
752  }
753  }
754  fprintf(MyFile, "%d\t%d\t%d\t%d\n", time, no, szf, szm);
755  fclose(MyFile);
756 }

References g_land, g_msg, Population_Manager::GetLiveArraySize(), Population_Manager::SupplyAnimalPtr(), Landscape::SupplyFarmOwner(), MapErrorMsg::Warn(), and WARN_FILE.

◆ BreedingSuccessProbeOutput()

void Skylark_Population_Manager::BreedingSuccessProbeOutput ( double  No,
int  BreedingFemales,
int  YoungOfTheYear,
int  TotalPop,
int  TotalFemales,
int  TotalMales,
int  time,
int  BreedingAttempts 
)
overridevirtual

Reimplemented from Population_Manager.

790  {
791  FILE* MyFile = fopen("BreedingSuccess.txt", "a");
792  if (!MyFile)
793  {
794  g_msg->Warn(WARN_FILE, "Skylark_Population_Manager::BreedingAttemptsOutput():", "Cannot open file for append: BreedingAttempts.txt");
795  exit(0);
796  }
797  // Do some calculations
798  const double floaters = (TotalPop - (YoungOfTheYear + BreedingFemales * 2)) / static_cast<double>(TotalPop - YoungOfTheYear);
799  const double HatchSuccess = m_TotalNestlings / static_cast<double>(m_TotalEggs + 1);
800  const double FledgeSuccess = m_TotalPrefledgelings / static_cast<double>(m_TotalNestlings + 1);
801  const double BreedingSuccess = m_TotalPrefledgelings / static_cast<double>(m_TotalEggs + 1);
802  // Print the results and data
803  fprintf(MyFile, "%d\t%d\t%d\t%d\t%d\t%d\t%d\t%g\t%g\t%g\t%g\t%g\t\n", time, BreedingFemales, BreedingAttempts, YoungOfTheYear, TotalPop,
804  TotalFemales, TotalMales, floaters, No, HatchSuccess, FledgeSuccess, BreedingSuccess);
805  //fprintf( MyFile, "%i\t%i\t%i\t%i\n", m_StriglingMort[ 0 ], m_StriglingMort[ 1 ],
806  // m_StriglingMort[ 2 ], m_StriglingMort[ 3 ] );
807  for (int h = 0; h < 4; h++) m_StriglingMort[h] = 0;
808  fclose(MyFile);
809  // Zero any counters
810  m_TotalEggs = 0;
811  m_TotalNestlings = 0;
813 }

References g_msg, m_StriglingMort, m_TotalEggs, m_TotalNestlings, m_TotalPrefledgelings, MapErrorMsg::Warn(), and WARN_FILE.

◆ Catastrophe()

void Skylark_Population_Manager::Catastrophe ( void  )
overrideprotectedvirtual

Reimplemented from Population_Manager.

1156  {
1157  // This version simply alters populations on 1st January - it is very dangerous to
1158  // add individuals in many of the models so beware!!!!
1159 
1160  // First do we have the right day?
1161  const int today = m_TheLandscape->SupplyDayInYear();
1162  if (today != 1) return;
1163  // First do we have the right year?
1165  if (year % cfg_PmEventfrequency.value() != 0) return;
1166 
1167  // assignment to get rid of warning
1168  Skylark_Adult* AS = nullptr;
1169  // Now if the % decrease is higher or lower than 100 we need to do different things
1170  int esize = cfg_PmEventsize.value();
1171  if (esize < 100)
1172  {
1173  unsigned size2 = static_cast<int>(GetLiveArraySize(sob_Male));
1174  for (unsigned j = 0; j < size2; j++)
1175  {
1176  if (g_random_fnc(100) > esize)
1177  {
1178  const auto MS = dynamic_cast<Skylark_Male*>(SupplyAnimalPtr(3, j));
1179  if (MS->MyMate != nullptr) MS->MyMate->OnMateDying();
1180  MS->Dying(); // Kill it
1181  }
1182  }
1183  size2 = static_cast<int>(GetLiveArraySize(sob_Female));
1184  for (unsigned j = 0; j < size2; j++)
1185  {
1186  if (g_random_fnc(100) > esize)
1187  {
1188  const auto FS = dynamic_cast<Skylark_Female*>(SupplyAnimalPtr(4, j));
1189  if (FS->MyMate != nullptr) FS->MyMate->OnMateDying();
1190  FS->Dying(); // Kill it
1191  }
1192  }
1193  }
1194  else if (esize > 100)
1195  {
1196  // This is a tricky thing to do because we need to duplicate birds, but dare not mess
1197  // mate pointers etc up.
1198  // This also requires a copy method in the target birds
1199  // esize also needs translating 120 = 20%, 200 = 100%
1200  if (esize < 200)
1201  {
1202  esize -= 100;
1203  for (unsigned i = 3; i < 5; i++)
1204  {
1205  const unsigned size2 = static_cast<int>(GetLiveArraySize(i));
1206  for (unsigned j = 0; j < size2; j++)
1207  {
1208  if (g_random_fnc(100) < esize)
1209  {
1210  AS = dynamic_cast<Skylark_Adult*>(SupplyAnimalPtr(i, j));
1211  AS->CopyMyself(i); // Duplicate it
1212  }
1213  }
1214  }
1215  }
1216  else
1217  {
1218  esize -= 100;
1219  esize /= 100; // this will throw away fractional parts so will get 1, 2, 3 from 200, 350 400
1220  for (unsigned i = 3; i < 5; i++)
1221  {
1222  const unsigned size2 = static_cast<int>(GetLiveArraySize(i));
1223  for (unsigned j = 0; j < size2; j++)
1224  {
1225  for (int e = 0; e < esize; e++)
1226  {
1227  AS = dynamic_cast<Skylark_Adult*>(SupplyAnimalPtr(i, j));
1228  AS->CopyMyself(i); // Duplicate it
1229  }
1230  }
1231  }
1232  }
1233  }
1234  else return; // No change so do nothing
1235 }

References cfg_CatastropheEventStartYear, cfg_PmEventfrequency, cfg_PmEventsize, Skylark_Adult::CopyMyself(), g_random_fnc(), Population_Manager::GetLiveArraySize(), Population_Manager_Base::m_TheLandscape, Population_Manager::SupplyAnimalPtr(), Landscape::SupplyDayInYear(), Landscape::SupplyYearNumber(), and CfgInt::value().

◆ CreateObjects()

void Skylark_Population_Manager::CreateObjects ( int  ob_type,
TAnimal pTAo,
void *  null,
Skylark_struct data,
int  number 
)
539  {
540  Skylark_Clutch* New_Clutch;
541  Skylark_Nestling* New_Nestling;
542  Skylark_PreFledgeling* New_PreFledgeling;
543  Skylark_Male* New_Male;
544  Skylark_Female* New_Female;
545 
546  skClutch_struct* cs;
547  Nestling_struct* ns;
550 
551  bool aCopy = false;
552  if (number == -1)
553  {
554  aCopy = true;
555  number = 1;
556  }
557 
558  for (int i = 0; i < number; i++)
559  {
560 #ifdef __CJTDebug_10
561  refnum++;
562 #endif
563  if (ob_type == 0)
564  {
565  cs = dynamic_cast<skClutch_struct*>(data);
566 
567  New_Clutch = new Skylark_Clutch(cs->Mum, cs->Terrs, cs->L, cs->No, cs->x, cs->y, cs->mh, this);
568  PushIndividual(ob_type, New_Clutch);
569  IncLiveArraySize(ob_type);
570  // Give mum the pointer to the clutch
571  cs->Mum->OnSetMyClutch(New_Clutch);
572 
573 #ifdef __CJTDebug_10
574  New_Clutch->m_Ref = refnum;
575 #endif
576  }
577  if (ob_type == 1)
578  {
579  ns = dynamic_cast<Nestling_struct*>(data);
580 
581  New_Nestling = new Skylark_Nestling(ns->x, ns->y, ns->Dad, ns->L, ns->Terrs, this, ns->bx, ns->by, ns->mh);
582  PushIndividual(ob_type, New_Nestling);
583  IncLiveArraySize(ob_type);
584  // Give Dad a pointer to nestling
585  ns->Dad->OnAddNestling(New_Nestling);
586 
587  // Count this as a chick hatched
589 #ifdef __CJTDebug_10
590  New_Nestling->m_Ref = refnum;
591 #endif
592  }
593  if (ob_type == 2)
594  {
595  pfs = dynamic_cast<PreFledgeling_struct*>(data);
596 
597  New_PreFledgeling = new Skylark_PreFledgeling(pfs->x, pfs->y, pfs->L, pfs->Terrs, pfs->Dad, pfs->sex, pfs->size, pfs->age, this,
598  pfs->bx, pfs->by, pfs->mh);
599 
600  PushIndividual(ob_type, New_PreFledgeling);
601  IncLiveArraySize(ob_type);
602  if (pfs->Dad) pfs->Dad->OnAddPreFledgeling(New_PreFledgeling, static_cast<Skylark_Nestling*>(pTAo));
603 
604  // Count this as a nest leaver
606  }
607  if (ob_type == 3)
608  {
609  as = dynamic_cast<AdultSkylark_struct*>(data);
610  // Male
611 
612  New_Male = new Skylark_Male(as->x, as->y, as->size, as->age, as->Terrs, as->L, this, as->bx, as->by, as->mh);
613  if (aCopy) New_Male->SensibleCopy();
614  PushIndividual(ob_type, New_Male);
615  IncLiveArraySize(ob_type);
616 
617 #ifdef __CJTDebug_10
618  New_Male->m_Ref = refnum;
619 #endif
620  }
621  if (ob_type == 4)
622  {
623  as = dynamic_cast<AdultSkylark_struct*>(data);
624  // Female
625 
626  New_Female = new Skylark_Female(as->x, as->y, as->size, as->age, as->Terrs, as->L, this, as->bx, as->by, as->mh);
627  if (aCopy) New_Female->SensibleCopy();
628  PushIndividual(ob_type, New_Female);
629  IncLiveArraySize(ob_type);
630 
631 #ifdef __CJTDebug_10
632  New_Female->m_Ref = refnum;
633 #endif
634  }
635  }
636 }

References PreFledgeling_struct::age, AdultSkylark_struct::age, Skylark_struct::bx, Skylark_struct::by, Nestling_struct::Dad, PreFledgeling_struct::Dad, Population_Manager::IncLiveArraySize(), Skylark_struct::L, m_TotalNestlings, m_TotalPrefledgelings, Skylark_struct::mh, skClutch_struct::Mum, skClutch_struct::No, Skylark_Male::OnAddNestling(), Skylark_Male::OnAddPreFledgeling(), Skylark_Female::OnSetMyClutch(), Population_Manager::PushIndividual(), Skylark_Female::SensibleCopy(), Skylark_Male::SensibleCopy(), PreFledgeling_struct::sex, PreFledgeling_struct::size, AdultSkylark_struct::size, Skylark_struct::Terrs, Skylark_struct::x, and Skylark_struct::y.

Referenced by Skylark_Adult::CopyMyself(), Init(), Skylark_Clutch::st_Hatching(), Skylark_Female::st_Laying(), Skylark_Nestling::st_Maturing(), and Skylark_PreFledgeling::st_Maturing().

◆ DoFirst()

void Skylark_Population_Manager::DoFirst ( void  )
overrideprotectedvirtual

Can be used in descendent classes

Reimplemented from Population_Manager.

890  {
891  //printf("Day %d Terrs: %d Occupied M/F %d/%d\n",g_date->DayInYear(),TheSkylarkTerrs->SupplyNoTerritories(), TheSkylarkTerrs->SupplyNoMaleOccupied(), TheSkylarkTerrs->SupplyNoFemaleOccupied());
892  // Bad weather criteria - not used as of 24 June 2009 because removing this had no impacts on the observed POM testing.
893  if (g_weather->GetRain() > 0.0 && g_weather->GetWindPeriod(g_date->Date(), 7) > 45.0 && g_weather->GetTempPeriod(g_date->Date(), 7) <
894  40.0) m_IsBadWeather = true;
895  else m_IsBadWeather = false;
897  const double temp = m_TheLandscape->SupplyTemp();
898  EMi = 31.2 - 0.44 * temp;
899  int today = m_TheLandscape->SupplyDayInYear();
900  if (today == January)
901  {
902  for (int h = 0; h < 4; h++) m_StriglingMort[h] = 0;
904  // Now re-house any males that already had territories
905  //ReHouse(); // Only needed if PreProcessLandsape2 is called after arrival
906  // Determine this years mortality
907  F_Mig_Mort = cfg_adultreturnmort.value(); //F_Mig_Mort_min + random( F_Mig_Mort_max - F_Mig_Mort_min );
908  // F_Mig_Mort=50;
909  //assume that male and female mortality is equal
911  //M_Mig_Mort = M_Mig_Mort_min + random( M_Mig_Mort_max - M_Mig_Mort_min );
912  // F_Mig_Mort=F_Mig_Mort_min+random(F_Mig_Mort_max-F_Mig_Mort_min);
913  // **CJT** testing code below
914  FILE* MyFile = fopen("PestEffects.txt", "a");
915  fprintf(MyFile, "%d %d %d\n", m_NoChickDeaths, m_NoFledgeDeaths, m_NoPestEffects);
916  fclose(MyFile);
917  m_NoFledgeDeaths = 0;
918  m_NoChickDeaths = 0;
919  m_NoPestEffects = 0;
920  }
921 
922 #ifdef __SKPOM
923  // Skylark POM outputs
924 #ifdef __KALONOSCRAPES
925  /* USE FOR KALO & NO SCRAPES */
926 switch (today) {
927  case 70:
928  return ProbeReportPOM( today );
929  break;
930  case 80:
931  return ProbeReportPOM( today );
932  break;
933  case 89:
934  return ProbeReportPOM( today );
935  break;
936  case 99:
937  return ProbeReportPOM( today );
938  break;
939  case 115:
940  return ProbeReportPOM( today );
941  break;
942  case 123:
943  return ProbeReportPOM( today );
944  break;
945  case 130:
946  return ProbeReportPOM( today );
947  break;
948  case 140:
949  return ProbeReportPOM( today );
950  break;
951  case 147:
952  return ProbeReportPOM( today );
953  break;
954  case 153:
955  return ProbeReportPOM( today );
956  break;
957  case 160:
958  return ProbeReportPOM( today );
959  break;
960  case 168:
961  return ProbeReportPOM( today );
962  break;
963  case 177:
964  return ProbeReportPOM( today );
965  break;
966  case 185:
967  return ProbeReportPOM( today );
968  break;
969  case 192:
970  return ProbeReportPOM( today );
971  break;
972  case 200:
973  return ProbeReportPOM( today );
974  break;
975  case 209:
976  return ProbeReportPOM( today );
977  break;
978  default: ;
979  }
980 #else
981 #ifdef __KALOSCRAPES
982 /* USE FOR KALO & SCRAPES */
983 switch (today) {
984  case 67:
985  return ProbeReportPOM( today );
986  break;
987  case 70:
988  return ProbeReportPOM( today );
989  break;
990  case 80:
991  return ProbeReportPOM( today );
992  break;
993  case 89:
994  return ProbeReportPOM( today );
995  break;
996  case 99:
997  return ProbeReportPOM( today );
998  break;
999  case 113:
1000  return ProbeReportPOM( today );
1001  break;
1002  case 125:
1003  return ProbeReportPOM( today );
1004  break;
1005  case 130:
1006  return ProbeReportPOM( today );
1007  break;
1008  case 131:
1009  return ProbeReportPOM( today );
1010  break;
1011  case 140:
1012  return ProbeReportPOM( today );
1013  break;
1014  case 147:
1015  return ProbeReportPOM( today );
1016  break;
1017  case 153:
1018  return ProbeReportPOM( today );
1019  break;
1020  case 162:
1021  return ProbeReportPOM( today );
1022  break;
1023  case 169:
1024  return ProbeReportPOM( today );
1025  break;
1026  case 178:
1027  return ProbeReportPOM( today );
1028  break;
1029  case 183:
1030  return ProbeReportPOM( today );
1031  break;
1032  default: ;
1033  }
1034 #else
1035  switch (today) {
1036  case 105:
1037  return ProbeReportPOM( today );
1038  break;
1039  case 119:
1040  return ProbeReportPOM( today );
1041  break;
1042  case 133:
1043  return ProbeReportPOM( today );
1044  break;
1045  case 147:
1046  return ProbeReportPOM( today );
1047  break;
1048  case 162:
1049  return ProbeReportPOM( today );
1050  break;
1051  case 177:
1052  return ProbeReportPOM( today );
1053  break;
1054  case 192:
1055  return ProbeReportPOM( today );
1056  break;
1057  case 207:
1058  return ProbeReportPOM( today );
1059  break;
1060  default: ;
1061  }
1062 #endif
1063 
1064 #endif
1065 
1066 #endif
1067  //Sigh, everyday we need to update the territory qualities, but at least it only needs doing here!
1069 }

References cfg_adultreturnmort, Calendar::Date(), EMi, SkTerritories::EvaluateAllTerritories(), F_Mig_Mort, g_date, g_weather, Weather::GetRain(), Weather::GetTempPeriod(), Weather::GetWindPeriod(), January, m_IsBadWeather, M_Mig_Mort, m_NoChickDeaths, m_NoFledgeDeaths, m_NoPestEffects, m_StriglingMort, Population_Manager_Base::m_TheLandscape, SkTerritories::PreProcessLandscape2(), ProbeReportPOM(), Landscape::SupplyDayInYear(), Landscape::SupplyTemp(), TheSkylarkTerrs, SkTerritories::Tick(), and CfgInt::value().

◆ FledgelingProbeOutput()

void Skylark_Population_Manager::FledgelingProbeOutput ( int  Total,
int  Time 
)
overridevirtual

Reimplemented from Population_Manager.

843  {
844  FILE* MyFile = fopen("SkFledgelingProbe.txt", "a");
845  if (!MyFile)
846  {
847  g_msg->Warn(WARN_FILE, "Skylark_Population_Manager::FledgelingProbeOutput():", "Cannot open file for append: SkFledgelingProbe.txt");
848  exit(0);
849  }
850  fprintf(MyFile, "%8d %6d", time, Total);
851  // Now get the areas
852  for (int i = 0; i < tov_Undefined+1; i++) fprintf(MyFile, " %3d %5d %9.0f", i, VegTypeFledgelings[i], m_TheLandscape->SupplyVegArea(i));
853  fprintf(MyFile, "\n");
854  fclose(MyFile);
855  // Data for the FledgelingProbe needs clearing
856  for (int i = 0; i < tov_Undefined+1; i++) { VegTypeFledgelings[i] = 0; }
857 }

References g_msg, Population_Manager_Base::m_TheLandscape, Landscape::SupplyVegArea(), tov_Undefined, VegTypeFledgelings, MapErrorMsg::Warn(), and WARN_FILE.

◆ incNoChickDeaths()

void Skylark_Population_Manager::incNoChickDeaths ( )
inline
480 { m_NoChickDeaths++; }

◆ incNoFledgeDeaths()

void Skylark_Population_Manager::incNoFledgeDeaths ( )
inline
478 { m_NoFledgeDeaths++; }

◆ incNoPestEffects()

void Skylark_Population_Manager::incNoPestEffects ( )
inline
482 { m_NoPestEffects++; }

◆ incTotalEggs()

void Skylark_Population_Manager::incTotalEggs ( const int  eggs)
inline
484 { m_TotalEggs += eggs; }

◆ incTotalNestlings()

void Skylark_Population_Manager::incTotalNestlings ( )
inline
486 { m_TotalNestlings++; }

◆ incTotalPrefledgelings()

void Skylark_Population_Manager::incTotalPrefledgelings ( )
inline

◆ Init()

void Skylark_Population_Manager::Init ( void  )
virtual
297  {
299  LoadParameters();
300  // Data for the FledgelingProbe
301  VegTypeFledgelings = new int[tov_Undefined + 1];
302  for (int i = 0; i < tov_Undefined+1; i++) VegTypeFledgelings[i] = 0;
303  // autom. called by constructor
304  m_SimulationName = "Skylark";
305  // Create 100 male and female skylarks
306 
307  int temp_thread_num = omp_get_max_threads();
308  int start_num_in_tread = cfg_SkStartNos.value() / temp_thread_num + 1;
309 
310  #pragma omp parallel
311  {
312  const auto aps = new AdultSkylark_struct;
313  aps->size = 38;
314  aps->Terrs = TheSkylarkTerrs;
315  aps->L = m_TheLandscape;
317  aps->sex = true;
318 
319  for (int i = 0; i < start_num_in_tread; i++)
320  {
323  aps->bx = aps->x;
324  aps->by = aps->y;
325  aps->age = g_random_fnc(5);
326  aps->mh = tov_Undefined;
327  CreateObjects(3, nullptr, nullptr, aps, 1);
328  }
329  aps->sex = false;
330  for (int i = 0; i < start_num_in_tread; i++)
331  {
334  aps->bx = aps->x;
335  aps->by = aps->y;
336  aps->age = g_random_fnc(5);
337  aps->mh = tov_Undefined;
338  CreateObjects(4, nullptr, nullptr, aps, 1);
339  }
340  delete aps;
341  }
342  // Load List of Animal Classes
343  m_ListNames[0] = "Clutch";
344  m_ListNames[1] = "Nestling";
345  m_ListNames[2] = "Pre-Fledgeling";
346  m_ListNames[3] = "Male";
347  m_ListNames[4] = "Female";
348  m_ListNameLength = 5;
350 
351  // Load State Names
352  StateNames[toss_Initiation] = "Initiation";
353  //Clutch
354  StateNames[toss_Developing] = "CDeveloping";
355  StateNames[toss_Hatching] = "CHatching";
356  StateNames[toss_CDying] = "CDying";
357  //Nestling
358  StateNames[toss_NDeveloping] = "NDeveloping";
359  StateNames[toss_NMaturing] = "NMaturing";
360  StateNames[toss_NDying] = "NDying";
361  //PreFledgeling
362  StateNames[toss_PDeveloping] = "PDeveloping";
363  StateNames[toss_PMaturing] = "PMaturing";
364  StateNames[toss_PDying] = "PDying";
365  //MaleSK
366  StateNames[toss_MFlocking] = "MFlocking";
367  StateNames[toss_MFloating] = "MFloating";
368  StateNames[toss_MArriving] = "MArriving";
369  StateNames[toss_MImmigrating] = "MImmigrating";
370  StateNames[toss_MEmigrating] = "MEmigrating";
371  StateNames[toss_MTempLeavingArea] = "MTempLeavingArea";
372  StateNames[toss_MFindingTerritory] = "MFindingTerritory";
373  StateNames[toss_AttractingAMate] = "MAttractingAMate";
374  StateNames[toss_FollowingMate] = "MFollowingMate";
375  StateNames[toss_ScaringOffChicks] = "MScaringOffChicks";
376  StateNames[toss_MCaringForYoung] = "MCaringForYoung";
377  StateNames[toss_MDying] = "MDying";
378  //FemaleSK
379  StateNames[toss_FFlocking] = "FFlocking";
380  StateNames[toss_FFloating] = "FFloating";
381  StateNames[toss_FArriving] = "FArriving";
382  StateNames[toss_FImmigrating] = "FImmigrating";
383  StateNames[toss_FEmigrating] = "FEmigrating";
384  StateNames[toss_FTempLeavingArea] = "FTempLeavingArea";
385  StateNames[toss_FFindingTerritory] = "FFindingTerritory";
386  StateNames[toss_BuildingUpResources] = "FBuildingUpResources";
387  StateNames[toss_MakingNest] = "FMakingNest";
388  StateNames[toss_PreparingForBreeding] = "FPreparingForBreeding";
389  StateNames[toss_Laying] = "FLaying";
390  StateNames[toss_StartingNewBrood] = "FStartingNewBrood";
391  StateNames[toss_EggHatching] = "FEggHatching";
392  StateNames[toss_Incubating] = "FIncubating";
393  StateNames[toss_StoppingBreeding] = "FStoppingBreeding";
394  StateNames[toss_FCaringForYoung] = "FCaringForYoung";
395  StateNames[toss_FDying] = "FDying";
396  StateNames[toss_GivingUpTerritory] = "FGivingUpTerritory";
397  StateNames[toss_Destroy] = "Being Destroyed";
398  // determine whether we should shuffle, or sort or do nothing to skylarks
399  // after each time step.
400  BeforeStepActions[0] = 3; // 0 = Shuffle, 1 = SortX, 2 = SortY, 3 = do nothing
401  BeforeStepActions[1] = 3; // 0 = Shuffle, 1 = SortX, 2 = SortY, 3 = do nothing
402  BeforeStepActions[2] = 3; // 0 = Shuffle, 1 = SortX, 2 = SortY, 3 = do nothing
403  BeforeStepActions[3] = 0; // 0 = Shuffle, 1 = SortX, 2 = SortY, 3 = do nothing
404  BeforeStepActions[4] = 0; // 0 = Shuffle, 1 = SortX, 2 = SortY, 3 = do nothing
405  // Zero any counters
406  m_TotalEggs = 0;
407  m_TotalNestlings = 0;
409  m_NoFledgeDeaths = 0;
410  m_NoChickDeaths = 0;
411  m_NoPestEffects = 0;
412 
414  else ReallyBigOutputPrb = nullptr;
415 #ifdef __SKPOM
416  SKPOM1 = fopen( "SkylarkPOM1.txt", "w" );
417  SKPOM2 = fopen( "SkylarkPOM2.txt", "w" );
418 #endif
419 }

References Population_Manager::BeforeStepActions, cfg_ReallyBigOutputUsed, cfg_SkStartNos, CreateObjects(), g_land, g_random_fnc(), LoadParameters(), Population_Manager_Base::m_ListNameLength, Population_Manager_Base::m_ListNames, m_NoChickDeaths, m_NoFledgeDeaths, m_NoPestEffects, Population_Manager::m_population_type, Population_Manager_Base::m_SimulationName, Population_Manager_Base::m_TheLandscape, m_TotalEggs, m_TotalNestlings, m_TotalPrefledgelings, Population_Manager::OpenTheReallyBigProbe(), Population_Manager::OpenTheRipleysOutputProbe(), Population_Manager::ReallyBigOutputPrb, AdultSkylark_struct::size, SKPOM1, SKPOM2, Population_Manager::StateNames, Landscape::SupplySimAreaHeight(), Landscape::SupplySimAreaWidth(), TheSkylarkTerrs, TOP_Skylark, tov_Undefined, CfgInt::value(), CfgBool::value(), and VegTypeFledgelings.

Referenced by Skylark_Population_Manager().

◆ IsBadWeather()

bool Skylark_Population_Manager::IsBadWeather ( ) const
inline
494 { return m_IsBadWeather; }

◆ LoadParameters()

void Skylark_Population_Manager::LoadParameters ( void  )
protected
423  {
425  NotTramline = 1 - IsTramline;
426 
442  MaxFeedRain = cfg_maxfeedrain.value(); //Estimate of really serious amount of rain
443 
450  EggTemp = cfg_EggTemp.value(); //was 37
451  MD_Threshold = cfg_MD_Threshold.value(); // was 12
454  MD_Hatch = cfg_MinDaysToHatch.value() * 24 * 60 * (EggTemp - MD_Threshold); // 9.8 fastest development from field data
455  //MD_Hatch = cfg_MinDaysToHatch.value() * 24 * 60;
457 
458  for (int h = 0; h <= 110; h++)
459  {
460  DensityScore[h] = 0.0;
461  VegHindranceD[h] = 1.0;
462  HeightScore[h] = 0.0;
463  VegHindranceH[h] = 1.0;
464  }
465  // Vegetation hindrance is made up of two parts - a densithy and height part
466  // Each a linear after a threshold level, down to another threshold (zero)
467 
468  double threshold = cfg_heightconstant_c.value();
469  for (int h = static_cast<int>(threshold); h <= 110; h++)
470  {
471  VegHindranceH[h] = 1 + h * cfg_hindconstantH_b.value();
472  if (VegHindranceH[h] <= 0) VegHindranceH[h] = 0;
473  }
474  threshold = cfg_densityconstant_c.value();
475  for (int d = static_cast<int>(threshold); d <= 110; d++)
476  {
477  VegHindranceD[d] = 1 + d * cfg_hindconstantD_b.value();
478  if (VegHindranceD[d] <= 0) VegHindranceD[d] = 0;
479  }
480 
481  // The next two arrays are related to nest choice
482  threshold = cfg_densityconstant_c.value();
483  for (int h = static_cast<int>(threshold); h <= 110; h++)
484  {
485  // Power function
486  // DensityScore[ h ] = cfg_densityconstant_a.value() * pow( h - ( threshold - 1 ), cfg_densityconstant_b.value() );
487  // Linear
488  DensityScore[h] = cfg_densityconstant_a.value() + (h - threshold) * (h - threshold) * cfg_densityconstant_b.value();
489  // Catch all just in case:
490  //if ( DensityScore[ h ] < 0 ) DensityScore[ h ] = 0;
491  }
492  threshold = cfg_heightconstant_c.value();
493  for (int h = static_cast<int>(threshold); h <= 110; h++)
494  {
495  // Power function
496  //double hh = cfg_heightconstant_a.value() * pow( h - ( threshold - 1 ), cfg_heightconstant_b.value() );
497  //HeightScore[ h ] = hh - ( 1 - hh ); // This expands the range of the curve
498  // Linear
499  HeightScore[h] = cfg_heightconstant_a.value() + (h - threshold) * cfg_heightconstant_b.value();
500  // Catch all just in case:
501  //if ( HeightScore[ h ] < 0 ) HeightScore[ h ] = 0;
502  }
503  for (int i = 0; i <= 30; i++)
504  {
505  // TempHindrance[ i ] = (1-( pow( 30 - i, cfg_temphindpow.value() ) / pow( 30, cfg_temphindpow.value() ) ));
506  if (i > 20) TempHindrance[i] = 1.0;
507  else
508  TempHindrance[i] = 0.0 + 1.0 * (1 - pow(static_cast<double>(20) - i, static_cast<double>(cfg_temphindpow.value())) / pow(
509  static_cast<double>(20), static_cast<double>(cfg_temphindpow.value())));
510  }
511  for (int i = 0; i <= 10; i++)
512  {
513  RainHindrance[i] = pow(static_cast<double>(10) - i, static_cast<double>(cfg_rainhindpow.value())) / pow(
514  10.0, static_cast<double>(cfg_rainhindpow.value()));
515  }
516 
517  m_NoFledgeDeaths = 0;
518  m_NoChickDeaths = 0;
519  m_NoPestEffects = 0;
520  FILE* MyFile = fopen("PestEffects.txt", "w");
521  fclose(MyFile);
523 }

References Breed_Res_Thresh1, cfg_Breed_Res_Thresh1, cfg_ClutchMortProb, cfg_Cooling_Rate_Eggs, cfg_densityconstant_a, cfg_densityconstant_b, cfg_densityconstant_c, cfg_EggTemp, cfg_FemaleMinTerritoryAcceptScore, cfg_FoodTripsPerDay, cfg_heightconstant_a, cfg_heightconstant_b, cfg_heightconstant_c, cfg_hindconstantD_b, cfg_hindconstantH_b, cfg_HQualityBareEarth, cfg_HQualityHedge, cfg_HQualityHedgeScrub, cfg_HQualityMetalRoad, cfg_HQualityNeutral, cfg_HQualityOpenTallVeg, cfg_HQualityTall, cfg_HQualityTall2, cfg_HQualityTallVeg, cfg_HQualityTrack, cfg_HQualityVeg30cm, cfg_HQualityWater, cfg_maxfeedrain, cfg_MD_Threshold, cfg_MeanExtractionRatePerMinute, cfg_MeanHatchingWeight, cfg_MinDaysToHatch, cfg_NestLeavingWeight, cfg_NestlingMortProb, cfg_NestPlacementMinQual, cfg_PatchyPremium, cfg_PreFledgeMortProb, cfg_rainhindpow, cfg_temphindpow, cfg_tramline_foraging, ClutchMortProb, Cooling_Rate_Eggs, DensityScore, EggTemp, FemaleNestAcceptScore, FoodTripsPerDay, HeightScore, HQualityBareEarth, HQualityHedge, HQualityHedgeScrub, HQualityMetalRoad, HQualityNeutral, HQualityOpenTallVeg, HQualityTall, HQualityTall2, HQualityTallVeg, HQualityTrack, HQualityVeg30cm, HQualityWater, IsTramline, m_NoChickDeaths, m_NoFledgeDeaths, m_NoPestEffects, MaxFeedRain, MD_Hatch, MD_Threshold, MeanExtractionRatePerMinute, MeanHatchingWeight, NestLeavingWeight, NestlingMortProb, NestPlacementMinQual, NotTramline, OpenTheBreedingSuccessProbe(), PatchyPremium, PreFledgeMortProb, RainHindrance, TempHindrance, CfgInt::value(), CfgFloat::value(), VegHindranceD, and VegHindranceH.

Referenced by Init().

◆ OpenTheBreedingPairsProbe()

bool Skylark_Population_Manager::OpenTheBreedingPairsProbe ( )
overridevirtual

Reimplemented from Population_Manager.

817  {
818  FILE* MyFile = fopen("BreedingPairs.txt", "w");
819  if (!MyFile)
820  {
821  g_msg->Warn(WARN_FILE, "Skylark_Population_Manager::FledgelingProbeOutput():", "Cannot open file: BreedingPairs.txt");
822  exit(0);
823  }
824  fclose(MyFile);
825  return true;
826 }

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

Referenced by Skylark_Population_Manager().

◆ OpenTheBreedingSuccessProbe()

bool Skylark_Population_Manager::OpenTheBreedingSuccessProbe ( )
overridevirtual

Reimplemented from Population_Manager.

830  {
831  FILE* MyFile = fopen("BreedingSuccess.txt", "w");
832  if (!MyFile)
833  {
834  g_msg->Warn(WARN_FILE, "Skylark_Population_Manager::FledgelingProbeOutput():", "Cannot open file: BreedingSuccess.txt");
835  exit(0);
836  }
837  fclose(MyFile);
838  return true;
839 }

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

Referenced by LoadParameters(), and Skylark_Population_Manager().

◆ OpenTheFledgelingProbe()

bool Skylark_Population_Manager::OpenTheFledgelingProbe ( )
overridevirtual

Reimplemented from Population_Manager.

860  {
861  FILE* MyFile = fopen("SkFledgelingProbe.txt", "w");
862  if (!MyFile) return false;
863  FILE* MyFile2 = fopen("TOV_KeyForFledgelingProbe.txt", "w");
864  if (!MyFile2) return false;
865  fprintf(MyFile2, "This is the tov to veg-type key\n");
866  const int howMany = tov_Undefined;
867  for (int i = 0; i <= howMany; i++)
868  {
869  fprintf(MyFile2, "%d %s\n", i, m_TheLandscape->VegtypeToString(static_cast<TTypesOfVegetation>(i)).c_str());
870  }
871  fclose(MyFile);
872  fclose(MyFile2);
873  return false;
874 }

References Population_Manager_Base::m_TheLandscape, tov_Undefined, and Landscape::VegtypeToString().

Referenced by Skylark_Population_Manager().

◆ ProbePOM()

float Skylark_Population_Manager::ProbePOM ( int  ListIndex,
const Probe_Data p_TheProbe 
)
protected

Modified probe for POM Output.

1089  {
1090  // Counts through the list and goes through each area to see if the animal
1091  // is standing there and if the farm conditions are met
1092  float NumberSk = 0;
1093  if (ListIndex == 4)
1094  {
1095  if (p_TheProbe->m_NoFarms != 0)
1096  {
1097  for (unsigned j = 0; j < GetLiveArraySize(ListIndex); j++)
1098  {
1099  const unsigned Farm = SupplyAnimalPtr(ListIndex, j)->SupplyFarmOwnerRef();
1100  for (unsigned k = 0; k < p_TheProbe->m_NoFarms; k++)
1101  {
1102  if (p_TheProbe->m_RefFarms[k] == Farm)
1103  {
1104  const auto FS = dynamic_cast<Skylark_Female*>(SupplyAnimalPtr(ListIndex, j));
1105  const auto state = static_cast<TTypesOfSkState>(FS->WhatState());
1106  switch (state)
1107  {
1108  case toss_MakingNest:
1109  case toss_PreparingForBreeding:
1110  case toss_Laying:
1111  case toss_StartingNewBrood:
1112  case toss_EggHatching:
1113  case toss_Incubating:
1114  case toss_FCaringForYoung:
1115  NumberSk++; // it is in the square so increment number
1116  default: ;
1117  }
1118  }
1119  }
1120  }
1121  }
1122  }
1123  else if (ListIndex == 3)
1124  {
1125  if (p_TheProbe->m_NoFarms != 0)
1126  {
1127  for (unsigned j = 0; j < GetLiveArraySize(ListIndex); j++)
1128  {
1129  const unsigned Farm = SupplyAnimalPtr(ListIndex, j)->SupplyFarmOwnerRef();
1130  for (unsigned k = 0; k < p_TheProbe->m_NoFarms; k++)
1131  {
1132  if (p_TheProbe->m_RefFarms[k] == Farm)
1133  {
1134  const auto MS = dynamic_cast<Skylark_Male*>(SupplyAnimalPtr(ListIndex, j));
1135  if (MS->HaveTerritory) NumberSk++; // it is in the square so increment number
1136  }
1137  }
1138  }
1139  }
1140  }
1141  return NumberSk;
1142 }

References Population_Manager::GetLiveArraySize(), Probe_Data::m_NoFarms, Probe_Data::m_RefFarms, Population_Manager::SupplyAnimalPtr(), and TAnimal::SupplyFarmOwnerRef().

Referenced by ProbeReportPOM().

◆ ProbeReportPOM()

void Skylark_Population_Manager::ProbeReportPOM ( int  a_time)
protected
1073  {
1074  for (int ProbeNo = 0; ProbeNo < m_NoProbes; ProbeNo++)
1075  {
1076  int No = 0;
1077  const unsigned Index = SupplyListIndexSize();
1078  for (unsigned listindex = 0; listindex < Index; listindex++)
1079  {
1080  if (TheProbe[ProbeNo]->m_TargetTypes[listindex]) No += static_cast<int>(ProbePOM(listindex, TheProbe[ProbeNo]));
1081  }
1082  TheProbe[ProbeNo]->FileOutput(No, a_time, ProbeNo);
1083  }
1084 }

References Probe_Data::FileOutput(), Population_Manager::m_NoProbes, ProbePOM(), Population_Manager::SupplyListIndexSize(), and Population_Manager_Base::TheProbe.

Referenced by DoFirst().

◆ ReHouse()

void Skylark_Population_Manager::ReHouse ( void  )
protectedvirtual
1145  {
1146  // assignment to get rid of warning
1147  const unsigned size = GetLiveArraySize(sob_Male);
1148  for (unsigned j = 0; j < size; j++)
1149  {
1150  const auto MS = dynamic_cast<Skylark_Male*>(SupplyAnimalPtr(sob_Male, j));
1151  if (MS->HaveTerritory) { MS->OnReHouse(); }
1152  }
1153 }

References Population_Manager::GetLiveArraySize(), and Population_Manager::SupplyAnimalPtr().

◆ SetF_Mig_Mort()

void Skylark_Population_Manager::SetF_Mig_Mort ( const int  m)
inline
466 { F_Mig_Mort = m; }

◆ SetM_Mig_Mort()

void Skylark_Population_Manager::SetM_Mig_Mort ( const int  m)
inline
464 { M_Mig_Mort = m; }

◆ SupplyEMi()

double Skylark_Population_Manager::SupplyEMi ( ) const
inline

◆ SupplyF_Mig_Mort()

int Skylark_Population_Manager::SupplyF_Mig_Mort ( ) const
inline
456 { return F_Mig_Mort; }

Referenced by Skylark_Female::GetMigrationMortality().

◆ SupplyM_Mig_Mort()

int Skylark_Population_Manager::SupplyM_Mig_Mort ( ) const
inline
454 { return M_Mig_Mort; }

Referenced by Skylark_Male::GetMigrationMortality().

◆ SupplyNoTerritories()

int Skylark_Population_Manager::SupplyNoTerritories ( ) const

◆ TheAOROutputProbe()

void Skylark_Population_Manager::TheAOROutputProbe ( )
overridevirtual

This method must be overridden in descendent classes

Reimplemented from Population_Manager.

759 { m_AOR_Probe->DoProbe(sob_Female); }

References AOR_Probe::DoProbe(), and Population_Manager::m_AOR_Probe.

◆ TheBreedingFemalesProbe()

int Skylark_Population_Manager::TheBreedingFemalesProbe ( int  ProbeNo)
overridevirtual

Reimplemented from Population_Manager.

668  {
669  int NumberSk = 0;
670  for (unsigned j = 0; j < GetLiveArraySize(3); j++)
671  {
672  const auto MS = dynamic_cast<Skylark_Male*>(SupplyAnimalPtr(3, j));
673  /* for (unsigned i=0; i<TheProbe[ProbeNo]->m_NoAreas; i++) { if ((MS->m_Born_x>=(int)TheProbe[ProbeNo]->m_Rect[i].m_x1)
674  && (MS->m_Born_y>=(int)TheProbe[ProbeNo]->m_Rect[i].m_y1) && (MS->m_Born_x<(int)TheProbe[ProbeNo]->m_Rect[i].m_x2)
675  && (MS->m_Born_y<(int)TheProbe[ProbeNo]->m_Rect[i].m_y2) && (MS->Paired==true) && (MS->HaveTerritory==true))
676  NumberSk++; // it is in the square so increment number } */
677  if (MS->Paired == true && MS->HaveTerritory == true) NumberSk++; // it is in the square so increment number
678  }
679  return NumberSk;
680 }

References Population_Manager::GetLiveArraySize(), and Population_Manager::SupplyAnimalPtr().

◆ TheBreedingSuccessProbe()

int Skylark_Population_Manager::TheBreedingSuccessProbe ( int &  BreedingFemales,
int &  YoungOfTheYear,
int &  TotalPop,
int &  TotalFemales,
int &  TotalMales,
int &  BreedingAttempts 
)
overridevirtual

Reimplemented from Population_Manager.

684  {
685  int NumberA = 0;
686  int HowMany = 0;
687  BreedingAttempts = 0;
688  const unsigned sz = static_cast<int>(GetLiveArraySize(4));
689  for (unsigned j = 0; j < sz; j++)
690  {
691  auto FS = dynamic_cast<Skylark_Female*>(SupplyAnimalPtr(4, j));
692  int success = FS->Supply_BreedingSuccess();
693 #ifdef __HazelParry1
694  if ( success >0 ) {
695  NumberA += success;
696  HowMany++;
697  FS->ResetBreedingSuccess();
698  }
699 #else
700  if (success != -1)
701  {
702  NumberA += success;
703  HowMany++;
704  }
705 #endif
706  BreedingAttempts += FS->Supply_BreedingAttempts();
707  }
708  BreedingFemales = HowMany;
709  TotalFemales = sz;
710  TotalMales = static_cast<int>(GetLiveArraySize(3));
711  YoungOfTheYear = TheFledgelingProbe();
712  TotalPop = TotalFemales + TotalMales;
713  return NumberA;
714 }

References Population_Manager::GetLiveArraySize(), Population_Manager::SupplyAnimalPtr(), and TheFledgelingProbe().

◆ TheFledgelingProbe()

int Skylark_Population_Manager::TheFledgelingProbe ( )
overridevirtual

Reimplemented from Population_Manager.

644  {
645  int NumberSk = 0;
646  for (unsigned j = 0; j < GetLiveArraySize(3); j++)
647  {
648  const auto MS = dynamic_cast<Skylark_Male*>(SupplyAnimalPtr(3, j));
649  if (MS->Age == 0)
650  {
651  NumberSk++; // it is in the square so increment number
652  VegTypeFledgelings[MS->m_MyHome]++;
653  }
654  }
655  for (unsigned j = 0; j < GetLiveArraySize(4); j++)
656  {
657  const auto FS = dynamic_cast<Skylark_Female*>(SupplyAnimalPtr(4, j));
658  if (FS->Age == 0)
659  {
660  NumberSk++; // it is in the square so increment number
661  VegTypeFledgelings[FS->m_MyHome]++;
662  }
663  }
664  return NumberSk;
665 }

References Population_Manager::GetLiveArraySize(), Population_Manager::SupplyAnimalPtr(), and VegTypeFledgelings.

Referenced by TheBreedingSuccessProbe().

◆ TheRipleysOutputProbe()

void Skylark_Population_Manager::TheRipleysOutputProbe ( FILE *  a_prb)
virtual
762  {
763  Skylark_Female* FS;
764  unsigned totalF = 0;
765  for (unsigned j = 0; j < GetLiveArraySize(sob_Female); j++) //adult females
766  {
767  FS = dynamic_cast<Skylark_Female*>(SupplyAnimalPtr(4, j));
768  if (FS->Paired) totalF++;
769  }
770  const int w = m_TheLandscape->SupplySimAreaWidth();
771  const int h = m_TheLandscape->SupplySimAreaHeight();
772  fprintf(a_prb, "%d %d %d %d %d\n", 0, w, 0, h, totalF);
773  for (unsigned j = 0; j < GetLiveArraySize(sob_Female); j++) //adult females
774  {
775  FS = dynamic_cast<Skylark_Female*>(SupplyAnimalPtr(4, j));
776  if (FS->Paired)
777  {
778  const int x = FS->Supply_m_Location_x();
779  const int y = FS->Supply_m_Location_y();
780  fprintf(a_prb, "%d\t%d\n", x, y);
781  }
782  }
783  fflush(a_prb);
784 }

References Population_Manager::GetLiveArraySize(), Population_Manager_Base::m_TheLandscape, Skylark_Adult::Paired, TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Population_Manager::SupplyAnimalPtr(), Landscape::SupplySimAreaHeight(), and Landscape::SupplySimAreaWidth().

◆ TheSkylarkTerrsSupply_quality()

int Skylark_Population_Manager::TheSkylarkTerrsSupply_quality ( int  r) const

◆ TheSkylarkTerrsSupply_size()

int Skylark_Population_Manager::TheSkylarkTerrsSupply_size ( int  r) const

◆ TheSkylarkTerrsSupply_x()

int Skylark_Population_Manager::TheSkylarkTerrsSupply_x ( int  r) const
880 { return TheSkylarkTerrs->Supply_x(r); }

References SkTerritories::Supply_x(), and TheSkylarkTerrs.

◆ TheSkylarkTerrsSupply_y()

int Skylark_Population_Manager::TheSkylarkTerrsSupply_y ( int  r) const
882 { return TheSkylarkTerrs->Supply_y(r); }

References SkTerritories::Supply_y(), and TheSkylarkTerrs.

◆ WriteSKPOM1()

◆ WriteSKPOM2()

void Skylark_Population_Manager::WriteSKPOM2 ( const int  n,
const int  n2 
) const
inline

Member Data Documentation

◆ EMi

double Skylark_Population_Manager::EMi
protected

Referenced by DoFirst().

◆ F_Mig_Mort

int Skylark_Population_Manager::F_Mig_Mort
protected

◆ m_IsBadWeather

bool Skylark_Population_Manager::m_IsBadWeather
protected

Referenced by DoFirst().

◆ M_Mig_Mort

int Skylark_Population_Manager::M_Mig_Mort
protected

◆ m_NoChickDeaths

int Skylark_Population_Manager::m_NoChickDeaths
protected

Referenced by DoFirst(), Init(), and LoadParameters().

◆ m_NoFledgeDeaths

int Skylark_Population_Manager::m_NoFledgeDeaths
protected

Referenced by DoFirst(), Init(), and LoadParameters().

◆ m_NoPestEffects

int Skylark_Population_Manager::m_NoPestEffects
protected

Referenced by DoFirst(), Init(), and LoadParameters().

◆ m_StriglingMort

int Skylark_Population_Manager::m_StriglingMort[4]
protected

◆ m_TotalEggs

int Skylark_Population_Manager::m_TotalEggs
protected

Referenced by BreedingSuccessProbeOutput(), and Init().

◆ m_TotalNestlings

int Skylark_Population_Manager::m_TotalNestlings
protected

◆ m_TotalPrefledgelings

int Skylark_Population_Manager::m_TotalPrefledgelings
protected

◆ SKPOM1

FILE* Skylark_Population_Manager::SKPOM1
protected

◆ SKPOM2

FILE* Skylark_Population_Manager::SKPOM2
protected

◆ TheSkylarkTerrs

◆ VegTypeFledgelings

int* Skylark_Population_Manager::VegTypeFledgelings

The documentation for this class was generated from the following files:
TOP_Skylark
Definition: PopulationManager.h:59
TAnimal::Supply_m_Location_x
int Supply_m_Location_x() const
Returns the ALMaSS x-coordinate.
Definition: PopulationManager.h:239
skClutch_struct::No
int No
Definition: skylarks_all.h:225
cfg_MinDaysToHatch
CfgFloat cfg_MinDaysToHatch
The time taken to egg hatch under optimal conditions.
NestlingMortProb
static int NestlingMortProb
Definition: skylarks_all.cpp:159
WARN_FILE
Definition: MapErrorMsg.h:37
Skylark_Population_Manager::m_NoPestEffects
int m_NoPestEffects
Definition: skylarks_all.h:441
Skylark_Clutch
Definition: skylarks_all.h:552
Breed_Res_Thresh1
static int Breed_Res_Thresh1
Definition: skylarks_all.cpp:167
Population_Manager::SupplyAnimalPtr
virtual TAnimal * SupplyAnimalPtr(unsigned int a_index, unsigned int a_animal)
Returns the pointer indexed by a_index and a_animal. Note NO RANGE CHECK.
Definition: PopulationManager.h:678
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
Skylark_Adult
Definition: skylarks_all.h:648
SkTerritories::Tick
void Tick(void)
Definition: skylarks_all.h:372
cfg_PmEventfrequency
CfgInt cfg_PmEventfrequency
Skylark_Population_Manager::EMi
double EMi
Definition: skylarks_all.h:433
ClutchMortProb
static int ClutchMortProb
Definition: skylarks_all.cpp:158
Landscape::VegtypeToString
std::string VegtypeToString(TTypesOfVegetation a_veg)
Returns the text representation of a TTypesOfVegetation type.
Definition: Landscape.cpp:6518
Skylark_Population_Manager::Init
virtual void Init(void)
Definition: skylarks_all.cpp:297
HeightScore
double HeightScore[111]
Definition: skylarks_all.cpp:193
Population_Manager::m_population_type
TTypesOfPopulation m_population_type
Definition: PopulationManager.h:858
FoodTripsPerDay
static int FoodTripsPerDay
Definition: skylarks_all.cpp:166
Population_Manager::BeforeStepActions
vector< unsigned > BeforeStepActions
Holds the season list of possible before step actions.
Definition: PopulationManager.h:819
g_land
Landscape * g_land
Definition: skylarks_all.cpp:44
cfg_CatastropheEventStartYear
CfgInt cfg_CatastropheEventStartYear
HQualityOpenTallVeg
int HQualityOpenTallVeg
Definition: skylarks_all.cpp:228
PreFledgeling_struct::Dad
Skylark_Male * Dad
Definition: skylarks_all.h:241
VegHindranceD
double VegHindranceD[111]
Definition: skylarks_all.cpp:191
HQualityMetalRoad
int HQualityMetalRoad
Definition: skylarks_all.cpp:232
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
cfg_PreFledgeMortProb
CfgInt cfg_PreFledgeMortProb
Skylark_struct::L
Landscape * L
Definition: skylarks_all.h:214
Population_Manager_Base::m_ListNames
const char * m_ListNames[32]
A list of life-stage names.
Definition: PopulationManager.h:628
SkTerritories::Supply_size
int Supply_size(int ref) const
Definition: skylarks_all.cpp:1394
EggTemp
static double EggTemp
Definition: skylarks_all.cpp:163
Skylark_Population_Manager::m_IsBadWeather
bool m_IsBadWeather
Definition: skylarks_all.h:442
cfg_juvreturnmort
CfgInt cfg_juvreturnmort
Immigration mortality for juveniles.
AdultSkylark_struct::age
int age
Definition: skylarks_all.h:252
cfg_HQualityTallVeg
CfgInt cfg_HQualityTallVeg
CfgFloat::value
double value() const
Definition: Configurator.h:142
Skylark_struct::by
int by
Definition: skylarks_all.h:212
Skylark_Population_Manager::ProbeReportPOM
void ProbeReportPOM(int a_time)
Definition: skylarks_all.cpp:1073
PatchyPremium
int PatchyPremium
Definition: skylarks_all.cpp:239
cfg_adultreturnmort
CfgInt cfg_adultreturnmort
Immigration mortality for juveniles.
cfg_FoodTripsPerDay
CfgInt cfg_FoodTripsPerDay
Skylark_Population_Manager::LoadParameters
void LoadParameters()
Definition: skylarks_all.cpp:423
Skylark_struct::x
int x
Definition: skylarks_all.h:209
TempHindrance
double TempHindrance[31]
Definition: skylarks_all.cpp:189
MeanHatchingWeight
static double MeanHatchingWeight
Definition: skylarks_all.cpp:161
Skylark_Population_Manager::TheSkylarkTerrs
SkTerritories * TheSkylarkTerrs
Definition: skylarks_all.h:496
Skylark_Male::OnAddNestling
void OnAddNestling(Skylark_Nestling *N)
Definition: skylarks_all.cpp:4649
Skylark_Nestling
Definition: skylarks_all.h:588
cfg_heightconstant_b
CfgFloat cfg_heightconstant_b
HQualityNeutral
int HQualityNeutral
Definition: skylarks_all.cpp:234
JuvenileReturnMort
int JuvenileReturnMort
Definition: skylarks_all.cpp:199
cfg_hindconstantD_b
CfgFloat cfg_hindconstantD_b
cfg_ReallyBigOutputUsed
CfgBool cfg_ReallyBigOutputUsed
Population_Manager_Base::m_ListNameLength
int m_ListNameLength
the number of life-stages simulated in the population manager
Definition: PopulationManager.h:626
cfg_HQualityMetalRoad
CfgInt cfg_HQualityMetalRoad
skClutch_struct
Definition: skylarks_all.h:223
TAnimal::SupplyFarmOwnerRef
unsigned SupplyFarmOwnerRef() const
Get the current location farm ref if any.
Definition: PopulationManager.cpp:1547
cfg_HQualityHedge
CfgInt cfg_HQualityHedge
VegHindranceH
double VegHindranceH[111]
Definition: skylarks_all.cpp:190
Skylark_Population_Manager::SKPOM1
FILE * SKPOM1
Definition: skylarks_all.h:444
Skylark_Female::SensibleCopy
void SensibleCopy()
Definition: skylarks_all.cpp:6620
MD_Hatch
static double MD_Hatch
Definition: skylarks_all.cpp:168
Skylark_Population_Manager::VegTypeFledgelings
int * VegTypeFledgelings
Definition: skylarks_all.h:497
cfg_NestlingMortProb
CfgInt cfg_NestlingMortProb
cfg_maxfeedrain
CfgFloat cfg_maxfeedrain
CfgBool::value
bool value() const
Definition: Configurator.h:164
Population_Manager_Base::m_TheLandscape
Landscape * m_TheLandscape
holds an internal pointer to the landscape
Definition: PopulationManager.h:624
AdultSkylark_struct::size
double size
Definition: skylarks_all.h:250
Skylark_Population_Manager::OpenTheBreedingPairsProbe
bool OpenTheBreedingPairsProbe() override
Definition: skylarks_all.cpp:817
Population_Manager::m_AOR_Probe
AOR_Probe * m_AOR_Probe
A pointer to the AOR probe.
Definition: PopulationManager.h:875
cfg_MD_Threshold
CfgFloat cfg_MD_Threshold
Skylark_Population_Manager::m_NoFledgeDeaths
int m_NoFledgeDeaths
Definition: skylarks_all.h:439
SkTerritories::Supply_x
int Supply_x(int ref) const
Definition: skylarks_all.cpp:1358
HQualityTrack
int HQualityTrack
Definition: skylarks_all.cpp:231
AOR_Probe::DoProbe
virtual void DoProbe(int a_lifestage)
Definition: AOR_Probe.cpp:104
RainHindrance
double RainHindrance[21]
Definition: skylarks_all.cpp:188
SkTerritories::EvaluateAllTerritories
void EvaluateAllTerritories(void)
Definition: skylarks_all.cpp:1893
Skylark_Population_Manager::F_Mig_Mort
int F_Mig_Mort
Definition: skylarks_all.h:432
HQualityTallVeg
int HQualityTallVeg
Definition: skylarks_all.cpp:241
Landscape::SupplySimAreaHeight
int SupplySimAreaHeight(void)
Gets the simulation landscape height.
Definition: Landscape.h:2302
Skylark_Population_Manager::OpenTheFledgelingProbe
bool OpenTheFledgelingProbe() override
Definition: skylarks_all.cpp:860
Landscape::SupplyFarmOwner
int SupplyFarmOwner(int a_x, int a_y)
Returns the farm owner pointer for the polygon referenced by a_polyref or a_x, a_y.
Definition: Landscape.h:1774
Calendar::Date
long Date(void)
Definition: Calendar.h:57
HQualityVeg30cm
int HQualityVeg30cm
Definition: skylarks_all.cpp:237
Landscape::SupplySimAreaWidth
int SupplySimAreaWidth(void)
Gets the simulation landscape width.
Definition: Landscape.h:2297
HQualityHedge
int HQualityHedge
Definition: skylarks_all.cpp:235
DensityScore
double DensityScore[111]
Definition: skylarks_all.cpp:192
MD_Threshold
static double MD_Threshold
Definition: skylarks_all.cpp:164
Skylark_Population_Manager::m_TotalEggs
int m_TotalEggs
Definition: skylarks_all.h:436
FemaleNestAcceptScore
double FemaleNestAcceptScore
Definition: skylarks_all.cpp:223
Cooling_Rate_Eggs
static double Cooling_Rate_Eggs
Definition: skylarks_all.cpp:162
cfg_EggTemp
CfgFloat cfg_EggTemp
cfg_heightconstant_c
CfgInt cfg_heightconstant_c
TAnimal::Supply_m_Location_y
int Supply_m_Location_y() const
Returns the ALMaSS y-coordinate.
Definition: PopulationManager.h:243
cfg_NestPlacementMinQual
CfgFloat cfg_NestPlacementMinQual
cfg_densityconstant_c
CfgInt cfg_densityconstant_c
SkTerritories::Supply_quality
int Supply_quality(int ref) const
Definition: skylarks_all.cpp:2014
MeanExtractionRatePerMinute
static double MeanExtractionRatePerMinute
Definition: skylarks_all.cpp:165
Skylark_Female::OnSetMyClutch
void OnSetMyClutch(Skylark_Clutch *p_C)
Definition: skylarks_all.h:744
SkTerritories::SupplyNoTerritories
int SupplyNoTerritories() const
Definition: skylarks_all.cpp:1362
Landscape::SupplyVegArea
double SupplyVegArea(int v)
Records all area vegetation types and transform it into a table.
Definition: Landscape.h:305
cfg_HQualityTall2
CfgInt cfg_HQualityTall2
MaxFeedRain
double MaxFeedRain
Definition: skylarks_all.cpp:196
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
Skylark_Population_Manager::m_TotalNestlings
int m_TotalNestlings
Definition: skylarks_all.h:437
Skylark_struct::Terrs
SkTerritories * Terrs
Definition: skylarks_all.h:215
Weather::GetWindPeriod
double GetWindPeriod(long a_date, unsigned int a_period)
Definition: Weather.cpp:697
cfg_NestLeavingWeight
CfgFloat cfg_NestLeavingWeight
Landscape::SupplyDayInYear
int SupplyDayInYear(void)
Passes a request on to the associated Calendar class function, the day in the year.
Definition: Landscape.h:2267
cfg_MeanHatchingWeight
CfgFloat cfg_MeanHatchingWeight
HQualityBareEarth
int HQualityBareEarth
Definition: skylarks_all.cpp:242
cfg_CfgRipleysOutputUsed
CfgBool cfg_CfgRipleysOutputUsed
cfg_HQualityOpenTallVeg
CfgInt cfg_HQualityOpenTallVeg
Skylark_Male
Definition: skylarks_all.h:760
cfg_densityconstant_a
CfgFloat cfg_densityconstant_a
Skylark_Adult::Paired
bool Paired
Definition: skylarks_all.h:670
cfg_HQualityTrack
CfgInt cfg_HQualityTrack
Landscape::SupplyYearNumber
int SupplyYearNumber(void)
Passes a request on to the associated Calendar class function, returns m_simulationyear
Definition: Landscape.h:2287
cfg_PatchyPremium
CfgInt cfg_PatchyPremium
cfg_HQualityTall
CfgInt cfg_HQualityTall
CfgInt::value
int value() const
Definition: Configurator.h:116
cfg_FemaleMinTerritoryAcceptScore
CfgFloat cfg_FemaleMinTerritoryAcceptScore
Population_Manager_Base::TheProbe
Probe_Data * TheProbe[100]
Holds a list of pointers to standard output probes.
Definition: PopulationManager.h:588
Skylark_Population_Manager::m_TotalPrefledgelings
int m_TotalPrefledgelings
Definition: skylarks_all.h:438
cfg_tramline_foraging
CfgFloat cfg_tramline_foraging
Skylark_Population_Manager::OpenTheBreedingSuccessProbe
bool OpenTheBreedingSuccessProbe() override
Definition: skylarks_all.cpp:830
cfg_MeanExtractionRatePerMinute
CfgFloat cfg_MeanExtractionRatePerMinute
cfg_densityconstant_b
CfgFloat cfg_densityconstant_b
HQualityHedgeScrub
int HQualityHedgeScrub
Definition: skylarks_all.cpp:233
tov_Undefined
Definition: LandscapeFarmingEnums.h:610
Population_Manager::OpenTheRipleysOutputProbe
bool OpenTheRipleysOutputProbe()
Definition: PopulationManager.cpp:897
PreFledgeMortProb
static int PreFledgeMortProb
Definition: skylarks_all.cpp:160
Population_Manager::StateNames
const char * StateNames[100]
Definition: PopulationManager.h:801
Skylark_Adult::CopyMyself
virtual void CopyMyself(int a_sktype)
Definition: skylarks_all.cpp:6601
SkTerritories::PreProcessLandscape2
void PreProcessLandscape2(Landscape *L)
Definition: skylarks_all.cpp:1660
Probe_Data::m_RefFarms
unsigned m_RefFarms[25]
Definition: PopulationManager.h:439
cfg_heightconstant_a
CfgFloat cfg_heightconstant_a
SkTerritories
Definition: skylarks_all.h:326
January
const int January
Julian start dates of the month of January.
Definition: Landscape.h:38
g_weather
class Weather * g_weather
Definition: Weather.cpp:49
PreFledgeling_struct::sex
bool sex
Definition: skylarks_all.h:242
Population_Manager::OpenTheReallyBigProbe
bool OpenTheReallyBigProbe()
Definition: PopulationManager.cpp:1005
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
Population_Manager::GetLiveArraySize
unsigned GetLiveArraySize(int a_listindex) override
Gets the number of 'live' objects for a list index in the TheArray.
Definition: PopulationManager.h:657
cfg_Cooling_Rate_Eggs
CfgFloat cfg_Cooling_Rate_Eggs
Maximum immigration mortality for females.
AdultSkylark_struct
Definition: skylarks_all.h:248
IsTramline
double IsTramline
Definition: skylarks_all.cpp:221
Skylark_Population_Manager::TheFledgelingProbe
int TheFledgelingProbe() override
Definition: skylarks_all.cpp:644
NotTramline
double NotTramline
Definition: skylarks_all.cpp:222
Weather::GetTempPeriod
double GetTempPeriod(long a_date, unsigned int a_period)
Definition: Weather.cpp:707
Skylark_Population_Manager::m_StriglingMort
int m_StriglingMort[4]
Definition: skylarks_all.h:435
Skylark_Population_Manager::SKPOM2
FILE * SKPOM2
Definition: skylarks_all.h:445
HQualityTall
int HQualityTall
Definition: skylarks_all.cpp:229
Skylark_struct::y
int y
Definition: skylarks_all.h:210
Farm
The base class for all farm types.
Definition: Farm.h:755
Probe_Data::FileOutput
void FileOutput(int No, int time, int ProbeNo) const
Definition: PopulationManager.cpp:1626
Skylark_Population_Manager::CreateObjects
void CreateObjects(int ob_type, TAnimal *pTAo, void *null, Skylark_struct *data, int number)
Definition: skylarks_all.cpp:539
Population_Manager_Base::m_SimulationName
string m_SimulationName
stores the simulation name
Definition: PopulationManager.h:622
Population_Manager::SupplyListIndexSize
virtual unsigned SupplyListIndexSize()
Definition: PopulationManager.h:725
Population_Manager::m_NoProbes
int m_NoProbes
Definition: PopulationManager.h:787
Nestling_struct::Dad
Skylark_Male * Dad
Definition: skylarks_all.h:233
Probe_Data::m_NoFarms
unsigned m_NoFarms
Definition: PopulationManager.h:436
cfg_ClutchMortProb
CfgInt cfg_ClutchMortProb
cfg_HQualityHedgeScrub
CfgInt cfg_HQualityHedgeScrub
Skylark_Female
Definition: skylarks_all.h:676
Skylark_PreFledgeling
Definition: skylarks_all.h:624
g_random_fnc
int g_random_fnc(const int a_range)
Definition: ALMaSS_Random.cpp:74
NestLeavingWeight
static double NestLeavingWeight
Definition: skylarks_all.cpp:155
NestPlacementMinQual
double NestPlacementMinQual
The minimum quality for nest placement.
Definition: skylarks_all.cpp:227
cfg_hindconstantH_b
CfgFloat cfg_hindconstantH_b
cfg_temphindpow
CfgInt cfg_temphindpow
PreFledgeling_struct::size
double size
Definition: skylarks_all.h:240
PreFledgeling_struct
Definition: skylarks_all.h:238
SkTerritories::Supply_y
int Supply_y(int ref) const
Definition: skylarks_all.cpp:1390
TTypesOfSkState
enum { toss_Initiation=0, toss_Developing, toss_Hatching, toss_CDying, toss_NDeveloping, toss_NMaturing, toss_NDying, toss_PDeveloping, toss_PMaturing, toss_PDying, toss_MFlocking, toss_MFloating, toss_MArriving, toss_MImmigrating, toss_MEmigrating, toss_MTempLeavingArea, toss_MFindingTerritory, toss_AttractingAMate, toss_FollowingMate, toss_ScaringOffChicks, toss_MCaringForYoung, toss_MDying, toss_MRehousing, toss_FFlocking, toss_FFloating, toss_FArriving, toss_FImmigrating, toss_FEmigrating, toss_FTempLeavingArea, toss_FFindingTerritory, toss_BuildingUpResources, toss_MakingNest, toss_PreparingForBreeding, toss_Laying, toss_StartingNewBrood, toss_EggHatching, toss_Incubating, toss_StoppingBreeding, toss_FCaringForYoung, toss_FDying, toss_GivingUpTerritory, toss_Destroy, } TTypesOfSkState
Definition: skylarks_all.h:92
Skylark_struct::mh
int mh
Definition: skylarks_all.h:213
PreFledgeling_struct::age
int age
Definition: skylarks_all.h:243
cfg_HQualityBareEarth
CfgInt cfg_HQualityBareEarth
Population_Manager::PushIndividual
void PushIndividual(const unsigned a_listindex, TAnimal *a_individual_ptr)
Definition: PopulationManager.cpp:1682
cfg_HQualityWater
CfgInt cfg_HQualityWater
Population_Manager::Population_Manager
Population_Manager(Landscape *a_l_ptr, int a_numberLifeStages=12)
Definition: PopulationManager.cpp:200
skClutch_struct::Mum
Skylark_Female * Mum
Definition: skylarks_all.h:226
Weather::GetRain
double GetRain(long a_date)
Definition: Weather.h:506
Skylark_Male::SensibleCopy
void SensibleCopy()
Definition: skylarks_all.cpp:6626
Population_Manager::ReallyBigOutputPrb
ofstream * ReallyBigOutputPrb
Definition: PopulationManager.h:873
HQualityTall2
int HQualityTall2
Definition: skylarks_all.cpp:230
cfg_PmEventsize
CfgInt cfg_PmEventsize
HQualityWater
int HQualityWater
Definition: skylarks_all.cpp:236
Skylark_Population_Manager::ProbePOM
float ProbePOM(int ListIndex, const Probe_Data *p_TheProbe)
Modified probe for POM Output.
Definition: skylarks_all.cpp:1089
cfg_HQualityNeutral
CfgInt cfg_HQualityNeutral
cfg_SkStartNos
CfgInt cfg_SkStartNos
The number of skylarks that start in the simulation.
cfg_Breed_Res_Thresh1
CfgInt cfg_Breed_Res_Thresh1
cfg_rainhindpow
CfgInt cfg_rainhindpow
Nestling_struct
Definition: skylarks_all.h:231
cfg_HQualityVeg30cm
CfgInt cfg_HQualityVeg30cm
Skylark_Male::OnAddPreFledgeling
void OnAddPreFledgeling(Skylark_PreFledgeling *P, const Skylark_Nestling *N)
Definition: skylarks_all.cpp:4232
Skylark_struct::bx
int bx
Definition: skylarks_all.h:211
Skylark_Population_Manager::m_NoChickDeaths
int m_NoChickDeaths
Definition: skylarks_all.h:440
Skylark_Population_Manager::M_Mig_Mort
int M_Mig_Mort
Definition: skylarks_all.h:431
Population_Manager::IncLiveArraySize
void IncLiveArraySize(int a_listindex)
Increments the number of 'live' objects for a list index in the TheArray.
Definition: PopulationManager.h:665