ALMaSS Rabbit ODdox  1.00
The rabbit model description following ODdox protocol
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
Rabbit_Warren Class Reference

A class to describe the rabbits warren system. More...

#include <Rabbit.h>

Inheritance diagram for Rabbit_Warren:
TAnimal TALMaSSObject

Public Member Functions

 Rabbit_Warren (int p_x, int p_y, Landscape *p_L, Rabbit_Population_Manager *p_NPM, int a_size, int a_soil)
 Rabbit warren constructor. More...
 
virtual ~Rabbit_Warren ()
 Rabbit warren destructor. More...
 
virtual void Step ()
 Warren step code. More...
 
virtual void BeginStep ()
 Warren begin step code. More...
 
int Get_TL_x ()
 Get m_TL_x. More...
 
int Get_TL_y ()
 Get m_TL_x. More...
 
APoint GetPointTL ()
 Get the TL coords as a point. More...
 
int GetActiveBurrows ()
 Gets the number of occupied burrows. More...
 
int GetPopulationSize ()
 Gets the total warren population of rabbits. More...
 
bool GetCarryingCapacityFilled ()
 Checks whether all possible burrows are filled with rabbits. More...
 
double GetCarryingCapacityRatio ()
 Checks whether all possible burrows are filled with rabbits. This is updated daily by Rabbit_Warren::UpdateForageInformation. More...
 
int GetCarryingCapacity ()
 Returns the carrying capacity in burrows. More...
 
double GetDiseaseConstant (void)
 Returns the warrens current disease constant. More...
 
void RabbitProductionRecord (RabbitObjectTypes YoungType, int kits)
 Stores data about production of rabbits throughout year. More...
 
int GetRabbitProductionRecord (RabbitObjectTypes YoungType)
 Get data about production of rabbits throughout year. More...
 
void ResetRabbitProductionRecord (RabbitObjectTypes YoungType)
 Reset specific data about production of rabbits throughout year. More...
 
void ResetAllRabbitProductionRecord (void)
 Reset data about production of rabbits throughout year. More...
 
void AddNetworkConnection (LocalWarrenNewtorkEntry a_LWNE)
 Adds a warren to the local network list. More...
 
Rabbit_WarrenGetNetworkWarren (void)
 Chooses a warren to evaluate based on distance. More...
 
void NetworkEvaluation (void)
 Calculates and saves distance probabilities. More...
 
bool IsMember (Rabbit_Base *a_rabbit)
 Returns true if this rabbit belongs to the warren. More...
 
bool IsFreeFemale (void)
 Returns true if there is a female with a burrow and no mate. More...
 
bool IsFreeMale (void)
 Returns true if there is a male with a burrow and no mate. More...
 
void UpdateDominance (void)
 Checks for a dominant female and promotes one if necessary and possible. More...
 
void ChooseNewDominant (void)
 Finds a subdominantfemale and promotes them to dominant. More...
 
int IsFreeBurrow (void)
 Is there a vacent burrow? More...
 
void Leave (Rabbit_Base *a_rabbit)
 Remove this adult from the warren list. More...
 
void Join (Rabbit_Base *a_rabbit)
 Adds this rabbit to the warren list. More...
 
void OccupyWarren (Rabbit_Adult *a_rabbit)
 Adds the first rabbit to the warren list. More...
 
void JoinNOccupy (Rabbit_Adult *a_rabbit)
 Adds this adult to the warren list and house them in a suitable burrow. More...
 
void JoinNMate (Rabbit_Adult *a_mate, RabbitObjectTypes rob_type)
 Adds this rabbit to the warren list and mate him with un-mated female/male with a burrow. More...
 
void Mate (Rabbit_Adult *a_mate, RabbitObjectTypes rob_type)
 Mate him with un-mated female/male with a burrow. More...
 
void OccupyNewBurrow ()
 a_rabbit occupies a newly dug burrow More...
 
void OccupyBurrow ()
 a_rabbit occupies a free burrow More...
 
int GetAllBreedingFemaleRabbits ()
 Supplies the number of breeding rabbits currently in the warren. More...
 
int GetAllBigFemaleRabbits ()
 Supplies the number of big rabbits currently in the warren. More...
 
double GetForagePesticide (void)
 Gets the current mean pesticide concentration per unit forage. More...
 
int GetSoilType (void)
 Gets the warren soil type. More...
 
bool DEBUG_InternalTest ()
 
bool DEBUG_InternalTest2 ()
 
double Disease ()
 Supply the current disease mortality constant. More...
 
void CalcDisease ()
 Calculate the current disease mortality constant. More...
 
double GetAvailableForage (void)
 Returns the available forage realtive to rabbit numbers. More...
 
double GetInvAvailableForage (void)
 Returns the inverse of available forage realtive to rabbit numbers. More...
 
double GetLitterReabsortionConst (void)
 Returns litter reabsorption chance. More...
 
int GetThisYearsBreeders ()
 Returns the number of females breeding this year. More...
 
double GetThisYearsBreedersAv ()
 Returns the number of females breeding this year. More...
 
int GetThisYears1yrOldFemales ()
 Returns the number of 1yr old females. More...
 
int GetLittersThisYear ()
 Returns the number litters produced in the last 12 months. More...
 
int GetThisYearsNonBreeders ()
 Returns the number of females not breeding this year but older than 1 year. More...
 
void UpdateThisYearsBreeders ()
 Calculates and stores the number of breeders and non-breeders. More...
 
double GetDailyMortalityChanceA ()
 Returns the adult daily mortality multiplier. More...
 
double GetDailyMortalityChanceJ ()
 Returns the juvenile daily mortality multiplier. More...
 
double GetCCRabbitsR ()
 Records the number of big female rabbits for carrying capacity calculations. More...
 
- Public Member Functions inherited from TAnimal
unsigned SupplyFarmOwnerRef ()
 
AnimalPosition SupplyPosition ()
 
APoint SupplyPoint ()
 
int SupplyPolygonRef ()
 
int Supply_m_Location_x ()
 
int Supply_m_Location_y ()
 
virtual void KillThis ()
 
virtual void CopyMyself ()
 
void SetX (int a_x)
 
void SetY (int a_y)
 
 TAnimal (int x, int y, Landscape *L)
 
virtual void EndStep (void)
 EndStep behaviour - must be implemented in descendent classes. More...
 
virtual void ReinitialiseObject (int x, int y, Landscape *L)
 Used to re-use an object - must be implemented in descendent classes. More...
 
virtual int WhatState ()
 
virtual void Dying ()
 
void CheckManagement (void)
 
void CheckManagementXY (int x, int y)
 
virtual bool OnFarmEvent (FarmToDo)
 
- Public Member Functions inherited from TALMaSSObject
int GetCurrentStateNo ()
 Returns the current state number. More...
 
void SetCurrentStateNo (int a_num)
 Sets the current state number. More...
 
bool GetStepDone ()
 Returns the step done indicator flag. More...
 
void SetStepDone (bool a_bool)
 Sets the step done indicator flag. More...
 
virtual void ReinitialiseObject ()
 Used to re-use an object - must be implemented in descendent classes. More...
 
 TALMaSSObject ()
 The constructor for TALMaSSObject. More...
 
virtual ~TALMaSSObject ()
 The destructor for TALMaSSObject. More...
 
void OnArrayBoundsError ()
 Used for debugging only, tests basic object properties. More...
 

Public Attributes

int m_breedingfemales
 The number of females that bred this year. More...
 
int m_1yrOldFemales
 The number of 1 year old females. More...
 
int m_littersthisyear
 The number of litters produced this year. More...
 
int m_nonbreedingfemales
 The number of females that did not breed this year but are older than 1 year. More...
 

Static Public Attributes

static double m_maxForageHeight = cfg_maxForageHeight.value()
 The maximum vegetation height assumed for forage potential. More...
 
static double m_minForageDigestability = cfg_minForageDigestability.value()
 The minimum vegetation digestability allowed for foraging. More...
 

Protected Member Functions

void st_WarrenBeing (void)
 The only warren behaviour - it just is. More...
 
void InitEvaluation (void)
 Intiates the evaluation of the warren area. More...
 
int GetForageArea (void)
 Returns the total area of permanent forage. More...
 
int CalcForageArea (void)
 Returns the total area of forage. More...
 
int CalcPermForageArea (void)
 Returns the total area of permanent forage. More...
 
int GetTemporaryForageArea (void)
 Returns the total area of temporary forage. More...
 
int GetCoverArea (void)
 Returns the total area of cover. More...
 
int GetTempForageAreaVeg (void)
 Returns the total area of temporary forage based on veg height. More...
 
int GetCoverAreaVeg (void)
 Returns the total area of cover based on veg height. More...
 
void UpdateForageInformation (void)
 Updates the forage information depending upon the vegetation state. More...
 
void UpdatePesticide (void)
 Updates the pesticide concentration in forage polygons. More...
 
void CalcCarryingCapacityRatio1 ()
 calculates the ratio of rabbits to the carrying capacity More...
 
double CalcCarryingCapacityRatio2 ()
 calculates the ratio of rabbits to the carrying capacity for the local area More...
 
- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 

Protected Attributes

int m_size
 Warren core size in m. More...
 
int m_foragesize
 Warren forage size in m. More...
 
int m_TL_x
 Stores original m_Location_x. More...
 
int m_TL_y
 Stores original m_Location_y. More...
 
int m_maintenence
 Warren maintenence score - if not max then houseing capacity is reduced. More...
 
int m_CarryingCapacity
 Records the max number of rabbit pairs possible here. More...
 
double m_CarryingCapacityR
 Records the max number of rabbits possible here. More...
 
double m_CarryingCapacityR2
 Records the max number of rabbits possible here divided by 2. More...
 
double m_BigFemaleRabbitsR
 Records the number of big female rabbits divided by m_CarryingCapacityR2. More...
 
double m_CarryingCapacityRatio
 Records the ratio between carrying capacity and no rabbits in warren. More...
 
int m_NoBurrows
 Records the maintenence restricted current carrying capacity (burrow number) More...
 
int m_NoOccupiedBurrows
 Records the burrows that are occupied. More...
 
int m_BurrowsUnderConstruction
 Records the burrows that are being dug. More...
 
int m_soiltype
 Variable holding the soil type, 1 = heavy, 0 = sandy, 3 = unsuitable (never used in warrens) More...
 
int m_rabbitdiggingtime
 The time taken for burrow construction. More...
 
int m_permforagearea
 Variable holding the total permanent forage area. More...
 
int m_foragearea
 Variable holding the total potential forage area. More...
 
double m_availableforage
 Records the amount of forage currently available in the warren area as a proportion of what is the potential relative to rabbit numbers possible. More...
 
double m_foragearearatio
 Records the amount of forage currently available in the warren area as a proportion of total forage area. More...
 
double m_inv_availableforage
 The inverse of m_availableforage, prevents multiple re-calculation. More...
 
double m_litterreabosorptionchance
 Chance of litter reaborption based on the m_availableforage. More...
 
double m_forageP
 Records the amount of pesticde as a mean concentration per unit area forage. More...
 
double m_diseaseconstant
 a measure of disease mortality likelihood More...
 
double m_mortalitymultiplierA
 a measure of mortality likelihood - adults More...
 
double m_mortalitymultiplierJ
 a measure of mortality likelihood - juveniles More...
 
int m_ThisYearsProduction [rob_foobar]
 Storage for rabbit production data. More...
 
TTypeOfRabbitState m_CurrentRState
 Variable to record current behavioural state. More...
 
vector< RabbitWarrenLEInfom_LEList
 List of polygons and the area which is part of the warren. More...
 
vector< LocalWarrenNewtorkEntrym_LocalWarrenNetwork
 List of local warrens and their accessibility from this warren. More...
 
vector< Rabbit_Base * > m_InhabitantsList
 List of rabbits that live here - for easy communication purposes. More...
 
Rabbit_Population_Managerm_OurPopulationManager
 This is a time saving pointer to the correct population manager object. More...
 
int m_runningavFemales
 Keeps track of the number of breeding females. More...
 
int m_runningavCount
 Keeps track of the number of breeding days. More...
 
- Protected Attributes inherited from TAnimal
int m_Location_x
 
int m_Location_y
 
Landscapem_OurLandscape
 
- Protected Attributes inherited from TALMaSSObject
int m_CurrentStateNo
 The basic state number for all objects - '-1' indicates death. More...
 
bool m_StepDone
 Indicates whether the iterative step code is done for this timestep. More...
 

Detailed Description

A class to describe the rabbits warren system.

Definition at line 518 of file Rabbit.h.

Constructor & Destructor Documentation

Rabbit_Warren::Rabbit_Warren ( int  p_x,
int  p_y,
Landscape p_L,
Rabbit_Population_Manager p_NPM,
int  a_size,
int  a_soil 
)

Rabbit warren constructor.

To get the warrens to display properly the centre location is needed. Unfortunately to work with display this needs to be m_Location_x & m_Location_y so we need to store TL_x & TL_y too

Must do an evaluation of the warren area and populate our list of polygons and areas. This is done by InitEvaluation

Definition at line 1449 of file Rabbit.cpp.

References cfg_rabbitdiggingtime, InitEvaluation(), m_BigFemaleRabbitsR, m_BurrowsUnderConstruction, m_CarryingCapacity, m_CarryingCapacityRatio, m_CurrentRState, m_diseaseconstant, m_foragesize, m_InhabitantsList, TAnimal::m_Location_x, TAnimal::m_Location_y, m_maintenence, m_NoOccupiedBurrows, m_OurPopulationManager, m_rabbitdiggingtime, m_runningavCount, m_runningavFemales, m_size, m_soiltype, m_TL_x, m_TL_y, ResetAllRabbitProductionRecord(), toRabbits_InitialState, and CfgInt::value().

1449  : TAnimal(p_x,p_y,p_L)
1450 {
1452  m_OurPopulationManager = p_NPM;
1453  m_size = a_size;
1454  m_maintenence = 0;
1455  m_NoOccupiedBurrows = 0;
1457  m_CarryingCapacity = 0;
1458  m_CarryingCapacityRatio = -1; // No effect for the first period until it is properly calculated
1459  m_InhabitantsList.resize(0);
1460  m_soiltype = a_soil;
1462  m_diseaseconstant = 0.0;
1464  m_BigFemaleRabbitsR = 0.0;
1465  m_runningavCount=0;
1466  m_runningavFemales = 0;
1470  m_Location_x = m_Location_x + (m_size / 2);
1471  m_Location_y = m_Location_y + (m_size / 2);
1472  // Now get the forage size.
1473  m_foragesize = m_size * 2;
1474  m_TL_x = m_Location_x - (m_foragesize / 2);
1475  if (m_TL_x < 0) m_TL_x = 0;
1476  m_TL_y = m_Location_x - (m_foragesize / 2);
1477  if (m_TL_y < 0) m_TL_y = 0;
1481  InitEvaluation();
1482 }
vector< Rabbit_Base * > m_InhabitantsList
List of rabbits that live here - for easy communication purposes.
Definition: Rabbit.h:752
CfgInt cfg_rabbitdiggingtime("RABBIT_DIGGINGTIME", CFG_CUSTOM, 10)
Input variable. Minimum burrow construction time in days.
int m_TL_y
Stores original m_Location_y.
Definition: Rabbit.h:700
void InitEvaluation(void)
Intiates the evaluation of the warren area.
Definition: Rabbit.cpp:1491
int m_runningavFemales
Keeps track of the number of breeding females.
Definition: Rabbit.h:756
int m_soiltype
Variable holding the soil type, 1 = heavy, 0 = sandy, 3 = unsuitable (never used in warrens) ...
Definition: Rabbit.h:720
int m_size
Warren core size in m.
Definition: Rabbit.h:694
void ResetAllRabbitProductionRecord(void)
Reset data about production of rabbits throughout year.
Definition: Rabbit.h:588
Rabbit_Population_Manager * m_OurPopulationManager
This is a time saving pointer to the correct population manager object.
Definition: Rabbit.h:754
int m_NoOccupiedBurrows
Records the burrows that are occupied.
Definition: Rabbit.h:716
double m_CarryingCapacityRatio
Records the ratio between carrying capacity and no rabbits in warren.
Definition: Rabbit.h:712
int m_CarryingCapacity
Records the max number of rabbit pairs possible here.
Definition: Rabbit.h:704
int m_rabbitdiggingtime
The time taken for burrow construction.
Definition: Rabbit.h:722
double m_diseaseconstant
a measure of disease mortality likelihood
Definition: Rabbit.h:738
int m_foragesize
Warren forage size in m.
Definition: Rabbit.h:696
TTypeOfRabbitState m_CurrentRState
Variable to record current behavioural state.
Definition: Rabbit.h:746
int value(void)
Definition: configurator.h:92
double m_BigFemaleRabbitsR
Records the number of big female rabbits divided by m_CarryingCapacityR2.
Definition: Rabbit.h:710
int m_maintenence
Warren maintenence score - if not max then houseing capacity is reduced.
Definition: Rabbit.h:702
int m_BurrowsUnderConstruction
Records the burrows that are being dug.
Definition: Rabbit.h:718
int m_runningavCount
Keeps track of the number of breeding days.
Definition: Rabbit.h:758
TAnimal(int x, int y, Landscape *L)
int m_TL_x
Stores original m_Location_x.
Definition: Rabbit.h:698
Rabbit_Warren::~Rabbit_Warren ( void  )
virtual

Rabbit warren destructor.

Definition at line 1485 of file Rabbit.cpp.

1486 {
1487  ;
1488 }

Member Function Documentation

void Rabbit_Warren::AddNetworkConnection ( LocalWarrenNewtorkEntry  a_LWNE)
inline

Adds a warren to the local network list.

Definition at line 590 of file Rabbit.h.

590 { m_LocalWarrenNetwork.push_back( a_LWNE ); }
vector< LocalWarrenNewtorkEntry > m_LocalWarrenNetwork
List of local warrens and their accessibility from this warren.
Definition: Rabbit.h:750
virtual void Rabbit_Warren::BeginStep ( void  )
inlinevirtual

Warren begin step code.

Reimplemented from TAnimal.

Definition at line 560 of file Rabbit.h.

560  {
562  }
void CalcCarryingCapacityRatio1()
calculates the ratio of rabbits to the carrying capacity
Definition: Rabbit.cpp:1682
void Rabbit_Warren::CalcCarryingCapacityRatio1 ( )
protected

calculates the ratio of rabbits to the carrying capacity

Definition at line 1682 of file Rabbit.cpp.

References GetAllBigFemaleRabbits(), m_BigFemaleRabbitsR, and m_CarryingCapacityR2.

1682  {
1683  m_BigFemaleRabbitsR = GetAllBigFemaleRabbits() / (m_CarryingCapacityR2); // m_CarryingCapacityR is (m_CarryingCapacity * cfg_rabbitdendepscaler.value())/2
1684 }
int GetAllBigFemaleRabbits()
Supplies the number of big rabbits currently in the warren.
Definition: Rabbit.cpp:2280
double m_BigFemaleRabbitsR
Records the number of big female rabbits divided by m_CarryingCapacityR2.
Definition: Rabbit.h:710
double m_CarryingCapacityR2
Records the max number of rabbits possible here divided by 2.
Definition: Rabbit.h:708
double Rabbit_Warren::CalcCarryingCapacityRatio2 ( )
protected

calculates the ratio of rabbits to the carrying capacity for the local area

Here the issue can be that the local warren is too small a unit to use for carrying capacity calculations for the POM tests on Bayreuth Therefore we have two options:

  • 1 use the local rabbits for real landscapes
  • 2 a combined area calculation (which takes more time) for enclosure tests

To speed this on each warren creates its own daily stats which can be combined here.

Definition at line 1686 of file Rabbit.cpp.

References m_BigFemaleRabbitsR, and m_LocalWarrenNetwork.

Referenced by UpdateForageInformation().

1686  {
1696 #ifdef __EnclosureTest
1697  double CCRatio = m_BigFemaleRabbitsR;
1698  int nsz = (int)m_LocalWarrenNetwork.size();
1699  for (int i = 0; i < nsz; i++) {
1700  CCRatio += m_LocalWarrenNetwork[i].m_aWarren->GetCCRabbitsR();
1701  }
1702  CCRatio /= (nsz + 1);
1703  return CCRatio;
1704 #endif
1705  return m_BigFemaleRabbitsR; // Is the number of big female rabbits / ((m_CarryingCapacity * cfg_rabbitdendepscaler.value())/2)
1706 }
double m_BigFemaleRabbitsR
Records the number of big female rabbits divided by m_CarryingCapacityR2.
Definition: Rabbit.h:710
vector< LocalWarrenNewtorkEntry > m_LocalWarrenNetwork
List of local warrens and their accessibility from this warren.
Definition: Rabbit.h:750
void Rabbit_Warren::CalcDisease ( void  )

Calculate the current disease mortality constant.

To simulate disease we need a globally variying probability with local variations depending upon density This is done by evaluating two levels - the first is the total population density. This is given by the the total number of rabbits divided by the total number of warrens.
The local density is the number of rabbits related to the carrying capacity.
This method is only called at a time period specified as an input variable, so disease will not instantly equilibrate.
The big disease chance is based on global density: prob_density = (totalrabbits / no warren) x (totalrabbits / no warren) * cfg_globaldisease_probability.value(); This is then modified by local density: m_diseaseconstant = prob_density * GetCarryingCapacityRatio

Definition at line 1577 of file Rabbit.cpp.

References cfg_globaldisease_probability, GetCarryingCapacityRatio(), Population_Manager::GetLiveArraySize(), m_diseaseconstant, m_OurPopulationManager, rob_Warren, Rabbit_Population_Manager::SupplyAllBigRabbits(), and CfgFloat::value().

1578 {
1591  // Get the numbers we need
1592  unsigned totalrabbits = m_OurPopulationManager->SupplyAllBigRabbits();
1593  unsigned warrens = m_OurPopulationManager->GetLiveArraySize(rob_Warren);
1594  // Some of this should be done by the population managerfor efficiency but it is here to keep it together.
1595  //The big chance based on global density
1596  double prob_density = (totalrabbits / (double)warrens) * (totalrabbits / (double)warrens) * cfg_globaldisease_probability.value();
1597  // Now the local stuff
1598  m_diseaseconstant = prob_density * GetCarryingCapacityRatio();
1599 }
unsigned GetLiveArraySize(int a_listindex)
Gets the number of &#39;live&#39; objects for a list index in the TheArray.
double GetCarryingCapacityRatio()
Checks whether all possible burrows are filled with rabbits. This is updated daily by Rabbit_Warren::...
Definition: Rabbit.h:576
double value(void)
Definition: configurator.h:107
Rabbit_Population_Manager * m_OurPopulationManager
This is a time saving pointer to the correct population manager object.
Definition: Rabbit.h:754
CfgFloat cfg_globaldisease_probability("RABBIT_GLOBALDISEASEPROBCONSTANT", CFG_CUSTOM, 0.05)
Input variable. A constant use to calculate the probability of density related disease.
double m_diseaseconstant
a measure of disease mortality likelihood
Definition: Rabbit.h:738
unsigned SupplyAllBigRabbits()
Returns the total number of rabbits.
int Rabbit_Warren::CalcForageArea ( void  )
protected

Returns the total area of forage.

This returns the forge area calcuated by element type.

Definition at line 1724 of file Rabbit.cpp.

References m_LEList.

Referenced by InitEvaluation(), and UpdateForageInformation().

1725 {
1729  int area = 0;
1730  for (vector<RabbitWarrenLEInfo>::size_type k = 0; k<m_LEList.size(); k++)
1731  {
1732  area += m_LEList[k].m_foragearea;
1733  }
1734  return area;
1735 }
vector< RabbitWarrenLEInfo > m_LEList
List of polygons and the area which is part of the warren.
Definition: Rabbit.h:748
int Rabbit_Warren::CalcPermForageArea ( void  )
protected

Returns the total area of permanent forage.

This returns the forge area calcuated by element type.

Definition at line 1738 of file Rabbit.cpp.

References m_LEList, and torh_Forage.

Referenced by InitEvaluation().

1739 {
1743  int area = 0;
1744  for (vector<RabbitWarrenLEInfo>::size_type k = 0; k<m_LEList.size(); k++)
1745  {
1746  if (m_LEList[k].m_torh == torh_Forage) area += m_LEList[k].m_area;
1747  }
1748  return area;
1749 }
vector< RabbitWarrenLEInfo > m_LEList
List of polygons and the area which is part of the warren.
Definition: Rabbit.h:748
void Rabbit_Warren::ChooseNewDominant ( void  )

Finds a subdominantfemale and promotes them to dominant.

Loops through the list to find suitable females who could be dominant. If no fully grown females then the largest one is taken.

Definition at line 1946 of file Rabbit.cpp.

References Rabbit_Adult::GetSocialStatus(), Rabbit_Base::GetweightAge(), m_InhabitantsList, rabbit_socialstatus_dominant, rabbit_socialstatus_subdominant, rob_Female, and Rabbit_Adult::SetSocialStatus().

Referenced by Rabbit_Female::st_Dying(), and UpdateDominance().

1946  {
1950  Rabbit_Female* rfemale = NULL;
1951  Rabbit_Female* rfemaleBig = NULL;
1952  int bigWeight = 0;
1953  int sz = (int)m_InhabitantsList.size();
1954  for (int i = 0; i < sz; i++) {
1955  if (m_InhabitantsList[ i ]->GetRabbitType() == rob_Female) {
1956  rfemale = dynamic_cast<Rabbit_Female*>(m_InhabitantsList[ i ]);
1958  if (rfemale->GetweightAge() >= 300) { // 300 represents max growth
1960  return;
1961  }
1962  else if (rfemale->GetweightAge() > bigWeight) {
1963  bigWeight = rfemale->GetweightAge();
1964  rfemaleBig = rfemale;
1965  }
1966  }
1967  }
1968  }
1969  if (rfemaleBig!=NULL) rfemaleBig->SetSocialStatus( rabbit_socialstatus_dominant );
1970 }
void SetSocialStatus(TTypesOfRabbitSocialStatus a_status)
Sets the dominance status.
Definition: Rabbit.h:391
The rabbit female class. All special female behaviour is described here.
Definition: Rabbit.h:443
vector< Rabbit_Base * > m_InhabitantsList
List of rabbits that live here - for easy communication purposes.
Definition: Rabbit.h:752
int GetweightAge(void)
Get age method.
Definition: Rabbit.h:230
TTypesOfRabbitSocialStatus GetSocialStatus(void)
Return the dominance status.
Definition: Rabbit.h:387
bool Rabbit_Warren::DEBUG_InternalTest ( )

Definition at line 2292 of file Rabbit.cpp.

References TALMaSSObject::GetCurrentStateNo(), m_InhabitantsList, m_NoBurrows, m_NoOccupiedBurrows, TAnimal::m_OurLandscape, rob_Female, rob_Male, and Landscape::Warn().

