|
ALMaSS
1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
|
#include <AOR_Probe.h>
◆ AOR_Probe()
21 if (a_filename ==
"") a_filename =
"NWordOutputPrb.txt";
24 g_msg->
Warn(
WARN_FILE,
"Population_Manager::AOR_Probe: ""Unable to open NWord probe file:", a_filename);
27 m_ProbeFile <<
"Year" <<
'\t' <<
"Day" <<
'\t' <<
"Total_no" <<
'\t' <<
"Cells50" <<
'\t' <<
"Occupied50" <<
'\t' <<
"Cells100" <<
'\t' <<
"Occupied100" <<
'\t' <<
"Cells200" <<
'\t' <<
"Occupied200" <<
'\t' <<
"Cells400" <<
'\t' <<
"Occupied400" << endl;
31 a_filename = std::regex_replace(a_filename, std::regex(
"\\.txt"),
"_HabitatLocation.txt");
34 g_msg->
Warn(
WARN_FILE,
"Population_Manager::AOR_Probe: ""Unable to open NWord probe file:", a_filename);
38 m_ProbeFileHL <<
"Year" <<
'\t' <<
"Day" <<
'\t' <<
"Total_no" <<
'\t' <<
"Cells50" <<
'\t' <<
"Occupied50" <<
'\t' <<
"Cells100" <<
'\t' <<
"Occupied100" <<
'\t' <<
"Cells200" <<
'\t' <<
"Occupied200" <<
'\t' <<
"Cells400" <<
'\t' <<
"Occupied400" << endl;
44 for (
int g = 0; g < 4; g++) {
References cfg_AOR_Habitat_Location_On, cfg_AOR_Habitat_Location_Type, g_msg, tole_Foobar, CfgInt::value(), CfgBool::value(), MapErrorMsg::Warn(), and WARN_FILE.
◆ ~AOR_Probe()
virtual AOR_Probe::~AOR_Probe |
( |
| ) |
|
|
inlinevirtual |
◆ CloseFile()
virtual void AOR_Probe::CloseFile |
( |
| ) |
|
|
inlinevirtual |
◆ DoProbe()
void AOR_Probe::DoProbe |
( |
int |
a_lifestage | ) |
|
|
virtual |
Counts all a_lifestage animals in each grid of each size
Reimplemented in AOR_Probe_Goose.
108 for (
int grid = 0; grid < 4; grid++) {
112 for (
unsigned j = 0; j < total; j++)
115 for (
int grid = 0; grid < 4; grid++) {
References cfg_AOR_Habitat_Location_On, APoint::m_x, APoint::m_y, and CfgBool::value().
Referenced by Erigone_Population_Manager::TheAOROutputProbe(), Oedothorax_Population_Manager::TheAOROutputProbe(), Vole_Population_Manager::TheAOROutputProbe(), Osmia_Population_Manager::TheAOROutputProbe(), Ladybird_Population_Manager::TheAOROutputProbe(), Skylark_Population_Manager::TheAOROutputProbe(), THare_Population_Manager::TheAOROutputProbe(), and Beetle_Population_Manager::TheAOROutputProbe().
◆ DoProbeInHaitatType()
Records the locations of all beetles and classifies them as to in a habitat type or not.
Counts all a_lifestage animals in each grid of each size
169 for (
int grid = 0; grid < 4; grid++) {
173 for (
unsigned j = 0; j < total; j++)
176 for (
int grid = 0; grid < 4; grid++) {
References Population_Manager::GetLiveArraySize(), m_gridcountHLoc, m_gridcountsize, m_gridcountwidth, m_owner, m_totalcells, APoint::m_x, APoint::m_y, Population_Manager::SupplyAnimalPtr(), TAnimal::SupplyPoint(), and WriteData().
◆ WriteData()
void AOR_Probe::WriteData |
( |
| ) |
|
◆ WriteDataHL()
void AOR_Probe::WriteDataHL |
( |
| ) |
|
86 for (
int gsz = 0; gsz < 4; gsz++) {
88 OccupiedCells[gsz] = 0;
93 if (res > 0) OccupiedCells[gsz]++;
98 for (
int c = 0; c < 3; c++) {
◆ m_gridcount
◆ m_gridcountheight
int AOR_Probe::m_gridcountheight[4] |
|
protected |
◆ m_gridcountHLoc
◆ m_gridcountsize
int AOR_Probe::m_gridcountsize[4] |
|
protected |
◆ m_gridcountwidth
int AOR_Probe::m_gridcountwidth[4] |
|
protected |
◆ m_owner
◆ m_ProbeFile
ofstream AOR_Probe::m_ProbeFile |
|
protected |
◆ m_ProbeFileHL
ofstream AOR_Probe::m_ProbeFileHL |
|
protected |
◆ m_target_tole
◆ m_TheLandscape
◆ m_totalcells
int AOR_Probe::m_totalcells[4] |
|
protected |
The documentation for this class was generated from the following files:
Definition: MapErrorMsg.h:37
static CfgBool cfg_AOR_Habitat_Location_On("G_AOR_HABITAT_ON", CFG_CUSTOM, false)
Flag for using the habitat location probe.
APoint SupplyPoint() const
Returns the objects location in ALMaSS coordinates.
Definition: PopulationManager.h:222
virtual TAnimal * SupplyAnimalPtr(unsigned int a_index, unsigned int a_animal)
Returns the pointer indexed by a_index and a_animal. Note NO RANGE CHECK.
Definition: PopulationManager.h:678
Definition: LandscapeFarmingEnums.h:183
virtual void CloseFile()
Definition: AOR_Probe.h:25
bool value() const
Definition: Configurator.h:164
Population_Manager * m_owner
Definition: AOR_Probe.h:18
int SupplySimAreaHeight(void)
Gets the simulation landscape height.
Definition: Landscape.h:2302
int SupplySimAreaWidth(void)
Gets the simulation landscape width.
Definition: Landscape.h:2297
TTypesOfLandscapeElement TranslateEleTypes(int EleReference)
Returns element type translated from the ALMaSS reference number.
Definition: Landscape.h:2313
A simple class defining an x,y coordinate set.
Definition: ALMaSS_Setup.h:52
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
int m_gridcountheight[4]
Definition: AOR_Probe.h:10
int SupplyDayInYear(void)
Passes a request on to the associated Calendar class function, the day in the year.
Definition: Landscape.h:2267
ofstream m_ProbeFile
Definition: AOR_Probe.h:7
int m_x
Definition: ALMaSS_Setup.h:55
int m_totalcells[4]
Definition: AOR_Probe.h:12
int SupplyYearNumber(void)
Passes a request on to the associated Calendar class function, returns m_simulationyear
Definition: Landscape.h:2287
ListOfCells m_gridcount[4]
Definition: AOR_Probe.h:13
int value() const
Definition: Configurator.h:116
ListOfCells m_gridcountHLoc[4]
Definition: AOR_Probe.h:14
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
unsigned GetLiveArraySize(int a_listindex) override
Gets the number of 'live' objects for a list index in the TheArray.
Definition: PopulationManager.h:657
int m_gridcountwidth[4]
Definition: AOR_Probe.h:9
TTypesOfLandscapeElement SupplyPolygonType() const
Returns the polygon type where the object is located.
Definition: PopulationManager.h:233
Landscape * m_TheLandscape
Definition: AOR_Probe.h:16
ofstream m_ProbeFileHL
Definition: AOR_Probe.h:8
static CfgInt cfg_AOR_Habitat_Location_Type("G_AOR_HABITAT_TYPE", CFG_CUSTOM, 20)
ALMaSS tole code for the habitat location probe to count in - default 20 = tole_Field.
void WriteData()
Definition: AOR_Probe.cpp:56
int m_y
Definition: ALMaSS_Setup.h:56
void WriteDataHL()
Definition: AOR_Probe.cpp:82
TTypesOfLandscapeElement m_target_tole
Definition: AOR_Probe.h:17
int m_gridcountsize[4]
Definition: AOR_Probe.h:11