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

The rabbit female class. All special female behaviour is described here. More...

#include <Rabbit.h>

Inheritance diagram for Rabbit_Female:
Rabbit_Adult Rabbit_Base TAnimal TALMaSSObject

Public Member Functions

 Rabbit_Female (int p_x, int p_y, int p_x2, int p_y2, Landscape *p_L, Rabbit_Population_Manager *p_NPM, int a_age, int a_weightage, Rabbit_Warren *a_warren)
 Rabbit_Female constructor. More...
 
virtual ~Rabbit_Female (void)
 Rabbit_Female destructor. More...
 
virtual void Step (void)
 The female rabbit step code. More...
 
void AddYoung (Rabbit_Young *a_young)
 Add a young. More...
 
void OnYoungDeath (Rabbit_Young *a_young)
 Message on death of a young. More...
 
void Weaned (Rabbit_Young *a_young)
 Message on weaning of a young. More...
 
void SetMinKits (double a_num)
 
void SetMaxKits (double a_num)
 
int GetTotalOffspring ()
 
int GetTotalLitters ()
 
int GetLittersThisYear ()
 
- Public Member Functions inherited from Rabbit_Adult
 Rabbit_Adult (int p_x, int p_y, int p_x2, int p_y2, Landscape *p_L, Rabbit_Population_Manager *p_NPM, int a_age, int a_weightage, Rabbit_Warren *a_warren)
 Rabbit_Adult constructor. More...
 
virtual ~Rabbit_Adult ()
 Rabbit_Adult destructor. More...
 
TTypesOfRabbitSocialStatus GetSocialStatus (void)
 Return the dominance status. More...
 
void SetSocialStatus (TTypesOfRabbitSocialStatus a_status)
 Sets the dominance status. More...
 
void SetMate (Rabbit_Adult *a_mate)
 Set/unset mate status. More...
 
virtual Rabbit_AdultGetMate (void)
 Get mate pointer. More...
 
void OnMateFinishedDigging (Rabbit_Adult *a_mate)
 Action when a mate has finished digging a burrow. More...
 
void OnMateDead (Rabbit_Adult *a_mate)
 Set/unset mate status. More...
 
- Public Member Functions inherited from Rabbit_Base
TTypeOfRabbitState GetCurrentRState ()
 
void SetAge (int a_age)
 Set age method. More...
 
RabbitObjectTypes GetRabbitType (void)
 Get rabbit type. More...
 
int GetAge (void)
 Get age method. More...
 
void SetweightAge (int a_age)
 Set age method. More...
 
int GetweightAge (void)
 Get age method. More...
 
Rabbit_WarrenGetWarren (void)
 Get warren pointer. More...
 
void SetWarren (Rabbit_Warren *a_warren)
 Set the warren pointer. More...
 
bool GetHasBurrow (void)
 Get burrow status. More...
 
void SetHasBurrow (bool a_status)
 Set/unset burrow status. More...
 
void SetDigging (int a_days)
 Set number of days to dig. More...
 
int GetDigging ()
 Get number of days to dig. More...
 
APoint GetBornLocation ()
 Get location of birth. More...
 
 Rabbit_Base (int p_x, int p_y, int p_x2, int p_y2, Landscape *p_L, Rabbit_Population_Manager *p_NPM, Rabbit_Warren *a_warren)
 Rabbit constructor. More...
 
virtual ~Rabbit_Base (void)
 Rabbit destructor. More...
 
virtual void BeginStep (void)
 The BeginStep is the first 'part' of the timestep that an animal can behave in. It is called once per timestep. More...
 
void OnFed (void)
 Signals food arrived today. More...
 
void OnMumDead (void)
 Signals death of mum. More...
 
void OnEvicted (void)
 Signals mum has a new litter to look after. 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 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...
 

Protected Member Functions

virtual TTypeOfRabbitState st_EvaluateTerritory (void)
 Female Evaluate Territory Step. More...
 
virtual TTypeOfRabbitState st_UpdateBreedingStatus (void)
 Female reproductive update - handles oestrous, gestation, lactation and birth. More...
 
virtual TTypeOfRabbitState st_GiveBirth (void)
 Female give birth state. More...
 
virtual TTypeOfRabbitState st_Lactating (void)
 Female lactating state. More...
 
virtual TTypeOfRabbitState st_Gestating (void)
 Female gestating state. More...
 
virtual TTypeOfRabbitState st_Forage (void)
 Adult female forage behaviour. More...
 
virtual void st_Dying (void)
 Female dying state. More...
 
int CalcLitterSize (void)
 Calculates the litter size at birth. More...
 
virtual void InternalPesticideHandlingAndResponse ()
 Handles internal effects of pesticide exposure - reimplemented from base class. More...
 
virtual void GeneralEndocrineDisruptor (double)
 Handles internal effects of endocrine distrupter pesticide exposure. More...
 
- Protected Member Functions inherited from Rabbit_Adult
virtual void EndStep (void)
 The EndStep is the last 'part' of the timestep that an animal can behave in. More...
 
- Protected Member Functions inherited from Rabbit_Base
virtual void Explore (void)
 Exploration method. More...
 
bool MortalityTest (double a_prop)
 A simple probability based test. More...
 
bool WalkTo (int a_x, int a_y)
 Walks to a location from current location. More...
 
virtual void GeneralOrganoPhosphate (double)
 Handles internal effects of organophosphate pesticide exposure. More...
 
- Protected Member Functions inherited from TAnimal
void CorrectWrapRound ()
 Corrects wrap around co-ordinate problems. More...
 

Protected Attributes

bool m_pregnant
 Flag to indicate pregnancy. More...
 
bool m_lactating
 Flag to indicate lactating. More...
 
int m_gestationcounter
 Counter to record the number of days gestating. More...
 
Rabbit_Youngm_myLitter [20]
 Holds the current young (for lactation) More...
 
int m_myLitterSize
 Holds the current litter size. More...
 
int m_MyOffspring
 The total number of kits born to her. More...
 
int m_MyTotalLitters
 The number of litters produced. More...
 
vector< int > m_AnnualLitters
 The number of litters produced. More...
 
- Protected Attributes inherited from Rabbit_Adult
TTypesOfRabbitSocialStatus m_socialstatus
 Flag to record dominance status (0-4) More...
 
int m_lifespan
 The rabbit's alloted lifespan. More...
 
Rabbit_Adultm_myMate
 Pointer to the mate if any. More...
 
- Protected Attributes inherited from Rabbit_Base
int m_Age
 The rabbit's age. More...
 