Referenced by IsFreeBurrow(), JoinNMate(), JoinNOccupy(), Mate(), Rabbit_Adult::OnMateFinishedDigging(), and st_WarrenBeing().

2293 {
2294  int Mburrs = 0;
2295  int Mmates = 0;
2296  int MBM = 0;
2297  int Fburrs = 0;
2298  int Fmates = 0;
2299  int FBM = 0;
2300  int siz = (int) m_InhabitantsList.size();
2301  int Mdigs = 0;
2302  int Fdigs = 0;
2303  for (int i = 0; i<siz; i++)
2304  {
2305  if (m_InhabitantsList[i]->GetCurrentStateNo() != -1)
2306  {
2307  if (m_InhabitantsList[i]->GetRabbitType() == rob_Male)
2308  {
2309  if (m_InhabitantsList[i]->GetHasBurrow()) Mburrs++; // No males with burrow
2310  if (m_InhabitantsList[i]->GetDigging()>-1) Mdigs++; // No males digging
2311  if (dynamic_cast<Rabbit_Adult*>(m_InhabitantsList[i])->GetMate() != NULL) Mmates++; // No males with mates
2312  if ((dynamic_cast<Rabbit_Adult*>(m_InhabitantsList[i])->GetMate() != NULL) && (m_InhabitantsList[i]->GetHasBurrow())) MBM++; // No males with mates and burrows
2313  }
2314  if (m_InhabitantsList[i]->GetRabbitType() == rob_Female)
2315  {
2316  if (m_InhabitantsList[i]->GetHasBurrow()) Fburrs++;
2317  if (m_InhabitantsList[i]->GetDigging() > -1) Fdigs++;
2318  if (dynamic_cast<Rabbit_Adult*>(m_InhabitantsList[i])->GetMate() != NULL) Fmates++;
2319  if ((dynamic_cast<Rabbit_Adult*>(m_InhabitantsList[i])->GetMate() != NULL) && (m_InhabitantsList[i]->GetHasBurrow())) FBM++;
2320  }
2321  }
2322  }
2323  int alonemales = Mburrs-MBM;
2324  int alonefemales = Fburrs-FBM;
2325  if (MBM != FBM)
2326  {
2327  m_OurLandscape->Warn("IsFreeBurrow","Inconsistent mates and burrows MBM != FBM.");
2328  exit(1);
2329  }
2330  if (MBM + alonemales + alonefemales > m_NoBurrows)
2331  {
2332  m_OurLandscape->Warn("IsFreeBurrow","Too many burrows occupied.");
2333  exit(1);
2334  }
2335  if (MBM + alonemales + alonefemales != this->m_NoOccupiedBurrows)
2336  {
2337  m_OurLandscape->Warn("IsFreeBurrow","Too many burrows occupied.");
2338  exit(1);
2339  }
2340  return true;
2341 }
vector< Rabbit_Base * > m_InhabitantsList
List of rabbits that live here - for easy communication purposes.
Definition: Rabbit.h:752
int m_NoOccupiedBurrows
Records the burrows that are occupied.
Definition: Rabbit.h:716
Landscape * m_OurLandscape
int m_NoBurrows
Records the maintenence restricted current carrying capacity (burrow number)
Definition: Rabbit.h:714
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1505
int GetCurrentStateNo()
Returns the current state number.
bool Rabbit_Warren::DEBUG_InternalTest2 ( )

Definition at line 2344 of file Rabbit.cpp.

References m_InhabitantsList, m_NoBurrows, TAnimal::m_OurLandscape, rob_Female, rob_Male, and Landscape::Warn().

Referenced by IsFreeBurrow(), and JoinNOccupy().

2345 {
2346  int Mburrs = 0;
2347  int Mmates = 0;
2348  int MBM = 0;
2349  int Fburrs = 0;
2350  int Fmates = 0;
2351  int FBM = 0;
2352  int siz = (int) m_InhabitantsList.size();
2353  for (int i=0; i<siz; i++)
2354  {
2355  if ( m_InhabitantsList[i]->GetRabbitType() == rob_Male)
2356  {
2357  if ( m_InhabitantsList[i]->GetHasBurrow()) Mburrs++;
2358  if ( dynamic_cast<Rabbit_Adult*>(m_InhabitantsList[i])->GetMate()!= NULL) Mmates++;
2359  if (( dynamic_cast<Rabbit_Adult*>(m_InhabitantsList[i])->GetMate()!= NULL) && (m_InhabitantsList[i]->GetHasBurrow())) MBM++;
2360  }
2361  if ( m_InhabitantsList[i]->GetRabbitType() == rob_Female)
2362  {
2363  if ( m_InhabitantsList[i]->GetHasBurrow()) Fburrs++;
2364  if ( dynamic_cast<Rabbit_Adult*>(m_InhabitantsList[i])->GetMate()!= NULL) Fmates++;
2365  if (( dynamic_cast<Rabbit_Adult*>(m_InhabitantsList[i])->GetMate()!= NULL) && (m_InhabitantsList[i]->GetHasBurrow())) FBM++;
2366  }
2367  }
2368  int alonemales = Mburrs-MBM;
2369  int alonefemales = Fburrs-FBM;
2370  if (MBM + alonemales + alonefemales >= m_NoBurrows)
2371  {
2372  m_OurLandscape->Warn("IsFreeBurrow","Too many burrows occupied.");
2373  exit(1);
2374  }
2375  return true;
2376 }
vector< Rabbit_Base * > m_InhabitantsList
List of rabbits that live here - for easy communication purposes.
Definition: Rabbit.h:752
Landscape * m_OurLandscape
int m_NoBurrows
Records the maintenence restricted current carrying capacity (burrow number)
Definition: Rabbit.h:714
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1505
double Rabbit_Warren::Disease ( )
inline

Supply the current disease mortality constant.

Definition at line 638 of file Rabbit.h.

638 { return m_diseaseconstant; }
double m_diseaseconstant
a measure of disease mortality likelihood
Definition: Rabbit.h:738
int Rabbit_Warren::Get_TL_x ( )
inline

Get m_TL_x.

Definition at line 564 of file Rabbit.h.

564 { return m_TL_x; }
int m_TL_x
Stores original m_Location_x.
Definition: Rabbit.h:698
int Rabbit_Warren::Get_TL_y ( )
inline

Get m_TL_x.

Definition at line 566 of file Rabbit.h.

566 { return m_TL_y; }
int m_TL_y
Stores original m_Location_y.
Definition: Rabbit.h:700
int Rabbit_Warren::GetActiveBurrows ( )
inline

Gets the number of occupied burrows.

Definition at line 570 of file Rabbit.h.

570 { return m_NoOccupiedBurrows; }
int m_NoOccupiedBurrows
Records the burrows that are occupied.
Definition: Rabbit.h:716
int Rabbit_Warren::GetAllBigFemaleRabbits ( void  )

Supplies the number of big rabbits currently in the warren.

Definition at line 2280 of file Rabbit.cpp.

References m_InhabitantsList, and rob_Female.

Referenced by CalcCarryingCapacityRatio1().

2280  {
2281  int biggies = 0;
2282  int sz = (int)m_InhabitantsList.size();
2283  for (int i = 0; i < sz; i++) {
2284  if (m_InhabitantsList[ i ]->GetRabbitType() == rob_Female) {
2285  if (m_InhabitantsList[ i ]->GetAge()>300) biggies++;
2286  }
2287  }
2288  return biggies;
2289 }
vector< Rabbit_Base * > m_InhabitantsList
List of rabbits that live here - for easy communication purposes.
Definition: Rabbit.h:752
int Rabbit_Warren::GetAllBreedingFemaleRabbits ( void  )

Supplies the number of breeding rabbits currently in the warren.

Definition at line 2268 of file Rabbit.cpp.

References m_InhabitantsList, rabbit_socialstatus_subordinate, and rob_Female.

Referenced by st_WarrenBeing().

2268  {
2269  int breeders = 0;
2270  int sz = (int)m_InhabitantsList.size();
2271  for (int i = 0; i < sz; i++) {
2272  if (m_InhabitantsList[ i ]->GetRabbitType() == rob_Female) {
2273  if (dynamic_cast<Rabbit_Female*>(m_InhabitantsList[ i ])->GetSocialStatus()>rabbit_socialstatus_subordinate) breeders++;
2274  }
2275  }
2276  return breeders;
2277 }
vector< Rabbit_Base * > m_InhabitantsList
List of rabbits that live here - for easy communication purposes.
Definition: Rabbit.h:752
double Rabbit_Warren::GetAvailableForage ( void  )
inline

Returns the available forage realtive to rabbit numbers.

Definition at line 642 of file Rabbit.h.

Referenced by Rabbit_Female::st_EvaluateTerritory().

642  {
643  return m_availableforage;
644  }
double m_availableforage
Records the amount of forage currently available in the warren area as a proportion of what is the po...
Definition: Rabbit.h:728
int Rabbit_Warren::GetCarryingCapacity ( )
inline

Returns the carrying capacity in burrows.

Definition at line 578 of file Rabbit.h.

Referenced by Rabbit_Population_Manager::CreateObjects(), and Rabbit_Male::st_EvaluateTerritory().

578 { return m_CarryingCapacity; }
int m_CarryingCapacity
Records the max number of rabbit pairs possible here.
Definition: Rabbit.h:704
bool Rabbit_Warren::GetCarryingCapacityFilled ( )
inline

Checks whether all possible burrows are filled with rabbits.

Definition at line 574 of file Rabbit.h.

int m_NoOccupiedBurrows
Records the burrows that are occupied.
Definition: Rabbit.h:716
int m_CarryingCapacity
Records the max number of rabbit pairs possible here.
Definition: Rabbit.h:704
double Rabbit_Warren::GetCarryingCapacityRatio ( )
inline

Checks whether all possible burrows are filled with rabbits. This is updated daily by Rabbit_Warren::UpdateForageInformation.

Definition at line 576 of file Rabbit.h.

Referenced by CalcDisease().

576 { return m_CarryingCapacityRatio; }
double m_CarryingCapacityRatio
Records the ratio between carrying capacity and no rabbits in warren.
Definition: Rabbit.h:712
double Rabbit_Warren::GetCCRabbitsR ( )
inline

Records the number of big female rabbits for carrying capacity calculations.

Definition at line 688 of file Rabbit.h.

688  {
689  return m_BigFemaleRabbitsR;
690  }
double m_BigFemaleRabbitsR
Records the number of big female rabbits divided by m_CarryingCapacityR2.
Definition: Rabbit.h:710
int Rabbit_Warren::GetCoverArea ( void  )
protected

Returns the total area of cover.

This returns the cover area calcuated by element type. This is probably mis-leading and the GetCoverAreaVeg() is better representative of the cover leves including high vegetation levels.

Definition at line 1766 of file Rabbit.cpp.

References m_LEList, and torh_Cover.

1767 {
1771  int area = 0;
1772  for (vector<RabbitWarrenLEInfo>::size_type k=0; k<m_LEList.size(); k++)
1773  {
1774  if (m_LEList[k].m_torh == torh_Cover) area += m_LEList[k].m_area;
1775  }
1776  return area;
1777 }
vector< RabbitWarrenLEInfo > m_LEList
List of polygons and the area which is part of the warren.
Definition: Rabbit.h:748
int Rabbit_Warren::GetCoverAreaVeg ( void  )
protected

Returns the total area of cover based on veg height.

This returns the cover area calcuated by element type and vegeation height.

Definition at line 1800 of file Rabbit.cpp.

References m_LEList, m_maxForageHeight, and torh_Other.

1800  {
1804  int area = 0;
1805  for (vector<RabbitWarrenLEInfo>::size_type k = 0; k<m_LEList.size(); k++) {
1806  if (m_LEList[ k ].m_ele->GetVegHeight() >= m_maxForageHeight) {
1807  if (m_LEList[ k ].m_torh != torh_Other) area += m_LEList[ k ].m_area;
1808  }
1809  }
1810  return area;
1811 }
vector< RabbitWarrenLEInfo > m_LEList
List of polygons and the area which is part of the warren.
Definition: Rabbit.h:748
static double m_maxForageHeight
The maximum vegetation height assumed for forage potential.
Definition: Rabbit.h:541
double Rabbit_Warren::GetDailyMortalityChanceA ( )
inline

Returns the adult daily mortality multiplier.

Definition at line 680 of file Rabbit.h.

Referenced by Rabbit_Adult::EndStep().

680  {
681  return m_mortalitymultiplierA;
682  }
double m_mortalitymultiplierA
a measure of mortality likelihood - adults
Definition: Rabbit.h:740
double Rabbit_Warren::GetDailyMortalityChanceJ ( )
inline

Returns the juvenile daily mortality multiplier.

Definition at line 684 of file Rabbit.h.

Referenced by Rabbit_Juvenile::EndStep().

684  {
685  return m_mortalitymultiplierJ;
686  }
double m_mortalitymultiplierJ
a measure of mortality likelihood - juveniles
Definition: Rabbit.h:742
double Rabbit_Warren::GetDiseaseConstant ( void  )
inline

Returns the warrens current disease constant.

Definition at line 580 of file Rabbit.h.

580 { return m_diseaseconstant; }
double m_diseaseconstant
a measure of disease mortality likelihood
Definition: Rabbit.h:738
int Rabbit_Warren::GetForageArea ( void  )
inlineprotected

Returns the total area of permanent forage.

Definition at line 766 of file Rabbit.h.

766 { return m_permforagearea; }
int m_permforagearea
Variable holding the total permanent forage area.
Definition: Rabbit.h:724
double Rabbit_Warren::GetForagePesticide ( void  )
inline

