42 #define PEST_GRIDSIZE_POW2 0 43 #define PEST_GRIDSIZE 1 44 #define PEST_GRIDAREA 1 // i.e. PEST_GRIDSIZE^2 73 m_sprayed_elem = a_sprayed_elem;
90 Diffusor(
int a_dx,
int a_dy,
double a_fraction ) {
93 m_fraction = a_fraction;
170 #ifdef __DETAILED_PESTICIDE_FATE 171 double *m_pest_map_vegcanopy;
172 double *m_pest_map_soil;
182 double m_RainWashoffFactor[10000];
193 void DailyQueueClear(
void );
194 void DailyQueueProcess(
void );
196 bool ElementIsWater(
int a_x,
int a_y );
198 void MainMapDecay(
void );
200 void TwinMapClear(
int a_minx,
int a_miny,
int a_maxx,
int a_maxy );
201 void TwinMapSpray(
LE* a_element_spryaed,
double a_amount,
int a_minx,
int a_miny,
int a_maxx,
int a_maxy );
202 void TwinMapSprayPixel(
int a_large_map_x,
204 double a_fractional_amount );
205 void TwinMapSprayCorrectBorders(
void );
208 void TwinMapDiffusion(
int a_minx,
int a_miny,
int a_maxx,
int a_maxy,
double a_cover );
210 void DiffusionMaskInit(
void );
211 double DiffusionFunction(
double a_dist_meters );
212 void DiffusionSprayPixel(
int a_x,
int a_limit_x,
int a_y,
int a_limit_y,
double a_amount,
double a_cover );
214 void CalcRainWashOffFactors();
218 void DailyQueueAdd(
LE* a_element_sprayed,
double a_amount );
225 #ifdef __DETAILED_PESTICIDE_FATE 226 double SupplyPesticideS(
int a_x,
int a_y);
227 double SupplyPesticideP(
int a_x,
int a_y);
228 double SupplyPesticideS(
int a_polyref);
229 double SupplyPesticideP(
int a_polyref);
231 double SupplyPesticide(
int a_x,
int a_y );
232 double SupplyPesticide(
int a_polyref);
241 bool SavePPM(
double *a_map,
242 int a_beginx,
int a_width,
243 int a_beginy,
int a_height,
246 void DiffusionMaskInitTest(
void );
257 m_map->SupplyElementType( a_x, a_y );
271 #ifdef __DETAILED_PESTICIDE_FATE 273 inline double Pesticide::SupplyPesticideS(
int a_x,
int a_y)
283 return m_pest_map_soil[l_y * m_pest_map_width + l_x];
286 inline double Pesticide::SupplyPesticideP(
int a_x,
int a_y)
296 return m_pest_map_vegcanopy[l_y * m_pest_map_width + l_x];
299 inline double Pesticide::SupplyPesticideS(
int a_ele)
305 int l_c = m_map->SupplyPesticideCell(a_ele);
306 return m_pest_map_soil[l_c];
309 inline double Pesticide::SupplyPesticideP(
int a_ele)
315 int l_c = m_map->SupplyPesticideCell(a_ele);
316 return m_pest_map_vegcanopy[l_c];
327 #ifdef PEST_WATER_CHECK 328 if (ElementIsWater(a_x, a_y))
335 return m_pest_map_main[l_y * m_pest_map_width + l_x];
342 int l_c = m_map->SupplyPesticideCell(a_ele);
343 return m_pest_map_main[l_c];
350 double a_fractional_amount)
355 m_pest_map_twin[l_y * m_pest_map_width + l_x] +=
359 #endif // PESTICIDE_H The landscape class containing all environmental and topographical data.
vector< Diffusor * > Diffusion_mask
The grid of diffusors for each point in a polygon that is sprayed.
unsigned int m_pest_map_width
double m_pest_daily_decay_frac_Soil
bool GetAnythingToDecay()
double SupplyPesticide(int a_x, int a_y)
#define PEST_GRIDSIZE_POW2
Turns on code for detailed pesticide fate handling.
double m_pest_daily_decay_frac_Veg
bool ElementIsWater(int a_x, int a_y)
PesticideEvent(LE *a_sprayed_elem, double a_amount)
void SetFraction(double a_frac)
vector< PesticideEvent * > m_daily_spray_queue
unsigned m_rainfallcategory
Daily rainfall saved here * 100 to use as an indext to the Pesticide::m_RainWashoffFactor array - an ...
void TwinMapSprayPixel(int a_large_map_x, int a_large_map_y, double a_fractional_amount)
unsigned int m_pest_map_size
bool m_something_to_decay
unsigned int m_pest_map_height
double m_pest_daily_decay_frac
Diffusor(int a_dx, int a_dy, double a_fraction)