Loading [MathJax]/extensions/ams.js
 |
ALMaSS
1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
|
#include <skylarks_all.h>
|
void | BeginStep (void) override |
| BeingStep behaviour - must be implemented in descendent classes. More...
|
|
void | Step (void) override |
| Step behaviour - must be implemented in descendent classes. More...
|
|
void | EndStep (void) override |
| EndStep behaviour - must be implemented in descendent classes. More...
|
|
| Skylark_Clutch (Skylark_Female *Mum, SkTerritories *Terrs, Landscape *L, int NoEggs, int x, int y, int mh, Skylark_Population_Manager *SPM) |
|
virtual void | ReInit (Skylark_Female *Mum, SkTerritories *Terrs, Landscape *L, int NoEggs, int x, int y, int mh, Skylark_Population_Manager *SPM) |
|
void | OnMumGone () |
|
void | AddEgg () |
|
void | StartDeveloping () |
|
| Skylark_Base (int x, int y, SkTerritories *Terrs, Landscape *L, Skylark_Population_Manager *SPM, int bx, int by, int mh) |
|
virtual void | ReInit (int x, int y, SkTerritories *Terrs, Landscape *L, Skylark_Population_Manager *SPM, int bx, int by, int mh) |
|
virtual double | On_FoodSupply (double) |
|
void | AddStriglingMort (const int lifestage) const |
|
int | WhatState () override |
| Returns the objects current state number. More...
|
|
bool | InSquare (rectangle R) const |
|
| TAnimal (int x, int y, Landscape *L) |
| The TAnimal constructor saving the x,y, location and the landscape pointer. More...
|
|
| TAnimal (int x, int y) |
| The TAnimal constructor saving the x,y used if landscape is already set. More...
|
|
void | SetGuardMapIndex (int a_index_x, int a_index_y) |
| Set the guard map index, this is used to avoid two animals operating in the same location when using multithread. More...
|
|
unsigned | SupplyFarmOwnerRef () const |
| Get the current location farm ref if any. More...
|
|
AnimalPosition | SupplyPosition () const |
| Returns the objects location and habitat type and veg type. More...
|
|
APoint | SupplyPoint () const |
| Returns the objects location in ALMaSS coordinates. More...
|
|
int | SupplyPolygonRef () const |
| Returns the polygon reference where the object is located. More...
|
|
TTypesOfLandscapeElement | SupplyPolygonType () const |
| Returns the polygon type where the object is located. More...
|
|
int | Supply_m_Location_x () const |
| Returns the ALMaSS x-coordinate. More...
|
|
int | Supply_m_Location_y () const |
| Returns the ALMaSS y-coordinate. More...
|
|
int | SupplyGuardCellX () const |
| Returns the x-index to the guard cell. More...
|
|
int | SupplyGuardCellY () const |
| Returns the y-index to the guard cell. More...
|
|
int | SupplyAge () const |
| Returns the animals age in days. More...
|
|
void | SetAge (int a_age) |
| Sets the animals age in days. More...
|
|
virtual void | KillThis () |
| Sets all parameters ready for object destruction. More...
|
|
virtual void | CopyMyself () |
| Used to copy the object details to another in descendent classes. More...
|
|
void | SetX (const int a_x) |
| Sets the x-coordinate. More...
|
|
void | SetY (const int a_y) |
| Sets the y-coordinate. More...
|
|
virtual void | ReinitialiseObject (int a_x, int a_y, Landscape *a_l_ptr) |
|
virtual void | ReinitialiseObject (int a_x, int a_y) |
| Used to re-use an object - must be implemented in descendent classes. More...
|
|
virtual void | Dying () |
| A wrapped for KillThis - ideally should not be used. More...
|
|
void | CheckManagement () |
| Used to start a check for any management related effects at the objects current location. More...
|
|
void | CheckManagementXY (int a_x, int a_y) |
| Used to start a check for any management related effects at x,y. More...
|
|
int | GetCurrentStateNo () const |
| Returns the current state number. More...
|
|
void | SetCurrentStateNo (int a_num) |
| Sets the current state number. More...
|
|
bool | GetStepDone () const |
| Returns the step done indicator flag. More...
|
|
void | SetStepDone (bool a_bool) |
| Sets the step done indicator flag. More...
|
|
void | ReinitialiseObjectBase () |
| Used to initialise an object. More...
|
|
| TALMaSSObject () |
| The constructor for TALMaSSObject. More...
|
|
virtual | ~TALMaSSObject ()=default |
| The destructor for TALMaSSObject. More...
|
|
◆ Skylark_Clutch()
◆ AddEgg()
void Skylark_Clutch::AddEgg |
( |
| ) |
|
|
inline |
◆ BeginStep()
void Skylark_Clutch::BeginStep |
( |
void |
| ) |
|
|
overridevirtual |
◆ EndStep()
void Skylark_Clutch::EndStep |
( |
void |
| ) |
|
|
overridevirtual |
EndStep behaviour - must be implemented in descendent classes.
Reimplemented from TALMaSSObject.
2400 if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
2405 case toss_Initiation:
2407 case toss_Developing:
2411 #ifdef TEST_ISSUE_DEATH_WARRANT
2412 printf(
"Skylark_Clutch::EndStep() st_Developing() %d\n", (
int )
g_date->
Date() );
2427 #ifdef TEST_ISSUE_DEATH_WARRANT
2428 printf(
"Skylark_Clutch::EndStep() st_Hatching() %d\n", (
int )
g_date->
Date() );
References Calendar::Date(), g_date, g_msg, Skylark_Base::m_CurrentSkState, TALMaSSObject::m_CurrentStateNo, TALMaSSObject::m_StepDone, st_Developing(), st_Dying(), st_Hatching(), and MapErrorMsg::Warn().
◆ OnFarmEvent()
bool Skylark_Clutch::OnFarmEvent |
( |
FarmToDo |
| ) |
|
|
overrideprotectedvirtual |
Must be reimplemented if used in descendent classes. Sets the action on a management event.
Reimplemented from TAnimal.
2192 #ifdef TEST_ISSUE_DEATH_WARRANT
2193 printf(
"Skylark_Clutch::OnFarmEvent() : %d : %d\n", event, (
int )
g_date->
Date() );
2246 #ifdef TEST_ISSUE_DEATH_WARRANT
2247 printf(
"Skylark_Female::OnFarmEvent() : %d : %d\n", event, (
int )
g_date->
Date() );
2257 #ifdef TEST_ISSUE_DEATH_WARRANT
2258 printf(
"Skylark_Clutch::OnFarmEvent() : %d : %d\n", event, (
int )
g_date->
Date() );
2267 #ifndef __NoStriglingEffect
2270 #ifdef TEST_ISSUE_DEATH_WARRANT
2271 printf(
"Skylark_Clutch::OnFarmEvent() : %d : %d\n", event, (
int )
g_date->
Date() );
2284 #ifdef TEST_ISSUE_DEATH_WARRANT
2285 printf(
"Skylark_Clutch::OnFarmEvent() : %d : %d\n", event, (
int )
g_date->
Date() );
2295 #ifdef TEST_ISSUE_DEATH_WARRANT
2296 printf(
"Skylark_Clutch::OnFarmEvent() : %d : %d\n", event, (
int )
g_date->
Date() );
2302 #ifndef __NoPigsOutEffect
2305 #ifdef TEST_ISSUE_DEATH_WARRANT
2306 printf(
"Skylark_Clutch::OnFarmEvent() : %d : %d\n", event, (
int )
g_date->
Date() );
References Skylark_Base::AddStriglingMort(), autumn_harrow, autumn_or_spring_plough, autumn_plough, autumn_roll, autumn_sow, autumn_sow_with_ferti, bed_forming, biocide, bulb_harvest, burn_straw_stubble, burn_top, cattle_out, cattle_out_low, cfg_insecticide_direct_mortE, cfg_strigling_clutch, cut_to_hay, cut_to_silage, cut_weeds, Calendar::Date(), deep_ploughing, Landscape::EventtypeToString(), fa_ammoniumsulphate, fa_boron, fa_calcium, fa_cu, fa_greenmanure, fa_k, fa_manganesesulphate, fa_manure, fa_n, fa_nk, fa_npk, fa_npks, fa_p, fa_pk, fa_pks, fa_rsm, fa_sk, fa_sludge, fa_slurry, fiber_covering, fiber_removal, flammebehandling, flower_cutting, fp_ammoniumsulphate, fp_boron, fp_calcium, fp_cu, fp_greenmanure, fp_k, fp_liquidNH3, fp_manganesesulphate, fp_manure, fp_n, fp_nc, fp_nk, fp_npk, fp_npks, fp_ns, fp_p, fp_pk, fp_pks, fp_rsm, fp_sk, fp_sludge, fp_slurry, fungicide_treat, g_date, g_land, g_random_fnc(), glyphosate, green_harvest, growth_regulator, harvest, harvest_bushfruit, harvestshoots, hay_bailing, hay_turning, heavy_cultivator_aggregate, herbicide_treat, hilling_up, insecticide_treat, last_treatment, Skylark_Base::m_CurrentSkState, TAnimal::m_Location_x, TAnimal::m_Location_y, TAnimal::m_OurLandscape, manual_weeding, molluscicide, mow, org_fungicide, org_herbicide, org_insecticide, pheromone, pigs_out, preseeding_cultivator, preseeding_cultivator_sow, product_treat, pruning, row_cultivation, shallow_harrow, shredding, sleep_all_day, spring_harrow, spring_plough, spring_roll, spring_sow, spring_sow_with_ferti, straw_chopping, straw_covering, straw_removal, strigling, strigling_hill, strigling_sow, stubble_cultivator_heavy, stubble_harrowing, stubble_plough, suckering, summer_harrow, summer_plough, summer_sow, Landscape::SupplyGrazingPressure(), swathing, syninsecticide_treat, trial_control, trial_insecticidetreat, trial_toxiccontrol, CfgInt::value(), Landscape::Warn(), water, winter_harrow, and winter_plough.
◆ OnMumGone()
void Skylark_Clutch::OnMumGone |
( |
void |
| ) |
|
2344 if ( IsAlive() != 0x0DEADC0DE )
2349 #ifdef TEST_ISSUE_DEATH_WARRANT
2350 printf(
"Skylark_Clutch::OnMumGone() %d\n", (
int )
g_date->
Date() );
References Calendar::Date(), g_date, Skylark_Base::m_CurrentSkState, TALMaSSObject::m_CurrentStateNo, and Mother.
Referenced by Skylark_Female::OnMateDying(), Skylark_Female::OnMateHomeless(), Skylark_Female::st_Dying(), Skylark_Female::st_GivingUpTerritory(), Skylark_Female::st_StartingNewBrood(), Skylark_Female::st_StoppingBreeding(), and Skylark_Female::Step().
◆ ReInit()
◆ st_Developing()
int Skylark_Clutch::st_Developing |
( |
| ) |
|
|
protected |
2453 if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
2469 const int off_nest_time = 24 * 60 - incubated_time;
2508 double cool =
EggTemp - cool_rate_pmin * TripLength * ((
EggTemp - Temp) / 2.0);
2512 if (cool < Temp) cool = Temp;
2516 const double cooltime = (
EggTemp - cool) / (cool_rate_pmin * ((
EggTemp - Temp) / 2.0));
2519 const double AverageOffNestTemp = (cool +
EggTemp) / 2.0;
2526 if (offnesttemp < 0) offnesttemp = 0;
2527 MinDegrees += static_cast<int>((off_nest_time - cooltime) * offnesttemp);
2528 double transitiontemp = static_cast<int>(AverageOffNestTemp) -
MD_Threshold;
2529 if (transitiontemp < 0) transitiontemp = 0;
2530 MinDegrees += static_cast<int>(2.0 * cooltime * transitiontemp);
References Skylark_Base::Age, cfg_sk_triplength, ClutchMortProb, Cooling_Rate_Eggs, Skylark_Base::DailyMortality(), EggTemp, TAnimal::m_OurLandscape, Skylark_Base::m_OurPopulationManager, MD_Hatch, MD_Threshold, MinDegrees, Mother, Skylark_Female::Supply_NestTime(), Landscape::SupplyDayInYear(), Landscape::SupplyTemp(), CfgFloat::value(), and Skylark_Population_Manager::WriteSKPOM1().
Referenced by EndStep().
◆ st_Dying()
void Skylark_Clutch::st_Dying |
( |
void |
| ) |
|
|
protected |
◆ st_Hatching()
int Skylark_Clutch::st_Hatching |
( |
| ) |
|
|
protected |
2567 if ( IsAlive() != 0x0DEADC0DE ) DEADCODEError();
2587 g_land->
Warn(
"Skylark_Clutch::st_Hatching(): DeBug7 ",
nullptr);
References Clutch_Size, Skylark_Population_Manager::CreateObjects(), Nestling_struct::Dad, g_land, Skylark_Base::m_Born_x, Skylark_Base::m_Born_y, TAnimal::m_Location_x, TAnimal::m_Location_y, Skylark_Base::m_MyHome, TAnimal::m_OurLandscape, Skylark_Base::m_OurPopulationManager, Skylark_Base::m_OurTerritories, Mother, Skylark_Female::MyMate, Skylark_Female::OnEggsHatch(), Skylark_Adult::Paired, and Landscape::Warn().
Referenced by EndStep().
◆ StartDeveloping()
void Skylark_Clutch::StartDeveloping |
( |
| ) |
|
|
inline |
◆ Step()
void Skylark_Clutch::Step |
( |
void |
| ) |
|
|
overridevirtual |
◆ Clutch_Size
int Skylark_Clutch::Clutch_Size |
◆ m_baddays
int Skylark_Clutch::m_baddays |
|
protected |
◆ MinDegrees
int Skylark_Clutch::MinDegrees |
|
protected |
◆ Mother
The documentation for this class was generated from the following files:
Definition: Treatment.h:129
Definition: Treatment.h:64
Definition: Treatment.h:84
Definition: Treatment.h:71
Definition: Treatment.h:88
Definition: Treatment.h:68
void incTotalEggs(const int eggs)
Definition: skylarks_all.h:484
Definition: Treatment.h:144
Definition: Treatment.h:52
Definition: Treatment.h:89
Definition: Treatment.h:94
Definition: Treatment.h:142
void AddStriglingMort(const int lifestage) const
Definition: skylarks_all.h:531
double SupplyTemp(void)
Passes a request on to the associated Weather class function, the temperature for the current day.
Definition: Landscape.h:1993
Definition: Treatment.h:83
Definition: Treatment.h:99
Definition: Treatment.h:76
Definition: Treatment.h:35
Definition: Treatment.h:81
static int ClutchMortProb
Definition: skylarks_all.cpp:158
Definition: Treatment.h:43
Definition: Treatment.h:91
Definition: Treatment.h:127
Definition: Treatment.h:103
Definition: Treatment.h:121
Landscape * g_land
Definition: skylarks_all.cpp:44
Definition: Treatment.h:44
Definition: Treatment.h:56
Definition: Treatment.h:125
Skylark_Clutch * SupplyMyClutch() const
Definition: skylarks_all.h:738
TTypesOfSkState m_CurrentSkState
Definition: skylarks_all.h:517
int SupplyGrazingPressure(int a_polyref)
Returns the grazing pressure of the polygon using the polygon reference number a_polyref or coordinat...
Definition: Landscape.h:1848
Definition: Treatment.h:61
Definition: Treatment.h:80
Definition: Treatment.h:60
class Calendar * g_date
Definition: Calendar.cpp:37
Definition: Treatment.h:90
Definition: Treatment.h:123
Definition: Treatment.h:131
void WriteSKPOM1(const int n, const int n2) const
Definition: skylarks_all.h:451
static double EggTemp
Definition: skylarks_all.cpp:163
Definition: Treatment.h:138
Definition: Treatment.h:122
Definition: Treatment.h:39
Definition: Treatment.h:110
Definition: Treatment.h:51
double value() const
Definition: Configurator.h:142
int st_Developing()
Definition: skylarks_all.cpp:2451
Definition: Treatment.h:143
Definition: Treatment.h:133
int m_Born_y
Definition: skylarks_all.h:521
void st_Dying()
Definition: skylarks_all.cpp:2602
Definition: Treatment.h:104
Definition: Treatment.h:85
CfgFloat cfg_sk_triplength
SkTerritories * m_OurTerritories
Definition: skylarks_all.h:525
Definition: Treatment.h:140
Definition: Treatment.h:38
Definition: Treatment.h:117
Definition: Treatment.h:120
Definition: Treatment.h:59
Definition: Treatment.h:100
Definition: Treatment.h:150
Definition: Treatment.h:124
Definition: Treatment.h:139
static double MD_Hatch
Definition: skylarks_all.cpp:168
Definition: Treatment.h:126
Definition: Treatment.h:149
Definition: Treatment.h:132
Definition: Treatment.h:148
Definition: Treatment.h:67
Definition: Treatment.h:42
Definition: Treatment.h:65
Definition: Treatment.h:45
Definition: Treatment.h:98
int m_MyHome
The vegetation type where the skylark was born.
Definition: skylarks_all.h:523
Definition: Treatment.h:77
int MinDegrees
Definition: skylarks_all.h:559
Definition: Treatment.h:96
Definition: Treatment.h:54
Definition: Treatment.h:130
Definition: Treatment.h:97
Definition: Treatment.h:141
long Date(void)
Definition: Calendar.h:57
int m_Location_y
The objects ALMaSS y coordinate.
Definition: PopulationManager.h:366
static double MD_Threshold
Definition: skylarks_all.cpp:164
Definition: Treatment.h:70
Definition: Treatment.h:46
static double Cooling_Rate_Eggs
Definition: skylarks_all.cpp:162
static Landscape * m_OurLandscape
A pointer to the landscape object shared with all TAnimal objects.
Definition: PopulationManager.h:342
CfgInt cfg_strigling_clutch
void CheckManagement()
Used to start a check for any management related effects at the objects current location.
Definition: PopulationManager.cpp:1591
static bool DailyMortality(int mort)
Definition: skylarks_all.cpp:2092
int Age
Definition: skylarks_all.h:518
int st_Hatching()
Definition: skylarks_all.cpp:2565
Definition: Treatment.h:111
Definition: Treatment.h:135
Definition: Treatment.h:82
Definition: Treatment.h:63
Definition: Treatment.h:62
Skylark_Base(int x, int y, SkTerritories *Terrs, Landscape *L, Skylark_Population_Manager *SPM, int bx, int by, int mh)
Definition: skylarks_all.cpp:2058
Definition: Treatment.h:119
Definition: Treatment.h:72
Definition: Treatment.h:112
Definition: Treatment.h:137
Definition: Treatment.h:40
Definition: Treatment.h:53
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
Definition: Treatment.h:145
Definition: Treatment.h:86
Definition: Treatment.h:49
CfgInt cfg_insecticide_direct_mortE
int SupplyDayInYear(void)
Passes a request on to the associated Calendar class function, the day in the year.
Definition: Landscape.h:2267
Definition: Treatment.h:95
Definition: Treatment.h:147
Definition: Treatment.h:36
bool m_StepDone
Indicates whether the iterative step code is done for this timestep.
Definition: PopulationManager.h:133
Definition: Treatment.h:116
Definition: Treatment.h:93
bool Paired
Definition: skylarks_all.h:670
Definition: Treatment.h:114
int Clutch_Size
Definition: skylarks_all.h:582
int value() const
Definition: Configurator.h:116
Definition: Treatment.h:75
Definition: Treatment.h:47
Definition: Treatment.h:106
Definition: Treatment.h:109
int Supply_NestTime() const
Definition: skylarks_all.h:736
Definition: Treatment.h:48
int m_Born_x
Definition: skylarks_all.h:520
std::string EventtypeToString(int a_event)
Returns the text representation of a treatment type.
Definition: Landscape.cpp:6024
Definition: Treatment.h:146
Definition: Treatment.h:134
Definition: Treatment.h:118
virtual void ReInit(int x, int y, SkTerritories *Terrs, Landscape *L, Skylark_Population_Manager *SPM, int bx, int by, int mh)
Definition: skylarks_all.cpp:2074
Definition: Treatment.h:113
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
Definition: Treatment.h:41
int m_baddays
Definition: skylarks_all.h:560
Skylark_Population_Manager * m_OurPopulationManager
Definition: skylarks_all.h:526
Definition: Treatment.h:37
Definition: Treatment.h:79
Definition: Treatment.h:74
void CreateObjects(int ob_type, TAnimal *pTAo, void *null, Skylark_struct *data, int number)
Definition: skylarks_all.cpp:539
void OnClutchDeath()
Definition: skylarks_all.cpp:5786
Definition: Treatment.h:136
Definition: Treatment.h:108
Definition: Treatment.h:69
Definition: Treatment.h:105
Skylark_Male * Dad
Definition: skylarks_all.h:233
Definition: Treatment.h:78
int g_random_fnc(const int a_range)
Definition: ALMaSS_Random.cpp:74
Definition: Treatment.h:66
Definition: Treatment.h:92
Definition: Treatment.h:102
Skylark_Male * MyMate
Definition: skylarks_all.h:724
Definition: Treatment.h:57
Definition: Treatment.h:87
int m_CurrentStateNo
The basic state number for all objects - '-1' indicates death.
Definition: PopulationManager.h:131
Definition: Treatment.h:101
void OnEggsHatch()
Definition: skylarks_all.cpp:5808
Definition: Treatment.h:73
Skylark_Female * Mother
Definition: skylarks_all.h:583
Definition: Treatment.h:55
void Warn(std::string a_msg1, std::string a_msg2)
Wrapper for the g_msg Warn function.
Definition: Landscape.h:2250
Definition: Treatment.h:34
int m_Location_x
The objects ALMaSS x coordinate.
Definition: PopulationManager.h:362
Definition: skylarks_all.h:231
Definition: Treatment.h:58
Definition: Treatment.h:128
Definition: Treatment.h:50
Definition: Treatment.h:115
Definition: Treatment.h:33
Definition: Treatment.h:107