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
TPredator_Population_Manager Class Reference

The class to handle all predator population related matters. More...

#include <Predators.h>

Inheritance diagram for TPredator_Population_Manager:
Population_Manager Population_Manager_Base

Public Member Functions

virtual void Run (int)
 
bool InOtherTerritory (unsigned sp, int p_x, int p_y, TPredator *p_Pred)
 
 TPredator_Population_Manager (Landscape *L, Vole_Population_Manager *VPM)
 
virtual ~TPredator_Population_Manager (void)
 
void CreateObjects (int ob_type, TAnimal *pvo, struct_Predator *data, int number)
 
void inc_inds (unsigned list)
 
void dec_inds (unsigned list)
 
unsigned supply_no_inds (unsigned list)
 
- 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
 
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 TheAOROutputProbe ()
 
virtual void TheRipleysOutputProbe (ofstream *a_prb)
 Special output functionality. More...
 
virtual void TheReallyBigOutputProbe ()
 
void CloseTheMonthlyRipleysOutputProbe () const
 
virtual void CloseTheRipleysOutputProbe ()
 
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 bool OpenTheFledgelingProbe ()
 
virtual bool OpenTheBreedingPairsProbe ()
 
virtual bool OpenTheBreedingSuccessProbe ()
 
virtual void BreedingPairsOutput (int)
 
virtual int TheBreedingFemalesProbe (int)
 
virtual int TheFledgelingProbe ()
 
virtual void BreedingSuccessProbeOutput (double, int, int, int, int, int, int, int)
 
virtual int TheBreedingSuccessProbe (int &, int &, int &, int &, int &, int &)
 
virtual void FledgelingProbeOutput (int, 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...
 

Protected Member Functions

virtual bool StepFinished ()
 Methods to run the simulations. More...
 
virtual void DoFirst ()
 
virtual void DoBefore ()
 
virtual void DoAfter ()
 
virtual void DoLast ()
 
void CloseTheReallyBigOutputProbe ()
 
void PredSampleFile ()
 
void PredAutumnSample ()
 
void PredSpringSample ()
 
void PredSpringAutumnSample ()
 
- Protected Member Functions inherited from Population_Manager
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)
 
virtual void Catastrophe ()
 
- Protected Member Functions inherited from Population_Manager_Base
 ~Population_Manager_Base ()=default
 

Protected Attributes

Vole_Population_Managerm_Prey
 
unsigned NoPredatorTypes
 
unsigned m_no_individuals [2]
 
- 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...
 

Additional Inherited Members

- 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...
 

Detailed Description

The class to handle all predator population related matters.

Constructor & Destructor Documentation

◆ TPredator_Population_Manager()

TPredator_Population_Manager::TPredator_Population_Manager ( Landscape L,
Vole_Population_Manager VPM 
)
91  : Population_Manager(L , 2)
92 {
93 
94  m_ListNames[WEASEL] = "Weasel";
95  m_ListNames[OWL] = "Owl";
96  m_ListNameLength = 2;
97  m_SimulationName = "Vole Predators";
98 
99  // Constants for the predator species
108  // Remember the prey
109  m_Prey=VPM;
112  // Create some weasels and owls
113  struct_Predator* sp;
114  sp = new struct_Predator;
115  sp->PM = this;
116  sp->L = m_TheLandscape;
118  for (int i=0; i<weasel_StartingNo; i++)
119  {
120  sp->x = g_random_fnc(SimW);
121  sp->y = g_random_fnc(SimH);
122  CreateObjects(0,NULL,sp,1); // 0 = weasel
123  }
124  for (int i=0; i<owl_StartingNo; i++)
125  {
126  sp->x = g_random_fnc(SimW);
127  sp->y = g_random_fnc(SimH);
128  CreateObjects(1,NULL,sp,1); // 1 = Owl
129  }
130  delete sp;
133 }

References cfg_owl_breed_day, cfg_owl_breed_threshold, cfg_owl_death_threshold, cfg_owl_StartingNo, cfg_weasel_breed_day, cfg_weasel_breed_threshold, cfg_weasel_death_threshold, cfg_weasel_StartingNo, CreateObjects(), g_random_fnc(), struct_Predator::L, Population_Manager_Base::m_ListNameLength, Population_Manager_Base::m_ListNames, m_no_individuals, Population_Manager::m_population_type, m_Prey, Population_Manager_Base::m_SimulationName, Population_Manager_Base::m_TheLandscape, OWL, owl_breed_day, owl_breed_threshold, owl_death_threshold, owl_StartingNo, struct_Predator::PM, Population_Manager::ReallyBigOutputPrb, Population_Manager::RipleysOutputPrb, Population_Manager_Base::SimH, Population_Manager_Base::SimW, TOP_Predators, CfgInt::value(), WEASEL, weasel_breed_day, weasel_breed_threshold, weasel_death_threshold, weasel_StartingNo, struct_Predator::x, and struct_Predator::y.

◆ ~TPredator_Population_Manager()

TPredator_Population_Manager::~TPredator_Population_Manager ( void  )
virtual
84 {
85  // Should all be done by the Population_Manager destructor
86 }

Member Function Documentation

◆ CloseTheReallyBigOutputProbe()

void TPredator_Population_Manager::CloseTheReallyBigOutputProbe ( )
inlineprotectedvirtual

close the probe

Reimplemented from Population_Manager.

171 {}; // This will always be done by the main population manager

◆ CreateObjects()

