ALMaSS Rodenticide ODdox  1.1
The rodenticide model description following ODdox protocol
RodenticideManager Class Reference

Class for management of bait locations. More...

#include <Rodenticide.h>

Public Member Functions

 RodenticideManager (string fname, Landscape *a_land)
 RodenticideManager constructor. More...
 
virtual ~RodenticideManager (void)
 RodenticideManager destructor. More...
 
void Tick (void)
 Advance one day. More...
 
void DoPlaceBait ()
 Initiates bait placement for those bait locations necessary. More...
 
int GetBaitStartDate (TTypesBaitLocation)
 Determines when the bait will be placed within a season. More...
 
bool ShouldPlaceBait (TTypesBaitLocation)
 Place bait dependent upon a frequency test. More...
 
void DoImmigration (void)
 
void Diffuse (int a_x, int a_y)
 Move poisoned mice around to twin map. More...
 
void DoDiffuse (void)
 
void DoDeath (void)
 Reduce each cell in twin map by m_deathRate. More...
 
void DistributeRing (int a_x, int a_y, double a_amount)
 Distribute an amount to the twin map in a ring. More...
 
double GetMap (int a_x, int a_y)
 Get poisoned mice at x,y. More...
 
double GetMapTwin (int a_x, int a_y)
 Get poisoned mice at x,y on twin map. More...
 
void SetMap (int a_x, int a_y, double a_p)
 Set poisoned mice at x,y. More...
 
void SetMapTwin (int a_x, int a_y, double a_p)
 Set poisoned mice at x,y on twin map. More...
 
void SetMapTwinMult (int a_x, int a_y, double a_p)
 Multiply poisoned mice at x,y on twin map by constant. More...
 
void SetMapTwinP (int a_x, int a_y, double a_p)
 Add to poisoned mice at x,y on twin map. More...
 
double GetRodenticide (unsigned a_x, int a_y)
 Return the poisoned mice value at x,y. More...
 
void DumpRodenticideMap (string a_fname)
 Dumps a map of rodenticide loads per 1m2 cells. More...
 
void InitiateRodenticidePolyData (string a_fname)
 Opens and initiates the output file for polygon rodenticide information. More...
 
void RecordRodenticidePolyData (string a_fname)
 Records rodenticide loads per polygon. More...
 

Protected Attributes

vector< BaitLocationm_BaitList
 List of bait locations. More...
 
vector< double > m_pmouse_map_main
 Map of probability of encountering a poisoned mouse. More...
 
vector< double > m_pmouse_map_twin
 Temporary map for calculation poisoned mouse diffusion. More...
 
Landscapem_land
 Landscape pointer. More...
 
int m_width
 Landscape dimensions. More...
 
int m_height
 
int m_heightm1
 
int m_gridsize
 rodenticide grid size - also affect diffusion rate More...
 
double m_diffusionRate
 poisoned mice diffusion rate More...
 
double m_immigrationRate
 poisoned mice immigration rate More...
 
double m_deathRate
 poisoned mice death rate More...
 
int m_seasonstartprob [tbl_foobar][1000]
 season start probability distribution More...
 

Detailed Description

Class for management of bait locations.

Constructor & Destructor Documentation

◆ RodenticideManager()

RodenticideManager::RodenticideManager ( string  fname,
Landscape a_land 
)

RodenticideManager constructor.

Uses the file name to open a file and read in all bait locations required for managemnet

Creates the rodenticide grid with its twin-map and fills them with zeros. The maps have a resolution which is defined by cfg_rodenticide_gridsize Cannot have diffusion of >= map width or height - this needs checking to prevent wrapping around the world.

Read in and handle the probability distributions for seasonal start dates for bait locations. BaitLocationsSeasonalStartProbs.txt holds a column of daily probability for bait placement for each building type ()values range 0.0 to 1.0).

