ALMaSS Hare ODDox  1.1
The hare model description following ODdox protocol
THare_Population_Manager Class Reference

The class that handles all the population lists for hares. More...

#include <Hare_all.h>

Public Member Functions

void AddHareDensity (int x, int y, Hare_Object a_type)
 Density function - adds one to the density in the square containing by x,y. Each square is 256x256m in size. More...
 
void BodyBurdenOut (int a_year, int a_day, double a_bb, double a_mgkg)
 BodyBurden output. More...
 
void CreateObjects (int ob_type, TAnimal *pvo, void *null, struct_Hare *data, int number)
 Method used to create new hares. More...
 
int GetAdultDensity (int x, int y)
 Density function - returns the density of adults in the square containing by x,y. Each square is 256x256m in size. More...
 
int GetDelayedAdultDensity (int x, int y)
 Density function - returns the density of adults in the square containing by x,y, but for last year at this time. Each square is 256x256m in size. More...
 
int GetFemaleDensity (int x, int y)
 Density function - returns the density of females in the square containing by x,y. Each square is 256x256m in size. More...
 
double GetGrowthEfficiency (int a_age)
 Get the growth efficiency for this a_age. More...
 
double GetGrowthEfficiencyF (int a_age)
 Get the growth efficiency for this a_age for creating fat. More...
 
double GetGrowthEfficiencyP (int a_age)
 Get the growth efficiency for this a_age for creating protein. More...
 
int GetHareRefNum ()
 Get the next ID number available. More...
 
int GetInfantDensity (int x, int y)
 Density function - returns the density of infants in the square containing by x,y. Each square is 256x256m in size. More...
 
double GetInterference (int h)
 Return the proportion of time used in communicating with con-specifics. More...
 
int GetJuvenileDensity (int x, int y)
 Density function - returns the density of juveniles in the square containing by x,y. Each square is 256x256m in size. More...
 