void TPredator_Population_Manager::CreateObjects ( int  ob_type,
TAnimal pvo,
struct_Predator data,
int  number 
)
138 {
139  Weasel* new_Weasel;
140  Owl* new_Owl;
141  for (int i=0; i<number; i++)
142  {
143  if (ob_type == WEASEL) // Weasel
144  {
145  new_Weasel = new Weasel(m_Prey,data->x, data->y, data->L, data->PM);
146  PushIndividual(ob_type, new_Weasel);
147  inc_inds(WEASEL);
148  }
149  if (ob_type == OWL) // Owl
150  {
151  new_Owl = new Owl(m_Prey,data->x, data->y, data->L, data->PM);
152  PushIndividual(ob_type, new_Owl);
153  inc_inds(OWL);
154  }
155  }
156 }

References inc_inds(), struct_Predator::L, m_Prey, OWL, struct_Predator::PM, Population_Manager::PushIndividual(), WEASEL, struct_Predator::x, and struct_Predator::y.

Referenced by Weasel::BeginStep(), Owl::BeginStep(), and TPredator_Population_Manager().

◆ dec_inds()

void TPredator_Population_Manager::dec_inds ( unsigned  list)
inline
156 {m_no_individuals[list]--;}

References m_no_individuals.

Referenced by Weasel::BeginStep(), and Owl::BeginStep().

◆ DoAfter()

virtual void TPredator_Population_Manager::DoAfter ( )
inlineprotectedvirtual

Can be used in descendent classes

Reimplemented from Population_Manager.

169 {}

Referenced by Run().

◆ DoBefore()

virtual void TPredator_Population_Manager::DoBefore ( )
inlineprotectedvirtual

Can be used in descendent classes

Reimplemented from Population_Manager.

168 {}

Referenced by Run().

◆ DoFirst()

virtual void TPredator_Population_Manager::DoFirst ( void  )
inlineprotectedvirtual

Can be used in descendent classes

Reimplemented from Population_Manager.

167 {}

Referenced by Run().

◆ DoLast()

virtual void TPredator_Population_Manager::DoLast ( )
inlineprotectedvirtual

Collects some data to describe the number of animals in each state at the end of the day

Reimplemented from Population_Manager.

170 {}

Referenced by Run().

◆ inc_inds()

void TPredator_Population_Manager::inc_inds ( unsigned  list)
inline
155 {m_no_individuals[list]++;}

References m_no_individuals.

Referenced by CreateObjects().

◆ InOtherTerritory()

bool TPredator_Population_Manager::InOtherTerritory ( unsigned  sp,
int  p_x,
int  p_y,
TPredator p_Pred 
)
672 {
673  // Go through sp species and see if a territory at x,y will overlap with
674  // theirs
675  for (unsigned i=0; i< SupplyListSize(sp); i++)
676  {
677  TPredator* APredator=(TPredator *) SupplyAnimalPtr(sp,i);
678  if (APredator->OverlapMyTerritory(x,y))
679  {
680  if (APredator!=p_Pred) return true;
681  }
682  }
683  return false;
684 }

References TPredator::OverlapMyTerritory(), Population_Manager::SupplyAnimalPtr(), and Population_Manager::SupplyListSize().

Referenced by TPredator::st_Dispersal().

◆ PredAutumnSample()

void TPredator_Population_Manager::PredAutumnSample ( )
protected
361 {
362  int today = m_TheLandscape->SupplyDayInYear();
363  int year = m_TheLandscape->SupplyYearNumber();
364 
366  FILE* pref=fopen("PredAutumnOutput.txt","a");
367  if (pref == NULL) {
368  m_TheLandscape->Warn("TPredator_Population_Manager::PredAutumnSample","Could Not Open PredAutumnOutput.txt File");
369  exit(0);
370  }
371 
372  unsigned int SizeWeasel = (unsigned int) SupplyListSize(0);
373  unsigned int SizeOwl = (unsigned int) SupplyListSize(1);
374  unsigned int TotalSize = SizeWeasel+SizeOwl;
375 
376  fprintf(pref,"%d\t", year);
377  fprintf(pref,"%d\t", today);
378  fprintf(pref,"%d\t", SizeWeasel);
379  fprintf(pref,"%d\t", SizeOwl);
380  fprintf(pref,"%d\t", TotalSize);
381  fprintf(pref,"\n");
382 
383  fclose(pref);
384  }
385 
386  else if (cfg_weasel_StartingNo.value()> 0){
387  unsigned int SizeWeasel = (unsigned int) SupplyListSize(0);
388 
389  FILE* pref = fopen("PredAutumnOutput.txt","a");
390  if (pref == NULL) {
391  m_TheLandscape->Warn("TPredator_Population_Manager::PredAutumnSample","Could Not Open PredAutumnOutput.txt File");
392  exit(0);
393  }
394  fprintf(pref,"%d\t", year);
395  fprintf(pref,"%d\t", today);
396  fprintf(pref,"%d\t", SizeWeasel);
397  fprintf(pref,"%d\t", 0);
398  fprintf(pref,"%d\t", SizeWeasel);
399  fprintf(pref,"\n");
400 
401  fclose(pref);
402  }
403 
404  else if (cfg_owl_StartingNo.value()> 0) {
405  unsigned int SizeOwl = (unsigned int) SupplyListSize(1);
406 
407  FILE* pref = fopen("PredAutumnOutput.txt","a");
408  if (pref == NULL) {
409  m_TheLandscape->Warn("TPredator_Population_Manager::PredAutumnSample","Could Not Open PredAutumnOutput.txt File");
410  exit(0);
411  }
412  fprintf(pref,"%d\t", year);
413  fprintf(pref,"%d\t", today);
414  fprintf(pref,"%d\t", 0);
415  fprintf(pref,"%d\t", SizeOwl);
416  fprintf(pref,"%d\t", SizeOwl);
417  fprintf(pref,"\n");
418 
419  fclose(pref);
420  }
421 }

References cfg_owl_StartingNo, cfg_weasel_StartingNo, Population_Manager_Base::m_TheLandscape, Landscape::SupplyDayInYear(), Population_Manager::SupplyListSize(), Landscape::SupplyYearNumber(), CfgInt::value(), and Landscape::Warn().

Referenced by Run().

◆ PredSampleFile()

void TPredator_Population_Manager::PredSampleFile ( )
protected
160  {
161 
162  int today = m_TheLandscape->SupplyDayInYear();
163  int year = m_TheLandscape->SupplyYearNumber();
164  int month = m_TheLandscape->SupplyMonth();
165  int dayinMo = m_TheLandscape->SupplyDayInMonth();
166 
168 
169  FILE* pref=fopen("PredSampleData.txt","a");
170  if (pref == NULL) {
171  m_TheLandscape->Warn("TPredator_Population_Manager::PredSampleFile","Could Not Open PredSampleData.txt File");
172  exit(0);
173  }
174 
175  Weasel* Wp;
176  unsigned int SizeWeasel = (unsigned int) SupplyListSize(0);
177  Owl* Op;
178  unsigned int SizeOwl = (unsigned int) SupplyListSize(1);
179  unsigned int TotalSize = SizeWeasel+SizeOwl;
180 
183  fprintf(pref,"%d\t %d\t %d\t %d\t %u\t %u\n", 0,w ,0, h, SizeWeasel, TotalSize);
184 
185  for (unsigned i=0; i<SizeWeasel; i++){
186 
187  Wp=dynamic_cast<Weasel*>(SupplyAnimalPtr(0, i));
188  int Wx{0}, Wy{0};
189  SupplyLocXY(0, i, Wx, Wy);
190 
191  int Wpoly = m_TheLandscape->SupplyPolyRef(Wx, Wy);
192  int Wele = m_TheLandscape->SupplyElementType(Wpoly);
193  int Wveg = m_TheLandscape->SupplyVegType(Wpoly);
194 
195  unsigned Wspecies = Wp->SupplySpeciesID();
196  int kill = Wp->SupplyKill();
197  int KillEff = Wp->SupplyKillEff();
198  int Terr = Wp->SupplyTerr();
199  int HomeR = Wp->SupplyHomeRange();
200 
201  fprintf(pref,"%d\t",year);
202  fprintf(pref,"%d\t",month);
203  fprintf(pref,"%d\t",dayinMo);
204  fprintf(pref,"%d\t",today);
205 
206  fprintf(pref,"%d\t",Wspecies);
207  fprintf(pref,"%d\t",kill);
208  fprintf(pref,"%d\t",KillEff);
209  fprintf(pref,"%d\t",Terr);
210  fprintf(pref,"%d\t",HomeR);
211 
212  fprintf(pref,"%d\t",Wx);
213  fprintf(pref,"%d\t",Wy);
214  fprintf(pref,"%d\t",Wpoly);
215  fprintf(pref,"%d\t",Wele);
216  fprintf(pref,"%d\t",Wveg);
217  fprintf(pref,"\n");
218  }
219 
220  fprintf(pref,"%d\t %d\t %d\t %d\t %u\t %u\n", 0,w ,0, h, SizeOwl, TotalSize);
221 
222  for (unsigned i = 0; i < SizeOwl; i++){
223  Op=dynamic_cast<Owl*>(SupplyAnimalPtr(1, i));
224  int Ox{0}, Oy{0};
225  SupplyLocXY(1, i, Ox, Oy);
226  int Opoly = m_TheLandscape->SupplyPolyRef(Ox, Oy);
227  int Oele = m_TheLandscape->SupplyElementType(Opoly);
228  int Oveg = m_TheLandscape->SupplyVegType(Opoly);
229 
230  int species = Op->SupplySpeciesID();
231  int kill = Op->SupplyKill();
232  int KillEff = Op->SupplyKillEff();
233  int Terr = Op->SupplyTerr();
234  int HomeR = Op->SupplyHomeRange();
235 
236  fprintf(pref,"%d\t",year);
237  fprintf(pref,"%d\t",month);
238  fprintf(pref,"%d\t",dayinMo);
239  fprintf(pref,"%d\t",today);
240 
241  fprintf(pref,"%d\t",species);
242  fprintf(pref,"%d\t",kill);
243  fprintf(pref,"%d\t",KillEff);
244  fprintf(pref,"%d\t",Terr);
245  fprintf(pref,"%d\t",HomeR);
246 
247  fprintf(pref,"%d\t",Ox);
248  fprintf(pref,"%d\t",Oy);
249  fprintf(pref,"%d\t",Opoly);
250  fprintf(pref,"%d\t",Oele);
251  fprintf(pref,"%d\t",Oveg);
252  fprintf(pref,"\n");
253  }
254  fclose(pref);
255  }
256 
257  else if (cfg_weasel_StartingNo.value()> 0){
258 
259  FILE* pref=fopen("PredSampleData.txt","a");
260  if (pref == NULL) {
261  m_TheLandscape->Warn("TPredator_Population_Manager::PredSampleFile","Could Not Open PredSampleData.txt File");
262  exit(0);
263  }
264 
265  Weasel* Wp;
266  unsigned int SizeWeasel = (unsigned int) SupplyListSize(0);
267  unsigned int TotalSize = (unsigned int) SizeWeasel;
268 
271  fprintf(pref,"%d\t %d\t %d\t %d\t %u\t %u\n", 0,w ,0, h, SizeWeasel, TotalSize);
272 
273  for (unsigned i = 0; i < SizeWeasel; i++){
274  Wp=dynamic_cast<Weasel*>(SupplyAnimalPtr(0, i));
275  int Wx{0}, Wy{0};
276  SupplyLocXY(0, i, Wx, Wy);
277  int Wpoly = m_TheLandscape->SupplyPolyRef(Wx, Wy);
278  int Wele = m_TheLandscape->SupplyElementType(Wpoly);
279  int Wveg = m_TheLandscape->SupplyVegType(Wpoly);
280 
281  int species = Wp->SupplySpeciesID();
282  int kill = Wp->SupplyKill();
283  int KillEff = Wp->SupplyKillEff();
284  int Terr = Wp->SupplyTerr();
285  int HomeR = Wp->SupplyHomeRange();
286 
287  fprintf(pref,"%d\t",year);
288  fprintf(pref,"%d\t",month);
289  fprintf(pref,"%d\t",dayinMo);
290  fprintf(pref,"%d\t",today);
291 
292  fprintf(pref,"%d\t",species);
293  fprintf(pref,"%d\t",kill);
294  fprintf(pref,"%d\t",KillEff);
295  fprintf(pref,"%d\t",Terr);
296  fprintf(pref,"%d\t",HomeR);
297 
298  fprintf(pref,"%d\t",Wx);
299  fprintf(pref,"%d\t",Wy);
300  fprintf(pref,"%d\t",Wpoly);
301  fprintf(pref,"%d\t",Wele);
302  fprintf(pref,"%d\t",Wveg);
303  fprintf(pref,"\n");
304  }
305  fclose(pref);
306  }
307 
308  else if (cfg_owl_StartingNo.value()> 0) {
309 
310  FILE* pref=fopen("PredSampleData.txt","a");
311  if (pref == NULL) {
312  m_TheLandscape->Warn("TPredator_Population_Manager::PredSampleFile","Could Not Open PredSampleData.txt File");
313  exit(0);
314  }
315 
316  Owl* Op;
317  unsigned int SizeOwl = (unsigned int) SupplyListSize(1);
318  unsigned int TotalSize = SizeOwl;
321  fprintf(pref,"%d\t %d\t %d\t %d\t %u\t %u\n", 0,w ,0, h, SizeOwl, TotalSize);
322 
323  for (unsigned i = 0; i < SizeOwl; i++){
324  Op=dynamic_cast<Owl*>(SupplyAnimalPtr(1, i));
325  int Wx{0}, Wy{0};
326  SupplyLocXY(1, i, Wx, Wy);
327 
328  int Wpoly = m_TheLandscape->SupplyPolyRef(Wx, Wy);
329  int Wele = m_TheLandscape->SupplyElementType(Wpoly);
330  int Wveg = m_TheLandscape->SupplyVegType(Wpoly);
331 
332  int Wspecies = Op->SupplySpeciesID();
333  int Wkill = Op->SupplyKill();
334  int WKillEff = Op->SupplyKillEff();
335  int Terr = Op->SupplyTerr();
336  int HomeR = Op->SupplyHomeRange();
337 
338  fprintf(pref,"%d\t",year);
339  fprintf(pref,"%d\t",month);
340  fprintf(pref,"%d\t",dayinMo);
341  fprintf(pref,"%d\t",today);
342 
343  fprintf(pref,"%d\t",Wspecies);
344  fprintf(pref,"%d\t",Wkill);
345  fprintf(pref,"%d\t",WKillEff);
346  fprintf(pref,"%d\t",Terr);
347  fprintf(pref,"%d\t",HomeR);
348 
349  fprintf(pref,"%d\t",Wx);
350  fprintf(pref,"%d\t",Wy);
351  fprintf(pref,"%d\t",Wpoly);
352  fprintf(pref,"%d\t",Wele);
353  fprintf(pref,"%d\t",Wveg);
354  fprintf(pref,"\n");
355  }
356  fclose(pref);
357  }
358 }

