![]() |
ALMaSS
1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
|
#include <Osmia.h>
Public Member Functions | |
Osmia_Egg (struct_Osmia *data) | |
Osmia_Egg constructor. More... | |
virtual void | ReInit (struct_Osmia *data) |
Osmia_Egg ReInit for object pool. More... | |
virtual | ~Osmia_Egg () |
Osmia_Egg destructor. More... | |
virtual void | Step (void) |
The Step is the second 'part' of the timestep that an animal can behave in. It is called continuously until all animals report that they are 'DONE'. More... | |
double | GetAgeDegrees () |
A typical interface function - this one returns the agedegrees. More... | |
void | SetAgeDegrees (unsigned a_agedegrees) |
A typical interface function - this one returns the agedegrees. More... | |
![]() | |
Osmia_Base (struct_Osmia *data) | |
Osmia constructor. More... | |
void | ReInit (struct_Osmia *data) |
Osmia reinitialise object methods. More... | |
virtual | ~Osmia_Base () |
Osmia destructor. More... | |
virtual void | st_Dying (void) |
Behavioural state dying. More... | |
virtual void | BeginStep (void) |
The BeginStep is the first 'part' of the timestep that an animal can behave in. It is called once per timestep. More... | |
virtual void | EndStep (void) |
The EndStep is the third 'part' of the timestep that an animal can behave in. It is called once per timestep. More... | |
int | GetAge () |
A typical interface function - this one returns the age. More... | |
void | SetAge (int a_age) |
A typical interface function - this one returns the age. More... | |
double | GetMass () |
Returns the bee's mass. More... | |
void | SetMass (double a_mass) |
Sets the bee's mass. More... | |
void | SetParasitised (TTypeOfOsmiaParasitoids a_status) |
Set the parasitised status. More... | |
TTypeOfOsmiaParasitoids | GetParasitised (void) |
Set the parasitised status. More... | |
Osmia_Nest * | GetNest () |
![]() | |
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 int | WhatState () |
Returns the objects current state number. 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... | |
virtual bool | OnFarmEvent (FarmToDo) |
Must be reimplemented if used in descendent classes. Sets the action on a management event. 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... | |
Protected Member Functions | |
virtual TTypeOfOsmiaState | st_Develop (void) |
Behavioural state development. More... | |
virtual TTypeOfOsmiaState | st_Hatch (void) |
Behavioural state hatch. More... | |
virtual bool | DailyMortality () |
Daily mortality test for eggs. More... | |
![]() | |
void | CorrectWrapRound () |
Corrects wrap around co-ordinate problems. More... | |
Protected Attributes | |
double | m_AgeDegrees = 0.0 |
This contains the age in degrees for development. More... | |
bool | m_Sex |
Holds the sex of the egg. Female = fertilized = true. More... | |
int | m_StageAge |
Holds the age when the stage was initiated. More... | |
double | m_egg_pest_mortality |
Holds the mortality caused by pesticide. More... | |
![]() | |
TTypeOfOsmiaState | m_CurrentOState |
Variable to record current behavioural state. More... | |
int | m_Age |
A typical member variable - this one is the age in days. More... | |
Osmia_Population_Manager * | m_OurPopulationManager |
This is a time saving pointer to the correct population manager object. More... | |
TTypeOfOsmiaParasitoids | m_ParasitoidStatus |
Holds the parasitoid status - only one is allowed. More... | |
Osmia_Nest * | m_OurNest |
double | m_Mass |
int | m_foragehours |
A variable to hold the number of available forage hours left in a day. More... | |
![]() | |
int | m_Location_x |
The objects ALMaSS x coordinate. More... | |
int | m_Location_y |
The objects ALMaSS y coordinate. More... | |
int | m_guard_cell_x |
The index x to the guard cell. More... | |
int | m_guard_cell_y |
The index y to the guard cell. More... | |
int | m_AgeDays {0} |
To hold the age in days. More... | |
PesticideToxicity | m_my_pesticide |
![]() | |
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 | |
![]() | |
static void | SetParameterValues () |
Used to populate the static members holding mortality and development parameters. More... | |
static void | SetTemp (double a_temperature) |
static void | SetParasitoidManager (OsmiaParasitoid_Population_Manager *a_popman) |
![]() | |
static void | SetSimulationWidth (int a_value) |
Sets the simulation width. More... | |
static void | SetSimulationHeight (int a_value) |
Sets the simulation height. More... | |
static void | SetDayInYear (int a_value) |
Sets the day in year attribute. More... | |
static void | SetOurLandscape (Landscape *a_value) |
Sets the landscape pointer. More... | |
static void | SetTempToday (double a_value) |
Sets the temperature today attribute. More... | |
![]() | |
static void | OnArrayBoundsError () |
Used for debugging only, tests basic object properties. More... | |
![]() | |
static OsmiaParasitoid_Population_Manager * | m_OurParasitoidPopulationManager = NULL |
This is a time saving pointer to the parasitoid population manager object. More... | |
static double | m_TempToday = -9999 |
The temperature today. This is static because there is only one temperature today. More... | |
static int | m_TempTodayInt = -9999 |
The temperature today to the nearest degree. This is static because there is only one temperature today. This is mostly for use in temperature indexed arrays (if used) More... | |
static double | m_DailyDevelopmentMortEggs = 0 |
This holds the daily mortality for eggs. More... | |
static double | m_DailyDevelopmentMortLarvae = 0 |
This holds the daily mortality for larvae. More... | |
static double | m_DailyDevelopmentMortPrepupae = 0 |
This holds the daily mortality for pre-pupae. More... | |
static double | m_DailyDevelopmentMortPupae = 0 |
This holds the daily mortality for pupae. More... | |
static double | m_OsmiaEggDevelTotalDD = 0 |
Is the number of day degrees needed for egg development to hatch. More... | |
static double | m_OsmiaEggDevelThreshold = 0 |
Is temperature developmental threshold for egg development. More... | |
static double | m_OsmiaLarvaDevelTotalDD = 0 |
Is the number of day degrees needed for larval hatch above the developmental threshold for larvae. More... | |
static double | m_OsmiaLarvaDevelThreshold = 0 |
Is temperature developmental threshold for larval development. More... | |
static double | m_OsmiaPupaDevelTotalDD = 0 |
Is the number of day degrees needed for pupal hatch above the developmental threshold for pupae. More... | |
static double | m_OsmiaPupaDevelThreshold = 0 |
Is temperature developmental threshold for pupal development. More... | |
static double | m_OsmiaPrepupalDevelTotalDays = 0 |
Number of days for prepupal development. More... | |
static double | m_OsmiaPrepupalDevelTotalDays10pct = 0 |
10% of the number of days for prepupal development - just for speed More... | |
static double | m_OsmiaInCocoonOverwinteringTempThreshold = 0 |
holds the value for the InCocoon overwintering temperature threshold More... | |
static double | m_OsmiaInCocoonEmergenceTempThreshold = 0 |
holds the value for the InCocoon emergence temperature threshold More... | |
static double | m_OsmiaInCocoonPrewinteringTempThreshold = 0 |
holds the value for the InCocoon prewintering temperature threshold More... | |
static double | m_OsmiaInCocoonWinterMortConst = 0.0 |
holds the constant term value for the InCocoon winter mortality calculation More... | |
static double | m_OsmiaInCocoonWinterMortSlope = 0.0 |
holds the coefficient value for the InCocoon winter mortality calculation More... | |
static double | m_OsmiaInCocoonEmergCountConst = 0.0 |
holds the constant term value for the InCocoon emergence counter calculation More... | |
static double | m_OsmiaInCocoonEmergCountSlope = 0.0 |
holds the coefficient value for the InCocoon emergence counter calculation More... | |
static double | m_OsmiaFemaleMassFromProvMassConst = 0.0 |
holds the constant term value for the female mass calculation from provision mass More... | |
static double | m_OsmiaFemaleMassFromProvMassSlope = 0.0 |
holds the coefficient value for the female mass calculation from provision mass More... | |
static double | m_MaleMinTargetProvisionMass = 0.0 |
The minimum target provisioning for a male cell. More... | |
static double | m_MaleMaxTargetProvisionMass = 0.0 |
The maximum target provisioning for a male cell. More... | |
static double | m_FemaleMinTargetProvisionMass = 0.0 |
The minimum target provisioning for a female cell. More... | |
static double | m_FemaleMaxTargetProvisionMass = 0.0 |
The maximum target provisioning for a female cell. More... | |
static double | m_FemaleMaxMass = 0.0 |
The maximum female mass. More... | |
static double | m_FemaleMinMass = 0.0 |
The minimum female mass. More... | |
static double | m_MaleMaxMass = 0.0 |
The minimum Male mass. More... | |
static double | m_PollenScoreToMg = 0.0 |
The conversion rate from pollen availability score to mg pollen provisioned per day. More... | |
static double | m_DensityDependentPollenRemovalConst = 0.0 |
A parameter to link linear reduction in pollen availability to Osmia numbers per 1km2. More... | |
static double | m_MinimumCellConstructionTime = 0.0 |
The shortest possible construction time for a cell - normally 1 day. More... | |
static double | m_MaximumCellConstructionTime = 0.0 |
The longest possible construction time for a cell. More... | |
static int | m_TotalNestsPossible = 0 |
The maximum number of nests possible for a bee. More... | |
static double | m_BombylidProbability = 0.0 |
holds the probability of bombylid fly parasitism if open nest parasitoid More... | |
static double | m_ParasitismProbToTimeCellOpen = 0.0 |
holds the ratio of open cell parasitism to time cell is open More... | |
static vector< double > | m_ParasitoidAttackChance = {} |
Holds the probability per capita of parasitoid attack for a subpopulation sized cell. More... | |
static double | m_OsmiaFemaleR50distance = 0.0 |
holds the value for the female typical homing distance More... | |
static double | m_OsmiaFemaleR90distance = 0.0 |
holds the value for the female max homing distance More... | |
static int | m_OsmiaFemalePrenesting = 0 |
holds the value for the duration of prenesting More... | |
static int | m_OsmiaFemaleLifespan = 0 |
holds the value for max female lifespan More... | |
static probability_distribution | m_generalmovementdistances = probability_distribution(cfg_OsmiaGeneralMovementProbType.value(), cfg_OsmiaGenerallMovementProbArgs.value()) |
Static instance of the probability_distribution class of distance probablilties for nest searching and foraging. More... | |
static probability_distribution | m_dispersalmovementdistances = probability_distribution(cfg_OsmiaDispersalMovementProbType.value(), cfg_OsmiaDispersalMovementProbArgs.value()) |
Static instance of the probability_distribution class of distance probablilties for dispersal. More... | |
static probability_distribution | m_eggspernestdistribution = probability_distribution(cfg_OsmiaEggsPerNestProbType.value(), cfg_OsmiaEggsPerNestProbArgs.value()) |
Static instance of the probability_distribution class of distance probablilties for numbers of eggs per nest. More... | |
static probability_distribution | m_exp_ZeroToOne = probability_distribution("BETA", "1.0, 5.0") |
Static instance of the probability_distribution class of distance probablilties for approx exponential probs zero to 1.0. More... | |
static double | m_CocoonToProvisionMass = 0.0 |
The ratio of cocoon to provision mass. More... | |
static double | m_ProvisionToCocoonMass = 0.0 |
The ratio of provison to cocoon mass. More... | |
static double | m_TotalProvisioningMassLoss = 0.0 |
The total provision mass loss expected first cocoon to last. More... | |
static double | m_TotalProvisioningMassLossRange = 0.0 |
The variability around the expected total mass loss. More... | |
static double | m_TotalProvisioningMassLossRangeX2 = 0.0 |
Twice the variability around the expected total mass loss. More... | |
static bool | m_UsingMechanisticParasitoids = false |
Flag for switching between ways of calculating parasitism. More... | |
static double | m_OsmiaFemaleBckMort = 0.0 |
Holds the parameter for unspecified female daily mortality. More... | |
static int | m_OsmiaFemaleMinEggsPerNest = 0 |
Holds the parameter for minimum planned eggs per nest. More... | |
static int | m_OsmiaFindNestAttemptNo = 0 |
Holds the parameter for number of find nest tries. More... | |
static int | m_OsmiaFemaleMaxEggsPerNest = 0 |
Holds the parameter for maximum planned eggs per nest. More... | |
static probability_distribution | m_emergenceday = probability_distribution(cfg_OsmiaEmergenceProbType.value(), cfg_OsmiaEmergenceProbArgs.value()) |
Static instance of the probability_distribution class of emergence day. More... | |
![]() | |
static Landscape * | m_OurLandscape = nullptr |
A pointer to the landscape object shared with all TAnimal objects. More... | |
static int | m_SimulationWidth = 0 |
A static member for the simulation width because it is often used by descendent classes. More... | |
static int | m_SimulationHeight = 0 |
A static member for the simulation height because it is often used by descendent classes. More... | |
static double | m_TemperatureToday = 0.0 |
A holder for the temperature today shared with all TAnimal objects. More... | |
static int | m_DayInYear = 0 |
A holder for the day in year shared with all TAnimal objects. More... | |
Osmia_Egg::Osmia_Egg | ( | struct_Osmia * | data | ) |
Osmia_Egg constructor.
References struct_Osmia::age, m_AgeDegrees, m_egg_pest_mortality, Osmia_Base::m_OurNest, m_Sex, m_StageAge, struct_Osmia::nest, struct_Osmia::pest_mortality, ReInit(), and struct_Osmia::sex.
|
virtual |
Osmia_Egg destructor.
|
inlineprotectedvirtual |
Daily mortality test for eggs.
Reimplemented in Osmia_Pupa, Osmia_Prepupa, and Osmia_Larva.
References g_rand_uni_fnc(), and Osmia_Base::m_DailyDevelopmentMortEggs.
Referenced by st_Develop().
|
inline |
|
virtual |
Osmia_Egg ReInit for object pool.
Reimplemented in Osmia_Female, Osmia_InCocoon, Osmia_Pupa, Osmia_Prepupa, and Osmia_Larva.
References struct_Osmia::age, m_AgeDegrees, m_egg_pest_mortality, Osmia_Base::m_OurNest, m_Sex, m_StageAge, struct_Osmia::nest, struct_Osmia::pest_mortality, Osmia_Base::ReInit(), and struct_Osmia::sex.
Referenced by Osmia_Egg(), and Osmia_Larva::ReInit().
|
inline |
|
protectedvirtual |
Behavioural state development.
Reimplemented in Osmia_Female, Osmia_InCocoon, Osmia_Pupa, Osmia_Prepupa, and Osmia_Larva.
References cfg_OsmiaEggThresholdBasedPesticideResponse, DailyMortality(), g_rand_uni_fnc(), Osmia_Nest::GetIsOpen(), Osmia_Base::m_Age, m_AgeDegrees, m_egg_pest_mortality, Osmia_Base::m_OsmiaEggDevelThreshold, Osmia_Base::m_OsmiaEggDevelTotalDD, Osmia_Base::m_OurNest, Osmia_Base::m_TempToday, toOsmias_Develop, toOsmias_Die, toOsmias_NextStage, and CfgBool::value().
Referenced by Step().
|
protectedvirtual |
Behavioural state hatch.
Creates a new larva object and passes the data from the egg to it, then signals egg object removal.
References struct_Osmia::age, Osmia_Population_Manager::CreateObjects(), TAnimal::KillThis(), struct_Osmia::L, Osmia_Base::m_Age, TAnimal::m_Location_x, TAnimal::m_Location_y, Osmia_Base::m_Mass, TAnimal::m_OurLandscape, Osmia_Base::m_OurNest, Osmia_Base::m_OurPopulationManager, Osmia_Base::m_ParasitoidStatus, m_Sex, m_StageAge, struct_Osmia::mass, struct_Osmia::nest, struct_Osmia::OPM, struct_Osmia::parasitised, struct_Osmia::sex, to_OsmiaLarva, toOsmias_Emerged, struct_Osmia::x, and struct_Osmia::y.
Referenced by Step().
|
virtual |
The Step is the second 'part' of the timestep that an animal can behave in. It is called continuously until all animals report that they are 'DONE'.
Osmia egg behaviour is simple. It calls develop until the egg hatches or dies.
Reimplemented from Osmia_Base.
Reimplemented in Osmia_Female, Osmia_InCocoon, Osmia_Pupa, Osmia_Prepupa, and Osmia_Larva.
References Osmia_Base::m_CurrentOState, TALMaSSObject::m_CurrentStateNo, TAnimal::m_OurLandscape, TALMaSSObject::m_StepDone, st_Develop(), Osmia_Base::st_Dying(), st_Hatch(), toOsmias_Develop, toOsmias_Die, toOsmias_InitialState, toOsmias_NextStage, TOP_Osmia, and Landscape::Warn().
|
protected |
This contains the age in degrees for development.
Referenced by GetAgeDegrees(), Osmia_Egg(), Osmia_Prepupa::Osmia_Prepupa(), ReInit(), Osmia_InCocoon::ReInit(), SetAgeDegrees(), st_Develop(), Osmia_Larva::st_Develop(), Osmia_Prepupa::st_Develop(), Osmia_Pupa::st_Develop(), and Osmia_InCocoon::st_Develop().
|
protected |
Holds the mortality caused by pesticide.
Referenced by Osmia_Egg(), ReInit(), and st_Develop().
|
protected |
Holds the sex of the egg. Female = fertilized = true.
Referenced by Osmia_Egg(), ReInit(), Osmia_Pupa::st_Emerge(), Osmia_InCocoon::st_Emerge(), st_Hatch(), Osmia_Larva::st_Prepupate(), and Osmia_Prepupa::st_Pupate().
|
protected |
Holds the age when the stage was initiated.
Referenced by Osmia_Egg(), ReInit(), Osmia_Pupa::st_Emerge(), Osmia_InCocoon::st_Emerge(), st_Hatch(), Osmia_Larva::st_Prepupate(), and Osmia_Prepupa::st_Pupate().