double GetKJperM (int a_size)
 Get the cost of moving 1m in KJ dependent upon mass (. More...
 
int GetLitterSize (int noLitters)
 Returns the litter size. More...
 
int GetMaleDensity (int x, int y)
 Density function - returns the density of males in the square containing by x,y. Each square is 256x256m in size. More...
 
double GetMaxDailyGrowthEnergy (int a_age)
 
double GetMaxDailyGrowthEnergyF (int a_age)
 Get the maximum daily energy needed for growth for this a_age for use in fat construction. More...
 
double GetMaxDailyGrowthEnergyP (int a_age)
 Get the maximum daily energy needed for growth for this a_age for use in protein construction. More...
 
double GetPolyFood (int a_poly)
 Get stored polygon food quality. More...
 
double GetRMR (int a_age, double a_size)
 Returns the RMR given a specific age and mass. More...
 
int GetTotalDensity (int x, int y)
 Density function - returns the density of all hares in the square containing by x,y. Each square is 256x256m in size. More...
 
int GetYoungDensity (int x, int y)
 Density function - returns the density of young in the square containing by x,y. Each square is 256x256m in size. More...
 
void SetPolyFood (int a_poly, double a_value)
 Set polygon food quality. More...
 
void SubtractHareDensity (int x, int y, Hare_Object a_type)
 Density function - subtracts one from the density in the square containing by x,y. Each square is 256x256m in size. More...
 
 THare_Population_Manager (Landscape *L)
 This is the constructor for the hare population manager. More...
 
virtual void TheAOROutputProbe ()
 Output method. More...
 
virtual ~THare_Population_Manager (void)
 THare_Population_Manager destructor. More...
 
- Public Member Functions inherited from Population_Manager
bool BeginningOfMonth ()
 
virtual void BreedingPairsOutput (int)
 
virtual void BreedingSuccessProbeOutput (double, int, int, int, int, int, int, int)
 
virtual void Catastrophe (int)
 
bool CheckXY (int l, int i)
 Debug method to test for out of bounds coordinates. More...
 
void CloseTheMonthlyRipleysOutputProbe ()
 
virtual void CloseTheReallyBigOutputProbe ()
 
virtual void CloseTheRipleysOutputProbe ()
 
virtual void DisplayLocations ()
 
unsigned int FarmAnimalCensus (unsigned int a_farm, unsigned int a_typeofanimal)
 
TAnimalFindClosest (int x, int y, unsigned Type)
 
virtual void FledgelingProbeOutput (int, int)
 
virtual void GeneticsResultsOutput (FILE *, unsigned)
 
unsigned GetLiveArraySize (int a_listindex)
 Gets the number of 'live' objects for a list index in the TheArray. More...
 
TTypesOfPopulation GetPopulationType ()
 
int GetSeasonNumber ()
 Get the season number. More...
 
virtual void ImpactedProbe ()
 
void ImpactProbeReport (int a_Time)
 
void IncLiveArraySize (int a_listindex)
 Increments the number of 'live' objects for a list index in the TheArray. More...
 
bool IsLast (unsigned listindex)
 
void LamdaBirth (int x, int y)
 
void LamdaBirth (int x, int y, int z)
 
void LamdaClear ()
 
void LamdaDeath (int x, int y)
 
void LamdaDumpOutput ()
 
void LOG (const char *fname)
 
void OpenTheAOROutputProbe (string a_AORFilename)
 
virtual bool OpenTheBreedingPairsProbe ()
 
virtual bool OpenTheBreedingSuccessProbe ()
 
virtual bool OpenTheFledgelingProbe ()
 
bool OpenTheMonthlyRipleysOutputProbe ()
 
bool OpenTheReallyBigProbe ()
 
bool OpenTheRipleysOutputProbe (string a_NWordFilename)
 
 Population_Manager (Landscape *L)
 
virtual float Probe (int ListIndex, probe_data *p_TheProbe)
 
int ProbeFileInput (char *p_Filename, int p_ProbeNo)
 
char * ProbeReport (int a_time)
 
char * ProbeReportTimed (int a_time)
 
virtual void Run (int NoTSteps)
 
void SetNoProbes (int a_pn)
 
char * SpeciesSpecificReporting (int a_species, int a_time)
 
TAnimalSupplyAnimalPtr (int a_index, int a_animal)
 Returns the pointer indexed by a_index and a_animal. Note NO RANGE CHECK. More...
 
virtual int SupplyCovPosx (int)
 
virtual int SupplyCovPosy (int)
 
unsigned SupplyListIndexSize ()
 
const char * SupplyListName (int i)
 
int SupplyListNameLength ()
 
unsigned SupplyListSize (unsigned listindex)
 
virtual void SupplyLocXY (unsigned listindex, unsigned j, int &x, int &y)
 
virtual int SupplyPegPosx (int)
 
virtual int SupplyPegPosy (int)
 
int SupplySimH ()
 
int SupplySimW ()
 
int SupplyState (unsigned listindex, unsigned j)
 
const char * SupplyStateNames (int i)
 
unsigned SupplyStateNamesLength ()
 
int SupplyStepSize ()
 
virtual int TheBreedingFemalesProbe (int)
 
virtual int TheBreedingSuccessProbe (int &, int &, int &, int &, int &, int &)
 
virtual int TheFledgelingProbe ()
 
virtual void TheGeneticProbe (unsigned, int, unsigned &)
 
virtual void TheReallyBigOutputProbe ()
 
virtual ~Population_Manager (void)
 

Public Attributes

double m_AdultMortRate
 Input variable - Adult mortality rate. More...
 
double m_DMWeight [5001]
 Array for storing minimum acceptable size with age. More...
 
float m_GoodYearBadYear
 Variable for adding stochasticity. More...
 
int m_HareThresholdDD
 Input variable - Threshold density dependence level. More...
 
double m_JuvMortRate
 Input variable - Juvenile mortality rate. More...
 
double m_YoungMortRate
 Input variable - Young mortality rate. More...
 
- Public Attributes inherited from Population_Manager
int IndexArrayX [5][10000]
 
char m_SimulationName [255]
 
Landscapem_TheLandscape
 
bool ProbesSet
 
int SimH
 
unsigned SimHH
 
int SimW
 
unsigned SimWH
 
probe_dataTheProbe [100]
 

Protected Member Functions

void CalcLitterSize (double mean, double SD, int litter)
 
virtual void Catastrophe ()
 Annual global change in population numbers. More...
 
virtual void DoAlmostLast ()
 Called before clean-up of dead objects. More...
 
virtual void DoFirst ()
 The first method called of the new time-step. More...
 
virtual void DoLast ()
 The last method called before the new time-step starts. More...
 
void ExtraPopMort (void)
 An extra global mortality
More...
 
void Hunting (void)
 
void HuntingDifferentiatedBeetleBankArea (void)
 
void HuntingGrid (void)
 
void Init ()
 Sets up data structures and calculations prior to starting simulation. More...
 
void MRROutputs ()
 Special probe for data to be used in mark-release-recapture simulations. More...
 
void POMOutputs ()
 This method is called to dump the information needed for POM approaches. More...
 
virtual void TheRipleysOutputProbe (FILE *a_prb)
 Standard spatial output. More...
 
- Protected Member Functions inherited from Population_Manager
virtual void DoAfter ()
 
virtual void DoBefore ()
 
void EmptyTheArray ()
 Removes all objects from the TheArray by deleting them and clearing TheArray. More...
 
unsigned PartitionLiveDead (unsigned Type)
 
void Shuffle (unsigned Type)
 
void Shuffle_or_Sort (unsigned Type)
 
void SortState (unsigned Type)
 
void SortStateR (unsigned Type)
 
void SortX (unsigned Type)
 
void SortXIndex (unsigned Type)
 
void SortY (unsigned Type)
 
virtual bool StepFinished ()
 Overrides the population manager StepFinished - there is no chance that hunters do not finish a step behaviour. More...
 

Protected Attributes

FILE * BodyBurdenPrb
 
int m_DensityMap [8][200][200]
 Array storing densities measured in different ways
More...
 
double m_GrowthEfficiency [5001]
 Precalculated growth efficiency with size
More...
 
double m_GrowthEfficiencyF [5001]
 Precalculated growth efficiency for fat with size
More...
 
double m_GrowthEfficiencyP [5001]
 Precalculated growth efficiency for protein with size
More...
 
double m_Interference [2500]
 Array storing density-dependence effect with density
More...
 
double m_KJperM [7001]
 Precalculated cost of locomotion - KJ per m per kg
More...
 
int m_LitterSize [12][7]
 Storage for litter size distributions (not used in default config)
More...
 
double m_MaxDailyGrowthEnergy [5001]
 Precalculated max growth energy requirement with size
More...
 
double m_MaxDailyGrowthEnergyF [5001]
 Precalculated max growth energy requirement with size for fat
More...
 
double m_MaxDailyGrowthEnergyP [5001]
 Precalculated max growth energy requirement with size for protein
More...
 
double m_MortStochast
 Stochasticity around mortality parameters
More...
 
MRR_Datam_OurMRRData
 Data structure for MarkReleaseRecapture expts
More...
 
double * m_PolyFood
 Temporary storage
More...
 
int m_RefNums
 The last hare ID used
More...
 
double m_RMR [2][366]
 Precalculated RMR with age
More...
 
int m_shot
 Hunting Bag. More...
 
int m_variableDD
 Used to vary the density dependence each year
More...
 
- Protected Attributes inherited from Population_Manager
ofstream * AOROutputPrb
 
unsigned BeforeStepActions [12]
 
long int lamdagrid [2][257][257]
 
FILE * m_AlleleFreqsFile
 
AOR_Probe * m_AOR_Probe
 
int m_catastrophestartyear
 
FILE * m_EasyPopRes
 
FILE * m_GeneticsFile
 
unsigned m_ListNameLength
 
const char * m_ListNames [32]
 
vector< unsigned > m_LiveArraySize
 
int m_NoProbes
 
TTypesOfPopulation m_population_type
 
int m_SeasonNumber
 Holds the season number. Used when running goose and hunter sims. More...
 
int m_StepSize
 
FILE * ReallyBigOutputPrb
 
FILE * RipleysOutputPrb
 
FILE * RipleysOutputPrb1
 
FILE * RipleysOutputPrb10
 
FILE * RipleysOutputPrb11
 
FILE * RipleysOutputPrb12
 
FILE * RipleysOutputPrb2
 
FILE * RipleysOutputPrb3
 
FILE * RipleysOutputPrb4
 
FILE * RipleysOutputPrb5
 
FILE * RipleysOutputPrb6
 
FILE * RipleysOutputPrb7
 
FILE * RipleysOutputPrb8
 
FILE * RipleysOutputPrb9
 
const char * StateNames [100]
 
unsigned StateNamesLength
 
FILE * TestFile
 
FILE * TestFile2
 
vector< TListOfAnimalsTheArray
 

Detailed Description

The class that handles all the population lists for hares.

Definition at line 529 of file Hare_all.h.

Constructor & Destructor Documentation

◆ THare_Population_Manager()

THare_Population_Manager::THare_Population_Manager ( Landscape L)

This is the constructor for the hare population manager.

It simply dumps unnecessary lists from the main population record (TheArray), then calls Init which initialises the variables needed before running.

Definition at line 383 of file Hare_all.cpp.

384  : Population_Manager(L)
385 {
386  for (int i=0; i<5; i++)
387  {
388  TheArray.pop_back();
389  }
390  Init();
391 }

References Init(), and Population_Manager::TheArray.

◆ ~THare_Population_Manager()

THare_Population_Manager::~THare_Population_Manager ( void  )
virtual

THare_Population_Manager destructor.

Definition at line 366 of file Hare_all.cpp.

367 {
369  fclose(BodyBurdenPrb);
370  free(m_PolyFood);
371  delete m_OurMRRData;
372 }

References BodyBurdenPrb, m_OurMRRData, m_PolyFood, and THare::m_vegPalatability.

Member Function Documentation

◆ AddHareDensity()

void THare_Population_Manager::AddHareDensity ( int  x,
int  y,
Hare_Object  a_type 
)
inline

Density function - adds one to the density in the square containing by x,y. Each square is 256x256m in size.

Definition at line 641 of file Hare_all.h.

641 { m_DensityMap[a_type][x >> __DENSITYSHIFT][y >> __DENSITYSHIFT]++; }

References m_DensityMap.

Referenced by DoFirst(), and Hare_Juvenile::st_Dispersal().

◆ BodyBurdenOut()

void THare_Population_Manager::BodyBurdenOut ( int  a_year,
int  a_day,
double  a_bb,
double  a_mgkg 
)
inline

BodyBurden output.

Definition at line 723 of file Hare_all.h.

723  {
724  fprintf(BodyBurdenPrb, "%d\t%d\t%g\t%g\n", a_year, a_day, a_bb, a_mgkg);
725  }

References BodyBurdenPrb.

Referenced by Hare_Male::InternalPesticideHandlingAndResponse(), and Hare_Female::InternalPesticideHandlingAndResponse().

◆ CalcLitterSize()

void THare_Population_Manager::CalcLitterSize ( double  mean,
double  SD,
int  litter 
)
protected

Calculates probabilities out of 10000 that a litter of a certain size is obtained.
Assumes a normal distribution around mean and SD. NB - will give problems if the SD==0.0

Definition at line 709 of file Hare_all.cpp.

710 {
714  double P;
715  double Distribution[7];
716  double total=0;
717  // Max 6 leverets
718  if (mean<=0) {
719  for (int i=0; i<7; i++) {
720  m_LitterSize[index][i]=10000;
721  }
722  } else {
723  // (from Zar page 79).
724  for (int i=0; i<7; i++) {
725  P=(1.0/SD*sqrt(2*3.14159265) );
726  P*=exp(-1*(((i-mean)*(i-mean))/(2*SD*SD)));
727  Distribution[i]=P;
728  total+=P;
729  }
730  int last=0;
731  for (int i=0; i<7; i++) {
732  m_LitterSize[index][i]=(int)(floor(0.5+((Distribution[i]/total)*10000)+last));
733  last=m_LitterSize[index][i];
734  }
735  }
736 }

References m_LitterSize.

Referenced by Init().

◆ Catastrophe()

void THare_Population_Manager::Catastrophe ( void  )
protectedvirtual

Annual global change in population numbers.

Remove or add hares to the population on a certain day and year - used for theoretical scenarios & testing

Reimplemented from Population_Manager.

Definition at line 4046 of file Hare_all.cpp.

4046  {
4047  // First do we have the right day?
4048  int today = m_TheLandscape->SupplyDayInYear();
4049  if (today!=1) return;
4050  // First do we have the right year?
4052  if (year%cfg_pm_eventfrequency.value()!=0) return;
4053 
4054  THare* AH = NULL;
4055  // Now if the % decrease is higher or lower than 100 we need to do different things
4056  int esize=cfg_pm_eventsize.value();
4057  if (esize<100) {
4058  unsigned size2;
4059  size2 = GetLiveArraySize(hob_Juvenile);
4060  for ( unsigned j = 0; j < size2; j++ ) {
4061  if (random(100) > esize) {
4062  AH = dynamic_cast < THare * > ( TheArray[hob_Juvenile] [ j ] );
4063  AH->Dying(); // Kill it
4064  }
4065  }
4066  size2 = GetLiveArraySize(hob_Female);
4067  for ( unsigned j = 0; j < size2; j++ ) {
4068  if (random(100) > esize) {
4069  AH = dynamic_cast < THare * > ( TheArray[hob_Female] [ j ] );
4070  AH->Dying(); // Kill it
4071  }
4072  }
4073  size2 = GetLiveArraySize(hob_Male);
4074  for ( unsigned j = 0; j < size2; j++ ) {
4075  if (random(100) > esize) {
4076  AH = dynamic_cast < THare * > ( TheArray[hob_Male] [ j ] );
4077  AH->Dying(); // Kill it
4078  }
4079  }
4080  }
4081  else if (esize>100) {
4082 /*
4083  Not implemented or needed as of yet
4084 */
4085  }
4086  else return; // No change so do nothing
4087 }

References cfg_pm_eventfrequency, cfg_pm_eventsize, TAnimal::Dying(), Population_Manager::GetLiveArraySize(), hob_Female, hob_Juvenile, hob_Male, Population_Manager::m_catastrophestartyear, Population_Manager::m_TheLandscape, Landscape::SupplyDayInYear(), Landscape::SupplyYearNumber(), and Population_Manager::TheArray.

◆ CreateObjects()

void THare_Population_Manager::CreateObjects ( int  ob_type,
TAnimal pvo,
void *  null,
struct_Hare data,
int  number 
)

Method used to create new hares.

Creates new hare objects that have just been born, or because of changes of life-stage require the creation of a new object. Input data is passed in the struct_Hare
This is a very important method - each type of population manager has its own implementation. This is the method that must be called every time a new Hare object is created.

Definition at line 928 of file Hare_all.cpp.

930 {
931  Hare_Infant* new_Infant;
932  Hare_Young* new_Young;
933  Hare_Juvenile* new_Juvenile;
934  Hare_Female* new_Female;
935  Hare_Female* Mum;
936  Hare_Male* new_Male;
937  for (int i = 0; i < number; i++)
938  {
939  if (unsigned(TheArray[ob_type].size()) > GetLiveArraySize(ob_type)) {
940  // We need to reuse an object
941  if (ob_type == 0) // Infant
942  {
943  new_Infant = dynamic_cast<Hare_Infant*>(TheArray[ob_type][GetLiveArraySize(ob_type)]);
944  new_Infant->ReInit((*data));
945  Mum = dynamic_cast<Hare_Female*>(pvo);
946  if (Mum) new_Infant->SetMum(Mum);
947  new_Infant->SetWeight(data->weight);
948  if (Mum) Mum->AddYoung(new_Infant);
949  }
950  if (ob_type == 1) // Young
951  {
952  new_Young = dynamic_cast<Hare_Young*>(TheArray[ob_type][GetLiveArraySize(ob_type)]);
953  new_Young->ReInit((*data));
954  new_Young->SetMum(data->Mum); // NB Mum may be NULL - this is OK
955  THare* old_Young = (THare*)pvo;
956  if (data->Mum) {
957  data->Mum->UpdateYoung(old_Young, new_Young);
958  }
959  }
960  if (ob_type == 2) // Juvenile
961  {
962  new_Juvenile = dynamic_cast<Hare_Juvenile*>(TheArray[ob_type][GetLiveArraySize(ob_type)]);
963  new_Juvenile->ReInit((*data));
964  new_Juvenile->SetMum(NULL);
965  }
966  if (ob_type == 3) // Male
967  {
968  new_Male = dynamic_cast<Hare_Male*>(TheArray[ob_type][GetLiveArraySize(ob_type)]);
969  new_Male->ReInit((*data));
970  }
971  if (ob_type == 4) // Female
972  {
973  new_Female = dynamic_cast<Hare_Female*>(TheArray[ob_type][GetLiveArraySize(ob_type)]);
974  new_Female->ReInit((*data));
975  }
976  }
977  else {
978 
979  if (ob_type == 0) // Infant
980  {
981  new_Infant = new Hare_Infant(data->x, data->y, data->L, data->HM);
982  TheArray[ob_type].push_back(new_Infant);
983  Mum = dynamic_cast<Hare_Female*>(pvo);
984  if (Mum) new_Infant->SetMum(Mum);
985  new_Infant->SetWeight(data->weight);
986  if (Mum) Mum->AddYoung(new_Infant);
987  }
988  if (ob_type == 1) // Young
989  {
990  new_Young = new Hare_Young(data->x, data->y, data->L, data->HM,
991  data->weight);
992  new_Young->SetMum(data->Mum); // NB Mum may be NULL - this is OK
993  // *** DeBug ***
994  //new_Young->m_MyOldMum=data->oldMum;
995  THare* old_Young = (THare*)pvo;
996  if (data->Mum) {
997  data->Mum->UpdateYoung(old_Young, new_Young);
998  }
999  TheArray[ob_type].push_back(new_Young);
1000  }
1001  if (ob_type == 2) // Juvenile
1002  {
1003  new_Juvenile = new Hare_Juvenile(data->x, data->y, data->L,
1004  data->HM, data->weight);
1005  new_Juvenile->SetMum(NULL);
1006  // *** DeBug ***
1007  //new_Juvenile->m_MyOldMum=data->oldMum;
1008 
1009  TheArray[ob_type].push_back(new_Juvenile);
1010  }
1011  if (ob_type == 3) // Male
1012  {
1013  new_Male = new Hare_Male(data->x, data->y, data->L, data->HM,
1014  data->weight, data->age, data->RefNum);
1015  TheArray[ob_type].push_back(new_Male);
1016  }
1017  if (ob_type == 4) // Female
1018  {
1019  new_Female = new Hare_Female(data->x, data->y, data->L, data->HM,
1020  data->weight, data->age, data->RefNum);
1021  TheArray[ob_type].push_back(new_Female);
1022  }
1023  }
1024  IncLiveArraySize(ob_type);
1025  }
1026 }

References Hare_Female::AddYoung(), struct_Hare::age, Population_Manager::GetLiveArraySize(), struct_Hare::HM, Population_Manager::IncLiveArraySize(), struct_Hare::L, struct_Hare::Mum, struct_Hare::RefNum, Hare_Infant::ReInit(), Hare_Young::ReInit(), Hare_Juvenile::ReInit(), Hare_Male::ReInit(), Hare_Female::ReInit(), THare::SetMum(), Hare_Infant::SetMum(), Hare_Infant::SetWeight(), Population_Manager::TheArray, Hare_Female::UpdateYoung(), struct_Hare::weight, struct_Hare::x, and struct_Hare::y.

Referenced by Hare_Female::GiveBirth(), Init(), Hare_Infant::st_NextStage(), Hare_Young::st_NextStage(), and Hare_Juvenile::st_NextStage().

◆ DoAlmostLast()

void THare_Population_Manager::DoAlmostLast ( )
protectedvirtual

Called before clean-up of dead objects.

In this case this only applies hunting mortality. Needs to be done before objects are tidied up at the end of the time-step.

Reimplemented from Population_Manager.

Definition at line 907 of file Hare_all.cpp.

908 {
910  {
911  if (cfg_HareHuntingType.value()==1) HuntingGrid();
913  else Hunting();
914  }
915 }

References cfg_HareHuntingDate(), cfg_HareHuntingType(), Hunting(), HuntingDifferentiatedBeetleBankArea(), HuntingGrid(), Population_Manager::m_TheLandscape, and Landscape::SupplyDayInYear().

◆ DoFirst()

void THare_Population_Manager::DoFirst ( )
protectedvirtual

The first method called of the new time-step.

Does special start of step actions here. In this case optional changes to parameter values e.g. mortality rates, data outputs e.g. POMOutputs(), and clearing the forage food array.

Reimplemented from Population_Manager.

Definition at line 817 of file Hare_all.cpp.

818 {
819 #ifdef __EXTRAPOPMORT
820  ExtraPopMort();
821 #endif
822  if (m_TheLandscape->SupplyDayInYear()==1) {
823 
824 #ifdef __VARIABLEDD
825  m_variableDD=random(21);
826 #endif
827 #ifdef __YEARLYVARIABLEFOODQUALITY
828  m_GoodYearBadYear = (float) (1.0 + float(random(40)-20)/100.0);
829 #endif
830 #ifdef __MORTSTOCHASTICITY
831  double MortStochasticity = ((random(200)/100.0)-1.0)* m_MortStochast; // -1.0 to +1.0 * m_MortStochast
832  m_YoungMortRate = cfg_hare_young_predation.value() + (cfg_hare_young_predation.value()*(MortStochasticity)); //
833  m_JuvMortRate = cfg_hare_juvenile_predation.value()+ (cfg_hare_juvenile_predation.value()*(MortStochasticity)); //
834  m_AdultMortRate = cfg_hare_adult_predation.value()+ (cfg_hare_adult_predation.value()*(MortStochasticity)); //
835 #else
839 #endif
840  }
841  //else if (m_TheLandscape->SupplyDayInYear()==(cfg_HareHuntingDate.value()-1)) {
842  AnimalPosition HP;
843  for (unsigned listindex=0; listindex<2;listindex++) {
844  unsigned size = GetLiveArraySize(listindex);
845  for (unsigned j=0; j<size; j++)
846  {
847 
848  HP=TheArray[listindex][j]->SupplyPosition();
849  AddHareDensity(HP.m_x, HP.m_y, (Hare_Object) listindex);
850  }
851  }
852  for (unsigned listindex=2; listindex<TheArray.size();listindex++) {
853  unsigned size= GetLiveArraySize(listindex);
854  for (unsigned j=0; j<size; j++)
855  {
856  HP=TheArray[listindex][j]->SupplyPosition();
857  int x=HP.m_x>>__DENSITYSHIFT;
858  int y=HP.m_y>>__DENSITYSHIFT;
859  m_DensityMap[listindex][x][y]++;
860  m_DensityMap[5][x][y]++;
861  m_DensityMap[7][x][y]++;
862  }
863  }
865  for (int i=0; i<100; i++) {
866  for (int j=0; j<100; j++) {
867  m_DensityMap[6][i][j]=m_DensityMap[7][i][j]/365;
868  m_DensityMap[7][i][j]=0;
869  }
870  }
871  }
872 
873  if (m_TheLandscape->SupplyDayInYear() == (270))
874  {
875  POMOutputs();
876 #ifdef __STERILITY
877  unsigned size = GetLiveArraySize(hob_Female);
878  for (unsigned j = 0; j<size; j++) {
879  Hare_Female* HF;
880  HF = dynamic_cast<Hare_Female*>(TheArray[hob_Female][j]);
881  if (HF->GetAge() < 730) {
882  int test = int(g_rand_uni() * 10000);
883  if (HF->GetAge() < 730) {
884  if (test<cfg_hare_firstyearsterility.value()) HF->SetSterile();
885  }
886  else {
887  if (test<cfg_hare_femalesterility.value()) HF->SetSterile();
888  }
889  }
890  }
891 #endif
892  }
893 
894  // Now do clear the forage food array
895  for (int i=0; i<=m_TheLandscape->SupplyLargestPolyNumUsed(); i++) {
896  m_PolyFood [i]=-1;
897  }
898 }

References AddHareDensity(), cfg_hare_adult_predation(), cfg_hare_femalesterility(), cfg_hare_firstyearsterility(), cfg_hare_juvenile_predation(), cfg_hare_young_predation(), ExtraPopMort(), g_rand_uni, THare::GetAge(), Population_Manager::GetLiveArraySize(), hob_Female, m_AdultMortRate, m_DensityMap, m_GoodYearBadYear, m_JuvMortRate, m_MortStochast, m_PolyFood, Population_Manager::m_TheLandscape, m_variableDD, AnimalPosition::m_x, AnimalPosition::m_y, m_YoungMortRate, October, POMOutputs(), Hare_Female::SetSterile(), Landscape::SupplyDayInYear(), Landscape::SupplyLargestPolyNumUsed(), and Population_Manager::TheArray.

