ALMaSS Partridge ODdox
1.1
The partridge model description following ODdox protocol
|
The partridge female class. More...
#include <Partridge_All.h>
Public Member Functions | |
virtual void | Dying () |
General dying handler area. More... | |
virtual void | BeginStep (void) |
Female BeginStep. More... | |
virtual void | Step (void) |
Female Step. More... | |
virtual void | EndStep (void) |
Female EndStep. More... | |
virtual bool | DailyMortality () |
Background mortality check. More... | |
virtual bool | OnFarmEvent (FarmToDo event) |
Management event handler. More... | |
void | OnMateDying (PartridgeCommunicationData *pc_data) |
Message handler. More... | |
void | OnClutchDeath () |
Message handler. More... | |
void | OnClutchMown () |
Message handler. More... | |
void | OnSetMyClutch (PartridgeCommunicationData *pc_data) |
Message handler. More... | |
void | OnChicksMatured () |
Message handler. More... | |
void | OnChicksDead () |
Message handler. More... | |
void | OnMating (PartridgeCommunicationData *pc_datae) |
Message handler. More... | |
void | OnWaitForMale () |
Message handler. More... | |
void | OnEggsHatch () |
Message handler. More... | |
int | GetClutchSize (void) |
´Supply clutch size More... | |
Partridge_Clutch * | GetClutch (void) |
Supply clutch pointer. More... | |
Partridge_Male * | GetMate (void) |
Supply mate pointer. More... | |
void | UnSetMate (void) |
Forget mate. More... | |
virtual bool | ArePaired () |
Are we paired? More... | |
virtual void | KillThis () |
Direct mortality message. More... | |
Partridge_Male * | GetOldMate (void) |
Supply old mate pointer. More... | |
void | SetOldMate (Partridge_Male *pm) |
Set old mate pointer. More... | |
void | RemoveOldMate (bool a_knockon) |
Forget old mate. More... | |
Partridge_Female (int a_born_x, int a_born_y, int a_x, int a_y, Partridge_Covey *a_flock, Landscape *a_map, int a_family_counter, Partridge_Population_Manager *a_manager) | |
Constructor. More... | |
virtual | ~Partridge_Female (void) |
Destructor. More... | |
bool | HaveTerritory (void) |
Have we a breeding 'territory'? More... | |
Public Member Functions inherited from Partridge_Base | |
Partridge_Object | GetObjectType () |
Supply object type. More... | |
bool | GetUncleStatus () |
Supply uncle status. More... | |
void | SetUncleStatus (bool a_Status) |
Set uncle status. More... | |
bool | PossibleMate (Partridge_Base *a_partridge) |
Can we mate? More... | |
Partridge_Covey * | GetCovey (void) |
Supply covey pointer. More... | |
Partridge_State | GetState (void) |
Supply state. More... | |
void | SetState (Partridge_State a_pars) |
Set state. More... | |
int | GetFamily (void) |
Supply family ID. More... | |
int | GetAge (void) |
Supply age. More... | |
void | SetAge (int a_age) |
Set age. More... | |
long | GetID (void) |
Supply ID. More... | |
void | SetFamily (unsigned int family) |
Set family ID. More... | |
void | SetCovey (Partridge_Covey *a_covey) |
Set covey pointer. More... | |
void | MakeCovey () |
Create our own covey. More... | |
void | SwitchCovey (Partridge_Covey *a_covey) |
Swap coveys. More... | |
Partridge_Base (int a_born_x, int a_born_y, int a_x, int a_y, int a_family_counter, Partridge_Covey *a_covey, Landscape *a_map, Partridge_Population_Manager *a_manager) | |
Constructor for Partridge_Base. More... | |
virtual | ~Partridge_Base (void) |
Destructor. More... | |
virtual void | CopyMyself (int a_Ptype) |
Duplicate this object. 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 | 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 () |
void | CheckManagement (void) |
void | CheckManagementXY (int x, int y) |
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 | |
Partridge_State | FFlocking (void) |
Female flocking state. More... | |
Partridge_State | FPairing (void) |
Female pairing state. More... | |
Partridge_State | FBuildingUpResources (void) |
Female building up resources state. More... | |
Partridge_State | FMakingNest (void) |
Female making nest state. More... | |
Partridge_State | FLaying (void) |
Female laying state. More... | |
Partridge_State | FStartingNewBrood (bool a_waslaying) |
Female starting new brood state. More... | |
Partridge_State | FIncubating (void) |
Female incubating state. More... | |
Partridge_State | FCaringForYoung (void) |
Female caring for young state. More... | |
Partridge_State | FFindingTerritory (void) |
Female finding 'territory' state. More... | |
Partridge_State | FAttractingMate (void) |
Female attracting mate state. More... | |
void | FDying (void) |
virtual void | CheckMatePointers () |
Debug function - checking mate consistency More... | |
double | GetNestingCoverDensity () |
Calls Partridge_Population_Manager::GetNestingCoverDensity More... | |
Protected Member Functions inherited from TAnimal | |
void | CorrectWrapRound () |
Corrects wrap around co-ordinate problems. More... | |
Protected Attributes | |
bool | m_HaveTerritory |
Flag for having found a suitable breeding area. More... | |
bool | m_clutchproduced |
Flag for having produced a clutch. More... | |
int | m_clutch_size |
Current clutch size. More... | |
int | m_clutch_number |
Current clutch attempt. More... | |
int | m_nest_counter |
Days spent nest building. More... | |
int | m_lifespan |
Physiological lifespan in days. More... | |
int | m_triggerlayingvar |
Adds stochasticity to the light triggering of breeding. More... | |
int | m_startlayingday |
Records the day laying started. More... | |
int | m_buildupwait |
Delay before breeding can commence. More... | |
Partridge_Male * | m_MyMate |
A pointer to the current mate if any. More... | |
Partridge_Male * | m_MyOldHusband |
A record of the previous mate if any. More... | |
Partridge_Clutch * | m_MyClutch |
A pointer to any current clutch. More... | |
Protected Attributes inherited from Partridge_Base | |
int | m_signal |
Used to pass information to outputs. More... | |
long | m_id |
Individual bird ID. More... | |
int | m_family_counter |
Family ID. More... | |
int | m_age |
Age in days. More... | |
int | m_born_x |
x-coord of birth More... | |
int | m_born_y |
y-coord of birth More... | |
bool | m_UncleStatus |
If has uncle status in the covey. More... | |
Partridge_Object | m_object_type |
Type of pob object this is. More... | |
Partridge_Covey * | m_covey |
Pointer to the covey. More... | |
Partridge_State | m_state |
Current behavioural state. 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... | |
Additional Inherited Members | |
Public Attributes inherited from Partridge_Base | |
Partridge_Population_Manager * | m_OurPopulationManager |
Pointer to the population manager. More... | |
The partridge female class.
Definition at line 770 of file Partridge_All.h.
Partridge_Female::Partridge_Female | ( | int | a_born_x, |
int | a_born_y, | ||
int | a_x, | ||
int | a_y, | ||
Partridge_Covey * | a_covey, | ||
Landscape * | a_map, | ||
int | a_family_counter, | ||
Partridge_Population_Manager * | a_manager | ||
) |
Constructor.
Constructor - ensures that attributes are set to sensible starting values, otherwise uses the Partridge_Base constructor.
Definition at line 1334 of file Partridge_All.cpp.
References cfg_par_max_lifespan, cfg_par_min_lifespan, cfg_par_triggerlayingvar, m_clutch_size, m_HaveTerritory, m_lifespan, m_MyClutch, m_MyMate, m_MyOldHusband, Partridge_Base::m_object_type, m_triggerlayingvar, pob_Female, and CfgInt::value().
|
inlinevirtual |
|
inlinevirtual |
Are we paired?
Reimplemented from Partridge_Base.
Definition at line 882 of file Partridge_All.h.
References m_MyMate.
|
virtual |
Female BeginStep.
The BeginStep code for the female partridge. Only function is the test for mortality of different kinds. Might as well remove her here than waste CPU time thinking about the Step code later this time-step.
Reimplemented from TAnimal.
Definition at line 1354 of file Partridge_All.cpp.
References TAnimal::CheckManagement(), CheckMatePointers(), DailyMortality(), FDying(), Partridge_Base::m_age, m_lifespan, and Partridge_Base::m_signal.
|
protectedvirtual |
Debug function - checking mate consistency
This is a debug function.
Reimplemented from Partridge_Base.
Definition at line 2827 of file Partridge_All.cpp.
References TALMaSSObject::GetCurrentStateNo(), Partridge_Male::GetMate(), m_MyMate, TAnimal::m_OurLandscape, Partridge_Base::m_state, pars_FFlocking, and Landscape::Warn().
Referenced by BeginStep(), FBuildingUpResources(), FFindingTerritory(), FMakingNest(), FStartingNewBrood(), and Step().
|
virtual |
Background mortality check.
This method is responsible for applying a general mortality, ie not explicitly modelled. There are three periods considered, a spring mortality applied during 'territory' finding (see Partridge_Female::FFindingTerritory), a winter mortality applied daily between October and April, and the rest of the year a summer mortality. In addition there is a scaling factor (extramort) which is applied if the bird is alone. All parameter values are under user control through configuration variables.
Reimplemented from Partridge_Base.
Definition at line 1454 of file Partridge_All.cpp.
References April, cfg_par_adult_mortality_alone, cfg_par_adult_mortalitySpring, cfg_par_adult_mortalitySummer, cfg_par_adult_mortalityWinter, FDying(), g_rand_uni, Partridge_Covey::GetCoveySize(), Partridge_Base::m_covey, TAnimal::m_OurLandscape, Partridge_Base::m_state, October, pars_FFindingTerritory, Landscape::SupplyDayInYear(), and CfgFloat::value().
Referenced by BeginStep().
|
inlinevirtual |
General dying handler area.
Reimplemented from TAnimal.
Definition at line 827 of file Partridge_All.h.
References FDying().
|
virtual |
Female EndStep.
Nothing to do.
Reimplemented from TAnimal.
Definition at line 1441 of file Partridge_All.cpp.
|
protected |
Female attracting mate state.
This just loops because it is the male who controls this. She will stay doing this until either she is pulled out by a male arriving or give up breeding date is reached.
During this period her covey peg is locked in position following Partridge_Female::FFindingTerritory, so she cannot be moved by other covies.
Definition at line 1962 of file Partridge_All.cpp.
References Partridge_Base::m_covey, Partridge_Base::m_OurPopulationManager, pars_FAttractingMate, pars_FFlocking, Partridge_Covey::SetFixed(), and Partridge_Population_Manager::SupplyShouldFlock().
Referenced by Step().
|
protected |
Female building up resources state.
This is simply a waiting state where we assume the female is building up physiologial resources before breeding. Since we don't know what triggers this we origianlly used a fixed counter from the point were territory has been fixed. This produced variation in the starting laying date determined by when the pair fixes their breeding territory for this season. However this did not seem satisfactory so it has been replaced with a measure of daylength with variation.
Definition at line 1644 of file Partridge_All.cpp.
References cfg_par_days_to_make_nest, cfg_par_triggerlaying, CheckMatePointers(), m_buildupwait, m_nest_counter, TAnimal::m_OurLandscape, m_triggerlayingvar, pars_FBuildingUpResources, pars_FMakingNest, Landscape::SupplyDaylength(), and CfgInt::value().
Referenced by Step().
|
protected |
Female caring for young state.
Will stay in this state until her young counter is zero - this is caused by messages from the young, so nothing to do but wait. Distance move is calculated as a function of chick food needs, so uses chick age.
Definition at line 1896 of file Partridge_All.cpp.
References g_MaxWalk, Partridge_Covey::GetChickAge(), Partridge_Base::m_covey, Partridge_Covey::MoveDistance(), and pars_FCaringForYoung.
Referenced by Step().
|
protected |
Must do all the clean-up necessary to remove the female from the simulation without leaving any stray pointers to this object.
Definition at line 1984 of file Partridge_All.cpp.
References population_attributes::incNoDeadFemales(), PartridgeCommunicationData::m_clutch, Partridge_Population_Manager::m_comms_data, Partridge_Base::m_covey, TALMaSSObject::m_CurrentStateNo, PartridgeCommunicationData::m_female, PartridgeCommunicationData::m_male, Partridge_Population_Manager::m_messagecentre, m_MyClutch, m_MyMate, Partridge_Population_Manager::m_Ourkfactors, Partridge_Base::m_OurPopulationManager, Partridge_Base::m_state, TALMaSSObject::m_StepDone, k_factors::m_ThisYear, Partridge_Covey::NestLeave(), pars_Destroy, Partridge_Communication::PassMessage(), pcomm_MumDeadC, Partridge_Covey::RemoveMember(), and RemoveOldMate().
Referenced by BeginStep(), DailyMortality(), Dying(), FIncubating(), KillThis(), OnClutchMown(), and OnFarmEvent().
|
protected |
Female finding 'territory' state.
Territory here is used to mean a place where breeding is possible and not a territory in the normal definition of a defended area.
First we have to be sure we are not too late in the year, if so start flocking.
Next we make a movement using Partridge_Covey::FlyTo and determine the quality of the territory compared to a minimum acceptable quality.
Next we check whether this area is already occupied by a covey. If this is OK then we settle here. If we fail at any of these steps then we have 49 more tries in this time-step before giving up until the next day.
Definition at line 1912 of file Partridge_All.cpp.
References Partridge_Covey::AssessHabitatQualityFaster(), cfg_buildupwait, cfg_par_female_movement_max, cfg_par_start_dissolve, CheckMatePointers(), Partridge_Covey::FixHabitat(), Partridge_Covey::FlyTo(), Partridge_Population_Manager::GetHabitatQuality(), m_buildupwait, m_clutch_number, Partridge_Population_Manager::m_comms_data, Partridge_Base::m_covey, PartridgeCommunicationData::m_female, m_HaveTerritory, PartridgeCommunicationData::m_male, Partridge_Population_Manager::m_messagecentre, m_MyMate, TAnimal::m_OurLandscape, Partridge_Base::m_OurPopulationManager, pars_FAttractingMate, pars_FBuildingUpResources, pars_FFindingTerritory, pars_FFlocking, Partridge_Communication::PassMessage(), pcomm_FemaleGivingUp, Partridge_Covey::SetFixed(), Landscape::SupplyDayInYear(), Partridge_Population_Manager::SupplyShouldFlock(), Partridge_Covey::TooClose(), and CfgInt::value().
Referenced by Step().
|
protected |
Female flocking state.
Ensures that the covey is moving around while flocking. NB: It is OK for all the members of the covey to call this method every day. It only has any effect on the first call.
The birds wait in this state until they get a message initiating breeding behaviour.
Definition at line 1632 of file Partridge_All.cpp.
References Partridge_Covey::GetmaxAllowedMove(), Partridge_Covey::GetmaxFoodNeedToday(), Partridge_Base::m_covey, Partridge_Covey::MoveDistance(), and pars_FFlocking.
Referenced by Step().
|
protected |
Female incubating state.
Arrives here from Laying, and stays until either the clutch tells her its hatched, or the clutch is dead - so just wait unless eaten via density-dependent mortality depending upon the number of nests nearby. NB this is a local density-dependence.
Definition at line 1856 of file Partridge_All.cpp.
References cfg_par_clutch_mortality, cfg_par_female_incubation_mortality_const, cfg_par_female_incubation_mortality_slope, Partridge_Population_Manager::ClutchDensity(), FDying(), FStartingNewBrood(), g_rand_uni, population_attributes::incNoClutchesPredated(), population_attributes::incNoHensPredated(), PartridgeCommunicationData::m_clutch, Partridge_Population_Manager::m_comms_data, Partridge_Base::m_covey, PartridgeCommunicationData::m_female, Partridge_Population_Manager::m_messagecentre, m_MyClutch, Partridge_Population_Manager::m_Ourkfactors, Partridge_Base::m_OurPopulationManager, Partridge_Base::m_state, k_factors::m_ThisYear, Partridge_Covey::NestLeave(), pars_FDying, pars_FIncubating, Partridge_Communication::PassMessage(), pcomm_ClutchEaten, CfgFloat::value(), Partridge_Covey::X(), and Partridge_Covey::Y().
Referenced by Step().
|
protected |
Female laying state.
Need to add eggs to clutch, here the problem is that eggs are not produced one each day We have: cfg_par_days_per_egg.value() and m_clutch_size and m_startlayingday so we just add one egg each cfg_par_days_per_egg.value() days until we have the size wee need.
If she completes her laying this is counted as a success and the female remembers the male as a good mate and makes a transition to FIncubating.
Definition at line 1768 of file Partridge_All.cpp.
References cfg_par_clutch_mortality, cfg_par_days_per_egg, FStartingNewBrood(), g_rand_uni, population_attributes::incNoClutchesPredated(), PartridgeCommunicationData::m_clutch, m_clutch_number, m_clutch_size, Partridge_Population_Manager::m_comms_data, Partridge_Base::m_covey, PartridgeCommunicationData::m_female, Partridge_Population_Manager::m_messagecentre, m_MyClutch, m_MyMate, Partridge_Population_Manager::m_Ourkfactors, TAnimal::m_OurLandscape, Partridge_Base::m_OurPopulationManager, m_startlayingday, Partridge_Base::m_state, k_factors::m_ThisYear, Partridge_Covey::NestLeave(), Partridge_Clutch::OnStartIncubating(), pars_FIncubating, pars_FLaying, Partridge_Communication::PassMessage(), pcomm_ClutchEaten, Partridge_Clutch::SetClutchSize(), Partridge_Male::SetOldMate(), SetOldMate(), Landscape::SupplyDayInYear(), Landscape::SupplyGlobalDate(), CfgFloat::value(), and Partridge_Population_Manager::WriteParClutches().
Referenced by Step().
|
protected |
Female making nest state.
We start with a test for the end of the breeding season. If it is not too late then we determine the eventual size of the clutch here and create this when the nest is completed. The clutch object is created with zero eggs and the eggs are added in Partridge_Female::FLaying.
Determining the number of eggs to be produced has been done by fitting a curve to Danish data from 1953 since we do not know how to do this mechanistically:
Clutch size with fitted curve used to create a probability distribution hard-coded below. This distribution is scaled up and down to obtain the correct mean clutch size recorded when parameter fitting.
The male will just carry on guarding so no need to tell him when the nest is complete. Originally needed to do a special calculation here to calculate the km nesting cover/km2 present. This does not change during the nest's existence so no danger of errors there and this code was slow so an alternative was to calculate all possible values on a coarser grid at start of simulation, then store these - this is the current implementation.
Definition at line 1673 of file Partridge_All.cpp.
References Partridge_struct::bx, Partridge_struct::by, cfg_par_last_brood_date, cfg_par_min_no_eggs, CheckMatePointers(), Partridge_Population_Manager::CreateObjects(), population_attributes::decNoClutches(), Partridge_struct::family_counter, m_clutch_size, m_clutchproduced, Partridge_Population_Manager::m_comms_data, Partridge_struct::m_covey, Partridge_Base::m_covey, Partridge_Base::m_family_counter, PartridgeCommunicationData::m_female, m_HaveTerritory, TAnimal::m_Location_x, TAnimal::m_Location_y, PartridgeCommunicationData::m_male, Partridge_Population_Manager::m_messagecentre, m_MyMate, m_nest_counter, Partridge_Population_Manager::m_Ourkfactors, TAnimal::m_OurLandscape, Partridge_Base::m_OurPopulationManager, m_startlayingday, k_factors::m_ThisYear, Clutch_struct::Mum, Partridge_Covey::NestFindLocation(), Clutch_struct::No, pars_FFindingTerritory, pars_FFlocking, pars_FLaying, pars_FMakingNest, Partridge_Communication::PassMessage(), pcomm_MovingHome, pcomm_StoppingBreeding, pob_Clutch, RemoveOldMate(), Partridge_Covey::SetFixed(), Landscape::SupplyDayInYear(), CfgInt::value(), Partridge_struct::x, and Partridge_struct::y.
Referenced by Step().
|
protected |
Female pairing state.
|
protected |
Female starting new brood state.
Need to test whether or not to start again.
If it is a brood that is lost then this behaviour is not an option, otherwise we will end here on the loss of a clutch or nest. The data in the lines below needs to be checked if it describes the distribution of 2nd brood sizes. Currently it is the same as 1st clutch minus 4.
See also Partridge_Female::MakingNest
Definition at line 1802 of file Partridge_All.cpp.
References cfg_par_last_brood_date, cfg_par_min_no_eggs, CheckMatePointers(), m_clutch_number, m_clutch_size, Partridge_Population_Manager::m_comms_data, Partridge_Base::m_covey, PartridgeCommunicationData::m_female, m_HaveTerritory, PartridgeCommunicationData::m_male, Partridge_Population_Manager::m_messagecentre, m_MyMate, m_nest_counter, TAnimal::m_OurLandscape, Partridge_Base::m_OurPopulationManager, pars_FFlocking, pars_FMakingNest, Partridge_Communication::PassMessage(), pcomm_StoppingBreeding, Partridge_Covey::SetFixed(), Landscape::SupplyDayInYear(), CfgInt::value(), and Landscape::Warn().
Referenced by FIncubating(), FLaying(), OnClutchDeath(), and Step().
|
inline |
Supply clutch pointer.
Definition at line 867 of file Partridge_All.h.
References m_MyClutch.
Referenced by Partridge_Communication::PassMessage().
|
inline |
|
inline |
Supply mate pointer.
Definition at line 872 of file Partridge_All.h.
References m_MyMate.
Referenced by Partridge_Covey::ArePaired(), Partridge_Male::CheckMatePointers(), Partridge_Clutch::ClDeveloping(), Partridge_Covey::FindMeAMateInCovey(), Partridge_Covey::FindMeAWife(), Partridge_Covey::OnAddChick(), and Partridge_Communication::PassMessage().
|
protected |
Calls Partridge_Population_Manager::GetNestingCoverDensity
Definition at line 273 of file Partridge_All.cpp.
References Partridge_Population_Manager::GetNestingCoverDensity(), TAnimal::m_Location_x, TAnimal::m_Location_y, and Partridge_Base::m_OurPopulationManager.
|
inline |
Supply old mate pointer.
Definition at line 893 of file Partridge_All.h.
References m_MyOldHusband.
Referenced by Partridge_Population_Manager::DissolveCovey(), Partridge_Covey::GetUnpairedFemale(), and Partridge_Communication::PassMessage().
|
inline |
Have we a breeding 'territory'?
Definition at line 920 of file Partridge_All.h.
References m_HaveTerritory.
Referenced by Partridge_Male::MFindingMate(), Partridge_Male::MFollowingMate(), Partridge_Male::MPairing(), and OnMating().
|
inlinevirtual |
Direct mortality message.
Reimplemented from TAnimal.
Definition at line 888 of file Partridge_All.h.
References FDying().
Referenced by Partridge_Population_Manager::DoFirst().
void Partridge_Female::OnChicksDead | ( | void | ) |
Message handler.
Response to pcomm_AllChicksDead message arriving when the last chick dies.
Definition at line 2118 of file Partridge_All.cpp.
References m_HaveTerritory, m_MyMate, Partridge_Base::m_state, and pars_FFlocking.
Referenced by Partridge_Communication::PassMessage().
void Partridge_Female::OnChicksMatured | ( | void | ) |
Message handler.
Response to pcomm_ChicksMature message arriving when the last chick matures.
Definition at line 2107 of file Partridge_All.cpp.
References m_HaveTerritory, m_MyMate, Partridge_Base::m_state, and pars_FFlocking.
Referenced by Partridge_Communication::PassMessage().
void Partridge_Female::OnClutchDeath | ( | ) |
Message handler.
Arrives here follwing a pcomm_ClutchDead or a pcomm_AllInfertile message.
Definition at line 2056 of file Partridge_All.cpp.
References FStartingNewBrood(), Partridge_Base::m_covey, m_MyClutch, Partridge_Base::m_state, Partridge_Covey::NestLeave(), and pars_FIncubating.
Referenced by OnClutchMown(), and Partridge_Communication::PassMessage().
void Partridge_Female::OnClutchMown | ( | ) |
Message handler.
Arrives here as a result of a pcomm_ClutchMown message. This determines whether the female dies with the clutch.
Definition at line 2069 of file Partridge_All.cpp.
References cfg_female_mowing_chance, FDying(), g_rand_uni, Partridge_Base::m_state, OnClutchDeath(), pars_FIncubating, and CfgFloat::value().
Referenced by Partridge_Communication::PassMessage().
void Partridge_Female::OnEggsHatch | ( | ) |
Message handler.
Response to pcomm_EggsHatch message arriving on clutch hatching.
Definition at line 2096 of file Partridge_All.cpp.
References Partridge_Base::m_covey, m_MyClutch, Partridge_Base::m_state, Partridge_Covey::NestLeave(), and pars_FCaringForYoung.
Referenced by Partridge_Communication::PassMessage().
|
virtual |
Management event handler.
There are only a few management events that cause direct effects for the female, but these may be important eg mowing/cutting events. When she is on the nest mortaltiy is controlled via the Partridge_Clutch object not this code, since she is assumed not to escape so easily (see Partridge_Clutch::AgDying).
Reimplemented from TAnimal.
Definition at line 1491 of file Partridge_All.cpp.
References autumn_harrow, autumn_or_spring_plough, autumn_plough, autumn_roll, autumn_sow, burn_straw_stubble, cattle_out, cattle_out_low, cfg_par_ad_cut, cut_to_hay, cut_to_silage, cut_weeds, deep_ploughing, Landscape::EventtypeToString(), fa_ammoniumsulphate, fa_greenmanure, fa_manure, fa_npk, fa_pk, fa_sludge, fa_slurry, FDying(), fp_greenmanure, fp_liquidNH3, fp_manganesesulphate, fp_manure, fp_npk, fp_npks, fp_pk, fp_sludge, fp_slurry, fungicide_treat, g_rand_uni, glyphosate, growth_regulator, harvest, hay_bailing, hay_turning, herbicide_treat, hilling_up, insecticide_treat, TAnimal::m_OurLandscape, Partridge_Base::m_state, molluscicide, mow, pars_Destroy, pigs_out, product_treat, row_cultivation, sleep_all_day, spring_harrow, spring_plough, spring_roll, spring_sow, straw_chopping, strigling, strigling_sow, stubble_harrowing, swathing, syninsecticide_treat, CfgFloat::value(), Landscape::Warn(), water, and winter_plough.
void Partridge_Female::OnMateDying | ( | PartridgeCommunicationData * | pc_data | ) |
Message handler.
Response to a pcomm_MaleDying message from Partridge_Male::MDying.
Definition at line 2129 of file Partridge_All.cpp.
References Partridge_Base::m_covey, PartridgeCommunicationData::m_male, m_MyClutch, m_MyMate, TAnimal::m_OurLandscape, Partridge_Base::m_state, Partridge_Covey::NestLeave(), Partridge_Clutch::OnGivenUp(), pars_FAttractingMate, pars_FBuildingUpResources, pars_FCaringForYoung, pars_FFindingTerritory, pars_FFlocking, pars_FIncubating, pars_FLaying, pars_FMakingNest, pars_FStartingNewBrood, RemoveOldMate(), Partridge_Covey::SetFixed(), and Landscape::Warn().
Referenced by Partridge_Communication::PassMessage().
void Partridge_Female::OnMating | ( | PartridgeCommunicationData * | pc_data | ) |
Message handler.
Arrives here following pcomm_Mating message from either Partridge_Population_Manager::DissolveCovey or Partridge_Male::MFindingMate.
Definition at line 2031 of file Partridge_All.cpp.
References cfg_buildupwait, HaveTerritory(), m_buildupwait, m_clutch_number, m_clutchproduced, PartridgeCommunicationData::m_covey, PartridgeCommunicationData::m_male, m_MyMate, Partridge_Base::m_state, pars_FBuildingUpResources, pars_FFindingTerritory, RemoveOldMate(), Partridge_Base::SwitchCovey(), and CfgInt::value().
Referenced by Partridge_Communication::PassMessage().
void Partridge_Female::OnSetMyClutch | ( | PartridgeCommunicationData * | pc_data | ) |
Message handler.
Response to the pcomm_SetClutch message received on Partridge_Clutch object creation.
Definition at line 2086 of file Partridge_All.cpp.
References PartridgeCommunicationData::m_clutch, m_MyClutch, Partridge_Base::m_state, and pars_FIncubating.
Referenced by Partridge_Communication::PassMessage().
void Partridge_Female::OnWaitForMale | ( | ) |
Message handler.
Called following a pcomm_WaitForMale message from Partridge_Population_Manager::DissolveCovey
Definition at line 2015 of file Partridge_All.cpp.
References Partridge_Base::m_covey, Partridge_Base::m_state, Partridge_Base::m_UncleStatus, pars_FAttractingMate, RemoveOldMate(), Partridge_Covey::SetFixed(), and Partridge_Base::SetUncleStatus().
Referenced by Partridge_Communication::PassMessage().
|
inline |
Forget old mate.
Definition at line 903 of file Partridge_All.h.
References m_MyOldHusband, and Partridge_Male::RemoveOldMate().
Referenced by FDying(), FMakingNest(), Partridge_Covey::GetUnpairedFemale(), OnMateDying(), OnMating(), OnWaitForMale(), and Partridge_Male::RemoveOldMate().
|
inline |
Set old mate pointer.
Definition at line 898 of file Partridge_All.h.
References m_MyOldHusband.
Referenced by FLaying().
|
virtual |
Female Step.
The Step code for the female partridge. This is the main state-transition control for the female. It will be called repeatedly each time-step until m_StepDone is set to true.
Reimplemented from TAnimal.
Definition at line 1378 of file Partridge_All.cpp.
References CheckMatePointers(), FAttractingMate(), FBuildingUpResources(), FCaringForYoung(), FFindingTerritory(), FFlocking(), FIncubating(), FLaying(), FMakingNest(), FStartingNewBrood(), TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, Partridge_Base::m_state, TALMaSSObject::m_StepDone, pars_FAttractingMate, pars_FBuildingUpResources, pars_FCaringForYoung, pars_FDying, pars_FFindingTerritory, pars_FFlocking, pars_FIncubating, pars_FLaying, pars_FMakingNest, pars_FStartingNewBrood, pars_Initiation, and Landscape::Warn().
|
inline |
|
protected |
Delay before breeding can commence.
Definition at line 817 of file Partridge_All.h.
Referenced by FBuildingUpResources(), FFindingTerritory(), and OnMating().
|
protected |
Current clutch attempt.
Definition at line 807 of file Partridge_All.h.
Referenced by FFindingTerritory(), FLaying(), FStartingNewBrood(), and OnMating().
|
protected |
Current clutch size.
Definition at line 805 of file Partridge_All.h.
Referenced by FLaying(), FMakingNest(), FStartingNewBrood(), GetClutchSize(), and Partridge_Female().
|
protected |
Flag for having produced a clutch.
Definition at line 803 of file Partridge_All.h.
Referenced by FMakingNest(), and OnMating().
|
protected |
Flag for having found a suitable breeding area.
Definition at line 801 of file Partridge_All.h.
Referenced by FFindingTerritory(), FMakingNest(), FStartingNewBrood(), HaveTerritory(), OnChicksDead(), OnChicksMatured(), and Partridge_Female().
|
protected |
Physiological lifespan in days.
Definition at line 811 of file Partridge_All.h.
Referenced by BeginStep(), and Partridge_Female().
|
protected |
A pointer to any current clutch.
Definition at line 823 of file Partridge_All.h.
Referenced by FDying(), FIncubating(), FLaying(), GetClutch(), OnClutchDeath(), OnEggsHatch(), OnMateDying(), OnSetMyClutch(), and Partridge_Female().
|
protected |
A pointer to the current mate if any.
Definition at line 819 of file Partridge_All.h.
Referenced by ArePaired(), CheckMatePointers(), FDying(), FFindingTerritory(), FLaying(), FMakingNest(), FStartingNewBrood(), GetMate(), OnChicksDead(), OnChicksMatured(), OnMateDying(), OnMating(), Partridge_Female(), and UnSetMate().
|
protected |
A record of the previous mate if any.
Definition at line 821 of file Partridge_All.h.
Referenced by GetOldMate(), Partridge_Female(), RemoveOldMate(), and SetOldMate().
|
protected |
Days spent nest building.
Definition at line 809 of file Partridge_All.h.
Referenced by FBuildingUpResources(), FMakingNest(), and FStartingNewBrood().
|
protected |
Records the day laying started.
Definition at line 815 of file Partridge_All.h.
Referenced by FLaying(), and FMakingNest().
|
protected |
Adds stochasticity to the light triggering of breeding.
Definition at line 813 of file Partridge_All.h.
Referenced by FBuildingUpResources(), and Partridge_Female().