124 {
125  // Read in input parameters
133  ifstream ifile(a_fname.c_str(), ios::in);
134  if ( !ifile.is_open() )
135  {
136  cout << "Cannot open input file " << a_fname << endl;
137  char ch;
138  cin >> ch;
139  exit(1);
140  }
141  int noBaits, x, y, blt;
142  TTypesBaitLocation BL_type = tbl_foobar;
143  BaitLocation Bait(0,0,BL_type);
144  ifile >> noBaits;
145  for (int i = 0; i < noBaits; i++)
146  {
147  ifile >> x >> y >> blt;
148  Bait.SetX(x >> m_gridsize);
149  Bait.SetY(y >> m_gridsize);
150  Bait.SetBLtype((TTypesBaitLocation)blt);
151  m_BaitList.push_back(Bait);
152  }
153  // Need to put actual baits out in the landscape
154  m_land = a_land;
161  m_heightm1 = m_height-1; // Saves many many calculations later.
162  m_pmouse_map_main.resize((m_width+1) * (m_height+1));
163  m_pmouse_map_twin.resize((m_width+1) * (m_height+1));
164  for (int i=0; i<m_width+1; ++i) for (int j=0; j<m_height+1; ++j)
165  {
166  m_pmouse_map_main[j*m_height + i] = 0;
167  m_pmouse_map_twin[j*m_height + i] = 0;
168  }
174  ifstream i2file("BaitLocationsSeasonalStartProbs.txt", ios::in);
175  if ( !ifile.is_open() )
176  {
177  cout << "Cannot open input file " << "BaitLocationsSeasonalStartProbs.txt" << endl;
178  char ch;
179  cin >> ch;
180  exit(1);
181  }
182  double temp[tbl_foobar][365];
183  for (int i = 0; i < 365; i++)
184  {
185  for (int j=0; j<tbl_foobar; j++)
186  {
187  i2file >> temp[j][i];
188  }
189  }
190  // BaitLocationsSeasonalStartProbs.txt data exists in temp.
191  // Next for each building type fill in the probability array in fractions of 0.1
192  // each entry corresponds to one day when bait might be started
193  for (int j=0; j<tbl_foobar; j++)
194  {
195  int index = 0;
196  for (int i = 0; i < 365; i++)
197  {
198  int prob = (int) floor((temp[j][i]*10)+0.5) + index; // input data sums to 100, so multiply by 10 is 1000
199  if (prob>1000) prob=1000;
200  for (int k=index; k<prob; k++) m_seasonstartprob[j][k] = i;
201  index=prob;
202  if (index>=1000) i=365;
203  }
204  }
205  InitiateRodenticidePolyData("RodenticidePolyData.txt");
206 }

References cfg_rodenticide_deathRate(), cfg_rodenticide_diffusionRate(), cfg_rodenticide_gridsize(), cfg_rodenticide_immigrationRate(), BaitLocation::SetBLtype(), BaitLocation::SetX(), BaitLocation::SetY(), Landscape::SupplySimAreaWidth(), and tbl_foobar.

◆ ~RodenticideManager()

RodenticideManager::~RodenticideManager ( void  )
virtual

RodenticideManager destructor.

210 {
211  ;
212 }

Member Function Documentation

◆ Diffuse()

void RodenticideManager::Diffuse ( int  a_x,
int  a_y 
)

Move poisoned mice around to twin map.

256 {
257  double before = GetMap(a_x, a_y);
258  if (before < 0.00001)
259  {
260  SetMapTwinP(a_x, a_y,0); // Prevents infinitely small calculations
261  return;
262  }
263  double after = before * m_diffusionRate;
264  double diff_out = after/8;
265  SetMapTwinP(a_x, a_y,before-after);
266  DistributeRing(a_x,a_y,diff_out);
267 }

◆ DistributeRing()

void RodenticideManager::DistributeRing ( int  a_x,
int  a_y,
double  a_amount 
)
inline

Distribute an amount to the twin map in a ring.

Distribute a_amount to the eight cells around m_x,m_y

270 {
272  int x1 = a_x - 1;
273  int y1 = a_y - 1;
274  int y2 = y1 + 2;
275  int x2 = x1 + 2;
276  if ((y1<0) || (y2==m_height) || (x1<0) || (x2==m_width))
277  {
278  // We need to do this to prevent the diffusion building a wall around the edge, but it could be assessed as to whether the speed penalty is worth it
279  x1 = (x1 + m_width) % m_width;
280  x2 = (x2 + m_width) % m_width;
281  y1 = (y1 + m_height) % m_height;
282  y2 = (y2 + m_height) % m_height;
283  }
284  SetMapTwinP(x1,y1,a_amount);
285  SetMapTwinP(x1,y2,a_amount);
286  SetMapTwinP(x1,a_y,a_amount);
287  SetMapTwinP(x2,y1,a_amount);
288  SetMapTwinP(x2,y2,a_amount);
289  SetMapTwinP(x2,a_y,a_amount);
290  SetMapTwinP(a_x,y1,a_amount);
291  SetMapTwinP(a_x,y2,a_amount);
292 }