Gets the current mean pesticide concentration per unit forage.

Definition at line 628 of file Rabbit.h.

Referenced by Rabbit_Juvenile::st_Forage(), Rabbit_Male::st_Forage(), and Rabbit_Female::st_Forage().

628  {
629  return m_forageP;
630  }
double m_forageP
Records the amount of pesticde as a mean concentration per unit area forage.
Definition: Rabbit.h:736
double Rabbit_Warren::GetInvAvailableForage ( void  )
inline

Returns the inverse of available forage realtive to rabbit numbers.

Definition at line 646 of file Rabbit.h.

646  {
647  return m_inv_availableforage;
648  }
double m_inv_availableforage
The inverse of m_availableforage, prevents multiple re-calculation.
Definition: Rabbit.h:732
double Rabbit_Warren::GetLitterReabsortionConst ( void  )
inline

Returns litter reabsorption chance.

Definition at line 650 of file Rabbit.h.

Referenced by Rabbit_Female::st_GiveBirth().

650  {
652  }
double m_litterreabosorptionchance
Chance of litter reaborption based on the m_availableforage.
Definition: Rabbit.h:734
int Rabbit_Warren::GetLittersThisYear ( )
inline

Returns the number litters produced in the last 12 months.

Definition at line 670 of file Rabbit.h.

Referenced by UpdateThisYearsBreeders().

670  {
671  return m_littersthisyear;
672  }
int m_littersthisyear
The number of litters produced this year.
Definition: Rabbit.h:549
Rabbit_Warren * Rabbit_Warren::GetNetworkWarren ( void  )

Chooses a warren to evaluate based on distance.

This method chooses a warren from the network with a probability of choice based on the distance from home. However, we need to start at a random point in the list and cycle because otherwise we run the risk of only the first few warrens ever being tested.

Definition at line 1907 of file Rabbit.cpp.

References g_rand_uni, and m_LocalWarrenNetwork.

Referenced by Rabbit_Male::st_EvaluateTerritory(), and Rabbit_Female::st_EvaluateTerritory().

1908 {
1913  // Pick a warren
1914  int nsz = (int) m_LocalWarrenNetwork.size();
1915  int loopstart = (int) floor(nsz * g_rand_uni());
1916  for (int i=0; i< nsz; i++ )
1917  {
1918  double chance = g_rand_uni();
1919  int index = (i + loopstart);
1920  if (index >= nsz) index-=nsz;
1921  if (chance>m_LocalWarrenNetwork[i].m_visitprob)
1922  {
1923  return m_LocalWarrenNetwork[i].m_aWarren;
1924  }
1925  }
1926  return NULL;
1927 }
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
vector< LocalWarrenNewtorkEntry > m_LocalWarrenNetwork
List of local warrens and their accessibility from this warren.
Definition: Rabbit.h:750
APoint Rabbit_Warren::GetPointTL ( )
inline

Get the TL coords as a point.

Definition at line 568 of file Rabbit.h.

568 { APoint TL; TL.m_x=m_TL_x; TL.m_y=m_TL_y; return TL; }
int m_TL_y
Stores original m_Location_y.
Definition: Rabbit.h:700
int m_TL_x
Stores original m_Location_x.
Definition: Rabbit.h:698
int Rabbit_Warren::GetPopulationSize ( )
inline

Gets the total warren population of rabbits.

Definition at line 572 of file Rabbit.h.

Referenced by Rabbit_Male::st_EvaluateTerritory().

572 { return (int)m_InhabitantsList.size(); }
vector< Rabbit_Base * > m_InhabitantsList
List of rabbits that live here - for easy communication purposes.
Definition: Rabbit.h:752
int Rabbit_Warren::GetRabbitProductionRecord ( RabbitObjectTypes  YoungType)
inline

Get data about production of rabbits throughout year.

Definition at line 584 of file Rabbit.h.

584 { return m_ThisYearsProduction[YoungType]; }
int m_ThisYearsProduction[rob_foobar]
Storage for rabbit production data.
Definition: Rabbit.h:744
int Rabbit_Warren::GetSoilType ( void  )
inline

Gets the warren soil type.

Definition at line 632 of file Rabbit.h.

632 { return m_soiltype; }
int m_soiltype
Variable holding the soil type, 1 = heavy, 0 = sandy, 3 = unsuitable (never used in warrens) ...
Definition: Rabbit.h:720
int Rabbit_Warren::GetTempForageAreaVeg ( void  )
protected

Returns the total area of temporary forage based on veg height.

This returns the temporary forge area calcuated by element type and vegetation height.

Definition at line 1780 of file Rabbit.cpp.

References m_LEList, m_maxForageHeight, and torh_TemporaryForage.

1781 {
1785  int area = 0;
1786  for (vector<RabbitWarrenLEInfo>::size_type k=0; k<m_LEList.size(); k++)
1787  {
1788  if (m_LEList[k].m_torh == torh_TemporaryForage)
1789  {
1790  if (m_LEList[k].m_ele->GetVegHeight() < m_maxForageHeight )
1791  {
1792  area += m_LEList[k].m_area;
1793  }
1794  }
1795  }
1796  return area;
1797 }
vector< RabbitWarrenLEInfo > m_LEList
List of polygons and the area which is part of the warren.
Definition: Rabbit.h:748
static double m_maxForageHeight
The maximum vegetation height assumed for forage potential.
Definition: Rabbit.h:541
int Rabbit_Warren::GetTemporaryForageArea ( void  )
protected

Returns the total area of temporary forage.

This returns the forge area calcuated by element type. This is probably mis-leading and the GetTemporaryForageAreaVeg() is better representative of the forage levels.

Definition at line 1752 of file Rabbit.cpp.

References m_LEList, and torh_TemporaryForage.

1753 {
1757  int area = 0;
1758  for (vector<RabbitWarrenLEInfo>::size_type k=0; k<m_LEList.size(); k++)
1759  {
1760  if (m_LEList[k].m_torh == torh_TemporaryForage) area += m_LEList[k].m_area;
1761  }
1762  return area;
1763 }
vector< RabbitWarrenLEInfo > m_LEList
List of polygons and the area which is part of the warren.
Definition: Rabbit.h:748
int Rabbit_Warren::GetThisYears1yrOldFemales ( )
inline

Returns the number of 1yr old females.

Definition at line 666 of file Rabbit.h.

666  {
667  return m_1yrOldFemales;
668  }
int m_1yrOldFemales
The number of 1 year old females.
Definition: Rabbit.h:547
int Rabbit_Warren::GetThisYearsBreeders ( )
inline

Returns the number of females breeding this year.

Definition at line 654 of file Rabbit.h.

654  {
655  return m_breedingfemales;
656  }
int m_breedingfemales
The number of females that bred this year.
Definition: Rabbit.h:545
double Rabbit_Warren::GetThisYearsBreedersAv ( )
inline

Returns the number of females breeding this year.

Definition at line 658 of file Rabbit.h.

658  {
659  double av = 0;
660  if (m_runningavCount>0) av = m_runningavFemales / static_cast<double>(m_runningavCount);
661  m_runningavFemales = 0;
662  m_runningavCount = 0;
663  return av;
664  }
int m_runningavFemales
Keeps track of the number of breeding females.
Definition: Rabbit.h:756
int m_runningavCount
Keeps track of the number of breeding days.
Definition: Rabbit.h:758
int Rabbit_Warren::GetThisYearsNonBreeders ( )
inline

Returns the number of females not breeding this year but older than 1 year.

Definition at line 674 of file Rabbit.h.

674  {
675  return m_nonbreedingfemales;
676  }
int m_nonbreedingfemales
The number of females that did not breed this year but are older than 1 year.
Definition: Rabbit.h:551
void Rabbit_Warren::InitEvaluation ( void  )
protected

Intiates the evaluation of the warren area.

This method is called when the warren in initially formed and is repsponsible for making the calcuations of forage and cover areas and then calculating the carrying capacity of the warren if fully occupied.

First fix any wrap-around problems.

Next loop through the area and find all the polygons and areas.

This is done by getting the polygon references and checking if we had this one already. If not save it with an area of 1 otherwise increment the correct record by 1.

Once all polygons are identified and counted then they are classified.

Next the carrying capacity is calculated. This is based on forage area possible and is the number of pairs possible.

We assume that the carrying capacity of sandy soil warrens is halved, unless there is only room for one burrow anyway.

Definition at line 1491 of file Rabbit.cpp.

References CalcForageArea(), CalcPermForageArea(), cfg_rabbitdendepscaler, cfg_rabbitmaxwarrensize, cfg_rabbitminwarrensize, Rabbit_Population_Manager::ClassifyHabitat(), RabbitWarrenLEInfo::m_area, m_CarryingCapacity, m_CarryingCapacityR, m_CarryingCapacityR2, RabbitWarrenLEInfo::m_ele, RabbitWarrenLEInfo::m_forage, RabbitWarrenLEInfo::m_foragearea, m_foragearea, m_foragesize, m_LEList, m_NoBurrows, TAnimal::m_OurLandscape, m_OurPopulationManager, m_permforagearea, RabbitWarrenLEInfo::m_pesticide_conc, RabbitWarrenLEInfo::m_ref, m_size, m_soiltype, m_TL_x, m_TL_y, Landscape::SupplyLEPointer(), Landscape::SupplyPolyRef(), Landscape::SupplySimAreaHeight(), Landscape::SupplySimAreaWidth(), torh_Forage, torh_TemporaryForage, and CfgFloat::value().

Referenced by Rabbit_Warren().

1492 {
1505  for (int i=m_TL_x; i<m_TL_x + m_foragesize; i++)
1506  {
1507  for (int j=m_TL_y; j<m_TL_y + m_foragesize; j++)
1508  {
1512  int PRef = m_OurLandscape->SupplyPolyRef(i,j);
1513  bool found=false;
1514  for (vector<RabbitWarrenLEInfo>::size_type k=0; k<m_LEList.size(); k++)
1515  {
1516  if (m_LEList[k].m_ref == PRef)
1517  {
1518  m_LEList[k].m_area++;
1519  found = true;
1520  break;
1521  }
1522  }
1523  if (!found)
1524  {
1525  RabbitWarrenLEInfo a_ele;
1526  a_ele.m_ref = PRef;
1527  a_ele.m_area = 1;
1529  a_ele.m_pesticide_conc = 0;
1530  a_ele.m_forage = 0;
1531  a_ele.m_foragearea = 0;
1532  // don't have this one
1533  m_LEList.push_back(a_ele);
1534  }
1535  }
1536  }
1538  for (vector<RabbitWarrenLEInfo>::size_type k=0; k<m_LEList.size(); k++)
1539  {
1540  TTypesOfLandscapeElement tole = m_LEList[k].m_ele->GetElementType();
1541  m_LEList[k].m_torh = m_OurPopulationManager->ClassifyHabitat(tole);
1542  // Do a little bit of forage managing here
1543  if (m_LEList[k].m_torh == torh_Forage) m_LEList[k].m_foragearea = m_LEList[k].m_area;
1544  else if (m_LEList[k].m_torh == torh_TemporaryForage)
1545  {
1546  // We assume only 50 m strip of fields is usable
1547  int fr = 50 * m_size;
1548  if (m_LEList[k].m_area < fr) fr = m_LEList[k].m_area;
1549  m_LEList[k].m_foragearea = fr;
1550  }
1551  else m_LEList[k].m_foragearea = 0;
1552  }
1556  double minpct = 1.0 / 16.0; // Divide by 16 because the minimum is based on 1/16th of the area used for forage
1557  double pct = m_foragearea/ (double) (m_foragesize * m_foragesize);
1558  if (pct<minpct)
1559  {
1560  // We have a problem, no rabbits can be here
1561  m_CarryingCapacity = 0;
1562  return;
1563  }
1564  if (pct > 0.9) pct = 0.9;
1565  // 1 is the lowest density until soil type is taken into account
1566  // We use the diff between min and actual pct cover, and then add pro-rata the extra proportion of 12 pairs
1567  // NB minpct must never be >= 0.9
1568  m_CarryingCapacity = static_cast<int>(cfg_rabbitminwarrensize.value() + (int)((pct - minpct) / (0.9 - minpct) * cfg_rabbitmaxwarrensize.value())); // e.g. 3 + (0.1 / 0.8 *9) = 3+1.5 for minpct 0.2, pct 0.3
1569  if (m_soiltype == 0) m_CarryingCapacity /= 2;
1570  m_NoBurrows = 0;
1572  m_CarryingCapacityR2 = m_CarryingCapacityR / 2.0; // Done here once to prevent it being recalculated possibly a lot of times later.
1573 
1574 }
int SupplyPolyRef(int a_x, int a_y)
Definition: landscape.h:1414
int CalcPermForageArea(void)
Returns the total area of permanent forage.
Definition: Rabbit.cpp:1738
LE * SupplyLEPointer(int a_polyref)
Definition: landscape.h:1020
int CalcForageArea(void)
Returns the total area of forage.
Definition: Rabbit.cpp:1724
int m_TL_y
Stores original m_Location_y.
Definition: Rabbit.h:700
CfgFloat cfg_rabbitdendepscaler("RABBIT_DENSITYDEPSCALER", CFG_CUSTOM, 4.5)
Input variable. Average family size for calculating carrying capacity.
int m_soiltype
Variable holding the soil type, 1 = heavy, 0 = sandy, 3 = unsuitable (never used in warrens) ...
Definition: Rabbit.h:720
int m_size
Warren core size in m.
Definition: Rabbit.h:694
double value(void)
Definition: configurator.h:107
int SupplySimAreaWidth(void)
Definition: landscape.h:1558
Rabbit_Population_Manager * m_OurPopulationManager
This is a time saving pointer to the correct population manager object.
Definition: Rabbit.h:754
double m_CarryingCapacityR
Records the max number of rabbits possible here.
Definition: Rabbit.h:706
static CfgFloat cfg_rabbitminwarrensize("RABBIT_MINWARRENSIZE", CFG_CUSTOM, 2)
The minimum size of a warren.
int m_CarryingCapacity
Records the max number of rabbit pairs possible here.
Definition: Rabbit.h:704
The basic information needed for an LE present in a warren area.
Definition: Rabbit.h:119
vector< RabbitWarrenLEInfo > m_LEList
List of polygons and the area which is part of the warren.
Definition: Rabbit.h:748
double m_pesticide_conc
Definition: Rabbit.h:124
TTypesOfRabbitHabitat ClassifyHabitat(TTypesOfLandscapeElement a_tole)
Classify a landscape element type according to the rabbit habitat classification. ...
int SupplySimAreaHeight(void)
Definition: landscape.h:1563
int m_foragesize
Warren forage size in m.
Definition: Rabbit.h:696
static CfgFloat cfg_rabbitmaxwarrensize("RABBIT_MAXWARRENSIZE", CFG_CUSTOM, 10)
Use to calculate the maximum size of a warren. Add min to get the real maximum warren size...
int m_permforagearea
Variable holding the total permanent forage area.
Definition: Rabbit.h:724
Landscape * m_OurLandscape
int m_NoBurrows
Records the maintenence restricted current carrying capacity (burrow number)
Definition: Rabbit.h:714
TTypesOfLandscapeElement
double m_forage
Definition: Rabbit.h:125
double m_CarryingCapacityR2
Records the max number of rabbits possible here divided by 2.
Definition: Rabbit.h:708
int m_foragearea
Variable holding the total potential forage area.
Definition: Rabbit.h:726
int m_TL_x
Stores original m_Location_x.
Definition: Rabbit.h:698
int Rabbit_Warren::IsFreeBurrow ( void  )

