#include <pesticide.h>
Definition at line 369 of file pesticide.h.
◆ PesticideMap()
PesticideMap::PesticideMap |
( |
int |
a_startyear, |
|
|
int |
a_noyears, |
|
|
int |
a_cellsize, |
|
|
Landscape * |
a_landscape, |
|
|
RasterMap * |
a_land, |
|
|
bool |
a_typeofmap |
|
) |
| |
Definition at line 769 of file pesticide.cpp.
785 m_PMap =
new ofstream(
"ALMaSS_InsecticideMap.txt", ios::out);
786 (*m_PMap) <<
"Years" <<
' ' << a_noyears <<
' ' <<
"Height" <<
' ' <<
m_pmap_height <<
' ' <<
"Width" <<
' ' <<
m_pmap_width <<
' ' << endl;
795 m_PMap =
new ofstream(
"ALMaSS_FungicideMap.txt", ios::out);
796 (*m_PMap) <<
"Years" <<
' ' << a_noyears <<
' ' <<
"Height" <<
' ' <<
m_pmap_height <<
' ' <<
"Width" <<
' ' <<
m_pmap_width <<
' ' << endl;
801 m_PMap =
new ofstream(
"ALMaSS_HerbicideMap.txt", ios::out);
802 (*m_PMap) <<
"Years" <<
' ' << a_noyears <<
' ' <<
"Height" <<
' ' <<
m_pmap_height <<
' ' <<
"Width" <<
' ' <<
m_pmap_width <<
' ' << endl;
◆ ~PesticideMap()
PesticideMap::~PesticideMap |
( |
| ) |
|
◆ DumpPMap()
bool PesticideMap::DumpPMap |
( |
vector< double > * |
a_map | ) |
|
Definition at line 824 of file pesticide.cpp.
829 else fname =
"ALMaSS_HerbicideMap.txt";
831 ofstream* m_PMap =
new ofstream(fname.c_str(), ios::app);
832 if (!(*m_PMap).is_open())
834 g_msg->
Warn(
WARN_FILE,
"PesticideMap::DumpMap Unable to open file for append: ", fname.c_str());
849 fill(a_map->begin(), a_map->end(), 0);
References g_date, g_msg, Calendar::GetMonth(), Calendar::GetYear(), MapErrorMsg::Warn(), and WARN_FILE.
Referenced by DumpPMapF(), DumpPMapH(), and DumpPMapI().
◆ DumpPMapF()
bool PesticideMap::DumpPMapF |
( |
| ) |
|
|
inline |
◆ DumpPMapH()
bool PesticideMap::DumpPMapH |
( |
| ) |
|
|
inline |
◆ DumpPMapI()
bool PesticideMap::DumpPMapI |
( |
| ) |
|
|
inline |
◆ Spray()
This records a 1 in the map for every m2 where pesticide is applied. This does not record drift.
Going through the whole landscape is very slow and unnecessary for small polygons. Since our polygons do not extend beyond the edge of the map ie do not wrap round, then we only need a measure of minx, maxx, miny, maxy. This is set up at the start of the simulation.
This method first determines what type of pesticide and selects the correct map to record on.
Definition at line 854 of file pesticide.cpp.
870 int l_large_map_index = a_element_sprayed->
GetMapIndex();
871 int minx = a_element_sprayed->
GetMinX();
872 int miny = a_element_sprayed->
GetMinY();
873 int maxx = a_element_sprayed->
GetMaxX();
874 int maxy = a_element_sprayed->
GetMaxY();
875 for (
int y = miny; y <= maxy; y++) {
876 for (
int x = minx; x <= maxx; x++) {
References fungicide, LE::GetMapIndex(), LE::GetMaxX(), LE::GetMaxY(), LE::GetMinX(), LE::GetMinY(), and herbicide.
◆ m_cellsize
int PesticideMap::m_cellsize |
|
protected |
the size of the cell for pesticide data in m
Definition at line 387 of file pesticide.h.
◆ m_endyear
int PesticideMap::m_endyear |
|
protected |
last year of data to record
Definition at line 385 of file pesticide.h.
◆ m_OurLandscape
◆ m_pmap_fungicides
vector<double>* PesticideMap::m_pmap_fungicides |
|
protected |
◆ m_pmap_height
int PesticideMap::m_pmap_height |
|
protected |
based on cellsize the height of the map
Definition at line 391 of file pesticide.h.
◆ m_pmap_herbicides
vector<double>* PesticideMap::m_pmap_herbicides |
|
protected |
◆ m_pmap_insecticides
vector<double>* PesticideMap::m_pmap_insecticides |
|
protected |
insecticide map data
PesticideMap is a class for handling pesticide mapping output. This can be used to sum up pesticide concentrations over time. It works currently for general pesticides split into insecticides, herbicides, and fungicides, but also for the primary test pesticide if one is being used.
Definition at line 377 of file pesticide.h.
Referenced by DumpPMapI().
◆ m_pmap_width
int PesticideMap::m_pmap_width |
|
protected |
based on cellsize the width of the map
Definition at line 389 of file pesticide.h.
◆ m_Rastermap
pointer to the landscape map
Definition at line 397 of file pesticide.h.
◆ m_startyear
int PesticideMap::m_startyear |
|
protected |
first simultion year to record
Definition at line 383 of file pesticide.h.
◆ m_typeofmap
bool PesticideMap::m_typeofmap |
|
protected |
true if using test pesticide, false for general pesticides
Definition at line 393 of file pesticide.h.
The documentation for this class was generated from the following files: