File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/extensions/ams.js
ALMaSS  1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PLWinterWheat Class Reference

PLWinterWheat class
. More...

#include <PLWinterWheat.h>

Inheritance diagram for PLWinterWheat:
Crop

Public Member Functions

virtual bool Do (Farm *a_farm, LE *a_field, FarmEvent *a_ev)
 The one and only method for a crop management plan. All farm actions go through here. More...
 
 PLWinterWheat (TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
 
void SetUpFarmCategoryInformation ()
 
- Public Member Functions inherited from Crop
virtual ~Crop ()
 
 Crop (TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
 
int GetFirstDate (void)
 
void ChooseNextCrop (int a_no_dates)
 Chooses the next crop to grow in a field. More...
 
int GetCropClassification ()
 
void SetCropClassification (int a_classification)
 
void GetCropType (TTypesOfCrops a_toc)
 
TTypesOfCrops GetCropType ()
 
FarmManagementCategory LookUpManagementCategory (int a_todo)
 
bool GetForceSpringOK ()
 

Additional Inherited Members

- Public Attributes inherited from Crop
TTypesOfVegetation m_tov
 
- Protected Member Functions inherited from Crop
void SimpleEvent (long a_date, int a_todo, bool a_lock)
 Adds an event to this crop management. More...
 
void SimpleEvent_ (long a_date, int a_todo, bool a_lock, Farm *a_farm, LE *a_field)
 Adds an event to this crop management without relying on member variables. More...
 
bool StartUpCrop (int a_spring, std::vector< std::vector< int >> a_flexdates, int a_todo)
 
Holds the translation between the farm operation enum for each cropand the farm management category associated with it More...
 
bool AphidDamage (LE *a_field)
 Compares aphid numbers per m2 with a threshold to return true if threshold is exceeded. More...
 
- Protected Attributes inherited from Crop
Farmm_farm
 
LEm_field
 
FarmEventm_ev
 
int m_first_date
 
int m_count
 
int m_last_date
 
int m_ddegstoharvest
 
int m_base_elements_no
 
Landscapem_OurLandscape
 
bool m_forcespringpossible = false
 Used to signal that the crop can be forced to start in spring. More...
 
TTypesOfCrops m_toc
 The Crop type in terms of the TTypesOfCrops list (smaller list than tov, no country designation) More...
 
int m_CropClassification
 Contains information on whether this is a winter crop, spring crop, or catch crop that straddles the year boundary (0,1,2) More...
 
vector< FarmManagementCategorym_ManagementCategories
 Holds the translation between the farm operation enum for each crop and the farm management category associated with it. More...
 
- Static Protected Attributes inherited from Crop
static int m_date_modifier = 0
 Holds a value that shifts test pesticide use by this many days in crops modified to use it. More...
 

Detailed Description

PLWinterWheat class
.

See PLWinterWheat.h::PLWinterWheatToDo for a complete list of all possible events triggered codes by the winter wheat management plan. When triggered these events are handled by Farm and are available as information for other objects such as animal and bird models.

Constructor & Destructor Documentation

◆ PLWinterWheat()

PLWinterWheat::PLWinterWheat ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
103  : Crop(a_tov, a_toc, a_L)
104  {
105  // When we start it off, the first possible date for a farm operation is 20th September
106  // This information is used by other crops when they decide how much post processing of
107  // the management is allowed after harvest before the next crop starts.
108  m_first_date=g_date->DayInYear( 20,9 );
109  // Create the farm operation to farm management category translation
111  }

References Calendar::DayInYear(), g_date, Crop::m_first_date, and SetUpFarmCategoryInformation().

Member Function Documentation

◆ Do()

bool PLWinterWheat::Do ( Farm a_farm,
LE a_field,
FarmEvent a_ev 
)
virtual

The one and only method for a crop management plan. All farm actions go through here.

Called every time something is done to the crop by the farmer in the first instance it is always called with m_ev->todo set to start, but susequently will be called whenever the farmer wants to carry out a new operation.
This method details all the management and relationships between operations necessary to grow and ALMaSS crop - in this case conventional winter wheat.

Reimplemented from Crop.

73 {
74  /******************** This block can be added to the top of all Crop::Do methods ***********************************************/
75  m_farm = a_farm; // These assignments are necessary, not for this method but for related event calls
76  m_field = a_field;
77  m_ev = a_ev;
78  bool done = false; // The boolean value done indicates when we are totally finished with this plan (i.e. it is set to true).
79  bool flag = false;
80  int d1 = 0;
81  int noDates = 1;
82  TTypesOfVegetation l_tov = tov_PLWinterWheat; // The current type - change to match the crop you have
83 /**********************************************To Here *************************************************************************/
84 
85  // Depending what event has occured jump to the correct bit of code
86  switch (m_ev->m_todo)
87  {
88  case pl_ww_start:
89  {
90  // pl_ww_start just sets up all the starting conditions and reference dates that are needed to start a pl_ww
91  PL_WW_FERTI_P1 = false;
92  PL_WW_FERTI_S1 = false;
93  PL_WW_STUBBLE_PLOUGH = false;
94  PL_WW_DECIDE_TO_GR = false;
96 
97  // Set up the date management stuff
98  // The next bit of code just allows for altering dates after harvest if it is necessary
99  // to allow for a crop which starts its management early.
100 
101  // 5 start and stop dates for all 'movable' events for this crop
102  int noDates = 4;
103  m_field->SetMDates(0, 0, g_date->DayInYear(5, 8)); // last possible day of harvest
104  m_field->SetMDates(1, 0, g_date->DayInYear(10, 8)); // last possible day of starw chopping, equal to harvest in this case
105  m_field->SetMDates(0, 1, 0); // start day of hay bailing (not used as it depend on previous treatment)
106  m_field->SetMDates(1, 1, g_date->DayInYear(15, 8)); // end day of hay bailing
107  m_field->SetMDates(0, 2, 0); // start day of RSM
108  m_field->SetMDates(1, 2, g_date->DayInYear(25, 8)); // end day of RSM
109  m_field->SetMDates(0, 3, 0); // start day of calcium application
110  m_field->SetMDates(1, 3, g_date->DayInYear(25, 8)); // end day of calcium application
111  // Can be up to 10 of these. If the shortening code is triggered
112  // then these will be reduced in value to 0
113 
114  m_field->SetMConstants(0, 1);
115 
116  // Check the next crop for early start, unless it is a spring crop
117  // in which case we ASSUME that no checking is necessary!!!!
118  // So DO NOT implement a crop that runs over the year boundary (i.e. from spring to spring!), at least not without fixing this.
119 
120  //new if: do the check only for non-optimising farms and if year>0. (030713 - m_rotation used only in the hidden year, so I modified the condition from >7 to >0)
121  //optimising farms not used for now so most of related code is removed (but not in 'start' case)
122  if (!(m_farm->GetType() == tof_OptimisingFarm && g_date->GetYearNumber() > 0)) {
123 
124  if (m_ev->m_startday > g_date->DayInYear(1, 7)) {
125  if (m_field->GetMDates(0, 0) >= m_ev->m_startday)
126  {
127  g_msg->Warn(WARN_BUG, "PLWinterWheat::Do(): ", "Harvest too late for the next crop to start!!!");
128  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
129  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
130  }
131  // Now fix any late finishing problems
132  for (int i = 0; i < noDates; i++) {
133  if (m_field->GetMDates(0, i) >= m_ev->m_startday) {
134  m_field->SetMDates(0, i, m_ev->m_startday - 1); //move the starting date
135  }
136  if (m_field->GetMDates(1, i) >= m_ev->m_startday) {
137  m_field->SetMConstants(i, 0); //change the default value of the MConst (=1) to 0 (necessary to correctly execute farm events in case the finishing date (MDate) was moved)
138  m_field->SetMDates(1, i, m_ev->m_startday - 1); //move the finishing date
139  }
140  }
141  }
142  // Now no operations can be timed after the start of the next crop.
143 
144  if (!m_ev->m_first_year) {
145  // Are we before July 1st?
146  d1 = g_date->OldDays() + g_date->DayInYear(1, 7);
147  if (g_date->Date() < d1) {
148  // Yes, too early. We assumme this is because the last crop was late
149  printf("Poly: %d\n", m_field->GetPoly());
150  g_msg->Warn(WARN_BUG, "PLWinterWheat::Do(): ", "Crop start attempt between 1st Jan & 1st July");
151  int prev = m_field->GetLandscape()->BackTranslateVegTypes(m_field->GetOwner()->GetPreviousTov(m_field->GetRotIndex()));
152  g_msg->Warn(WARN_BUG, "Previous Crop ", prev);
153  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
154  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
155  }
156  else {
157  d1 = g_date->OldDays() + m_first_date; // Add 365 for spring crop
158  if (g_date->Date() > d1) {
159  // Yes too late - should not happen - raise an error
160  g_msg->Warn(WARN_BUG, "PLWinterWheat::Do(): ", "Crop start attempt after last possible start date");
161  g_msg->Warn(WARN_BUG, "Previous Crop ", "");
163  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
164  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
165  }
166  }
167  }
168  else {
169  // Is the first year
170  // Some special code to cope with that first start-up year in ALMaSS - ignore for all practical purposes
171  // Code for first spring treatment used
172  if (m_farm->IsStockFarmer()) //Stock Farmer
173  {
175  }
177  break;
178  }
179  }//if
180 
181  // End single block date checking code. Please see next line comment as well.
182  // Reinit d1 to first possible starting date.
183  d1 = g_date->OldDays() + g_date->DayInYear(20, 7);
184  // OK, let's go.
185  // Here we queue up the first event - this differs depending on whether we have a
186  // stock or arable farmer
187  if (m_farm->IsStockFarmer()) { // StockFarmer
189  }
190  else SimpleEvent_(d1, pl_ww_ferti_p1, false, m_farm, m_field);
191  }
192  break;
193 
194  // This is the first real farm operation
195  case pl_ww_ferti_p1:
196  // In total 10% of arable farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
197  // We therefore assume that half of them (5%) do it now
198  if (m_ev->m_lock || m_farm->DoIt_prob(0.05))
199  {
200  if (!m_farm->FP_Slurry(m_field, 0.0, g_date->DayInYear(20, 9) - g_date->DayInYear())) {
201  // If we don't suceed on the first try, then try and try again (until 20/8 when we will suceed)
203  break;
204  }
205  else
206  {
207  //Rest of farmers do slurry before autumn plough/stubble cultivation so we need to remeber who already did it
208  PL_WW_FERTI_P1 = true;
209  }
210  }
211  // Queue up the next event -in this case stubble ploughing
213  break;
214  case pl_ww_ferti_s1:
215  // In total 80% of stock farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
216  // We therefore assume that half of them (40%) do it now
217  if (m_ev->m_lock || m_farm->DoIt_prob(0.40))
218  {
219  if (!m_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(20, 9) - g_date->DayInYear())) {
221  break;
222  }
223  else
224  {
225  //Rest of farmers do slurry before autumn plough/stubble cultivation so we need to remeber who already did it
226  PL_WW_FERTI_S1 = true;
227  }
228  }
229  // Queue up the next event -in this case stubble ploughing
231  break;
233  // some will do stubble plough, but rest will get away with non-inversion cultivation or non-tillage
234  if (m_ev->m_lock || m_farm->DoIt_prob(0.50 * cfg_WW_conv_tillage_prop1.value())) // initially 50%
235  {
236  if (!m_farm->StubblePlough(m_field, 0.0, g_date->DayInYear(20, 9) - g_date->DayInYear())) {
238  break;
239  }
240  else
241  {
242  // 50% of farmers will do this, but the other 50% won't so we need to remember whether we are in one or the other group
243  PL_WW_STUBBLE_PLOUGH = true;
244  // Queue up the next event
246  break;
247  }
248  }
250  break;
252  if (!m_farm->AutumnHarrow(m_field, 0.0, g_date->DayInYear(20, 9) - g_date->DayInYear())) {
254  break;
255  }
257  break;
259  if (m_ev->m_lock || m_farm->DoIt_prob(0.40))
260  {
261  if (!m_farm->AutumnHarrow(m_field, 0.0, g_date->Date() + 7 - g_date->DayInYear())) {
263  break;
264  }
265  }
266  d1 = g_date->Date() + 1;
267  if (d1 < g_date->OldDays() + g_date->DayInYear(20, 8)) {
268  d1 = g_date->OldDays() + g_date->DayInYear(20, 8);
269  }
270  if (m_farm->IsStockFarmer()) //Stock Farmer
271  {
273  }
274  else SimpleEvent_(d1, pl_ww_ferti_p2, false, m_farm, m_field);
275  break;
277  // some will do stubble plough, but rest will get away with non-inversion cultivation or non-tillage
278  if (m_ev->m_lock || m_farm->DoIt_prob(1.00 * cfg_WW_NINV_tillage_prop1.value())) // initially 50% so no non-tillage
279  {
280  if (!m_farm->StubbleHarrowing(m_field, 0.0, g_date->DayInYear(25, 9) - g_date->DayInYear())) {
282  break;
283  }
284  }
285  d1 = g_date->Date() + 1;
286  if (d1 < g_date->OldDays() + g_date->DayInYear(20, 8)) {
287  d1 = g_date->OldDays() + g_date->DayInYear(20, 8);
288  }
289  if (m_farm->IsStockFarmer()) //Stock Farmer
290  {
292  }
293  else SimpleEvent_(d1, pl_ww_ferti_p2, false, m_farm, m_field);
294  break;
295  case pl_ww_ferti_p2:
296  // In total 10% of arable farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
297  // We therefore assume that half of them (5%) do it now (if haven't done before)
298  if (m_ev->m_lock || m_farm->DoIt_prob(5.0/95.0)&&(PL_WW_FERTI_P1==false))
299  {
300  if (!m_farm->FP_Slurry(m_field, 0.0, g_date->DayInYear(30, 9) - g_date->DayInYear())) {
302  break;
303  }
304  }
306  break;
307  case pl_ww_ferti_s2:
308  // In total 80% of stock farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
309  // We therefore assume that half of them (40%) do it now (if haven't done before)
310  if (m_ev->m_lock || m_farm->DoIt_prob(40.0/60.0) && (PL_WW_FERTI_S1==false))
311  {
312  if (!m_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(30, 9) - g_date->DayInYear())) {
314  break;
315  }
316  }
318  break;
319  case pl_ww_autumn_plough:
320  // some will do autumn plough, but rest will get away with non-inversion cultivation or non-tillage
321  if (m_ev->m_lock || m_farm->DoIt_prob(0.50 * cfg_WW_conv_tillage_prop2.value())) // initially 80% but changed to 50% for meta-model fitting
322  {
323  if (!m_farm->AutumnPlough(m_field, 0.0, g_date->DayInYear(30, 9) - g_date->DayInYear())) {
325  break;
326  }
327  else
328  {
329  // Queue up the next event and if it's late (after 15/9) it has to be rolling, else next fertilizer
330  d1 = g_date->OldDays() + g_date->DayInYear(15, 9);
331  if (g_date->Date() > d1)
332  {
334  break;
335  }
336  else
337  {
338  if (m_farm->IsStockFarmer()) //Stock Farmer
339  {
341  }
343  break;
344  }
345  }
346  }
348  break;
349  case pl_ww_autumn_roll:
350  if (!m_farm->AutumnRoll(m_field, 0.0, g_date->DayInYear(30, 9) - g_date->DayInYear())) {
352  break;
353  }
354  if (m_farm->IsStockFarmer()) //Stock Farmer
355  {
357  }
359  break;
361  // some will do autumn plough, but rest will get away with non-inversion cultivation or non-tillage
362  if (m_ev->m_lock || m_farm->DoIt_prob(1.00 * cfg_WW_NINV_tillage_prop2.value())) // initially 20% so no non-tillage but changed to 50% (see comment above)
363  //if (m_ev->m_lock || m_farm->DoIt_prob(100))
364  {
367  break;
368  }
369  }
370  if (m_farm->IsStockFarmer()) //Stock Farmer
371  {
373  }
375  break;
376  case pl_ww_ferti_p3:
377  if (m_ev->m_lock || m_farm->DoIt_prob(0.45))
378  {
379  if (!m_farm->FP_NPKS(m_field, 0.0, g_date->DayInYear(3, 10) - g_date->DayInYear())) {
381  break;
382  }
383  }
385  break;
386  case pl_ww_ferti_s3:
387  if (m_ev->m_lock || m_farm->DoIt_prob(0.45))
388  {
389  if (!m_farm->FA_NPKS(m_field, 0.0, g_date->DayInYear(3, 10) - g_date->DayInYear())) {
391  break;
392  }
393  }
395  break;
397  // 30% will do preseeding cultivation, the rest will do it together with sow
398  if (m_ev->m_lock || m_farm->DoIt_prob(0.30))
399  {
400  if (!m_farm->PreseedingCultivator(m_field, 0.0, g_date->DayInYear(4, 10) - g_date->DayInYear())) {
402  break;
403  }
405  break;
406  }
408  break;
409  case pl_ww_autumn_sow:
410  if (cfg_seedcoating_winterwheat_on.value() && a_field->GetLandscape()->SupplyShouldSpray()) {
411  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(5, 10) - g_date->DayInYear(),
414  break;
415  }
416  }
417  else {
418  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(5, 10) - g_date->DayInYear())) {
420  break;
421  }
422  }
423 
424  // Here is a fork leading to four parallel events
425  SimpleEvent_(g_date->Date() + 3, pl_ww_herbicide1, false, m_farm, m_field); // Herbidide thread
426  SimpleEvent_(g_date->Date() + 3, pl_ww_fungicide1, false, m_farm, m_field); // Fungicide thread
427  SimpleEvent_(g_date->Date() + 20 + m_date_modifier, pl_ww_insecticide1, false, m_farm, m_field); // Insecticide thread
428  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 4) + 365, pl_ww_growth_regulator1, false, m_farm, m_field); // GR thread
429  if (m_farm->IsStockFarmer()) //Stock Farmer // PK thread
430  {
432  }
433  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_ww_ferti_p4, false, m_farm, m_field);
434  if (m_farm->IsStockFarmer()) //Stock Farmer // Main thread
435  {
437  }
438  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_ww_ferti_p5, false, m_farm, m_field);
439  if (m_farm->IsStockFarmer()) //Stock Farmer // Microelemnts thread
440  {
442  }
443  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 4) + 365, pl_ww_ferti_p8, false, m_farm, m_field);
444  break;
446  // 70% will do preseeding cultivation with sow
449  break;
450  }
451  // Here is a fork leading to four parallel events
452  SimpleEvent_(g_date->Date() + 3, pl_ww_herbicide1, false, m_farm, m_field); // Herbidide thread
453  SimpleEvent_(g_date->Date() + 3, pl_ww_fungicide1, false, m_farm, m_field); // Fungicide thread
454  SimpleEvent_(g_date->Date() + 20 + m_date_modifier, pl_ww_insecticide1, false, m_farm, m_field); // Insecticide thread
455  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 4) + 365, pl_ww_growth_regulator1, false, m_farm, m_field); // GR thread
456  if (m_farm->IsStockFarmer()) //Stock Farmer // PK thread
457  {
459  }
460  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_ww_ferti_p4, false, m_farm, m_field);
461  if (m_farm->IsStockFarmer()) //Stock Farmer // Main thread
462  {
464  }
465  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_ww_ferti_p5, false, m_farm, m_field);
466  if (m_farm->IsStockFarmer()) //Stock Farmer // Microelemnts thread
467  {
469  }
470  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 4) + 365, pl_ww_ferti_p8, false, m_farm, m_field);
471  break;
472  case pl_ww_herbicide1: // The first of the pesticide managements.
473  // Here comes the herbicide thread
474  if (m_ev->m_lock || m_farm->DoIt_prob(0.80))
475  {
476  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
478  break;
479  }
480  }
482  break;
483  case pl_ww_herbicide2:
484  if (m_ev->m_lock || m_farm->DoIt_prob(0.73))
485  {
486  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(10, 4) - g_date->DayInYear())) {
488  break;
489  }
490  }
491  // End of thread
492  break;
493  case pl_ww_fungicide1:
494  // Here comes the fungicide thread
495  if (m_ev->m_lock || m_farm->DoIt_prob(0.05))
496  {
497  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
499  break;
500  }
501  }
503  break;
504  case pl_ww_fungicide2:
505  if (m_ev->m_lock || m_farm->DoIt_prob(0.80))
506  {
507  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
509  break;
510  }
511  }
512  d1 = g_date->Date() + 14;
513  if (d1 < g_date->OldDays() + g_date->DayInYear(10, 5)) {
514  d1 = g_date->OldDays() + g_date->DayInYear(10, 5);
515  }
517  break;
518  case pl_ww_fungicide3:
519  if (m_ev->m_lock || m_farm->DoIt_prob(0.68))
520  {
521  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(5, 6) - g_date->DayInYear())) {
523  break;
524  }
525  }
527  break;
528  case pl_ww_fungicide4:
529  if (m_ev->m_lock || m_farm->DoIt_prob(0.15))
530  {
531  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(20, 6) - g_date->DayInYear())) {
533  break;
534  }
535  }
536  // End of thread
537  break;
538  case pl_ww_insecticide1:
539 #ifdef ECOSTACK_BIOPESTICIDE
540  // Here comes the insecticide thread
541  if (m_ev->m_lock || m_farm->DoIt_prob(0.1 * cfg_WW_isecticide_prop1.value())) // initially 5%
542 #else
543  if (m_ev->m_lock || m_farm->DoIt_prob(0.05 * cfg_WW_isecticide_prop1.value())) // initially 5%
544 #endif
545  {
546  if (m_field->GetGreenBiomass() <= 0) {
548  }
549  else
550  {
551  // here we check whether we are using ERA pesticide or not
552  d1 = g_date->DayInYear(15, 11) - g_date->DayInYear();
553  if (!cfg_pest_winterwheat_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
554  {
555 #ifdef ECOSTACK_BIOPESTICIDE
556  flag = m_farm->BiocideTreat(m_field, 0.0, d1);
557 #else
558  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
559 #endif
560  }
561  else {
563  }
564  if (!flag) {
566  break;
567  }
568  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(20, 4) + 365 + m_date_modifier, pl_ww_insecticide2, false, m_farm, m_field); //what to do with ECOSTACK_BIOPESTICIDE here
569  break;
570  }
571  }
573  break;
574 
575  case pl_ww_insecticide2:
576 #ifdef ECOSTACK_BIOPESTICIDE
577  if (m_ev->m_lock || m_farm->DoIt_prob(1.0 * cfg_WW_isecticide_prop2.value())) // initially 74% ale changed to 50% for meta model testing
578 #else
579  if (m_ev->m_lock || m_farm->DoIt_prob(0.50 * cfg_WW_isecticide_prop2.value())) // initially 74% ale changed to 50% for meta model testing
580 #endif
581  {
582  // here we check whether we are using ERA pesticide or not
583  d1 = g_date->DayInYear(10, 6) - g_date->DayInYear();
584  if (!cfg_pest_winterwheat_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
585  {
586 #ifdef ECOSTACK_BIOPESTICIDE
587  flag = m_farm->BiocideTreat(m_field, 0.0, d1);
588 #else
589  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
590 #endif
591  }
592  else {
594  }
595  if (!flag) {
597  break;
598  }
599  }
600 #ifdef ECOSTACK_BIOPESTICIDE
602  break;
603 #else
605  break;
606 #endif
607 
608  case pl_ww_insecticide3:
609 #ifdef ECOSTACK_BIOPESTICIDE
610  if (m_ev->m_lock || m_farm->DoIt_prob(0.5 * cfg_WW_isecticide_prop3.value())) // initially 38% but changed to 25% proportionally to insecticide2 change
611 #else
612  if (m_ev->m_lock || m_farm->DoIt_prob(0.25 * cfg_WW_isecticide_prop3.value())) // initially 38% but changed to 25% proportionally to insecticide2 change
613 #endif
614  {
615  // here we check whether we are using ERA pesticide or not
616  d1 = g_date->DayInYear(25, 6) - g_date->DayInYear();
617  if (!cfg_pest_winterwheat_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
618  {
619 #ifdef ECOSTACK_BIOPESTICIDE
620  flag = m_farm->BiocideTreat(m_field, 0.0, d1);
621 #else
622  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
623 #endif
624  }
625  else {
627  }
628  if (!flag) {
630  break;
631  }
632  }
633  // End of thread
634  break;
636  // Here comes the GR thread
637  if (m_ev->m_lock || m_farm->DoIt_prob(0.68))
638  {
639  if (!m_farm->GrowthRegulator(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
641  break;
642  }
643  else
644  {
645  //We need to remeber who did GR I
646  PL_WW_DECIDE_TO_GR = true;
647  }
648  }
650  break;
653  {
654  if (!m_farm->GrowthRegulator(m_field, 0.0, g_date->Date() + 21 - g_date->DayInYear())) {
656  break;
657  }
658  }
659  // End of thread
660  break;
661  case pl_ww_ferti_p4:
662  // Here comes the PK thread
663  if (m_ev->m_lock || m_farm->DoIt_prob(0.50))
664  {
665  if (!m_farm->FP_PK(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
667  break;
668  }
669  }
670  // End of thread
671  break;
672  case pl_ww_ferti_s4:
673  // Here comes the PK thread
674  if (m_ev->m_lock || m_farm->DoIt_prob(0.50))
675  {
676  if (!m_farm->FA_PK(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
678  break;
679  }
680  }
681  // End of thread
682  break;
683  case pl_ww_ferti_p5:
684  // Here comes the MAIN thread
685  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
687  break;
688  }
689  d1 = g_date->Date() + 10;
690  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 4)) {
691  d1 = g_date->OldDays() + g_date->DayInYear(1, 4);
692  }
694  break;
695  case pl_ww_ferti_s5:
696  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
698  break;
699  }
700  d1 = g_date->Date() + 10;
701  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 4)) {
702  d1 = g_date->OldDays() + g_date->DayInYear(1, 4);
703  }
705  break;
706  case pl_ww_ferti_p6:
707  if (m_ev->m_lock || m_farm->DoIt_prob(0.95))
708  {
709  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
711  break;
712  }
713  }
715  break;
716  case pl_ww_ferti_s6:
717  if (m_ev->m_lock || m_farm->DoIt_prob(0.95))
718  {
719  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
721  break;
722  }
723  }
725  break;
726  case pl_ww_ferti_p7:
727  if (m_ev->m_lock || m_farm->DoIt_prob(0.40))
728  {
729  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(10, 6) - g_date->DayInYear())) {
731  break;
732  }
733  }
735  break;
736  case pl_ww_ferti_s7:
737  if (m_ev->m_lock || m_farm->DoIt_prob(0.40))
738  {
739  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(10, 6) - g_date->DayInYear())) {
741  break;
742  }
743  }
745  break;
746  case pl_ww_ferti_p8:
747  // Here comes the mickroelements thread
748  if (m_ev->m_lock || m_farm->DoIt_prob(0.63))
749  {
750  if (!m_farm->FP_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
752  break;
753  }
754  }
756  break;
757  case pl_ww_ferti_s8:
758  if (m_ev->m_lock || m_farm->DoIt_prob(0.63))
759  {
760  if (!m_farm->FA_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
762  break;
763  }
764  }
766  break;
767  case pl_ww_ferti_p9:
768  if (m_ev->m_lock || m_farm->DoIt_prob(0.08))
769  {
770  if (!m_farm->FP_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear())) {
772  break;
773  }
774  }
775  // End of thread
776  break;
777  case pl_ww_ferti_s9:
778  if (m_ev->m_lock || m_farm->DoIt_prob(0.08))
779  {
780  if (!m_farm->FA_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear())) {
782  break;
783  }
784  }
785  // End of thread
786  break;
787  case pl_ww_harvest:
788  // Here the MAIN thread continues
789  // We don't move harvest days
790  if (!m_farm->Harvest(m_field, 0.0, m_field->GetMDates(0, 0) - g_date->DayInYear())) {
792  break;
793  }
795  break;
796 
797 
799  if (m_farm->IsStockFarmer()) //Stock Farmer
800  {
801  // 10% of stock farmers will do straw chopping, but rest will do hay bailing instead
802  if (m_ev->m_lock || m_farm->DoIt_prob(0.10))
803  {
804  if (m_field->GetMConstants(0) == 0) {
805  if (!m_farm->StrawChopping(m_field, 0.0, -1)) { // raise an error
806  g_msg->Warn(WARN_BUG, "PLWinterWheat::Do(): failure in 'StrawChopping' execution", "");
807  exit(1);
808  }
809  }
810  else {
811  if (!m_farm->StrawChopping(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
813  break;
814  }
815  else
816  {
817  // Queue up the next event
819  break;
820  }
821  }
822 
823  }
825  break;
826  }
827  else
828  {
829  // 90% of arable farmers will do straw chopping, but rest will do hay bailing instead
830  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
831  {
832  if (m_field->GetMConstants(0) == 0) {
833  if (!m_farm->StrawChopping(m_field, 0.0, -1)) { // raise an error
834  g_msg->Warn(WARN_BUG, "PLWinterWheat::Do(): failure in 'StrawChopping' execution", "");
835  exit(1);
836  }
837  }
838  else {
839  if (!m_farm->StrawChopping(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
841  break;
842  }
843  else
844  {
845  // Queue up the next event
847  break;
848  }
849  }
850 
851  }
853  break;
854  }
855  case pl_ww_hay_bailing:
856  if (m_field->GetMConstants(1) == 0) {
857  if (!m_farm->HayBailing(m_field, 0.0, -1)) { // raise an error
858  g_msg->Warn(WARN_BUG, "PLWinterWheat::Do(): failure in 'HayBailing' execution", "");
859  exit(1);
860  }
861  }
862  else {
863  if (!m_farm->HayBailing(m_field, 0.0, m_field->GetMDates(1,1) - g_date->DayInYear())) {
865  break;
866  }
867  }
868  if (m_farm->IsStockFarmer()) //Stock Farmer
869  {
871  }
873  break;
874  case pl_ww_ferti_p10:
875  if (m_ev->m_lock || m_farm->DoIt_prob(0.18))
876  {
877  if (m_field->GetMConstants(2) == 0) {
878  if (!m_farm->FP_RSM(m_field, 0.0, -1)) { // raise an error
879  g_msg->Warn(WARN_BUG, "PLWinterWheat::Do(): failure in 'FP_RSM' execution", "");
880  exit(1);
881  }
882  }
883  else {
884  if (!m_farm->FP_RSM(m_field, 0.0, m_field->GetMDates(1,2) - g_date->DayInYear())) {
886  break;
887  }
888  }
889  }
890  if (m_farm->IsStockFarmer()) //Stock Farmer
891  {
893  }
895  break;
896  case pl_ww_ferti_s10:
897  if (m_ev->m_lock || m_farm->DoIt_prob(0.18))
898  {
899  if (m_field->GetMConstants(2) == 0) {
900  if (!m_farm->FA_RSM(m_field, 0.0, -1)) { // raise an error
901  g_msg->Warn(WARN_BUG, "PLWinterWheat::Do(): failure in 'FA_RSM' execution", "");
902  exit(1);
903  }
904  }
905  else {
906  if (!m_farm->FA_RSM(m_field, 0.0, m_field->GetMDates(1, 2) - g_date->DayInYear())) {
908  break;
909  }
910  }
911  }
912  if (m_farm->IsStockFarmer()) //Stock Farmer
913  {
915  }
917  break;
918  case pl_ww_ferti_p11:
919  if (m_ev->m_lock || m_farm->DoIt_prob(0.23))
920  {
921  if (m_field->GetMConstants(3) == 0) {
922  if (!m_farm->FP_Calcium(m_field, 0.0, -1)) { // raise an error
923  g_msg->Warn(WARN_BUG, "PLWinterWheat::Do(): failure in 'FP_Calcium' execution", "");
924  exit(1);
925  }
926  }
927  else {
928  if (!m_farm->FP_Calcium(m_field, 0.0, m_field->GetMDates(1,3) - g_date->DayInYear())) {
930  break;
931  }
932  }
933  }
934  done = true;
935  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
936  // END of MAIN THREAD
937  break;
938  case pl_ww_ferti_s11:
939  if (m_ev->m_lock || m_farm->DoIt_prob(0.23))
940  {
941  if (m_field->GetMConstants(3) == 0) {
942  if (!m_farm->FA_Calcium(m_field, 0.0, -1)) { // raise an error
943  g_msg->Warn(WARN_BUG, "PLWinterWheat::Do(): failure in 'FA_Calcium' execution", "");
944  exit(1);
945  }
946  }
947  else {
948  if (!m_farm->FA_Calcium(m_field, 0.0, m_field->GetMDates(1, 3) - g_date->DayInYear())) {
950  break;
951  }
952  }
953  }
954  done = true;
955  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
956  // END of MAIN THREAD
957  break;
958  default:
959  g_msg->Warn(WARN_BUG, "PLWinterWheat::Do(): "
960  "Unknown event type! ", "");
961  exit(1);
962  }
963  return done;
964 }