Is there a vacent burrow?

Here we need to determine if there are free burrows, but also what to do about an unoccupied location. If the warren is unoccupied then we need to arrange for the rabbit to slowly make burrow.

Returns
0 if all burrows are occupied
1 if there is a free burrow
2 if the warren is unoccupied and needs a burrow dug or if there is room to make a new burrow

Definition at line 2029 of file Rabbit.cpp.

References DEBUG_InternalTest(), DEBUG_InternalTest2(), m_BurrowsUnderConstruction, m_CarryingCapacity, m_NoBurrows, and m_NoOccupiedBurrows.

Referenced by Rabbit_Male::st_EvaluateTerritory(), and Rabbit_Female::st_EvaluateTerritory().

2030 {
2039 #ifdef __RABBITDEBUG
2040  this->DEBUG_InternalTest();
2041 #endif
2042 
2044  {
2045 #ifdef __RABBITDEBUG
2046  this->DEBUG_InternalTest2();
2047 #endif
2048  return 1; // There is a free burrow
2049  }
2051  return 0;
2052 }
int m_NoOccupiedBurrows
Records the burrows that are occupied.
Definition: Rabbit.h:716
int m_CarryingCapacity
Records the max number of rabbit pairs possible here.
Definition: Rabbit.h:704
bool DEBUG_InternalTest()
Definition: Rabbit.cpp:2292
int m_NoBurrows
Records the maintenence restricted current carrying capacity (burrow number)
Definition: Rabbit.h:714
bool DEBUG_InternalTest2()
Definition: Rabbit.cpp:2344
int m_BurrowsUnderConstruction
Records the burrows that are being dug.
Definition: Rabbit.h:718
bool Rabbit_Warren::IsFreeFemale ( void  )

Returns true if there is a female with a burrow and no mate.

Returns
false if none, true if unmated female found Checks the list of residents for a female with a burrow and no mate.

Definition at line 1973 of file Rabbit.cpp.

References m_InhabitantsList, and rob_Female.

Referenced by Rabbit_Male::st_EvaluateTerritory().

1973  {
1978  int sz = (int)m_InhabitantsList.size();
1979  for (int i = 0; i<sz; i++) {
1980  if (m_InhabitantsList[ i ]->GetRabbitType() == rob_Female) {
1981  if (m_InhabitantsList[ i ]->GetMate() == NULL) {
1982  if ((m_InhabitantsList[ i ]->GetHasBurrow()) || (m_InhabitantsList[ i ]->GetDigging() > -1)) return true;
1983  }
1984  }
1985  }
1986  return false;
1987 }
vector< Rabbit_Base * > m_InhabitantsList
List of rabbits that live here - for easy communication purposes.
Definition: Rabbit.h:752
bool Rabbit_Warren::IsFreeMale ( void  )

Returns true if there is a male with a burrow and no mate.

Returns
false if none, true if unmated male found Checks the list of residents for a male with a burrow and no mate.

Definition at line 2008 of file Rabbit.cpp.

References m_InhabitantsList, and rob_Male.

Referenced by Rabbit_Female::st_EvaluateTerritory(), and Rabbit_Female::st_UpdateBreedingStatus().

2009 {
2014  int sz = (int) m_InhabitantsList.size();
2015  for (int i=0; i<sz; i++)
2016  {
2017  if ( m_InhabitantsList[i]->GetRabbitType() == rob_Male )
2018  {
2019  if ( m_InhabitantsList[i]->GetMate()==NULL )
2020  {
2021  if ( (m_InhabitantsList[i]->GetHasBurrow() ) || ( m_InhabitantsList[i]->GetDigging() > -1) ) return true;
2022  }
2023  }
2024  }
2025  return false;
2026 }
vector< Rabbit_Base * > m_InhabitantsList
List of rabbits that live here - for easy communication purposes.
Definition: Rabbit.h:752
bool Rabbit_Warren::IsMember ( Rabbit_Base a_rabbit)

Returns true if this rabbit belongs to the warren.

Returns
false if none, true if unmated male found Checks the list of residents for a male with a burrow and no mate.

Definition at line 1990 of file Rabbit.cpp.

References m_InhabitantsList.

Referenced by Rabbit_Female::Rabbit_Female(), and Rabbit_Female::st_EvaluateTerritory().

1991 {
1996  int sz = (int) m_InhabitantsList.size();
1997  for (int i=0; i<sz; i++)
1998  {
1999  if (m_InhabitantsList[i] == a_rabbit )
2000  {
2001  return true;
2002  }
2003  }
2004  return false;
2005 }
vector< Rabbit_Base * > m_InhabitantsList
List of rabbits that live here - for easy communication purposes.
Definition: Rabbit.h:752
void Rabbit_Warren::Join ( Rabbit_Base a_rabbit)

Adds this rabbit to the warren list.

Join a warren.

Definition at line 2055 of file Rabbit.cpp.

References m_InhabitantsList, and Rabbit_Base::SetWarren().

Referenced by JoinNMate(), JoinNOccupy(), OccupyWarren(), Rabbit_Base::Rabbit_Base(), Rabbit_Male::st_EvaluateTerritory(), and Rabbit_Female::st_EvaluateTerritory().

2056 {
2058  m_InhabitantsList.push_back(a_rabbit);
2059  a_rabbit->SetWarren(this);
2060 }
vector< Rabbit_Base * > m_InhabitantsList
List of rabbits that live here - for easy communication purposes.
Definition: Rabbit.h:752
void SetWarren(Rabbit_Warren *a_warren)
Set the warren pointer.
Definition: Rabbit.h:238
void Rabbit_Warren::JoinNMate ( Rabbit_Adult a_mate,
RabbitObjectTypes  rob_type 
)

Adds this rabbit to the warren list and mate him with un-mated female/male with a burrow.

Loops through the list of warren inhabitants and looks for the target type rob_type. If found without a mate then ascertain if they have a burrow. Social status will depend on whether one or both is available.

Definition at line 2218 of file Rabbit.cpp.

References DEBUG_InternalTest(), Rabbit_Base::GetDigging(), Rabbit_Base::GetHasBurrow(), Rabbit_Adult::GetMate(), Join(), m_InhabitantsList, rabbit_socialstatus_subdominant, rabbit_socialstatus_subordinate, Rabbit_Base::SetDigging(), Rabbit_Base::SetHasBurrow(), Rabbit_Adult::SetMate(), and Rabbit_Adult::SetSocialStatus().

Referenced by Rabbit_Male::st_EvaluateTerritory(), and Rabbit_Female::st_EvaluateTerritory().

2219 {
2224 #ifdef __RABBITDEBUG
2225  this->DEBUG_InternalTest();
2226 #endif
2227  int sz = (int) m_InhabitantsList.size();
2228  for (int r=0; r<sz; r++)
2229  {
2230  Rabbit_Adult* p_rabAdult = dynamic_cast<Rabbit_Adult*>(m_InhabitantsList[ r ]);
2231  if ((m_InhabitantsList[r]->GetRabbitType() == rob_type) && (p_rabAdult->GetMate() == NULL) )
2232  {
2233 #ifdef __RABBITDEBUG
2234  this->DEBUG_InternalTest();
2235 #endif
2236  if (p_rabAdult->GetHasBurrow())
2237  {
2238  a_mate->SetDigging(-1);
2239  a_mate->SetMate(dynamic_cast<Rabbit_Adult*>(m_InhabitantsList[r]));
2240  a_mate->SetHasBurrow(true);
2243  p_rabAdult->SetMate( a_mate );
2244  Join(a_mate);
2245  break;
2246  }
2247  else
2248  if (p_rabAdult->GetDigging() > -1)
2249  {
2250  a_mate->SetMate( p_rabAdult );
2253  p_rabAdult->SetMate( a_mate );
2254  int digging = p_rabAdult->GetDigging();
2255  a_mate->SetDigging(digging);
2256  Join(a_mate);
2257  break;
2258  }
2259 
2260  }
2261  }
2262 #ifdef __RABBITDEBUG
2263  this->DEBUG_InternalTest();
2264 #endif
2265 }
void SetSocialStatus(TTypesOfRabbitSocialStatus a_status)
Sets the dominance status.
Definition: Rabbit.h:391
void SetHasBurrow(bool a_status)
Set/unset burrow status.
Definition: Rabbit.h:246
vector< Rabbit_Base * > m_InhabitantsList
List of rabbits that live here - for easy communication purposes.
Definition: Rabbit.h:752
void SetMate(Rabbit_Adult *a_mate)
Set/unset mate status.
Definition: Rabbit.cpp:606
virtual Rabbit_Adult * GetMate(void)
Get mate pointer.
Definition: Rabbit.h:397
int GetDigging()
Get number of days to dig.
Definition: Rabbit.h:254
The rabbit adult class. All generic adult behaviour is described here.
Definition: Rabbit.h:378
void Join(Rabbit_Base *a_rabbit)
Adds this rabbit to the warren list.
Definition: Rabbit.cpp:2055
bool DEBUG_InternalTest()
Definition: Rabbit.cpp:2292
void SetDigging(int a_days)
Set number of days to dig.
Definition: Rabbit.h:250
bool GetHasBurrow(void)
Get burrow status.
Definition: Rabbit.h:242
void Rabbit_Warren::JoinNOccupy ( Rabbit_Adult a_rabbit)

Adds this adult to the warren list and house them in a suitable burrow.

Join a warren and occupy a burrow.

Definition at line 2085 of file Rabbit.cpp.

References DEBUG_InternalTest(), DEBUG_InternalTest2(), Join(), m_NoBurrows, m_NoOccupiedBurrows, TAnimal::m_OurLandscape, OccupyBurrow(), rabbit_socialstatus_subdominant, Rabbit_Base::SetDigging(), Rabbit_Base::SetHasBurrow(), Rabbit_Adult::SetSocialStatus(), and Landscape::Warn().

Referenced by Rabbit_Male::st_EvaluateTerritory(), and Rabbit_Female::st_EvaluateTerritory().

2086 {
2088 #ifdef __RABBITDEBUG
2089  // Do some safety checks here.
2090  if ((m_NoBurrows <= m_NoOccupiedBurrows) && (m_NoBurrows!=0))
2091  {
2092  m_OurLandscape->Warn("Rabbit_Warren::JoinNOccupy","Attempt to occupy a burrow that is occupied or does not exist.");
2093  exit(1);
2094  }
2095 #endif
2096 #ifdef __RABBITDEBUG
2097  this->DEBUG_InternalTest2();
2098 #endif
2099  Join(a_rabbit);
2100  OccupyBurrow( );
2101  a_rabbit->SetDigging(-1);
2103  a_rabbit->SetHasBurrow( true );
2104 
2105 #ifdef __RABBITDEBUG
2106  this->DEBUG_InternalTest();
2107 #endif
2108 }
void SetSocialStatus(TTypesOfRabbitSocialStatus a_status)
Sets the dominance status.
Definition: Rabbit.h:391
void SetHasBurrow(bool a_status)
Set/unset burrow status.
Definition: Rabbit.h:246
int m_NoOccupiedBurrows
Records the burrows that are occupied.
Definition: Rabbit.h:716
void Join(Rabbit_Base *a_rabbit)
Adds this rabbit to the warren list.
Definition: Rabbit.cpp:2055
bool DEBUG_InternalTest()
Definition: Rabbit.cpp:2292
Landscape * m_OurLandscape
void SetDigging(int a_days)
Set number of days to dig.
Definition: Rabbit.h:250
void OccupyBurrow()
a_rabbit occupies a free burrow
Definition: Rabbit.cpp:2071
int m_NoBurrows
Records the maintenence restricted current carrying capacity (burrow number)
Definition: Rabbit.h:714
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1505
bool DEBUG_InternalTest2()
Definition: Rabbit.cpp:2344
void Rabbit_Warren::Leave ( Rabbit_Base a_rabbit)

