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

The rabbit adult class. All generic adult behaviour is described here. More...

#include <Rabbit.h>

Inheritance diagram for Rabbit_Adult:
Rabbit_Base TAnimal TALMaSSObject Rabbit_Female Rabbit_Male

Public Member Functions

 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...
 
virtual void Step (void)
 The Step is the second 'part' of the timestep that an animal can behave in. It is called continuously until all animals report that they are 'DONE'. 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 void st_Dying (void)
 Default dying state. More...
 
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 InternalPesticideHandlingAndResponse ()
 Handles internal effects of pesticide exposure. If any effects are needed this method must be re-implemented by descendent classes. More...
 
virtual void GeneralEndocrineDisruptor (double)
 Handles internal effects of endocrine distrupter pesticide exposure. 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

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

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 adult class. All generic adult behaviour is described here.

Definition at line 378 of file Rabbit.h.

Constructor & Destructor Documentation

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.

Main function is the initialise the attribute values. Lifespan is given as 2 years plus randomly up to two years = maximum four, average three. Dominance is set to 0 (lowest level). It is evaluated in the st_EvaluateTerritory state

Definition at line 523 of file Rabbit.cpp.

References cfg_adult_base_mort, g_rand_uni, Rabbit_Population_Manager::GetGrowth(), Rabbit_Base::m_Age, Rabbit_Base::m_digging, m_lifespan, m_myMate, Rabbit_Base::m_MyMortChance, Rabbit_Base::m_OurPopulationManager, Rabbit_Base::m_weight, Rabbit_Base::m_weightAge, rabbit_socialstatus_zero, SetSocialStatus(), and CfgFloat::value().

523  : Rabbit_Base(p_x, p_y, p_x2, p_y2, p_L, p_NPM, a_warren)
524 {
529  m_Age = a_age;
530  m_weightAge = a_weightage;
531  m_weight = m_OurPopulationManager->GetGrowth( a_weightage );
532  m_lifespan = int ( (730.0*g_rand_uni()) + 4.5*365); // This allows for the maximum age found by Rodel et al in the German study.
533  //m_lifespan = 6.5 * 365; // This allows for the maximum age found by Rodel et al in the German study.
534  SetSocialStatus( rabbit_socialstatus_zero ); // Default not dominant
535  m_digging = -1;
536  m_myMate = NULL;
538 }
static CfgFloat cfg_adult_base_mort("RABBIT_ADULTBASEMORT", CFG_CUSTOM, 0.00013)
Input variable. The daily base level for adult mortality before any modifiers are applied...
void SetSocialStatus(TTypesOfRabbitSocialStatus a_status)
Sets the dominance status.
Definition: Rabbit.h:391
int m_lifespan
The rabbit&#39;s alloted lifespan.
Definition: Rabbit.h:407
Rabbit_Population_Manager * m_OurPopulationManager
This is a time saving pointer to the correct population manager object.
Definition: Rabbit.h:181
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.
Definition: Rabbit.cpp:161
Rabbit_Adult * m_myMate
Pointer to the mate if any.
Definition: Rabbit.h:409
double m_weight
The weight in g.
Definition: Rabbit.h:195
int m_Age
The rabbit&#39;s age.
Definition: Rabbit.h:177
double value(void)
Definition: configurator.h:107
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
int m_weightAge
A physiological age parameter, this is the growth age based on an optimal curve (if optimal condition...
Definition: Rabbit.h:197
double GetGrowth(int a_age)
Get method for the rabbit growth with age.
double m_MyMortChance
Definition: Rabbit.h:183
Rabbit_Adult::~Rabbit_Adult ( void  )
virtual

Rabbit_Adult destructor.

Definition at line 541 of file Rabbit.cpp.

542 {
543  ;
544 }

Member Function Documentation

void Rabbit_Adult::EndStep ( void  )
protectedvirtual

The EndStep is the last 'part' of the timestep that an animal can behave in.

Here we apply a density dependent mortality as well as a daily mortality rate. The mortality is dependent on three factors - whether the rabbit has a burrow, and whether the carrying capacity of the warren is reached in terms of number of possible burrows, or whether the rabbit is digging. The carrying capacity is results in extra movement which causes extra mortality (see evaluate territory) as well as increased mortality here.
Disease is a density dependent mortality factor - used here to increase mortality at high densities. This is step function at the moment but could be altered as necessary. The disease mortality is constant for all members of a warren - updated by the warren do first. See Rabbit_Warren::CalcDisease()
If we survive all this, then we need to age, and die if we exceed our alloted lifespan.
If that does not kill us then check for burrow digging completion and if we have done this occupy the burrow and if we have a mate then tell the mate to set the appropriate burrow and digging information.

Reimplemented from Rabbit_Base.

Definition at line 547 of file Rabbit.cpp.

References Rabbit_Warren::GetDailyMortalityChanceA(), Rabbit_Population_Manager::GetForageDay(), Rabbit_Population_Manager::GetGrowth(), Rabbit_Base::GetHasBurrow(), Rabbit_Base::InternalPesticideHandlingAndResponse(), Rabbit_Base::m_Age, Rabbit_Base::m_CurrentRState, TALMaSSObject::m_CurrentStateNo, Rabbit_Base::m_digging, m_lifespan, m_myMate, Rabbit_Base::m_MyMortChance, Rabbit_Base::m_myWarren, Rabbit_Base::m_OurPopulationManager, Rabbit_Base::m_pesticide_burden, m_socialstatus, Rabbit_Base::m_weight, Rabbit_Base::m_weightAge, Rabbit_Base::MortalityTest(), Rabbit_Warren::OccupyNewBurrow(), OnMateFinishedDigging(), rabbit_socialstatus_dominant, rabbit_socialstatus_subdominant, Rabbit_Base::SetHasBurrow(), SetSocialStatus(), st_Dying(), and toRabbits_Die.

547  {
562  if (m_CurrentStateNo == -1) return; // Already dead
563  double mult = 1.0;
564  if (m_myWarren != NULL) {
566  }
567  // Mortality depends on the social status
569  mult *= mult2;
570  if (MortalityTest( m_MyMortChance * mult )) {
572  st_Dying(); // m_MyMortChance% chance of death
573  return;
574  }
575  if (++m_Age > m_lifespan) {
577  st_Dying();
578  return;
579  }
580  if (m_digging > -1)
581  // We are digging a burrow
582  {
583 #ifdef __RABBITDEBUG
584  if (m_myMate != NULL) {
585  if (m_myMate->GetHasBurrow()) {
586  int rubbish = 0;
587  }
588  }
589 #endif
590  if (--m_digging < 0)
591  // Finished digging
592  {
594  SetHasBurrow( true );
596  if (m_myMate != NULL) m_myMate->OnMateFinishedDigging( this );
597  }
598  }
601  // Deal with pesticides if necessary
603 }
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_lifespan
The rabbit&#39;s alloted lifespan.
Definition: Rabbit.h:407
bool GetForageDay()
Get method for the forage day flag.
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 GetDailyMortalityChanceA()
Returns the adult daily mortality multiplier.
Definition: Rabbit.h:680
virtual void st_Dying(void)
Default dying state.
Definition: Rabbit.cpp:685
double m_weight
The weight in g.
Definition: Rabbit.h:195
int m_Age
The rabbit&#39;s age.
Definition: Rabbit.h:177
virtual void InternalPesticideHandlingAndResponse()
Handles internal effects of pesticide exposure. If any effects are needed this method must be re-impl...
Definition: Rabbit.h:303
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
void OccupyNewBurrow()
a_rabbit occupies a newly dug burrow
Definition: Rabbit.cpp:2063
TTypesOfRabbitSocialStatus m_socialstatus
Flag to record dominance status (0-4)
Definition: Rabbit.h:405
int m_CurrentStateNo
The basic state number for all objects - &#39;-1&#39; indicates death.
int m_weightAge
A physiological age parameter, this is the growth age based on an optimal curve (if optimal condition...
Definition: Rabbit.h:197
void OnMateFinishedDigging(Rabbit_Adult *a_mate)
Action when a mate has finished digging a burrow.
Definition: Rabbit.cpp:624
double GetGrowth(int a_age)
Get method for the rabbit growth with age.
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 m_CurrentRState
Variable to record current behavioural state.
Definition: Rabbit.h:179
double m_MyMortChance
Definition: Rabbit.h:183
bool GetHasBurrow(void)
Get burrow status.
Definition: Rabbit.h:242
bool MortalityTest(double a_prop)
A simple probability based test.
Definition: Rabbit.cpp:194
virtual Rabbit_Adult* Rabbit_Adult::GetMate ( void  )
inlinevirtual

Get mate pointer.

Reimplemented from Rabbit_Base.

Definition at line 397 of file Rabbit.h.

Referenced by Rabbit_Warren::JoinNMate(), and Rabbit_Warren::Mate().

397 { return m_myMate; };
Rabbit_Adult * m_myMate
Pointer to the mate if any.
Definition: Rabbit.h:409
TTypesOfRabbitSocialStatus Rabbit_Adult::GetSocialStatus ( void  )
inline

Return the dominance status.

Definition at line 387 of file Rabbit.h.

Referenced by Rabbit_Warren::ChooseNewDominant().

387  {
388  return m_socialstatus;
389  }
TTypesOfRabbitSocialStatus m_socialstatus
Flag to record dominance status (0-4)
Definition: Rabbit.h:405
void Rabbit_Adult::OnMateDead ( Rabbit_Adult a_mate)

Set/unset mate status.

Definition at line 653 of file Rabbit.cpp.

References Rabbit_Base::GetRabbitType(), Rabbit_Base::m_CurrentRState, m_myMate, TAnimal::m_OurLandscape, Rabbit_Base::m_RabbitType, toRabbits_Die, and Landscape::Warn().

Referenced by st_Dying().

654 {
655 #ifdef __RABBITDEBUG
656  if (a_mate->GetRabbitType() == m_RabbitType)
657  {
658  m_OurLandscape->Warn("Rabbit_Adult::OnMateDead","homosexual rabbit!");
659  exit(1);
660  }
661  if ((m_myMate != a_mate) && (m_CurrentRState != toRabbits_Die))
662  {
663  m_OurLandscape->Warn("Rabbit_Adult::OnMateDead","rabbit bigamy, mate not recognised!");
664  exit(1);
665  }
666 #endif
667  m_myMate = NULL;
668 }
Rabbit_Adult * m_myMate
Pointer to the mate if any.
Definition: Rabbit.h:409
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
RabbitObjectTypes GetRabbitType(void)
Get rabbit type.
Definition: Rabbit.h:218
TTypeOfRabbitState m_CurrentRState
Variable to record current behavioural state.
Definition: Rabbit.h:179
void Rabbit_Adult::OnMateFinishedDigging ( Rabbit_Adult a_mate)

Action when a mate has finished digging a burrow.

Definition at line 624 of file Rabbit.cpp.

References Rabbit_Warren::DEBUG_InternalTest(), Rabbit_Base::GetRabbitType(), Rabbit_Base::m_CurrentRState, Rabbit_Base::m_digging, Rabbit_Base::m_haveBurrow, m_myMate, Rabbit_Base::m_myWarren, TAnimal::m_OurLandscape, Rabbit_Base::m_RabbitType, rabbit_socialstatus_subdominant, Rabbit_Base::SetDigging(), Rabbit_Base::SetHasBurrow(), SetSocialStatus(), toRabbits_Die, and Landscape::Warn().

Referenced by EndStep().

625 {
626 #ifdef __RABBITDEBUG
627  if (a_mate->GetRabbitType() == m_RabbitType)
628  {
629  m_OurLandscape->Warn("Rabbit_Adult::OnMateFinishedDigging","homosexual rabbit!");
630  exit(1);
631  }
632  if ((m_myMate != a_mate) && (m_CurrentRState != toRabbits_Die))
633  {
634  m_OurLandscape->Warn("Rabbit_Adult::OnMateFinishedDigging","rabbit bigamy, mate not recognised!");
635  exit(1);
636  }
637  if (m_digging < 0) {
638  int rubbish = 0;
639  }
640  if (m_haveBurrow) {
641  int rubbish = 0;
642  }
643 #endif
644  SetDigging(-1);
645  SetHasBurrow(true);
647 #ifdef __RABBITDEBUG
649 #endif
650 }
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_Adult * m_myMate
Pointer to the mate if any.
Definition: Rabbit.h:409
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
RabbitObjectTypes m_RabbitType
The rabbits type.
Definition: Rabbit.h:170
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 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
RabbitObjectTypes GetRabbitType(void)
Get rabbit type.
Definition: Rabbit.h:218
bool m_haveBurrow
Flag to record burrow status.
Definition: Rabbit.h:185
TTypeOfRabbitState m_CurrentRState
Variable to record current behavioural state.
Definition: Rabbit.h:179
void Rabbit_Adult::SetMate ( Rabbit_Adult a_mate)

Set/unset mate status.

Definition at line 606 of file Rabbit.cpp.

References Rabbit_Base::GetRabbitType(), m_myMate, TAnimal::m_OurLandscape, Rabbit_Base::m_RabbitType, and Landscape::Warn().

Referenced by Rabbit_Warren::JoinNMate(), and Rabbit_Warren::Mate().

607 {
608 #ifdef __RABBITDEBUG
609  if (a_mate->GetRabbitType() == m_RabbitType)
610  {
611  m_OurLandscape->Warn("Rabbit_Adult::SetMate","homosexual rabbit!");
612  exit(1);
613  }
614  if (m_myMate != NULL)
615  {
616  m_OurLandscape->Warn("Rabbit_Adult::SetMate","rabbit bigamy!");
617  exit(1);
618  }
619 #endif
620  m_myMate = a_mate;
621 }
Rabbit_Adult * m_myMate
Pointer to the mate if any.
Definition: Rabbit.h:409
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
RabbitObjectTypes GetRabbitType(void)
Get rabbit type.
Definition: Rabbit.h:218
void Rabbit_Adult::SetSocialStatus ( TTypesOfRabbitSocialStatus  a_status)
inline

Sets the dominance status.

Definition at line 391 of file Rabbit.h.

Referenced by Rabbit_Warren::ChooseNewDominant(), EndStep(), Rabbit_Warren::JoinNMate(), Rabbit_Warren::JoinNOccupy(), Rabbit_Warren::Mate(), OnMateFinishedDigging(), Rabbit_Adult(), Rabbit_Male::st_EvaluateTerritory(), and Rabbit_Female::st_EvaluateTerritory().

391  {
392  m_socialstatus = a_status;
393  }
TTypesOfRabbitSocialStatus m_socialstatus
Flag to record dominance status (0-4)
Definition: Rabbit.h:405
void Rabbit_Adult::st_Dying ( void  )
protectedvirtual

Default dying state.

Adult dying state. Needs to:

  • Tell the warren he is leaving
  • Tell any mate
  • Set the current state to -1 (signals object destruction to the population manager).
  • Set StepDone to true to prevent further Step behaviour.

Reimplemented from Rabbit_Base.

Reimplemented in Rabbit_Female.

Definition at line 685 of file Rabbit.cpp.

References Rabbit_Warren::Leave(), TALMaSSObject::m_CurrentStateNo, m_myMate, Rabbit_Base::m_myWarren, TALMaSSObject::m_StepDone, and OnMateDead().

Referenced by EndStep(), Rabbit_Female::st_Dying(), and Rabbit_Male::Step().

686 {
694  if ( m_myWarren != NULL )
695  {
696  m_myWarren->Leave(this);
697  }
698  if (m_myMate != NULL)
699  {
700  m_myMate->OnMateDead( this );
701  m_myMate = NULL;
702  }
703  m_CurrentStateNo = -1; // this will kill the animal object and free up space
704  m_StepDone = true;
705 }
void Leave(Rabbit_Base *a_rabbit)
Remove this adult from the warren list.
Definition: Rabbit.cpp:2111
Rabbit_Adult * m_myMate
Pointer to the mate if any.
Definition: Rabbit.h:409
int m_CurrentStateNo
The basic state number for all objects - &#39;-1&#39; indicates death.
Rabbit_Warren * m_myWarren
True if currently mated.
Definition: Rabbit.h:189
void OnMateDead(Rabbit_Adult *a_mate)
Set/unset mate status.
Definition: Rabbit.cpp:653
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.

Member Data Documentation

int Rabbit_Adult::m_lifespan
protected

The rabbit's alloted lifespan.

Definition at line 407 of file Rabbit.h.

Referenced by EndStep(), and Rabbit_Adult().

Rabbit_Adult* Rabbit_Adult::m_myMate
protected
TTypesOfRabbitSocialStatus Rabbit_Adult::m_socialstatus
protected

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