◆ DoLast()

void THare_Population_Manager::DoLast ( )
protectedvirtual

The last method called before the new time-step starts.

Called after EndStep and before the landscape turns for the next time-step.
Does special end of step actions here. In this case zeroing the density maps, optional debug and mark-release-recapture outputs

Reimplemented from Population_Manager.

Definition at line 763 of file Hare_all.cpp.

764 {
766 
767 // Do our special end of time step actions here
768  // Clear the old data
769  for (int i=0; i<100; i++) {
770  for (int j=0; j<100; j++) {
771  m_DensityMap[0][i][j]=0;
772  m_DensityMap[1][i][j]=0;
773  m_DensityMap[2][i][j]=0;
774  m_DensityMap[3][i][j]=0;
775  m_DensityMap[4][i][j]=0;
776  m_DensityMap[5][i][j]=0;
777  }
778  }
779 
780  //Special hare debugging test
781  //if (m_TheLandscape->SupplyDayInMonth()==1) {
782  /*
783  if (TheArray[hob_Female].size()>0) {
784  Hare_Female* HF;
785  HF = dynamic_cast<Hare_Female*>(TheArray[hob_Female][0]);
786  HF->dumpEnergy();
787  }
788  */
789  /*
790  FILE* hareweights=fopen(hareweights,"HareWeights.txt","a");
791  for (unsigned listindex=0; listindex<5; listindex++)
792  {
793  unsigned size=TheArray[listindex].size();
794  if (size>0) {
795  for (unsigned j=0; j<size; j++)
796  {
797  int age=dynamic_cast < THare * > ( TheArray[listindex][j] )->GetAge();
798  double w=dynamic_cast < THare * > ( TheArray[listindex][j] )->GetWeight();
799  int weight=int (floor(0.5+w));
800  fprintf(hareweights,"%i\t%i\n",age, weight);
801  }
802  }
803  }
804  fclose(hareweights);
805  // End special
806 */
807  MRROutputs();
808 }

References Population_Manager::DoLast(), m_DensityMap, and MRROutputs().

◆ ExtraPopMort()

void THare_Population_Manager::ExtraPopMort ( void  )
protected

An extra global mortality

Like Catastrophe() this just kills hares but always on Jan 1st.
Used for POM testing only.

Definition at line 4093 of file Hare_all.cpp.

4093  {
4094  THare* AH = NULL;
4095  // This version simply alters populations on 1st January
4096  int esize= random(50);
4097  // First do we have the right day?
4098  int today = m_TheLandscape->SupplyDayInYear();
4099  if (today!=1) return;
4100  // First do we have the right year?
4101  // First do we have the right year?
4102  int year = m_TheLandscape->SupplyYearNumber();
4103  if (year%1!=0) return;
4104  unsigned size2;
4105  size2 = GetLiveArraySize(hob_Juvenile);
4106  for ( unsigned j = 0; j < size2; j++ ) {
4107  if (random(100) < esize) {
4108  AH = dynamic_cast < THare * > ( TheArray[hob_Juvenile] [ j ] );
4109  AH->Dying(); // Kill it
4110  }
4111  }
4112  size2 = GetLiveArraySize(hob_Male);
4113  for ( unsigned j = 0; j < size2; j++ ) {
4114  if (random(100) < esize) {
4115  AH = dynamic_cast < THare * > ( TheArray[hob_Male] [ j ] );
4116  AH->Dying(); // Kill it
4117  }
4118  }
4119  size2 = GetLiveArraySize(hob_Female);
4120  for ( unsigned j = 0; j < size2; j++ ) {
4121  if (random(100) < esize) {
4122  AH = dynamic_cast < THare * > ( TheArray[hob_Female] [ j ] );
4123  AH->Dying(); // Kill it
4124  }
4125  }
4126 }

References TAnimal::Dying(), Population_Manager::GetLiveArraySize(), hob_Female, hob_Juvenile, hob_Male, Population_Manager::m_TheLandscape, Landscape::SupplyDayInYear(), Landscape::SupplyYearNumber(), and Population_Manager::TheArray.

Referenced by DoFirst().

◆ GetAdultDensity()

int THare_Population_Manager::GetAdultDensity ( int  x,
int  y 
)
inline

Density function - returns the density of adults in the square containing by x,y. Each square is 256x256m in size.

Definition at line 681 of file Hare_all.h.

682  {
683  return (m_DensityMap[hob_Male][x>>__DENSITYSHIFT][y>>__DENSITYSHIFT] + m_DensityMap[hob_Female][x>>__DENSITYSHIFT][y>>__DENSITYSHIFT]);
684  }

References hob_Female, hob_Male, and m_DensityMap.

Referenced by Hare_Juvenile::st_Dispersal(), Hare_Male::st_Foraging(), and Hare_Female::st_Foraging().

◆ GetDelayedAdultDensity()

int THare_Population_Manager::GetDelayedAdultDensity ( int  x,
int  y 
)
inline

Density function - returns the density of adults in the square containing by x,y, but for last year at this time. Each square is 256x256m in size.

Definition at line 689 of file Hare_all.h.

689  {
690  return m_DensityMap[6][x>>__DENSITYSHIFT][y>>__DENSITYSHIFT];
691  }

References m_DensityMap.

Referenced by Hare_Male::st_Foraging(), and Hare_Female::st_Foraging().

◆ GetFemaleDensity()

int THare_Population_Manager::GetFemaleDensity ( int  x,
int  y 
)
inline

Density function - returns the density of females in the square containing by x,y. Each square is 256x256m in size.

Definition at line 671 of file Hare_all.h.

671 { return m_DensityMap[hob_Female][x>>__DENSITYSHIFT][y>>__DENSITYSHIFT]; }

References hob_Female, and m_DensityMap.

◆ GetGrowthEfficiency()

double THare_Population_Manager::GetGrowthEfficiency ( int  a_age)
inline

Get the growth efficiency for this a_age.

Definition at line 590 of file Hare_all.h.

590  {
591 #ifdef __BOUNDSCHECK
592  if ((a_age<0) || (a_age>5000)) {
593  m_TheLandscape->Warn( "Hare GetGrowthEfficiency a_age out of bounds", NULL );
594  exit( 1 );
595  }
596 #endif
597  return m_GrowthEfficiency[a_age]; }

References m_GrowthEfficiency, Population_Manager::m_TheLandscape, and Landscape::Warn().

Referenced by Hare_Infant::st_Developing().

◆ GetGrowthEfficiencyF()

double THare_Population_Manager::GetGrowthEfficiencyF ( int  a_age)
inline

Get the growth efficiency for this a_age for creating fat.

Definition at line 614 of file Hare_all.h.

614  {
615 #ifdef __BOUNDSCHECK
616  if ((a_age<0) || (a_age>5000)) {
617  m_TheLandscape->Warn( "Hare m_GrowthEfficiencyF a_age out of bounds", NULL );
618  exit( 1 );
619  }
620 #endif
621  return m_GrowthEfficiencyF[a_age]; }

References m_GrowthEfficiencyF, Population_Manager::m_TheLandscape, and Landscape::Warn().

Referenced by Hare_Juvenile::st_Developing(), Hare_Male::st_Developing(), and Hare_Female::st_Developing().

◆ GetGrowthEfficiencyP()

double THare_Population_Manager::GetGrowthEfficiencyP ( int  a_age)
inline

Get the growth efficiency for this a_age for creating protein.

Definition at line 602 of file Hare_all.h.

602  {
603 #ifdef __BOUNDSCHECK
604  if ((a_age<0) || (a_age>5000)) {
605  m_TheLandscape->Warn( "Hare GetGrowthEfficiencyP a_age out of bounds", NULL );
606  exit( 1 );
607  }
608 #endif
609  return m_GrowthEfficiencyP[a_age]; }

References m_GrowthEfficiencyP, Population_Manager::m_TheLandscape, and Landscape::Warn().

Referenced by Hare_Young::st_Developing(), Hare_Juvenile::st_Developing(), Hare_Male::st_Developing(), and Hare_Female::st_Developing().

◆ GetHareRefNum()

int THare_Population_Manager::GetHareRefNum ( )
inline

Get the next ID number available.

Definition at line 548 of file Hare_all.h.

548 { return ++m_RefNums; }

References m_RefNums.

Referenced by THare::THareInit().

◆ GetInfantDensity()

int THare_Population_Manager::GetInfantDensity ( int  x,
int  y 
)
inline

Density function - returns the density of infants in the square containing by x,y. Each square is 256x256m in size.

Definition at line 651 of file Hare_all.h.

651 { return m_DensityMap[hob_Infant][x >> __DENSITYSHIFT][y >> __DENSITYSHIFT]; }

References hob_Infant, and m_DensityMap.

◆ GetInterference()

double THare_Population_Manager::GetInterference ( int  h)
inline

Return the proportion of time used in communicating with con-specifics.

Based on:
m_Interference[i]=exp(i*cfg_HareInterferenceConstant)

Definition at line 700 of file Hare_all.h.

700  {
701 #ifdef __BOUNDSCHECK
702  if ((h<0) || (h>2499)) {
703  m_TheLandscape->Warn( "Hare Interference range out of bounds", NULL );
704  exit( 1 );
705  }
706 #endif
707  return m_Interference[h]; //[m_variableDD];
708  }

References m_Interference, Population_Manager::m_TheLandscape, and Landscape::Warn().

Referenced by Hare_Infant::BeginStep(), Hare_Young::BeginStep(), Hare_Juvenile::BeginStep(), Hare_Juvenile::st_Dispersal(), Hare_Juvenile::st_Foraging(), Hare_Male::st_Foraging(), and Hare_Female::st_Foraging().

◆ GetJuvenileDensity()

int THare_Population_Manager::GetJuvenileDensity ( int  x,
int  y 
)
inline

Density function - returns the density of juveniles in the square containing by x,y. Each square is 256x256m in size.

Definition at line 661 of file Hare_all.h.

661 { return m_DensityMap[hob_Juvenile][x>>__DENSITYSHIFT][y>>__DENSITYSHIFT]; }

References hob_Juvenile, and m_DensityMap.

◆ GetKJperM()

double THare_Population_Manager::GetKJperM ( int  a_size)
inline

Get the cost of moving 1m in KJ dependent upon mass (.

Definition at line 626 of file Hare_all.h.

626  {
627 #ifdef __BOUNDSCHECK
628  if ((a_size<0) || (a_size>7000)) {
629  char sz[255];
630  _itoa(a_size,sz,10);
631  m_TheLandscape->Warn( "Hare GetKJperM a_size out of bounds", sz );
632  exit( 1 );
633  }
634 #endif
635  return m_KJperM[a_size]; }

References m_KJperM, Population_Manager::m_TheLandscape, and Landscape::Warn().

Referenced by Hare_Infant::BeginStep(), Hare_Young::BeginStep(), Hare_Juvenile::BeginStep(), Hare_Male::BeginStep(), Hare_Female::BeginStep(), and Hare_Female::Init().

◆ GetLitterSize()

int THare_Population_Manager::GetLitterSize ( int  litter)

Returns the litter size.

Uses a frequency distribution out of 0-9999 and 6 bins and returns one of the bins as the return based on a random number from 0-9999

Definition at line 744 of file Hare_all.cpp.

745 {
746  int testing=int(g_rand_uni()*10000);
747  for (int i=0; i<7; i++) {
748  if (testing<=m_LitterSize[litter][i]) return i;
749  }
750  // something wrong if the program gets to here
751  m_TheLandscape->Warn("THare_Population_Manager::GetLitterSize - litter size error",NULL);
752  exit(1);
753 }

References g_rand_uni, m_LitterSize, Population_Manager::m_TheLandscape, and Landscape::Warn().

◆ GetMaleDensity()

int THare_Population_Manager::GetMaleDensity ( int  x,
int  y 
)
inline

Density function - returns the density of males in the square containing by x,y. Each square is 256x256m in size.

Definition at line 666 of file Hare_all.h.

666 { return m_DensityMap[hob_Male][x>>__DENSITYSHIFT][y>>__DENSITYSHIFT]; }

References hob_Male, and m_DensityMap.

◆ GetMaxDailyGrowthEnergy()

double THare_Population_Manager::GetMaxDailyGrowthEnergy ( int  a_age)
inline

Get the maximum daily energy needed for growth for this a_age

Definition at line 552 of file Hare_all.h.

552  {
553 #ifdef __BOUNDSCHECK
554  if ((a_age<0) || (a_age>5000)) {
555  m_TheLandscape->Warn( "Hare GetMaxDailyGrowthEnergy a_age out of bounds", NULL );
556  exit( 1 );
557  }
558 #endif
559  return m_MaxDailyGrowthEnergy[a_age];
560  }

References m_MaxDailyGrowthEnergy, Population_Manager::m_TheLandscape, and Landscape::Warn().

Referenced by Hare_Female::DoLactation().

◆ GetMaxDailyGrowthEnergyF()

double THare_Population_Manager::GetMaxDailyGrowthEnergyF ( int  a_age)
inline

Get the maximum daily energy needed for growth for this a_age for use in fat construction.

Definition at line 578 of file Hare_all.h.

578  {
579 #ifdef __BOUNDSCHECK
580  if ((a_age<0) || (a_age>5000)) {
581  m_TheLandscape->Warn( "Hare GetMaxDailyGrowthEnergyF a_age out of bounds", NULL );
582  exit( 1 );
583  }
584 #endif
585  return m_MaxDailyGrowthEnergyF[a_age]; }

References m_MaxDailyGrowthEnergyF, Population_Manager::m_TheLandscape, and Landscape::Warn().

Referenced by Hare_Juvenile::st_Developing(), Hare_Male::st_Developing(), and Hare_Female::st_Developing().

◆ GetMaxDailyGrowthEnergyP()

double THare_Population_Manager::GetMaxDailyGrowthEnergyP ( int  a_age)
inline

Get the maximum daily energy needed for growth for this a_age for use in protein construction.

Definition at line 565 of file Hare_all.h.

565  {
566 #ifdef __BOUNDSCHECK
567  if ((a_age<0) || (a_age>5000)) {
568  m_TheLandscape->Warn( "Hare GetMaxDailyGrowthEnergyP a_age out of bounds", NULL );
569  exit( 1 );
570  }
571 #endif
572  return m_MaxDailyGrowthEnergyP[a_age];
573  }

References m_MaxDailyGrowthEnergyP, Population_Manager::m_TheLandscape, and Landscape::Warn().

Referenced by Hare_Infant::st_Developing(), Hare_Young::st_Developing(), Hare_Juvenile::st_Developing(), Hare_Male::st_Developing(), and Hare_Female::st_Developing().

◆ GetPolyFood()

double THare_Population_Manager::GetPolyFood ( int  a_poly)
inline

Get stored polygon food quality.

Definition at line 713 of file Hare_all.h.

713 { return m_PolyFood[a_poly]; }

References m_PolyFood.

Referenced by THare::ForageSquare(), and THare::ForageSquareP().

◆ GetRMR()

double THare_Population_Manager::GetRMR ( int  a_age,
double  a_size 
)

Returns the RMR given a specific age and mass.

RMR is weight dependent based on RMR=69.1*4.1868)w^0.808 (McNab 1988)
But affected by temperature. We assume that after 35days 1kg weight, that this effect is constant per kg