Remove this adult from the warren list.

A rabbit is leaving. It may be because they are dead or because they are moving warrens, or just leaving. The rabbit:rabbit interactions are dealt with by the rabbit objects communicating, but burrow occupancy needs to be sorted out here. Both completed and burrows being dug need to be dealt with.

Definition at line 2111 of file Rabbit.cpp.

References Rabbit_Base::GetCurrentRState(), TALMaSSObject::GetCurrentStateNo(), Rabbit_Base::GetDigging(), Rabbit_Base::GetHasBurrow(), Rabbit_Base::GetMate(), Rabbit_Base::GetRabbitType(), m_BurrowsUnderConstruction, m_InhabitantsList, m_NoOccupiedBurrows, TAnimal::m_OurLandscape, rob_Juvenile, rob_Male, Rabbit_Base::SetDigging(), Rabbit_Base::SetHasBurrow(), Rabbit_Base::SetWarren(), toRabbits_Die, and Landscape::Warn().

Referenced by Rabbit_Adult::st_Dying(), Rabbit_Male::st_EvaluateTerritory(), Rabbit_Female::st_EvaluateTerritory(), and Rabbit_Base::~Rabbit_Base().

2112 {
2118  int sz = (int) m_InhabitantsList.size();
2119  for (int i=0; i<sz; i++)
2120  {
2121  if (m_InhabitantsList[i]==a_rabbit)
2122  {
2123  // Found the rabbit.
2124 #ifdef __RABBITDEBUG
2125  // Do some safety checks here.
2126  if ( (a_rabbit->GetRabbitType() >= rob_Male ) && (a_rabbit->GetCurrentRState() != toRabbits_Die) )
2127  {
2128  if ((a_rabbit->GetMate()!=NULL) && (a_rabbit->GetCurrentStateNo() != -1))
2129  {
2130  m_OurLandscape->Warn("Rabbit_Warren::Leave","Attempt to leave a warren with a mate.");
2131  exit(1);
2132  }
2133  // Do some safety checks here.
2134  if ((m_InhabitantsList[i]->GetHasBurrow()) && (a_rabbit->GetMate() != NULL) && (a_rabbit->GetCurrentStateNo() != -1))
2135  {
2136  m_OurLandscape->Warn("Rabbit_Warren::Leave","Attempt to leave a warren with a burrow and mate.");
2137  exit(1);
2138  }
2139  }
2140 #endif
2141  if (a_rabbit->GetRabbitType() > rob_Juvenile)
2142  {
2143  if ((a_rabbit->GetHasBurrow()) && (a_rabbit->GetMate() == NULL)) {
2144  // Single burrow occupier leaving
2146  a_rabbit->SetHasBurrow( false );
2147  }
2148  if ((a_rabbit->GetDigging()!=-1) && (a_rabbit->GetMate() == NULL)) {
2149  // Single digger leaving
2151  a_rabbit->SetDigging( -1 );
2152  }
2153  }
2154  a_rabbit->SetWarren(NULL);
2155  // remove the rabbit from the warren list
2156  m_InhabitantsList.erase(m_InhabitantsList.begin() + i);
2157  break;
2158  }
2159  }
2160 }
virtual Rabbit_Adult * GetMate(void)
Get mate pointer.
Definition: Rabbit.h:288
void SetHasBurrow(bool a_status)
Set/unset burrow status.
Definition: Rabbit.h:246
vector< Rabbit_Base * > m_InhabitantsList
List of rabbits that live here - for easy communication purposes.
Definition: Rabbit.h:752
int GetDigging()
Get number of days to dig.
Definition: Rabbit.h:254
int m_NoOccupiedBurrows
Records the burrows that are occupied.
Definition: Rabbit.h:716
Landscape * m_OurLandscape
void SetDigging(int a_days)
Set number of days to dig.
Definition: Rabbit.h:250
TTypeOfRabbitState GetCurrentRState()
Definition: Rabbit.h:210
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1505
RabbitObjectTypes GetRabbitType(void)
Get rabbit type.
Definition: Rabbit.h:218
int m_BurrowsUnderConstruction
Records the burrows that are being dug.
Definition: Rabbit.h:718
void SetWarren(Rabbit_Warren *a_warren)
Set the warren pointer.
Definition: Rabbit.h:238
int GetCurrentStateNo()
Returns the current state number.
bool GetHasBurrow(void)
Get burrow status.
Definition: Rabbit.h:242
void Rabbit_Warren::Mate ( Rabbit_Adult a_mate,
RabbitObjectTypes  rob_type 
)

Mate him with un-mated female/male with a burrow.

Mates two rabbits and also takes care of deciding whether they need to dig a burrow, and sets the social status.

Definition at line 2163 of file Rabbit.cpp.

References DEBUG_InternalTest(), Rabbit_Base::GetDigging(), Rabbit_Base::GetHasBurrow(), Rabbit_Adult::GetMate(), m_InhabitantsList, m_NoOccupiedBurrows, rabbit_socialstatus_subdominant, rabbit_socialstatus_subordinate, Rabbit_Base::SetDigging(), Rabbit_Base::SetHasBurrow(), Rabbit_Adult::SetMate(), and Rabbit_Adult::SetSocialStatus().

Referenced by Rabbit_Male::st_EvaluateTerritory(), Rabbit_Female::st_EvaluateTerritory(), and Rabbit_Female::st_UpdateBreedingStatus().

2164 {
2168 #ifdef __RABBITDEBUG
2169  this->DEBUG_InternalTest();
2170 #endif
2171  int sz = (int) m_InhabitantsList.size();
2172  for (int i=0; i<sz; i++)
2173  {
2174  Rabbit_Adult * p_rabAdult = dynamic_cast<Rabbit_Adult*>(m_InhabitantsList[ i ]);
2175  if ((m_InhabitantsList[ i ]->GetRabbitType() == rob_type) && (p_rabAdult->GetMate() == NULL))
2176  {
2177  if (p_rabAdult->GetHasBurrow())
2178  {
2179 #ifdef __RABBITDEBUG
2180  if (p_rabAdult->GetDigging() != -1)
2181  {
2182  int rubbish = 0;
2183  }
2184 #endif
2185  a_mate->SetDigging( -1 );
2186  a_mate->SetMate( p_rabAdult );
2187  p_rabAdult->SetMate( a_mate );
2188  // If the rabbit already has a burrow then we have a free one now
2189  if (a_mate->GetHasBurrow()) {
2191  }
2192  else a_mate->SetHasBurrow( true );
2195  break;
2196  }
2197  else
2198  if (p_rabAdult->GetDigging() > -1)
2199  {
2200  a_mate->SetMate(dynamic_cast<Rabbit_Adult*>(m_InhabitantsList[i]));
2201  p_rabAdult->SetMate( a_mate );
2202  int digging = p_rabAdult->GetDigging() / 2; // We have help so half the time
2203  p_rabAdult->SetDigging( digging );
2204  a_mate->SetDigging(digging);
2207  break;
2208  }
2209  // Else they are not interesting and we ignore them
2210  }
2211  }
2212 #ifdef __RABBITDEBUG
2213  this->DEBUG_InternalTest();
2214 #endif
2215 }
void SetSocialStatus(TTypesOfRabbitSocialStatus a_status)
Sets the dominance status.
Definition: Rabbit.h:391
void SetHasBurrow(bool a_status)
Set/unset burrow status.
Definition: Rabbit.h:246
vector< Rabbit_Base * > m_InhabitantsList
List of rabbits that live here - for easy communication purposes.
Definition: Rabbit.h:752
void SetMate(Rabbit_Adult *a_mate)
Set/unset mate status.
Definition: Rabbit.cpp:606
virtual Rabbit_Adult * GetMate(void)
Get mate pointer.
Definition: Rabbit.h:397
int GetDigging()
Get number of days to dig.
Definition: Rabbit.h:254
int m_NoOccupiedBurrows
Records the burrows that are occupied.
Definition: Rabbit.h:716
The rabbit adult class. All generic adult behaviour is described here.
Definition: Rabbit.h:378
bool DEBUG_InternalTest()
Definition: Rabbit.cpp:2292
void SetDigging(int a_days)
Set number of days to dig.
Definition: Rabbit.h:250
bool GetHasBurrow(void)
Get burrow status.
Definition: Rabbit.h:242
void Rabbit_Warren::NetworkEvaluation ( void  )

Calculates and saves distance probabilities.

We need to randomise the list because otherwise the probability will always favour the first ones added - which causes NE movement in general

Definition at line 1709 of file Rabbit.cpp.

References m_foragesize, and m_LocalWarrenNetwork.

1710 {
1711  int nsz = (int) m_LocalWarrenNetwork.size();
1715  random_shuffle (m_LocalWarrenNetwork.begin(), m_LocalWarrenNetwork.end() );
1716  for (int i=0; i< nsz; i++ )
1717  {
1718  // Probability calculated as m_size/dist
1719  m_LocalWarrenNetwork[i].m_visitprob = m_foragesize / (double) (m_LocalWarrenNetwork[i].m_dist);
1720  }
1721 }
int m_foragesize
Warren forage size in m.
Definition: Rabbit.h:696
vector< LocalWarrenNewtorkEntry > m_LocalWarrenNetwork
List of local warrens and their accessibility from this warren.
Definition: Rabbit.h:750
void Rabbit_Warren::OccupyBurrow ( )

a_rabbit occupies a free burrow

Definition at line 2071 of file Rabbit.cpp.

References m_NoOccupiedBurrows.

Referenced by JoinNOccupy(), Rabbit_Male::st_EvaluateTerritory(), and Rabbit_Female::st_EvaluateTerritory().

2072 {
2074 }
int m_NoOccupiedBurrows
Records the burrows that are occupied.
Definition: Rabbit.h:716
void Rabbit_Warren::OccupyNewBurrow ( )

a_rabbit occupies a newly dug burrow

Definition at line 2063 of file Rabbit.cpp.

References m_BurrowsUnderConstruction, m_NoBurrows, and m_NoOccupiedBurrows.

Referenced by Rabbit_Adult::EndStep().

2064 {
2066  m_NoBurrows++;
2068 }
int m_NoOccupiedBurrows
Records the burrows that are occupied.
Definition: Rabbit.h:716
int m_NoBurrows
Records the maintenence restricted current carrying capacity (burrow number)
Definition: Rabbit.h:714
int m_BurrowsUnderConstruction
Records the burrows that are being dug.
Definition: Rabbit.h:718
void Rabbit_Warren::OccupyWarren ( Rabbit_Adult a_rabbit)

Adds the first rabbit to the warren list.

Definition at line 2077 of file Rabbit.cpp.

References Join(), m_BurrowsUnderConstruction, m_rabbitdiggingtime, and Rabbit_Base::SetDigging().

Referenced by Rabbit_Male::st_EvaluateTerritory(), and Rabbit_Female::st_EvaluateTerritory().

2078 {
2080  a_rabbit->SetDigging( m_rabbitdiggingtime ); // Heavy soil has double digging time
2081  Join(a_rabbit);
2082 }
void Join(Rabbit_Base *a_rabbit)
Adds this rabbit to the warren list.
Definition: Rabbit.cpp:2055
int m_rabbitdiggingtime
The time taken for burrow construction.
Definition: Rabbit.h:722
void SetDigging(int a_days)
Set number of days to dig.
Definition: Rabbit.h:250
int m_BurrowsUnderConstruction
Records the burrows that are being dug.
Definition: Rabbit.h:718
void Rabbit_Warren::RabbitProductionRecord ( RabbitObjectTypes  YoungType,
int  kits 
)
inline

Stores data about production of rabbits throughout year.

Definition at line 582 of file Rabbit.h.

Referenced by Rabbit_Female::Rabbit_Female(), Rabbit_Juvenile::Rabbit_Juvenile(), Rabbit_Male::Rabbit_Male(), and Rabbit_Female::st_GiveBirth().

582 { m_ThisYearsProduction[YoungType] += kits; }
int m_ThisYearsProduction[rob_foobar]
Storage for rabbit production data.
Definition: Rabbit.h:744
void Rabbit_Warren::ResetAllRabbitProductionRecord ( void  )
inline

Reset data about production of rabbits throughout year.

Definition at line 588 of file Rabbit.h.

References rob_foobar, and rob_Young.

Referenced by Rabbit_Warren().

588 { for (int r = (int) rob_Young; r < (int) rob_foobar; r++) m_ThisYearsProduction[r] = 0; }
int m_ThisYearsProduction[rob_foobar]
Storage for rabbit production data.
Definition: Rabbit.h:744
void Rabbit_Warren::ResetRabbitProductionRecord ( RabbitObjectTypes  YoungType)
inline

Reset specific data about production of rabbits throughout year.

Definition at line 586 of file Rabbit.h.

586 { m_ThisYearsProduction[YoungType] = 0; }
int m_ThisYearsProduction[rob_foobar]
Storage for rabbit production data.
Definition: Rabbit.h:744
void Rabbit_Warren::st_WarrenBeing ( void  )
protected

The only warren behaviour - it just is.

This is the only warren behaviour - the warren just is, and this is where any daily updates to its status are performed.

First daily job it to determine whether warren maintenence should be kept up, increased or decreased. Then use this to determine the current burrow state. Then a check is made for a dominant female. If there is one then OK, otherwise see if one can be made.