◆ DoDeath()

void RodenticideManager::DoDeath ( void  )
inline

Reduce each cell in twin map by m_deathRate.

121  {
122  for (int i=0;i<m_width; i++)
123  for (int j=0; j<m_height; j++) SetMapTwinMult(i,j,m_deathRate);
124  }

◆ DoDiffuse()

void RodenticideManager::DoDiffuse ( void  )
inline
115  {
116  for (int i=0;i<m_width; i++)
117  for (int j=0; j<m_height; j++) this->Diffuse(i,j);
118  }

◆ DoImmigration()

void RodenticideManager::DoImmigration ( void  )
241 {
242  unsigned sz = (unsigned) m_BaitList.size();
243  for (unsigned i=0; i<sz; i++)
244  {
245  if (m_BaitList[i].GetMass()>0)
246  {
247  m_BaitList[i].ReduceMass(m_immigrationRate); // subtract 1 m_immigrationRate from mass
248  int x = m_BaitList[i].GetX();
249  int y = m_BaitList[i].GetY();
251  }
252  }
253 }

◆ DoPlaceBait()

void RodenticideManager::DoPlaceBait ( void  )

Initiates bait placement for those bait locations necessary.

Depending upon the bait type, whether the bait has been used this year and whether it is destined to be used this method will add mass to the bait locations.
Housekeeping on Jan 1st is to remove all masses and zero all flags for the start of the new year.
The first test is of date, since whether a BL is used is determined by the frequency of that BL type on Jan 1st.
The next test is on the season, determining the start of bait placement.
NB this not so time critical so no optimising of the loops is done here.

334 {
343  int day = m_land->SupplyDayInYear();
344  unsigned sz = (unsigned) m_BaitList.size();
345  if (day==0)
346  {
347  for (unsigned i=0; i<sz; i++)
348  {
349  m_BaitList[i].Reset();
350  if (ShouldPlaceBait(m_BaitList[i].GetBLtype()))
351  {
352  m_BaitList[i].SetUseFlag(true);
353  m_BaitList[i].SetstartDay(GetBaitStartDate(m_BaitList[i].GetBLtype()));
354  }
355  }
356  }
357  // Loop through all the BLs and initiate any needed doing today
358  for (unsigned i=0; i<sz; i++)
359  {
360  if (m_BaitList[i].GetUseFlag())
361  {
362  if (m_BaitList[i].GetstartDay() == day )
363  {
364  // Due to start today, so set bait mass & unset use flag because we have used it now.
365  // Find the bait mass
366  int mass;
367  switch (m_BaitList[i].GetBLtype())
368  {
369  case tbl_town:
370  mass = cfg_rodenticide_BLtown_Length.value();
371  break;
372  case tbl_country:
373  mass = cfg_rodenticide_BLcountry_Length.value();
374  break;
375  case tbl_woodland:
376  mass = cfg_rodenticide_BLwoodland_Length.value();
377  break;
378  case tbl_christmasstrees:
379  mass = cfg_rodenticide_BLchristmasstrees_Length.value(); // uses same as woodland
380  break;
381  case tbl_grass:
382  mass = cfg_rodenticide_BLgrass_Length.value(); // uses same as woodland
383  break;
384  default:
385  g_msg->Warn( WARN_FILE, "RodenticideManager::DoPlaceBait(void): Unknown bait type","");
386  exit( 0 );
387  }
388  m_BaitList[i].SetMass(mass);
389  m_BaitList[i].SetUseFlag(false);
390  // Add the bait to the main map
391  SetMap(m_BaitList[i].GetX(),m_BaitList[i].GetY(),1.0);
392  }
393  }
394  }
395 
396 }

References cfg_rodenticide_BLchristmasstrees_Length(), cfg_rodenticide_BLcountry_Length(), cfg_rodenticide_BLgrass_Length(), cfg_rodenticide_BLtown_Length(), cfg_rodenticide_BLwoodland_Length(), tbl_christmasstrees, tbl_country, tbl_grass, tbl_town, and tbl_woodland.

◆ DumpRodenticideMap()

void RodenticideManager::DumpRodenticideMap ( string  a_fname)

Dumps a map of rodenticide loads per 1m2 cells.

Uses the file name to open a file and saves the rodenticide value for each cell at the time this method is called.

400 {
404  ofstream ofile(a_fname.c_str(), ios::out);
405  if ( !ofile.is_open() )
406  {
407  cout << "Cannot open output file for rodenticide map dump " << a_fname << endl;
408  char ch;
409  cin >> ch;
410  exit(1);
411  }
412  int xext = m_land->SupplySimAreaWidth();
413  int yext = m_land->SupplySimAreaHeight();
414  ofile << "Width: "<< xext << endl;
415  ofile << "Height: "<< yext << endl;
416  for (int y=0; y<yext; y++)
417  {
418  for (int x=0; x<xext; x++)
419  {
420  ofile << m_land->SupplyRodenticide(x,y) << '\t';
421  }
422  ofile << endl;
423  }
424  ofile.close();
425 }

◆ GetBaitStartDate()

int RodenticideManager::GetBaitStartDate ( TTypesBaitLocation  a_BLt)

Determines when the bait will be placed within a season.

328 {
329  int chance = (int) floor((g_rand_uni() * 1000)+0.5);
330  return m_seasonstartprob[a_BLt][chance];
331 }

References g_rand_uni.

◆ GetMap()

double RodenticideManager::GetMap ( int  a_x,
int  a_y 
)
inline

Get poisoned mice at x,y.

129 { return m_pmouse_map_main[a_y*m_width + a_x]; }

◆ GetMapTwin()

double RodenticideManager::GetMapTwin ( int  a_x,
int  a_y 
)
inline

Get poisoned mice at x,y on twin map.

131 { return m_pmouse_map_twin[a_y*m_width + a_x]; }

◆ GetRodenticide()

double RodenticideManager::GetRodenticide ( unsigned  a_x,
int  a_y 
)
inline

Return the poisoned mice value at x,y.

141 { return m_pmouse_map_main[(a_x >> m_gridsize) + (a_y >> m_gridsize)*m_width]; }

◆ InitiateRodenticidePolyData()

void RodenticideManager::InitiateRodenticidePolyData ( string  a_fname)

Opens and initiates the output file for polygon rodenticide information.

Uses the file name to open a file and saves the rodenticide value for each polygon at the time this method is called.

429 {
433  ofstream ofile(a_fname.c_str(), ios::out);
434  if ( !ofile.is_open() )
435  {
436  cout << "Cannot open output file for rodenticide poly initiate " << a_fname << endl;
437  char ch;
438  cin >> ch;
439  exit(1);
440  }
441  int noPoly=m_land->SupplyNumberOfPolygons();
442  ofile << noPoly << endl;
443  for (int p=0; p<(noPoly-1); p++)
444  {
445  ofile << m_land->SupplyPolyRefVector(p) << '\t';
446  }
447  ofile << m_land->SupplyPolyRefVector(noPoly-1) << endl;
448  for (int p=0; p<(noPoly-1); p++)
449  {
450  ofile << m_land->SupplyElementTypeFromVector(p) << '\t';
451  }
452  ofile << m_land->SupplyElementTypeFromVector(noPoly-1) << endl;
453  for (int p=0; p<(noPoly-1); p++)
454  {
455  int area = (int) m_land->SupplyPolygonAreaVector(p);
456  ofile << area << '\t';
457  }
458  ofile << m_land->SupplyPolygonAreaVector(noPoly-1);
459  ofile.close();
460 }

◆ RecordRodenticidePolyData()

void RodenticideManager::RecordRodenticidePolyData ( string  a_fname)

Records rodenticide loads per polygon.

Uses the file name to open a file and saves the rodenticide value for each polygon at the time this method is called.

