ALMaSS Partridge ODdox
1.1
The partridge model description following ODdox protocol
|
Partridge chick class. More...
#include <Partridge_All.h>
Public Member Functions | |
virtual void | BeginStep (void) |
Chick BeginStep. More... | |
virtual void | Step (void) |
Chick Step. More... | |
virtual void | EndStep (void) |
Chick EndStep. More... | |
virtual bool | DailyMortality () |
Background mortality test. More... | |
virtual bool | OnFarmEvent (FarmToDo event) |
Farm event handler. More... | |
virtual void | Dying () |
Generic dying handler. More... | |
void | OnYouAreDead () |
Message handler. More... | |
Partridge_Chick (int a_x, int a_y, Partridge_Female *a_mother, Partridge_Covey *a_flock, Landscape *a_map, bool a_sex, int a_family_counter, Partridge_Population_Manager *a_manager) | |
Constructor. More... | |
virtual | ~Partridge_Chick (void) |
Destructor. 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... | |
virtual bool | ArePaired () |
Overridden base function. 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 | 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 () |
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 | |
virtual Partridge_State | ChDeveloping (void) |
Development. More... | |
virtual Partridge_State | ChMaturing (void) |
Maturation. More... | |
void | ChDying (void) |
Chick Dying. More... | |
Protected Member Functions inherited from Partridge_Base | |
virtual void | CheckMatePointers () |
Debug. More... | |
Protected Member Functions inherited from TAnimal | |
void | CorrectWrapRound () |
Corrects wrap around co-ordinate problems. More... | |
Protected Attributes | |
bool | m_sex |
Sex. More... | |
int | m_starve |
Days spent starving. 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... | |
Partridge chick class.
Definition at line 581 of file Partridge_All.h.
Partridge_Chick::Partridge_Chick | ( | int | a_born_x, |
int | a_born_y, | ||
Partridge_Female * | a_mother, | ||
Partridge_Covey * | a_covey, | ||
Landscape * | a_map, | ||
bool | a_sex, | ||
int | a_family_counter, | ||
Partridge_Population_Manager * | a_manager | ||
) |
Constructor.
The constructor. Ensures sensible values for attributes not set by the base constructor.
Definition at line 663 of file Partridge_All.cpp.
References Partridge_Base::m_age, Partridge_Base::m_covey, Partridge_Base::m_object_type, m_sex, m_starve, Partridge_Covey::OnAddChick(), and pob_Chick.
|
inlinevirtual |
|
virtual |
Chick BeginStep.
BeginStep checks for daily mortality and management events, also deals with knock-on deaths for other chicks in the covey.
Reimplemented from TAnimal.
Reimplemented in Partridge_Chick2.
Definition at line 680 of file Partridge_All.cpp.
References ChDying(), TAnimal::CheckManagement(), Partridge_Covey::ChickExtraMortality(), DailyMortality(), g_MaxWalk, Partridge_Base::m_age, Partridge_Base::m_covey, TALMaSSObject::m_CurrentStateNo, Partridge_Base::m_signal, Partridge_Covey::MoveDistance(), and Partridge_Covey::SetChickAge().
|
protectedvirtual |
Development.
Chick development is simplified to developing as long as the chick is not starving for too long. This is determined by the age dependent energy needs and rainfall. This could also be augmented to cinclude temperature at a later stage.
At 42 days old the Chick becomes a Partridge_Chick2.
Reimplemented in Partridge_Chick2.
Definition at line 922 of file Partridge_All.cpp.
References cfg_par_extraction_rate, cfg_par_starve_threshold, ChDying(), g_FoodNeed, g_par_rainfactor, population_attributes::incNoStarvedChicks(), Partridge_Base::m_age, Partridge_Base::m_covey, Partridge_Population_Manager::m_Ourkfactors, TAnimal::m_OurLandscape, Partridge_Base::m_OurPopulationManager, Partridge_Base::m_signal, m_starve, k_factors::m_ThisYear, pars_ChDeveloping, pars_ChDying, pars_ChMaturing, Partridge_Covey::SupplyFoodToday(), Landscape::SupplyRain(), CfgInt::value(), and CfgFloat::value().
Referenced by EndStep().
|
protected |
Chick Dying.
All the housekeeping necessary to die.
Definition at line 989 of file Partridge_All.cpp.
References population_attributes::incNoDeadChicks(), population_attributes::incNoDeadFemales(), population_attributes::incNoDeadMales(), Partridge_Base::m_age, Partridge_Base::m_covey, TALMaSSObject::m_CurrentStateNo, Partridge_Population_Manager::m_Ourkfactors, Partridge_Base::m_OurPopulationManager, m_sex, Partridge_Base::m_state, TALMaSSObject::m_StepDone, k_factors::m_ThisYear, Partridge_Covey::OnChickDeath(), pars_Destroy, and Partridge_Covey::RemoveMember().
Referenced by BeginStep(), Partridge_Chick2::BeginStep(), ChDeveloping(), Dying(), EndStep(), Partridge_Chick2::EndStep(), OnFarmEvent(), and OnYouAreDead().
|
protectedvirtual |
Maturation.
Matures the Chick object into a Partridge_Chick2 object, passing all the necessary informatin using a Chick_struct.
Reimplemented in Partridge_Chick2.
Definition at line 961 of file Partridge_All.cpp.
References Partridge_struct::bx, Partridge_struct::by, Partridge_Population_Manager::CreateObjects(), Partridge_struct::family_counter, Partridge_struct::m_covey, Partridge_Base::m_covey, TALMaSSObject::m_CurrentStateNo, Partridge_Base::m_family_counter, TAnimal::m_Location_x, TAnimal::m_Location_y, Partridge_Base::m_OurPopulationManager, m_sex, TALMaSSObject::m_StepDone, Chick_struct::Mum, pars_Destroy, pob_Chick2, Partridge_Covey::RemoveMember(), Chick_struct::sex, Partridge_struct::x, and Partridge_struct::y.
Referenced by Step().
|
virtual |
Background mortality test.
Does the simple probability test against chance of daily mortality for non-specifically modelled mortalities.
Reimplemented from Partridge_Base.
Reimplemented in Partridge_Chick2.
Definition at line 905 of file Partridge_All.cpp.
References cfg_par_chick_mortality, g_rand_uni, and CfgFloat::value().
Referenced by BeginStep().
|
inlinevirtual |
Generic dying handler.
Reimplemented from TAnimal.
Definition at line 607 of file Partridge_All.h.
References ChDying().
Referenced by Partridge_Chick2::OnFarmEvent().
|
virtual |
Chick EndStep.
EndStep does the developing for the Chick. This ensures that someone (adult) has called the methods necessary to collect food for developing that day during Step.
Reimplemented from TAnimal.
Reimplemented in Partridge_Chick2.
Definition at line 738 of file Partridge_All.cpp.
References ChDeveloping(), ChDying(), TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, Partridge_Base::m_state, pars_ChDeveloping, pars_ChDying, pars_ChMaturing, pars_Initiation, and Landscape::Warn().
|
virtual |
Farm event handler.
Check and respond to farm events either using config variables for cutting or direct inline values.
Reimplemented from TAnimal.
Reimplemented in Partridge_Chick2.
Definition at line 765 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_ch_cut, ChDying(), 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, 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_Chick::OnYouAreDead | ( | ) |
Message handler.
Called by any method that directly kills a chick. Will cause housekeeping to be done by informing those objects that need to know.
Definition at line 1016 of file Partridge_All.cpp.
References ChDying().
Referenced by Partridge_Covey::KillExcessChicks(), and Partridge_Communication::PassMessage().
|
virtual |
Chick Step.
Step only takes care of maturing for this class.
Reimplemented from TAnimal.
Reimplemented in Partridge_Chick2.
Definition at line 709 of file Partridge_All.cpp.
References ChMaturing(), TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, Partridge_Base::m_state, TALMaSSObject::m_StepDone, pars_ChDeveloping, pars_ChDying, pars_ChMaturing, pars_Initiation, and Landscape::Warn().
|
protected |
Sex.
Definition at line 590 of file Partridge_All.h.
Referenced by ChDying(), ChMaturing(), Partridge_Chick2::ChMaturing(), and Partridge_Chick().
|
protected |
Days spent starving.
Definition at line 592 of file Partridge_All.h.
Referenced by ChDeveloping(), and Partridge_Chick().