References cfg_owl_StartingNo, cfg_weasel_StartingNo, Population_Manager_Base::m_TheLandscape, Population_Manager::SupplyAnimalPtr(), Landscape::SupplyDayInMonth(), Landscape::SupplyDayInYear(), Landscape::SupplyElementType(), TPredator::SupplyHomeRange(), TPredator::SupplyKill(), TPredator::SupplyKillEff(), Population_Manager::SupplyListSize(), Population_Manager_Base::SupplyLocXY(), Landscape::SupplyMonth(), Landscape::SupplyPolyRef(), Landscape::SupplySimAreaHeight(), Landscape::SupplySimAreaWidth(), TPredator::SupplySpeciesID(), TPredator::SupplyTerr(), Landscape::SupplyVegType(), Landscape::SupplyYearNumber(), CfgInt::value(), and Landscape::Warn().

Referenced by Run().

◆ PredSpringAutumnSample()

void TPredator_Population_Manager::PredSpringAutumnSample ( )
protected
487 {
488  int today = m_TheLandscape->SupplyDayInYear();
489  int year = m_TheLandscape->SupplyYearNumber();
490 
492  unsigned int SizeWeasel = (unsigned int) SupplyListSize(0);
493  unsigned int SizeOwl = (unsigned int) SupplyListSize(1);
494  unsigned int TotalSize = SizeWeasel+SizeOwl;
495 
496  FILE* pref=fopen("PredSpringAutumnOutput.txt","a");
497  if (pref == NULL) {
498  m_TheLandscape->Warn("TPredator_Population_Manager::PredSpringAutumnSample","Could Not Open PredSpringAutumnOutput.txt File");
499  exit(0);
500  }
501 
502  fprintf(pref,"%d\t", year);
503  fprintf(pref,"%d\t", today);
504  fprintf(pref,"%d\t", SizeWeasel);
505  fprintf(pref,"%d\t", SizeOwl);
506  fprintf(pref,"%d\t", TotalSize);
507  fprintf(pref,"\n");
508 
509  fclose(pref);
510  }
511 
512  else if (cfg_weasel_StartingNo.value()> 0){
513  unsigned int SizeWeasel = (unsigned int) SupplyListSize(0);
514 
515  FILE* pref=fopen("PredSpringAutumnOutput.txt","a");
516  if (pref == NULL) {
517  m_TheLandscape->Warn("TPredator_Population_Manager::PredSpringAutumnSample","Could Not Open PredSpringAutumnOutput.txt File");
518  exit(0);
519  }
520  fprintf(pref,"%d\t", year);
521  fprintf(pref,"%d\t", today);
522  fprintf(pref,"%d\t", SizeWeasel);
523  fprintf(pref,"%d\t", 0);
524  fprintf(pref,"%d\t", SizeWeasel);
525  fprintf(pref,"\n");
526 
527  fclose(pref);
528  }
529  else if (cfg_owl_StartingNo.value()> 0) {
530  unsigned int SizeOwl = (unsigned int) SupplyListSize(1);
531 
532  FILE* pref=fopen("PredSpringAutumnOutput.txt","a");
533  if (pref == NULL) {
534  m_TheLandscape->Warn("TPredator_Population_Manager::PredSpringAutumnSample","Could Not Open PredSpringAutumnOutput.txt File");
535  exit(0);
536  }
537  fprintf(pref,"%d\t", year);
538  fprintf(pref,"%d\t", today);
539  fprintf(pref,"%d\t", 0);
540  fprintf(pref,"%d\t", SizeOwl);
541  fprintf(pref,"%d\t", SizeOwl);
542  fprintf(pref,"\n");
543 
544  fclose(pref);
545  }
546 }

References cfg_owl_StartingNo, cfg_weasel_StartingNo, Population_Manager_Base::m_TheLandscape, Landscape::SupplyDayInYear(), Population_Manager::SupplyListSize(), Landscape::SupplyYearNumber(), CfgInt::value(), and Landscape::Warn().

Referenced by Run().

◆ PredSpringSample()

void TPredator_Population_Manager::PredSpringSample ( )
protected
424 {
425  int today = m_TheLandscape->SupplyDayInYear();
426  int year = m_TheLandscape->SupplyYearNumber();
427 
429  unsigned int SizeWeasel = (unsigned int) SupplyListSize(0);
430  unsigned int SizeOwl = (unsigned int) SupplyListSize(1);
431  unsigned int TotalSize = SizeWeasel+SizeOwl;
432 
433  FILE* pref=fopen("PredSpringOutput.txt","a");
434  if (pref == NULL) {
435  m_TheLandscape->Warn("TPredator_Population_Manager::PredSpringSample","Could Not Open PredSpringOutput.txt File");
436  exit(0);
437  }
438  fprintf(pref,"%d\t", year);
439  fprintf(pref,"%d\t", today);
440  fprintf(pref,"%d\t", SizeWeasel);
441  fprintf(pref,"%d\t", SizeOwl);
442  fprintf(pref,"%d\t", TotalSize);
443  fprintf(pref,"\n");
444 
445  fclose(pref);
446  }
447 
448  else if (cfg_weasel_StartingNo.value()> 0){
449  unsigned int SizeWeasel = (unsigned int) SupplyListSize(0);
450 
451  FILE* pref=fopen("PredSpringOutput.txt","a");
452  if (pref == NULL) {
453  m_TheLandscape->Warn("TPredator_Population_Manager::PredSpringSample","Could Not Open PredSpringOutput.txt File");
454  exit(0);
455  }
456  fprintf(pref,"%d\t", year);
457  fprintf(pref,"%d\t", today);
458  fprintf(pref,"%d\t", SizeWeasel);
459  fprintf(pref,"%d\t", 0);
460  fprintf(pref,"%d\t", SizeWeasel);
461  fprintf(pref,"\n");
462 
463  fclose(pref);
464  }
465 
466  else if (cfg_owl_StartingNo.value()> 0) {
467  unsigned int SizeOwl = (unsigned int) SupplyListSize(1);
468 
469  FILE* pref=fopen("PredSpringOutput.txt","a");
470  if (pref == NULL) {
471  m_TheLandscape->Warn("TPredator_Population_Manager::PredSpringSample","Could Not Open PredSpringOutput.txt File");
472  exit(0);
473  }
474  fprintf(pref,"%d\t", year);
475  fprintf(pref,"%d\t", today);
476  fprintf(pref,"%d\t", 0);
477  fprintf(pref,"%d\t", SizeOwl);
478  fprintf(pref,"%d\t", SizeOwl);
479  fprintf(pref,"\n");
480 
481  fclose(pref);
482  }
483 }