463 {
467  ofstream ofile(a_fname.c_str(), ios::app);
468  if ( !ofile.is_open() )
469  {
470  cout << "Cannot open output file for rodenticide poly data " << a_fname << endl;
471  char ch;
472  cin >> ch;
473  exit(1);
474  }
475  int noPoly=m_land->SupplyLargestPolyNumUsed()+1;
476  double* polyR = new double [noPoly];
477  for (int p=0; p<(noPoly); p++) polyR[p]=0.0;
478  int xext = m_land->SupplySimAreaWidth();
479  int yext = m_land->SupplySimAreaHeight();
480  for (int y=0; y<yext; y++)
481  {
482  for (int x=0; x<xext; x++)
483  {
484  double Rdt = m_land->SupplyRodenticide(x,y);
485  int pindex = m_land->SupplyPolyRefIndex(x,y);
486  polyR[pindex]+=Rdt;
487  }
488  }
489  ofile << endl; // Got to be here to easily allow an eof test later
490  for (int p=0; p<(noPoly-1); p++)
491  {
492  ofile << polyR[p] << '\t';
493  }
494  ofile << polyR[noPoly-1];
495  ofile.close();
496  delete polyR;
497 }

◆ SetMap()

void RodenticideManager::SetMap ( int  a_x,
int  a_y,
double  a_p 
)
inline

Set poisoned mice at x,y.

133 { m_pmouse_map_main[a_y*m_width + a_x] = a_p; }

◆ SetMapTwin()

void RodenticideManager::SetMapTwin ( int  a_x,
int  a_y,
double  a_p 
)
inline

Set poisoned mice at x,y on twin map.

135 { m_pmouse_map_twin[a_y*m_width + a_x] = a_p; }

◆ SetMapTwinMult()

void RodenticideManager::SetMapTwinMult ( int  a_x,
int  a_y,
double  a_p 
)
inline

Multiply poisoned mice at x,y on twin map by constant.

137 { m_pmouse_map_twin[a_y*m_width + a_x] *= a_p; }

◆ SetMapTwinP()

void RodenticideManager::SetMapTwinP ( int  a_x,
int  a_y,
double  a_p 
)
inline

Add to poisoned mice at x,y on twin map.

139 { m_pmouse_map_twin[a_y*m_width + a_x] += a_p; }

◆ ShouldPlaceBait()

bool RodenticideManager::ShouldPlaceBait ( TTypesBaitLocation  a_BLt)

Place bait dependent upon a frequency test.

295 {
296 #ifdef __RODENTICIDE_DISTRIBUTIONTEST
297  return true;
298 #endif
299  double chance = g_rand_uni();
300  switch (a_BLt)
301  {
302  case tbl_town:
303  if (chance < cfg_rodenticide_BLtown_AnnFreq.value()) return true;
304  break;
305  case tbl_country:
306  if (chance < cfg_rodenticide_BLcountry_AnnFreq.value()) return true;
307  break;
308  case tbl_woodland:
309  if (chance < cfg_rodenticide_BLwoodland_AnnFreq.value()) return true;
310  break;
311  case tbl_christmasstrees:
312  if (chance < cfg_rodenticide_BLchristmastrees_AnnFreq.value()) return true;
313  break;
314  case tbl_grass:
315  if (chance < cfg_rodenticide_BLgrass_AnnFreq.value()) return true;
316  break;
317  case tbl_foobar:
318  cout << "Unknown building type" << endl;
319  char ch;
320  cin >> ch;
321  exit(1);
322  break;
323  }
324  return false;
325 }

References cfg_rodenticide_BLchristmastrees_AnnFreq(), cfg_rodenticide_BLcountry_AnnFreq(), cfg_rodenticide_BLgrass_AnnFreq(), cfg_rodenticide_BLtown_AnnFreq(), cfg_rodenticide_BLwoodland_AnnFreq(), g_rand_uni, tbl_christmasstrees, tbl_country, tbl_foobar, tbl_grass, tbl_town, and tbl_woodland.

◆ Tick()

void RodenticideManager::Tick ( void  )

Advance one day.

Check for bait location placement each day, but also do intialisation on Jan 1st.

For each bait location - first add immigration to the main map.

Then calculate diffusion for every cell - this is time consuming! Diffusion is added to twin map.

Apply mortalities to all cells in the twin map.

Finally swap the twin map and main map, then clear the twin map.