References Farm::AutumnHarrow(), Farm::AutumnPlough(), Farm::AutumnRoll(), Farm::AutumnSow(), Farm::BiocideTreat(), cfg_pest_product_amounts, cfg_pest_winterwheat_on, cfg_seedcoating_product_amounts, cfg_seedcoating_winterwheat_on, cfg_WW_conv_tillage_prop1, cfg_WW_conv_tillage_prop2, cfg_WW_isecticide_prop1, cfg_WW_isecticide_prop2, cfg_WW_isecticide_prop3, cfg_WW_NINV_tillage_prop1, cfg_WW_NINV_tillage_prop2, LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), Farm::DoIt_prob(), Farm::FA_AmmoniumSulphate(), Farm::FA_Calcium(), Farm::FA_ManganeseSulphate(), Farm::FA_NPKS(), Farm::FA_PK(), Farm::FA_RSM(), Farm::FA_Slurry(), Farm::FP_AmmoniumSulphate(), Farm::FP_Calcium(), Farm::FP_ManganeseSulphate(), Farm::FP_NPKS(), Farm::FP_PK(), Farm::FP_RSM(), Farm::FP_Slurry(), Farm::FungicideTreat(), g_date, g_msg, LE::GetGreenBiomass(), LE::GetMConstants(), LE::GetMDates(), LE::GetOwner(), LE::GetPoly(), Farm::GetPreviousTov(), LE::GetRotIndex(), Farm::GetType(), Calendar::GetYearNumber(), Farm::GrowthRegulator(), Farm::Harvest(), Farm::HayBailing(), Farm::HerbicideTreat(), Farm::InsecticideTreat(), Farm::IsStockFarmer(), Crop::m_date_modifier, Crop::m_ev, Crop::m_farm, Crop::m_field, Crop::m_first_date, FarmEvent::m_first_year, FarmEvent::m_lock, FarmEvent::m_next_tov, FarmEvent::m_startday, FarmEvent::m_todo, Calendar::OldDays(), pl_ww_autumn_harrow1, pl_ww_autumn_harrow2, pl_ww_autumn_plough, pl_ww_autumn_roll, pl_ww_autumn_sow, PL_WW_DECIDE_TO_GR, PL_WW_FERTI_P1, pl_ww_ferti_p1, pl_ww_ferti_p10, pl_ww_ferti_p11, pl_ww_ferti_p2, pl_ww_ferti_p3, pl_ww_ferti_p4, pl_ww_ferti_p5, pl_ww_ferti_p6, pl_ww_ferti_p7, pl_ww_ferti_p8, pl_ww_ferti_p9, PL_WW_FERTI_S1, pl_ww_ferti_s1, pl_ww_ferti_s10, pl_ww_ferti_s11, pl_ww_ferti_s2, pl_ww_ferti_s3, pl_ww_ferti_s4, pl_ww_ferti_s5, pl_ww_ferti_s6, pl_ww_ferti_s7, pl_ww_ferti_s8, pl_ww_ferti_s9, pl_ww_fungicide1, pl_ww_fungicide2, pl_ww_fungicide3, pl_ww_fungicide4, pl_ww_growth_regulator1, pl_ww_growth_regulator2, pl_ww_harvest, pl_ww_hay_bailing, pl_ww_herbicide1, pl_ww_herbicide2, pl_ww_insecticide1, pl_ww_insecticide2, pl_ww_insecticide3, pl_ww_preseeding_cultivator, pl_ww_preseeding_cultivator_sow, pl_ww_start, pl_ww_straw_chopping, pl_ww_stubble_cultivator_heavy, pl_ww_stubble_harrow, PL_WW_STUBBLE_PLOUGH, pl_ww_stubble_plough, ppp_1, Farm::PreseedingCultivator(), Farm::PreseedingCultivatorSow(), Farm::ProductApplication(), LE::SetMConstants(), LE::SetMDates(), Crop::SimpleEvent_(), Farm::StrawChopping(), Farm::StubbleCultivatorHeavy(), Farm::StubbleHarrowing(), Farm::StubblePlough(), tof_OptimisingFarm, tov_PLWinterWheat, CfgFloat::value(), CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), and WARN_BUG.