TTypeOfRabbitState m_CurrentRState
 Variable to record current behavioural state. More...
 
Rabbit_Population_Managerm_OurPopulationManager
 This is a time saving pointer to the correct population manager object. More...
 
double m_MyMortChance
 
bool m_haveBurrow
 Flag to record burrow status. More...
 
Rabbit_Warrenm_myWarren
 True if currently mated. More...
 
Rabbit_Femalem_Mum
 Pointer to mum. More...
 
bool m_FedToday
 Flag for been fed today. More...
 
double m_weight
 The weight in g. More...
 
int m_weightAge
 A physiological age parameter, this is the growth age based on an optimal curve (if optimal conditions it will be the same as m_age) More...
 
int m_digging
 Flag to denote digging behaviour. This keeps the rabbit in a warren without burrows whilst it tries to make one. More...
 
APoint m_born_location
 The x,y location at birth. More...
 
double m_pesticide_burden
 State variable used to hold the current body-burden of pesticide. More...
 
bool m_pesticideInfluenced1
 Flag to indicate pesticide effects (e.g. can be used for endocrine distruptors with delayed effects until birth). 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...
 

Static Protected Attributes

static double m_MinKitsNo = cfg_rabbitminkits.value()
 The minimum number of kits. More...
 
static double m_MaxKitsNo = cfg_rabbitmaxkits.value() - cfg_rabbitminkits.value()
 The maximum number of kits. More...
 

Additional Inherited Members

- Public Attributes inherited from Rabbit_Base
RabbitObjectTypes m_RabbitType
 The rabbits type. More...
 
- Static Public Attributes inherited from Rabbit_Base
static double m_dispersalmortperm = cfg_dispersalmortperm.value()
 The extra dispersal mortality per m travelled. More...
 
static double m_pesticidedegradationrate = cfg_rabbit_pesticidedegradationrate.value()
 State variable used to hold the daily degredation rate of the pesticide in the body. More...
 

Detailed Description

The rabbit female class. All special female behaviour is described here.

Definition at line 443 of file Rabbit.h.

Constructor & Destructor Documentation

Rabbit_Female::Rabbit_Female ( int  p_x,
int  p_y,
int  p_x2,
int  p_y2,
Landscape p_L,
Rabbit_Population_Manager p_NPM,
int  a_age,
int  a_weightage,
Rabbit_Warren a_warren 
)

Rabbit_Female constructor.

Definition at line 894 of file Rabbit.cpp.

References Rabbit_Warren::IsMember(), m_gestationcounter, m_lactating, m_myLitterSize, m_MyOffspring, m_MyTotalLitters, Rabbit_Base::m_myWarren, TAnimal::m_OurLandscape, m_pregnant, Rabbit_Base::m_RabbitType, Rabbit_Warren::RabbitProductionRecord(), rob_Female, and Landscape::Warn().

894  : Rabbit_Adult(p_x, p_y, p_x2, p_y2, p_L, p_NPM, a_age, a_weightage, a_warren)
895 {
897  if (a_warren != NULL) a_warren->RabbitProductionRecord(rob_Female, 1);
898  m_lactating = false;
899  m_pregnant = false;
900  m_gestationcounter = 0;
901  m_myLitterSize = 0;
902  m_MyOffspring = 0;
903  m_MyTotalLitters = 0;
904 #ifdef __RABBITDEBUG
905  if (m_myWarren != NULL) if (m_myWarren->IsMember(this)==false)
906  {
907  m_OurLandscape->Warn("Rabbit_Female::Rabbit_Female","not a member of our warren");
908  exit(1);
909  }
910 #endif
911 }
int m_myLitterSize
Holds the current litter size.
Definition: Rabbit.h:497
Rabbit_Adult(int p_x, int p_y, int p_x2, int p_y2, Landscape *p_L, Rabbit_Population_Manager *p_NPM, int a_age, int a_weightage, Rabbit_Warren *a_warren)
Rabbit_Adult constructor.
Definition: Rabbit.cpp:523
bool m_lactating
Flag to indicate lactating.
Definition: Rabbit.h:491
int m_gestationcounter
Counter to record the number of days gestating.
Definition: Rabbit.h:493
bool IsMember(Rabbit_Base *a_rabbit)
Returns true if this rabbit belongs to the warren.
Definition: Rabbit.cpp:1990
RabbitObjectTypes m_RabbitType
The rabbits type.
Definition: Rabbit.h:170
Landscape * m_OurLandscape
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1505
Rabbit_Warren * m_myWarren
True if currently mated.
Definition: Rabbit.h:189
int m_MyOffspring
The total number of kits born to her.
Definition: Rabbit.h:503
int m_MyTotalLitters
The number of litters produced.
Definition: Rabbit.h:505
void RabbitProductionRecord(RabbitObjectTypes YoungType, int kits)
Stores data about production of rabbits throughout year.
Definition: Rabbit.h:582
bool m_pregnant
Flag to indicate pregnancy.
Definition: Rabbit.h:489
Rabbit_Female::~Rabbit_Female ( void  )
virtual

Rabbit_Female destructor.

Definition at line 914 of file Rabbit.cpp.

915 {
916  ;
917 }

Member Function Documentation

void Rabbit_Female::AddYoung ( Rabbit_Young a_young)
inline

Add a young.

Definition at line 454 of file Rabbit.h.

455  {
456  m_myLitter[m_myLitterSize++] = a_young;
457  }
int m_myLitterSize
Holds the current litter size.
Definition: Rabbit.h:497
Rabbit_Young * m_myLitter[20]
Holds the current young (for lactation)
Definition: Rabbit.h:495
int Rabbit_Female::CalcLitterSize ( void  )
protected

Calculates the litter size at birth.

This determines how many young are born in a litter. Litter sizes are 3-8 young, but what controls this is not yet implemented, currently the results are stochastic between these extremes. However, there appears to be no consensus in the literature about this. Larger females have more young, but survival seems also to be greater for individuals of smaller litters. Since this seems to balance out uniform variation and standardised subsequent survival have been implemented.

Definition at line 1249 of file Rabbit.cpp.

References g_rand_uni, m_MaxKitsNo, and m_MinKitsNo.

Referenced by st_GiveBirth().

1250 {
1256  return int(floor(m_MinKitsNo + g_rand_uni() * m_MaxKitsNo));
1257 }
static double m_MinKitsNo
The minimum number of kits.
Definition: Rabbit.h:499
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
static double m_MaxKitsNo
The maximum number of kits.
Definition: Rabbit.h:501
void Rabbit_Female::GeneralEndocrineDisruptor ( double  )
protectedvirtual

Handles internal effects of endocrine distrupter pesticide exposure.

For rabbits, only the female responds to this type of pesticide

Reimplemented from Rabbit_Base.

Definition at line 1418 of file Rabbit.cpp.

References m_gestationcounter, and Rabbit_Base::m_pesticideInfluenced1.

Referenced by InternalPesticideHandlingAndResponse().

1418  {
1422  // May also wish to specify certain gestation days for the effects here
1423  if (m_gestationcounter > 0) {
1424  m_pesticideInfluenced1 = true;
1425  }
1426 }
int m_gestationcounter
Counter to record the number of days gestating.
Definition: Rabbit.h:493
bool m_pesticideInfluenced1
Flag to indicate pesticide effects (e.g. can be used for endocrine distruptors with delayed effects u...
Definition: Rabbit.h:205
int Rabbit_Female::GetLittersThisYear ( )
inline

Definition at line 466 of file Rabbit.h.

466  {
467  return static_cast<int>(m_AnnualLitters.size());
468  }
vector< int > m_AnnualLitters
The number of litters produced.
Definition: Rabbit.h:507
int Rabbit_Female::GetTotalLitters ( )
inline

Definition at line 465 of file Rabbit.h.

465 { return m_MyTotalLitters; }
int m_MyTotalLitters
The number of litters produced.
Definition: Rabbit.h:505
int Rabbit_Female::GetTotalOffspring ( )
inline

Definition at line 464 of file Rabbit.h.

464 { return m_MyOffspring; }
int m_MyOffspring
The total number of kits born to her.
Definition: Rabbit.h:503
void Rabbit_Female::InternalPesticideHandlingAndResponse ( )
protectedvirtual

Handles internal effects of pesticide exposure - reimplemented from base class.

This method is re-implemented ffrom Rabbit_Base for any class which has pesticide response behaviour. If the body burden exceeds the trigger then call pesticide-specific actions by dose

Reimplemented from Rabbit_Base.

Definition at line 1389 of file Rabbit.cpp.

References cfg_RabbitPesticideResponse, GeneralEndocrineDisruptor(), Rabbit_Base::GeneralOrganoPhosphate(), TAnimal::m_OurLandscape, Rabbit_Base::m_pesticide_burden, Rabbit_Base::m_pesticidedegradationrate, Rabbit_Base::m_weight, Landscape::SupplyPesticideType(), ttop_AcuteEffects, ttop_NoPesticide, ttop_ReproductiveEffects, CfgFloat::value(), and MapErrorMsg::Warn().

1389  {
1395  double pesticideInternalConc = m_pesticide_burden / m_weight;
1396 
1397  if (pesticideInternalConc > cfg_RabbitPesticideResponse.value()) {
1398  switch (tp) {
1399  case ttop_NoPesticide:
1400  break;
1402  GeneralEndocrineDisruptor( pesticideInternalConc ); // Calls the EndocrineDisruptor action code
1403  break;
1404  case ttop_AcuteEffects:
1405  GeneralOrganoPhosphate( pesticideInternalConc ); // Calls the GeneralOrganophosphate action code
1406  break;
1407  default:
1408  g_msg->Warn( "Unknown pesticide type used in Rabbit_Female::InternalPesticideHandlingAndResponse() pesticide code ", int( tp ) );
1409  exit( 47 );
1410  }
1411  }
1412  m_pesticide_burden *= m_pesticidedegradationrate; // Does nothing by default except internal degredation of the pesticide
1413 }
virtual void GeneralEndocrineDisruptor(double)
Handles internal effects of endocrine distrupter pesticide exposure.
Definition: Rabbit.cpp:1418
static double m_pesticidedegradationrate
State variable used to hold the daily degredation rate of the pesticide in the body.
Definition: Rabbit.h:174
double m_weight
The weight in g.
Definition: Rabbit.h:195
double value(void)
Definition: configurator.h:107
MapErrorMsg * g_msg
Definition: maperrormsg.cpp:38
Landscape * m_OurLandscape
virtual void GeneralOrganoPhosphate(double)
Handles internal effects of organophosphate pesticide exposure.
Definition: Rabbit.cpp:1432
CfgFloat cfg_RabbitPesticideResponse("RABBIT_PESTICDERESPONSETHRESHOLD", CFG_CUSTOM, 0.00001)
Input variable. The threshold above which a rabbit will be killed if it ingests pesticide.
TTypesOfPesticide SupplyPesticideType(void)
Definition: landscape.h:401
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: maperrormsg.cpp:56
double m_pesticide_burden
State variable used to hold the current body-burden of pesticide.
Definition: Rabbit.h:203
TTypesOfPesticide
Definition: landscape.h:64
void Rabbit_Female::OnYoungDeath ( Rabbit_Young a_young)

Message on death of a young.

If a young has died then it is removed from the litter list. If it is the last one, then lactation is stopped immediately.

Definition at line 1287 of file Rabbit.cpp.

References m_lactating, m_myLitter, m_myLitterSize, TAnimal::m_OurLandscape, and Landscape::Warn().

Referenced by Rabbit_Young::EndStep(), and Rabbit_Young::st_Dying().

1288 {
1292  for(int l=0; l<m_myLitterSize; l++)
1293  {
1294  if (m_myLitter[l] == a_young)
1295  {
1296  for (int n=l; n<m_myLitterSize; n++)
1297  {
1298  m_myLitter[n] = m_myLitter[n+1];
1299  }
1300  m_myLitter[--m_myLitterSize] = NULL;
1301  if (m_myLitterSize == 0) m_lactating = false;
1302  return;
1303  }
1304  }
1305  // If we get here there is an error
1306  m_OurLandscape->Warn("Rabbit_Female::OnYoungDeath","unknown litter member");
1307  exit(1);
1308 }
int m_myLitterSize
Holds the current litter size.
Definition: Rabbit.h:497
bool m_lactating
Flag to indicate lactating.
Definition: Rabbit.h:491
Landscape * m_OurLandscape
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1505
Rabbit_Young * m_myLitter[20]
Holds the current young (for lactation)
Definition: Rabbit.h:495
void Rabbit_Female::SetMaxKits ( double  a_num)
inline

Definition at line 463 of file Rabbit.h.

Referenced by Rabbit_Population_Manager::AssignStaticVariables().

463 { m_MaxKitsNo = a_num; }
static double m_MaxKitsNo
The maximum number of kits.
Definition: Rabbit.h:501
void Rabbit_Female::SetMinKits ( double  a_num)
inline

Definition at line 462 of file Rabbit.h.

Referenced by Rabbit_Population_Manager::AssignStaticVariables().

462 { m_MinKitsNo = a_num; }
static double m_MinKitsNo
The minimum number of kits.
Definition: Rabbit.h:499
void Rabbit_Female::st_Dying ( void  )
protectedvirtual

Female dying state.

Female dying state. Needs to:

  • Tell any young
  • Pass the mantle of dominance on if they are dominant
  • Perform the adult dying actions

Reimplemented from Rabbit_Adult.

Definition at line 967 of file Rabbit.cpp.

References Rabbit_Warren::ChooseNewDominant(), m_myLitter, m_myLitterSize, Rabbit_Base::m_myWarren, Rabbit_Base::m_OurPopulationManager, Rabbit_Adult::m_socialstatus, Rabbit_Base::OnMumDead(), rabbit_socialstatus_dominant, Rabbit_Population_Manager::ReproOutputRecordOutput(), Rabbit_Adult::st_Dying(), and CfgBool::value().

Referenced by Step().

968 {
975  for(int l=0; l<m_myLitterSize; l++)
976  {
977  m_myLitter[l]->OnMumDead();
978  }
981  }
982  // Record our repro output if needed
985 }
int m_myLitterSize
Holds the current litter size.
Definition: Rabbit.h:497
Rabbit_Population_Manager * m_OurPopulationManager
This is a time saving pointer to the correct population manager object.
Definition: Rabbit.h:181
virtual void st_Dying(void)
Default dying state.
Definition: Rabbit.cpp:685
void ChooseNewDominant(void)
Finds a subdominantfemale and promotes them to dominant.
Definition: Rabbit.cpp:1946
TTypesOfRabbitSocialStatus m_socialstatus
Flag to record dominance status (0-4)
Definition: Rabbit.h:405
bool value(void)
Definition: configurator.h:123
Rabbit_Warren * m_myWarren
True if currently mated.
Definition: Rabbit.h:189
void OnMumDead(void)
Signals death of mum.
Definition: Rabbit.h:280
void ReproOutputRecordOutput(Rabbit_Female *a_female)
Print reproductive record to file.
CfgBool cfg_RabbitUseReproOutput
Flag to denote using lifetime repro output file or not.
Rabbit_Young * m_myLitter[20]
Holds the current young (for lactation)
Definition: Rabbit.h:495
TTypeOfRabbitState Rabbit_Female::st_EvaluateTerritory ( void  )
protectedvirtual

Female Evaluate Territory Step.

Returns
The next behavioural state. Legal returns are toRabbits_Foraging, toRabbits_UpdateBreedingStatus, and toRabbits_Die

The rabbit must evaluate her territory and decide if she will stay or leave. This decision is based on a number of criteria:

  1. An evaluation of the current mate status
  2. An evaluation of the current social status
  3. An evaluation of the current territory quality
  4. A comparison with potential areas explored nearby

Here we make the assumption that if suitable quality unoccupied territory is known to be available and the rabbit is not dominant, then it will move to set up a territory there. If none is avaible or known, then the rabbit will remain as subordinate as long as the current territory can support her. If she is forced out she must find a vacent place or will die. If she stays she may become dominant one day.

No mate so before anything else we need to evaluate our current warren for possibilities - could be vacant burrow or mate here for us. If no warren for some reason, then find one.

If an itinerant then she must find a warren. Finds the closest - NB this code should not often be used, so efficiency here has not been optimised

Next she moves there, and assesses whether she can join

If there is a free burrow then joining is certain. If the warren site is unoccupied then currently the rabbit will join it and start to dig. This behaviour might need to be altered later, if rabbits might not start up alone so easily.

If nothing doing locally the Rabbit will move if conditions elsewhere are better and is not dominant or mated:

  • If itinerent, possible free territory -> move
  • If a mate is possible in the new place -> move
  • If itinerent there is a chance of moving even if to nothing better

Definition at line 988 of file Rabbit.cpp.

References Rabbit_Population_Manager::FindClosestWarren(), g_rand_uni, Rabbit_Warren::GetAvailableForage(), Rabbit_Warren::GetNetworkWarren(), Rabbit_Warren::IsFreeBurrow(), Rabbit_Warren::IsFreeMale(), Rabbit_Warren::IsMember(), Rabbit_Warren::Join(), Rabbit_Warren::JoinNMate(), Rabbit_Warren::JoinNOccupy(), Rabbit_Warren::Leave(), m_AnnualLitters, Rabbit_Base::m_digging, TAnimal::m_Location_x, TAnimal::m_Location_y, Rabbit_Adult::m_myMate, Rabbit_Base::m_myWarren, TAnimal::m_OurLandscape, Rabbit_Base::m_OurPopulationManager, Rabbit_Adult::m_socialstatus, TALMaSSObject::m_StepDone, Rabbit_Warren::Mate(), Rabbit_Warren::OccupyBurrow(), Rabbit_Warren::OccupyWarren(), rabbit_socialstatus_subdominant, rabbit_socialstatus_subordinate, rabbit_socialstatus_zero, rob_Male, Rabbit_Base::SetDigging(), Rabbit_Base::SetHasBurrow(), Rabbit_Adult::SetSocialStatus(), TAnimal::Supply_m_Location_x(), TAnimal::Supply_m_Location_y(), Landscape::SupplyGlobalDate(), toRabbits_Die, toRabbits_Foraging, toRabbits_UpdateBreedingStatus, Rabbit_Base::WalkTo(), and Landscape::Warn().

Referenced by Step().

988  {
1002  // We need to manage our annual repro info
1003  int today = m_OurLandscape->SupplyGlobalDate();
1004  for (int l = static_cast<int>(m_AnnualLitters.size()-1); l >= 0; l--) {
1005  if (today - m_AnnualLitters[ l ] > 365) {
1006  m_AnnualLitters.erase( m_AnnualLitters.begin() + (l) );
1007  }
1008  }
1009 #ifdef __RABBITDEBUG
1010  if (m_myWarren != NULL)
1011  {
1012  if (m_myWarren->IsMember( this ) == false) {
1013  m_OurLandscape->Warn( "Rabbit_Female::st_EvaluateTerritory", "not a member of our warren" );
1014  exit( 1 );
1015  }
1016  }
1017 #endif
1019 #ifdef __RABBITDEBUG
1020  if (m_myMate != NULL) {
1021  int rubbish = 0;
1022  }
1023 #endif
1024  return toRabbits_UpdateBreedingStatus; // No need to check the rest we have it all
1025  }
1026  // Update breeding status needs StepDone == false, but otherwise we need to set StepDone here.
1027  m_StepDone = true;
1028  if (m_myMate != NULL) {
1029  return toRabbits_Foraging; // Must be digging a burrow
1030  }
1034  if (m_myWarren == NULL) {
1040  bool survived = WalkTo( aRW->Supply_m_Location_x(), aRW->Supply_m_Location_y() );
1041  if (!survived) return toRabbits_Die;
1042  if (aRW->IsFreeMale()) {
1043  aRW->JoinNMate( this, rob_Male );
1044  }
1049  else {
1050  int burrow = aRW->IsFreeBurrow();
1051  if (burrow == 1) {
1052  aRW->JoinNOccupy( this );
1053  }
1054  else
1055  if (burrow == 2) {
1056  aRW->OccupyWarren( this );
1057  }
1058 
1059  }
1060  return toRabbits_Foraging;
1061  }
1062  // We have a warren but no mate or burrow
1063  else if (m_myWarren->IsFreeMale()) {
1064  m_myWarren->Mate( this, rob_Male );
1065  }
1066  else if (m_myWarren->IsFreeBurrow() == 1) {
1068  SetDigging( -1 );
1070  SetHasBurrow( true );
1071  }
1072  else if (m_digging > 0) {
1073  return toRabbits_Foraging;
1074  }
1075  else
1082  {
1084  if (aWarren != NULL) {
1085  if (aWarren->IsFreeMale()) {
1086  bool survived = WalkTo( aWarren->Supply_m_Location_x(), aWarren->Supply_m_Location_y() );
1087  if (!survived) return toRabbits_Die;
1088  m_myWarren->Leave( this );
1089  aWarren->JoinNMate( this, rob_Male );
1090  }
1091  else {
1092  int burrows = aWarren->IsFreeBurrow();
1093  if (burrows == 1) {
1094  bool survived = WalkTo( aWarren->Supply_m_Location_x(), aWarren->Supply_m_Location_y() );
1095  if (!survived) return toRabbits_Die;
1096  m_myWarren->Leave( this );
1097  aWarren->JoinNOccupy( this );
1099  }
1100  else if (burrows == 2) {
1101  bool survived = WalkTo( aWarren->Supply_m_Location_x(), aWarren->Supply_m_Location_y() );
1102  if (!survived) return toRabbits_Die;
1103  m_myWarren->Leave( this );
1104  aWarren->OccupyWarren( this );
1106  }
1107  else {
1108  // No room but we may need to move anyway
1109  double dispersalchance = m_myWarren->GetAvailableForage()/5.0;
1110  if (g_rand_uni() < dispersalchance) {
1111  bool survived = WalkTo( aWarren->Supply_m_Location_x(), aWarren->Supply_m_Location_y() );
1112  if (!survived) return toRabbits_Die;
1113  m_myWarren->Leave( this );
1114  aWarren->Join( this );
1115  SetDigging( -1 );
1117  }
1118  }
1119  }
1120  }
1121  }
1122 #ifdef __RABBITDEBUG
1123  if (m_myWarren != NULL) if (m_myWarren->IsMember( this ) == false) {
1124  m_OurLandscape->Warn( "Rabbit_Female::st_EvaluateTerritory", "not a member of our warren" );
1125  exit( 1 );
1126  }
1127 #endif
1128  return toRabbits_Foraging; // Do it all again tomorrow
1129 }
void Leave(Rabbit_Base *a_rabbit)
Remove this adult from the warren list.
Definition: Rabbit.cpp:2111
Rabbit_Warren * FindClosestWarren(int a_x, int a_y, int a_rank)
Finds the closest warren as the crow flies.
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
Rabbit_Population_Manager * m_OurPopulationManager
This is a time saving pointer to the correct population manager object.
Definition: Rabbit.h:181
Rabbit_Adult * m_myMate
Pointer to the mate if any.
Definition: Rabbit.h:409
void Mate(Rabbit_Adult *a_mate, RabbitObjectTypes rob_type)
Mate him with un-mated female/male with a burrow.
Definition: Rabbit.cpp:2163
A class to describe the rabbits warren system.
Definition: Rabbit.h:518
Rabbit_Warren * GetNetworkWarren(void)
Chooses a warren to evaluate based on distance.
Definition: Rabbit.cpp:1907
int m_digging
Flag to denote digging behaviour. This keeps the rabbit in a warren without burrows whilst it tries t...
Definition: Rabbit.h:199
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
void Join(Rabbit_Base *a_rabbit)
Adds this rabbit to the warren list.
Definition: Rabbit.cpp:2055
TTypesOfRabbitSocialStatus m_socialstatus
Flag to record dominance status (0-4)
Definition: Rabbit.h:405
bool IsMember(Rabbit_Base *a_rabbit)
Returns true if this rabbit belongs to the warren.
Definition: Rabbit.cpp:1990
int Supply_m_Location_y()
int Supply_m_Location_x()
int IsFreeBurrow(void)
Is there a vacent burrow?
Definition: Rabbit.cpp:2029
double GetAvailableForage(void)
Returns the available forage realtive to rabbit numbers.
Definition: Rabbit.h:642
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
void JoinNOccupy(Rabbit_Adult *a_rabbit)
Adds this adult to the warren list and house them in a suitable burrow.
Definition: Rabbit.cpp:2085
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1505
bool IsFreeMale(void)
Returns true if there is a male with a burrow and no mate.
Definition: Rabbit.cpp:2008
Rabbit_Warren * m_myWarren
True if currently mated.
Definition: Rabbit.h:189
void OccupyWarren(Rabbit_Adult *a_rabbit)
Adds the first rabbit to the warren list.
Definition: Rabbit.cpp:2077
vector< int > m_AnnualLitters
The number of litters produced.
Definition: Rabbit.h:507
long SupplyGlobalDate(void)
Definition: landscape.h:1547
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
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...
Definition: Rabbit.cpp:2218
bool WalkTo(int a_x, int a_y)
Walks to a location from current location.
Definition: Rabbit.cpp:205
TTypeOfRabbitState Rabbit_Female::st_Forage ( void  )
protectedvirtual

Adult female forage behaviour.

This is a critical part of the pesticide handling code. The rabbit forages from the warren area and as a result picks up pesticide. Exactly how much pesticide is picked up depends on the assumptions regarding foraging behaviour. These can be altered int GetForagePesticide(), but the default assumption is that the rabbit will forage from all suitable forgage locations equally, and therefore will pick up an average dose based on the average concentration of residue in the forage areas (there is an alternative version that picks the maximum concentration). This is precalculated by the Rabbit_Warren in UpdatePesticide. The pesticide response code is placed in EndStep - this will determine direct mortality or set any necessary flags indicating pesticide effects later, e.g. for reproduction.

Definition at line 1177 of file Rabbit.cpp.

References Rabbit_Warren::GetForagePesticide(), Rabbit_Base::m_myWarren, Rabbit_Base::m_pesticide_burden, and toRabbits_EvaluateTerritory.

Referenced by Step().

1177  {
1188 }
double GetForagePesticide(void)
Gets the current mean pesticide concentration per unit forage.
Definition: Rabbit.h:628
Rabbit_Warren * m_myWarren
True if currently mated.
Definition: Rabbit.h:189
double m_pesticide_burden
State variable used to hold the current body-burden of pesticide.
Definition: Rabbit.h:203
TTypeOfRabbitState Rabbit_Female::st_Gestating ( void  )
protectedvirtual

Female gestating state.

Updates gestation counter and if still lactating returns a suitable return state, unless its time to give birth.

Definition at line 1273 of file Rabbit.cpp.

References m_gestationcounter, m_lactating, toRabbits_Foraging, toRabbits_GiveBirth, and toRabbits_Lactating.

Referenced by Step().

1274 {
1279  if (m_gestationcounter >= 30) {
1280  return toRabbits_GiveBirth;
1281  }
1282  if (m_lactating) return toRabbits_Lactating;
1283  return toRabbits_Foraging;
1284 }
bool m_lactating
Flag to indicate lactating.
Definition: Rabbit.h:491
int m_gestationcounter
Counter to record the number of days gestating.
Definition: Rabbit.h:493
TTypeOfRabbitState Rabbit_Female::st_GiveBirth ( void  )
protectedvirtual

Female give birth state.

Produces kits. If currently lactating then expels the current young. If it is the breeding season and she has a mate, then she becomes pregnant again immediately. Whether the pregancy is successful will depend on the social status. If social status is too low they cannot reproduce, sub dominant has % chance to reproduce. Reproduction will also depend on the current forage and density

Definition at line 1191 of file Rabbit.cpp.

References CalcLitterSize(), cfg_rabbitsocialreproductionthreshold, Rabbit_Population_Manager::CreateObjects(), g_rand_uni, Rabbit_Warren::GetLitterReabsortionConst(), Rabbit_Population_Manager::IsBreedingSeason(), struct_Rabbit::m_age, m_AnnualLitters, m_gestationcounter, struct_Rabbit::m_L, m_lactating, TAnimal::m_Location_x, TAnimal::m_Location_y, m_myLitter, m_myLitterSize, Rabbit_Adult::m_myMate, m_MyOffspring, m_MyTotalLitters, Rabbit_Base::m_myWarren, struct_Rabbit::m_NPM, TAnimal::m_OurLandscape, Rabbit_Base::m_OurPopulationManager, Rabbit_Base::m_pesticideInfluenced1, m_pregnant, Rabbit_Adult::m_socialstatus, struct_Rabbit::m_Warren, Rabbit_Base::m_weightAge, struct_Rabbit::m_x, struct_Rabbit::m_x2, struct_Rabbit::m_y, struct_Rabbit::m_y2, Rabbit_Base::OnEvicted(), Rabbit_Population_Manager::PesticideDeathRecord(), rabbit_socialstatus_dominant, Rabbit_Warren::RabbitProductionRecord(), rob_Young, Landscape::SupplyGlobalDate(), toRabbits_Foraging, and CfgFloat::value().

Referenced by Step().

1191  {
1197  if (m_myLitterSize > 0) {
1198  for (int l = 0; l < m_myLitterSize; l++) {
1199  m_myLitter[ l ]->OnEvicted();
1200  m_myLitter[ l ] = NULL;
1201  }
1202  m_myLitterSize = 0;
1203  }
1204  if (!m_pesticideInfluenced1) {
1205  // Here we take both social status and weight into account
1208  }
1209  int kits = 0;
1210  // Here we have a test for re-abosorption of the litter depending on forage conditions. Low forage high chance of re-absorption
1212  struct_Rabbit* sR = new struct_Rabbit;
1213  sR->m_age = 0;
1214  sR->m_L = m_OurLandscape;
1216  sR->m_x = m_Location_x;
1217  sR->m_y = m_Location_y;
1218  sR->m_x2 = m_Location_x;
1219  sR->m_y2 = m_Location_y;
1220  sR->m_Warren = m_myWarren;
1221  kits = CalcLitterSize();
1222  m_OurPopulationManager->CreateObjects( rob_Young, this, sR, kits );
1224  delete sR;
1225  }
1226  if (kits > 0) {
1227  m_lactating = true;
1228  // Record our success
1229  m_MyTotalLitters++;
1230  m_MyOffspring += kits;
1231  // We also need to manage our annual repro info
1233  }
1234  }
1235  else {
1236  m_pesticideInfluenced1 = false; // Reset the pesticide flag since we lost the litter
1238  }
1240  if (m_myMate != NULL) {
1241  m_pregnant = true;
1242  m_gestationcounter = 0;
1243  }
1244  }
1245  return toRabbits_Foraging;
1246 }
int m_myLitterSize
Holds the current litter size.
Definition: Rabbit.h:497
int CalcLitterSize(void)
Calculates the litter size at birth.
Definition: Rabbit.cpp:1249
Rabbit_Warren * m_Warren
A pointer to the current warren.
Rabbit_Population_Manager * m_NPM
Rabbit_Population_Manager pointer.
static CfgFloat cfg_rabbitsocialreproductionthreshold("RABBIT_SOCIALREPROTHRESHOLD", CFG_CUSTOM, 2.3)
The threshold at which social reproduction reduction is tested. 1.0 means 50% chance of reproduction ...
Rabbit_Population_Manager * m_OurPopulationManager
This is a time saving pointer to the correct population manager object.
Definition: Rabbit.h:181
Rabbit_Adult * m_myMate
Pointer to the mate if any.
Definition: Rabbit.h:409
double GetLitterReabsortionConst(void)
Returns litter reabsorption chance.
Definition: Rabbit.h:650
int m_y2
y-coord of birth
double value(void)
Definition: configurator.h:107
bool m_lactating
Flag to indicate lactating.
Definition: Rabbit.h:491
void CreateObjects(RabbitObjectTypes ob_type, TAnimal *pvo, struct_Rabbit *a_data, int a_number)
Method for creating a new individual Rabbit.
Used for creation of a new Rabbit object.
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
void OnEvicted(void)
Signals mum has a new litter to look after.
Definition: Rabbit.h:284
int m_gestationcounter
Counter to record the number of days gestating.
Definition: Rabbit.h:493
TTypesOfRabbitSocialStatus m_socialstatus
Flag to record dominance status (0-4)
Definition: Rabbit.h:405
bool IsBreedingSeason(void)
Get whether it is breeding season.
int m_age
The rabbit age.
int m_weightAge
A physiological age parameter, this is the growth age based on an optimal curve (if optimal condition...
Definition: Rabbit.h:197
Landscape * m_OurLandscape
int m_x2
x-coord of birth
Rabbit_Warren * m_myWarren
True if currently mated.
Definition: Rabbit.h:189
int m_MyOffspring
The total number of kits born to her.
Definition: Rabbit.h:503
vector< int > m_AnnualLitters
The number of litters produced.
Definition: Rabbit.h:507
long SupplyGlobalDate(void)
Definition: landscape.h:1547
int m_MyTotalLitters
The number of litters produced.
Definition: Rabbit.h:505
void RabbitProductionRecord(RabbitObjectTypes YoungType, int kits)
Stores data about production of rabbits throughout year.
Definition: Rabbit.h:582
Rabbit_Young * m_myLitter[20]
Holds the current young (for lactation)
Definition: Rabbit.h:495
Landscape * m_L
Landscape pointer.
bool m_pregnant
Flag to indicate pregnancy.
Definition: Rabbit.h:489
bool m_pesticideInfluenced1
Flag to indicate pesticide effects (e.g. can be used for endocrine distruptors with delayed effects u...
Definition: Rabbit.h:205
void PesticideDeathRecord(RabbitObjectTypes ob_type)
Records pesticide poisoning incidents.
TTypeOfRabbitState Rabbit_Female::st_Lactating ( void  )
protectedvirtual

Female lactating state.

Rotates round each of the current young and gives them milk. If this does not happen for some reason then the young will automatically die

Definition at line 1260 of file Rabbit.cpp.

References m_myLitter, m_myLitterSize, Rabbit_Base::OnFed(), and toRabbits_Foraging.

Referenced by Step().

1261 {
1265  for(int lit=0; lit<m_myLitterSize; lit++)
1266  {
1267  m_myLitter[lit]->OnFed();
1268  }
1269  return toRabbits_Foraging;
1270 }
int m_myLitterSize
Holds the current litter size.
Definition: Rabbit.h:497
void OnFed(void)
Signals food arrived today.
Definition: Rabbit.h:276
Rabbit_Young * m_myLitter[20]
Holds the current young (for lactation)
Definition: Rabbit.h:495
TTypeOfRabbitState Rabbit_Female::st_UpdateBreedingStatus ( void  )
protectedvirtual

Female reproductive update - handles oestrous, gestation, lactation and birth.

Returns
The repro behaviour to exhibit. Legal returns are: toRabbits_Gestation, toRabbits_GiveBirth, toRabbits_Lactating, toRabbits_Foraging

Determines where we are in the reproductive cycle. Will hold off or switch on oestrous depending upon season, otherwise will update gestation, continue lactating, mate or give birth as necessary. This uses a number of flags and counters specific to the female rabbit to achieve this. NB if she comes into oestrous and has a mate she will automatically become pregnant. Whether this will happen depends on the weather. Initially we assume that the average temperature over the last month determines intiation of breeding. Cessation may be more problematical. If lactating then the young are forced out at 30 days, when she can be giving birth again if it is still breeding season. If it is not breeding season and nothing else is happening then evaulate territory. This requires setting StepDone to true to prevent continuous looping.

Definition at line 1132 of file Rabbit.cpp.

References Rabbit_Population_Manager::IsBreedingSeason(), Rabbit_Warren::IsFreeMale(), m_gestationcounter, m_lactating, Rabbit_Adult::m_myMate, Rabbit_Base::m_myWarren, Rabbit_Base::m_OurPopulationManager, m_pregnant, Rabbit_Warren::Mate(), rob_Male, toRabbits_Foraging, toRabbits_Gestation, and toRabbits_Lactating.

Referenced by Step().

1133 {
1146  {
1147  // Do we have a litter on the way?
1148  if (m_pregnant)
1149  {
1150  return toRabbits_Gestation;
1151  }
1152  else
1153  {
1154  // Not pregnant but breeding season so check if there is a mate.
1155  if (m_myMate != NULL)
1156  {
1157  m_pregnant = true;
1158  m_gestationcounter = 0;
1159  }
1160  else if (m_myWarren->IsFreeMale())
1161  {
1162  m_myWarren->Mate( this, rob_Male );
1163  }
1164  }
1165  return toRabbits_Foraging;
1166  }
1167  // Not breeding season but may have young
1168  if (m_lactating) return toRabbits_Lactating;
1169  else
1170  {
1171  m_gestationcounter = 0;
1172  return toRabbits_Foraging;
1173  }
1174 }
Rabbit_Population_Manager * m_OurPopulationManager
This is a time saving pointer to the correct population manager object.
Definition: Rabbit.h:181
Rabbit_Adult * m_myMate
Pointer to the mate if any.
Definition: Rabbit.h:409
void Mate(Rabbit_Adult *a_mate, RabbitObjectTypes rob_type)
Mate him with un-mated female/male with a burrow.
Definition: Rabbit.cpp:2163
bool m_lactating
Flag to indicate lactating.
Definition: Rabbit.h:491
int m_gestationcounter
Counter to record the number of days gestating.
Definition: Rabbit.h:493
bool IsBreedingSeason(void)
Get whether it is breeding season.
bool IsFreeMale(void)
Returns true if there is a male with a burrow and no mate.
Definition: Rabbit.cpp:2008
Rabbit_Warren * m_myWarren
True if currently mated.
Definition: Rabbit.h:189
bool m_pregnant
Flag to indicate pregnancy.
Definition: Rabbit.h:489
void Rabbit_Female::Step ( void  )
virtual

The female rabbit step code.

The female step code is the most complicated of the rabbit behavioural control. It is very similar to the male's code but with the addition of the behaviours related to reproduction. Each day the cycle involves an evaluation of the current resource status, and then updating the reproductive behaviour. Exactly which behaviour needs to be updated depends on the current status and whether it is breeding season, and of course whether there is a mate.

Reimplemented from Rabbit_Base.

Definition at line 920 of file Rabbit.cpp.

References Rabbit_Base::m_CurrentRState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, st_Dying(), st_EvaluateTerritory(), st_Forage(), st_Gestating(), st_GiveBirth(), st_Lactating(), st_UpdateBreedingStatus(), toRabbits_Die, toRabbits_EvaluateTerritory, toRabbits_Foraging, toRabbits_Gestation, toRabbits_GiveBirth, toRabbits_InitialState, toRabbits_Lactating, toRabbits_Remove, toRabbits_UpdateBreedingStatus, and Landscape::Warn().

921 {
927  if (m_StepDone || m_CurrentStateNo == -1) return;
928  switch (m_CurrentRState)
929  {
930  case toRabbits_InitialState: // Initial state always starts with develop
932  break;
933  case toRabbits_Foraging:
935  m_StepDone = true;
936  break;
937  case toRabbits_EvaluateTerritory: // Initial state always starts with develop
939  break;
942  break;
943  case toRabbits_Gestation:
945  break;
946  case toRabbits_GiveBirth:
948  break;
949  case toRabbits_Lactating:
951  break;
952  case toRabbits_Die:
953  st_Dying(); // No return value - no behaviour after this
954  m_StepDone=true;
955  break;
956  case toRabbits_Remove:
957  m_CurrentStateNo = -1;
958  m_StepDone=true;
959  break;
960  default:
961  m_OurLandscape->Warn("Rabbit_Female::Step()","unknown state - default");
962  exit(1);
963  }
964 }
virtual TTypeOfRabbitState st_Forage(void)
Adult female forage behaviour.
Definition: Rabbit.cpp:1177
virtual void st_Dying(void)
Female dying state.
Definition: Rabbit.cpp:967
virtual TTypeOfRabbitState st_Lactating(void)
Female lactating state.
Definition: Rabbit.cpp:1260
virtual TTypeOfRabbitState st_EvaluateTerritory(void)
Female Evaluate Territory Step.
Definition: Rabbit.cpp:988
int m_CurrentStateNo
The basic state number for all objects - &#39;-1&#39; indicates death.
virtual TTypeOfRabbitState st_Gestating(void)
Female gestating state.
Definition: Rabbit.cpp:1273
virtual TTypeOfRabbitState st_GiveBirth(void)
Female give birth state.
Definition: Rabbit.cpp:1191
Landscape * m_OurLandscape
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.
virtual TTypeOfRabbitState st_UpdateBreedingStatus(void)
Female reproductive update - handles oestrous, gestation, lactation and birth.
Definition: Rabbit.cpp:1132
TTypeOfRabbitState m_CurrentRState
Variable to record current behavioural state.
Definition: Rabbit.h:179
void Rabbit_Female::Weaned ( Rabbit_Young a_young)

Message on weaning of a young.

If a young has been weaned then it is removed from the litter list. If it is the last one, then lactation is stopped immediately.

Definition at line 1311 of file Rabbit.cpp.

References m_lactating, m_myLitter, m_myLitterSize, TAnimal::m_OurLandscape, and Landscape::Warn().

Referenced by Rabbit_Young::st_BecomeJuvenile().

1312 {
1316  for(int l=0; l<m_myLitterSize; l++)
1317  {
1318  if (m_myLitter[l] == a_young)
1319  {
1320  for (int n=l; n<m_myLitterSize; n++)
1321  {
1322  m_myLitter[n] = m_myLitter[n+1];
1323  }
1324  m_myLitter[--m_myLitterSize] = NULL;
1325  if (m_myLitterSize == 0) m_lactating = false;
1326  return;
1327  }
1328  }
1329  // If we get here there is an error
1330  m_OurLandscape->Warn("Rabbit_Female::Weaned","unknown litter member");
1331  exit(1);
1332 }
int m_myLitterSize
Holds the current litter size.
Definition: Rabbit.h:497
bool m_lactating
Flag to indicate lactating.
Definition: Rabbit.h:491
Landscape * m_OurLandscape
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1505
Rabbit_Young * m_myLitter[20]
Holds the current young (for lactation)
Definition: Rabbit.h:495

Member Data Documentation

vector<int> Rabbit_Female::m_AnnualLitters
protected

The number of litters produced.

Definition at line 507 of file Rabbit.h.

Referenced by st_EvaluateTerritory(), and st_GiveBirth().

int Rabbit_Female::m_gestationcounter
protected

Counter to record the number of days gestating.

Definition at line 493 of file Rabbit.h.

Referenced by GeneralEndocrineDisruptor(), Rabbit_Female(), st_Gestating(), st_GiveBirth(), and st_UpdateBreedingStatus().

bool Rabbit_Female::m_lactating
protected

Flag to indicate lactating.

Definition at line 491 of file Rabbit.h.

Referenced by OnYoungDeath(), Rabbit_Female(), st_Gestating(), st_GiveBirth(), st_UpdateBreedingStatus(), and Weaned().

double Rabbit_Female::m_MaxKitsNo = cfg_rabbitmaxkits.value() - cfg_rabbitminkits.value()
staticprotected

The maximum number of kits.

Definition at line 501 of file Rabbit.h.

Referenced by CalcLitterSize().

double Rabbit_Female::m_MinKitsNo = cfg_rabbitminkits.value()
staticprotected

The minimum number of kits.

Definition at line 499 of file Rabbit.h.

Referenced by CalcLitterSize().

Rabbit_Young* Rabbit_Female::m_myLitter[20]
protected

Holds the current young (for lactation)

Definition at line 495 of file Rabbit.h.

Referenced by OnYoungDeath(), st_Dying(), st_GiveBirth(), st_Lactating(), and Weaned().

int Rabbit_Female::m_myLitterSize
protected

Holds the current litter size.

Definition at line 497 of file Rabbit.h.

Referenced by OnYoungDeath(), Rabbit_Female(), st_Dying(), st_GiveBirth(), st_Lactating(), and Weaned().

int Rabbit_Female::m_MyOffspring
protected

The total number of kits born to her.

Definition at line 503 of file Rabbit.h.

Referenced by Rabbit_Female(), and st_GiveBirth().

int Rabbit_Female::m_MyTotalLitters
protected

The number of litters produced.

Definition at line 505 of file Rabbit.h.

Referenced by Rabbit_Female(), and st_GiveBirth().

bool Rabbit_Female::m_pregnant
protected

Flag to indicate pregnancy.

Definition at line 489 of file Rabbit.h.

Referenced by Rabbit_Female(), st_GiveBirth(), and st_UpdateBreedingStatus().


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