Next the food availability is calculated. This is a cominbination of permanent forage and suitable temporary forage.

Finally if there is any chance that there is some pesticide to take into account the UpdatePesticide method is called.

Definition at line 1859 of file Rabbit.cpp.

References cfg_forageareamortscaler, DEBUG_InternalTest(), GetAllBreedingFemaleRabbits(), Rabbit_Population_Manager::GetForageDay(), Rabbit_Population_Manager::IsBreedingSeason(), m_diseaseconstant, m_InhabitantsList, m_maintenence, m_mortalitymultiplierA, m_mortalitymultiplierJ, m_NoBurrows, m_OurPopulationManager, m_rabbitdiggingtime, m_runningavCount, m_runningavFemales, m_soiltype, UpdateDominance(), UpdateForageInformation(), and CfgFloat::value().

Referenced by Step().

1860 {
1871 #ifdef __RABBITDEBUG
1873 #endif
1874 
1875  if (m_InhabitantsList.size() == 0)
1876  {
1877  m_maintenence -= 2 - m_soiltype; // Double rate of maintenence for light soil
1878  }
1880  if (m_maintenence < 0)
1881  {
1883  if (m_NoBurrows > 0) m_NoBurrows--;
1884  }
1885  // Dominance check
1886  UpdateDominance();
1887  // Food update
1889  // Now calculates the mortality chance for today
1890  double foragemult = 0;
1891  if (!m_OurPopulationManager->GetForageDay()) foragemult = 1 + cfg_forageareamortscaler.value(); // *(1 - m_availableforage); // m_foragearearatio is 0-1 and larger available forage is reduced.
1892  m_mortalitymultiplierA = 1 + m_diseaseconstant + foragemult; // Disease is the only density dependent death for adults
1893  // We need to de-couple mortality of juveniles and density
1894  m_mortalitymultiplierJ = 1 + foragemult;
1895 #ifdef __RABBITDEBUG
1897 #endif
1898  // Keep track of breeding females for POM
1900  m_runningavCount++;
1902  }
1903 }
vector< Rabbit_Base * > m_InhabitantsList
List of rabbits that live here - for easy communication purposes.
Definition: Rabbit.h:752
bool GetForageDay()
Get method for the forage day flag.
int GetAllBreedingFemaleRabbits()
Supplies the number of breeding rabbits currently in the warren.
Definition: Rabbit.cpp:2268
int m_runningavFemales
Keeps track of the number of breeding females.
Definition: Rabbit.h:756
int m_soiltype
Variable holding the soil type, 1 = heavy, 0 = sandy, 3 = unsuitable (never used in warrens) ...
Definition: Rabbit.h:720
double value(void)
Definition: configurator.h:107
Rabbit_Population_Manager * m_OurPopulationManager
This is a time saving pointer to the correct population manager object.
Definition: Rabbit.h:754
void UpdateForageInformation(void)
Updates the forage information depending upon the vegetation state.
Definition: Rabbit.cpp:1639
bool IsBreedingSeason(void)
Get whether it is breeding season.
int m_rabbitdiggingtime
The time taken for burrow construction.
Definition: Rabbit.h:722
void UpdateDominance(void)
Checks for a dominant female and promotes one if necessary and possible.
Definition: Rabbit.cpp:1930
double m_diseaseconstant
a measure of disease mortality likelihood
Definition: Rabbit.h:738
bool DEBUG_InternalTest()
Definition: Rabbit.cpp:2292
double m_mortalitymultiplierJ
a measure of mortality likelihood - juveniles
Definition: Rabbit.h:742
int m_NoBurrows
Records the maintenence restricted current carrying capacity (burrow number)
Definition: Rabbit.h:714
static CfgFloat cfg_forageareamortscaler("RABBIT_FORAGEAREAMORTSCALER", CFG_CUSTOM, 60.0)
Input variable. A constant used to increase bad weather mortality as a function of the proportion of ...
int m_maintenence
Warren maintenence score - if not max then houseing capacity is reduced.
Definition: Rabbit.h:702
double m_mortalitymultiplierA
a measure of mortality likelihood - adults
Definition: Rabbit.h:740
int m_runningavCount
Keeps track of the number of breeding days.
Definition: Rabbit.h:758
void Rabbit_Warren::Step ( void  )
virtual

Warren step code.

Reimplemented from TAnimal.

Definition at line 1840 of file Rabbit.cpp.

References m_CurrentRState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, st_WarrenBeing(), toRabbits_InitialState, toRabbits_WarrenBeing, and Landscape::Warn().

1841 {
1842  if (m_StepDone || m_CurrentStateNo == -1) return;
1843  switch (m_CurrentRState)
1844  {
1845  case toRabbits_InitialState:
1847  break;
1848  case toRabbits_WarrenBeing: // Being state is never left for warrens - 'they just are'
1849  st_WarrenBeing();
1850  m_StepDone=true;
1851  break;
1852  default:
1853  m_OurLandscape->Warn("Rabbit_Warren::Step()","unknown state - default");
1854  exit(1);
1855  }
1856 }
int m_CurrentStateNo
The basic state number for all objects - &#39;-1&#39; indicates death.
Landscape * m_OurLandscape
TTypeOfRabbitState m_CurrentRState
Variable to record current behavioural state.
Definition: Rabbit.h:746
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1505
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
void st_WarrenBeing(void)
The only warren behaviour - it just is.
Definition: Rabbit.cpp:1859
void Rabbit_Warren::UpdateDominance ( void  )

Checks for a dominant female and promotes one if necessary and possible.

Returns
false if none, true if unmated female found Checks the list of residents for a female with a burrow and no mate.

Definition at line 1930 of file Rabbit.cpp.

References ChooseNewDominant(), m_InhabitantsList, rabbit_socialstatus_subdominant, and rob_Female.

Referenced by st_WarrenBeing().

1930  {
1935  int sz = (int)m_InhabitantsList.size();
1936  for (int i = 0; i<sz; i++) {
1937  if (m_InhabitantsList[ i ]->GetRabbitType() == rob_Female) {
1938  if (dynamic_cast<Rabbit_Female*>(m_InhabitantsList[ i ])->GetSocialStatus() == rabbit_socialstatus_subdominant) return;
1939  }
1940  }
1941  // If we get here we have no dominant female, so see if one can be created.
1943 }
vector< Rabbit_Base * > m_InhabitantsList
List of rabbits that live here - for easy communication purposes.
Definition: Rabbit.h:752
void ChooseNewDominant(void)
Finds a subdominantfemale and promotes them to dominant.
Definition: Rabbit.cpp:1946
void Rabbit_Warren::UpdateForageInformation ( void  )
protected

Updates the forage information depending upon the vegetation state.

This method updates the warren forage information based upon the vegetation height and digestability for each forage polygon. Other options which could be exercised here are to use the vegetation type, biomass or density.

Also calculated here is the amount of available forage relative to the current carrying capacity ratio. Low forage availability will increase death rates in adults, but only if the carrying capacity is too low (based on current forage).

Definition at line 1639 of file Rabbit.cpp.

References CalcCarryingCapacityRatio2(), CalcForageArea(), cfg_litterabsorptionconstant, m_availableforage, m_CarryingCapacityRatio, m_foragearea, m_foragearearatio, m_inv_availableforage, m_LEList, m_litterreabosorptionchance, m_maxForageHeight, m_minForageDigestability, TAnimal::m_OurLandscape, m_permforagearea, Landscape::SupplyDayInYear(), Landscape::SupplyGlobalDate(), Landscape::SupplyVegDigestability(), Landscape::SupplyVegHeight(), torh_TemporaryForage, UpdatePesticide(), CfgInt::value(), CfgFloat::value(), and CfgBool::value().

Referenced by st_WarrenBeing().

1639  {
1647  double availableforage = m_permforagearea;
1648  for (vector<RabbitWarrenLEInfo>::size_type k = 0; k < m_LEList.size(); k++) {
1649  if (m_LEList[ k ].m_torh == torh_TemporaryForage) {
1650  double vegheight = m_OurLandscape->SupplyVegHeight( m_LEList[ k ].m_ref ); // m_ref is the landscape polyref
1651  double vegdigestability = m_OurLandscape->SupplyVegDigestability( m_LEList[ k ].m_ref );
1652  if ((vegheight < m_maxForageHeight) && (vegdigestability > m_minForageDigestability)) {
1653  // 30 cm
1654  m_LEList[ k ].m_forage = m_LEList[ k ].m_foragearea;
1655  availableforage += m_LEList[ k ].m_foragearea;
1656  }
1657  else m_LEList[ k ].m_forage = 0.0;
1658  }
1659  }
1660  // Only do the expensive pesticide update if there is a chance that there is some pesticide to work with
1662 
1665  m_CarryingCapacityRatio = CalcCarryingCapacityRatio2(); // Normally this is the same as m_BigFemaleRabbitsR, which gets bigger as rabbits get close to CC
1666  }
1667  m_foragearearatio = availableforage / m_foragearea;
1671  }
1672  else {
1673  m_availableforage = 1.0;
1674  m_inv_availableforage = 0.0;
1675  }
1678  }
1679 }
static double m_minForageDigestability
The minimum vegetation digestability allowed for foraging.
Definition: Rabbit.h:543
int CalcForageArea(void)
Returns the total area of forage.
Definition: Rabbit.cpp:1724
CfgBool l_pest_enable_pesticide_engine
double CalcCarryingCapacityRatio2()
calculates the ratio of rabbits to the carrying capacity for the local area
Definition: Rabbit.cpp:1686
double value(void)
Definition: configurator.h:107
double m_availableforage
Records the amount of forage currently available in the warren area as a proportion of what is the po...
Definition: Rabbit.h:728
double m_CarryingCapacityRatio
Records the ratio between carrying capacity and no rabbits in warren.
Definition: Rabbit.h:712
bool value(void)
Definition: configurator.h:123
double m_inv_availableforage
The inverse of m_availableforage, prevents multiple re-calculation.
Definition: Rabbit.h:732
vector< RabbitWarrenLEInfo > m_LEList
List of polygons and the area which is part of the warren.
Definition: Rabbit.h:748
CfgInt cfg_rabbitdensitydependencedelay
Input variable. The period between recalculation of rabbit disease probability.
double m_litterreabosorptionchance
Chance of litter reaborption based on the m_availableforage.
Definition: Rabbit.h:734
int SupplyDayInYear(void)
Definition: landscape.h:1522
int m_permforagearea
Variable holding the total permanent forage area.
Definition: Rabbit.h:724
Landscape * m_OurLandscape
static CfgFloat cfg_litterabsorptionconstant("RABBIT_LITTERABSOPRTIONCONST", CFG_CUSTOM, 1.8)
Used to calculate the chance of litter reabsorption depending on forage conditions.
int value(void)
Definition: configurator.h:92
double SupplyVegHeight(int a_polyref)
Definition: landscape.h:857
long SupplyGlobalDate(void)
Definition: landscape.h:1547
void UpdatePesticide(void)
Updates the pesticide concentration in forage polygons.
Definition: Rabbit.cpp:1602
static double m_maxForageHeight
The maximum vegetation height assumed for forage potential.
Definition: Rabbit.h:541
double m_foragearearatio
Records the amount of forage currently available in the warren area as a proportion of total forage a...
Definition: Rabbit.h:730
int m_foragearea
Variable holding the total potential forage area.
Definition: Rabbit.h:726
double SupplyVegDigestability(int a_polyref)
Definition: landscape.h:840
void Rabbit_Warren::UpdatePesticide ( void  )
protected

Updates the pesticide concentration in forage polygons.

This is a very 'costly' method. It should not be called if there is no pesticide in use.

Runs through the warren forage area and sums the pesticide.If __RABBITMEANPESTICIDECONC is defined then the pesticide values in all polygons are divided by the area of forage in the warren and the concentration determined. Otherwise the maximum concentration is found in forage areas and set as the value for returning in m_forageP

Definition at line 1602 of file Rabbit.cpp.

References m_availableforage, m_forageP, m_foragesize, m_LEList, TAnimal::m_OurLandscape, m_TL_x, m_TL_y, Landscape::SupplyPesticide(), Landscape::SupplyPesticideDecay(), and Landscape::SupplyPolyRef().

Referenced by UpdateForageInformation().

1602  {
1611  m_forageP = 0.0;
1612  if (!m_OurLandscape->SupplyPesticideDecay()) return;
1613  for (int i = m_TL_x; i < m_TL_x + m_foragesize; i++) {
1614  for (int j = m_TL_y; j < m_TL_y + m_foragesize; j++) {
1615  // Unfortunately we need to check for each square whether the rabbit can forage here.
1616  int ele = m_OurLandscape->SupplyPolyRef( i, j );
1617  for (vector<RabbitWarrenLEInfo>::size_type k = 0; k < m_LEList.size(); k++) {
1618  if (m_LEList[ k ].m_ref == ele) {
1619  if (m_LEList[ k ].m_forage > 0.0) {
1620 #ifdef __RABBITMEANPESTICIDECONC
1622 #else
1623  double pe = m_OurLandscape->SupplyPesticide( i, j );
1624  if (m_forageP< pe ) m_forageP = pe;
1625 #endif
1626  }
1627  break;
1628  }
1629  }
1630  }
1631  }
1632  // Now calculate the mean concentration and mean forage concentration if needed
1633 #ifdef __RABBITMEANPESTICIDECONC
1634  m_forageP /= (double)m_availableforage;
1635 #endif
1636 }
int SupplyPolyRef(int a_x, int a_y)
Definition: landscape.h:1414
int m_TL_y
Stores original m_Location_y.
Definition: Rabbit.h:700
bool SupplyPesticideDecay()
Returns true if there is any pesticide in the system at all at this point.
Definition: Landscape.cpp:639
double m_availableforage
Records the amount of forage currently available in the warren area as a proportion of what is the po...
Definition: Rabbit.h:728
double SupplyPesticide(int a_x, int a_y)
Gets total pesticide for a location.
Definition: Landscape.cpp:481
vector< RabbitWarrenLEInfo > m_LEList
List of polygons and the area which is part of the warren.
Definition: Rabbit.h:748
int m_foragesize
Warren forage size in m.
Definition: Rabbit.h:696
Landscape * m_OurLandscape
double m_forageP
Records the amount of pesticde as a mean concentration per unit area forage.
Definition: Rabbit.h:736
int m_TL_x
Stores original m_Location_x.
Definition: Rabbit.h:698
void Rabbit_Warren::UpdateThisYearsBreeders ( )