215 {
217  DoPlaceBait();
219  DoImmigration();
221  DoDiffuse();
223  DoDeath();
225  m_pmouse_map_twin.swap(m_pmouse_map_main); // Swap the twim map to the main map
226  m_pmouse_map_twin.assign((m_width+1) * (m_height+1), 0); // clears the twin map
227  // OUTPUT
228  int year = m_land->SupplyYearNumber();
229  int today = m_land->SupplyDayInYear();
230  if ((cfg_rodenticide_dumpmapstartyear.value()>=year) && (cfg_rodenticide_dumpmapstartyear.value()<=year) &&(cfg_rodenticide_dumpmapday.value()==today) )
231  {
232  DumpRodenticideMap("RodenticideMap.txt");
233  }
234  if ((year >= cfg_rodenticide_dumppolystartyear.value()) && (year <= cfg_rodenticide_dumppolyendyear.value()) )
235  {
236  if (today % cfg_rodenticide_dumppolyinterval.value()==0) RecordRodenticidePolyData("RodenticidePolyData.txt");
237  }
238 }

References cfg_rodenticide_dumpmapday(), cfg_rodenticide_dumpmapstartyear(), cfg_rodenticide_dumppolyendyear(), cfg_rodenticide_dumppolyinterval(), and cfg_rodenticide_dumppolystartyear().

Member Data Documentation

◆ m_BaitList

vector<BaitLocation> RodenticideManager::m_BaitList
protected

List of bait locations.

◆ m_deathRate

double RodenticideManager::m_deathRate
protected

poisoned mice death rate

◆ m_diffusionRate

double RodenticideManager::m_diffusionRate
protected

poisoned mice diffusion rate

◆ m_gridsize

int RodenticideManager::m_gridsize
protected

rodenticide grid size - also affect diffusion rate

◆ m_height

int RodenticideManager::m_height
protected

◆ m_heightm1

int RodenticideManager::m_heightm1
protected

◆ m_immigrationRate

double RodenticideManager::m_immigrationRate
protected

poisoned mice immigration rate

◆ m_land

Landscape* RodenticideManager::m_land
protected

Landscape pointer.

◆ m_pmouse_map_main

vector<double> RodenticideManager::m_pmouse_map_main
protected

Map of probability of encountering a poisoned mouse.

◆ m_pmouse_map_twin

vector<double> RodenticideManager::m_pmouse_map_twin
protected

Temporary map for calculation poisoned mouse diffusion.

◆ m_seasonstartprob

int RodenticideManager::m_seasonstartprob[tbl_foobar][1000]
protected

season start probability distribution

◆ m_width

int RodenticideManager::m_width
protected

Landscape dimensions.


The documentation for this class was generated from the following files:
RodenticideManager::GetMap
double GetMap(int a_x, int a_y)
Get poisoned mice at x,y.
Definition: Rodenticide.h:129
cfg_rodenticide_dumppolyinterval
CfgInt cfg_rodenticide_dumppolyinterval("RODENTICIDE_DUMPPOLYINTERVAL", CFG_CUSTOM, 180)
RodenticideManager::DumpRodenticideMap
void DumpRodenticideMap(string a_fname)
Dumps a map of rodenticide loads per 1m2 cells.
Definition: Rodenticide.cpp:399
RodenticideManager::DistributeRing
void DistributeRing(int a_x, int a_y, double a_amount)
Distribute an amount to the twin map in a ring.
Definition: Rodenticide.cpp:269
Landscape::SupplyNumberOfPolygons
unsigned int SupplyNumberOfPolygons(void)
Definition: landscape.h:1461
RodenticideManager::DoPlaceBait
void DoPlaceBait()
Initiates bait placement for those bait locations necessary.
Definition: Rodenticide.cpp:333
tbl_christmasstrees
Definition: Rodenticide.h:13
RodenticideManager::SetMapTwinP
void SetMapTwinP(int a_x, int a_y, double a_p)
Add to poisoned mice at x,y on twin map.
Definition: Rodenticide.h:139
cfg_rodenticide_BLwoodland_Length
CfgInt cfg_rodenticide_BLwoodland_Length("RODENTICIDE_BLTYPE_WOODLAND_LENGTH", CFG_CUSTOM, 82)
cfg_rodenticide_dumppolystartyear
CfgInt cfg_rodenticide_dumppolystartyear("RODENTICIDE_DUMPPOLYSTARTYEAR", CFG_CUSTOM, 99999)
RodenticideManager::m_BaitList
vector< BaitLocation > m_BaitList
List of bait locations.
Definition: Rodenticide.h:76
cfg_rodenticide_BLwoodland_AnnFreq
CfgFloat cfg_rodenticide_BLwoodland_AnnFreq("RODENTICIDE_BLTYPE_WOODLAND_ANNFREQ", CFG_CUSTOM, 0.01)
cfg_rodenticide_BLgrass_Length
CfgInt cfg_rodenticide_BLgrass_Length("RODENTICIDE_BLTYPE_GRASS_LENGTH", CFG_CUSTOM, 82)
RodenticideManager::m_pmouse_map_twin
vector< double > m_pmouse_map_twin
Temporary map for calculation poisoned mouse diffusion.
Definition: Rodenticide.h:80
cfg_rodenticide_deathRate
CfgFloat cfg_rodenticide_deathRate("RODENTICIDE_DEATHRATE", CFG_CUSTOM, 0.048307)
RodenticideManager::m_height
int m_height
Definition: Rodenticide.h:84
tbl_woodland
Definition: Rodenticide.h:12
RodenticideManager::RecordRodenticidePolyData
void RecordRodenticidePolyData(string a_fname)
Records rodenticide loads per polygon.
Definition: Rodenticide.cpp:462
tbl_grass
Definition: Rodenticide.h:14
cfg_rodenticide_diffusionRate
CfgFloat cfg_rodenticide_diffusionRate("RODENTICIDE_DIFFUSIONRATE", CFG_CUSTOM, 0.5)
cfg_rodenticide_gridsize
CfgInt cfg_rodenticide_gridsize("RODENTICIDE_GRIDSIZE", CFG_CUSTOM, 5)
cfg_rodenticide_BLcountry_Length
CfgInt cfg_rodenticide_BLcountry_Length("RODENTICIDE_BLTYPE_COUNTRY_LENGTH", CFG_CUSTOM, 34)
tbl_town
Definition: Rodenticide.h:10
cfg_rodenticide_immigrationRate
CfgFloat cfg_rodenticide_immigrationRate("RODENTICIDE_IMMIGRATIONRATE", CFG_CUSTOM, 1.0)
RodenticideManager::DoDeath
void DoDeath(void)
Reduce each cell in twin map by m_deathRate.
Definition: Rodenticide.h:120
RodenticideManager::InitiateRodenticidePolyData
void InitiateRodenticidePolyData(string a_fname)
Opens and initiates the output file for polygon rodenticide information.
Definition: Rodenticide.cpp:428
BaitLocation
Class used for describing the rodenticide bait location.
Definition: Rodenticide.h:19
cfg_rodenticide_BLcountry_AnnFreq
CfgFloat cfg_rodenticide_BLcountry_AnnFreq("RODENTICIDE_BLTYPE_COUNTRY_ANNFREQ", CFG_CUSTOM, 0.33)
Landscape::SupplySimAreaHeight
int SupplySimAreaHeight(void)
Definition: landscape.h:1637
Landscape::SupplySimAreaWidth
int SupplySimAreaWidth(void)
Definition: landscape.h:1632
cfg_rodenticide_dumppolyendyear
CfgInt cfg_rodenticide_dumppolyendyear("RODENTICIDE_DUMPPOLYENDYEAR", CFG_CUSTOM,-1)
RodenticideManager::m_deathRate
double m_deathRate
poisoned mice death rate
Definition: Rodenticide.h:92
cfg_rodenticide_BLchristmasstrees_Length
CfgInt cfg_rodenticide_BLchristmasstrees_Length("RODENTICIDE_BLTYPE_CTREE_LENGTH", CFG_CUSTOM, 82)
RodenticideManager::m_pmouse_map_main
vector< double > m_pmouse_map_main
Map of probability of encountering a poisoned mouse.
Definition: Rodenticide.h:78
Landscape::SupplyRodenticide
double SupplyRodenticide(int a_x, int a_y)
Gets total rodenticide for a location.
Definition: Landscape.cpp:492
Landscape::SupplyDayInYear
int SupplyDayInYear(void)
Definition: landscape.h:1596
tbl_foobar
Definition: Rodenticide.h:15
RodenticideManager::ShouldPlaceBait
bool ShouldPlaceBait(TTypesBaitLocation)
Place bait dependent upon a frequency test.
Definition: Rodenticide.cpp:294
Landscape::SupplyYearNumber
int SupplyYearNumber(void)
Definition: landscape.h:1616
g_rand_uni
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
Landscape::SupplyPolyRefVector
int SupplyPolyRefVector(unsigned int a_index)
Definition: landscape.h:1451
Landscape::SupplyElementTypeFromVector
TTypesOfLandscapeElement SupplyElementTypeFromVector(unsigned int a_index)
Definition: landscape.h:1104
TTypesBaitLocation
TTypesBaitLocation
An enumeration listing the types of bait locations possible.
Definition: Rodenticide.h:8
RodenticideManager::m_width
int m_width
Landscape dimensions.
Definition: Rodenticide.h:84
RodenticideManager::Diffuse
void Diffuse(int a_x, int a_y)
Move poisoned mice around to twin map.
Definition: Rodenticide.cpp:255
RodenticideManager::DoImmigration
void DoImmigration(void)
Definition: Rodenticide.cpp:240
RodenticideManager::m_immigrationRate
double m_immigrationRate
poisoned mice immigration rate
Definition: Rodenticide.h:90
cfg_rodenticide_BLtown_AnnFreq
CfgFloat cfg_rodenticide_BLtown_AnnFreq("RODENTICIDE_BLTYPE_TOWN_ANNFREQ", CFG_CUSTOM, 0.05)
RodenticideManager::m_gridsize
int m_gridsize
rodenticide grid size - also affect diffusion rate
Definition: Rodenticide.h:86
RodenticideManager::GetBaitStartDate
int GetBaitStartDate(TTypesBaitLocation)
Determines when the bait will be placed within a season.
Definition: Rodenticide.cpp:327
cfg_rodenticide_BLchristmastrees_AnnFreq
CfgFloat cfg_rodenticide_BLchristmastrees_AnnFreq("RODENTICIDE_BLTYPE_CTREES_ANNFREQ", CFG_CUSTOM, 0.05 *(5/9))
RodenticideManager::m_heightm1
int m_heightm1
Definition: Rodenticide.h:84
RodenticideManager::m_diffusionRate
double m_diffusionRate
poisoned mice diffusion rate
Definition: Rodenticide.h:88
RodenticideManager::SetMap
void SetMap(int a_x, int a_y, double a_p)
Set poisoned mice at x,y.
Definition: Rodenticide.h:133
RodenticideManager::SetMapTwinMult
void SetMapTwinMult(int a_x, int a_y, double a_p)
Multiply poisoned mice at x,y on twin map by constant.
Definition: Rodenticide.h:137
cfg_rodenticide_BLgrass_AnnFreq
CfgFloat cfg_rodenticide_BLgrass_AnnFreq("RODENTICIDE_BLTYPE_GRASS_ANNFREQ", CFG_CUSTOM, 0.05 *(5/9))
Landscape::SupplyPolygonAreaVector
double SupplyPolygonAreaVector(int a_polyref)
Returns the area of a polygon using the vector index as a reference.
Definition: landscape.h:1200
RodenticideManager::m_land
Landscape * m_land
Landscape pointer.
Definition: Rodenticide.h:82
Landscape::SupplyPolyRefIndex
int SupplyPolyRefIndex(int a_x, int a_y)
Definition: landscape.h:1493
Landscape::SupplyLargestPolyNumUsed
int SupplyLargestPolyNumUsed()
Definition: landscape.h:355
cfg_rodenticide_dumpmapstartyear
CfgInt cfg_rodenticide_dumpmapstartyear("RODENTICIDE_DUMPMAPSTARTYEAR", CFG_CUSTOM, 99999)
RodenticideManager::DoDiffuse
void DoDiffuse(void)
Definition: Rodenticide.h:114
cfg_rodenticide_dumpmapday
CfgInt cfg_rodenticide_dumpmapday("RODENTICIDE_DUMPMAPDAY", CFG_CUSTOM, 180)
RodenticideManager::m_seasonstartprob
int m_seasonstartprob[tbl_foobar][1000]
season start probability distribution
Definition: Rodenticide.h:94
cfg_rodenticide_BLtown_Length
CfgInt cfg_rodenticide_BLtown_Length("RODENTICIDE_BLTYPE_TOWN_LENGTH", CFG_CUSTOM, 34)
tbl_country
Definition: Rodenticide.h:11
int