Definition at line 1034 of file Hare_all.cpp.

1034  {
1035  double a_temp = m_TheLandscape->SupplyTemp();
1036  if (a_temp>20.0) a_temp=20.0;
1037  double tempdiff=18.0-a_temp;// 18 is used because this was the value where Hacklander
1038  //started his expts - 20 is assumed thermoneutral point and
1039  // a linear relationship between these two
1040  // Adjust for rainfall - assume that if we have a rainfall of >5mm then the temp diff is maximum - removing this might help add variation to juvenile survivorship!
1041  double rainfall = m_TheLandscape->SupplyRain();
1042  if (rainfall>5.0) rainfall=5.0;
1043  tempdiff*=1.0+(rainfall*g_RMRrainFactor);
1044  //tempdiff*=1.0+((rainfall*rainfall*rainfall*g_RMRrainFactor)/25); // Gives a curve sloping up
1045 
1046 #ifdef __BOUNDSCHECK
1047  if (a_age<0) {
1048  m_TheLandscape->Warn( "Hare GetRMR a_age range out of bounds", NULL );
1049  exit( 1 );
1050  }
1051 #endif
1052  a_size/=1000.0;
1053  double RMR;
1054  if (a_age<37) {
1055  RMR=((tempdiff*m_RMR[0][a_age])+m_RMR[1][a_age])*(a_size);
1056  } else
1057  {
1058  a_age=36;
1059  RMR=(69.1*4.1868)*pow(a_size,0.808);
1060  RMR=RMR+(tempdiff*m_RMR[0][a_age]*a_size);
1061  }
1062  return RMR;
1063 }

References g_RMRrainFactor, m_RMR, Population_Manager::m_TheLandscape, Landscape::SupplyRain(), Landscape::SupplyTemp(), and Landscape::Warn().

Referenced by THare::EnergyBalance(), THare::GetRMR(), Hare_Infant::st_Developing(), and Hare_Young::st_Foraging().

◆ GetTotalDensity()

int THare_Population_Manager::GetTotalDensity ( int  x,
int  y 
)
inline

Density function - returns the density of all hares in the square containing by x,y. Each square is 256x256m in size.

Definition at line 676 of file Hare_all.h.

676 { return m_DensityMap[5][x>>__DENSITYSHIFT][y>>__DENSITYSHIFT]; }

References m_DensityMap.

Referenced by Hare_Infant::BeginStep(), Hare_Young::BeginStep(), Hare_Juvenile::BeginStep(), Hare_Male::BeginStep(), Hare_Female::BeginStep(), and HuntingGrid().

◆ GetYoungDensity()

int THare_Population_Manager::GetYoungDensity ( int  x,
int  y 
)
inline

Density function - returns the density of young in the square containing by x,y. Each square is 256x256m in size.

Definition at line 656 of file Hare_all.h.

656 { return m_DensityMap[hob_Young][x>>__DENSITYSHIFT][y>>__DENSITYSHIFT]; }

References hob_Young, and m_DensityMap.

◆ Hunting()

void THare_Population_Manager::Hunting ( void  )
protected

Takes a fixed proportion of the population (input variable), in the middle of the hunting season.

Definition at line 4131 of file Hare_all.cpp.

4131  {
4132  m_shot=0;
4133  double huntpercent=cfg_HareHunting.value();
4134  Hare_Juvenile* AJH = NULL;
4135  unsigned size2;
4136  size2 = GetLiveArraySize(hob_Young);
4137  for ( unsigned j = 0; j < size2; j++ ) {
4138  AJH = dynamic_cast < Hare_Juvenile * > ( TheArray[ hob_Juvenile ] [ j ] );
4139  if ( g_rand_uni()< huntpercent) {
4140  // Must check if it is already dead of some other cause - is so can't kill it again
4141  if (AJH->GetCurrentStateNo() != -1)
4142  {
4143  AJH->ON_Dead(); // Kill it
4144  m_shot++;
4145  }
4146  }
4147  }
4148  Hare_Male* AH = NULL;
4149  size2 = GetLiveArraySize(hob_Male);
4150  for ( unsigned j = 0; j < size2; j++ ) {
4151  AH = dynamic_cast < Hare_Male * > ( TheArray[ hob_Male ] [ j ] );
4152  if ( g_rand_uni()< huntpercent) {
4153  if (AH->GetCurrentStateNo() != -1)
4154  {
4155  AH->ON_Dead(); // Kill it
4156  m_shot++;
4157  }
4158  }
4159  }
4160  Hare_Female* AFH = NULL;
4161  size2 = GetLiveArraySize(hob_Female);
4162  for ( unsigned j = 0; j < size2; j++ ) {
4163  AFH = dynamic_cast < Hare_Female * > ( TheArray[ hob_Female ] [ j ] );
4164  if ( g_rand_uni()< huntpercent) {
4165  if (AFH->GetCurrentStateNo() != -1)
4166  {
4167  AFH->ON_Dead(); // Kill it
4168  m_shot++;
4169  }
4170  }
4171  }
4172 }

References cfg_HareHunting(), g_rand_uni, TALMaSSObject::GetCurrentStateNo(), Population_Manager::GetLiveArraySize(), hob_Female, hob_Juvenile, hob_Male, hob_Young, m_shot, Hare_Juvenile::ON_Dead(), Hare_Male::ON_Dead(), Hare_Female::ON_Dead(), and Population_Manager::TheArray.

Referenced by DoAlmostLast().

◆ HuntingDifferentiatedBeetleBankArea()

void THare_Population_Manager::HuntingDifferentiatedBeetleBankArea ( void  )
protected

Differential hunting inside a specific area designated as beetlebank addition area. Takes a fixed proportion of the population (input variable for inside and outside), in the middle of the hunting season

Definition at line 4178 of file Hare_all.cpp.

4178  {
4179  m_shot=0;
4180  int tx1 = cfg_BeetleBankMinX.value();
4181  int tx2 = cfg_BeetleBankMaxX.value();
4182  int ty1 = cfg_BeetleBankMinY.value();
4183  int ty2 = cfg_BeetleBankMaxY.value();
4184  double huntpercent_out, huntpercent_in;
4185  if (!cfg_BeetleBankInvert.value())
4186  {
4187  huntpercent_out =cfg_HareHunting.value();
4188  huntpercent_in =cfg_HareHuntingBeetleBankArea.value();
4189  }
4190  else
4191  {
4192  huntpercent_in =cfg_HareHunting.value();
4193  huntpercent_out =cfg_HareHuntingBeetleBankArea.value();
4194  }
4195  THare* AH = NULL;
4196  unsigned size2;
4197  for (int ind =hob_Juvenile; ind < hob_Foobar; ind++)
4198  {
4199  size2 = (unsigned)GetLiveArraySize(ind);
4200  for ( unsigned j = 0; j < size2; j++ )
4201  {
4202  AH = dynamic_cast < THare * > ( TheArray[ ind ] [ j ] );
4203  APoint xy = AH->SupplyPoint();
4204  if ((xy.m_x >= tx1) && (xy.m_y >= ty1) && (xy.m_x <= tx2) && (xy.m_y <= ty2))
4205  {
4206  if ( g_rand_uni()< huntpercent_in)
4207  {
4208  AH->ON_Dead(); // Kill it
4209  m_shot++;
4210  }
4211  } else
4212  {
4213  if ( g_rand_uni()< huntpercent_out)
4214  {
4215  AH->ON_Dead(); // Kill it
4216  m_shot++;
4217  }
4218  }
4219  }
4220  }
4221 }

References cfg_BeetleBankInvert, cfg_BeetleBankMaxX, cfg_BeetleBankMaxY, cfg_BeetleBankMinX, cfg_BeetleBankMinY, cfg_HareHunting(), cfg_HareHuntingBeetleBankArea(), g_rand_uni, Population_Manager::GetLiveArraySize(), hob_Foobar, hob_Juvenile, m_shot, THare::ON_Dead(), TAnimal::SupplyPoint(), and Population_Manager::TheArray.

Referenced by DoAlmostLast().

◆ HuntingGrid()

void THare_Population_Manager::HuntingGrid ( void  )
protected

Hunting version based on grid squares - hunting occurs only if there are enough hares in each grid square.
Density squares are 256x256m in size, so for each ca 1 square km we need 8x8 of these squares, if total numbers is greater than a threshold then we hunt.

Definition at line 4227 of file Hare_all.cpp.

4227  {
4228  int N;
4229  m_shot=0;
4230  for (int x=500; x<SimW; x+=1000) {
4231  for (int y=500; y<SimH; y+=1000) {
4232  // For each 1km square
4233  N=0;
4234  for (int xx=x-(256+128); xx<=x+(256+128); xx+=256) {
4235  for (int yy=y-(256+128); yy<=y+(256+128); yy+=256) {
4236  N+=GetTotalDensity(xx,yy);
4237  }
4238  }
4239  if (N>cfg_HareHuntingThreshold.value()) {
4240  double huntpercent=cfg_HareHunting.value();
4241  Hare_Juvenile* AJH = NULL;
4242  unsigned size2;
4243  size2 = GetLiveArraySize(hob_Juvenile);
4244  for ( unsigned j = 0; j < size2; j++ ) {
4245  AJH = dynamic_cast < Hare_Juvenile * > ( TheArray[ hob_Juvenile ] [ j ] );
4246  if ((AJH->Supply_m_Location_x() >=x-500) &&(AJH->Supply_m_Location_x()< x+500) && (AJH->Supply_m_Location_y() >=y-500) && (AJH->Supply_m_Location_y()< y+500)) {
4247  if ( g_rand_uni()< huntpercent) {
4248  if (AJH->GetCurrentStateNo() != -1) {
4249  AJH->ON_Dead(); // Kill it
4250  m_shot++;
4251  }
4252  }
4253  }
4254  }
4255  Hare_Male* AH = NULL;
4256  size2 = GetLiveArraySize(hob_Male);
4257  for ( unsigned j = 0; j < size2; j++ ) {
4258  AH = dynamic_cast < Hare_Male * > ( TheArray[ hob_Male ] [ j ] );
4259  if ((AH->Supply_m_Location_x() >=x-500) &&(AH->Supply_m_Location_x()< x+500) && (AH->Supply_m_Location_y() >=y-500) && (AH->Supply_m_Location_y()< y+500)) {
4260  if ( g_rand_uni()< huntpercent) {
4261  if (AH->GetCurrentStateNo() != -1) {
4262  AH->ON_Dead(); // Kill it
4263  m_shot++;
4264  }
4265  }
4266  }
4267  }
4268  Hare_Female* AFH = NULL;
4269  size2 = GetLiveArraySize(hob_Female);
4270  for ( unsigned j = 0; j < size2; j++ ) {
4271  AFH = dynamic_cast < Hare_Female * > ( TheArray[ hob_Female ] [ j ] );
4272  if ((AFH->Supply_m_Location_x() >=x-500) && (AFH->Supply_m_Location_x()< x+500) && (AFH->Supply_m_Location_y() >=y-500) && (AFH->Supply_m_Location_y()< y+500)) {
4273  if ( g_rand_uni()< huntpercent) {
4274  if (AFH->GetCurrentStateNo() != -1) {
4275  AFH->ON_Dead(); // Kill it
4276  m_shot++;
4277  }
4278  }
4279  }
4280  }
4281  }
4282  }
4283  }
4284 }

References cfg_HareHunting(), cfg_HareHuntingThreshold(), g_rand_uni, TALMaSSObject::GetCurrentStateNo(), Population_Manager::GetLiveArraySize(), GetTotalDensity(), hob_Female, hob_Juvenile, hob_Male, m_shot, Hare_Juvenile::ON_Dead(), Hare_Male::ON_Dead(), Hare_Female::ON_Dead(), Population_Manager::SimH, Population_Manager::SimW, TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), and Population_Manager::TheArray.

Referenced by DoAlmostLast().

◆ Init()

void THare_Population_Manager::Init ( )
protected

Sets up data structures and calculations prior to starting simulation.

Creates some hares in semi-sensible places.

open the probe

Set up before step action sorts This determines how we handle the arrays between steps

Load State Names - these are just used to tell us what the animal is doing in the GUI

Loads a data file giving max daily growth at age together with cost of that growth per g. These are up to day 365. After 365 the cost is constant and assumes only fat is added

Calculates RMR based on Hacklander - these are the thermoneutral values

Ensure zeros in the density map!

Intitialise the Pattern Oriented Modelling output file

Definition at line 402 of file Hare_all.cpp.