◆ SetUpFarmCategoryInformation()

void PLWinterWheat::SetUpFarmCategoryInformation ( )
inline
112  {
113  const int elements = 2 + (pl_ww_foobar - PLWINTERWHEAT_BASE);
115 
116  FarmManagementCategory catlist[elements] =
117  {
118  fmc_Others, // this needs to be at the zero line
119  fmc_Others, // pl_ww_start = 1,
120  fmc_Others, // pl_ww_sleep_all_day = PLWINTERWHEAT_BASE,
121  fmc_Fertilizer, // pl_ww_ferti_p1,
122  fmc_Fertilizer, // pl_ww_ferti_s1,
123  fmc_Cultivation, // pl_ww_stubble_plough,
124  fmc_Cultivation, // pl_ww_autumn_harrow1,
125  fmc_Cultivation, // pl_ww_autumn_harrow2,
126  fmc_Cultivation, // pl_ww_stubble_harrow,
127  fmc_Fertilizer, //pl_ww_ferti_p2,
128  fmc_Fertilizer, //pl_ww_ferti_s2,
129  fmc_Cultivation, // pl_ww_autumn_plough,
130  fmc_Others, // pl_ww_autumn_roll,
131  fmc_Cultivation, // pl_ww_stubble_cultivator_heavy,
132  fmc_Fertilizer, //pl_ww_ferti_p3,
133  fmc_Fertilizer, // pl_ww_ferti_s3,
134  fmc_Cultivation, // pl_ww_preseeding_cultivator,
135  fmc_Cultivation, // pl_ww_preseeding_cultivator_sow,
136  fmc_Others, // pl_ww_autumn_sow,
137  fmc_Herbicide, // pl_ww_herbicide1,
138  fmc_Fungicide, // pl_ww_fungicide1,
139  fmc_Insecticide, // pl_ww_insecticide1,
140  fmc_Fertilizer, //pl_ww_ferti_p4,
141  fmc_Fertilizer, //pl_ww_ferti_s4,
142  fmc_Fertilizer, //pl_ww_ferti_p5,
143  fmc_Fertilizer, //pl_ww_ferti_s5,
144  fmc_Fertilizer, //pl_ww_ferti_p6,
145  fmc_Fertilizer, //pl_ww_ferti_s6,
146  fmc_Fertilizer, //pl_ww_ferti_p7,
147  fmc_Fertilizer, //pl_ww_ferti_s7,
148  fmc_Fertilizer, //pl_ww_ferti_p8,
149  fmc_Fertilizer, //pl_ww_ferti_s8,
150  fmc_Fertilizer, //pl_ww_ferti_p9,
151  fmc_Fertilizer, //pl_ww_ferti_s9,
152  fmc_Herbicide, // pl_ww_herbicide2,
153  fmc_Fungicide, // pl_ww_fungicide2,
154  fmc_Fungicide, // pl_ww_fungicide3,
155  fmc_Fungicide, // pl_ww_fungicide4,
156  fmc_Insecticide, // pl_ww_insecticide2,
157  fmc_Insecticide, // pl_ww_insecticide3,
158  fmc_Others, // pl_ww_growth_regulator1,
159  fmc_Others, // pl_ww_growth_regulator2,
160  fmc_Harvest, //pl_ww_harvest,
161  fmc_Others, // pl_ww_straw_chopping,
162  fmc_Others, // pl_ww_hay_bailing,
163  fmc_Fertilizer, // pl_ww_ferti_p10,
164  fmc_Fertilizer, // pl_ww_ferti_s10,
165  fmc_Fertilizer, // pl_ww_ferti_p11,
166  fmc_Fertilizer // pl_ww_ferti_s11,
167  };
168  // Iterate over the catlist elements and copy them to vector
169  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
170  }

