ALMaSS Partridge ODdox  1.1
The partridge model description following ODdox protocol
elements.cpp
Go to the documentation of this file.
1 /*
2 *******************************************************************************************************
3 Copyright (c) 2011, Christopher John Topping, University of Aarhus
4 All rights reserved.
5 
6 Redistribution and use in source and binary forms, with or without modification, are permitted provided
7 that the following conditions are met:
8 
9 Redistributions of source code must retain the above copyright notice, this list of conditions and the
10 following disclaimer.
11 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
12 the following disclaimer in the documentation and/or other materials provided with the distribution.
13 
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
15 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
17 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
18 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
19 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 ********************************************************************************************************
23 */
24 
25 #define _CRT_SECURE_NO_DEPRECATE
26 
27 
28 
29 #define __WEED_CURVE 99 //99 // 99 is the weed curve
30 
31 // The default no better information values (Mean of the four crop values)
32 #define EL_BUG_PERCENT_A 0.0
33 #define EL_BUG_PERCENT_B 0.2975
34 #define EL_BUG_PERCENT_C 0.095916647275
35 #define EL_BUG_PERCENT_D 0
36 
37 // SBarley
38 #define EL_BUG_PERCENT_SB_A 0
39 #define EL_BUG_PERCENT_SB_B 0.380763296
40 #define EL_BUG_PERCENT_SB_C 0
41 #define EL_BUG_PERCENT_D 0
42 
43 // WWheat
44 #define EL_BUG_PERCENT_WW_A 0.0
45 #define EL_BUG_PERCENT_WW_B 0.1283
46 #define EL_BUG_PERCENT_WW_C 0.0
47 #define EL_BUG_PERCENT_D 0
48 
49 // WRye
50 #define EL_BUG_PERCENT_WRy_A 0.0
51 #define EL_BUG_PERCENT_WRy_B 0.395651915
52 #define EL_BUG_PERCENT_WRy_C 0.0
53 #define EL_BUG_PERCENT_D 0
54 
55 //WRape
56 #define EL_BUG_PERCENT_WR_A 0.0
57 #define EL_BUG_PERCENT_WR_B 0.028271643
58 #define EL_BUG_PERCENT_WR_C 0.0
59 #define EL_BUG_PERCENT_D 0
60 
61 //Cropped/Grazed Grass
62 #define EL_BUG_PERCENT_G_A 4.123817127
63 #define EL_BUG_PERCENT_G_B 0.151015629
64 #define EL_BUG_PERCENT_G_C -0.228228353
65 #define EL_BUG_PERCENT_D 0
66 
67 //Edges
68 #define EL_BUG_PERCENT_Edges_A 10.72459109
69 #define EL_BUG_PERCENT_Edges_B 0.4
70 #define EL_BUG_PERCENT_Edges_C 2.529631141
71 #define EL_BUG_PERCENT_D 0
72 
73 #include <math.h>
74 #include "../Landscape/ls.h"
75 #include "../BatchALMaSS/BoostRandomGenerators.h"
76 
77 using namespace std;
78 
79 extern boost::variate_generator<base_generator_type&, boost::uniform_real<> > g_rand_uni;
81 
82 extern void FloatToDouble(double &, float);
85 
86 
87 
88 
90 CfgBool cfg_pollen_nectar_on("ELE_POLLENNECTAR_ON", CFG_CUSTOM, false);
92 CfgBool cfg_calc_pond_pesticide("POND_PEST_CALC_ON", CFG_CUSTOM, false);
94 CfgFloat cfg_pondpesticiderunoff("POND_PEST_RUNOFFFACTOR", CFG_CUSTOM, 10.0);
96 CfgBool cfg_randompondquality("POND_RANDOMQUALITY", CFG_CUSTOM, false);
98 CfgInt cfg_goosecountperiod("GOOSE_GOOSECOUNTPERIOD",CFG_CUSTOM,1);
100 CfgFloat cfg_PermanentVegGrowthMaxScaler("VEG_GROWTHSCALERMAX", CFG_CUSTOM, 1.0);
102 CfgFloat cfg_PermanentVegGrowthMinScaler("VEG_GROWTHSCALERMIN", CFG_CUSTOM, 1.0);
103 const double c_SolarConversion[ 2 ] [ 81 ] = {
104  {
105  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0.28,
106  0.56,0.84,1.12,1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.4,1.4,
107  1.4,1.4,1.26,1.12,0.98,0.84,0.7,0.56,0.42,0.28,0.14,0,0,0,0,0,0,0,0,0,0,0,
108  0,0,0,0,0
109  },
110  {
111  0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,
112  0,0.242857,0.485714,0.728571,0.971429,1.214286,1.457143,1.7,1.7,1.7,1.7,
113  1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,1.7,
114  1.53,1.36,1.19,1.02,0.85,0.68,0.51,0.34,0.17,0,0,0,0,0,0
115  }
116  };
117 
119 static CfgFloat l_pest_productOrchard_amount( "PEST_PRODUCTORCHARD_AMOUNT", CFG_CUSTOM, 0.0 );
127 
128 
129 static CfgFloat cfg_beetlebankinsectscaler("ELE_BBINSECTSCALER",CFG_CUSTOM,1.0); // 1.0 means beetlebank is the same as hedgebank
131 static double g_weed_percent[ tov_Undefined ];
136 static CfgInt cfg_OrchardSprayDay( "TOX_ORCHARDSPRAYDAY", CFG_CUSTOM, 150 );
137 static CfgInt cfg_OrchardSprayDay2( "TOX_ORCHARDSPRAYDAYTWO", CFG_CUSTOM, 200000 );
138 CfgInt cfg_OrchardNoCutsDay( "TOX_ORCHARDNOCUTS", CFG_CUSTOM, -1 );
139 static CfgInt cfg_MownGrassNoCutsDay( "ELE_MOWNGRASSNOCUTS", CFG_CUSTOM, -1 );
140 static CfgInt cfg_UMPatchyChance( "UMPATCHYCHANCE", CFG_CUSTOM, 0 );
142 static CfgFloat cfg_BBPatchyChance( "BEETLEBANKBPATCHYCHANCE", CFG_CUSTOM, 0.5 );
144 static CfgFloat cfg_MGPatchyChance( "MOWNGRASSPATCHYCHANCE", CFG_CUSTOM, 0.5 );
146 static CfgFloat cfg_SetAsidePatchyChance("SETASIDEPATCHYCHANCE", CFG_CUSTOM, 1.0);
147 static CfgFloat cfg_ele_weedscaling( "ELE_WEEDSCALING", CFG_CUSTOM, 1.0 );
149 CfgFloat cfg_PondLarvalFoodBiomassConst("POND_LARVALFOODBIOMASSCONST", CFG_CUSTOM, 215.0);
151 CfgFloat cfg_PondLarvalFoodR("POND_LARVALFOODFOODR", CFG_CUSTOM, 0.15);
152 // Docs in elements.h
153 CfgInt g_el_tramline_decaytime_days( "ELEM_TRAMLINE_DECAYTIME_DAYS", CFG_PRIVATE, 21 );
154 CfgInt g_el_herbicide_delaytime_days( "ELEM_HERBICIDE_DELAYTIME_DAYS", CFG_PRIVATE, 35 );
155 CfgInt g_el_strigling_delaytime_days( "ELEM_STRIGLING_DELAYTIME_DAYS", CFG_PRIVATE, 28 );
156 
157 // Daydegree sum set on an element by ReduceVeg().
158 #define EL_GROWTH_DAYDEG_MAGIC l_el_growth_daydeg_magic.value()
159 static CfgInt l_el_growth_daydeg_magic( "ELEM_GROWTH_DAYDEG_MAGIC", CFG_PRIVATE, 100 );
160 
161 // Date after which ReduceVeg() automatically sets the growth phase
162 // to harvest1. Cannot become a global configuration variable as it
163 // is calculated at runtime.
164 #define EL_GROWTH_DATE_MAGIC (g_date->DayInYear(1,9))
165 
166 // If the fraction used in the call to ReduceVeg() is *below* this
167 // value, then a phase transition to harvest1 is considered if
168 // there has been no previous 'forced' phase transition before this
169 // year.
170 #define EL_GROWTH_PHASE_SHIFT_LEVEL (l_el_growth_phase_shift_level.value())
171 static CfgFloat l_el_growth_phase_shift_level( "ELEM_GROWTH_PHASE_SHIFT_LEVEL", CFG_PRIVATE, 0.5 );
172 
173 
174 // Types of landscape elements. Default is 'unknown'.
175 // The conversion arrays are at the top in 'elements.cpp'!
176 // Change when adding or deleting element types.
177 // Outdated, not used anywhere in the landscape. *FN*
178 //#define EL_MAX_ELEM_TYPES 18
179 
180 // Constant of proportionality between leaf area total and plant
181 // biomass.
182 #define EL_PLANT_BIOMASS (l_el_plant_biomass_proport.value()) // Scaled to dry matter on Spring Barley for 2001 & 2002
183 // All other values are scaled relative to this as of 29/03/05
184 static CfgFloat l_el_plant_biomass_proport( "ELEM_PLANT_BIOMASS_PROPORT", CFG_PRIVATE, 41.45 );
185 
186 // Default starting LAI Total. (NB LAIGreen=LAITotal/4)
187 #define EL_VEG_START_LAIT (l_el_veg_start_lait.value())
188 static CfgFloat l_el_veg_start_lait( "ELEM_VEG_START_LAIT", CFG_PRIVATE, 1.08 );
189 
190 // Constant * biomass to get height
191 #define EL_VEG_HEIGHTSCALE (l_el_veg_heightscale.value())
192 static CfgInt l_el_veg_heightscale( "ELEM_VEG_HEIGHTSCALE", CFG_PRIVATE, 16 );
193 //May+21
194 #define RV_CUT_MAY (l_el_rv_cut_may.value())
195 static CfgInt l_el_rv_cut_may( "ELEM_RV_CUT_MAY", CFG_PRIVATE, 142 );
196 
197 #define RV_CUT_JUN (l_el_rv_cut_jun.value())
198 static CfgInt l_el_rv_cut_jun( "ELEM_RV_CUT_JUN", CFG_PRIVATE, 28 );
199 
200 #define RV_CUT_JUL (l_el_rv_cut_jul.value())
201 static CfgInt l_el_rv_cut_jul( "ELEM_RV_CUT_JUL", CFG_PRIVATE, 35 );
202 
203 #define RV_CUT_AUG (l_el_rv_cut_aug.value())
204 static CfgInt l_el_rv_cut_aug( "ELEM_RV_CUT_AUG", CFG_PRIVATE, 42 );
205 
206 #define RV_CUT_SEP (l_el_rv_cut_sep.value())
207 static CfgInt l_el_rv_cut_sep( "ELEM_RV_CUT_SEP", CFG_PRIVATE, 49 );
208 
209 #define RV_CUT_OCT (l_el_rv_cut_oct.value())
210 static CfgInt l_el_rv_cut_oct( "ELEM_RV_CUT_OCT", CFG_PRIVATE, 49 );
211 
212 #define RV_MAY_1ST (l_el_rv_may_1st.value())
213 static CfgInt l_el_rv_may_1st( "ELEM_RV_MAY_1ST", CFG_PRIVATE, 121 );
214 
215 #define RV_CUT_HEIGHT (l_el_rv_cut_height.value())
216 static CfgFloat l_el_rv_cut_height( "ELEM_RV_CUT_HEIGHT", CFG_PRIVATE, 10.0 );
217 #define RV_CUT_GREEN (l_el_rv_cut_green.value())
218 static CfgFloat l_el_rv_cut_green( "ELEM_RV_CUT_GREEN", CFG_PRIVATE, 1.5 );
219 #define RV_CUT_TOTAL (l_el_rv_cut_total.value())
220 static CfgFloat l_el_rv_cut_total( "ELEM_RV_CUT_TOTAL", CFG_PRIVATE, 2.0 );
221 
222 CfgFloat l_el_o_cut_height( "ELEM_RV_CUT_HEIGHT", CFG_PRIVATE, 10.0 );
223 CfgFloat l_el_o_cut_green( "ELEM_RV_CUT_GREEN", CFG_PRIVATE, 1.5 );
224 CfgFloat l_el_o_cut_total( "ELEM_RV_CUT_TOTAL", CFG_PRIVATE, 2.0 );
225 
226 // Default fraction between crop and weed biomasses.
227 #define EL_WEED_PERCENT (l_el_weed_percent.value())
228 static CfgFloat l_el_weed_percent( "ELEM_WEED_PERCENT", CFG_PRIVATE, 0.1 );
229 
230 // Weed biomass regrowth slope after herbacide application.
231 #define EL_WEED_SLOPE (l_el_weed_slope.value())
232 static CfgFloat l_el_weed_slope( "ELEM_WEED_SLOPE", CFG_PRIVATE, 0.15 );
233 
234 // Bug biomass regrowth slope after insecticide application.
235 #define EL_BUG_SLOPE (l_el_bug_slope.value())
236 static CfgFloat l_el_bug_slope( "ELEM_BUG_SLOPE", CFG_PRIVATE, 0.2 );
237 
238 // Fraction of the weed biomass below which we are in pesticide
239 // regrowth phase, above we are in proportionality mode.
240 // CANNOT be 1.00!
241 #define EL_WEED_GLUE (l_el_weed_glue.value())
242 static CfgFloat l_el_weed_glue( "ELEM_WEED_GLUE", CFG_PRIVATE, 0.99 );
243 
244 // Same as for weed, but bugs this time.
245 #define EL_BUG_GLUE (l_el_bug_glue.value())
246 static CfgFloat l_el_bug_glue( "ELEM_BUG_GLUE", CFG_PRIVATE, 0.50 );
247 
260 // This is inversed prior to use. A multiplication is very much less
261 // expensive compared to a division.
262 //
263 // The original array supplied is:
264 // {1.11,1.06,1.01,0.99,0.96,0.92,0.92,0.93,0.97,0.99,1.02,1.06}
265 double LE::m_monthly_traffic[ 12 ] =
266  {0.9009, 0.9434, 0.9901, 1.0101, 1.0417, 1.0870,
267  1.0870, 1.0753, 1.0753, 1.0101, 0.9804, 0.9434};
268 
269 double LE::m_largeroad_load[ 24 ] =
270  {15,9,4,5,14,54,332,381,252,206,204,215,
271  231,256,335,470,384,270,191,130,91,100,99,60};
272 
273 double LE::m_smallroad_load[ 24 ] =
274  {4,3,1,1,4,15,94,108,71,58,58,61,
275  65,73,95,133,109,76,54,37,26,28,28,17};
276 
278 
279 LE::LE(void) {
280 
284  m_signal_mask = 0;
285  m_lasttreat.resize(1);
286  m_lasttreat[0] = sleep_all_day;
287  m_lastindex = 0;
288  m_running = 0;
289  m_poison = false;
290  m_owner_file = -1;
291  m_owner_index = -1;
292  m_high = false;
293  m_cattle_grazing = 0;
294  m_default_grazing_level = 0; // this means any grazed elements must set this in their constructor.
295  m_pig_grazing = false;
296  m_yddegs = 0.0;
297  m_vegddegs = -1.0;
298  m_olddays = 0;
299  m_days_since_insecticide_spray = 0;
300  m_tramlinesdecay = 0;
301  m_mowndecay = 0;
302  m_herbicidedelay = 0;
303  m_border = NULL;
304  m_unsprayedmarginpolyref = -1;
305  m_valid_x = -1;
306  m_valid_y = -1;
307  m_is_in_map = false;
308  m_squares_in_map = 0;
309  m_management_loop_detect_date = 0;
310  m_management_loop_detect_count = 0;
311  m_repeat_start = false;
312  m_skylarkscrapes = false;
313  m_type = tole_Foobar;
314  SetALMaSSEleType(-1);
315  m_ddegs = 0.0;
316  m_maxx = -1; // a very small number
317  m_maxy = -1;
318  m_minx = 9999999; // a very big number
319  m_miny = 9999999;
320  m_countrydesignation = -1; // default not set
321  m_soiltype = -1;
322  m_area = 0;
323  m_centroidx = -1;
324  m_centroidy = -1;
325  m_vege_danger_store = -1;
326  m_PesticideGridCell = -1;
327  m_subtype = -1;
328  m_owner = NULL;
329  m_rot_index = -1;
330  m_poly = -1;
331  m_map_index = -1;
332  m_almass_le_type = -1;
333  m_farmfunc_tried_to_do = -1;
334  SetStubble(false);
335  m_birdseedforage = -1;
336  m_birdmaizeforage = -1;
337  m_openness = -1;
338  m_vegage = -1;
339  m_OsmiaNestProb = 0;
340  m_maxOsmiaNests = 0;
341  m_currentOsmiaNests = 0;
342  for (int i = 0; i<10; i++) SetMConstants(i, 1);
343  for (int i = 0; i < 366; i++)
344  {
345  m_gooseNos[i] = 0;
346  m_gooseNosTimed[i] = 0;
347  for (int l = 0; l < gs_foobar; l++)
348  {
349  m_gooseSpNos[i][l] = 0;
350  m_gooseSpNosTimed[i][l] = 0;
351  }
352  }
353  for (int l = 0; l < gs_foobar; l++)
354  {
355  m_goosegrazingforage[l] = 0;
356  }
357  for (int i = 0; i < 25; i++)
358  {
359  MDates[0][i] = -1;
360  MDates[1][i] = -1;
361  }
362  SetLastSownVeg(tov_Undefined);
363 #ifdef FMDEBUG
364  m_pindex = 0;
365  for ( int i = 0; i < 256; i++ ) {
366  m_pdates[ i ] = 0;
367  m_ptrace[ i ] = 0;
368  }
369 #endif
370 }
371 
372 void LE::DoCopy(const LE* a_LE) {
373 
377  m_signal_mask = a_LE->m_signal_mask;
378  m_lasttreat = a_LE->m_lasttreat;
379  m_lastindex = a_LE->m_lastindex;
380  m_running = a_LE->m_running;
381  m_poison = a_LE->m_poison;
382  m_owner_file = a_LE->m_owner_file;
383  m_owner_index = a_LE->m_owner_index;
384  m_high = a_LE->m_high;
385  m_cattle_grazing = a_LE->m_cattle_grazing;
386  m_default_grazing_level = a_LE->m_default_grazing_level; // this means any grazed elements must set this in their constructor.
387  m_pig_grazing = a_LE->m_pig_grazing;
388  m_yddegs = a_LE->m_yddegs;
389  m_olddays = a_LE->m_olddays;
390  m_vegddegs = a_LE->m_vegddegs;
391  m_days_since_insecticide_spray = a_LE->m_days_since_insecticide_spray;
392  m_tramlinesdecay = a_LE->m_tramlinesdecay;
393  m_mowndecay = a_LE->m_mowndecay;
394  m_herbicidedelay = a_LE->m_herbicidedelay;
395  m_border = a_LE->m_border;
396  m_unsprayedmarginpolyref = a_LE->m_unsprayedmarginpolyref;
397  m_valid_x = a_LE->m_valid_x;
398  m_valid_y = a_LE->m_valid_y;
399  m_is_in_map = a_LE->m_is_in_map;
400  m_squares_in_map = a_LE->m_squares_in_map;
401  m_management_loop_detect_date = a_LE->m_management_loop_detect_date;
402  m_management_loop_detect_count = a_LE->m_management_loop_detect_count;
403  m_repeat_start = a_LE->m_repeat_start;
404  m_skylarkscrapes = a_LE->m_skylarkscrapes;
405  m_type = a_LE->m_type;
406  m_birdseedforage = a_LE->m_birdseedforage;
407  m_birdmaizeforage = a_LE->m_birdmaizeforage;
408  m_ddegs = a_LE->m_ddegs;
409  m_maxx = a_LE->m_maxx;
410  m_maxy = a_LE->m_maxy;
411  m_minx = a_LE->m_minx;
412  m_miny = a_LE->m_miny;
413  m_countrydesignation = a_LE->m_countrydesignation;
414  m_soiltype = a_LE->m_soiltype;
415  m_area = a_LE->m_area;
416  m_centroidx = a_LE->m_centroidx;
417  m_centroidy = a_LE->m_centroidy;
418  m_vege_danger_store = a_LE->m_vege_danger_store;
419  m_PesticideGridCell = a_LE->m_PesticideGridCell;
420  m_subtype = a_LE->m_subtype;
421  m_owner = a_LE->m_owner;
422  m_rot_index = a_LE->m_rot_index;
423  m_poly = a_LE->m_poly;
424  m_map_index = a_LE->m_map_index;
425  m_almass_le_type = a_LE->m_almass_le_type;
426  m_farmfunc_tried_to_do = a_LE->m_farmfunc_tried_to_do;
427  m_openness = a_LE->m_openness;
428  m_vegage = a_LE->m_vegage;
429  for (int i = 0; i < 366; i++)
430  {
431  m_gooseNos[i] = a_LE->m_gooseNos[i];
432  m_gooseNosTimed[i] = a_LE->m_gooseNosTimed[i];
433  for (int l = 0; l < gs_foobar; l++)
434  {
435  m_gooseSpNos[i][l] = a_LE->m_gooseSpNos[i][l];
436  m_gooseSpNosTimed[i][l] = a_LE->m_gooseSpNosTimed[i][l];
437  }
438  }
439  for (int l = 0; l < gs_foobar; l++)
440  {
441  m_goosegrazingforage[l] = a_LE->m_goosegrazingforage[l];
442  }
443  for (int i = 0; i < 25; i++)
444  {
445  MDates[0][i] = a_LE->MDates[0][i];
446  MDates[1][i] = a_LE->MDates[1][i];
447  }
448  for (int i = 0; i<10; i++) SetMConstants(i, a_LE->MConsts[i]);
449 }
450 
451 
452 LE::~LE( void ) {
453 }
454 
455 
456 #ifdef FMDEBUG
457 void LE::Trace( int a_value ) {
458  m_farmfunc_tried_to_do = a_value;
459 #ifdef __RECORDFARMEVENTS
460  g_landscape_p->RecordEvent(a_value, g_date->DayInYear(), g_date->GetYearNumber());
461 #endif
462  m_pdates[ m_pindex ] = g_date->DayInYear();
463  m_ptrace[ m_pindex++ ] = a_value;
464  m_pindex &= 0xff; // Circular buffer if need be.
465 }
466 
467 void LE::ResetTrace( void ) {
468  m_pindex = 0;
469  for ( int i = 0; i < 256; i++ ) {
470  m_pdates[ i ] = 0;
471  m_ptrace[ i ] = 0;
472  }
473 }
474 
475 #else
476 // Compiles into nothing if FMDEBUG is #undef.
477 void LE::Trace( int a_value ) {
478  m_farmfunc_tried_to_do = a_value;
479 }
480 
481 void LE::ResetTrace( void ) {
482 }
483 
484 #endif
485 
486 void LE::SetCopyTreatment( int a_treatment ) {
487  SetLastTreatment( a_treatment );
488 }
489 
490 void LE::SetLastTreatment( int a_treatment ) {
491  unsigned sz = (int) m_lasttreat.size();
492  if ( m_lastindex == sz )
493  m_lasttreat.resize( m_lastindex + 1 );
494 
495  m_lasttreat[ m_lastindex++ ] = a_treatment;
496 
497  // Count this treatment in the grand scope of things.
498  g_landscape_p->IncTreatCounter( a_treatment );
499  // If we have a field margin then we need to tell it about this
500  // but not if it is an insecticide spray etc..
501  /* if (m_unsprayedmarginpolyref!=-1) { switch (a_treatment) { case herbicide_treat: case growth_regulator:
502  case fungicide_treat: case insecticide_treat: case trial_insecticidetreat: case syninsecticide_treat: case molluscicide:
503  break; // Do not add sprayings default: LE* le=g_landscape_p->SupplyLEPointer(m_unsprayedmarginpolyref);
504  le->SetCopyTreatment(a_treatment); // Now we also need to do something with the treatment
505 
506  break; }
507 
508  } */
509 }
510 
511 int LE::GetLastTreatment( int * a_index ) {
512  if ( * a_index == ( int )m_lastindex )
513  return sleep_all_day;
514  int i = ( * a_index ) ++;
515  int treat = m_lasttreat[ i ];
516  return treat;
517 }
518 
519 void LE::Tick( void ) {
520  m_lastindex = 0;
521  m_lasttreat[ 0 ] = sleep_all_day;
522  if ( m_tramlinesdecay > 0 )
523  m_tramlinesdecay--;
524  if ( m_mowndecay > 0 )
525  m_mowndecay--;
526  if ( m_herbicidedelay > 0 ) m_herbicidedelay--;
527 }
528 
529 
530 
531 void LE::DoDevelopment( void ) {
532 }
533 
534 APoint LE::GetCentroid()
535 {
536  APoint p;
537  p.m_x=m_centroidx;
538  p.m_y=m_centroidy;
539  return p;
540 }
541 
547  int geese = 0;
548  for (unsigned i = 1; i <= (unsigned)cfg_goosecountperiod.value( ); i++) {
549  unsigned ind = ((unsigned)g_date->DayInYear( ) - i) % 365;
550  geese += m_gooseNos[ ind ];
551  }
552  return geese;
553 }
554 
560  int geese = 0;
561  for (unsigned i = 1; i <= (unsigned)cfg_goosecountperiod.value(); i++) {
562  unsigned ind = ((unsigned)g_date->DayInYear() - i) % 365;
563  geese += m_gooseSpNos[ind][gs_Pinkfoot];
564  geese += m_gooseSpNos[ind][gs_Greylag];
565  }
566  return geese;
567 }
568 
573  int geese = 0;
574  for (unsigned i = 0; i < (unsigned)gs_foobar; i++) {
575  geese += m_gooseSpNos[g_date->DayInYear()][i];
576  }
577  return geese;
578 }
579 
584  int geese = 0;
585  for (unsigned i = 0; i < (unsigned)gs_foobar; i++) {
586  geese += m_gooseSpNosTimed[g_date->DayInYear()][i];
587  }
588  return geese;
589 }
590 
592 int LE::GetGooseSpNosToday(GooseSpecies a_goose) {
593  return m_gooseSpNos[g_date->DayInYear()][a_goose];
594 }
595 
597 int LE::GetGooseSpNosTodayTimed(GooseSpecies a_goose) {
598  return m_gooseSpNosTimed[g_date->DayInYear()][a_goose];
599 }
601 int LE::GetGooseRoostDist(GooseSpecies a_goose) {
602  return int(m_dist_to_closest_roost[a_goose]);
603 }
604 
605 void LE::SetPollenNectarData(int a_almasstype) {
607  m_pollenquality.m_quality = m_pollencurve->GetData(365);
608  m_nectarquality.m_quality = m_nectarcurve->GetData(365);
609  m_totalPollen = 0.0;
610  m_totalNectar = 0.0;
611 }
612 //---------------------------------------------------------------------------
613 //---------------------------------------------------------------------------
614 
616  SetVegPatchy(false);
617  m_growth_scaler = 1.0; // default
618  m_veg_biomass = 0.0;
619  m_weed_biomass = 0.0;
620  m_veg_height = 0.0;
621  m_veg_cover = 0.0;
622  m_insect_pop = 1.0;
625  m_weed_curve_num = 99; // 99 used as zero growth curve
626  m_yddegs = 0.0;
627  m_vegddegs = -1.0;
628  m_ddegs = 0.0;
629  m_LAgreen = 0.0;
630  m_LAtotal = 0.0;
631  m_digestability = 1.0;
632  for (int i = 0; i < 32; i++) m_oldnewgrowth[i] = 0.5;
634  m_newgrowthsum = 8.0;
635  m_forced_phase_shift = false;
636  m_force_growth = false;
638  m_total_biomass = 0.0;
639  m_total_biomass_old = 0.0;
640 
641 
642 
643  g_biomass_scale[tov_Carrots] = 0.7857;
647  g_biomass_scale[ tov_BroadBeans ] = 0.857;
648  g_biomass_scale[ tov_FieldPeas ] = 0.857;
653  g_biomass_scale[tov_Maize] = 1.00;
656  g_biomass_scale[tov_NaturalGrass] = 0.567; //0.567 is scaled for actual yield
657  g_biomass_scale[tov_Heath] = 0.567; //0.567 is scaled for actual yield
659  g_biomass_scale[tov_None] = 0.0;
661  g_biomass_scale[tov_Oats] = 0.857;
663  g_biomass_scale[tov_OSBarleySilage] = 0.857 * 0.8;
664  g_biomass_scale[tov_OCarrots] = 0.7857 * 0.8;
668  g_biomass_scale[tov_OFieldPeas] = 0.857 * 0.8;
669  g_biomass_scale[tov_OFieldPeasSilage] = 0.857 * 0.8;
671  g_biomass_scale[tov_OGrazingPigs] = 0.7857 * 0.8;
672  g_biomass_scale[tov_OOats] = 0.857 * 0.8;
674  g_biomass_scale[tov_OPotatoes] = 0.857 * 0.8;
677  g_biomass_scale[tov_OSetaside] = 0.7857;
678  g_biomass_scale[tov_OSpringBarley] = 0.857 * 0.8;
679  g_biomass_scale[tov_OSpringBarleyExt] = 0.857 * 0.8 * 0.8;
682  g_biomass_scale[tov_OSpringBarleyPigs] = 0.857 * 0.8;
683  g_biomass_scale[tov_OTriticale] = 1.00 * 0.8;
684  g_biomass_scale[tov_OWinterBarley] = 0.857 * 0.8;
685  g_biomass_scale[tov_OWinterBarleyExt] = 0.857 * 0.8 * 0.8;
686  g_biomass_scale[tov_OWinterRape] = 1.071 * 0.8;
687  g_biomass_scale[tov_OWinterRye] = 0.857 * 0.8;
688  g_biomass_scale[ tov_OWinterWheat ] = 1.00 * 0.8;
690  g_biomass_scale[ tov_OWinterWheatUndersownExt ] = 1.00 * 0.8 * 0.8;
695  g_biomass_scale[tov_Potatoes] = 0.857;
701  g_biomass_scale[tov_Setaside] = 0.7857;
716  g_biomass_scale[tov_WinterWheat] = 1.00; // This gives approx 18 tonnes biomass for WW
735  g_biomass_scale[tov_YoungForest] = 0.7857 * 0.67;
736  g_biomass_scale[tov_Wasteland] = 0.7857 * 0.67;
738 
749  g_biomass_scale[tov_PLBeet] = 0.857;
752  g_biomass_scale[tov_PLCarrots] = 0.7857;
756  g_biomass_scale[tov_PLBeans] = 0.857;
757 
762  g_biomass_scale[tov_NLBeet] = 0.857;
763  g_biomass_scale[tov_NLCarrots] = 0.7857;
764  g_biomass_scale[tov_NLCabbage] = 0.7857;
765  g_biomass_scale[tov_NLTulips] = 0.7857;
778 
779 
780  g_biomass_scale[tov_DummyCropPestTesting] = 1.00; // just for testing of pesticide spraying distribution
781 
783  //ReadBugPercentageFile();
784  return;
785  }
786 
789  g_weed_percent[ tov_Maize ] = 0.05;
829  g_weed_percent[tov_OOats] = 0.1;
830  g_weed_percent[tov_Oats] = 0.1;
831  g_weed_percent[tov_Heath] = 0.1;
833  g_weed_percent[ tov_FieldPeas ] = 0.1;
850  g_weed_percent[tov_None] = 0.1;
875 
886  g_weed_percent[tov_PLBeet] = 0.1;
894 
899  g_weed_percent[tov_NLBeet] = 0.1;
915 
1007 
1026 
1047 
1048 
1136 
1155 
1176 
1264 
1283 
1304 
1391 
1410 
1431 
1432 
1433  //05.03.13 - modifications for farmer decision making, AM
1436  m_crop_index = 0;
1437 }
1438 
1440  FILE* lm_ifile=fopen(l_el_bug_percentage_file.value(), "r" );
1441  if ( !lm_ifile ) {
1442  g_msg->Warn( WARN_FILE, "PlantGrowthData::ReadBugPercentageFile(): Unable to open file", l_el_bug_percentage_file.value() );
1443  exit( 1 );
1444  }
1445  for ( int i = 0; i < tov_Undefined; i++ ) {
1446  int vegnum;
1447  // **cjt** modified 31/01/2004
1448  float weedpercent, bugpercent_a, bugpercent_b, bugpercent_c, bugpercent_d;
1449  if ( 2 != fscanf( lm_ifile, "%d %f %f %f %f %f", & vegnum, & weedpercent, & bugpercent_a, & bugpercent_b,
1450  & bugpercent_c, & bugpercent_d ) ) {
1451  char vegnums[ 20 ];
1452  sprintf( vegnums, "%d", tov_Undefined );
1453  g_msg->Warn( WARN_FILE,
1454  "VegElement::ReadBugPercentageFile(): Unable to read"
1455  " sufficient number of int/double pairs from bug percentage file."" Lines expected:", vegnums );
1456  exit( 1 );
1457  }
1458  FloatToDouble( g_weed_percent[ vegnum ], weedpercent);
1459  FloatToDouble( g_bug_percent_a[ vegnum ] , bugpercent_a);
1460  FloatToDouble( g_bug_percent_b[ vegnum ] , bugpercent_b);
1461  FloatToDouble( g_bug_percent_c[ vegnum ] , bugpercent_c);
1462  FloatToDouble( g_bug_percent_d[ vegnum ] , bugpercent_d);
1463  }
1464  fclose( lm_ifile );
1465 }
1466 
1468 {
1469  // NB Maize here is classed as cereal
1470  switch (m_lastsownvegtype)
1471  {
1472  case tov_SpringBarley:
1473  case tov_SpringBarleySpr:
1474  case tov_WinterBarley:
1475  case tov_SpringWheat:
1476  case tov_WinterWheat:
1477  case tov_WinterRye:
1478  case tov_Oats:
1479  case tov_Triticale:
1480  case tov_SpringBarleySeed:
1487  case tov_OWinterBarley:
1488  case tov_OWinterBarleyExt:
1489  case tov_OWinterRye:
1490  case tov_SpringBarleyGrass:
1494  case tov_OSpringBarley:
1495  case tov_OSpringBarleyPigs:
1497  case tov_OWinterWheat:
1498  case tov_OOats:
1499  case tov_OTriticale:
1500  case tov_WWheatPControl:
1502  case tov_WWheatPTreatment:
1506  case tov_OSpringBarleyExt:
1508  case tov_OSBarleySilage:
1510  case tov_PLWinterWheat:
1511  case tov_PLWinterBarley:
1512  case tov_PLWinterRye:
1513  case tov_PLWinterTriticale:
1514  case tov_PLSpringWheat:
1515  case tov_PLSpringBarley:
1516  case tov_PLSpringBarleySpr:
1517  case tov_PLWinterWheatLate:
1518  case tov_PLMaize:
1519  case tov_PLMaizeSilage:
1520  case tov_Maize:
1521  case tov_MaizeSilage:
1522  case tov_MaizeStrigling:
1523  case tov_NLSpringBarley:
1524  case tov_NLWinterWheat:
1525  case tov_NLMaize:
1527  case tov_NLMaizeSpring:
1528  return true;
1529  default: // No matching code so is should not be cereal
1530  return false;
1531  }
1532 }
1533 
1535 {
1536  switch (m_vege_type)
1537  {
1538  case tov_SpringBarley:
1539  case tov_SpringBarleySpr:
1540  case tov_WinterBarley:
1541  case tov_SpringWheat:
1542  case tov_WinterWheat:
1543  case tov_WinterRye:
1544  case tov_Oats:
1545  case tov_Triticale:
1546  case tov_SpringBarleySeed:
1553  case tov_OWinterBarley:
1554  case tov_OWinterBarleyExt:
1555  case tov_OWinterRye:
1556  case tov_SpringBarleyGrass:
1559  case tov_OSpringBarley:
1560  case tov_OSpringBarleyPigs:
1562  case tov_OWinterWheat:
1563  case tov_OOats:
1564  case tov_OTriticale:
1565  case tov_WWheatPControl:
1567  case tov_WWheatPTreatment:
1571  case tov_OSpringBarleyExt:
1574  case tov_PLWinterWheat:
1575  case tov_PLWinterBarley:
1576  case tov_PLWinterRye:
1577  case tov_PLWinterTriticale:
1578  case tov_PLSpringWheat:
1579  case tov_PLSpringBarley:
1580  case tov_PLSpringBarleySpr:
1581  case tov_PLWinterWheatLate:
1582  case tov_NLSpringBarley:
1583  case tov_NLWinterWheat:
1585  return true;
1586  default: // No matching code so is should not be mature cereal
1587  return false;
1588  }
1589 }
1590 
1592 {
1594  switch (m_vege_type)
1595  {
1596  case tov_Maize:
1597  case tov_OMaizeSilage:
1598  case tov_MaizeSilage:
1599  case tov_PLMaize:
1600  case tov_PLMaizeSilage:
1601  case tov_NLMaize:
1602  case tov_NLMaizeSpring:
1603  return true;
1604  default: // No matching code so is should not be maize
1605  return false;
1606  }
1607 }
1608 
1609 
1610 inline bool VegElement::IsGrass()
1611 {
1612  switch (m_vege_type)
1613  {
1614  case tov_NaturalGrass:
1618  case tov_PermanentSetaside:
1619  case tov_Setaside:
1620  case tov_SeedGrass1:
1621  case tov_SeedGrass2:
1622  case tov_OSeedGrass1:
1623  case tov_OSeedGrass2:
1628  case tov_OrchardCrop:
1629  case tov_YoungForest:
1630  case tov_FodderGrass:
1631  case tov_Heath:
1632  case tov_PLFodderLucerne1:
1633  case tov_PLFodderLucerne2:
1634  case tov_NLGrassGrazed1:
1636  case tov_NLGrassGrazed2:
1638  case tov_WaterBufferZone:
1639  return true;
1640  default: return false;
1641  }
1642 }
1643 
1645  switch (m_vege_type) {
1646  case tov_NaturalGrass:
1650  return true;
1651  default: break;
1652  }
1653  switch (m_lastsownvegtype) {
1654  case tov_SeedGrass1:
1655  case tov_SeedGrass2:
1656  case tov_OSeedGrass1:
1657  case tov_OSeedGrass2:
1662  case tov_FodderGrass:
1663  case tov_PLFodderLucerne1:
1664  case tov_PLFodderLucerne2:
1665  case tov_NLGrassGrazed1:
1667  case tov_NLGrassGrazed2:
1669  return true;
1670  default:
1671  return false;
1672  }
1673 
1674 }
1675 
1676 
1677 
1681  double newgrowth = 0;
1682  m_veg_cover = 1.0 - (exp(m_LAtotal * -0.6)); // Beer's Law to give cover
1683  double usefull_veg_cover = 1.0 - (exp(m_LAgreen * -0.4)); // This is used to calc growth rate
1684  // Need gloabal radiation today
1685  double glrad = g_landscape_p->SupplyGlobalRadiation();
1686  // This is different for maize (a C4 plant)
1687  int ptype;
1688  if ((m_vege_type == tov_Maize) || (m_vege_type == tov_OMaizeSilage) || (m_vege_type == tov_MaizeSilage) || (m_vege_type == tov_MaizeStrigling)) ptype = 1; else ptype = 0;
1689  int index = (int)floor(0.5 + g_landscape_p->SupplyTemp()) + 30; // There are 30 negative temps
1690  double radconv = c_SolarConversion[ptype][index];
1691  if (m_LAtotal >= m_oldLAtotal) {
1692  // we are in positive growth so grow depending on our equation
1693  newgrowth = usefull_veg_cover * glrad * radconv * g_biomass_scale[m_vege_type];
1694  if (m_owner_index != -1) { // This only works because only crops and similar structures have owners
1695  int fintensity = g_landscape_p->SupplyFarmIntensity(m_poly);
1696  if (fintensity == 1) {
1697  // 1 means extensive, so reduce vegetation biomass by 20%
1698  // NB this cannot be used with extensive crop types otherwise you get an additional 20% reduction
1699  // This way of doing things provides a quick and dirty general effect.
1700  m_veg_biomass += newgrowth * 0.8;
1701  }
1702  else m_veg_biomass += newgrowth;
1703  }
1704  else m_veg_biomass += newgrowth;
1705  }
1706  else {
1707  // Negative growth - so shrink proportional to the loss in LAI Total
1708  if (m_oldLAtotal > 0) {
1710  }
1711  }
1715  // NB The m_weed_biomass is calculated directly from the curve in Curves.pre
1716  // rather than going through the rigmorole of converting leaf-area index
1717 
1718  // Another thing to do is to calculate mean vegetation digestability
1719  // This is a 32-day running average of the amount of new growth per day divided by veg biomass
1720  // With a minimum value of 0.5
1721  ++m_newoldgrowthindex &= 31;
1722  if (m_veg_biomass > 0) {
1723  switch (m_vege_type) {
1724  case tov_NoGrowth:
1725  case tov_None:
1726  case tov_OFirstYearDanger:
1727  m_digestability = 0.0;
1728  break;
1729  case tov_OPotatoes:
1730  case tov_Maize:
1731  case tov_MaizeSilage:
1732  case tov_OMaizeSilage:
1733  case tov_MaizeStrigling:
1734  case tov_Potatoes:
1735  case tov_PotatoesIndustry:
1736  case tov_PLMaize:
1737  case tov_PLMaizeSilage:
1738  case tov_PLPotatoes:
1739  case tov_NLMaize:
1740  case tov_NLPotatoes:
1741  case tov_NLMaizeSpring:
1742  case tov_NLPotatoesSpring:
1743  m_digestability = 0.5;
1744  break;
1745  default:
1746  //m_oldnewgrowth[m_newoldgrowthindex]=(newgrowth/m_veg_biomass);
1747  m_oldnewgrowth[m_newoldgrowthindex] = (newgrowth);
1748  m_newgrowthsum = 0.0;
1749  for (int i = 0; i < 32; i++) {
1751  }
1753  m_digestability += 0.5;
1754  if (m_digestability > 0.8) m_digestability = 0.8;
1755  }
1756  }
1757  else {
1759  m_digestability = 0.0;
1760  }
1761  // The insect calculation part
1762  // Bugmass = a + b(biomass) + c(height)
1763  double temp_bugmass = //g_bug_percent_d[ m_vege_type ] // This was used as a scaler - now not used
1766  // Set a minimum value (regressions will otherwise sometimes give a -ve value
1767  if (temp_bugmass < 0.05) temp_bugmass = 0.05;
1768  // Now need to check for deviations caused by management
1769  // First spot the deviation - this is easy because the only deviation that does
1770  // not affect the vegetation too is insecticide spraying
1772  // Need to change insects still, so grow towards the target, but only when 21 days from zero effect
1775  }
1776  else {
1777  m_insect_pop = temp_bugmass;
1778  }
1779  m_veg_density = (int)(floor(0.5 + (m_veg_biomass / (1 + m_veg_height))));
1780  if (m_veg_density > 100) m_veg_density = 100; // to stop array bounds problems
1781  if (m_LAtotal == 0.0) m_green_biomass = 0.0;
1788 }
1789 
1791 {
1797  int today = g_date->DayInYear();
1798  //need to store the correct pollen curve for fast look-up - this can be a pointer directly to the correct curve - avoiding the problem of tov vs tole
1800  m_NectarM2 = m_pollencurve->GetData(today);
1801  m_totalPollen = double(m_area) * m_PollenM2;
1802  m_totalNectar = double(m_area) * m_NectarM2;
1803 }
1804 
1806 {
1807  // For geese that eat spilled grain and maize we need to remove some of this daily (loss to other things than geese)
1808  // Get the Julian day
1809  int day = g_date->DayInYear();
1810  double rate;
1811  if ((day > March) && (day < July)) rate = cfg_goose_GrainDecayRateSpring.value();
1812  else rate = cfg_goose_GrainDecayRateWinter.value();
1813  m_birdseedforage *= rate;
1814  if (m_birdseedforage < 0.01) m_birdseedforage = 0.0;
1815  m_birdmaizeforage *= rate;
1816  if (m_birdmaizeforage < 0.01) m_birdmaizeforage = 0.0;
1817  // We also need to calculate non-grain forage for geese
1818  if (IsCereal()) {
1819  //if (m_green_biomass > 0.5) //Testing if this could be a suitable fix for the cereals
1820  //{
1821  for (unsigned i = 0; i < gs_foobar; i++) {
1824  }
1825  //}
1826  //else for (unsigned i = 0; i < gs_foobar; i++) {
1827  // m_goosegrazingforage[i] = 0.0;
1828  //}
1829  //m_goosegrazingforage[gs_foobar] = 1; // Is cereal
1830  }
1832  else {
1833  if (IsGooseGrass()) {
1834  for (unsigned i = 0; i < gs_foobar; i++) {
1835  //m_goosegrazingforage[ i ] = 0.0;
1837  }
1838  }
1839  else for (unsigned i = 0; i < gs_foobar; i++) m_goosegrazingforage[i] = 0.0;
1840  }
1841 }
1842 
1843 void VegElement::RandomVegStartValues( double * a_LAtotal, double * a_LAgreen, double * a_veg_height, double * a_weed_biomass ) {
1844  * a_LAtotal = EL_VEG_START_LAIT * ( ( ( ( double )( random( 21 ) - 10 ) ) / 100.0 ) + 1.0 ); // +/- 10%
1845  * a_LAgreen = * a_LAtotal / 4.0;
1846  * a_veg_height = * a_LAgreen * EL_VEG_HEIGHTSCALE;
1847  * a_weed_biomass = * a_LAgreen * 0.1; // 10% weeds by biomass
1848 }
1849 
1850 
1851 void VegElement::SetGrowthPhase(int a_phase) {
1852 
1853  if (a_phase == sow) {
1854  m_vegddegs = 0.0;
1855  }
1856  else if (a_phase == harvest) m_vegddegs = -1;
1857  if (a_phase == janfirst) {
1858  m_forced_phase_shift = false;
1863  if (g_crops->StartValid(m_curve_num, a_phase)) {
1864  double temp_veg_height = g_crops->GetStartValue(m_curve_num, a_phase, 2);
1865  if (temp_veg_height < m_veg_height) { // Otherwise we are better off with the numbers we have to start with
1866  // Now with added variability
1867  m_LAgreen = g_crops->GetStartValue(m_curve_num, a_phase, 0);
1868  m_LAtotal = g_crops->GetStartValue(m_curve_num, a_phase, 1);
1870  }
1871  }
1872 
1873  }
1874  else if (g_crops->StartValid(m_curve_num, a_phase)) {
1875  m_LAgreen = g_crops->GetStartValue(m_curve_num, a_phase, 0);
1876  m_LAtotal = g_crops->GetStartValue(m_curve_num, a_phase, 1);
1878  }
1879  else if (!m_force_growth) {
1880  // If we are in forced growth mode (which is very likely),
1881  // then do not choose a new set of starting values, as we have
1882  // already calculated our way to a reasonable set of values.
1883  //RandomVegStartValues( & m_LAtotal, & m_LAgreen, & m_veg_height, & m_weed_biomass ); // **CJT** Testing removal 17/02/2015
1884  }
1885  m_veg_phase = a_phase;
1886  m_yddegs = 0.0;
1888  m_force_growth = false;
1889 
1890  if (m_veg_phase == janfirst) {
1891  // For some growth curves there is no growth in the first
1892  // two months of the year. This will more likely than
1893  // not cause a discontinuous jump in the growth curves
1894  // come March first. ForceGrowthSpringTest() tries
1895  // to avoid that by checking for positive growth values
1896  // for the January growth phase. If none are found, then
1897  // it initializes a forced growth/transition to the March
1898  // 1st starting values.
1899  ForceGrowthSpringTest(); // Removal of this causes continuous increase in vegetation growth year on year for any curve that does not have a hard reset (e.g. harvest).
1900  }
1901 }
1902 
1903 
1905  // Called whenever the farmer does something 'destructive' to a
1906  // field, that reduced the vegetaion.
1907  if ( g_date->DayInYear() >= g_date->DayInYear( 1, 11 )
1908  || ( g_date->DayInYear() < g_date->DayInYear( 1, 3 ) && m_force_growth ) ) {
1910  }
1911 }
1912 
1913 
1914 
1916  // Check if there are any positive growth differentials in the curve
1917  // for the first two months of the year. Do nothing if there is.
1918  // If we have any positive growth then no need to force either
1919  if (g_crops->GetLAgreenDiff(90000.0, 0.0, m_curve_num, janfirst) > 0.001
1920  || g_crops->GetLAtotalDiff(90000.0, 0.0, m_curve_num, janfirst) > 0.001
1921  || g_crops->GetHeightDiff(90000.0, 0.0, m_curve_num, janfirst) > 0.001) {
1922  return;
1923  }
1924  // No growth, force it.
1926 }
1927 
1928 
1929 
1931  double LAgreen_target;
1932  double Weed_target;
1933  double LAtotal_target;
1934  double veg_height_target;
1935  int next_phase, daysleft;
1936 
1937  // Figure out what our target phase is.
1938  if ( g_date->DayInYear() < g_date->DayInYear( 3, 1 ) ) {
1939  daysleft = g_date->DayInYear( 1, 3 ) - g_date->DayInYear();
1940  next_phase = marchfirst;
1941  } else if ( g_date->DayInYear() >= g_date->DayInYear( 1, 11 ) ) {
1942  daysleft = 366 - g_date->DayInYear(); // Adjusted from 365 to prevent occaisional negative values
1943  next_phase = janfirst;
1944  } else {
1945  return;
1946  }
1947  if ( daysleft <= 0 )
1948  // Uh! Oh! This really shouldn't happen.
1949  return;
1950 
1951  if ( !g_crops->StartValid( m_curve_num, next_phase ) ) {
1952  // If no valid starting values for next phase, then
1953  // preinitialize the random starting values! Ie. make the
1954  // choice here and then do not choose another set come
1955  // next phase transition, but use the values we already
1956  // got at that point in time.
1957  RandomVegStartValues( & LAtotal_target, & LAgreen_target, & veg_height_target, & Weed_target );
1958  }
1959  else {
1960  //add +/- 20% variation
1961  double vari = (g_rand_uni() * 0.4) + 0.8;
1962  Weed_target = g_crops->GetStartValue(m_weed_curve_num, next_phase, 0) * vari;
1963  LAgreen_target = g_crops->GetStartValue(m_curve_num, next_phase, 0) * vari;
1964  LAtotal_target = g_crops->GetStartValue(m_curve_num, next_phase, 1) * vari;
1965  veg_height_target = g_crops->GetStartValue(m_curve_num, next_phase, 2) * vari;
1966  }
1967 
1968  m_force_growth = true;
1969  m_force_Weed = ( Weed_target - m_weed_biomass ) / ( double )daysleft;
1970  m_force_LAgreen = ( LAgreen_target - m_LAgreen ) / ( double )daysleft;
1971  m_force_LAtotal = ( LAtotal_target - m_LAtotal ) / ( double )daysleft;
1972  m_force_veg_height = ( veg_height_target - m_veg_height ) / ( double )daysleft;
1973 }
1974 
1975 
1977  //if ( m_herbicidedelay == 0 ) m_weed_biomass += m_force_Weed; // ***CJT*** 12th Sept 2008 - rather than force growth, weeds might be allowed to grow on their own
1981 
1982  if (m_LAgreen < 0) m_LAgreen = 0;
1983  if (m_LAtotal < 0) m_LAtotal = 0;
1984  if (m_veg_height < 0) m_veg_height = 0;
1985 }
1986 
1987 
1988 
1989 void VegElement::ZeroVeg( void ) {
1990  m_LAgreen = 0.0;
1991  m_LAtotal = 0.0;
1992  m_veg_height = 0.0;
1993  m_veg_cover = 0.0;
1994  m_veg_biomass = 0.0;
1995  m_weed_biomass = 0.0;
1996  m_birdseedforage = 0.0;
1997  m_birdmaizeforage = 0.0;
1998  SetStubble(false);
1999  ForceGrowthTest();
2001 }
2002 
2003 
2005  if (!m_force_growth) {
2006  //** First does the day degree calculations */
2007  m_yddegs = m_ddegs;
2009  if (m_vegddegs != -1.0) m_vegddegs += m_ddegs; // Sum up the vegetation day degrees since sowing
2010  m_ddegs += m_yddegs; // and sum up the phase ddegs
2011 
2015 
2016  m_LAgreen += dLAG;
2017  if (m_LAgreen < 0.0)
2018  m_LAgreen = 0.0;
2019  m_LAtotal += dLAT;
2020  if (m_LAtotal < 0.0)
2021  m_LAtotal = 0.0;
2022  int fintensity = 0;
2023 #ifdef __EXTSHRINKSHEIGHT
2024  if (this->m_owner_index != -1) { // This only works because only crops and similar structures have owners
2025  fintensity = g_landscape_p->SupplyFarmIntensity(m_poly);
2026  if (fintensity == 1) {
2027  // 1 means extensive, so reduce vegetation height change by 10%
2028  dHgt *= 0.9;
2029  }
2030  }
2031 #endif
2032  m_veg_height += dHgt;
2033  if (m_veg_height < 0.0) m_veg_height = 0.0;
2035  if (m_herbicidedelay == 0) {
2037  m_weed_biomass += dWee * cfg_ele_weedscaling.value()* (1 + fintensity);
2038  }
2039  if (m_weed_biomass < 0.0) m_weed_biomass = 0.0;
2040  }
2041  else {
2043  }
2046  ResetGeese();
2047 }
2049  m_gooseNos[ g_date->DayInYear() ] = 0;
2050  for (unsigned i = 0; i < gs_foobar; i++) {
2051  m_gooseSpNos[ g_date->DayInYear() ][ (GooseSpecies)i ] = 0;
2052  m_gooseSpNosTimed[ g_date->DayInYear() ][ (GooseSpecies)i ] = 0;
2053  }
2054 }
2055 
2056 void VegElement::GrazeVegetationTotal( double a_grams )
2057 {
2058  GrazeVegetation( a_grams/m_area, true );
2059 }
2060 
2061 void VegElement::GrazeVegetation( double a_reduc, bool a_force )
2062 {
2074  if (!a_force) a_reduc *= m_default_grazing_level;
2075  if (a_reduc >= m_veg_biomass) return;
2076  double propreduc = 1.0 - (a_reduc / m_veg_biomass);
2077  m_veg_height *= propreduc;
2078  m_weed_biomass *= propreduc;
2079  m_veg_biomass -= a_reduc;
2080  // Need to do something with the LA too -
2081  m_LAgreen *= propreduc;
2082  m_LAtotal *= propreduc;
2083  m_oldLAtotal = m_LAtotal; // this stops double reduction of biomass later in RecalculateBugsNStuff();
2084 }
2085 
2086 void VegElement::ReduceVeg(double a_reduc) {
2087  m_LAgreen *= a_reduc;
2088  m_LAtotal *= a_reduc;
2089  m_veg_height *= a_reduc;
2090  m_veg_biomass *= a_reduc;
2091  m_weed_biomass *= a_reduc;
2092 
2093  ForceGrowthTest();
2094  m_oldLAtotal = m_LAtotal; // this stops double reduction of biomass later in RecalculateBugsNStuff();
2095 }
2096 
2097 void VegElement::ReduceVeg_Extended(double a_reduc) {
2098  m_LAgreen *= a_reduc;
2099  m_LAtotal *= a_reduc;
2100  m_veg_height *= a_reduc;
2101  m_veg_biomass *= a_reduc;
2102  m_weed_biomass *= a_reduc;
2103 
2104  if ( a_reduc < EL_GROWTH_PHASE_SHIFT_LEVEL ) {
2105  m_yddegs = 0.0;
2107  }
2108 
2111  m_forced_phase_shift = true;
2112  }
2113 
2114  ForceGrowthTest();
2115  m_oldLAtotal = m_LAtotal; // this stops double reduction of biomass later in RecalculateBugsNStuff();
2116 }
2117 
2118 //---------------------------------------------------------------------------
2119 //---------------------------------------------------------------------------
2120 
2121 
2123  m_type = tole_Field;
2125 }
2126 
2127 
2128 
2130  //05.03.13 AM
2132 
2133  m_CropDataStorage[index].taken = false;
2136  m_CropDataStorage[index].harvested = false;
2137  m_CropDataStorage[index].area = 0;
2138  m_CropDataStorage[index].no_herb_app = 0;
2140  m_CropDataStorage[index].no_fi_app = 0;
2141  m_CropDataStorage[index].missed_fi_app = 0;
2142 }
2143 
2145 {
2146  m_vege_type = a_vege_type;
2147  m_curve_num = g_crops->VegTypeToCurveNum(a_vege_type);
2148  // -1 is used as a signal not to change the weed type
2149  // this is because it may be specific to that field
2150  if (a_weed_type != tov_Undefined) m_weed_curve_num = a_weed_type;
2152  if (m_unsprayedmarginpolyref != -1) {
2153  // Must have an unsprayed margin so need to pass the information on to it
2155  dynamic_cast<VegElement*>(um)->SetPollenNectarCurves(m_pollencurve, m_nectarcurve);
2156  }
2157 }
2158 
2159 
2160 void Field::DoDevelopment( void ) {
2162  SetSprayedToday(false); // Reset the overspray flag in case it is set
2163  // Now if we have an unsprayed field margin, we need to transfer the crop
2164  // data to it.
2165  if ( GetUnsprayedMarginPolyRef() != -1 ) {
2172  }
2173 }
2174 
2175 
2177  return m_owner->GetPreviousCrop(a_index);
2178 }
2179 
2180 
2181 void VegElement::SetCropData( double a_veg_height, double a_LAtotal, double a_LAgreen, TTypesOfVegetation a_veg,
2182  double a_cover, int a_grazed ) {
2183  m_veg_height = a_veg_height;
2184  m_LAtotal = a_LAtotal;
2185  m_LAgreen = a_LAgreen;
2186  m_vege_type = a_veg;
2187  m_veg_cover = a_cover;
2188  m_cattle_grazing = a_grazed;
2189 }
2190 
2191 void VegElement::SetCropDataAll( double a_veg_height, double a_biomass, double a_LAtotal, double a_LAgreen,
2192  TTypesOfVegetation a_veg, double a_wb, double a_cover, int a_grazed, double a_ins, bool a_patchy, double a_dens ) {
2193  m_veg_height = a_veg_height;
2194  m_veg_biomass = a_biomass;
2195  m_LAtotal = a_LAtotal;
2196  m_LAgreen = a_LAgreen;
2197  m_vege_type = a_veg;
2198  m_weed_biomass = a_wb;
2199  m_veg_cover = a_cover;
2200  m_cattle_grazing = a_grazed;
2201  m_insect_pop = a_ins;
2202  m_veg_density = (int) a_dens;
2203  m_veg_patchy = a_patchy;
2204 }
2205 
2206 void VegElement::InsectMortality( double a_fraction ) {
2207  m_insect_pop *= a_fraction;
2208 }
2209 
2211  // Vegetation type set by the farm manager.
2213  m_veg_patchy = false;
2215  m_growth_scaler = (g_rand_uni() * (cfg_PermanentVegGrowthMaxScaler.value() - cfg_PermanentVegGrowthMinScaler.value())) + cfg_PermanentVegGrowthMinScaler.value(); // Scales growth stochastically in a range given by the configs
2216 }
2217 
2219  // Vegetation type set by the farm manager.
2221  m_veg_patchy = false;
2223  m_growth_scaler = (g_rand_uni() * (cfg_PermanentVegGrowthMaxScaler.value() - cfg_PermanentVegGrowthMinScaler.value())) + cfg_PermanentVegGrowthMinScaler.value(); // Scales growth stochastically in a range given by the configs
2224 }
2225 
2226 
2228  // Vegetation type set by the farm manager.
2230  m_veg_patchy = true;
2231  m_digestability+=0.2;
2232  if (m_digestability>0.8) m_digestability=0.8;
2234  m_growth_scaler = (g_rand_uni() * (cfg_PermanentVegGrowthMaxScaler.value() - cfg_PermanentVegGrowthMinScaler.value())) + cfg_PermanentVegGrowthMinScaler.value(); // Scales growth stochastically in a range given by the configs
2235 }
2236 
2237 
2242  if (g_rand_uni() < cfg_SetAsidePatchyChance.value()) m_veg_patchy = true; else m_veg_patchy = false;
2243  m_digestability+=0.2;
2244  if (m_digestability>0.8) m_digestability=0.8;
2245  m_growth_scaler = (g_rand_uni() * (cfg_PermanentVegGrowthMaxScaler.value()- cfg_PermanentVegGrowthMinScaler.value())) + cfg_PermanentVegGrowthMinScaler.value(); // Scales growth stochastically in a range given by the configs
2246 
2247 }
2248 
2249 
2251  LE::SetHigh( true );
2252  //default to tall - later will depend on height recorded in polygon data
2255  m_type = tole_Hedges;
2256  SetSubType(0);
2257 }
2258 
2259 
2264  SetSubType(0);
2265 }
2266 
2267 
2272  if (g_rand_uni() < cfg_BBPatchyChance.value()) m_veg_patchy = true; else m_veg_patchy = false;
2273 }
2274 
2275 
2280  m_veg_patchy = true;
2281  m_growth_scaler = (g_rand_uni() * (cfg_PermanentVegGrowthMaxScaler.value() - cfg_PermanentVegGrowthMinScaler.value())) + cfg_PermanentVegGrowthMinScaler.value(); // Scales growth stochastically in a range given by the configs
2282 }
2283 
2286  // Add cutting functionality when ready.
2287  long today = g_date->DayInYear();
2288 
2289  if ( g_date->JanFirst() ) {
2290  // beginning of year so restart the cutting
2291  m_DateCut = 0;
2292  }
2293 
2294  if ( today > RV_MAY_1ST ) // No cutting before May 1st
2295  {
2296  long SinceCut = today - m_DateCut; // how many days since last cut
2297  int month = g_date->GetMonth();
2298  switch ( month ) {
2299  case 5:
2300  if ( random( 14 ) + SinceCut > RV_CUT_MAY ) Cutting( today );
2301  break;
2302  case 6:
2303  if ( random( 14 ) + SinceCut > RV_CUT_JUN ) Cutting( today );
2304  break;
2305  case 7:
2306  if ( random( 14 ) + SinceCut > RV_CUT_JUL ) Cutting( today );
2307  break;
2308  case 8:
2309  if ( random( 14 ) + SinceCut > RV_CUT_AUG ) Cutting( today );
2310  break;
2311  case 9:
2312  if ( random( 14 ) + SinceCut > RV_CUT_SEP ) Cutting( today );
2313  break;
2314  case 10:
2315  if ( random( 14 ) + SinceCut > RV_CUT_OCT ) Cutting( today );
2316  break;
2317  default:
2318  break;
2319  }
2320  }
2321 }
2322 
2323 void RoadsideVerge::Cutting( int a_today )
2324 {
2325  SetLastTreatment( mow );
2326  m_DateCut = a_today;
2331 }
2332 
2336  m_veg_patchy = true;
2337 }
2338 
2340 {
2342 
2343 }
2344 
2345 
2350  m_veg_patchy = true;
2351  m_growth_scaler = (g_rand_uni() * (cfg_PermanentVegGrowthMaxScaler.value() - cfg_PermanentVegGrowthMinScaler.value())) + cfg_PermanentVegGrowthMinScaler.value(); // Scales growth stochastically in a range given by the configs
2352 }
2353 
2356  // Add reseting veg functionality on January 1st
2357  long today = g_date->DayInYear();
2358 
2359  if (g_date->JanFirst()) {
2360  // beginning of year so restart the cutting
2361  ResetingVeg(today);
2362  }
2363 }
2364 
2366 {
2367  ZeroVeg();
2368 }
2369 
2370 
2371 //---------------------------------------------------------------------------
2372 //---------------------------------------------------------------------------
2373 
2375  m_veg_patchy = false;
2376 }
2377 
2378 
2381 }
2382 
2383 
2385  LE::SetHigh( true );
2386  m_type = tole_Scrub;
2387 }
2388 
2389 
2393  m_type = tole_Marsh;
2394  m_growth_scaler = (g_rand_uni() * (cfg_PermanentVegGrowthMaxScaler.value() - cfg_PermanentVegGrowthMinScaler.value())) + cfg_PermanentVegGrowthMinScaler.value(); // Scales growth stochastically in a range given by the configs
2395 }
2396 
2399  m_growth_scaler = (g_rand_uni() * (cfg_PermanentVegGrowthMaxScaler.value() - cfg_PermanentVegGrowthMinScaler.value())) + cfg_PermanentVegGrowthMinScaler.value(); // Scales growth stochastically in a range given by the configs
2400 }
2401 
2402 
2406  m_type = tole_Heath;
2407  m_veg_patchy = true;
2408  m_growth_scaler = (g_rand_uni() * (cfg_PermanentVegGrowthMaxScaler.value() - cfg_PermanentVegGrowthMinScaler.value())) + cfg_PermanentVegGrowthMinScaler.value(); // Scales growth stochastically in a range given by the configs
2409 }
2410 
2412  LE::SetHigh( true );
2416 }
2417 
2422  if (g_rand_uni() < cfg_MGPatchyChance.value()) m_veg_patchy = true; else m_veg_patchy = false;
2423 }
2424 
2426  LE::SetHigh( true );
2430  m_LastSprayed = 99999;
2431 }
2432 
2435  long today = g_date->DayInYear();
2436  // Spraying
2437  //int sprayday = cfg_OrchardSprayDay.value();
2438  int sprayday2 = cfg_pest_productapplic_startdate2.value();
2439  int sprayday3 = cfg_pest_productapplic_startdate3.value();
2440  int sprayday=cfg_pest_productapplic_startdate.value();
2441  //sprayday+=random(cfg_pest_productapplic_period.value());
2442  if ( ( today == sprayday ) || ( today == sprayday2 ) || ( today == sprayday3 ) )
2443  if ( g_landscape_p->SupplyShouldSpray() ) {
2444  //g_pest->DailyQueueAdd( this, l_pest_insecticide_amount.value() );
2446  }
2447  // Cutting functionality
2448  if ( g_date->JanFirst() ) {
2449  // beginning of year so restart the cutting
2450  m_DateCut = 0;
2451  }
2452 
2453  switch ( cfg_OrchardNoCutsDay.value() ) {
2454  case 99:
2455  if ( today == ( sprayday - 7 ) ) Cutting( today );
2456  break;
2457  case 4:
2458  if ( ( today == 259 ) || ( today == 122 ) || ( today == 92 ) || ( today == 196 ) )
2459  Cutting( today );
2460  break;
2461  case 3:
2462  if ( ( today == 259 ) || ( today == 122 ) || ( today == 92 ) ) Cutting( today );
2463  break;
2464  case 2:
2465  if ( ( today == 259 ) || ( today == 122 ) ) Cutting( today );
2466  break;
2467  case 1:
2468  if ( ( today == 259 ) ) Cutting( today );
2469  break;
2470  default: // No cut
2471  break;
2472  }
2473 }
2474 
2475 void Orchard::Cutting( int a_today ) {
2476  SetLastTreatment( mow );
2477  SetMownDecay( 12 ); // 12 days of not suitable
2479  m_DateCut = a_today;
2483 }
2484 
2487  long today = g_date->DayInYear();
2488  // Cutting functionality
2489  if ( g_date->JanFirst() ) {
2490  // beginning of year so restart the cutting
2491  m_DateCut = 0;
2492  }
2493  switch ( cfg_MownGrassNoCutsDay.value() ) {
2494  case 99:
2495  // Use to define special cutting behaviour e.g. cutting every 14 days after 1st May
2496  if ( ( today >= ( March + 15 ) ) && ( today % 42 == 0 )) {
2497  if (today < October) Cutting( today );
2498  }
2499  break;
2500  case 5:
2501  if ( ( today == 151 ) ) // 1st June
2502  Cutting( today );
2503  break;
2504  case 4:
2505  if ( ( today == 259 ) || ( today == 122 ) || ( today == 92 ) || ( today == 196 ) )
2506  Cutting( today );
2507  break;
2508  case 3:
2509  if ( ( today == 259 ) || ( today == 122 ) || ( today == 92 ) ) Cutting( today );
2510  break;
2511  case 2:
2512  if ( ( today == 259 ) || ( today == 122 ) ) Cutting( today );
2513  break;
2514  case 1:
2515  if ( ( today == 259 ) ) Cutting( today );
2516  break;
2517  default: // No cut
2518  break;
2519  }
2520 }
2521 
2522 void MownGrass::Cutting( int a_today ) {
2523  SetLastTreatment( mow );
2524  SetMownDecay( 21 ); // 21 days of not suitable
2526  m_DateCut = a_today;
2530 }
2531 
2532 
2535  long today = g_date->DayInYear();
2536  if (m_LastSprayed<today) {
2538  if (m_herbicidedelay > 5) m_herbicidedelay = 5;
2539  else if (m_herbicidedelay < 0) m_herbicidedelay = 0;
2540  this->ReduceVeg(0.9);
2541  if ((today == 0) || (today-m_LastSprayed > 90)) m_LastSprayed = 999999;
2542  }
2543  // Spraying
2544  int sprayday2 = cfg_pest_productapplic_startdate2.value();
2545  int sprayday3 = cfg_pest_productapplic_startdate3.value();
2546  int sprayday=cfg_pest_productapplic_startdate.value();
2547  //sprayday+=random(cfg_pest_productapplic_period.value());
2548  if ( ( today == sprayday ) || ( today == sprayday2 ) || ( today == sprayday3 ) ) {
2549  if ( g_landscape_p->SupplyShouldSpray() ) {
2551  }
2552  m_LastSprayed = today; // Regardless of whether we spray our test compound, we want to have the herbicide effect
2553 
2554  }
2555 }
2556 
2559 }
2560 
2561 
2565  m_veg_patchy=true;
2567  m_growth_scaler = (g_rand_uni() * (cfg_PermanentVegGrowthMaxScaler.value() - cfg_PermanentVegGrowthMinScaler.value())) + cfg_PermanentVegGrowthMinScaler.value(); // Scales growth stochastically in a range given by the configs
2568 }
2569 
2573  m_veg_patchy=true;
2575  m_growth_scaler = (g_rand_uni() * (cfg_PermanentVegGrowthMaxScaler.value() - cfg_PermanentVegGrowthMinScaler.value())) + cfg_PermanentVegGrowthMinScaler.value(); // Scales growth stochastically in a range given by the configs
2576 }
2577 
2581  m_veg_patchy = true;
2583 }
2584 
2587  // The assumption is that natural grass has a range of species, which means
2588  // there should be good food all year - but still it should vary with season
2589  // So we add a constant to the digestability of 0.2
2590  m_digestability+=0.2;
2591  if (m_digestability>0.8) m_digestability=0.8;
2592 }
2593 
2596  // The assumption is that natural grass has a range of species, which means
2597  // there should be good food all year - but still it should vary with season
2598  // So we add a constant to the digestability of 0.2
2599  m_digestability+=0.2;
2600  if (m_digestability>0.8) m_digestability=0.8;
2601 }
2602 
2604  // The assumption is that natural grass has a range of species, which means
2605  // there should be good food all year - but still it should vary with season
2606  // So we add a constant to the digestability of 0.2
2607  m_digestability += 0.2;
2609  if (m_digestability>0.8) m_digestability = 0.8;
2610 }
2611 
2616 }
2617 
2622  if (random(100) < cfg_UMPatchyChance.value()) m_veg_patchy = true; else
2623  m_veg_patchy = false;
2624 }
2625 
2627  m_yddegs = m_ddegs;
2630  m_weed_biomass += dWee;
2631  if ( m_weed_biomass < 0.0 ) m_weed_biomass = 0.0;
2632  double temp_biomass = m_LAtotal * EL_PLANT_BIOMASS * 0.9 * g_biomass_scale[ m_vege_type ];
2633  // Calculate vegdensity here so that excess weeds do not make the density greater
2634  // They are in the patches which are not calculated in the 0.1 reduc.
2635  m_veg_density = ( int )floor( 0.5 + ( temp_biomass / ( 1 + m_veg_height ) ) );
2636  if ( m_veg_density > 100 ) m_veg_density = 100; // to stop array bounds problems
2637  double temp_bugmass = g_bug_percent_d[ m_vege_type ] * g_bug_percent_a[ m_vege_type ]
2638  + ( ( temp_biomass + m_weed_biomass ) * g_bug_percent_b[ m_vege_type ] )
2640  // Set a minimum value (regressions will otherwise give a -ve value
2641  if ( temp_bugmass < 0.05 ) temp_bugmass = 0.05;
2642  m_veg_biomass = m_weed_biomass + ( temp_biomass * 0.9 );
2643  m_insect_pop = temp_bugmass;
2644  m_veg_density = ( int )floor( 0.5 + ( m_veg_biomass / ( 1 + m_veg_height ) ) );
2645  if ( m_veg_density > 100 ) m_veg_density = 100; // to stop array bounds problems
2646 }
2647 
2648 
2650  LE::SetHigh( true );
2652 }
2653 
2654 
2656  m_type = tole_Railway;
2657 }
2658 
2660 {
2663 }
2664 
2665 
2667  LE::SetHigh(true);
2670 }
2671 //---------------------------------------------------------------------------
2672 //---------------------------------------------------------------------------
2673 
2674 
2676  LE::SetHigh( true ); // default to tall
2677 }
2678 
2679 
2681  m_type = tole_Copse;
2682 }
2683 
2684 
2687 }
2688 
2689 
2692 }
2693 
2694 
2697 }
2698 
2703  m_veg_patchy = true;
2704  LE::SetHigh( false ); // default to tall
2705 }
2706 
2709 }
2710 
2713 }
2714 
2717 }
2718 
2719 //---------------------------------------------------------------------------
2720 //---------------------------------------------------------------------------
2721 
2723  ;
2724 }
2725 
2726 
2729 }
2730 
2732  LE::SetHigh(true);
2733  m_type = tole_Garden;
2734 }
2735 
2736 
2738  LE::SetHigh( true );
2740  m_countrydesignation = 0; // default = 0 = town
2741 }
2742 
2743 
2745  LE::SetHigh( true );
2747 }
2748 
2750  LE::SetHigh(false);
2751  m_type = tole_Fence;
2752 }
2753 
2754 
2756  LE::SetHigh( true );
2758 }
2759 
2760 
2763 }
2764 
2765 
2768 }
2769 
2770 
2773 }
2774 
2775 
2776 Pond::Pond( void ) : Freshwater() {
2777  m_type = tole_Pond;
2778  m_LarvalFood = 0.01;
2779  m_MaleNewtPresent = false;
2781 }
2782 
2784 {
2785  LE::DoDevelopment();
2787  CalcLarvalFood();
2788  m_MaleNewtPresent = false;
2789 }
2790 
2792 {
2801  m_pondpesticide = 0.0;
2803  {
2804  return;
2805  }
2810  for (int x = m_minx; x <= m_maxx; x++)
2811  for (int y = m_miny; y <= m_maxy; y++)
2812  {
2814  }
2820 }
2821 
2823 {
2836  double area = m_area;
2837  if (m_area > 400) area = 400;
2838  const double LarvalFoodMonthlyK[12] = { 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0 };
2839  // Back calculate the scaler
2841  // Calculate the new scaler
2843  // Provide some contest competition by preventing all the food from being used up, leaving minimum 1%
2844  if (m_LarvalFoodScaler < 0.01) m_LarvalFoodScaler = 0.01;
2845  // Calculate the new food biomass
2847 }
2848 
2849 bool Pond::SubtractLarvalFood(double a_food)
2850 {
2855  m_LarvalFood -= a_food;
2856  if (m_LarvalFood < 0) return false;
2857  return true;
2858 }
2859 
2862 }
2863 
2865  m_type = tole_River;
2866 }
2867 
2869  m_type = tole_Canal;
2870 }
2871 
2874 }
2875 
2878 }
2879 
2880 
2882  m_type = tole_Coast;
2883 }
2884 
2885 
2888 }
2889 
2890 
2893 }
2894 
2895 
2898 }
2899 
2900 
2903 }
2904 
2905 
2907  LE::SetHigh( true );
2909 }
2910 
2912  LE::SetHigh(true);
2914 }
2915 
2916 
2919 }
2920 
2921 
2923  LE::SetHigh( true );
2925 }
2926 
2927 
2929  LE::SetHigh( true );
2931 }
2932 
2933 
2936 }
2937 
2938 
2941 }
2942 
2943 
2946 }
2947 
2948 
2951 }
2952 
2953 
2955  m_type = tole_Track;
2956 }
2957 
2959  m_type = tole_Stream;
2960 }
2961 
2964 }
2965 
2967  m_type = tole_Carpark;
2968 }
2969 
2972 }
2973 
2976 }
2977 
2979  LE::SetHigh(true);
2980  m_type = tole_Pylon;
2981 }
2982 
2983 
2985  LE::SetHigh(true);
2986  m_type = tole_Pylon;
2987 }
2988 
2989 
2990 
2991 
2992 
2993 //--------------------------------------------------------------------
2994 // created 25/08/00
2996  static char error_num[ 20 ];
2997 
2998  // This returns the vegetation type (or crop type) as applicable
2999  switch ( EleReference ) {
3000  case 5: return tole_Building;
3001  case 8: return tole_UrbanNoVeg;
3002  case 9: return tole_UrbanVeg;
3003  case 11: return tole_Garden;
3004  case 12: return tole_AmenityGrass;
3005  case 13: return tole_RoadsideVerge;
3006  case 14: return tole_Parkland;
3007  case 15: return tole_StoneWall;
3008  case 16: return tole_BuiltUpWithParkland;
3009  case 17: return tole_UrbanPark;
3010  case 20: return tole_Field;
3011  case 27: return tole_PermPastureTussocky;
3012  case 26: return tole_PermPastureLowYield;
3013  case 31: return tole_UnsprayedFieldMargin;
3014  case 33: return tole_PermanentSetaside;
3015  case 35: return tole_PermPasture;
3016  case 40: return tole_DeciduousForest;
3017  case 41: return tole_Copse;
3018  case 50: return tole_ConiferousForest;
3019  case 55: return tole_YoungForest;
3020  case 56: return tole_Orchard;
3021  case 69: return tole_BareRock;
3022  case 57: return tole_OrchardBand;
3023  case 58: return tole_MownGrass;
3024  case 60: return tole_MixedForest;
3025  case 70: return tole_Scrub;
3026  case 75: return tole_PitDisused;
3027  case 80: return tole_Saltwater;
3028  case 90: return tole_Freshwater;
3029  case 94: return tole_Heath;
3030  case 95: return tole_Marsh;
3031  case 96: return tole_River;
3032  case 97: return tole_RiversideTrees;
3033  case 98: return tole_RiversidePlants;
3034  case 100: return tole_Coast;
3035  case 101: return tole_SandDune;
3036  case 110: return tole_NaturalGrassDry;
3037  case 115: return tole_ActivePit;
3038  case 118: return tole_Railway;
3039  case 121: return tole_LargeRoad;
3040  case 122: return tole_SmallRoad;
3041  case 123: return tole_Track;
3042  case 130: return tole_Hedges;
3043  case 140: return tole_HedgeBank;
3044  case 141: return tole_BeetleBank;
3045  case 150: return tole_Chameleon;
3046  case 160: return tole_FieldBoundary;
3047  case 201: return tole_RoadsideSlope;
3048  case 202: return tole_MetalledPath;
3049  case 203: return tole_Carpark;
3050  case 204: return tole_Churchyard;
3051  case 205: return tole_NaturalGrassWet;
3052  case 206: return tole_Saltmarsh;
3053  case 207: return tole_Stream;
3054  case 208: return tole_HeritageSite;
3055  case 209: return tole_Wasteland;
3056  case 210: return tole_UnknownGrass;
3057  case 211: return tole_WindTurbine;
3058  case 212: return tole_Pylon;
3059  case 213: return tole_IndividualTree;
3060  case 214: return tole_PlantNursery;
3061  case 215: return tole_Vildtager;
3062  case 216: return tole_WoodyEnergyCrop;
3063  case 217: return tole_WoodlandMargin;
3064  case 218: return tole_PermPastureTussockyWet;
3065  case 219: return tole_Pond;
3066  case 220: return tole_FishFarm;
3067  case 221: return tole_RiverBed;
3068  case 222: return tole_DrainageDitch;
3069  case 223: return tole_Canal;
3070  case 224: return tole_RefuseSite;
3071  case 225: return tole_Fence;
3072  case 226: return tole_WaterBufferZone;
3073  case 2112: return tole_Missing;
3074 
3075  // case 999: return tole_Foobar;
3076  // !! type unknown - should not happen
3077  default:
3078  sprintf( error_num, "%d", EleReference );
3079  g_msg->Warn( WARN_FILE, "LE_TypeClass::TranslateEleTypes(): ""Unknown landscape element type:", error_num );
3080  exit( 1 );
3081  }
3082 }
3083 
3084 
3085 
3086 //----------------------------------------------------------------------
3087 // created 24/08/00
3089  char error_num[ 20 ];
3090 
3091  // This returns the vegetation type (or crop type) as applicable
3092  switch ( VegReference ) {
3093  case 1:
3094  return tov_SpringBarley;
3095  case 2:
3096  return tov_WinterBarley;
3097  case 3:
3098  return tov_SpringWheat;
3099  case 4:
3100  return tov_WinterWheat;
3101  case 5:
3102  return tov_WinterRye;
3103  case 6:
3104  return tov_Oats;
3105  case 7:
3106  return tov_Triticale;
3107  case 8:
3108  return tov_Maize;
3109  case 13:
3110  return tov_SpringBarleySeed;
3111  case 14: return tov_SpringBarleyStrigling;
3112  case 15: return tov_SpringBarleyStriglingSingle;
3113  case 16: return tov_SpringBarleyStriglingCulm;
3114  case 17: return tov_WinterWheatStrigling;
3115  case 18: return tov_WinterWheatStriglingSingle;
3116  case 19: return tov_WinterWheatStriglingCulm;
3117  case 21:
3118  return tov_SpringRape;
3119  case 22:
3120  return tov_WinterRape;
3121  case 30:
3122  return tov_FieldPeas;
3123  case 31:
3124  return tov_FieldPeasSilage; //ok?
3125  case 32:
3126  return tov_BroadBeans;
3127  case 50:
3128  return tov_Setaside;
3129  case 54:
3130  return tov_PermanentSetaside;
3131  case 55:
3132  return tov_YoungForest;
3133  case 60:
3134  return tov_FodderBeet;
3135  case 61:
3136  return tov_SugarBeet;
3137  case 65:
3138  return tov_CloverGrassGrazed1;
3139  case 92:
3140  return tov_PotatoesIndustry;
3141  case 93:
3142  return tov_Potatoes;
3143  case 94:
3144  return tov_SeedGrass1;
3145  case 102:
3146  return tov_OWinterBarley;
3147  case 611:
3148  return tov_OWinterBarleyExt;
3149  case 103:
3150  return tov_OSBarleySilage;
3151  case 105:
3152  return tov_OWinterRye;
3153  case 106:
3154  return tov_OFieldPeasSilage;
3155  case 107:
3156  return tov_SpringBarleyGrass;
3157  case 108:
3159  case 109:
3160  return tov_SpringBarleySpr;
3161  case 113:
3163  case 114:
3165  case 115:
3166  return tov_SpringBarleySilage;
3167  case 122:
3168  return tov_OWinterRape;
3169  case 140:
3170  return tov_PermanentGrassGrazed;
3171  case 141:
3173  case 142:
3175  case 165:
3176  return tov_CloverGrassGrazed2;
3177  case 194:
3178  return tov_SeedGrass2;
3179  case 201:
3180  return tov_OSpringBarley;
3181  case 204:
3183  case 205:
3184  return tov_OWinterWheat;
3185  case 206:
3186  return tov_OOats;
3187  case 207:
3188  return tov_OTriticale;
3189  case 230:
3190  return tov_OFieldPeas;
3191  case 26:
3192  return tov_OFodderBeet;
3193  case 265:
3194  return tov_OCloverGrassGrazed1;
3195  case 270:
3196  return tov_OCarrots;
3197  case 271:
3198  return tov_Carrots;
3199  case 272:
3200  return tov_Wasteland;
3201  case 273:
3202  return tov_OGrazingPigs;
3203  case 293:
3204  return tov_OPotatoes;
3205  case 294:
3206  return tov_OSeedGrass1;
3207  case 306:
3208  return tov_OSpringBarleyPigs;
3209  case 307:
3210  return tov_OSpringBarleyGrass;
3211  case 308:
3212  return tov_OSpringBarleyClover;
3213  case 340:
3215  case 365:
3216  return tov_OCloverGrassGrazed2;
3217  case 366:
3218  return tov_OCloverGrassSilage1;
3219  case 394:
3220  return tov_OSeedGrass2;
3221  case 400:
3222  return tov_NaturalGrass;
3223  case 401:
3224  return tov_None;
3225  case 601:
3226  return tov_WWheatPControl;
3227  case 602:
3228  return tov_WWheatPToxicControl;
3229  case 603:
3230  return tov_WWheatPTreatment;
3231  case 604:
3233  case 605:
3234  return tov_WinterWheatShort;
3235  case 606:
3236  return tov_MaizeSilage;
3237  case 607:
3238  return tov_FodderGrass;
3239  case 608:
3241  case 609:
3242  return tov_OSpringBarleyExt;
3243  case 610:
3244  return tov_OMaizeSilage;
3245  case 612:
3247  case 613:
3248  return tov_Heath;
3249  case 700:
3250  return tov_OrchardCrop;
3251  case 701:
3252  return tov_WaterBufferZone;
3253  case 801:
3254  return tov_PLWinterWheat;
3255  case 802:
3256  return tov_PLWinterRape;
3257  case 803:
3258  return tov_PLWinterBarley;
3259  case 804:
3260  return tov_PLWinterTriticale;
3261  case 805:
3262  return tov_PLWinterRye;
3263  case 806:
3264  return tov_PLSpringWheat;
3265  case 807:
3266  return tov_PLSpringBarley;
3267  case 808:
3268  return tov_PLMaize;
3269  case 809:
3270  return tov_PLMaizeSilage;
3271  case 810:
3272  return tov_PLPotatoes;
3273  case 811:
3274  return tov_PLBeet;
3275  case 812:
3276  return tov_PLFodderLucerne1;
3277  case 813:
3278  return tov_PLFodderLucerne2;
3279  case 814:
3280  return tov_PLCarrots;
3281  case 815:
3282  return tov_PLSpringBarleySpr;
3283  case 816:
3284  return tov_PLWinterWheatLate;
3285  case 817:
3286  return tov_PLBeetSpr;
3287  case 818:
3288  return tov_PLBeans;
3289 
3290  case 850:
3291  return tov_NLBeet;
3292  case 851:
3293  return tov_NLCarrots;
3294  case 852:
3295  return tov_NLMaize;
3296  case 853:
3297  return tov_NLPotatoes;
3298  case 854:
3299  return tov_NLSpringBarley;
3300  case 855:
3301  return tov_NLWinterWheat;
3302  case 856:
3303  return tov_NLCabbage;
3304  case 857:
3305  return tov_NLTulips;
3306  case 858:
3307  return tov_NLGrassGrazed1;
3308  case 859:
3309  return tov_NLGrassGrazed2;
3310  case 860:
3312  case 861:
3313  return tov_NLCatchPeaCrop;
3314  case 862:
3315  return tov_NLBeetSpring;
3316  case 863:
3317  return tov_NLCarrotsSpring;
3318  case 864:
3319  return tov_NLMaizeSpring;
3320  case 865:
3321  return tov_NLPotatoesSpring;
3322  case 866:
3323  return tov_NLSpringBarleySpring;
3324  case 867:
3325  return tov_NLCabbageSpring;
3326  case 868:
3327  return tov_NLGrassGrazed1Spring;
3328  case 869:
3329  return tov_NLGrassGrazedLast;
3330 
3331  case 888:
3332  return tov_DummyCropPestTesting;
3333 
3334  case 999:
3335  return tov_Undefined;
3336  default: // No matching code so we need an error message of some kind
3337  sprintf( error_num, "%d", VegReference );
3338  g_msg->Warn( WARN_FILE, "LE_TypeClass::TranslateVegTypes(): ""Unknown vegetation type:", error_num );
3339  exit( 1 );
3340  }
3341 }
3342 
3343 //-----------------------------------------------------------------------
3344 // created 25/08/00
3346  char error_num[ 20 ];
3347 
3348  // This returns the vegetation type (or crop type) as applicable
3349  switch ( VegReference ) {
3350  case tov_SpringBarley:
3351  return 1;
3352  case tov_WinterBarley:
3353  return 2;
3354  case tov_SpringWheat:
3355  return 3;
3356  case tov_WinterWheat:
3357  return 4;
3358  case tov_WinterRye:
3359  return 5;
3360  case tov_Oats:
3361  return 6;
3362  case tov_Triticale:
3363  return 7;
3364  case tov_Maize:
3365  return 8;
3366  case tov_SpringBarleySeed:
3367  return 13;
3369  return 14;
3371  return 15;
3373  return 16;
3375  return 17;
3377  return 18;
3379  return 19;
3380  case tov_SpringRape:
3381  return 21;
3382  case tov_WinterRape:
3383  return 22;
3384  case tov_FieldPeas:
3385  return 30;
3386  case tov_FieldPeasSilage:
3387  return 31;
3388  case tov_BroadBeans:
3389  return 32;
3390  case tov_Setaside:
3391  return 50;
3392  case tov_PermanentSetaside:
3393  return 54;
3394  case tov_YoungForest:
3395  return 55;
3396  case tov_FodderBeet:
3397  return 60;
3398  case tov_SugarBeet:
3399  return 61;
3401  return 65;
3402  case tov_PotatoesIndustry:
3403  return 92;
3404  case tov_Potatoes:
3405  return 93;
3406  case tov_SeedGrass1:
3407  return 94;
3408  case tov_OWinterBarley:
3409  return 102;
3410  case tov_OWinterBarleyExt:
3411  return 611;
3412  case tov_OWinterRye:
3413  return 105;
3414  case tov_SpringBarleyGrass:
3415  return 107;
3417  return 108;
3418  case tov_SpringBarleySpr:
3419  return 109;
3420  case tov_OSBarleySilage:
3421  return 103;
3423  return 113;
3425  return 114;
3427  return 115;
3428  case tov_OWinterRape:
3429  return 122;
3431  return 140;
3433  return 141;
3435  return 142;
3437  return 165;
3438  case tov_SeedGrass2:
3439  return 194;
3440  case tov_OSpringBarley:
3441  return 201;
3443  return 204;
3444  case tov_OWinterWheat:
3445  return 205;
3446  case tov_OOats:
3447  return 206;
3448  case tov_OTriticale:
3449  return 207;
3450  case tov_OFieldPeas:
3451  return 230;
3452  case tov_OFieldPeasSilage:
3453  return 106;
3454  case tov_OFodderBeet:
3455  return 260;
3457  return 265;
3458  case tov_OCarrots:
3459  return 270;
3460  case tov_Carrots:
3461  return 271;
3462  case tov_OPotatoes:
3463  return 293;
3464  case tov_OSeedGrass1:
3465  return 294;
3466  case tov_OSpringBarleyPigs:
3467  return 306;
3469  return 307;
3471  return 308;
3473  return 340;
3475  return 365;
3477  return 366;
3478  case tov_OSeedGrass2:
3479  return 394;
3480  case tov_NaturalGrass:
3481  return 400;
3482  case tov_None:
3483  return 401;
3484  case tov_NoGrowth:
3485  return 402;
3486  case tov_WWheatPControl:
3487  return 601;
3489  return 602;
3490  case tov_WWheatPTreatment:
3491  return 603;
3493  return 604;
3494  case tov_WinterWheatShort:
3495  return 605;
3496  case tov_MaizeSilage:
3497  return 606;
3498  case tov_FodderGrass:
3499  return 607;
3501  return 608;
3502  case tov_OSpringBarleyExt:
3503  return 609;
3504  case tov_OMaizeSilage:
3505  return 610;
3507  return 612;
3508  case tov_Heath:
3509  return 613;
3510  case tov_OrchardCrop:
3511  return 700;
3512  case tov_WaterBufferZone:
3513  return 701;
3514  case tov_PLWinterWheat:
3515  return 801;
3516  case tov_PLWinterRape:
3517  return 802;
3518  case tov_PLWinterBarley:
3519  return 803;
3520  case tov_PLWinterTriticale:
3521  return 804;
3522  case tov_PLWinterRye:
3523  return 805;
3524  case tov_PLSpringWheat:
3525  return 806;
3526  case tov_PLSpringBarley:
3527  return 807;
3528  case tov_PLMaize:
3529  return 808;
3530  case tov_PLMaizeSilage:
3531  return 809;
3532  case tov_PLPotatoes:
3533  return 810;
3534  case tov_PLBeet:
3535  return 811;
3536  case tov_PLFodderLucerne1:
3537  return 812;
3538  case tov_PLFodderLucerne2:
3539  return 813;
3540  case tov_PLCarrots:
3541  return 814;
3542  case tov_PLSpringBarleySpr:
3543  return 815;
3544  case tov_PLWinterWheatLate:
3545  return 816;
3546  case tov_PLBeetSpr:
3547  return 817;
3548  case tov_PLBeans:
3549  return 818;
3550 
3551  case tov_NLBeet:
3552  return 850;
3553  case tov_NLCarrots:
3554  return 851;
3555  case tov_NLMaize:
3556  return 852;
3557  case tov_NLPotatoes:
3558  return 853;
3559  case tov_NLSpringBarley:
3560  return 854;
3561  case tov_NLWinterWheat:
3562  return 855;
3563  case tov_NLCabbage:
3564  return 856;
3565  case tov_NLTulips:
3566  return 857;
3567  case tov_NLGrassGrazed1:
3568  return 858;
3569  case tov_NLGrassGrazed2:
3570  return 859;
3572  return 860;
3573  case tov_NLCatchPeaCrop:
3574  return 861;
3575  case tov_NLBeetSpring:
3576  return 862;
3577  case tov_NLCarrotsSpring:
3578  return 863;
3579  case tov_NLMaizeSpring:
3580  return 864;
3581  case tov_NLPotatoesSpring:
3582  return 865;
3584  return 866;
3585  case tov_NLCabbageSpring:
3586  return 867;
3588  return 868;
3589  case tov_NLGrassGrazedLast:
3590  return 869;
3591 
3592  case tov_OGrazingPigs:
3593  return 271;
3594  case tov_Wasteland:
3595  return 272;
3597  return 888;
3598 
3599  case tov_Undefined:
3600  return 999;
3601  default: // No matching code so we need an error message of some kind
3602  sprintf( error_num, "%d", VegReference );
3603  g_msg->Warn( WARN_FILE, "LE_TypeClass::BackTranslateVegTypes(): ""Unknown vegetation type:", error_num );
3604  exit( 1 );
3605  }
3606 }
3607 
3608 //-----------------------------------------------------------------------
3609 // created 25/08/00
3611  static char error_num[ 20 ];
3612 
3613  // This returns the vegetation type (or crop type) as applicable
3614  switch ( EleReference )
3615  {
3616  case tole_Building: return 5;
3617  case tole_UrbanNoVeg: return 8;
3618  case tole_UrbanVeg: return 9;
3619  case tole_Garden: return 11;
3620  case tole_AmenityGrass: return 12;
3621  case tole_RoadsideVerge: return 13;
3622  case tole_Parkland: return 14;
3623  case tole_StoneWall: return 15;
3624  case tole_BuiltUpWithParkland: return 16;
3625  case tole_UrbanPark: return 17;
3626  case tole_Field: return 20;
3627  case tole_PermPastureTussocky: return 27;
3628  case tole_PermPastureLowYield: return 26;
3629  case tole_UnsprayedFieldMargin: return 31;
3630  case tole_PermanentSetaside: return 33;
3631  case tole_PermPasture: return 35;
3632  case tole_DeciduousForest: return 40;
3633  case tole_Copse: return 41;
3634  case tole_ConiferousForest: return 50;
3635  case tole_YoungForest: return 55;
3636  case tole_Orchard: return 56;
3637  case tole_BareRock: return 69;
3638  case tole_OrchardBand: return 57;
3639  case tole_MownGrass: return 58;
3640  case tole_MixedForest: return 60;
3641  case tole_Scrub: return 70;
3642  case tole_PitDisused: return 75;
3643  case tole_Saltwater: return 80;
3644  case tole_Freshwater: return 90;
3645  case tole_Heath: return 94;
3646  case tole_Marsh: return 95;
3647  case tole_River: return 96;
3648  case tole_RiversideTrees: return 97;
3649  case tole_RiversidePlants: return 98;
3650  case tole_Coast: return 100;
3651  case tole_SandDune: return 101;
3652  case tole_NaturalGrassDry: return 110;
3653  case tole_ActivePit: return 115;
3654  case tole_Railway: return 118;
3655  case tole_LargeRoad: return 121;
3656  case tole_SmallRoad: return 122;
3657  case tole_Track: return 123;
3658  case tole_Hedges: return 130;
3659  case tole_HedgeBank: return 140;
3660  case tole_BeetleBank: return 141;
3661  case tole_Chameleon: return 150;
3662  case tole_FieldBoundary: return 160;
3663  case tole_RoadsideSlope: return 201;
3664  case tole_MetalledPath: return 202;
3665  case tole_Carpark: return 203;
3666  case tole_Churchyard: return 204;
3667  case tole_NaturalGrassWet: return 205;
3668  case tole_Saltmarsh: return 206;
3669  case tole_Stream: return 207;
3670  case tole_HeritageSite: return 208;
3671  case tole_Wasteland: return 209;
3672  case tole_UnknownGrass: return 210;
3673  case tole_WindTurbine: return 211;
3674  case tole_Pylon: return 212;
3675  case tole_IndividualTree: return 213;
3676  case tole_PlantNursery: return 214;
3677  case tole_Vildtager: return 215;
3678  case tole_WoodyEnergyCrop: return 216;
3679  case tole_WoodlandMargin: return 217;
3680  case tole_PermPastureTussockyWet: return 218;
3681  case tole_Pond: return 219;
3682  case tole_FishFarm: return 220;
3683  case tole_RiverBed: return 221;
3684  case tole_DrainageDitch: return 222;
3685  case tole_Canal: return 223;
3686  case tole_RefuseSite: return 224;
3687  case tole_Fence: return 225;
3688  case tole_WaterBufferZone: return 226;
3689 
3690  case tole_Missing: return 2112;
3691 
3692  //case tole_Foobar: return 999;
3693  // !! type unknown - should not happen
3694  default:
3695  sprintf( error_num, "%d", EleReference );
3696  g_msg->Warn( WARN_FILE, "LE_TypeClass::BackTranslateEleTypes(): ""Unknown landscape element type:", error_num );
3697  exit( 1 );
3698  }
3699 }
3700 
3701 //------------------------------------------------------------------------
3702 
3705  m_insect_pop = m_insect_pop * 3.0;
3706 }
3707 
3711 }
3712 
3713 
LE_TypeClass::BackTranslateEleTypes
int BackTranslateEleTypes(TTypesOfLandscapeElement EleReference)
Definition: elements.cpp:3610
cfg_randompondquality
CfgBool cfg_randompondquality("POND_RANDOMQUALITY", CFG_CUSTOM, false)
Controls whether random pond quality is used.
tov_AgroChemIndustryCereal
Definition: tov_declaration.h:55
EL_BUG_PERCENT_SB_A
#define EL_BUG_PERCENT_SB_A
Definition: elements.cpp:38
VegElement::ReduceVeg_Extended
virtual void ReduceVeg_Extended(double a_reduc)
Definition: elements.cpp:2097
Pond::m_MaleNewtPresent
bool m_MaleNewtPresent
Flag for presence of a male newt.
Definition: elements.h:1192
tov_OSpringBarleyClover
Definition: tov_declaration.h:46
tole_HedgeBank
Definition: tole_declaration.h:68
tole_UrbanNoVeg
Definition: tole_declaration.h:78
cfg_MownGrassNoCutsDay
static CfgInt cfg_MownGrassNoCutsDay("ELE_MOWNGRASSNOCUTS", CFG_CUSTOM, -1)
WaterBufferZone::WaterBufferZone
WaterBufferZone(void)
Definition: elements.cpp:2346
tov_SpringBarleyStrigling
Definition: tov_declaration.h:58
tov_PLWinterWheatLate
Definition: tov_declaration.h:85
tov_PLSpringWheat
Definition: tov_declaration.h:75
tov_NLSpringBarley
Definition: tov_declaration.h:93
tole_Saltwater
Definition: tole_declaration.h:66
Landscape::SupplyLEPointer
LE * SupplyLEPointer(int a_polyref)
Definition: landscape.h:1099
tov_NLMaizeSpring
Definition: tov_declaration.h:102
LE::m_monthly_traffic
static double m_monthly_traffic[]
Used for birds that feed on grain on cereal fields 3% spill is expected.
Definition: elements.h:527
RV_MAY_1ST
#define RV_MAY_1ST
Definition: elements.cpp:212
tov_Oats
Definition: tov_declaration.h:40
tole_UnsprayedFieldMargin
Definition: tole_declaration.h:72
tov_OWinterBarley
Definition: tov_declaration.h:47
tole_UrbanVeg
Definition: tole_declaration.h:103
DeciduousForest::DeciduousForest
DeciduousForest(void)
Definition: elements.cpp:2685
tole_Missing
Definition: tole_declaration.h:109
tov_NLPotatoes
Definition: tov_declaration.h:92
CfgStr::value
const char * value(void)
Definition: configurator.h:152
cfg_OrchardNoCutsDay
CfgInt cfg_OrchardNoCutsDay("TOX_ORCHARDNOCUTS", CFG_CUSTOM, -1)
VegElement::SetCropData
virtual void SetCropData(double, double, double, TTypesOfVegetation, double, int)
Definition: elements.cpp:2181
LE::~LE
virtual ~LE(void)
Definition: elements.cpp:452
StoneWall::StoneWall
StoneWall(void)
Definition: elements.cpp:2744
LE::m_area
double m_area
The element area in m2.
Definition: elements.h:489
tole_Building
Definition: tole_declaration.h:62
Landscape::SupplyTemp
double SupplyTemp(void)
Definition: landscape.h:1386
VegElement::IsCereal
virtual bool IsCereal()
Definition: elements.cpp:1467
g_el_strigling_delaytime_days
CfgInt g_el_strigling_delaytime_days("ELEM_STRIGLING_DELAYTIME_DAYS", CFG_PRIVATE, 28)
tole_Freshwater
Definition: tole_declaration.h:64
l_el_rv_cut_sep
static CfgInt l_el_rv_cut_sep("ELEM_RV_CUT_SEP", CFG_PRIVATE, 49)
VegElement::m_newgrowthsum
double m_newgrowthsum
Definition: elements.h:700
LE::m_pollenquality
PollenNectarQuality m_pollenquality
Definition: elements.h:539
tov_OPermanentGrassGrazed
Definition: tov_declaration.h:44
VegElement::DoDevelopment
virtual void DoDevelopment(void)
Definition: elements.cpp:2004
PlantGrowthData::GetLAgreenDiff
double GetLAgreenDiff(double a_ddegs, double a_yddegs, int a_plant, int a_phase)
Get the differential in LA green for the day degrees experienced.
Definition: plants.h:107
ChameleonLE::ChameleonLE
ChameleonLE(void)
Definition: elements.cpp:2727
EL_PLANT_BIOMASS
#define EL_PLANT_BIOMASS
Definition: elements.cpp:182
EL_GROWTH_PHASE_SHIFT_LEVEL
#define EL_GROWTH_PHASE_SHIFT_LEVEL
Definition: elements.cpp:170
cfg_SetAsidePatchyChance
static CfgFloat cfg_SetAsidePatchyChance("SETASIDEPATCHYCHANCE", CFG_CUSTOM, 1.0)
The chance that a setaside being created is patchy or not.
cfg_MGPatchyChance
static CfgFloat cfg_MGPatchyChance("MOWNGRASSPATCHYCHANCE", CFG_CUSTOM, 0.5)
The chance that a beetlebank being created is patchy or not.
g_pest
class Pesticide * g_pest
Definition: pesticide.cpp:92
CropActualValues::taken
bool taken
Definition: elements.h:556
tole_Parkland
Definition: tole_declaration.h:77
tole_StoneWall
Definition: tole_declaration.h:56
LE::m_subtype
int m_subtype
Definition: elements.h:461
Churchyard::Churchyard
Churchyard(void)
Definition: elements.cpp:2962
cfg_PondLarvalFoodBiomassConst
CfgFloat cfg_PondLarvalFoodBiomassConst("POND_LARVALFOODBIOMASSCONST", CFG_CUSTOM, 215.0)
A constant relating the proportion of food units per m2. The value is calibrated to estimates of newt...
Landscape::SupplyShouldSpray
bool SupplyShouldSpray()
Definition: landscape.h:357
tole_RiversidePlants
Definition: tole_declaration.h:49
tole_FishFarm
Definition: tole_declaration.h:102
Pond::SubtractLarvalFood
bool SubtractLarvalFood(double a_food)
Called by a larva when feeding, removes an age specific amount of larval food
Definition: elements.cpp:2849
EL_BUG_PERCENT_WW_B
#define EL_BUG_PERCENT_WW_B
Definition: elements.cpp:45
tov_PLSpringBarleySpr
Definition: tov_declaration.h:84
EL_BUG_PERCENT_WW_A
#define EL_BUG_PERCENT_WW_A
Definition: elements.cpp:44
Railway::Railway
Railway(void)
Definition: elements.cpp:2655
EL_BUG_PERCENT_WRy_A
#define EL_BUG_PERCENT_WRy_A
Definition: elements.cpp:50
tole_Garden
Definition: tole_declaration.h:58
tov_OOats
Definition: tov_declaration.h:44
tole_Churchyard
Definition: tole_declaration.h:86
LE::m_running
long m_running
Definition: elements.h:446
UrbanVeg::UrbanVeg
UrbanVeg(void)
Definition: elements.cpp:2911
LE::m_PesticideGridCell
int m_PesticideGridCell
Definition: elements.h:457
Calendar::GetYearNumber
int GetYearNumber(void)
Definition: calendar.h:68
tole_RoadsideSlope
Definition: tole_declaration.h:83
g_el_tramline_decaytime_days
CfgInt g_el_tramline_decaytime_days("ELEM_TRAMLINE_DECAYTIME_DAYS", CFG_PRIVATE, 21)
VegElement::m_force_LAtotal
double m_force_LAtotal
Definition: elements.h:703
tole_MixedForest
Definition: tole_declaration.h:53
LE::m_gooseNos
int m_gooseNos[366]
The number of geese each day.
Definition: elements.h:491
VegElement::m_LAgreen
double m_LAgreen
Definition: elements.h:684
Fence::Fence
Fence(void)
Definition: elements.cpp:2749
Calendar::GetHour
int GetHour(void)
Definition: calendar.h:71
Saltmarsh::Saltmarsh
Saltmarsh(void)
Definition: elements.cpp:2397
LE::m_squares_in_map
int m_squares_in_map
Definition: elements.h:86
Field::Field
Field(void)
Definition: elements.cpp:2122
tov_OSetaside
Definition: tov_declaration.h:46
tov_PLMaizeSilage
Definition: tov_declaration.h:78
tov_OTriticale
Definition: tov_declaration.h:47
Pond::CalcLarvalFood
void CalcLarvalFood()
Calculates the amount of larval food present
Definition: elements.cpp:2822
tov_MaizeStrigling
Definition: tov_declaration.h:58
July
const int July
Definition: landscape.h:42
g_letype
class LE_TypeClass * g_letype
Definition: elements.cpp:277
VegElement::m_total_biomass_old
double m_total_biomass_old
Definition: elements.h:688
l_el_veg_start_lait
static CfgFloat l_el_veg_start_lait("ELEM_VEG_START_LAIT", CFG_PRIVATE, 1.08)
EL_BUG_PERCENT_SB_C
#define EL_BUG_PERCENT_SB_C
Definition: elements.cpp:40
VegElement::m_force_veg_height
double m_force_veg_height
Definition: elements.h:704
tov_OWinterWheatUndersown
Definition: tov_declaration.h:49
cfg_pollen_nectar_on
CfgBool cfg_pollen_nectar_on("ELE_POLLENNECTAR_ON", CFG_CUSTOM, false)
Flag to determine whether nectar and pollen models are used - should be set to true for pollinator mo...
Heath::Heath
Heath(void)
Definition: elements.cpp:2403
CropActualValues::missed_fi_app
int missed_fi_app
Definition: elements.h:564
tole_Copse
Definition: tole_declaration.h:82
tov_Undefined
Definition: tov_declaration.h:114
PlantGrowthData::GetLAtotalDiff
double GetLAtotalDiff(double a_ddegs, double a_yddegs, int a_plant, int a_phase)
Get the differential in LA total for the day degrees experienced.
Definition: plants.h:111
VegElement::m_green_biomass
double m_green_biomass
Definition: elements.h:689
VegElement::ForceGrowthTest
virtual void ForceGrowthTest(void)
Definition: elements.cpp:1904
LE::m_pollencurve
PollenNectarDevelopmentCurve * m_pollencurve
pointer to the correct pollen curve set
Definition: elements.h:546
tole_UnknownGrass
Definition: tole_declaration.h:91
l_el_rv_cut_jul
static CfgInt l_el_rv_cut_jul("ELEM_RV_CUT_JUL", CFG_PRIVATE, 35)
VegElement::m_force_LAgreen
double m_force_LAgreen
Definition: elements.h:702
harvest
Definition: treatment.h:82
LE::SetCropData
virtual void SetCropData(double, double, double, TTypesOfVegetation, double, int)
Definition: elements.h:167
Building::Building
Building(void)
Definition: elements.cpp:2737
VegElement::m_veg_cover
double m_veg_cover
Definition: elements.h:695
l_el_rv_cut_may
static CfgInt l_el_rv_cut_may("ELEM_RV_CUT_MAY", CFG_PRIVATE, 142)
tov_FieldPeasStrigling
Definition: tov_declaration.h:56
Orchard::DoDevelopment
virtual void DoDevelopment(void)
Definition: elements.cpp:2433
tole_BareRock
Definition: tole_declaration.h:75
VegElement::SetGrowthPhase
virtual void SetGrowthPhase(int a_phase)
Definition: elements.cpp:1851
tov_WinterBarleyStrigling
Definition: tov_declaration.h:59
ConiferousForest::ConiferousForest
ConiferousForest(void)
Definition: elements.cpp:2690
tole_Saltmarsh
Definition: tole_declaration.h:88
LE::m_totalNectar
double m_totalNectar
Definition: elements.h:542
tov_NLBeetSpring
Definition: tov_declaration.h:100
Weather::GetDDDegs
double GetDDDegs(long a_date)
Definition: weather.cpp:155
LE::m_openness
int m_openness
The openness metric for a field (if any)
Definition: elements.h:509
LE::GetGooseNos
int GetGooseNos()
For goose model functionality, returns the number of geese yesterday.
Definition: elements.cpp:542
RV_CUT_TOTAL
#define RV_CUT_TOTAL
Definition: elements.cpp:219
WaterBufferZone::ResetingVeg
void ResetingVeg(int a_today)
Definition: elements.cpp:2365
NaturalGrassDry::NaturalGrassDry
NaturalGrassDry(void)
Definition: elements.cpp:2562
LE::m_maxy
int m_maxy
Definition: elements.h:464
Field::GetPreviousCrop
TTypesOfVegetation GetPreviousCrop(int a_index)
Definition: elements.cpp:2176
l_el_veg_heightscale
static CfgInt l_el_veg_heightscale("ELEM_VEG_HEIGHTSCALE", CFG_PRIVATE, 16)
l_el_rv_cut_height
static CfgFloat l_el_rv_cut_height("ELEM_RV_CUT_HEIGHT", CFG_PRIVATE, 10.0)
tov_PLFodderLucerne1
Definition: tov_declaration.h:81
Freshwater
Definition: elements.h:1160
l_el_rv_may_1st
static CfgInt l_el_rv_may_1st("ELEM_RV_MAY_1ST", CFG_PRIVATE, 121)
tov_WinterWheat
Definition: tov_declaration.h:55
LE::m_soiltype
int m_soiltype
Definition: elements.h:513
WoodlandMargin::WoodlandMargin
WoodlandMargin(void)
Definition: elements.cpp:2707
LE::MDates
int MDates[2][25]
Definition: elements.h:530
RV_CUT_HEIGHT
#define RV_CUT_HEIGHT
Definition: elements.cpp:215
tov_OCloverGrassSilage1
Definition: tov_declaration.h:43
tov_PermanentGrassTussocky
Definition: tov_declaration.h:49
cfg_pest_productapplic_startdate2
CfgInt cfg_pest_productapplic_startdate2
RV_CUT_AUG
#define RV_CUT_AUG
Definition: elements.cpp:203
tole_Railway
Definition: tole_declaration.h:39
tov_PLWinterTriticale
Definition: tov_declaration.h:73
tov_Heath
Definition: tov_declaration.h:66
VegElement::GrazeVegetationTotal
virtual void GrazeVegetationTotal(double a_grams)
Definition: elements.cpp:2056
l_el_rv_cut_aug
static CfgInt l_el_rv_cut_aug("ELEM_RV_CUT_AUG", CFG_PRIVATE, 42)
cfg_pest_productapplic_startdate
CfgInt cfg_pest_productapplic_startdate
Definition: elements.cpp:120
LE::m_valid_y
int m_valid_y
Definition: elements.h:453
LargeRoad::LargeRoad
LargeRoad(void)
Definition: elements.cpp:2934
tole_RoadsideVerge
Definition: tole_declaration.h:38
NaturalGrassWet::NaturalGrassWet
NaturalGrassWet(void)
Definition: elements.cpp:2570
Calendar::GetMonth
int GetMonth(void)
Definition: calendar.h:69
tole_Pylon
Definition: tole_declaration.h:96
RV_CUT_SEP
#define RV_CUT_SEP
Definition: elements.cpp:206
tov_OCloverGrassGrazed2
Definition: tov_declaration.h:43
tov_PLPotatoes
Definition: tov_declaration.h:79
tov_NLCabbage
Definition: tov_declaration.h:95
PollenNectarDevelopmentCurveSet::m_pollencurveptr
PollenNectarDevelopmentCurve * m_pollencurveptr
Definition: plants.h:211
VegElement::m_forced_phase_shift
bool m_forced_phase_shift
Definition: elements.h:696
ForestElement::ForestElement
ForestElement(void)
Definition: elements.cpp:2675
tov_PLBeet
Definition: tov_declaration.h:80
Pond::m_LarvalFood
double m_LarvalFood
The amount of larval food present
Definition: elements.h:1186
LE::m_largeroad_load
static double m_largeroad_load[]
Definition: elements.h:528
LE::m_maxx
int m_maxx
Definition: elements.h:462
VegElement::RandomVegStartValues
void RandomVegStartValues(double *a_LAtotal, double *a_LAgreen, double *a_veg_height, double *a_weed_biomass)
Definition: elements.cpp:1843
WoodyEnergyCrop::WoodyEnergyCrop
WoodyEnergyCrop(void)
Definition: elements.cpp:2715
tole_WoodlandMargin
Definition: tole_declaration.h:98
cfg_UMPatchyChance
static CfgInt cfg_UMPatchyChance("UMPATCHYCHANCE", CFG_CUSTOM, 0)
VegElement::m_insect_pop
double m_insect_pop
Definition: elements.h:685
VegElement::m_vege_type
TTypesOfVegetation m_vege_type
Definition: elements.h:676
HedgeBank::HedgeBank
HedgeBank(void)
Definition: elements.cpp:2260
tov_PermanentSetaside
Definition: tov_declaration.h:49
Saltwater::Saltwater
Saltwater(void)
Definition: elements.cpp:2761
Field::DoDevelopment
virtual void DoDevelopment(void)
Definition: elements.cpp:2160
tole_WindTurbine
Definition: tole_declaration.h:97
tole_ActivePit
Definition: tole_declaration.h:63
l_el_weed_percent
static CfgFloat l_el_weed_percent("ELEM_WEED_PERCENT", CFG_PRIVATE, 0.1)
PermanentSetaside::PermanentSetaside
PermanentSetaside(void)
Definition: elements.cpp:2238
RoadsideSlope::RoadsideSlope
RoadsideSlope(void)
Definition: elements.cpp:2333
tov_Lawn
Definition: tov_declaration.h:63
tov_NLSpringBarleySpring
Definition: tov_declaration.h:104
cfg_pest_productapplic_startdate3
CfgInt cfg_pest_productapplic_startdate3
tov_PLWinterRye
Definition: tov_declaration.h:74
FloatToDouble
void FloatToDouble(double &, float)
VegElement::m_veg_phase
int m_veg_phase
Definition: elements.h:679
tov_OSpringBarley
Definition: tov_declaration.h:46
VegElement::ResetGeese
void ResetGeese(void)
Reset geese numbers to zero in case this was not done by the population manager (the normal situation...
Definition: elements.cpp:2048
GreenElement::DoDevelopment
virtual void DoDevelopment(void)
Definition: elements.cpp:2379
EL_BUG_PERCENT_Edges_A
#define EL_BUG_PERCENT_Edges_A
Definition: elements.cpp:68
tov_Setaside
Definition: tov_declaration.h:50
LE::m_minx
int m_minx
Definition: elements.h:463
AmenityGrass::AmenityGrass
AmenityGrass(void)
Definition: elements.cpp:2896
RiverBed::RiverBed
RiverBed(void)
Definition: elements.cpp:2860
PlantGrowthData::GetLAgreenDiffScaled
double GetLAgreenDiffScaled(double a_ddegs, double a_yddegs, int a_plant, int a_phase, double a_scaler)
Get the differential in LA green for the day degrees experienced, scalable depending on plant growth ...
Definition: plants.h:121
UrbanPark::UrbanPark
UrbanPark(void)
Definition: elements.cpp:2917
tov_OrchardCrop
Definition: tov_declaration.h:65
cfg_BBPatchyChance
static CfgFloat cfg_BBPatchyChance("BEETLEBANKBPATCHYCHANCE", CFG_CUSTOM, 0.5)
The chance that a beetlebank being created is patchy or not.
Wasteland::Wasteland
Wasteland(void)
Definition: elements.cpp:2578
tov_SpringBarleySeed
Definition: tov_declaration.h:52
tov_SpringBarleySKManagement
Definition: tov_declaration.h:65
BareRock::BareRock
BareRock(void)
Definition: elements.cpp:2886
l_el_o_cut_height
CfgFloat l_el_o_cut_height("ELEM_RV_CUT_HEIGHT", CFG_PRIVATE, 10.0)
LE::m_herbicidedelay
int m_herbicidedelay
Definition: elements.h:486
tole_MownGrass
Definition: tole_declaration.h:74
tov_WWheatPToxicControl
Definition: tov_declaration.h:55
tov_NLMaize
Definition: tov_declaration.h:91
tov_OWinterWheat
Definition: tov_declaration.h:66
LE::m_poison
bool m_poison
Definition: elements.h:516
tov_SpringBarleyStriglingCulm
Definition: tov_declaration.h:62
tov_FieldPeasSilage
Definition: tov_declaration.h:65
VegElement::m_weed_curve_num
int m_weed_curve_num
Definition: elements.h:678
Orchard::Cutting
void Cutting(int a_today)
Definition: elements.cpp:2475
l_el_rv_cut_green
static CfgFloat l_el_rv_cut_green("ELEM_RV_CUT_GREEN", CFG_PRIVATE, 1.5)
tov_OCarrots
Definition: tov_declaration.h:43
tole_YoungForest
Definition: tole_declaration.h:55
YoungForest::YoungForest
YoungForest(void)
Definition: elements.cpp:2699
harvest1
Definition: plants.h:55
tov_OWinterWheatUndersownExt
Definition: tov_declaration.h:63
tole_Stream
Definition: tole_declaration.h:89
EL_BUG_PERCENT_SB_B
#define EL_BUG_PERCENT_SB_B
Definition: elements.cpp:39
tov_NLGrassGrazedLast
Definition: tov_declaration.h:108
VegElement::IsMaize
virtual bool IsMaize()
Definition: elements.cpp:1591
LE::m_centroidx
int m_centroidx
Definition: elements.h:454
PollenNectarDevelopmentCurve::GetData
double GetData(int a_index)
The basic return function for the curve - day indexed.
Definition: plants.h:193
VegElement::ForceGrowthSpringTest
void ForceGrowthSpringTest(void)
Definition: elements.cpp:1915
PollenNectarDevelopmentData::GetPollenNectarCurvePtr
PollenNectarDevelopmentCurveSet GetPollenNectarCurvePtr(int a_almassLEref)
Definition: plants.cpp:566
PitDisused::PitDisused
PitDisused(void)
Definition: elements.cpp:2755
g_rand_uni
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni
tole_Foobar
Definition: tole_declaration.h:111
tov_OBarleyPeaCloverGrass
Definition: tov_declaration.h:41
tole_ConiferousForest
Definition: tole_declaration.h:54
LE::m_birdmaizeforage
double m_birdmaizeforage
The maize forage present in KJ/m2.
Definition: elements.h:503
LE::m_management_loop_detect_date
long m_management_loop_detect_date
Definition: elements.h:467
l_el_plant_biomass_proport
static CfgFloat l_el_plant_biomass_proport("ELEM_PLANT_BIOMASS_PROPORT", CFG_PRIVATE, 41.45)
tov_WinterWheatShort
Definition: tov_declaration.h:56
g_msg
class MapErrorMsg * g_msg
Definition: maperrormsg.cpp:41
tov_SpringBarleyGrass
Definition: tov_declaration.h:52
Pond::m_pondpesticide
double m_pondpesticide
Holds the pesticide content per unit pond water.
Definition: elements.h:1190
RV_CUT_JUL
#define RV_CUT_JUL
Definition: elements.cpp:200
LE::m_lastindex
unsigned int m_lastindex
Definition: elements.h:525
g_bug_percent_c
static double g_bug_percent_c[tov_Undefined]
Definition: elements.cpp:134
DrainageDitch::DrainageDitch
DrainageDitch(void)
Definition: elements.cpp:2872
PlantNursery::PlantNursery
PlantNursery(void)
Definition: elements.cpp:2666
l_pest_insecticide_amount
CfgFloat l_pest_insecticide_amount
l_el_bug_glue
static CfgFloat l_el_bug_glue("ELEM_BUG_GLUE", CFG_PRIVATE, 0.50)
Orchard::Orchard
Orchard(void)
Definition: elements.cpp:2411
tole_LargeRoad
Definition: tole_declaration.h:61
EL_BUG_PERCENT_A
#define EL_BUG_PERCENT_A
Definition: elements.cpp:32
VegElement::m_veg_patchy
bool m_veg_patchy
Definition: elements.h:694
LE_TypeClass::TranslateEleTypes
TTypesOfLandscapeElement TranslateEleTypes(int EleReference)
Definition: elements.cpp:2995
LE::m_valid_x
int m_valid_x
Definition: elements.h:452
LE::m_smallroad_load
static double m_smallroad_load[]
Definition: elements.h:529
Pylon::Pylon
Pylon(void)
Definition: elements.cpp:2978
LE::SetSprayedToday
void SetSprayedToday(bool a_didit)
Definition: elements.h:303
BuiltUpWithParkland::BuiltUpWithParkland
BuiltUpWithParkland(void)
Definition: elements.cpp:2922
WindTurbine::WindTurbine
WindTurbine(void)
Definition: elements.cpp:2984
VegElement::PollenNectarPhenologyCalculation
void PollenNectarPhenologyCalculation()
This methods calculates the daily availability of pollen and nectar per square meter and in total.
Definition: elements.cpp:1790
l_el_bug_slope
static CfgFloat l_el_bug_slope("ELEM_BUG_SLOPE", CFG_PRIVATE, 0.2)
LE::m_vegage
int m_vegage
Definition: elements.h:512
VegElement::IsGooseGrass
virtual bool IsGooseGrass()
Definition: elements.cpp:1644
cfg_PondLarvalFoodR
CfgFloat cfg_PondLarvalFoodR("POND_LARVALFOODFOODR", CFG_CUSTOM, 0.15)
The instanteous rate of growth for larval food (r from logistic equation)
LE::m_almass_le_type
int m_almass_le_type
This holds the ALMaSS element type reference number.
Definition: elements.h:482
tov_YoungForest
Definition: tov_declaration.h:60
VegElement::m_weed_biomass
double m_weed_biomass
Definition: elements.h:691
Parkland::Parkland
Parkland(void)
Definition: elements.cpp:2901
tov_OWinterBarleyExt
Definition: tov_declaration.h:65
MownGrass::DoDevelopment
virtual void DoDevelopment(void)
Definition: elements.cpp:2485
Pond::Pond
Pond(void)
Definition: elements.cpp:2776
VegElement::VegElement
VegElement(void)
Definition: elements.cpp:615
October
const int October
Definition: landscape.h:45
LE::m_lasttreat
vector< int > m_lasttreat
Definition: elements.h:524
cfg_pondpesticiderunoff
CfgFloat cfg_pondpesticiderunoff("POND_PEST_RUNOFFFACTOR", CFG_CUSTOM, 10.0)
The multiplication factor assumed to account for ingress of pesticide from run-off and soil water to ...
tov_SpringBarleySilage
Definition: tov_declaration.h:52
l_el_o_cut_total
CfgFloat l_el_o_cut_total("ELEM_RV_CUT_TOTAL", CFG_PRIVATE, 2.0)
LE::m_birdseedforage
double m_birdseedforage
The grain forage present in KJ/m2.
Definition: elements.h:501
tov_NLGrassGrazed1Spring
Definition: tov_declaration.h:107
VegElement
Definition: elements.h:568
PollenNectarDevelopmentData::tovGetPollenNectarCurvePtr
PollenNectarDevelopmentCurveSet tovGetPollenNectarCurvePtr(int a_tov_ref)
Definition: plants.cpp:582
EL_BUG_PERCENT_D
#define EL_BUG_PERCENT_D
Definition: elements.cpp:71
LE_TypeClass
Definition: elements.h:70
tov_DummyCropPestTesting
Definition: tov_declaration.h:112
LE::m_default_grazing_level
int m_default_grazing_level
Definition: elements.h:518
tole_Marsh
Definition: tole_declaration.h:41
LE::m_pig_grazing
bool m_pig_grazing
Definition: elements.h:519
Landscape::SupplyPesticide
double SupplyPesticide(int a_x, int a_y, PlantProtectionProducts a_ppp)
Gets total pesticide for a location.
Definition: Landscape.cpp:586
TTypesOfVegetation
TTypesOfVegetation
Definition: tov_declaration.h:30
tole_OrchardBand
Definition: tole_declaration.h:73
tov_SpringRape
Definition: tov_declaration.h:53
EL_BUG_PERCENT_WRy_B
#define EL_BUG_PERCENT_WRy_B
Definition: elements.cpp:51
tole_Pond
Definition: tole_declaration.h:101
EL_GROWTH_DAYDEG_MAGIC
#define EL_GROWTH_DAYDEG_MAGIC
Definition: elements.cpp:158
PollenNectarQuality::m_quantity
double m_quantity
Definition: plants.h:219
g_weed_percent
static double g_weed_percent[tov_Undefined]
Definition: elements.cpp:131
MownGrass::Cutting
void Cutting(int a_today)
Definition: elements.cpp:2522
LE::m_skylarkscrapes
bool m_skylarkscrapes
For management testing of skylark scrapes.
Definition: elements.h:88
Calendar::Date
long Date(void)
Definition: calendar.h:57
tov_PotatoesIndustry
Definition: tov_declaration.h:50
GreenElement::GreenElement
GreenElement(void)
Definition: elements.cpp:2374
CropActualValues::no_herb_app
int no_herb_app
Definition: elements.h:561
tov_SpringBarleyPTreatment
Definition: tov_declaration.h:63
MixedForest::MixedForest
MixedForest(void)
Definition: elements.cpp:2695
tov_FodderGrass
Definition: tov_declaration.h:62
LE::SetCropDataAll
virtual void SetCropDataAll(double, double, double, double, TTypesOfVegetation, double, double, int, double, bool, double)
Definition: elements.h:168
River::River
River(void)
Definition: elements.cpp:2864
tov_PLBeetSpr
Definition: tov_declaration.h:86
tov_PlantNursery
Definition: tov_declaration.h:66
tov_NLCatchPeaCrop
Definition: tov_declaration.h:106
cfg_goosecountperiod
CfgInt cfg_goosecountperiod("GOOSE_GOOSECOUNTPERIOD", CFG_CUSTOM, 1)
The number of days a goose count can be used.
tov_Carrots
Definition: tov_declaration.h:31
VegElement::InsectMortality
virtual void InsectMortality(double a_fraction)
Definition: elements.cpp:2206
MownGrass::m_DateCut
long m_DateCut
Definition: elements.h:1018
VegElement::Clean_CropDataStorage
void Clean_CropDataStorage(int index)
Definition: elements.cpp:2129
tov_NLCarrotsSpring
Definition: tov_declaration.h:101
CfgBool
Bool configurator entry class.
Definition: configurator.h:127
tole_PermPasture
Definition: tole_declaration.h:47
LE::GetGooseNosTodayTimed
int GetGooseNosTodayTimed()
For goose model functionality, returns the number of geese today at a predefined time.
Definition: elements.cpp:580
LE::m_olddays
long m_olddays
Definition: elements.h:466
l_el_weed_slope
static CfgFloat l_el_weed_slope("ELEM_WEED_SLOPE", CFG_PRIVATE, 0.15)
LE::m_goosegrazingforage
double m_goosegrazingforage[gs_foobar]
The grazing forage present in KJ/min. The last value indicates cereal 1 or not -1.
Definition: elements.h:505
g_landscape_p
class Landscape * g_landscape_p
Definition: Landscape.cpp:258
tov_NLPotatoesSpring
Definition: tov_declaration.h:103
MetalledPath::MetalledPath
MetalledPath(void)
Definition: elements.cpp:2974
LE::SetMownDecay
void SetMownDecay(int a_decaytime_days)
Definition: elements.h:314
LE::m_map_index
int m_map_index
Definition: elements.h:480
UrbanNoVeg::UrbanNoVeg
UrbanNoVeg(void)
Definition: elements.cpp:2906
Pond::m_pondquality
double m_pondquality
a factor used to alter the pond qualities (default behaviour is random 0.0-1.0)
Definition: elements.h:1194
FieldBoundary::FieldBoundary
FieldBoundary(void)
Definition: elements.cpp:2612
SmallRoad::GetTrafficLoad
virtual double GetTrafficLoad(void)
Definition: elements.cpp:2949
tov_SpringBarleyCloverGrass
Definition: tov_declaration.h:52
Landscape::SupplyGooseGrazingForageH
double SupplyGooseGrazingForageH(double a_height, GooseSpecies a_goose)
Returns the leaf forage resource as seen from a goose standpoint at a polygon based on the height onl...
Definition: landscape.h:541
LE::m_NectarM2
double m_NectarM2
Definition: elements.h:544
LE::GetGooseNosToday
int GetGooseNosToday()
For goose model functionality, returns the number of geese today.
Definition: elements.cpp:569
tov_WinterRape
Definition: tov_declaration.h:53
LE::GetGooseRoostDist
int GetGooseRoostDist(GooseSpecies a_goose)
For goose model functionality, returns the distance to closest roost.
Definition: elements.cpp:601
BeetleBank::BeetleBank
BeetleBank(void)
Definition: elements.cpp:2268
tov_OGrazingPigs
Definition: tov_declaration.h:44
UnsprayedFieldMargin::DoDevelopment
virtual void DoDevelopment(void)
Definition: elements.cpp:2626
tov_SugarBeet
Definition: tov_declaration.h:66
VegElement::ForceGrowthDevelopment
virtual void ForceGrowthDevelopment(void)
Definition: elements.cpp:1976
tov_NLBeet
Definition: tov_declaration.h:89
UnsprayedFieldMargin::UnsprayedFieldMargin
UnsprayedFieldMargin(void)
Definition: elements.cpp:2618
RiversidePlants::RiversidePlants
RiversidePlants(void)
Definition: elements.cpp:2557
LE::m_miny
int m_miny
Definition: elements.h:465
VegElement::m_CropDataStorage
CropActualValues m_CropDataStorage[2]
Keeps data on pesticide applications, biomass at harvest etc. Data for maximum two crops can be store...
Definition: elements.h:722
tole_PermanentSetaside
Definition: tole_declaration.h:46
tov_OSBarleySilage
Definition: tov_declaration.h:56
Orchard::m_DateCut
long m_DateCut
Definition: elements.h:995
tole_Canal
Definition: tole_declaration.h:106
tov_SpringBarleyPeaCloverGrassStrigling
Definition: tov_declaration.h:60
tov_PermanentGrassGrazed
Definition: tov_declaration.h:49
MownGrass::MownGrass
MownGrass(void)
Definition: elements.cpp:2418
tole_UrbanPark
Definition: tole_declaration.h:79
cfg_pest_productapplic_period
CfgInt cfg_pest_productapplic_period
Definition: elements.cpp:123
LE::GetLastTreatment
int GetLastTreatment(int *a_index)
Definition: elements.cpp:511
c_SolarConversion
const double c_SolarConversion[2][81]
Definition: elements.cpp:103
Pond::m_LarvalFoodScaler
double m_LarvalFoodScaler
The proportion of larval food per m2
Definition: elements.h:1188
tov_CloverGrassGrazed2
Definition: tov_declaration.h:33
Stream::Stream
Stream(void)
Definition: elements.cpp:2958
tole_Track
Definition: tole_declaration.h:59
tov_WWheatPControl
Definition: tov_declaration.h:55
PollenNectarDevelopmentData
A standard class to manage a range of pollen and nectar development curves based on indexed rates.
Definition: plants.h:224
OrchardBand::m_LastSprayed
long m_LastSprayed
Definition: elements.h:1006
cfg_goose_GrainDecayRateWinter
CfgFloat cfg_goose_GrainDecayRateWinter
g_el_herbicide_delaytime_days
CfgInt g_el_herbicide_delaytime_days("ELEM_HERBICIDE_DELAYTIME_DAYS", CFG_PRIVATE, 35)
Pesticide::DailyQueueAdd
void DailyQueueAdd(LE *a_element_sprayed, double a_amount, PlantProtectionProducts a_ppp)
Definition: pesticide.cpp:140
tov_PLWinterRape
Definition: tov_declaration.h:71
VegElement::SetVegType
virtual void SetVegType(TTypesOfVegetation a_vege_type, TTypesOfVegetation a_weed_type)
Definition: elements.cpp:2144
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: maperrormsg.cpp:59
RoadsideVerge
Definition: elements.h:795
tov_PLBeans
Definition: tov_declaration.h:87
tov_SpringBarleyCloverGrassStrigling
Definition: tov_declaration.h:58
LE::m_lastsownvegtype
TTypesOfVegetation m_lastsownvegtype
Records the last vegegetation type that was sown on the element.
Definition: elements.h:507
tov_Potatoes
Definition: tov_declaration.h:50
tov_WinterRyeStrigling
Definition: tov_declaration.h:59
tov_PLWinterBarley
Definition: tov_declaration.h:72
PlantGrowthData::GetHeightDiff
double GetHeightDiff(double a_ddegs, double a_yddegs, int a_plant, int a_phase)
Get the differential in veg height for the day degrees experienced.
Definition: plants.h:115
VegElement::m_newoldgrowthindex
int m_newoldgrowthindex
Definition: elements.h:699
VegElement::m_veg_biomass
double m_veg_biomass
Definition: elements.h:686
EL_VEG_START_LAIT
#define EL_VEG_START_LAIT
Definition: elements.cpp:187
tov_WinterWheatStriglingCulm
Definition: tov_declaration.h:62
mow
Definition: treatment.h:93
LE::m_yddegs
double m_yddegs
Definition: elements.h:521
EL_BUG_PERCENT_Edges_B
#define EL_BUG_PERCENT_Edges_B
Definition: elements.cpp:69
tov_NLTulips
Definition: tov_declaration.h:96
l_el_read_bug_percentage_file
static CfgBool l_el_read_bug_percentage_file("ELEM_READ_BUG_PERCENTAGE_FILE", CFG_CUSTOM, false)
tov_WinterRapeStrigling
Definition: tov_declaration.h:59
Hedges::Hedges
Hedges(void)
Definition: elements.cpp:2250
CropActualValues::tov_type
TTypesOfVegetation tov_type
Definition: elements.h:557
PlantGrowthData::GetStartValue
double GetStartValue(int a_veg_type, int a_phase, int a_type)
Definition: plants.h:127
EL_BUG_PERCENT_C
#define EL_BUG_PERCENT_C
Definition: elements.cpp:34
PlantGrowthData::GetHeightDiffScaled
double GetHeightDiffScaled(double a_ddegs, double a_yddegs, int a_plant, int a_phase, double a_scaler)
Get the differential in veg height for the day degrees experienced, scalable depending on plant growt...
Definition: plants.h:125
l_el_rv_cut_oct
static CfgInt l_el_rv_cut_oct("ELEM_RV_CUT_OCT", CFG_PRIVATE, 49)
VegElement::m_crop_index
int m_crop_index
Definition: elements.h:723
Pond::DoDevelopment
virtual void DoDevelopment(void)
Definition: elements.cpp:2783
tole_NaturalGrassWet
Definition: tole_declaration.h:87
LE::m_high
bool m_high
Definition: elements.h:515
LE::m_gooseSpNos
int m_gooseSpNos[366][gs_foobar]
The number of geese of each species each day.
Definition: elements.h:493
EL_BUG_PERCENT_WRy_C
#define EL_BUG_PERCENT_WRy_C
Definition: elements.cpp:52
LE::m_days_since_insecticide_spray
int m_days_since_insecticide_spray
Definition: elements.h:514
tov_OMaizeSilage
Definition: tov_declaration.h:65
VegElement::IsMatureCereal
virtual bool IsMatureCereal()
Definition: elements.cpp:1534
tole_Orchard
Definition: tole_declaration.h:71
RV_CUT_JUN
#define RV_CUT_JUN
Definition: elements.cpp:197
g_biomass_scale
static double g_biomass_scale[tov_Undefined]
Definition: elements.cpp:130
tole_MetalledPath
Definition: tole_declaration.h:84
tov_Maize
Definition: tov_declaration.h:36
CropActualValues::biomass_at_harvest
double biomass_at_harvest
Definition: elements.h:558
SandDune::SandDune
SandDune(void)
Definition: elements.cpp:2891
NonVegElement
Definition: elements.h:1028
LE::m_farmfunc_tried_to_do
int m_farmfunc_tried_to_do
Definition: elements.h:483
OrchardBand::OrchardBand
OrchardBand(void)
Definition: elements.cpp:2425
CropActualValues::area
double area
Definition: elements.h:560
tov_OWinterRape
Definition: tov_declaration.h:47
tov_WWheatPTreatment
Definition: tov_declaration.h:55
RiversideTrees::RiversideTrees
RiversideTrees(void)
Definition: elements.cpp:2649
tole_SandDune
Definition: tole_declaration.h:81
LE::MConsts
int MConsts[10]
Definition: elements.h:531
CfgFloat::value
double value(void)
Definition: configurator.h:118
RV_CUT_OCT
#define RV_CUT_OCT
Definition: elements.cpp:209
LE::m_countrydesignation
int m_countrydesignation
Definition: elements.h:470
g_crops
class PlantGrowthData * g_crops
Definition: plants.cpp:41
tole_WoodyEnergyCrop
Definition: tole_declaration.h:94
BeetleBank::DoDevelopment
virtual void DoDevelopment(void)
Definition: elements.cpp:3708
l_el_growth_phase_shift_level
static CfgFloat l_el_growth_phase_shift_level("ELEM_GROWTH_PHASE_SHIFT_LEVEL", CFG_PRIVATE, 0.5)
EL_BUG_PERCENT_WR_C
#define EL_BUG_PERCENT_WR_C
Definition: elements.cpp:58
tov_FieldPeas
Definition: tov_declaration.h:34
tov_SpringBarleyStriglingSingle
Definition: tov_declaration.h:60
tov_BroadBeans
Definition: tov_declaration.h:66
VegElement::m_dead_biomass
double m_dead_biomass
Definition: elements.h:690
LE_TypeClass::TranslateVegTypes
TTypesOfVegetation TranslateVegTypes(int VegReference)
Definition: elements.cpp:3088
tov_Wasteland
Definition: tov_declaration.h:66
PollenNectarDevelopmentCurveSet::m_nectarcurveptr
PollenNectarDevelopmentCurve * m_nectarcurveptr
Definition: plants.h:212
tov_NLGrassGrazed1
Definition: tov_declaration.h:97
LE::m_owner_index
int m_owner_index
Definition: elements.h:472
tole_River
Definition: tole_declaration.h:65
tov_OSeedGrass1
Definition: tov_declaration.h:46
VegElement::m_oldLAtotal
double m_oldLAtotal
Definition: elements.h:683
LE::m_totalPollen
double m_totalPollen
Definition: elements.h:541
RoadsideVerge::Cutting
void Cutting(int a_today)
Definition: elements.cpp:2323
tov_OFodderBeet
Definition: tov_declaration.h:65
g_bug_percent_d
static double g_bug_percent_d[tov_Undefined]
Definition: elements.cpp:135
ppp_1
Definition: farm.h:422
tov_NLWinterWheat
Definition: tov_declaration.h:94
Wasteland::DoDevelopment
virtual void DoDevelopment()
Definition: elements.cpp:2603
tole_Scrub
Definition: tole_declaration.h:42
LE::SetStubble
void SetStubble(bool a_flag)
Sets the in stubble flag.
Definition: elements.h:390
LE::SetPollenNectarData
void SetPollenNectarData(int a_almasstype)
sets the pollen and nectar information
Definition: elements.cpp:605
LE::GetGooseSpNosTodayTimed
int GetGooseSpNosTodayTimed(GooseSpecies a_goose)
For goose model functionality, returns the number of geese per species yesterday at a predefined time...
Definition: elements.cpp:597
tov_PLMaize
Definition: tov_declaration.h:77
CFG_CUSTOM
Definition: configurator.h:60
tov_OCloverGrassGrazed1
Definition: tov_declaration.h:43
VegElement::m_LAtotal
double m_LAtotal
Definition: elements.h:682
tole_PermPastureTussocky
Definition: tole_declaration.h:45
tov_OSpringBarleyPigs
Definition: tov_declaration.h:47
tov_SpringBarleySpr
Definition: tov_declaration.h:66
LE::m_border
LE * m_border
Definition: elements.h:447
Landscape::SupplyGlobalRadiation
double SupplyGlobalRadiation()
Definition: landscape.h:1341
LE
Definition: elements.h:81
LE::m_tramlinesdecay
int m_tramlinesdecay
Definition: elements.h:484
tov_PLSpringBarley
Definition: tov_declaration.h:76
PermPasture::PermPasture
PermPasture(void)
Definition: elements.cpp:2210
tov_PermanentGrassLowYield
Definition: tov_declaration.h:63
LE::SetHigh
void SetHigh(bool a_high)
Definition: elements.h:225
cfg_goose_grass_to_winter_cereal_scaler
CfgFloat cfg_goose_grass_to_winter_cereal_scaler
LE::SetCopyTreatment
void SetCopyTreatment(int a_treatment)
Definition: elements.cpp:486
tov_WinterWheatStrigling
Definition: tov_declaration.h:59
VegElement::m_force_Weed
double m_force_Weed
Definition: elements.h:701
tole_Field
Definition: tole_declaration.h:43
LE::m_cattle_grazing
int m_cattle_grazing
Definition: elements.h:517
g_bug_percent_a
static double g_bug_percent_a[tov_Undefined]
Definition: elements.cpp:132
OrchardBand::DoDevelopment
virtual void DoDevelopment(void)
Definition: elements.cpp:2533
tole_PermPastureTussockyWet
Definition: tole_declaration.h:100
Carpark::Carpark
Carpark(void)
Definition: elements.cpp:2966
tov_WinterWheatStriglingSingle
Definition: tov_declaration.h:62
tole_FieldBoundary
Definition: tole_declaration.h:40
PlantGrowthData::GetLAtotalDiffScaled
double GetLAtotalDiffScaled(double a_ddegs, double a_yddegs, int a_plant, int a_phase, double a_scaler)
Get the differential in LA total for the day degrees experienced, scalable depending on plant growth ...
Definition: plants.h:123
LE::SetPollenNectarCurves
void SetPollenNectarCurves(PollenNectarDevelopmentCurve *a_pollencurnve, PollenNectarDevelopmentCurve *a_nectarcurve)
Set method for pollen and nectar curves.
Definition: elements.h:435
ForestElement
Definition: elements.h:929
tole_PermPastureLowYield
Definition: tole_declaration.h:44
EL_BUG_PERCENT_G_B
#define EL_BUG_PERCENT_G_B
Definition: elements.cpp:63
EL_BUG_PERCENT_WR_A
#define EL_BUG_PERCENT_WR_A
Definition: elements.cpp:56
VegElement::ReduceVeg
virtual void ReduceVeg(double a_reduc)
Definition: elements.cpp:2086
tole_WaterBufferZone
Definition: tole_declaration.h:108
l_pest_productOrchard_amount
static CfgFloat l_pest_productOrchard_amount("PEST_PRODUCTORCHARD_AMOUNT", CFG_CUSTOM, 0.0)
LE::SetLastTreatment
void SetLastTreatment(int a_treatment)
Definition: elements.cpp:490
WARN_FILE
Definition: maperrormsg.h:37
LE::m_owner_file
int m_owner_file
Definition: elements.h:471
LE::m_ddegs
double m_ddegs
Definition: elements.h:522
EL_BUG_PERCENT_G_A
#define EL_BUG_PERCENT_G_A
Definition: elements.cpp:62
CfgInt
Integer configurator entry class.
Definition: configurator.h:87
tole_RiversideTrees
Definition: tole_declaration.h:51
LE::m_centroidy
int m_centroidy
Definition: elements.h:455
FishFarm::FishFarm
FishFarm(void)
Definition: elements.cpp:2771
tole_RiverBed
Definition: tole_declaration.h:104
tov_PLCarrots
Definition: tov_declaration.h:83
tov_WinterBarley
Definition: tov_declaration.h:53
VegElement::SetVegPatchy
virtual void SetVegPatchy(bool p)
Definition: elements.h:585
tov_NaturalGrass
Definition: tov_declaration.h:37
LargeRoad::GetTrafficLoad
virtual double GetTrafficLoad(void)
Definition: elements.cpp:2939
VegElement::m_curve_num
int m_curve_num
Definition: elements.h:677
PermPastureLowYield::PermPastureLowYield
PermPastureLowYield(void)
Definition: elements.cpp:2218
Vildtager::Vildtager
Vildtager(void)
Definition: elements.cpp:2659
LE::GetGooseSpNosToday
int GetGooseSpNosToday(GooseSpecies a_goose)
For goose model functionality, returns the number of geese per species yesterday.
Definition: elements.cpp:592
TTypesOfLandscapeElement
TTypesOfLandscapeElement
Definition: tole_declaration.h:36
LE::DoCopy
void DoCopy(const LE *a_Le)
a copy function to be used because a copy constuctor won't work
Definition: elements.cpp:372
tole_IndividualTree
Definition: tole_declaration.h:93
Marsh
Definition: elements.h:843
VegElement::RecalculateBugsNStuff
virtual void RecalculateBugsNStuff(void)
This method is responsible for.
Definition: elements.cpp:1678
ActivePit::ActivePit
ActivePit(void)
Definition: elements.cpp:2928
tov_SeedGrass2
Definition: tov_declaration.h:50
cfg_PermanentVegGrowthMinScaler
CfgFloat cfg_PermanentVegGrowthMinScaler("VEG_GROWTHSCALERMIN", CFG_CUSTOM, 1.0)
Scales the growth of vegetation - min value.
RoadsideSlope::DoDevelopment
virtual void DoDevelopment(void)
Definition: elements.cpp:2339
tov_WaterBufferZone
Definition: tov_declaration.h:110
VegElement::m_digestability
double m_digestability
Definition: elements.h:697
NaturalGrassWet::DoDevelopment
virtual void DoDevelopment()
Definition: elements.cpp:2594
RoadsideVerge::RoadsideVerge
RoadsideVerge(void)
Definition: elements.cpp:2276
CfgFloat
Double configurator entry class.
Definition: configurator.h:106
LE::m_gooseNosTimed
int m_gooseNosTimed[366]
The number of geese at a predefined time per day.
Definition: elements.h:495
tole_PitDisused
Definition: tole_declaration.h:50
tov_MaizeSilage
Definition: tov_declaration.h:62
VegElement::SetCropDataAll
virtual void SetCropDataAll(double, double, double, double, TTypesOfVegetation, double, double, int, double, bool, double)
Definition: elements.cpp:2191
LE::m_owner
Farm * m_owner
Definition: elements.h:469
Scrub::Scrub
Scrub(void)
Definition: elements.cpp:2384
LE::m_vegddegs
double m_vegddegs
Definition: elements.h:520
l_el_bug_percentage_file
static CfgStr l_el_bug_percentage_file("ELEM_BUG_PERCENTAGE_FILE", CFG_CUSTOM,"bugpercents.txt")
tole_Wasteland
Definition: tole_declaration.h:92
tov_NoGrowth
Definition: tov_declaration.h:38
Garden::Garden
Garden(void)
Definition: elements.cpp:2731
tov_OPotatoes
Definition: tov_declaration.h:44
tole_HeritageSite
Definition: tole_declaration.h:90
CropActualValues::harvested
bool harvested
Definition: elements.h:559
l_el_growth_daydeg_magic
static CfgInt l_el_growth_daydeg_magic("ELEM_GROWTH_DAYDEG_MAGIC", CFG_PRIVATE, 100)
CFG_PRIVATE
Definition: configurator.h:62
CfgInt::value
int value(void)
Definition: configurator.h:98
tole_PlantNursery
Definition: tole_declaration.h:95
Copse::Copse
Copse(void)
Definition: elements.cpp:2680
VegElement::m_veg_density
int m_veg_density
Definition: elements.h:693
LE::m_gooseSpNosTimed
int m_gooseSpNosTimed[366][gs_foobar]
The number of geese of each species at a predefined time per day.
Definition: elements.h:497
EL_BUG_PERCENT_Edges_C
#define EL_BUG_PERCENT_Edges_C
Definition: elements.cpp:70
tole_DrainageDitch
Definition: tole_declaration.h:105
l_el_rv_cut_jun
static CfgInt l_el_rv_cut_jun("ELEM_RV_CUT_JUN", CFG_PRIVATE, 28)
CropActualValues::no_fi_app
int no_fi_app
Definition: elements.h:563
tov_OSeedGrass2
Definition: tov_declaration.h:46
VegElement::m_total_biomass
double m_total_biomass
Definition: elements.h:687
LE::GetUnsprayedMarginPolyRef
int GetUnsprayedMarginPolyRef(void)
Definition: elements.h:319
janfirst
Definition: plants.h:52
PlantGrowthData::VegTypeToCurveNum
int VegTypeToCurveNum(TTypesOfVegetation VegReference)
Definition: plants.cpp:226
VegElement::IsGrass
virtual bool IsGrass()
Definition: elements.cpp:1610
LE::m_nectarcurve
PollenNectarDevelopmentCurve * m_nectarcurve
pointer to the correct nectar curve set
Definition: elements.h:548
g_nectarpollen
class PollenNectarDevelopmentData * g_nectarpollen
Definition: Landscape.cpp:241
VegElement::m_growth_scaler
double m_growth_scaler
Definition: elements.h:680
tov_NLGrassGrazed2
Definition: tov_declaration.h:98
RV_CUT_GREEN
#define RV_CUT_GREEN
Definition: elements.cpp:217
tov_OFieldPeasSilage
Definition: tov_declaration.h:56
PermPastureTussocky::PermPastureTussocky
PermPastureTussocky(void)
Definition: elements.cpp:2227
Calendar::DayInYear
int DayInYear(void)
Definition: calendar.h:58
VegElement::ZeroVeg
virtual void ZeroVeg(void)
Definition: elements.cpp:1989
cfg_OrchardSprayDay
static CfgInt cfg_OrchardSprayDay("TOX_ORCHARDSPRAYDAY", CFG_CUSTOM, 150)
tov_SpringWheat
Definition: tov_declaration.h:53
tov_SpringBarley
Definition: tov_declaration.h:52
LE_TypeClass::BackTranslateVegTypes
int BackTranslateVegTypes(TTypesOfVegetation VegReference)
Definition: elements.cpp:3345
tov_OWinterRye
Definition: tov_declaration.h:49
tole_Carpark
Definition: tole_declaration.h:85
tov_NLCarrots
Definition: tov_declaration.h:90
g_date
class Calendar * g_date
Definition: calendar.cpp:38
RV_CUT_MAY
#define RV_CUT_MAY
Definition: elements.cpp:194
tov_OFirstYearDanger
Definition: tov_declaration.h:44
tole_DeciduousForest
Definition: tole_declaration.h:52
Farm::GetPreviousCrop
TTypesOfVegetation GetPreviousCrop(int a_index)
Definition: farm.h:909
tov_CloverGrassGrazed1
Definition: tov_declaration.h:32
LE::m_PollenM2
double m_PollenM2
Definition: elements.h:543
WaterBufferZone::DoDevelopment
virtual void DoDevelopment(void)
Definition: elements.cpp:2354
GreenElement
Definition: elements.h:825
tole_Hedges
Definition: tole_declaration.h:37
EL_GROWTH_DATE_MAGIC
#define EL_GROWTH_DATE_MAGIC
Definition: elements.cpp:164
PlantGrowthData::StartValid
bool StartValid(int a_veg_type, int a_phase)
Definition: plants.cpp:409
tov_OFieldPeas
Definition: tov_declaration.h:43
tov_FodderBeet
Definition: tov_declaration.h:35
RoadsideVerge::m_DateCut
long m_DateCut
Definition: elements.h:799
VegElement::m_oldnewgrowth
double m_oldnewgrowth[32]
Definition: elements.h:698
tov_WinterRye
Definition: tov_declaration.h:55
tov_PLFodderLucerne2
Definition: tov_declaration.h:82
Marsh::Marsh
Marsh(void)
Definition: elements.cpp:2390
tov_Triticale
Definition: tov_declaration.h:53
tov_PLWinterWheat
Definition: tov_declaration.h:70
VegElement::GrazeVegetation
virtual void GrazeVegetation(double a_grams, bool a_force)
Definition: elements.cpp:2061
tole_Vildtager
Definition: tole_declaration.h:99
CropActualValues::missed_herb_app
int missed_herb_app
Definition: elements.h:562
cfg_beetlebankinsectscaler
static CfgFloat cfg_beetlebankinsectscaler("ELE_BBINSECTSCALER", CFG_CUSTOM, 1.0)
HeritageSite::HeritageSite
HeritageSite(void)
Definition: elements.cpp:2970
LE::m_rot_index
int m_rot_index
Definition: elements.h:473
Calendar::JanFirst
bool JanFirst(void)
Definition: calendar.h:74
EL_BUG_PERCENT_B
#define EL_BUG_PERCENT_B
Definition: elements.cpp:33
l_el_rv_cut_total
static CfgFloat l_el_rv_cut_total("ELEM_RV_CUT_TOTAL", CFG_PRIVATE, 2.0)
March
const int March
Definition: landscape.h:38
tole_RefuseSite
Definition: tole_declaration.h:107
sleep_all_day
Definition: treatment.h:33
tole_Chameleon
Definition: tole_declaration.h:110
Canal::Canal
Canal(void)
Definition: elements.cpp:2868
LE::m_poly
int m_poly
The polyref number for this polygon.
Definition: elements.h:477
CfgBool::value
bool value(void)
Definition: configurator.h:135
LE::m_signal_mask
LE_Signal m_signal_mask
Definition: elements.h:532
EL_BUG_PERCENT_WW_C
#define EL_BUG_PERCENT_WW_C
Definition: elements.cpp:46
tov_NLPermanentGrassGrazed
Definition: tov_declaration.h:99
tole_AmenityGrass
Definition: tole_declaration.h:76
cfg_OrchardSprayDay2
static CfgInt cfg_OrchardSprayDay2("TOX_ORCHARDSPRAYDAYTWO", CFG_CUSTOM, 200000)
Coast::Coast
Coast(void)
Definition: elements.cpp:2881
VegElement::m_force_growth
bool m_force_growth
Definition: elements.h:705
Track::Track
Track(void)
Definition: elements.cpp:2954
l_el_weed_glue
static CfgFloat l_el_weed_glue("ELEM_WEED_GLUE", CFG_PRIVATE, 0.99)
cfg_ele_weedscaling
static CfgFloat cfg_ele_weedscaling("ELE_WEEDSCALING", CFG_CUSTOM, 1.0)
tole_NaturalGrassDry
Definition: tole_declaration.h:48
LE::m_vege_danger_store
int m_vege_danger_store
Definition: elements.h:456
tole_BeetleBank
Definition: tole_declaration.h:69
Landscape::SupplyPolyRef
int SupplyPolyRef(int a_x, int a_y)
Definition: landscape.h:1488
cfg_goose_GrainDecayRateSpring
CfgFloat cfg_goose_GrainDecayRateSpring
tov_SeedGrass1
Definition: tov_declaration.h:50
EL_BUG_PERCENT_WR_B
#define EL_BUG_PERCENT_WR_B
Definition: elements.cpp:57
Landscape::SupplyFarmIntensity
int SupplyFarmIntensity(int a_x, int a_y)
Definition: Landscape.cpp:756
VegElement::CalcGooseForageResources
void CalcGooseForageResources()
Calculates spilled grain and grazing forage resources for geese.
Definition: elements.cpp:1805
LE::m_mowndecay
int m_mowndecay
Definition: elements.h:485
HedgeBank::DoDevelopment
virtual void DoDevelopment(void)
Definition: elements.cpp:3703
EL_BUG_PERCENT_G_C
#define EL_BUG_PERCENT_G_C
Definition: elements.cpp:64
VegElement::ForceGrowthInitialize
virtual void ForceGrowthInitialize(void)
Definition: elements.cpp:1930
Freshwater::Freshwater
Freshwater(void)
Definition: elements.cpp:2766
VegElement::m_veg_height
double m_veg_height
Definition: elements.h:692
NonVegElement::NonVegElement
NonVegElement(void)
Definition: elements.cpp:2722
tov_OSpringBarleyGrass
Definition: tov_declaration.h:46
g_weather
class Weather * g_weather
Definition: weather.cpp:41
LE::LE
LE(void)
Definition: elements.cpp:279
Pond::CalcPondPesticide
void CalcPondPesticide()
Calculates the amount of pesticide per unit pond water
Definition: elements.cpp:2791
tole_Coast
Definition: tole_declaration.h:67
tole_BuiltUpWithParkland
Definition: tole_declaration.h:80
VegElement::ReadBugPercentageFile
void ReadBugPercentageFile(void)
Definition: elements.cpp:1439
tole_SmallRoad
Definition: tole_declaration.h:60
LE::GetQuarryNos
int GetQuarryNos()
For goose model functionality, returns the number of geese yesterday which can be hunted as legal qua...
Definition: elements.cpp:555
LE::m_unsprayedmarginpolyref
int m_unsprayedmarginpolyref
Definition: elements.h:448
LE::m_management_loop_detect_count
long m_management_loop_detect_count
Definition: elements.h:468
NaturalGrassDry::DoDevelopment
virtual void DoDevelopment()
Definition: elements.cpp:2585
tov_None
Definition: tov_declaration.h:39
SmallRoad::SmallRoad
SmallRoad(void)
Definition: elements.cpp:2944
g_bug_percent_b
static double g_bug_percent_b[tov_Undefined]
Definition: elements.cpp:133
RoadsideVerge::DoDevelopment
virtual void DoDevelopment(void)
Definition: elements.cpp:2284
tole_Fence
Definition: tole_declaration.h:57
tov_OSpringBarleyExt
Definition: tov_declaration.h:63
marchfirst
Definition: plants.h:54
sow
Definition: plants.h:53
EL_VEG_HEIGHTSCALE
#define EL_VEG_HEIGHTSCALE
Definition: elements.cpp:191
LE::m_is_in_map
bool m_is_in_map
Definition: elements.h:459
Landscape::IncTreatCounter
void IncTreatCounter(int a_treat)
Definition: Landscape.cpp:3575
cfg_PermanentVegGrowthMaxScaler
CfgFloat cfg_PermanentVegGrowthMaxScaler("VEG_GROWTHSCALERMAX", CFG_CUSTOM, 1.0)
Scales the growth of vegetation - max value.
cfg_calc_pond_pesticide
CfgBool cfg_calc_pond_pesticide("POND_PEST_CALC_ON", CFG_CUSTOM, false)
Flag to determine whether to calculate pond pesticide concentration.
tole_Heath
Definition: tole_declaration.h:70
tov_NLCabbageSpring
Definition: tov_declaration.h:105
RefuseSite::RefuseSite
RefuseSite(void)
Definition: elements.cpp:2876
LE::m_type
TTypesOfLandscapeElement m_type
Definition: elements.h:487
IndividualTree::IndividualTree
IndividualTree(void)
Definition: elements.cpp:2711
l_el_o_cut_green
CfgFloat l_el_o_cut_green("ELEM_RV_CUT_GREEN", CFG_PRIVATE, 1.5)