403 {
408  m_RefNums=0;
411  if ( cfg_RipleysOutput_used.value() ) {
413  }
414  if ( cfg_ReallyBigOutput_used.value() ) {
416  } else ReallyBigOutputPrb=0;
420  BodyBurdenPrb = fopen("HareBodyBurden.txt", "w");
421  if (!BodyBurdenPrb) {
422  g_msg->Warn(WARN_FILE, "Population_Manager::OpenBodyBurdenProbe(): ""Unable to open probe file", "HareBodyBurden.txt");
423  exit(1);
424  }
425  //-----------------------------------------------------------------------------
426  // Initialisation code for the hare population manager
427  strcpy(m_SimulationName,"Hare");
428  // Load List of Hare Classes
429  m_ListNames[0]="Infant";
430  m_ListNames[1]="Young";
431  m_ListNames[2]="Juvenile";
432  m_ListNames[3]="Male";
433  m_ListNames[4]="Female";
434  m_ListNameLength = 5;
436  // Create an instance of THare to set static members
437  THare* thare = new THare( 0, 0, m_TheLandscape, this );
438  thare->loadVegPalatability();
439  delete thare;
443  BeforeStepActions[0]=0; // 0 = Shuffle, 1 = SortX, 2 = SortY, 3 = do nothing
444  BeforeStepActions[1]=0; // 0 = Shuffle, 1 = SortX, 2 = SortY, 3 = do nothing
445  BeforeStepActions[2]=0; // 0 = Shuffle, 1 = SortX, 2 = SortY, 3 = do nothing
446  BeforeStepActions[3]=0; // 0 = Shuffle, 1 = SortX, 2 = SortY, 3 = do nothing
447  BeforeStepActions[4]=0; // 0 = Shuffle, 1 = SortX, 2 = SortY, 3 = do nothing
448 
452  StateNames[tohs_InitialState] = "Initial State";
453  StateNames[ tohs_NextStage ] = "Next Stage";
454  StateNames[ tohs_Developing ] = "Development";
455  StateNames[ tohs_Dispersal ] = "Dispersal";
456  StateNames[ tohs_Foraging ] = "Foraging";
457  StateNames[ tohs_Resting ] = "Resting";
458  StateNames[ tohs_Running ] = "Running";
459  StateNames[ tohs_ReproBehaviour ] = "ReprodBehaviour";
460  StateNames[ tohs_Dying ] = "Dying";
461 
462  // Deal with peg global
464  // Create some hares
465  // This is only used when the simulation starts and puts a starting number of
466  // hares in the landscape at random positions
467  //
468  struct_Hare* sp;
469  sp = new struct_Hare;
470  sp->HM = this;
471  sp->L = m_TheLandscape;
472  sp->age=365;
473  sp->weight=3800/3;
474  sp->RefNum=0;
475  bool b;
476  for (int i=0; i<cfg_hare_StartingNo.value(); i++)
477  {
478  do {
479  sp->x = random(SimW);
480  sp->y = random(SimH);
482  switch (te)
483  {
484  case tole_Building:
485  case tole_Freshwater:
486  case tole_FishFarm:
487  case tole_Pond:
488  case tole_River:
489  case tole_Saltwater:
490  case tole_Coast:
491  case tole_BareRock:
492  case tole_AmenityGrass:
493  case tole_Parkland:
494  case tole_UrbanNoVeg:
495  case tole_UrbanPark:
497  case tole_SandDune:
498  case tole_Copse:
499  case tole_MetalledPath:
500  case tole_Carpark:
501  case tole_Churchyard:
502  case tole_Stream:
503  case tole_HeritageSite:
504  b=false;
505  break;
506  default:
507  b=true;
508  }
509  }
510  while (!b);
511  CreateObjects(3,NULL,NULL,sp,1); // 3 = Males
512  }
513  for (int i=0; i<cfg_hare_StartingNo.value(); i++)
514  {
515  do {
516  sp->x = random(SimW);
517  sp->y = random(SimH);
519  switch (te)
520  {
521  case tole_Building:
522  case tole_Pond:
523  case tole_Freshwater:
524  case tole_FishFarm:
525  case tole_River:
526  case tole_Saltwater:
527  case tole_Coast:
528  case tole_BareRock:
529  case tole_AmenityGrass:
530  case tole_Parkland:
531  case tole_UrbanNoVeg:
532  case tole_UrbanPark:
534  case tole_SandDune:
535  case tole_Copse:
536  case tole_MetalledPath:
537  case tole_Carpark:
538  case tole_Churchyard:
539  case tole_Stream:
540  case tole_HeritageSite:
541  b=false;
542  break;
543  default:
544  b=true;
545  }
546  }
547  while (!b);
548  CreateObjects(4,NULL,NULL,sp,1); // 4 = Females
549  }
550  delete sp;
555  double weightDM, rmr, f0, f1,f2,protcost,fatcost, totalgrowthcost;
556  ifstream* HareDataFile = new ifstream("Hare_GrowthALMaSS_Input.txt", ios::in);
557  if (!HareDataFile->is_open()) {
558  // This is an error since we are running hares - so say so.
559  m_TheLandscape->Warn("THare_Population_Manager::Init - Hare_GrowthALMaSS_Input.txt is missing or in use", "");
560  exit(1);
561  }
562  else {
563  // File format: "Age" "Ing-free dmBW (g,dm)" "Protein W-gain (g,dm)" "Fat W-gain (g,dm)"
564  // "KJcost prot" "KJ cost fat" "Energy cost (kJ) to achieve BW gain " "resting energy kJ"
565  for (int i = 0; i<5000; i++) {
566  (*HareDataFile) >> f0 >> weightDM >> f1 >> f2 >> protcost >> fatcost >> totalgrowthcost >> rmr;
567  // These arrays are little wasteful of space because many are only really used for the first 36 days, but
568  // if this is a problem it can be fixed later CJT 12-09-2006
569  m_MaxDailyGrowthEnergyP[i] = protcost; // How much energy for protein growth max at age i
570  if (protcost>0) m_GrowthEfficiencyP[i] = f1 / protcost; // KJ per g protein at age i
571  else m_GrowthEfficiencyP[i] = 0;
572  m_MaxDailyGrowthEnergyF[i] = fatcost; // How much energy for fat growth max at age i
573  if (fatcost>0) m_GrowthEfficiencyF[i] = f2 / fatcost; // KJ per g fat at age i
574  else m_GrowthEfficiencyF[i] = 0;
575  // No 366 is in fact the value for day 366 and rest of life and is about adding only fat
576  m_MaxDailyGrowthEnergy[i] = totalgrowthcost;
577  m_GrowthEfficiency[i] = (f1 + f2) / totalgrowthcost;
578  m_DMWeight[i] = weightDM*cfg_min_growth_attain.value(); // Used to test for falling behind in growth
579  }
580  HareDataFile->close();
581  }
582 
586  m_RMR[0][0]=0;
587  m_RMR[1][0]=0;
588  /* OLD CODE
589  for (int i=1; i<7001; i++) {
590  m_RMR[i]=((3.8*pow((double(i)/(0.88*0.33)),-0.27))*20.1*24)*((double(i)/(0.88*0.33))/1000.0); // KJ/day See energetics notes
591  }
592  */
593  for (int i=1; i<=37; i++) {
594  m_RMR[0][i]=(-1.5658*i + 58.487); // Slope KJ/day/degree See energetics notes
595  m_RMR[1][i]=1525.4*pow(i,-0.3997); // KJ/day See energetics notes
596  }
597 
598 
599  // Energy for walking dependent upon weight KJ per m
600  for (int i=1; i<7001; i++) {
601  //m_KJperM[i]=(9.08*pow(((double (i)/(0.88*0.33))/1000.0),0.77344))*0.001; // KJ/M for each weight
602  double fi=3.75*i/1000.0; // Corrected for dw to ww + ingesta
603  // m_KJperM[i]=(10.7*pow(fi,-0.316)*fi)/1000.0;
604  m_KJperM[i] = (10.7*pow(fi, cfg_HareWalkingPowerConst.value())*fi) / 1000.0;
605  }
606  m_KJperM[0]=0.0;
607 
608  double mean=cfg_littersize_mean1.value();
609  double SD=cfg_littersize_SD1.value();
610  CalcLitterSize(mean,SD,0);
611 
612  mean=cfg_littersize_mean2.value();
613  SD=cfg_littersize_SD2.value();
614  CalcLitterSize(mean,SD,1);
615 
616  mean=cfg_littersize_mean3.value();
617  SD=cfg_littersize_SD3.value();
618  CalcLitterSize(mean,SD,2);
619 
620  mean=cfg_littersize_mean4.value();
621  SD=cfg_littersize_SD4.value();
622  CalcLitterSize(mean,SD,3);
623 
624  mean=cfg_littersize_mean5.value();
625  SD=cfg_littersize_SD5.value();
626  CalcLitterSize(mean,SD,4);
627 
628  mean=cfg_littersize_mean6.value();
629  SD=cfg_littersize_SD6.value();
630  CalcLitterSize(mean,SD,5);
631 
632  mean=cfg_littersize_mean7.value();
633  SD=cfg_littersize_SD7.value();
634  CalcLitterSize(mean,SD,6);
635 
636  mean=cfg_littersize_mean8.value();
637  SD=cfg_littersize_SD8.value();
638  CalcLitterSize(mean,SD,7);
639 
640  mean=cfg_littersize_mean9.value();
641  SD=cfg_littersize_SD9.value();
642  CalcLitterSize(mean,SD,8);
643 
644  mean=cfg_littersize_mean10.value();
645  SD=cfg_littersize_SD10.value();
646  CalcLitterSize(mean,SD,9);
647 
648  mean=cfg_littersize_mean11.value();
649  SD=cfg_littersize_SD11.value();
650  CalcLitterSize(mean,SD,10);
651 
652  mean=cfg_littersize_mean12.value();
653  SD=cfg_littersize_SD12.value();
654  CalcLitterSize(mean,SD,11);
655 
656  for (int i=1; i<2500; i++) {
658  }
659  m_Interference[0]=1.0;
660 
664  for (int i=0; i<200; i++) {
665  for (int j=0; j<200; j++) {
666  m_DensityMap[0][i][j]=0;
667  m_DensityMap[1][i][j]=0;
668  m_DensityMap[2][i][j]=0;
669  m_DensityMap[3][i][j]=0;
670  m_DensityMap[4][i][j]=0;
671  m_DensityMap[5][i][j]=0;
672  m_DensityMap[6][i][j]=0;
673  m_DensityMap[7][i][j]=0;
674  }
675  }
676  m_PolyFood = (double*)malloc(sizeof(double)* (1+m_TheLandscape->SupplyLargestPolyNumUsed()) );
677  if ( m_PolyFood == NULL ) {
678  g_msg->Warn( WARN_FILE, "HarePopulationManager::Init: Out of memory!", "" );
679  exit( 1 );
680  }
684  FILE* fp;
685  fp=fopen("LitterProduction.txt","w");
686  fclose(fp);
687  fp=fopen("EnergyCheck.txt","w");
688  fclose(fp);
689  fp=fopen("POM_Hare.txt","w");
690  fprintf(fp,"1) Timestep,\n");
691  fprintf(fp,"2-6) Population Size of add stages,\n");
692  fprintf(fp,"7) Females < 365 days old,\n");
693  fprintf(fp,"8) Females >=1 & < 2 yrs old,\n");
694  fprintf(fp,"9) Females >=2 & < 3 yrs old,\n");
695  fprintf(fp,"10) Females >=3 & < 4 yrs old,\n");
696  fprintf(fp,"11) Females >=4 & < 5 yrs old,\n");
697  fprintf(fp,"12) Females >=4 yrs old,\n");
698  fprintf(fp,"13) Mean bodyweight of females (dw),\n");
699  fprintf(fp,"14) variance in bodyweight,\n");
700  fclose(fp);
701  fp=fopen("POM_FemaleHareWeights.txt","w");
702  fclose(fp);
703  // Mortality variables
704  m_variableDD=10;
705  // MRR
706  m_OurMRRData = new MRR_Data;
707 }

References struct_Hare::age, Population_Manager::BeforeStepActions, BodyBurdenPrb, CalcLitterSize(), cfg_FarmIntensiveness(), cfg_FarmIntensivenessH(), cfg_hare_peg_inertia(), cfg_hare_StartingNo(), cfg_HareInterferenceConstant(), cfg_HareMortStochasticity(), cfg_HareThresholdDD(), cfg_HareWalkingPowerConst(), cfg_littersize_mean1(), cfg_littersize_mean10(), cfg_littersize_mean11(), cfg_littersize_mean12(), cfg_littersize_mean2(), cfg_littersize_mean3(), cfg_littersize_mean4(), cfg_littersize_mean5(), cfg_littersize_mean6(), cfg_littersize_mean7(), cfg_littersize_mean8(), cfg_littersize_mean9(), cfg_littersize_SD1(), cfg_littersize_SD10(), cfg_littersize_SD11(), cfg_littersize_SD12(), cfg_littersize_SD2(), cfg_littersize_SD3(), cfg_littersize_SD4(), cfg_littersize_SD5(), cfg_littersize_SD6(), cfg_littersize_SD7(), cfg_littersize_SD8(), cfg_littersize_SD9(), cfg_min_growth_attain(), cfg_ReallyBigOutput_used, cfg_RipleysOutput_used, cfg_RMRrainFactor(), cfg_VegHeightForageReduction(), CreateObjects(), g_FarmIntensiveness, g_FarmIntensivenessH, g_hare_peg_inertia, g_RMRrainFactor, g_VegHeightForageReduction, struct_Hare::HM, struct_Hare::L, THare::loadVegPalatability(), m_DensityMap, m_DMWeight, m_GrowthEfficiency, m_GrowthEfficiencyF, m_GrowthEfficiencyP, m_HareThresholdDD, m_Interference, m_KJperM, Population_Manager::m_ListNameLength, Population_Manager::m_ListNames, m_MaxDailyGrowthEnergy, m_MaxDailyGrowthEnergyF, m_MaxDailyGrowthEnergyP, m_MortStochast, m_OurMRRData, m_PolyFood, Population_Manager::m_population_type, m_RefNums, m_RMR, Population_Manager::m_SimulationName, Population_Manager::m_TheLandscape, m_variableDD, Population_Manager::OpenTheReallyBigProbe(), Population_Manager::OpenTheRipleysOutputProbe(), Population_Manager::ReallyBigOutputPrb, struct_Hare::RefNum, Population_Manager::SimH, Population_Manager::SimW, Population_Manager::StateNames, Landscape::SupplyElementType(), Landscape::SupplyLargestPolyNumUsed(), tohs_Developing, tohs_Dispersal, tohs_Dying, tohs_Foraging, tohs_InitialState, tohs_NextStage, tohs_ReproBehaviour, tohs_Resting, tohs_Running, tole_AmenityGrass, tole_BareRock, tole_Building, tole_BuiltUpWithParkland, tole_Carpark, tole_Churchyard, tole_Coast, tole_Copse, tole_FishFarm, tole_Freshwater, tole_HeritageSite, tole_MetalledPath, tole_Parkland, tole_Pond, tole_River, tole_Saltwater, tole_SandDune, tole_Stream, tole_UrbanNoVeg, tole_UrbanPark, TOP_Hare, Landscape::Warn(), struct_Hare::weight, struct_Hare::x, and struct_Hare::y.