References fmc_Cultivation, fmc_Fertilizer, fmc_Fungicide, fmc_Harvest, fmc_Herbicide, fmc_Insecticide, fmc_Others, Crop::m_base_elements_no, Crop::m_ManagementCategories, pl_ww_foobar, and PLWINTERWHEAT_BASE.

Referenced by PLWinterWheat().


The documentation for this class was generated from the following files:
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
pl_ww_ferti_s2
Definition: PLWinterWheat.h:48
cfg_pest_winterwheat_on
CfgBool cfg_pest_winterwheat_on
Turn on pesticides for winter wheat.
pl_ww_hay_bailing
Definition: PLWinterWheat.h:82
pl_ww_ferti_p6
Definition: PLWinterWheat.h:64
Farm::FA_Slurry
virtual bool FA_Slurry(LE *a_field, double a_user, int a_days)
Spready slurry on a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1067
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
pl_ww_ferti_p2
Definition: PLWinterWheat.h:47
Farm::PreseedingCultivator
virtual bool PreseedingCultivator(LE *a_field, double a_user, int a_days)
Carry out preseeding cultivation on a_field (tilling set including cultivator and string roller to co...
Definition: FarmFuncs.cpp:312
LE::SetMDates
void SetMDates(int a, int b, int c)
Definition: Elements.h:406
Farm::HerbicideTreat
virtual bool HerbicideTreat(LE *a_field, double a_user, int a_days)
Apply herbicide to a_field.
Definition: FarmFuncs.cpp:2025
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
cfg_seedcoating_product_amounts
CfgArray_Double cfg_seedcoating_product_amounts
Amount of seed coating pesticide applied in grams of active substance per hectare for each of the 10 ...
pl_ww_autumn_plough
Definition: PLWinterWheat.h:49
pl_ww_ferti_s8
Definition: PLWinterWheat.h:69
Farm::Harvest
virtual bool Harvest(LE *a_field, double a_user, int a_days)
Carry out a harvest on a_field.
Definition: FarmFuncs.cpp:1364
pl_ww_herbicide2
Definition: PLWinterWheat.h:72
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
Farm::FP_ManganeseSulphate
virtual bool FP_ManganeseSulphate(LE *a_field, double a_user, int a_days)
Apply Manganse Sulphate to a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:840
Farm::ProductApplication
virtual bool ProductApplication(LE *a_field, double a_user, int a_days, double a_applicationrate, PlantProtectionProducts a_ppp, bool a_isgranularpesticide=false, int a_orcharddrifttype=0)
Apply test pesticide to a_field.
Definition: FarmFuncs.cpp:2267
Farm::StubbleCultivatorHeavy
virtual bool StubbleCultivatorHeavy(LE *a_field, double a_user, int a_days)
Carry out a stubble cultivation event on a_field. This is non-inversion type of cultivation which can...
Definition: FarmFuncs.cpp:245
PL_WW_STUBBLE_PLOUGH
#define PL_WW_STUBBLE_PLOUGH
Definition: PLWinterWheat.h:30
LE::GetMConstants
int GetMConstants(int a)
Definition: Elements.h:407
pl_ww_ferti_s7
Definition: PLWinterWheat.h:67
LE::ClearManagementActionSum
void ClearManagementActionSum()
clears the management action counters
Definition: Elements.h:247
pl_ww_ferti_s10
Definition: PLWinterWheat.h:84
Calendar::GetYearNumber
int GetYearNumber(void)
Definition: Calendar.h:72
pl_ww_ferti_p11
Definition: PLWinterWheat.h:85
pl_ww_ferti_p4
Definition: PLWinterWheat.h:60
pl_ww_ferti_s6
Definition: PLWinterWheat.h:65
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
Farm::StubblePlough
virtual bool StubblePlough(LE *a_field, double a_user, int a_days)
Carry out a stubble ploughing event on a_field. This is similar to normal plough but shallow (normall...
Definition: FarmFuncs.cpp:232
LE::GetPoly
int GetPoly(void)
Returns the polyref number for this polygon.
Definition: Elements.h:238
pl_ww_fungicide3
Definition: PLWinterWheat.h:74
Farm::DoIt_prob
bool DoIt_prob(double a_probability)
Return chance out of 0 to 1.
Definition: Farm.cpp:864
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
cfg_WW_NINV_tillage_prop2
CfgFloat cfg_WW_NINV_tillage_prop2
Provided to allow configuration control of the proportion of farmers doing second non-inversion tilla...
pl_ww_autumn_harrow2
Definition: PLWinterWheat.h:45
Farm::GetPreviousTov
TTypesOfVegetation GetPreviousTov(int a_index)
Definition: Farm.h:966
Farm::FA_NPKS
virtual bool FA_NPKS(LE *a_field, double a_user, int a_days)
Apply NPKS fertilizer, on a_field owned by a stock farmer.
Definition: FarmFuncs.cpp:968
CfgFloat::value
double value() const
Definition: Configurator.h:142
Farm::GetType
TTypesOfFarm GetType(void)
Definition: Farm.h:956
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
pl_ww_preseeding_cultivator_sow
Definition: PLWinterWheat.h:55
pl_ww_ferti_p9
Definition: PLWinterWheat.h:70
pl_ww_ferti_s5
Definition: PLWinterWheat.h:63
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
FarmEvent::m_startday
int m_startday
Definition: Farm.h:385
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
pl_ww_ferti_p3
Definition: PLWinterWheat.h:52
pl_ww_ferti_p10
Definition: PLWinterWheat.h:83
pl_ww_insecticide2
Definition: PLWinterWheat.h:76
Farm::FP_PK
virtual bool FP_PK(LE *a_field, double a_user, int a_days)
Apply PK fertilizer, on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:673
pl_ww_insecticide3
Definition: PLWinterWheat.h:77
pl_ww_ferti_s4
Definition: PLWinterWheat.h:61
CfgBool::value
bool value() const
Definition: Configurator.h:164
pl_ww_autumn_harrow1
Definition: PLWinterWheat.h:44
cfg_WW_isecticide_prop1
CfgFloat cfg_WW_isecticide_prop1
Provided to allow configuration control of the proportion of farmers doing first insecticide spray in...
cfg_WW_conv_tillage_prop2
CfgFloat cfg_WW_conv_tillage_prop2
Provided to allow configuration control of the proportion of farmers doing second conventional tillag...
Farm::FA_RSM
virtual bool FA_RSM(LE *a_field, double a_user, int a_days)
RSM (ammonium nitrate solution) applied on a_field owned by a stock farmer.
Definition: FarmFuncs.cpp:1154
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
PL_WW_FERTI_P1
#define PL_WW_FERTI_P1
A flag used to indicate autumn ploughing status.
Definition: PLWinterWheat.h:28
pl_ww_start
Definition: PLWinterWheat.h:39
Calendar::Date
long Date(void)
Definition: Calendar.h:57
Farm::FP_AmmoniumSulphate
virtual bool FP_AmmoniumSulphate(LE *a_field, double a_user, int a_days)
Apply Ammonium Sulphate to a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:882
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
Farm::HayBailing
virtual bool HayBailing(LE *a_field, double a_user, int a_days)
Carry out hay bailing on a_field.
Definition: FarmFuncs.cpp:1507
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
Farm::FA_Calcium
virtual bool FA_Calcium(LE *a_field, double a_user, int a_days)
Calcium applied on a_field owned by a stock farmer.
Definition: FarmFuncs.cpp:1168
Farm::StrawChopping
virtual bool StrawChopping(LE *a_field, double a_user, int a_days)
Carry out straw chopping on a_field.
Definition: FarmFuncs.cpp:1475
cfg_WW_isecticide_prop2
CfgFloat cfg_WW_isecticide_prop2
Provided to allow configuration control of the proportion of farmers doing second insecticide spray i...
PL_WW_DECIDE_TO_GR
#define PL_WW_DECIDE_TO_GR
Definition: PLWinterWheat.h:31
Farm::FA_ManganeseSulphate
virtual bool FA_ManganeseSulphate(LE *a_field, double a_user, int a_days)
Apply manganese sulphate to a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1095
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
pl_ww_fungicide2
Definition: PLWinterWheat.h:73
pl_ww_fungicide4
Definition: PLWinterWheat.h:75
pl_ww_herbicide1
Definition: PLWinterWheat.h:57
cfg_WW_isecticide_prop3
CfgFloat cfg_WW_isecticide_prop3
Provided to allow configuration control of the proportion of farmers doing third insecticide spray in...
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
Farm::FP_Calcium
virtual bool FP_Calcium(LE *a_field, double a_user, int a_days)
Calcium applied on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:954
LE::GetRotIndex
int GetRotIndex(void)
Definition: Elements.h:373
pl_ww_autumn_roll
Definition: PLWinterWheat.h:50
FarmEvent::m_next_tov
TTypesOfVegetation m_next_tov
Definition: Farm.h:390
pl_ww_stubble_harrow
Definition: PLWinterWheat.h:46
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
pl_ww_stubble_plough
Definition: PLWinterWheat.h:43
Crop::m_field
LE * m_field
Definition: Farm.h:499
pl_ww_harvest
Definition: PLWinterWheat.h:80
Crop::m_ManagementCategories
vector< FarmManagementCategory > m_ManagementCategories
Holds the translation between the farm operation enum for each crop and the farm management category ...
Definition: Farm.h:530
CfgArray_Double::value
std::vector< double > value() const
Definition: Configurator.h:219
Farm::PreseedingCultivatorSow
virtual bool PreseedingCultivatorSow(LE *a_field, double a_user, int a_days, double a_seed_coating_amount=-1, PlantProtectionProducts a_ppp=ppp_foobar)
Carry out preseeding cultivation together with sow on a_field (tilling and sowing set including culti...
Definition: FarmFuncs.cpp:325
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
PLWINTERWHEAT_BASE
#define PLWINTERWHEAT_BASE
Definition: PLWinterWheat.h:24
Farm::InsecticideTreat
virtual bool InsecticideTreat(LE *a_field, double a_user, int a_days)
Apply insecticide to a_field.
Definition: FarmFuncs.cpp:2135
Farm::AutumnRoll
virtual bool AutumnRoll(LE *a_field, double a_user, int a_days)
Carry out a roll event in the autumn on a_field.
Definition: FarmFuncs.cpp:299
LE::GetGreenBiomass
virtual double GetGreenBiomass(void)
Definition: Elements.h:160
Farm::FP_Slurry
virtual bool FP_Slurry(LE *a_field, double a_user, int a_days)
Apply slurry to a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:823
Farm::BiocideTreat
virtual bool BiocideTreat(LE *a_field, double a_user, int a_days)
Apply Biocide to a_field.
Definition: FarmFuncs.cpp:2175
cfg_pest_product_amounts
CfgArray_Double cfg_pest_product_amounts
Amount of pesticide applied in grams of active substance per hectare for each of the 10 pesticides.
pl_ww_fungicide1
Definition: PLWinterWheat.h:58
cfg_seedcoating_winterwheat_on
CfgBool cfg_seedcoating_winterwheat_on
Turn on seed coating for winter wheat.
tof_OptimisingFarm
Definition: LandscapeFarmingEnums.h:696
tov_PLWinterWheat
Definition: LandscapeFarmingEnums.h:232
pl_ww_ferti_p8
Definition: PLWinterWheat.h:68
Farm::AutumnPlough
virtual bool AutumnPlough(LE *a_field, double a_user, int a_days)
Carry out a ploughing event in the autumn on a_field.
Definition: FarmFuncs.cpp:212
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
pl_ww_ferti_s9
Definition: PLWinterWheat.h:71
pl_ww_foobar
Definition: PLWinterWheat.h:87
Farm::AutumnHarrow
virtual bool AutumnHarrow(LE *a_field, double a_user, int a_days)
Carry out a harrow event in the autumn on a_field.
Definition: FarmFuncs.cpp:285
Farm::FA_AmmoniumSulphate
virtual bool FA_AmmoniumSulphate(LE *a_field, double a_user, int a_days)
Apply ammonium sulphate to a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1081
PLWinterWheat::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: PLWinterWheat.h:112
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
cfg_WW_conv_tillage_prop1
CfgFloat cfg_WW_conv_tillage_prop1
Provided to allow configuration control of the proportion of farmers doing first conventional tillage...
Crop::m_date_modifier
static int m_date_modifier
Holds a value that shifts test pesticide use by this many days in crops modified to use it.
Definition: Farm.h:514
Farm::AutumnSow
virtual bool AutumnSow(LE *a_field, double a_user, int a_days, double a_seed_coating_amount=-1, PlantProtectionProducts a_ppp=ppp_foobar)
Carry out a sowing event in the autumn on a_field.
Definition: FarmFuncs.cpp:360
pl_ww_insecticide1
Definition: PLWinterWheat.h:59
Farm::FP_RSM
virtual bool FP_RSM(LE *a_field, double a_user, int a_days)
RSM (ammonium nitrate solution) applied on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:940
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
pl_ww_growth_regulator1
Definition: PLWinterWheat.h:78
pl_ww_ferti_s3
Definition: PLWinterWheat.h:53
Farm::GrowthRegulator
virtual bool GrowthRegulator(LE *a_field, double a_user, int a_days)
Apply growth regulator to a_field.
Definition: FarmFuncs.cpp:2070
pl_ww_stubble_cultivator_heavy
Definition: PLWinterWheat.h:51
pl_ww_ferti_p5
Definition: PLWinterWheat.h:62
pl_ww_autumn_sow
Definition: PLWinterWheat.h:56
LE::GetOwner
Farm * GetOwner(void)
Definition: Elements.h:256
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
PL_WW_FERTI_S1
#define PL_WW_FERTI_S1
Definition: PLWinterWheat.h:29
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
pl_ww_preseeding_cultivator
Definition: PLWinterWheat.h:54
Farm::FA_PK
virtual bool FA_PK(LE *a_field, double a_user, int a_days)
Apply PK fertilizer to a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1010
pl_ww_ferti_p7
Definition: PLWinterWheat.h:66
pl_ww_straw_chopping
Definition: PLWinterWheat.h:81
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
pl_ww_ferti_s11
Definition: PLWinterWheat.h:86
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
pl_ww_ferti_p1
Definition: PLWinterWheat.h:41
cfg_WW_NINV_tillage_prop1
CfgFloat cfg_WW_NINV_tillage_prop1
Provided to allow configuration control of the proportion of farmers doing first non-inversion tillag...
pl_ww_growth_regulator2
Definition: PLWinterWheat.h:79
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
Farm::StubbleHarrowing
virtual bool StubbleHarrowing(LE *a_field, double a_user, int a_days)
Carry out stubble harrowing on a_field.
Definition: FarmFuncs.cpp:1523
pl_ww_ferti_s1
Definition: PLWinterWheat.h:42
Farm::FP_NPKS
virtual bool FP_NPKS(LE *a_field, double a_user, int a_days)
Apply NPKS fertilizer, on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:630
Crop::SimpleEvent_
void SimpleEvent_(long a_date, int a_todo, bool a_lock, Farm *a_farm, LE *a_field)
Adds an event to this crop management without relying on member variables.
Definition: Farm.cpp:751