Calculates and stores the number of breeders and non-breeders.

Loops through the list of inhabitants and checks if each is a female > 1 year, if so whether it produced a litter this year.

Returns
the number of females that produced litters this year

Definition at line 1815 of file Rabbit.cpp.

References GetLittersThisYear(), m_1yrOldFemales, m_breedingfemales, m_InhabitantsList, m_littersthisyear, m_nonbreedingfemales, and rob_Female.

1815  {
1821  m_breedingfemales = 0;
1823  m_1yrOldFemales = 0;
1824  m_littersthisyear = 0;
1825  int sz = static_cast<int>(m_InhabitantsList.size());
1826  for (int r = 0; r < sz; r++) {
1827  if (m_InhabitantsList[ r ]->GetRabbitType() == rob_Female) {
1828  if (m_InhabitantsList[ r ]->GetAge() < 300) {
1829  m_1yrOldFemales++;
1830  }else{
1831  int litters = dynamic_cast<Rabbit_Female*>(m_InhabitantsList[ r ])->GetLittersThisYear();
1832  if (litters > 0) m_breedingfemales++; else m_nonbreedingfemales++;
1833  m_littersthisyear += litters;
1834  }
1835  }
1836  }
1837 }
The rabbit female class. All special female behaviour is described here.
Definition: Rabbit.h:443
vector< Rabbit_Base * > m_InhabitantsList
List of rabbits that live here - for easy communication purposes.
Definition: Rabbit.h:752
int m_breedingfemales
The number of females that bred this year.
Definition: Rabbit.h:545
int GetLittersThisYear()
Returns the number litters produced in the last 12 months.
Definition: Rabbit.h:670
int m_littersthisyear
The number of litters produced this year.
Definition: Rabbit.h:549
int m_nonbreedingfemales
The number of females that did not breed this year but are older than 1 year.
Definition: Rabbit.h:551
int m_1yrOldFemales
The number of 1 year old females.
Definition: Rabbit.h:547

Member Data Documentation

int Rabbit_Warren::m_1yrOldFemales

The number of 1 year old females.

Definition at line 547 of file Rabbit.h.

Referenced by UpdateThisYearsBreeders().

double Rabbit_Warren::m_availableforage
protected

Records the amount of forage currently available in the warren area as a proportion of what is the potential relative to rabbit numbers possible.

Definition at line 728 of file Rabbit.h.

Referenced by UpdateForageInformation(), and UpdatePesticide().

double Rabbit_Warren::m_BigFemaleRabbitsR
protected

Records the number of big female rabbits divided by m_CarryingCapacityR2.

Definition at line 710 of file Rabbit.h.

Referenced by CalcCarryingCapacityRatio1(), CalcCarryingCapacityRatio2(), and Rabbit_Warren().

int Rabbit_Warren::m_breedingfemales

The number of females that bred this year.

Definition at line 545 of file Rabbit.h.

Referenced by UpdateThisYearsBreeders().

int Rabbit_Warren::m_BurrowsUnderConstruction
protected

Records the burrows that are being dug.

Definition at line 718 of file Rabbit.h.

Referenced by IsFreeBurrow(), Leave(), OccupyNewBurrow(), OccupyWarren(), and Rabbit_Warren().

int Rabbit_Warren::m_CarryingCapacity
protected

Records the max number of rabbit pairs possible here.

Definition at line 704 of file Rabbit.h.

Referenced by InitEvaluation(), IsFreeBurrow(), and Rabbit_Warren().

double Rabbit_Warren::m_CarryingCapacityR
protected

Records the max number of rabbits possible here.

Definition at line 706 of file Rabbit.h.

Referenced by InitEvaluation().

double Rabbit_Warren::m_CarryingCapacityR2
protected

Records the max number of rabbits possible here divided by 2.

Definition at line 708 of file Rabbit.h.

Referenced by CalcCarryingCapacityRatio1(), and InitEvaluation().

double Rabbit_Warren::m_CarryingCapacityRatio
protected

Records the ratio between carrying capacity and no rabbits in warren.

Definition at line 712 of file Rabbit.h.

Referenced by Rabbit_Warren(), and UpdateForageInformation().

TTypeOfRabbitState Rabbit_Warren::m_CurrentRState
protected

Variable to record current behavioural state.

Definition at line 746 of file Rabbit.h.

Referenced by Rabbit_Warren(), and Step().

double Rabbit_Warren::m_diseaseconstant
protected

a measure of disease mortality likelihood

Definition at line 738 of file Rabbit.h.

Referenced by CalcDisease(), Rabbit_Warren(), and st_WarrenBeing().

int Rabbit_Warren::m_foragearea
protected

Variable holding the total potential forage area.

Definition at line 726 of file Rabbit.h.

Referenced by InitEvaluation(), and UpdateForageInformation().

double Rabbit_Warren::m_foragearearatio
protected

Records the amount of forage currently available in the warren area as a proportion of total forage area.

Definition at line 730 of file Rabbit.h.

Referenced by UpdateForageInformation().

double Rabbit_Warren::m_forageP
protected

Records the amount of pesticde as a mean concentration per unit area forage.

Definition at line 736 of file Rabbit.h.

Referenced by UpdatePesticide().

int Rabbit_Warren::m_foragesize
protected

Warren forage size in m.

Definition at line 696 of file Rabbit.h.

Referenced by InitEvaluation(), NetworkEvaluation(), Rabbit_Warren(), and UpdatePesticide().

vector<Rabbit_Base*> Rabbit_Warren::m_InhabitantsList
protected
double Rabbit_Warren::m_inv_availableforage
protected

The inverse of m_availableforage, prevents multiple re-calculation.

Definition at line 732 of file Rabbit.h.

Referenced by UpdateForageInformation().

vector<RabbitWarrenLEInfo> Rabbit_Warren::m_LEList
protected

List of polygons and the area which is part of the warren.

Definition at line 748 of file Rabbit.h.

Referenced by CalcForageArea(), CalcPermForageArea(), GetCoverArea(), GetCoverAreaVeg(), GetTempForageAreaVeg(), GetTemporaryForageArea(), InitEvaluation(), UpdateForageInformation(), and UpdatePesticide().

double Rabbit_Warren::m_litterreabosorptionchance
protected

Chance of litter reaborption based on the m_availableforage.

Definition at line 734 of file Rabbit.h.

Referenced by UpdateForageInformation().

int Rabbit_Warren::m_littersthisyear

The number of litters produced this year.

Definition at line 549 of file Rabbit.h.

Referenced by UpdateThisYearsBreeders().

vector<LocalWarrenNewtorkEntry> Rabbit_Warren::m_LocalWarrenNetwork
protected

List of local warrens and their accessibility from this warren.

Definition at line 750 of file Rabbit.h.

Referenced by CalcCarryingCapacityRatio2(), GetNetworkWarren(), and NetworkEvaluation().

int Rabbit_Warren::m_maintenence
protected

Warren maintenence score - if not max then houseing capacity is reduced.

Definition at line 702 of file Rabbit.h.

Referenced by Rabbit_Warren(), and st_WarrenBeing().

double Rabbit_Warren::m_maxForageHeight = cfg_maxForageHeight.value()
static

The maximum vegetation height assumed for forage potential.

From http://informedfarmers.com/rabbit-reproduction/
The size of a warren depends on the soil type. Typically, warrens can be around two metres deep, although warrens in sandy soils are more likely to be smaller and have fewer underground interconnections than warrens in hard soils.
This is because it is easier for rabbits to start a new warren in sandy soil but in harder, clay-type soils it is easier to extend an existing warren. On average, one warren will have 3 to 15 entrances, with each active entrance likely to house two adult rabbits.

Warren carrying capacity is assumed to be maximum if the 90% of whole area is under permanent forage. Max CC is 15 pairs. We assume that the number of pais is linearly related to the area above a minimum required for 3 pairs.

The warren is a square area of the landscape which is of a standard size and must contain a certain proportion of permanent forage habitat (input parameter RABBIT_WARRENMINPCTFORAGE ). The warren manages its own list of resident rabbits and is responsible for ensuring that the number of rabbits does not rise above its carrying capacity which is determined by the total forage available. Maximum possible carrying capacity is 15 burrows, minimum for a warren to exist is 3.
Daily actual carrying capacity is determined by the number of burrows possible and the number that are actually present. On creation there is no burrows present and a rabbit must first occupy the warren then dig the burrow before breeding can start. Subsequently the warren will grow as rabbits dig further burrows if the warren is continually occupied. After 2 years it will be assumed to have reached the maximum number of burrows possible.

Definition at line 541 of file Rabbit.h.

Referenced by Rabbit_Population_Manager::AssignStaticVariables(), GetCoverAreaVeg(), GetTempForageAreaVeg(), Rabbit_Population_Manager::Rabbit_Population_Manager(), and UpdateForageInformation().

double Rabbit_Warren::m_minForageDigestability = cfg_minForageDigestability.value()
static

The minimum vegetation digestability allowed for foraging.

Definition at line 543 of file Rabbit.h.

Referenced by Rabbit_Population_Manager::AssignStaticVariables(), and UpdateForageInformation().

double Rabbit_Warren::m_mortalitymultiplierA
protected

a measure of mortality likelihood - adults

Definition at line 740 of file Rabbit.h.

Referenced by st_WarrenBeing().

double Rabbit_Warren::m_mortalitymultiplierJ
protected

a measure of mortality likelihood - juveniles

Definition at line 742 of file Rabbit.h.

Referenced by st_WarrenBeing().

int Rabbit_Warren::m_NoBurrows
protected

Records the maintenence restricted current carrying capacity (burrow number)

Definition at line 714 of file Rabbit.h.

Referenced by DEBUG_InternalTest(), DEBUG_InternalTest2(), InitEvaluation(), IsFreeBurrow(), JoinNOccupy(), OccupyNewBurrow(), and st_WarrenBeing().

int Rabbit_Warren::m_nonbreedingfemales

The number of females that did not breed this year but are older than 1 year.

Definition at line 551 of file Rabbit.h.

Referenced by UpdateThisYearsBreeders().

int Rabbit_Warren::m_NoOccupiedBurrows
protected

Records the burrows that are occupied.

Definition at line 716 of file Rabbit.h.

Referenced by DEBUG_InternalTest(), IsFreeBurrow(), JoinNOccupy(), Leave(), Mate(), OccupyBurrow(), OccupyNewBurrow(), and Rabbit_Warren().

Rabbit_Population_Manager* Rabbit_Warren::m_OurPopulationManager
protected

This is a time saving pointer to the correct population manager object.

Definition at line 754 of file Rabbit.h.

Referenced by CalcDisease(), InitEvaluation(), Rabbit_Warren(), and st_WarrenBeing().

int Rabbit_Warren::m_permforagearea
protected

Variable holding the total permanent forage area.

Definition at line 724 of file Rabbit.h.

Referenced by InitEvaluation(), and UpdateForageInformation().

int Rabbit_Warren::m_rabbitdiggingtime
protected

The time taken for burrow construction.

Definition at line 722 of file Rabbit.h.

Referenced by OccupyWarren(), Rabbit_Warren(), and st_WarrenBeing().

int Rabbit_Warren::m_runningavCount
protected

Keeps track of the number of breeding days.

Definition at line 758 of file Rabbit.h.

Referenced by Rabbit_Warren(), and st_WarrenBeing().

int Rabbit_Warren::m_runningavFemales
protected

Keeps track of the number of breeding females.

Definition at line 756 of file Rabbit.h.

Referenced by Rabbit_Warren(), and st_WarrenBeing().

int Rabbit_Warren::m_size
protected

Warren core size in m.

Definition at line 694 of file Rabbit.h.

Referenced by InitEvaluation(), and Rabbit_Warren().

int Rabbit_Warren::m_soiltype
protected

Variable holding the soil type, 1 = heavy, 0 = sandy, 3 = unsuitable (never used in warrens)

Definition at line 720 of file Rabbit.h.

Referenced by InitEvaluation(), Rabbit_Warren(), and st_WarrenBeing().

int Rabbit_Warren::m_ThisYearsProduction[rob_foobar]
protected

Storage for rabbit production data.

Definition at line 744 of file Rabbit.h.

int Rabbit_Warren::m_TL_x
protected

Stores original m_Location_x.

Definition at line 698 of file Rabbit.h.

Referenced by InitEvaluation(), Rabbit_Warren(), and UpdatePesticide().

int Rabbit_Warren::m_TL_y
protected

Stores original m_Location_y.

Definition at line 700 of file Rabbit.h.

Referenced by InitEvaluation(), Rabbit_Warren(), and UpdatePesticide().


The documentation for this class was generated from the following files: