ALMaSS Rabbit ODdox
1.1
The rabbit model description following ODdox protocol
|
A class to describe the rabbits warren system. More...
#include <Rabbit.h>
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_Warren * | GetNetworkWarren (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< RabbitWarrenLEInfo > | m_LEList |
List of polygons and the area which is part of the warren. More... | |
vector< LocalWarrenNewtorkEntry > | m_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_Manager * | m_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 |
Landscape * | m_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... | |
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 1455 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().
|
virtual |
|
inline |
Adds a warren to the local network list.
Definition at line 590 of file Rabbit.h.
References m_LocalWarrenNetwork.
|
inlinevirtual |
Warren begin step code.
Reimplemented from TAnimal.
Definition at line 560 of file Rabbit.h.
References CalcCarryingCapacityRatio1().
|
protected |
calculates the ratio of rabbits to the carrying capacity
Definition at line 1688 of file Rabbit.cpp.
References GetAllBigFemaleRabbits(), m_BigFemaleRabbitsR, and m_CarryingCapacityR2.
Referenced by BeginStep().
|
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:
To speed this on each warren creates its own daily stats which can be combined here.
Definition at line 1692 of file Rabbit.cpp.
References m_BigFemaleRabbitsR, and m_LocalWarrenNetwork.
Referenced by UpdateForageInformation().
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 1583 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().
|
protected |
Returns the total area of forage.
This returns the forge area calcuated by element type.
Definition at line 1730 of file Rabbit.cpp.
References m_LEList.
Referenced by InitEvaluation(), and UpdateForageInformation().
|
protected |
Returns the total area of permanent forage.
This returns the forge area calcuated by element type.
Definition at line 1744 of file Rabbit.cpp.
References m_LEList, and torh_Forage.
Referenced by InitEvaluation().
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 1952 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().
bool Rabbit_Warren::DEBUG_InternalTest | ( | ) |
Definition at line 2298 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().
bool Rabbit_Warren::DEBUG_InternalTest2 | ( | ) |
Definition at line 2350 of file Rabbit.cpp.
References m_InhabitantsList, m_NoBurrows, TAnimal::m_OurLandscape, rob_Female, rob_Male, and Landscape::Warn().
Referenced by IsFreeBurrow(), and JoinNOccupy().
|
inline |
Supply the current disease mortality constant.
Definition at line 638 of file Rabbit.h.
References m_diseaseconstant.
|
inline |
|
inline |
|
inline |
Gets the number of occupied burrows.
Definition at line 570 of file Rabbit.h.
References m_NoOccupiedBurrows.
int Rabbit_Warren::GetAllBigFemaleRabbits | ( | void | ) |
Supplies the number of big rabbits currently in the warren.
Definition at line 2286 of file Rabbit.cpp.
References m_InhabitantsList, and rob_Female.
Referenced by CalcCarryingCapacityRatio1().
int Rabbit_Warren::GetAllBreedingFemaleRabbits | ( | void | ) |
Supplies the number of breeding rabbits currently in the warren.
Definition at line 2274 of file Rabbit.cpp.
References m_InhabitantsList, rabbit_socialstatus_subordinate, and rob_Female.
Referenced by st_WarrenBeing().
|
inline |
Returns the available forage realtive to rabbit numbers.
Definition at line 642 of file Rabbit.h.
References m_availableforage.
Referenced by Rabbit_Female::st_EvaluateTerritory().
|
inline |
Returns the carrying capacity in burrows.
Definition at line 578 of file Rabbit.h.
References m_CarryingCapacity.
Referenced by Rabbit_Population_Manager::CreateObjects(), Rabbit_Male::st_EvaluateTerritory(), and Rabbit_Population_Manager::WarrenOccupancyRecordOutput().
|
inline |
Checks whether all possible burrows are filled with rabbits.
Definition at line 574 of file Rabbit.h.
References m_CarryingCapacity, and m_NoOccupiedBurrows.
|
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.
References m_CarryingCapacityRatio.
Referenced by CalcDisease(), and Rabbit_Population_Manager::WarrenOccupancyRecordOutput().
|
inline |
Records the number of big female rabbits for carrying capacity calculations.
Definition at line 688 of file Rabbit.h.
References m_BigFemaleRabbitsR.
|
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 1772 of file Rabbit.cpp.
References m_LEList, and torh_Cover.
|
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 1806 of file Rabbit.cpp.
References m_LEList, m_maxForageHeight, and torh_Other.
|
inline |
Returns the adult daily mortality multiplier.
Definition at line 680 of file Rabbit.h.
References m_mortalitymultiplierA.
Referenced by Rabbit_Adult::EndStep().
|
inline |
Returns the juvenile daily mortality multiplier.
Definition at line 684 of file Rabbit.h.
References m_mortalitymultiplierJ.
Referenced by Rabbit_Juvenile::EndStep().
|
inline |
Returns the warrens current disease constant.
Definition at line 580 of file Rabbit.h.
References m_diseaseconstant.
Referenced by Rabbit_Population_Manager::WarrenOccupancyRecordOutput().
|
inlineprotected |
Returns the total area of permanent forage.
Definition at line 766 of file Rabbit.h.
References m_permforagearea.
|
inline |
Gets the current mean pesticide concentration per unit forage.
Definition at line 628 of file Rabbit.h.
References m_forageP.
Referenced by Rabbit_Juvenile::st_Forage(), Rabbit_Male::st_Forage(), and Rabbit_Female::st_Forage().
|
inline |
Returns the inverse of available forage realtive to rabbit numbers.
Definition at line 646 of file Rabbit.h.
References m_inv_availableforage.
|
inline |
Returns litter reabsorption chance.
Definition at line 650 of file Rabbit.h.
References m_litterreabosorptionchance.
Referenced by Rabbit_Female::st_GiveBirth(), and Rabbit_Population_Manager::WarrenOccupancyRecordOutput().
|
inline |
Returns the number litters produced in the last 12 months.
Definition at line 670 of file Rabbit.h.
References m_littersthisyear.
Referenced by Rabbit_Population_Manager::WarrenOccupancyRecordOutput().
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 1913 of file Rabbit.cpp.
References g_rand_uni, and m_LocalWarrenNetwork.
Referenced by Rabbit_Male::st_EvaluateTerritory(), and Rabbit_Female::st_EvaluateTerritory().
|
inline |
|
inline |
Gets the total warren population of rabbits.
Definition at line 572 of file Rabbit.h.
References m_InhabitantsList.
Referenced by Rabbit_Male::st_EvaluateTerritory(), and Rabbit_Population_Manager::WarrenOccupancyRecordOutput().
|
inline |
Get data about production of rabbits throughout year.
Definition at line 584 of file Rabbit.h.
References m_ThisYearsProduction.
Referenced by Rabbit_Population_Manager::WarrenOccupancyRecordOutput().
|
inline |
Gets the warren soil type.
Definition at line 632 of file Rabbit.h.
References m_soiltype.
Referenced by Rabbit_Population_Manager::SaveWarrenLocations().
|
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 1786 of file Rabbit.cpp.
References m_LEList, m_maxForageHeight, and torh_TemporaryForage.
|
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 1758 of file Rabbit.cpp.
References m_LEList, and torh_TemporaryForage.
|
inline |
Returns the number of 1yr old females.
Definition at line 666 of file Rabbit.h.
References m_1yrOldFemales.
Referenced by Rabbit_Population_Manager::WarrenOccupancyRecordOutput().
|
inline |
Returns the number of females breeding this year.
Definition at line 654 of file Rabbit.h.
References m_breedingfemales.
Referenced by Rabbit_Population_Manager::WarrenOccupancyRecordOutput().
|
inline |
Returns the number of females breeding this year.
Definition at line 658 of file Rabbit.h.
References m_runningavCount, and m_runningavFemales.
Referenced by Rabbit_Population_Manager::WarrenOccupancyRecordOutput().
|
inline |
Returns the number of females not breeding this year but older than 1 year.
Definition at line 674 of file Rabbit.h.
References m_nonbreedingfemales.
Referenced by Rabbit_Population_Manager::WarrenOccupancyRecordOutput().
|
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 1497 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().
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.
Definition at line 2035 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().
bool Rabbit_Warren::IsFreeFemale | ( | void | ) |
Returns true if there is a female with a burrow and no mate.
Definition at line 1979 of file Rabbit.cpp.
References m_InhabitantsList, and rob_Female.
Referenced by Rabbit_Male::st_EvaluateTerritory().
bool Rabbit_Warren::IsFreeMale | ( | void | ) |
Returns true if there is a male with a burrow and no mate.
Definition at line 2014 of file Rabbit.cpp.
References m_InhabitantsList, and rob_Male.
Referenced by Rabbit_Female::st_EvaluateTerritory(), and Rabbit_Female::st_UpdateBreedingStatus().
bool Rabbit_Warren::IsMember | ( | Rabbit_Base * | a_rabbit | ) |
Returns true if this rabbit belongs to the warren.
Definition at line 1996 of file Rabbit.cpp.
References m_InhabitantsList.
Referenced by Rabbit_Female::Rabbit_Female(), and Rabbit_Female::st_EvaluateTerritory().
void Rabbit_Warren::Join | ( | Rabbit_Base * | a_rabbit | ) |
Adds this rabbit to the warren list.
Join a warren.
Definition at line 2061 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().
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 2224 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().
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 2091 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().
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 2117 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().
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 2169 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().
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 1715 of file Rabbit.cpp.
References m_foragesize, and m_LocalWarrenNetwork.
void Rabbit_Warren::OccupyBurrow | ( | ) |
a_rabbit occupies a free burrow
Definition at line 2077 of file Rabbit.cpp.
References m_NoOccupiedBurrows.
Referenced by JoinNOccupy(), Rabbit_Male::st_EvaluateTerritory(), and Rabbit_Female::st_EvaluateTerritory().
void Rabbit_Warren::OccupyNewBurrow | ( | ) |
a_rabbit occupies a newly dug burrow
Definition at line 2069 of file Rabbit.cpp.
References m_BurrowsUnderConstruction, m_NoBurrows, and m_NoOccupiedBurrows.
Referenced by Rabbit_Adult::EndStep().
void Rabbit_Warren::OccupyWarren | ( | Rabbit_Adult * | a_rabbit | ) |
Adds the first rabbit to the warren list.
Definition at line 2083 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().
|
inline |
Stores data about production of rabbits throughout year.
Definition at line 582 of file Rabbit.h.
References m_ThisYearsProduction.
Referenced by Rabbit_Female::Rabbit_Female(), Rabbit_Juvenile::Rabbit_Juvenile(), Rabbit_Male::Rabbit_Male(), and Rabbit_Female::st_GiveBirth().
|
inline |
Reset data about production of rabbits throughout year.
Definition at line 588 of file Rabbit.h.
References m_ThisYearsProduction, rob_foobar, and rob_Young.
Referenced by Rabbit_Warren(), and Rabbit_Population_Manager::WarrenOccupancyRecordOutput().
|
inline |
Reset specific data about production of rabbits throughout year.
Definition at line 586 of file Rabbit.h.
References m_ThisYearsProduction.
|
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 1865 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().
|
virtual |
Warren step code.
Reimplemented from TAnimal.
Definition at line 1846 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().
void Rabbit_Warren::UpdateDominance | ( | void | ) |
Checks for a dominant female and promotes one if necessary and possible.
Definition at line 1936 of file Rabbit.cpp.
References ChooseNewDominant(), m_InhabitantsList, rabbit_socialstatus_subdominant, and rob_Female.
Referenced by st_WarrenBeing().
|
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 1645 of file Rabbit.cpp.
References CalcCarryingCapacityRatio2(), CalcForageArea(), cfg_litterabsorptionconstant, cfg_rabbitdensitydependencedelay, l_pest_enable_pesticide_engine, 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().
|
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 1608 of file Rabbit.cpp.
References m_availableforage, m_forageP, m_foragesize, m_LEList, TAnimal::m_OurLandscape, m_TL_x, m_TL_y, ppp_1, Landscape::SupplyPesticide(), Landscape::SupplyPesticideDecay(), and Landscape::SupplyPolyRef().
Referenced by UpdateForageInformation().
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.
Definition at line 1821 of file Rabbit.cpp.
References m_1yrOldFemales, m_breedingfemales, m_InhabitantsList, m_littersthisyear, m_nonbreedingfemales, and rob_Female.
Referenced by Rabbit_Population_Manager::WarrenOccupancyRecordOutput().
int Rabbit_Warren::m_1yrOldFemales |
The number of 1 year old females.
Definition at line 547 of file Rabbit.h.
Referenced by GetThisYears1yrOldFemales(), and UpdateThisYearsBreeders().
|
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 GetAvailableForage(), UpdateForageInformation(), and UpdatePesticide().
|
protected |
Records the number of big female rabbits divided by m_CarryingCapacityR2.
Definition at line 710 of file Rabbit.h.
Referenced by CalcCarryingCapacityRatio1(), CalcCarryingCapacityRatio2(), GetCCRabbitsR(), 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 GetThisYearsBreeders(), and UpdateThisYearsBreeders().
|
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().
|
protected |
Records the max number of rabbit pairs possible here.
Definition at line 704 of file Rabbit.h.
Referenced by GetCarryingCapacity(), GetCarryingCapacityFilled(), InitEvaluation(), IsFreeBurrow(), and Rabbit_Warren().
|
protected |
Records the max number of rabbits possible here.
Definition at line 706 of file Rabbit.h.
Referenced by InitEvaluation().
|
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().
|
protected |
Records the ratio between carrying capacity and no rabbits in warren.
Definition at line 712 of file Rabbit.h.
Referenced by GetCarryingCapacityRatio(), Rabbit_Warren(), and UpdateForageInformation().
|
protected |
Variable to record current behavioural state.
Definition at line 746 of file Rabbit.h.
Referenced by Rabbit_Warren(), and Step().
|
protected |
a measure of disease mortality likelihood
Definition at line 738 of file Rabbit.h.
Referenced by CalcDisease(), Disease(), GetDiseaseConstant(), Rabbit_Warren(), and st_WarrenBeing().
|
protected |
Variable holding the total potential forage area.
Definition at line 726 of file Rabbit.h.
Referenced by InitEvaluation(), and UpdateForageInformation().
|
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().
|
protected |
Records the amount of pesticde as a mean concentration per unit area forage.
Definition at line 736 of file Rabbit.h.
Referenced by GetForagePesticide(), and UpdatePesticide().
|
protected |
Warren forage size in m.
Definition at line 696 of file Rabbit.h.
Referenced by InitEvaluation(), NetworkEvaluation(), Rabbit_Warren(), and UpdatePesticide().
|
protected |
List of rabbits that live here - for easy communication purposes.
Definition at line 752 of file Rabbit.h.
Referenced by ChooseNewDominant(), DEBUG_InternalTest(), DEBUG_InternalTest2(), GetAllBigFemaleRabbits(), GetAllBreedingFemaleRabbits(), GetPopulationSize(), IsFreeFemale(), IsFreeMale(), IsMember(), Join(), JoinNMate(), Leave(), Mate(), Rabbit_Warren(), st_WarrenBeing(), UpdateDominance(), and UpdateThisYearsBreeders().
|
protected |
The inverse of m_availableforage, prevents multiple re-calculation.
Definition at line 732 of file Rabbit.h.
Referenced by GetInvAvailableForage(), and UpdateForageInformation().
|
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().
|
protected |
Chance of litter reaborption based on the m_availableforage.
Definition at line 734 of file Rabbit.h.
Referenced by GetLitterReabsortionConst(), and UpdateForageInformation().
int Rabbit_Warren::m_littersthisyear |
The number of litters produced this year.
Definition at line 549 of file Rabbit.h.
Referenced by GetLittersThisYear(), and UpdateThisYearsBreeders().
|
protected |
List of local warrens and their accessibility from this warren.
Definition at line 750 of file Rabbit.h.
Referenced by AddNetworkConnection(), CalcCarryingCapacityRatio2(), GetNetworkWarren(), and NetworkEvaluation().
|
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().
|
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().
|
static |
The minimum vegetation digestability allowed for foraging.
Definition at line 543 of file Rabbit.h.
Referenced by Rabbit_Population_Manager::AssignStaticVariables(), and UpdateForageInformation().
|
protected |
a measure of mortality likelihood - adults
Definition at line 740 of file Rabbit.h.
Referenced by GetDailyMortalityChanceA(), and st_WarrenBeing().
|
protected |
a measure of mortality likelihood - juveniles
Definition at line 742 of file Rabbit.h.
Referenced by GetDailyMortalityChanceJ(), and st_WarrenBeing().
|
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 GetThisYearsNonBreeders(), and UpdateThisYearsBreeders().
|
protected |
Records the burrows that are occupied.
Definition at line 716 of file Rabbit.h.
Referenced by DEBUG_InternalTest(), GetActiveBurrows(), GetCarryingCapacityFilled(), IsFreeBurrow(), JoinNOccupy(), Leave(), Mate(), OccupyBurrow(), OccupyNewBurrow(), and Rabbit_Warren().
|
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().
|
protected |
Variable holding the total permanent forage area.
Definition at line 724 of file Rabbit.h.
Referenced by GetForageArea(), InitEvaluation(), and UpdateForageInformation().
|
protected |
The time taken for burrow construction.
Definition at line 722 of file Rabbit.h.
Referenced by OccupyWarren(), Rabbit_Warren(), and st_WarrenBeing().
|
protected |
Keeps track of the number of breeding days.
Definition at line 758 of file Rabbit.h.
Referenced by GetThisYearsBreedersAv(), Rabbit_Warren(), and st_WarrenBeing().
|
protected |
Keeps track of the number of breeding females.
Definition at line 756 of file Rabbit.h.
Referenced by GetThisYearsBreedersAv(), Rabbit_Warren(), and st_WarrenBeing().
|
protected |
Warren core size in m.
Definition at line 694 of file Rabbit.h.
Referenced by InitEvaluation(), and Rabbit_Warren().
|
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 GetSoilType(), InitEvaluation(), Rabbit_Warren(), and st_WarrenBeing().
|
protected |
Storage for rabbit production data.
Definition at line 744 of file Rabbit.h.
Referenced by GetRabbitProductionRecord(), RabbitProductionRecord(), ResetAllRabbitProductionRecord(), and ResetRabbitProductionRecord().
|
protected |
Stores original m_Location_x.
Definition at line 698 of file Rabbit.h.
Referenced by Get_TL_x(), GetPointTL(), InitEvaluation(), Rabbit_Warren(), and UpdatePesticide().
|
protected |
Stores original m_Location_y.
Definition at line 700 of file Rabbit.h.
Referenced by Get_TL_y(), GetPointTL(), InitEvaluation(), Rabbit_Warren(), and UpdatePesticide().