References cfg_owl_StartingNo, cfg_weasel_StartingNo, Population_Manager_Base::m_TheLandscape, Landscape::SupplyDayInYear(), Population_Manager::SupplyListSize(), Landscape::SupplyYearNumber(), CfgInt::value(), and Landscape::Warn().

Referenced by Run().

◆ Run()

void TPredator_Population_Manager::Run ( int  NoTSteps)
virtual

This is the main scheduling method for the population manager.
Note the structure of Shuffle_or_Sort(), DoFirst(), BeginStep, DoBefore(), Step looping until all are finished, DoAfter(), EndStep, DoLast().

Can do multiple time-steps here inside one landscape time-step (a day). This is used in the roe deer model to provide 10 minute behavioural time-steps.

It is necessary to remove any dead animals before the timestep starts. It is possible that animals are killed after their population manager Run method has been executed. This is the case with geese and hunters. Checking death first prevents this becomming a problem.

Reimplemented from Population_Manager.

554 {
555  DoFirst();
556  // begin step actions ...
557  // set all stepdone to false.... is this really necessary??
558  int today = m_TheLandscape->SupplyDayInYear();
560 
563  {
564  PredSampleFile();
566  }
567  if (today == cfg_pred_first_sample_day.value())
568  {
570  }
571  if (today == cfg_pred_second_sample_day.value())
572  {
574  }
575  }
576 
577  if (today==364 ) {
578  FILE* pref = fopen("PredProbe.txt","a");
579  if (!pref) {
580  m_TheLandscape->Warn("Predator_Population_Manager Destructor","Could Not Open PredProbe.txt File");
581  exit(0);
582  }
583  if ((SupplyListSize(0)> 0)&& (SupplyListSize(1)> 0)){
584  unsigned int PredNo0 = (unsigned int) SupplyListSize(0);
585  unsigned int PredNo1 = (unsigned int) SupplyListSize(1);
586  fprintf(pref,"%d\t%u\t%u\t%u\t%u\n", Y, 0, PredNo0, 1, PredNo1);
587  }
588  else if (SupplyListSize(0)> 0){
589  unsigned int PredNo0 = (unsigned int) SupplyListSize(0);
590  fprintf(pref,"%d\t%u\t%u\n", Y, 0, PredNo0);
591  }
592  else if (SupplyListSize(1)> 0) {
593  unsigned int PredNo1 = (unsigned int) SupplyListSize(1);
594  fprintf(pref,"%d\t%u\t%u\n", Y, 1, PredNo1);
595  }
596  fclose(pref);
597  }
598 // cal
599  for (unsigned listindex=0; listindex<SupplyListIndexSize(); listindex++)
600  {
601  for (unsigned j=0; j< SupplyListSize(listindex); j++)
602  {
603  SupplyAnimalPtr(listindex, j)->SetStepDone(false);
604  }
605  }
606  // call the begin-step-method of all objects
607  for (unsigned listindex=0; listindex<SupplyListIndexSize();listindex++)
608  {
609  for (unsigned j=0; j< SupplyListSize(listindex); j++)
610  SupplyAnimalPtr(listindex, j)->BeginStep();
611  }
612  DoBefore();
613  // call the step-method of all objects
614  do
615  {
616  for (unsigned listindex=0; listindex<SupplyListIndexSize();listindex++)
617  {
618  for (unsigned j=0; j< SupplyListSize(listindex); j++)
619  {
620  SupplyAnimalPtr(listindex, j)->Step();
621  }
622  } // for listindex
623  } while (!StepFinished());
624  DoAfter();
625  // call the end-step-method of all objects
626  for (unsigned listindex=0; listindex<SupplyListIndexSize();listindex++)
627  {
628  for (unsigned j=0; j< SupplyListSize(listindex); j++)
629  {
630  SupplyAnimalPtr(listindex, j)->EndStep();
631  }
632  }
633  // ----------------
634  // end of this step actions
635 
636  // For each animal list
637  for (unsigned listindex=0; listindex<SupplyListIndexSize();listindex++)
638  {
639  // Must check each object in the list for m_CurrentStateNo==-1
640  int TAend=(int) SupplyListSize(listindex)-1;
641  for (int j=TAend; j>=0; j--) // Search backwards is more efficicent
642  {
643  if (SupplyAnimalPtr(listindex, j)->GetCurrentStateNo() == -1) // code for kill it
644  {
645  delete SupplyAnimalPtr(listindex,j); // this line will become redundant if we use smart pointers instead of new
646  }
647  }
648  }
649  DoLast();
650 }

References TALMaSSObject::BeginStep(), cfg_pred_first_sample_day, cfg_pred_second_sample_day, cfg_PredSampleDataUsed, DoAfter(), DoBefore(), DoFirst(), DoLast(), TALMaSSObject::EndStep(), TALMaSSObject::GetCurrentStateNo(), Population_Manager_Base::m_TheLandscape, PredAutumnSample(), PredSampleFile(), PredSpringAutumnSample(), PredSpringSample(), TALMaSSObject::SetStepDone(), TALMaSSObject::Step(), StepFinished(), Population_Manager::SupplyAnimalPtr(), Landscape::SupplyDayInYear(), Population_Manager::SupplyListIndexSize(), Population_Manager::SupplyListSize(), Landscape::SupplyYearNumber(), CfgInt::value(), CfgBool::value(), and Landscape::Warn().

