![]() |
ALMaSS
1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
|
The Osmia nest is assumed to be a linear element with egg cells added one by one. More...
#include <Osmia.h>
Public Member Functions | |
Osmia_Nest (int a_x, int a_y, int a_polyref, Osmia_Nest_Manager *a_manager) | |
virtual | ~Osmia_Nest () |
void | SetCellLock (void) |
Set the cell lock. More... | |
void | ReleaseCellLock (void) |
Release the cell lock. More... | |
void | AddCocoon (TAnimal *a_cocoon) |
Adds a cocoon to the nest, this is only used to initialise the simulation. More... | |
void | AddEgg (TAnimal *a_egg) |
Adds an egg to the nest. More... | |
void | ReplaceNestPointer (TAnimal *a_oldpointer, TAnimal *a_newpointer) |
void | RemoveCell (TAnimal *a_oldpointer) |
bool | Find (TAnimal *a_osmia) |
Debug function - Is this osmia present? More... | |
void | KillAllSubsequentCells (TAnimal *a_osmia) |
Removes all Osmia from the nest from a target to the end of the tube. More... | |
int | GetPolyRef () |
Get the polyref. More... | |
int | GetNoNests () |
For debug - get the number of nests currently for this polygon. More... | |
int | GetNoCells () |
Get the number of cells for this nest. More... | |
bool | ZeroCells () |
Debug - to check if any nests have zero cells. More... | |
int | GetAspectDelay () |
bool | GetIsOpen () |
Tells us whether the nest is finished for additions = false or can be added too = true. More... | |
void | CloseNest () |
Signals that the nest is closed. More... | |
![]() | |
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... | |
virtual void | BeginStep () |
BeingStep behaviour - must be implemented in descendent classes. More... | |
virtual void | Step () |
Step behaviour - must be implemented in descendent classes. More... | |
virtual void | EndStep () |
EndStep behaviour - must be implemented in descendent classes. More... | |
void | ReinitialiseObjectBase () |
Used to initialise an object. More... | |
TALMaSSObject () | |
The constructor for TALMaSSObject. More... | |
virtual | ~TALMaSSObject ()=default |
The destructor for TALMaSSObject. More... | |
Public Attributes | |
Osmia_Female * | m_owner |
Protected Attributes | |
int | m_x |
x-location More... | |
int | m_y |
y-location More... | |
int | m_PolyRef |
polygon reference to where the nest is located More... | |
std::forward_list< TAnimal * > | m_cells |
list of egg objects More... | |
omp_nest_lock_t * | m_cell_lock |
The lock to for egg cells operation. More... | |
bool | m_isOpen |
Signals that the nest is closed or open for adding new cells. More... | |
int | m_aspectdelay |
Simulates the natural variation assumed per nest location based on aspect, exposure etc.. 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... | |
Static Protected Attributes | |
static Osmia_Nest_Manager * | m_OurManager = NULL |
A pointer to the one and only nest population manager. 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... | |
Additional Inherited Members | |
![]() | |
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... | |
![]() | |
void | CorrectWrapRound () |
Corrects wrap around co-ordinate problems. More... | |
The Osmia nest is assumed to be a linear element with egg cells added one by one.
Osmia_Nest::Osmia_Nest | ( | int | a_x, |
int | a_y, | ||
int | a_polyref, | ||
Osmia_Nest_Manager * | a_manager | ||
) |
References g_generator, g_uni_0to15(), m_aspectdelay, m_cell_lock, m_cells, m_isOpen, m_OurManager, m_owner, m_PolyRef, m_x, and m_y.
|
inlinevirtual |
References m_cell_lock.
|
inline |
Adds a cocoon to the nest, this is only used to initialise the simulation.
References m_cells.
Referenced by Osmia_Population_Manager::CreateObjects().
|
inline |
Adds an egg to the nest.
References m_cells.
Referenced by Osmia_Population_Manager::CreateObjects().
|
inline |
Signals that the nest is closed.
References m_isOpen.
Referenced by Osmia_Female::st_Dying(), and Osmia_Female::st_ReproductiveBehaviour().
|
inline |
|
inline |
|
inline |
Tells us whether the nest is finished for additions = false or can be added too = true.
References m_isOpen.
Referenced by Osmia_Egg::st_Develop(), and Osmia_Larva::st_Develop().
|
inline |
Get the number of cells for this nest.
References m_cells.
Referenced by Osmia_Female::st_Dying(), and Osmia_Female::st_ReproductiveBehaviour().
int Osmia_Nest::GetNoNests | ( | ) |
For debug - get the number of nests currently for this polygon.
References Osmia_Nest_Manager::GetNoNests(), m_OurManager, and m_PolyRef.
|
inline |
Get the polyref.
References m_PolyRef.
Referenced by Osmia_Female::st_Dying(), and Osmia_Female::st_ReproductiveBehaviour().
void Osmia_Nest::KillAllSubsequentCells | ( | TAnimal * | a_osmia | ) |
Removes all Osmia from the nest from a target to the end of the tube.
Searches the nest until if finds a specific Osmia, once found it removes that Osmia and deletes all cells created higher up the tube.
References m_cells, m_OurManager, m_PolyRef, and Osmia_Nest_Manager::ReleaseOsmiaNest().
|
inline |
Release the cell lock.
References m_cell_lock.
Referenced by Osmia_Population_Manager::CreateObjects(), RemoveCell(), Osmia_Female::st_Dying(), and Osmia_Female::st_ReproductiveBehaviour().
void Osmia_Nest::RemoveCell | ( | TAnimal * | a_oldpointer | ) |
References m_cells, m_OurManager, m_PolyRef, ReleaseCellLock(), Osmia_Nest_Manager::ReleaseOsmiaNest(), and SetCellLock().
Referenced by Osmia_Base::st_Dying(), and Osmia_InCocoon::st_Emerge().
References m_cells.
Referenced by Osmia_Population_Manager::CreateObjects().
|
inline |
Set the cell lock.
References m_cell_lock.
Referenced by Osmia_Population_Manager::CreateObjects(), RemoveCell(), Osmia_Female::st_Dying(), and Osmia_Female::st_ReproductiveBehaviour().
|
inline |
|
protected |
Simulates the natural variation assumed per nest location based on aspect, exposure etc..
Referenced by GetAspectDelay(), and Osmia_Nest().
|
protected |
The lock to for egg cells operation.
Referenced by Osmia_Nest(), ReleaseCellLock(), SetCellLock(), and ~Osmia_Nest().
|
protected |
list of egg objects
Referenced by AddCocoon(), AddEgg(), Find(), GetNoCells(), KillAllSubsequentCells(), Osmia_Nest(), RemoveCell(), ReplaceNestPointer(), and ZeroCells().
|
protected |
Signals that the nest is closed or open for adding new cells.
Referenced by CloseNest(), GetIsOpen(), and Osmia_Nest().
|
staticprotected |
A pointer to the one and only nest population manager.
Referenced by GetNoNests(), KillAllSubsequentCells(), Osmia_Nest(), and RemoveCell().
Osmia_Female* Osmia_Nest::m_owner |
Referenced by Osmia_Female::FindNestLocation(), and Osmia_Nest().
|
protected |
polygon reference to where the nest is located
Referenced by GetNoNests(), GetPolyRef(), KillAllSubsequentCells(), Osmia_Nest(), and RemoveCell().
|
protected |
x-location
The Osmia_Nest class contains a list of Osmia_Egg pointers to objects it contains. It is descended from TAnimal which means it has a location and has access to the TALMaSSObject Step code if needed..however, right now this is not implemented in the population manager. All information about the egg state is held by the egg itself e.g. sex, parasitoids, so this is simply a list of eggs in order of them being added to the nest The nest can however supply the number of current eggs it holds
Referenced by Osmia_Nest().
|
protected |
y-location
Referenced by Osmia_Nest().