Referenced by THare_Population_Manager().

◆ MRROutputs()

void THare_Population_Manager::MRROutputs ( )
protected

Special probe for data to be used in mark-release-recapture simulations.

What this has to do is to print to the MMR file the occurence if any of each animal that ever existed between two dates.
If that animal has been counted before then add to that animals line, otherwise create a new line.
Requires that each hare has a unique ID number.
NB this counts the population with zero error.

Definition at line 1232 of file Hare_all.cpp.

1232  {
1233  //
1234  // Step one - do we count today?
1236  int day=m_TheLandscape->SupplyDayInYear();
1237  if ((day!=cfg_MRR1.value()) && (day!=cfg_MRR2.value()) && (day!=cfg_MRR3.value()) && (day!=cfg_MRR4.value()) && (day!=cfg_MRR5.value())) return;
1238  // We want to count today
1239  // Loop through all Juvenile and Adult hares and put their details in the MRR data array
1240  unsigned size = GetLiveArraySize(hob_Juvenile);
1241  for (unsigned j=0; j<size; j++) { // Every other one, so assume 50% males
1242  Hare_Juvenile* HJ;
1243  HJ = dynamic_cast<Hare_Juvenile*>(TheArray[hob_Juvenile][j]);
1245  }
1246  size = GetLiveArraySize(hob_Female);
1247  for (unsigned j=0; j<size; j++) {
1248  Hare_Female* HF;
1249  HF = dynamic_cast<Hare_Female*>(TheArray[hob_Female][j]);
1251  }
1252  size= GetLiveArraySize(hob_Male);
1253  for (unsigned j=0; j<size; j++) {
1254  Hare_Male* HM;
1255  HM = dynamic_cast<Hare_Male*>(TheArray[hob_Male][j]);
1257  }
1258 
1259  // If we need to dump the results this time do this
1260  if ((day==cfg_MRR5.value() && (m_TheLandscape->SupplyYearNumber()==cfg_MRR_LastYear.value()))) m_OurMRRData->OutputToFile();
1262 }

References MRR_Data::AddEntry(), cfg_MRR1(), cfg_MRR2(), cfg_MRR3(), cfg_MRR4(), cfg_MRR5(), cfg_MRR_FirstYear(), cfg_MRR_LastYear(), Population_Manager::GetLiveArraySize(), THare::GetRefNum(), hob_Female, hob_Juvenile, hob_Male, MRR_Data::IncTrapping(), m_OurMRRData, Population_Manager::m_TheLandscape, MRR_Data::OutputToFile(), Landscape::SupplyDayInYear(), Landscape::SupplyYearNumber(), and Population_Manager::TheArray.

Referenced by DoLast().

◆ POMOutputs()

void THare_Population_Manager::POMOutputs ( )
protected

This method is called to dump the information needed for POM approaches.

The data dumped is variable dependent upon what is needed at the time. Contents vary from version to version.

Definition at line 1073 of file Hare_all.cpp.

1073  {
1074  //
1075  // Outputs are:
1076  // 1) Timestep
1077  // 2-6) Population Size of add stages
1078  // 7) Females < 2 yrs old
1079  // 8) Females >=2 & < 3 yrs old
1080  // 9) Females >=3 & < 4 yrs old
1081  // 10) Females >=4 & < 5 yrs old
1082  // 11) Females >=5 yrs old
1083  // 12) Mean bodyweight of females (dw)
1084  // 13) variance in bodyweight
1085  // 14) Mean yearlings
1086  // 14) Var yearlings
1087  // 16) m_shot
1088 
1089  int age0 = 0;
1090  int age1 = 0;
1091  int age2 = 0;
1092  int age3 = 0;
1093  int age4 = 0;
1094  int age5 = 0;
1095  int age6 = 0;
1096  int age7 = 0;
1097  double totweight = 0.0;
1098  double totweight2 = 0.0;
1099  double yearlingstotweight = 0.0;
1100  double yearlingstotweight2 = 0.0;
1101  FILE* POMOut = fopen("POM_Hare.txt", "a");
1102  FILE* POMOut2 = fopen("POM_FemaleHareWeights.txt", "a");
1103  if (!POMOut) {
1104  // something wrong if the program gets to here
1105  m_TheLandscape->Warn("THare_Population_Manager::POMOutputs - POM_Output.txt can't be opened", NULL);
1106  exit(1);
1107  }
1108  // Now sort out the data for the females
1109  int yearlingssize = 0;
1110  unsigned size = GetLiveArraySize(hob_Juvenile);
1111  for (unsigned j = 0; j<size; j += 2) { // Every other one, so assume 50% males
1112  Hare_Juvenile* HJ;
1113  HJ = dynamic_cast<Hare_Juvenile*>(TheArray[hob_Juvenile][j]);
1114  double bw = HJ->GetTotalWeight();
1115  if (bw>1000) {
1116  yearlingstotweight += bw; // This removes hares that are still almost leverets
1117  yearlingstotweight2 += (bw*bw);
1118  yearlingssize++;
1119  fprintf(POMOut2, "0\t%g\n", (float)bw);
1120  }
1121  }
1122  size = GetLiveArraySize(hob_Female);
1123  for (unsigned j = 0; j < size; j++) {
1124  Hare_Female* HF;
1125  HF = dynamic_cast<Hare_Female*>(TheArray[hob_Female][j]);
1126  double bw = HF->GetTotalWeight();
1127  if (HF->GetAge() < 365) {
1128  age0++;
1129  if (bw>333) {
1130  yearlingstotweight += bw; // This removes hares that are still almost leverets
1131  yearlingstotweight2 += (bw*bw);
1132  yearlingssize++;
1133  }
1134  fprintf(POMOut2, "0\t%g\n", (float)bw);
1135  }
1136  else {
1137  totweight += bw;
1138  totweight2 += (bw*bw);
1139  if (HF->GetAge() < 730) {
1140  age1++;
1141  fprintf(POMOut2, "1\t%g\n", (float)bw);
1142  }
1143  else if (HF->GetAge() < 1095) {
1144  age2++;
1145  fprintf(POMOut2, "2\t%g\n", (float)bw);
1146  }
1147  else if (HF->GetAge() < 1460) {
1148  age3++;
1149  fprintf(POMOut2, "3\t%g\n", (float)bw);
1150  }
1151  else if (HF->GetAge() < 1825) {
1152  age4++;
1153  fprintf(POMOut2, "4\t%g\n", (float)bw);
1154  }
1155  else if (HF->GetAge() < 2190) {
1156  age5++;
1157  fprintf(POMOut2, "5\t%g\n", (float)bw);
1158  }
1159  else if (HF->GetAge() < 2555) {
1160  age6++;
1161  fprintf(POMOut2, "6\t%g\n", (float)bw);
1162  }
1163  else {
1164  age7++;
1165  fprintf(POMOut2, "7\t%g\n", (float)bw);
1166  }
1167  }
1168  // Do the bodyweight stuff
1169  }
1170  double yearlingsvar = (yearlingstotweight2 - ((yearlingstotweight*yearlingstotweight) / double(yearlingssize))) / double(yearlingssize);
1171  double yearlingsmean = yearlingstotweight / double(yearlingssize);
1172  double var = (totweight2 - ((totweight*totweight) / double(size))) / double(size);
1173  double mean = totweight / double(size);
1174  float meanf = (float)mean;
1175  float varf = (float)var;
1176  float meany = (float)yearlingsmean;
1177  float vary = (float)yearlingsvar;
1178  /*
1179  // Lets test the density grid
1180  int den = 0;
1181  for (int i = 0; i < 200; i++)
1182  for (int j = 0; j < 200; j++)
1183  {
1184  for (int l = 0; l < hob_Foobar; l++)
1185  den += m_DensityMap[l][i][j];
1186  }
1187  */
1188  fprintf(POMOut, "%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%d\t%g\t%g\t%g\t%g\t%d\n", (int)m_TheLandscape->SupplyDayInYear(), GetLiveArraySize(hob_Infant), GetLiveArraySize(hob_Young), GetLiveArraySize(hob_Juvenile), GetLiveArraySize(hob_Male), GetLiveArraySize(hob_Female), age0, age1, age2, age3, age4, age5, age6, age7, meanf, varf, meany, vary, m_shot);
1189  fclose(POMOut);
1190  fclose(POMOut2);
1191 }

References THare::GetAge(), Population_Manager::GetLiveArraySize(), THare::GetTotalWeight(), hob_Female, hob_Infant, hob_Juvenile, hob_Male, hob_Young, m_shot, Population_Manager::m_TheLandscape, Landscape::SupplyDayInYear(), Population_Manager::TheArray, and Landscape::Warn().

Referenced by DoFirst().

◆ SetPolyFood()

void THare_Population_Manager::SetPolyFood ( int  a_poly,
double  a_value 
)
inline

Set polygon food quality.

Definition at line 718 of file Hare_all.h.

718 { m_PolyFood[a_poly]=a_value; }

References m_PolyFood.

Referenced by THare::ForageSquare(), and THare::ForageSquareP().

◆ SubtractHareDensity()

void THare_Population_Manager::SubtractHareDensity ( int  x,
int  y,
Hare_Object  a_type 
)
inline

Density function - subtracts one from the density in the square containing by x,y. Each square is 256x256m in size.

Definition at line 646 of file Hare_all.h.

646 { m_DensityMap[a_type][x >> __DENSITYSHIFT][y >> __DENSITYSHIFT]--; }

References m_DensityMap.

Referenced by Hare_Juvenile::st_Dispersal().

◆ TheAOROutputProbe()

void THare_Population_Manager::TheAOROutputProbe ( )
virtual

Output method.

Reimplemented from Population_Manager.

Definition at line 1217 of file Hare_all.cpp.

1217  {
1218  m_AOR_Probe->DoProbe(hob_Female);
1219 }

References hob_Female, and Population_Manager::m_AOR_Probe.

◆ TheRipleysOutputProbe()

void THare_Population_Manager::TheRipleysOutputProbe ( FILE *  a_prb)
protectedvirtual

Standard spatial output.

Special probe for data to be used in spatial statistics

Reimplemented from Population_Manager.

Definition at line 1198 of file Hare_all.cpp.

1198  {
1199  // Currently just counts females
1200  Hare_Female* FH;
1201  unsigned totalF= GetLiveArraySize(hob_Female);
1202  int x,y;
1205  fprintf(a_prb,"%d %d %d %d %d\n", 0,w ,0, h, totalF);
1206  for (unsigned j=0; j<totalF; j++) //adult females
1207  {
1208  FH=dynamic_cast<Hare_Female*>(TheArray[hob_Female][j]);
1209  x=FH->Supply_m_Location_x();
1210  y=FH->Supply_m_Location_y();
1211  fprintf(a_prb,"%d\t%d\n", x,y);
1212  }
1213  fflush(a_prb);
1214 }

References Population_Manager::GetLiveArraySize(), hob_Female, Population_Manager::m_TheLandscape, TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Landscape::SupplySimAreaHeight(), Landscape::SupplySimAreaWidth(), and Population_Manager::TheArray.

Member Data Documentation

◆ BodyBurdenPrb

FILE* THare_Population_Manager::BodyBurdenPrb
protected

Probe for pestidcide output/testing

Definition at line 790 of file Hare_all.h.

Referenced by BodyBurdenOut(), Init(), and ~THare_Population_Manager().

◆ m_AdultMortRate

double THare_Population_Manager::m_AdultMortRate

Input variable - Adult mortality rate.

Definition at line 734 of file Hare_all.h.

Referenced by DoFirst(), and THare::WasPredated().

◆ m_DensityMap

int THare_Population_Manager::m_DensityMap[8][200][200]
protected

◆ m_DMWeight

double THare_Population_Manager::m_DMWeight[5001]

Array for storing minimum acceptable size with age.

Definition at line 746 of file Hare_all.h.

Referenced by Init().

◆ m_GoodYearBadYear

float THare_Population_Manager::m_GoodYearBadYear

Variable for adding stochasticity.

Definition at line 742 of file Hare_all.h.

Referenced by DoFirst().

◆ m_GrowthEfficiency

double THare_Population_Manager::m_GrowthEfficiency[5001]
protected

Precalculated growth efficiency with size

Definition at line 776 of file Hare_all.h.

Referenced by GetGrowthEfficiency(), and Init().

◆ m_GrowthEfficiencyF

double THare_Population_Manager::m_GrowthEfficiencyF[5001]
protected

Precalculated growth efficiency for fat with size

Definition at line 784 of file Hare_all.h.

Referenced by GetGrowthEfficiencyF(), and Init().

◆ m_GrowthEfficiencyP

double THare_Population_Manager::m_GrowthEfficiencyP[5001]
protected

Precalculated growth efficiency for protein with size

Definition at line 782 of file Hare_all.h.

Referenced by GetGrowthEfficiencyP(), and Init().

◆ m_HareThresholdDD

int THare_Population_Manager::m_HareThresholdDD

Input variable - Threshold density dependence level.

Definition at line 750 of file Hare_all.h.

Referenced by Hare_Young::BeginStep(), Hare_Juvenile::BeginStep(), Init(), Hare_Juvenile::st_Foraging(), Hare_Male::st_Foraging(), and Hare_Female::st_Foraging().

◆ m_Interference

double THare_Population_Manager::m_Interference[2500]
protected

Array storing density-dependence effect with density

Definition at line 760 of file Hare_all.h.

Referenced by GetInterference(), and Init().

◆ m_JuvMortRate

double THare_Population_Manager::m_JuvMortRate

Input variable - Juvenile mortality rate.

Definition at line 730 of file Hare_all.h.

Referenced by Hare_Juvenile::BeginStep(), DoFirst(), and Hare_Juvenile::WasPredated().

◆ m_KJperM

double THare_Population_Manager::m_KJperM[7001]
protected

Precalculated cost of locomotion - KJ per m per kg

Definition at line 786 of file Hare_all.h.

Referenced by GetKJperM(), and Init().

◆ m_LitterSize

int THare_Population_Manager::m_LitterSize[12][7]
protected

Storage for litter size distributions (not used in default config)

Definition at line 766 of file Hare_all.h.

Referenced by CalcLitterSize(), and GetLitterSize().

◆ m_MaxDailyGrowthEnergy

double THare_Population_Manager::m_MaxDailyGrowthEnergy[5001]
protected

Precalculated max growth energy requirement with size

Definition at line 774 of file Hare_all.h.

Referenced by GetMaxDailyGrowthEnergy(), and Init().

◆ m_MaxDailyGrowthEnergyF

double THare_Population_Manager::m_MaxDailyGrowthEnergyF[5001]
protected

Precalculated max growth energy requirement with size for fat

Definition at line 780 of file Hare_all.h.

Referenced by GetMaxDailyGrowthEnergyF(), and Init().

◆ m_MaxDailyGrowthEnergyP

double THare_Population_Manager::m_MaxDailyGrowthEnergyP[5001]
protected

Precalculated max growth energy requirement with size for protein

Definition at line 778 of file Hare_all.h.

Referenced by GetMaxDailyGrowthEnergyP(), and Init().

◆ m_MortStochast

double THare_Population_Manager::m_MortStochast
protected

Stochasticity around mortality parameters

Definition at line 758 of file Hare_all.h.

Referenced by DoFirst(), and Init().

◆ m_OurMRRData

MRR_Data* THare_Population_Manager::m_OurMRRData
protected

Data structure for MarkReleaseRecapture expts

Definition at line 788 of file Hare_all.h.

Referenced by Init(), MRROutputs(), and ~THare_Population_Manager().

◆ m_PolyFood

double* THare_Population_Manager::m_PolyFood
protected

Temporary storage

Definition at line 768 of file Hare_all.h.

Referenced by DoFirst(), GetPolyFood(), Init(), SetPolyFood(), and ~THare_Population_Manager().

◆ m_RefNums

int THare_Population_Manager::m_RefNums
protected

The last hare ID used

Definition at line 754 of file Hare_all.h.

Referenced by GetHareRefNum(), and Init().

◆ m_RMR

double THare_Population_Manager::m_RMR[2][366]
protected

Precalculated RMR with age

Definition at line 772 of file Hare_all.h.

Referenced by GetRMR(), and Init().

◆ m_shot

int THare_Population_Manager::m_shot
protected

Hunting Bag.

Definition at line 756 of file Hare_all.h.

Referenced by Hunting(), HuntingDifferentiatedBeetleBankArea(), HuntingGrid(), and POMOutputs().

◆ m_variableDD

int THare_Population_Manager::m_variableDD
protected

Used to vary the density dependence each year

Definition at line 764 of file Hare_all.h.

Referenced by DoFirst(), and Init().

◆ m_YoungMortRate

double THare_Population_Manager::m_YoungMortRate

Input variable - Young mortality rate.

Definition at line 738 of file Hare_all.h.

Referenced by Hare_Infant::BeginStep(), Hare_Young::BeginStep(), and DoFirst().