◆ StepFinished()

bool TPredator_Population_Manager::StepFinished ( void  )
protectedvirtual

Methods to run the simulations.

Returns true if and only if all objects have finished the current step

Reimplemented from Population_Manager.

655 {
656  for (unsigned listindex=0; listindex<SupplyListIndexSize();listindex++)
657  {
658  for (unsigned j=0; j< SupplyListSize(listindex); j++)
659  {
660  if (SupplyAnimalPtr(listindex,j)->GetStepDone() == false)
661  {
662  return false;
663  }
664  }
665  }
666  return true;
667 }

References TALMaSSObject::GetStepDone(), Population_Manager::SupplyAnimalPtr(), Population_Manager::SupplyListIndexSize(), and Population_Manager::SupplyListSize().

Referenced by Run().

◆ supply_no_inds()

unsigned TPredator_Population_Manager::supply_no_inds ( unsigned  list)
inline
157 {return m_no_individuals[list];}

References m_no_individuals.

Referenced by Weasel::BeginStep(), and Owl::BeginStep().

Member Data Documentation

◆ m_no_individuals

unsigned TPredator_Population_Manager::m_no_individuals[2]
protected

◆ m_Prey

Vole_Population_Manager* TPredator_Population_Manager::m_Prey
protected

◆ NoPredatorTypes

unsigned TPredator_Population_Manager::NoPredatorTypes
protected