The documentation for this class was generated from the following files:
cfg_littersize_SD12
static CfgFloat cfg_littersize_SD12("HARE_LITTERSIZE_SD_L", CFG_CUSTOM, 0.0)
tole_UrbanNoVeg
Definition: tole_declaration.h:78
Hare_Male::ReInit
void ReInit(struct_Hare a_data)
Male object reinitiation.
Definition: Hare_all.cpp:2675
struct_Hare::x
int x
Definition: Hare_all.h:137
tole_Saltwater
Definition: tole_declaration.h:66
THare_Population_Manager::CreateObjects
void CreateObjects(int ob_type, TAnimal *pvo, void *null, struct_Hare *data, int number)
Method used to create new hares.
Definition: Hare_all.cpp:928
THare::m_vegPalatability
static double * m_vegPalatability
Will hold and array of palatability for hare for each tov type. Most are 1, but unpalatable vegetatio...
Definition: Hare_all.h:318
THare_Population_Manager::m_MaxDailyGrowthEnergyF
double m_MaxDailyGrowthEnergyF[5001]
Precalculated max growth energy requirement with size for fat
Definition: Hare_all.h:780
Hare_Female::UpdateYoung
bool UpdateYoung(THare *a_old, THare *a_new)
Swap a young list pointer.
Definition: Hare_all.cpp:3823
tohs_NextStage
Definition: Hare_all.h:72
THare_Population_Manager::m_DensityMap
int m_DensityMap[8][200][200]
Array storing densities measured in different ways
Definition: Hare_all.h:762
Population_Manager::m_catastrophestartyear
int m_catastrophestartyear
Definition: PopulationManager.h:532
tole_Building
Definition: tole_declaration.h:62
Landscape::SupplyTemp
double SupplyTemp(void)
Definition: Landscape.h:1386
THare_Population_Manager::m_PolyFood
double * m_PolyFood
Temporary storage
Definition: Hare_all.h:768
cfg_HareHuntingType
CfgInt cfg_HareHuntingType("HARE_HUNTING_TYPE", CFG_CUSTOM, 0)
Population_Manager::DoLast
virtual void DoLast()
Definition: PopulationManager.cpp:530
tole_Freshwater
Definition: tole_declaration.h:64
cfg_hare_adult_predation
CfgFloat cfg_hare_adult_predation("HARE_ADULT_PREDATION", CFG_CUSTOM, 0.0023)
struct_Hare::y
int y
Definition: Hare_all.h:138
cfg_littersize_mean6
static CfgFloat cfg_littersize_mean6("HARE_LITTERSIZE_MEAN_F", CFG_CUSTOM, 1.72)
Landscape::SupplyElementType
TTypesOfLandscapeElement SupplyElementType(int a_polyref)
Definition: Landscape.h:1110
tole_Parkland
Definition: tole_declaration.h:77
Hare_Female::ON_Dead
virtual void ON_Dead()
The female is dead.
Definition: Hare_all.cpp:3956
cfg_hare_young_predation
static CfgFloat cfg_hare_young_predation("HARE_YOUNG_PREDATION", CFG_CUSTOM, 0.002)
hob_Female
Definition: Hare_all.h:61
tole_FishFarm
Definition: tole_declaration.h:102
THare_Population_Manager::m_DMWeight
double m_DMWeight[5001]
Array for storing minimum acceptable size with age.
Definition: Hare_all.h:746
hob_Foobar
Definition: Hare_all.h:62
Population_Manager::TheArray
vector< TListOfAnimals > TheArray
Definition: PopulationManager.h:534
tohs_Foraging
Definition: Hare_all.h:75
tole_Churchyard
Definition: tole_declaration.h:86
Population_Manager::m_population_type
TTypesOfPopulation m_population_type
Definition: PopulationManager.h:580
Population_Manager::Population_Manager
Population_Manager(Landscape *L)
Definition: PopulationManager.cpp:221
cfg_HareThresholdDD
CfgInt cfg_HareThresholdDD("HARE_THRESHOLDDD", CFG_CUSTOM, 5)
tohs_Resting
Definition: Hare_all.h:76
tohs_Developing
Definition: Hare_all.h:73
cfg_littersize_SD2
static CfgFloat cfg_littersize_SD2("HARE_LITTERSIZE_SD_B", CFG_CUSTOM, 0.957)
cfg_RipleysOutput_used
CfgBool cfg_RipleysOutput_used
cfg_BeetleBankMaxX
CfgInt cfg_BeetleBankMaxX
THare::GetRefNum
int GetRefNum()
Get the refnum for this hare.
Definition: Hare_all.h:419
THare_Population_Manager::m_GrowthEfficiencyF
double m_GrowthEfficiencyF[5001]
Precalculated growth efficiency for fat with size
Definition: Hare_all.h:784
tole_Copse
Definition: tole_declaration.h:82
cfg_MRR3
static CfgInt cfg_MRR3("HARE_MMRTHREE", CFG_CUSTOM, 999)
cfg_VegHeightForageReduction
CfgFloat cfg_VegHeightForageReduction("HARE_VEGHEIGHTFORAGEREDUCTION", CFG_CUSTOM, 0.0003)
cfg_hare_StartingNo
static CfgInt cfg_hare_StartingNo("HARE_START_NO", CFG_CUSTOM, 50)
THare_Population_Manager::m_MaxDailyGrowthEnergyP
double m_MaxDailyGrowthEnergyP[5001]
Precalculated max growth energy requirement with size for protein
Definition: Hare_all.h:778
struct_Hare::age
int age
Definition: Hare_all.h:139
cfg_BeetleBankInvert
CfgBool cfg_BeetleBankInvert
cfg_littersize_mean3
static CfgFloat cfg_littersize_mean3("HARE_LITTERSIZE_MEAN_C", CFG_CUSTOM, 2.514)
Population_Manager::ReallyBigOutputPrb
FILE * ReallyBigOutputPrb
Definition: PopulationManager.h:595
tole_BareRock
Definition: tole_declaration.h:75
THare_Population_Manager::m_AdultMortRate
double m_AdultMortRate
Input variable - Adult mortality rate.
Definition: Hare_all.h:734
cfg_littersize_SD5
static CfgFloat cfg_littersize_SD5("HARE_LITTERSIZE_SD_E", CFG_CUSTOM, 0.6415)
Hare_Young::ReInit
void ReInit(struct_Hare a_data)
Young object reinitiation.
Definition: Hare_all.cpp:1722
THare_Population_Manager::m_variableDD
int m_variableDD
Used to vary the density dependence each year
Definition: Hare_all.h:764
cfg_littersize_SD1
static CfgFloat cfg_littersize_SD1("HARE_LITTERSIZE_SD_A", CFG_CUSTOM, 0.685)
cfg_MRR1
static CfgInt cfg_MRR1("HARE_MMRONE", CFG_CUSTOM, 999)
g_FarmIntensivenessH
double g_FarmIntensivenessH
Definition: Hare_all.cpp:284
cfg_littersize_mean11
static CfgFloat cfg_littersize_mean11("HARE_LITTERSIZE_MEAN_K", CFG_CUSTOM, 1.72)
Population_Manager::OpenTheRipleysOutputProbe
bool OpenTheRipleysOutputProbe(string a_NWordFilename)
Definition: PopulationManager.cpp:757
Hare_Juvenile::ON_Dead
virtual void ON_Dead()
Definition: Hare_all.cpp:2654
THare_Population_Manager::m_LitterSize
int m_LitterSize[12][7]
Storage for litter size distributions (not used in default config)
Definition: Hare_all.h:766
THare_Population_Manager::AddHareDensity
void AddHareDensity(int x, int y, Hare_Object a_type)
Density function - adds one to the density in the square containing by x,y. Each square is 256x256m i...
Definition: Hare_all.h:641
Population_Manager::m_SimulationName
char m_SimulationName[255]
Definition: PopulationManager.h:513
AnimalPosition::m_x
unsigned m_x
Definition: PopulationManager.h:172
struct_Hare::Mum
Hare_Female * Mum
Definition: Hare_all.h:142
TOP_Hare
Definition: PopulationManager.h:64
cfg_hare_femalesterility
static CfgInt cfg_hare_femalesterility("HARE_FEMALESTERILITY", CFG_CUSTOM, 1401)
struct_Hare::HM
THare_Population_Manager * HM
Definition: Hare_all.h:141
Hare_Female
Class for female hares.
Definition: Hare_all.h:1040
Population_Manager::GetLiveArraySize
unsigned GetLiveArraySize(int a_listindex)
Gets the number of 'live' objects for a list index in the TheArray.
Definition: PopulationManager.h:433
TAnimal::Supply_m_Location_x
int Supply_m_Location_x()
Definition: PopulationManager.h:213
THare_Population_Manager::m_GrowthEfficiencyP
double m_GrowthEfficiencyP[5001]
Precalculated growth efficiency for protein with size
Definition: Hare_all.h:782
cfg_hare_firstyearsterility
static CfgInt cfg_hare_firstyearsterility("HARE_FIRSTYEARSTERILITY", CFG_CUSTOM, 769)
hob_Young
Definition: Hare_all.h:58
THare::loadVegPalatability
void loadVegPalatability(void)
Loads static member m_vegPalatability with data.
Definition: Hare_THare.cpp:116
TAnimal::Dying
virtual void Dying()
Definition: PopulationManager.h:266
g_hare_peg_inertia
double g_hare_peg_inertia
Definition: Hare_all.cpp:50
THare_Population_Manager::m_HareThresholdDD
int m_HareThresholdDD
Input variable - Threshold density dependence level.
Definition: Hare_all.h:750
THare_Population_Manager::m_KJperM
double m_KJperM[7001]
Precalculated cost of locomotion - KJ per m per kg
Definition: Hare_all.h:786
THare_Population_Manager::m_GoodYearBadYear
float m_GoodYearBadYear
Variable for adding stochasticity.
Definition: Hare_all.h:742
THare_Population_Manager::HuntingDifferentiatedBeetleBankArea
void HuntingDifferentiatedBeetleBankArea(void)
Definition: Hare_all.cpp:4178
MRR_Data::OutputToFile
void OutputToFile()
Definition: Hare_all.cpp:4340
Population_Manager::SimW
int SimW
Definition: PopulationManager.h:511
tole_Stream
Definition: tole_declaration.h:89
cfg_HareHunting
CfgFloat cfg_HareHunting("HARE_HUNTING", CFG_CUSTOM, 0.15)
cfg_pm_eventfrequency
CfgInt cfg_pm_eventfrequency
struct_Hare::RefNum
int RefNum
Definition: Hare_all.h:143
THare_Population_Manager::m_MortStochast
double m_MortStochast
Stochasticity around mortality parameters
Definition: Hare_all.h:758
Hare_Male::ON_Dead
virtual void ON_Dead()
Definition: Hare_all.cpp:3044
THare_Population_Manager::Init
void Init()
Sets up data structures and calculations prior to starting simulation.
Definition: Hare_all.cpp:402
cfg_BeetleBankMinY
CfgInt cfg_BeetleBankMinY
Population_Manager::m_AOR_Probe
AOR_Probe * m_AOR_Probe
Definition: PopulationManager.h:526
TAnimal::SupplyPoint
APoint SupplyPoint()
Definition: PopulationManager.h:209
cfg_HareMortStochasticity
CfgFloat cfg_HareMortStochasticity("HARE_MORTSTOCHASTICITY", CFG_CUSTOM, 1.0)
cfg_min_growth_attain
CfgFloat cfg_min_growth_attain("HARE_MINGROWTHATTAIN", CFG_CUSTOM, 0.475)
THare
The base class for all hare classes.
Definition: Hare_all.h:154
cfg_BeetleBankMinX
CfgInt cfg_BeetleBankMinX
THare_Population_Manager::ExtraPopMort
void ExtraPopMort(void)
An extra global mortality
Definition: Hare_all.cpp:4093
THare::SetMum
void SetMum(Hare_Female *)
Set the mother pointer. Reimplemented in Hare_Infant.
Definition: Hare_all.h:399
tole_Pond
Definition: tole_declaration.h:101
Landscape::SupplySimAreaHeight
int SupplySimAreaHeight(void)
Definition: Landscape.h:1637
Landscape::SupplySimAreaWidth
int SupplySimAreaWidth(void)
Definition: Landscape.h:1632
cfg_hare_juvenile_predation
static CfgFloat cfg_hare_juvenile_predation("HARE_JUVENILE_PREDATION", CFG_CUSTOM, 0.0016)
cfg_littersize_mean7
static CfgFloat cfg_littersize_mean7("HARE_LITTERSIZE_MEAN_G", CFG_CUSTOM, 2.17)
cfg_littersize_SD7
static CfgFloat cfg_littersize_SD7("HARE_LITTERSIZE_SD_G", CFG_CUSTOM, 0.955)
THare_Population_Manager::HuntingGrid
void HuntingGrid(void)
Definition: Hare_all.cpp:4227
struct_Hare::L
Landscape * L
Definition: Hare_all.h:140
g_VegHeightForageReduction
double g_VegHeightForageReduction
Used to scale access to crops for modern day farm intensiveness.
Definition: Hare_all.cpp:282
Hare_Infant::SetWeight
void SetWeight(double w)
Set the weight.
Definition: Hare_all.h:851
cfg_HareHuntingThreshold
CfgInt cfg_HareHuntingThreshold("HARE_HUNTING_THRESHOLD", CFG_CUSTOM, 0)
THare_Population_Manager::m_shot
int m_shot
Hunting Bag.
Definition: Hare_all.h:756
cfg_MRR_FirstYear
static CfgInt cfg_MRR_FirstYear("HARE_MRRFIRSTYEAR", CFG_CUSTOM, 10000)
cfg_littersize_SD3
static CfgFloat cfg_littersize_SD3("HARE_LITTERSIZE_SD_C", CFG_CUSTOM, 0.955)
Hare_Female::SetSterile
void SetSterile()
Female is sterile.
Definition: Hare_all.h:1093
AnimalPosition
A class defining an animals position.
Definition: PopulationManager.h:168
cfg_HareHuntingBeetleBankArea
CfgFloat cfg_HareHuntingBeetleBankArea("HARE_HUNTING_BEETLEBANKAREA", CFG_CUSTOM, 0.95)
cfg_littersize_SD11
static CfgFloat cfg_littersize_SD11("HARE_LITTERSIZE_SD_K", CFG_CUSTOM, 0.6415)
Population_Manager::BeforeStepActions
unsigned BeforeStepActions[12]
Definition: PopulationManager.h:542
Hare_Infant
Class for infant hares (stationary, only milk inputs)
Definition: Hare_all.h:817
tole_UrbanPark
Definition: tole_declaration.h:79
cfg_HareWalkingPowerConst
CfgFloat cfg_HareWalkingPowerConst("HARE_WALKINGPOWERCONST", CFG_CUSTOM, -0.316)
THare_Population_Manager::POMOutputs
void POMOutputs()
This method is called to dump the information needed for POM approaches.
Definition: Hare_all.cpp:1073
THare::ON_Dead
virtual void ON_Dead(void)
Mortality - overridden in descendent classes.
Definition: Hare_all.h:424
MRR_Data::IncTrapping
void IncTrapping()
Definition: Hare_all.h:123
cfg_MRR_LastYear
static CfgInt cfg_MRR_LastYear("HARE_MRRLASTYEAR", CFG_CUSTOM, 0)
hob_Male
Definition: Hare_all.h:60
THare::GetAge
int GetAge()
Definition: Hare_all.h:377
Landscape::SupplyDayInYear
int SupplyDayInYear(void)
Definition: Landscape.h:1596
cfg_pm_eventsize
CfgInt cfg_pm_eventsize
cfg_littersize_SD6
static CfgFloat cfg_littersize_SD6("HARE_LITTERSIZE_SD_F", CFG_CUSTOM, 0.6415)
cfg_littersize_mean1
static CfgFloat cfg_littersize_mean1("HARE_LITTERSIZE_MEAN_A", CFG_CUSTOM, 1.535)
cfg_MRR2
static CfgInt cfg_MRR2("HARE_MMRTWO", CFG_CUSTOM, 999)
tohs_Dying
Definition: Hare_all.h:79
cfg_littersize_SD9
static CfgFloat cfg_littersize_SD9("HARE_LITTERSIZE_SD_I", CFG_CUSTOM, 0.6415)
Landscape::SupplyYearNumber
int SupplyYearNumber(void)
Definition: Landscape.h:1616
cfg_littersize_mean8
static CfgFloat cfg_littersize_mean8("HARE_LITTERSIZE_MEAN_H", CFG_CUSTOM, 1.72)
MRR_Data
Class for running mark-release-recapture experiments.
Definition: Hare_all.h:118
tole_MetalledPath
Definition: tole_declaration.h:84
Hare_Juvenile::ReInit
void ReInit(struct_Hare a_data)
Juvenile object reinitiation.
Definition: Hare_all.cpp:2225
Hare_Female::ReInit
void ReInit(struct_Hare a_data)
Female object reinitiation.
Definition: Hare_all.cpp:3123
tohs_InitialState
Definition: Hare_all.h:71
THare_Population_Manager::m_YoungMortRate
double m_YoungMortRate
Input variable - Young mortality rate.
Definition: Hare_all.h:738
THare_Population_Manager::m_RMR
double m_RMR[2][366]
Precalculated RMR with age
Definition: Hare_all.h:772
tole_SandDune
Definition: tole_declaration.h:81
cfg_HareInterferenceConstant
CfgFloat cfg_HareInterferenceConstant("HARE_INTERFERENCECONSTANT", CFG_CUSTOM,-0.03)
AnimalPosition::m_y
unsigned m_y
Definition: PopulationManager.h:173
tohs_ReproBehaviour
Definition: Hare_all.h:77
hob_Juvenile
Definition: Hare_all.h:59
THare_Population_Manager::m_JuvMortRate
double m_JuvMortRate
Input variable - Juvenile mortality rate.
Definition: Hare_all.h:730
cfg_RMRrainFactor
CfgFloat cfg_RMRrainFactor("HARE_RMRRAINFACTOR", CFG_CUSTOM, 0.47)
Hare_Young
Class for young hares (low mobility, milk and solid food inputs)
Definition: Hare_all.h:872
tole_River
Definition: tole_declaration.h:65
Hare_Male
Class for male hares.
Definition: Hare_all.h:976
Population_Manager::StateNames
const char * StateNames[100]
Definition: PopulationManager.h:531
cfg_littersize_mean5
static CfgFloat cfg_littersize_mean5("HARE_LITTERSIZE_MEAN_E", CFG_CUSTOM, 1.72)
THare_Population_Manager::BodyBurdenPrb
FILE * BodyBurdenPrb
Definition: Hare_all.h:790
THare_Population_Manager::MRROutputs
void MRROutputs()
Special probe for data to be used in mark-release-recapture simulations.
Definition: Hare_all.cpp:1232
cfg_MRR5
static CfgInt cfg_MRR5("HARE_MMRFIVE", CFG_CUSTOM, 270)
Hare_Infant::ReInit
void ReInit(struct_Hare a_data)
Infant object reinitiation.
Definition: Hare_all.cpp:1276
cfg_FarmIntensiveness
CfgFloat cfg_FarmIntensiveness("HARE_FARMINTENSIVENESS", CFG_CUSTOM, 0.01)
Landscape::SupplyRain
double SupplyRain(void)
Definition: Landscape.h:1365
Population_Manager::m_TheLandscape
Landscape * m_TheLandscape
Definition: PopulationManager.h:515
cfg_littersize_mean9
static CfgFloat cfg_littersize_mean9("HARE_LITTERSIZE_MEAN_I", CFG_CUSTOM, 1.72)
Hare_Object
Hare_Object
Definition: Hare_all.h:56
Population_Manager::OpenTheReallyBigProbe
bool OpenTheReallyBigProbe()
Definition: PopulationManager.cpp:859
cfg_ReallyBigOutput_used
CfgBool cfg_ReallyBigOutput_used
cfg_HareHuntingDate
CfgInt cfg_HareHuntingDate("HARE_HUNTING_DATE", CFG_CUSTOM, 312)
struct_Hare
Class used to pass hare information to CreateObjects.
Definition: Hare_all.h:134
hob_Infant
Definition: Hare_all.h:57
Population_Manager::SimH
int SimH
Definition: PopulationManager.h:511
Population_Manager::m_ListNameLength
unsigned m_ListNameLength
Definition: PopulationManager.h:538
THare_Population_Manager::CalcLitterSize
void CalcLitterSize(double mean, double SD, int litter)
Definition: Hare_all.cpp:709
TALMaSSObject::GetCurrentStateNo
int GetCurrentStateNo()
Returns the current state number.
Definition: PopulationManager.h:121
TTypesOfLandscapeElement
TTypesOfLandscapeElement
Definition: tole_declaration.h:36
THare_Population_Manager::Hunting
void Hunting(void)
Definition: Hare_all.cpp:4131
TAnimal::Supply_m_Location_y
int Supply_m_Location_y()
Definition: PopulationManager.h:216
g_FarmIntensiveness
double g_FarmIntensiveness
Definition: Hare_all.cpp:283
THare_Population_Manager::m_OurMRRData
MRR_Data * m_OurMRRData
Data structure for MarkReleaseRecapture expts
Definition: Hare_all.h:788
cfg_littersize_SD10
static CfgFloat cfg_littersize_SD10("HARE_LITTERSIZE_SD_J", CFG_CUSTOM, 0.6415)
THare_Population_Manager::m_MaxDailyGrowthEnergy
double m_MaxDailyGrowthEnergy[5001]
Precalculated max growth energy requirement with size
Definition: Hare_all.h:774
tole_HeritageSite
Definition: tole_declaration.h:90
cfg_littersize_mean12
static CfgFloat cfg_littersize_mean12("HARE_LITTERSIZE_MEAN_L", CFG_CUSTOM, 0.0)
cfg_littersize_mean2
static CfgFloat cfg_littersize_mean2("HARE_LITTERSIZE_MEAN_B", CFG_CUSTOM, 2.508)
THare::GetTotalWeight
double GetTotalWeight()
Provide the wet weight of the hare.
Definition: Hare_all.h:370
MRR_Data::AddEntry
void AddEntry(int a_RefNum)
Definition: Hare_all.cpp:4298
cfg_MRR4
static CfgInt cfg_MRR4("HARE_MMRFOUR", CFG_CUSTOM, 999)
cfg_littersize_mean10
static CfgFloat cfg_littersize_mean10("HARE_LITTERSIZE_MEAN_J", CFG_CUSTOM, 1.72)
Hare_Infant::SetMum
void SetMum(Hare_Female *a_af)
Set the mother pointer.
Definition: Hare_all.h:856
g_rand_uni
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
tole_Carpark
Definition: tole_declaration.h:85
tohs_Dispersal
Definition: Hare_all.h:74
g_RMRrainFactor
double g_RMRrainFactor
Definition: Hare_all.cpp:51
struct_Hare::weight
double weight
Definition: Hare_all.h:144
Landscape::SupplyLargestPolyNumUsed
int SupplyLargestPolyNumUsed()
Definition: Landscape.h:355
THare_Population_Manager::m_GrowthEfficiency
double m_GrowthEfficiency[5001]
Precalculated growth efficiency with size
Definition: Hare_all.h:776
cfg_FarmIntensivenessH
CfgInt cfg_FarmIntensivenessH("HARE_FARMINTENSIVENESSH", CFG_CUSTOM, 10)
Population_Manager::m_ListNames
const char * m_ListNames[32]
Definition: PopulationManager.h:537
cfg_littersize_SD8
static CfgFloat cfg_littersize_SD8("HARE_LITTERSIZE_SD_H", CFG_CUSTOM, 0.6415)
tohs_Running
Definition: Hare_all.h:78
Landscape::Warn
void Warn(std::string a_msg1, std::string a_msg2)
Definition: Landscape.h:1579
THare_Population_Manager::GetTotalDensity
int GetTotalDensity(int x, int y)
Density function - returns the density of all hares in the square containing by x,...
Definition: Hare_all.h:676
tole_AmenityGrass
Definition: tole_declaration.h:76
Hare_Female::AddYoung
void AddYoung(THare *a_new)
Add a leveret to the list of kids.
Definition: Hare_all.cpp:3844
cfg_littersize_mean4
static CfgFloat cfg_littersize_mean4("HARE_LITTERSIZE_MEAN_D", CFG_CUSTOM, 1.72)
THare_Population_Manager::m_Interference
double m_Interference[2500]
Array storing density-dependence effect with density
Definition: Hare_all.h:760
Hare_Juvenile
Class for juvenile hares (after 5 weeks old, fully mobile)
Definition: Hare_all.h:924
tole_Coast
Definition: tole_declaration.h:67
tole_BuiltUpWithParkland
Definition: tole_declaration.h:80
THare_Population_Manager::m_RefNums
int m_RefNums
The last hare ID used
Definition: Hare_all.h:754
cfg_hare_peg_inertia
static CfgFloat cfg_hare_peg_inertia("HARE_PEG_INERTIA", CFG_CUSTOM, 0.20)
cfg_littersize_SD4
static CfgFloat cfg_littersize_SD4("HARE_LITTERSIZE_SD_D", CFG_CUSTOM, 0.6415)
October
const int October
Definition: Landscape.h:45
Population_Manager::IncLiveArraySize
void IncLiveArraySize(int a_listindex)
Increments the number of 'live' objects for a list index in the TheArray.
Definition: PopulationManager.h:437
cfg_BeetleBankMaxY
CfgInt cfg_BeetleBankMaxY