The documentation for this class was generated from the following files:
TPredator
The base class for predators encompsassing all their general behaviours.
Definition: Predators.h:87
owl_breed_threshold
int owl_breed_threshold
Definition: Predators.cpp:73
TALMaSSObject::SetStepDone
void SetStepDone(bool a_bool)
Sets the step done indicator flag.
Definition: PopulationManager.h:143
TALMaSSObject::Step
virtual void Step()
Step behaviour - must be implemented in descendent classes.
Definition: PopulationManager.h:148
weasel_StartingNo
int weasel_StartingNo
Definition: Predators.cpp:79
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
OWL
#define OWL
Definition: Predators.cpp:49
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
cfg_owl_death_threshold
static CfgInt cfg_owl_death_threshold("OWL_DT", CFG_CUSTOM,-1)
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
TALMaSSObject::EndStep
virtual void EndStep()
EndStep behaviour - must be implemented in descendent classes.
Definition: PopulationManager.h:151
Population_Manager::m_population_type
TTypesOfPopulation m_population_type
Definition: PopulationManager.h:858
cfg_pred_second_sample_day
static CfgInt cfg_pred_second_sample_day("PRED_SAMPLE_FILE_DAY_TWO", CFG_CUSTOM, 287)
TPredator::OverlapMyTerritory
bool OverlapMyTerritory(unsigned x, unsigned y)
Definition: Predators.cpp:770
TPredator_Population_Manager::DoFirst
virtual void DoFirst()
Definition: Predators.h:167
Population_Manager_Base::SupplyLocXY
virtual void SupplyLocXY(unsigned, unsigned, int &, int &)
A stub for identifying an individual at a location.
Definition: PopulationManager.h:593
Population_Manager_Base::m_ListNames
const char * m_ListNames[32]
A list of life-stage names.
Definition: PopulationManager.h:628
TALMaSSObject::BeginStep
virtual void BeginStep()
BeingStep behaviour - must be implemented in descendent classes.
Definition: PopulationManager.h:145
cfg_owl_breed_threshold
static CfgInt cfg_owl_breed_threshold("OWL_BT", CFG_CUSTOM, 5000000)
struct_Predator::y
int y
Definition: Predators.h:69
TPredator::SupplyKill
int SupplyKill()
Definition: Predators.h:135
TPredator_Population_Manager::PredSpringSample
void PredSpringSample()
Definition: Predators.cpp:423
TPredator_Population_Manager::DoAfter
virtual void DoAfter()
Definition: Predators.h:169
cfg_owl_StartingNo
static CfgInt cfg_owl_StartingNo("OWL_START_NO", CFG_CUSTOM, 0)
struct_Predator::PM
TPredator_Population_Manager * PM
Definition: Predators.h:72
owl_death_threshold
int owl_death_threshold
Definition: Predators.cpp:75
owl_breed_day
int owl_breed_day
Definition: Predators.cpp:77
TPredator_Population_Manager::inc_inds
void inc_inds(unsigned list)
Definition: Predators.h:155
Landscape::SupplyMonth
int SupplyMonth(void)
Passes a request on to the associated Calendar class function, returns m_month + 1 (the calendar mont...
Definition: Landscape.h:2272
TPredator_Population_Manager::PredAutumnSample
void PredAutumnSample()
Definition: Predators.cpp:360
Population_Manager::RipleysOutputPrb
ofstream * RipleysOutputPrb
Definition: PopulationManager.h:860
cfg_weasel_StartingNo
static CfgInt cfg_weasel_StartingNo("WEASEL_START_NO", CFG_CUSTOM, 0)
Population_Manager_Base::m_ListNameLength
int m_ListNameLength
the number of life-stages simulated in the population manager
Definition: PopulationManager.h:626
TPredator_Population_Manager::m_no_individuals
unsigned m_no_individuals[2]
Definition: Predators.h:163
struct_Predator::L
Landscape * L
Definition: Predators.h:71
struct_Predator
Used for creation of a new predator object.
Definition: Predators.h:65
cfg_weasel_breed_threshold
static CfgInt cfg_weasel_breed_threshold("WEASEL_BT", CFG_CUSTOM, 5)
TPredator::SupplySpeciesID
unsigned SupplySpeciesID()
Definition: Predators.h:134
weasel_breed_day
int weasel_breed_day
Definition: Predators.cpp:76
CfgBool::value
bool value() const
Definition: Configurator.h:164
Owl
The Owl class is one of two current implementations of TPredator.
Definition: Predators.h:207
Weasel
The Weasel class is one of two current implementations of TPredator.
Definition: Predators.h:186
Population_Manager_Base::m_TheLandscape
Landscape * m_TheLandscape
holds an internal pointer to the landscape
Definition: PopulationManager.h:624
TPredator_Population_Manager::PredSpringAutumnSample
void PredSpringAutumnSample()
Definition: Predators.cpp:486
TPredator::SupplyKillEff
int SupplyKillEff()
Definition: Predators.h:137
Population_Manager_Base::SimH
int SimH
stores the simulation height
Definition: PopulationManager.h:614
TPredator_Population_Manager::DoLast
virtual void DoLast()
Definition: Predators.h:170
Landscape::SupplyDayInMonth
int SupplyDayInMonth(void)
Passes a request on to the associated Calendar class function, returns m_day_in_month
Definition: Landscape.h:2277
Landscape::SupplySimAreaHeight
int SupplySimAreaHeight(void)
Gets the simulation landscape height.
Definition: Landscape.h:2302
Landscape::SupplySimAreaWidth
int SupplySimAreaWidth(void)
Gets the simulation landscape width.
Definition: Landscape.h:2297
cfg_owl_breed_day
static CfgInt cfg_owl_breed_day("OWL_BD", CFG_CUSTOM, 120)
Landscape::SupplyDayInYear
int SupplyDayInYear(void)
Passes a request on to the associated Calendar class function, the day in the year.
Definition: Landscape.h:2267
weasel_death_threshold
int weasel_death_threshold
Definition: Predators.cpp:74
TPredator::SupplyTerr
bool SupplyTerr()
Definition: Predators.h:136
TOP_Predators
Definition: PopulationManager.h:80
Landscape::SupplyYearNumber
int SupplyYearNumber(void)
Passes a request on to the associated Calendar class function, returns m_simulationyear
Definition: Landscape.h:2287
CfgInt::value
int value() const
Definition: Configurator.h:116
Population_Manager_Base::SimW
int SimW
stores the simulation width
Definition: PopulationManager.h:616
TALMaSSObject::GetCurrentStateNo
int GetCurrentStateNo() const
Returns the current state number.
Definition: PopulationManager.h:137
TPredator_Population_Manager::CreateObjects
void CreateObjects(int ob_type, TAnimal *pvo, struct_Predator *data, int number)
Definition: Predators.cpp:136
cfg_weasel_breed_day
static CfgInt cfg_weasel_breed_day("WEASEL_BD", CFG_CUSTOM, 115)
cfg_PredSampleDataUsed
static CfgBool cfg_PredSampleDataUsed("PRED_SAMPLE_DATA_USED", CFG_CUSTOM, false)
TALMaSSObject::GetStepDone
bool GetStepDone() const
Returns the step done indicator flag.
Definition: PopulationManager.h:141
cfg_weasel_death_threshold
static CfgInt cfg_weasel_death_threshold("WEASEL_DT", CFG_CUSTOM, 10)
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
TPredator::SupplyHomeRange
int SupplyHomeRange()
Definition: Predators.h:138
TPredator_Population_Manager::StepFinished
virtual bool StepFinished()
Methods to run the simulations.
Definition: Predators.cpp:654
g_random_fnc
int g_random_fnc(const int a_range)
Definition: ALMaSS_Random.cpp:74
TPredator_Population_Manager::DoBefore
virtual void DoBefore()
Definition: Predators.h:168
Population_Manager::PushIndividual
void PushIndividual(const unsigned a_listindex, TAnimal *a_individual_ptr)
Definition: PopulationManager.cpp:1682
TPredator_Population_Manager::PredSampleFile
void PredSampleFile()
Definition: Predators.cpp:160
weasel_breed_threshold
int weasel_breed_threshold
Definition: Predators.cpp:72
Population_Manager::SupplyListSize
unsigned SupplyListSize(unsigned listindex) const
Definition: PopulationManager.h:726
WEASEL
#define WEASEL
Definition: Predators.cpp:48
Population_Manager::Population_Manager
Population_Manager(Landscape *a_l_ptr, int a_numberLifeStages=12)
Definition: PopulationManager.cpp:200
Population_Manager::ReallyBigOutputPrb
ofstream * ReallyBigOutputPrb
Definition: PopulationManager.h:873
struct_Predator::x
int x
Definition: Predators.h:68
TPredator_Population_Manager::m_Prey
Vole_Population_Manager * m_Prey
Definition: Predators.h:161
Landscape::Warn
void Warn(std::string a_msg1, std::string a_msg2)
Wrapper for the g_msg Warn function.
Definition: Landscape.h:2250
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_pred_first_sample_day
static CfgInt cfg_pred_first_sample_day("PRED_SAMPLE_FILE_DAY_ONE", CFG_CUSTOM, 109)
owl_StartingNo
int owl_StartingNo
Definition: Predators.cpp:78