ALMaSS Hare ODDox  1.1
The hare model description following ODdox protocol
WWheatPTreatment.cpp
Go to the documentation of this file.
1 //
2 // WWheatPTreatment.cpp
3 //
4 /*
5 *******************************************************************************************************
6 Copyright (c) 2011, Christopher John Topping, Aarhus University
7 All rights reserved.
8 
9 Redistribution and use in source and binary forms, with or without modification, are permitted provided
10 that the following conditions are met:
11 
12 Redistributions of source code must retain the above copyright notice, this list of conditions and the
13 following disclaimer.
14 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
15 the following disclaimer in the documentation and/or other materials provided with the distribution.
16 
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
18 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
19 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
20 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
22 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 ********************************************************************************************************
26 */
27 
28 #include "../../Landscape/ls.h"
29 #include "../../Landscape/cropprogs/WWheatPTreatment.h"
30 
31 
32 extern CfgFloat cfg_ins_app_prop1;
33 extern CfgFloat cfg_herbi_app_prop;
34 extern CfgFloat cfg_fungi_app_prop1;
35 extern CfgFloat cfg_greg_app_prop;
36 extern CfgInt cfg_productapplicstartyear;
37 extern CfgInt cfg_productapplicendyear;
41 extern CfgFloat cfg_pest_product_1_amount;
42 
43 
44 bool WWheatPTreatment::Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev )
45 {
46  m_farm = a_farm;
47  m_field = a_field;
48  m_ev = a_ev;
49 
50  bool done = false;
51 
52  switch ( m_ev->m_todo )
53  {
54  case wwpt_start:
55  {
56  WWP_AUTUMN_PLOUGH = false;
57  WWP_WAIT_FOR_PLOUGH = false;
58 
59  // Set up the date management stuff
60 
61  // Could save the start day in case it is needed later
62  // m_field->m_startday = m_ev->m_startday;
63 
64  // Start and stop dates for all events after harvest
65  int noDates=5;
66  m_field->SetMDates(0,0,g_date->DayInYear(20,8));
67 
68  // Determined by harvest date - used to see if at all possible
69  m_field->SetMDates(1,0,g_date->DayInYear(20,8));
70  m_field->SetMDates(0,1,0); // Subbleharrow start
71  m_field->SetMDates(1,1,g_date->DayInYear(20,8));
72  m_field->SetMDates(0,2,g_date->DayInYear(5,8));
73  m_field->SetMDates(1,2,g_date->DayInYear(25,8));
74  m_field->SetMDates(0,3,g_date->DayInYear(10,8));
75  m_field->SetMDates(1,3,g_date->DayInYear(15,9));
76  m_field->SetMDates(0,4,g_date->DayInYear(15,8));
77  m_field->SetMDates(1,4,g_date->DayInYear(15,10));
78 
79  // Check the next crop for early start, unless it is a spring crop
80  // in which case we ASSUME that no checking is necessary!!!!
81  // So DO NOT implement a crop that runs over the year boundary
82  if (m_ev->m_startday>g_date->DayInYear(1,7))
83  {
84  if (m_field->GetMDates(0,0) >=m_ev->m_startday)
85  {
86  g_msg->Warn( WARN_BUG, "WWheatPTreatment::Do(): "
87  "Harvest too late for the next crop to start!!!", "" );
88  exit( 1 );
89  }
90  // Now fix any late finishing problems
91  for (int i=0; i<noDates; i++) {
92  if (m_field->GetMDates(0,i)>=m_ev->m_startday)
93  m_field->SetMDates(0,i,m_ev->m_startday-1);
94  if (m_field->GetMDates(1,i)>=m_ev->m_startday)
95  m_field->SetMDates(1,i,m_ev->m_startday-1);
96  }
97  }
98  // Now no operations can be timed after the start of the next crop.
99 
100  // CJT note:
101  // Start single block date checking code to be cut-'n-pasted...
102  int d1;
103  if ( ! m_ev->m_first_year ) {
104 
105  // Are we before July 1st?
106  d1 = g_date->OldDays() + g_date->DayInYear( 1,7 );
107  if (g_date->Date() < d1 ) {
108  // Yes, too early. We assumme this is because the last crop was late
109  printf ("Poly: %d\n", m_field->GetPoly());
110  g_msg->Warn( WARN_BUG, "WWheatPTreatment::Do(): "
111  "Crop start attempt between 1st Jan & 1st July", "" );
112  exit( 1 );
113  }
114  else
115  {
116  d1 = g_date->OldDays() + m_first_date; // Add 365 for spring crop
117  if (g_date->Date() > d1)
118  {
119  // Yes too late - should not happen - raise an error
120  g_msg->Warn( WARN_BUG, "WWheatPTrial::Do(): "
121  "Crop start attempt after last possible start date", "" );
122  exit( 1 );
123  }
124  }
125  }
126  else
127  {
128  // Is the first year
129  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1,4 ),
130  wwpt_spring_roll, false );
131  break;
132  }
133  // End single block date checking code. Please see next line
134  // comment as well.
135  // Reinit d1 to first possible starting date.
136  d1 = g_date->OldDays() + g_date->DayInYear( 21,8 );
137  // OK, let's go.
138  if (m_farm->IsStockFarmer()) // StockFarmer
139  {
140  SimpleEvent( d1, wwpt_ferti_s1, false );
141  }
142  else SimpleEvent( d1, wwpt_ferti_p1, false );
143  }
144  break;
145 
146  case wwpt_ferti_p1:
147  if ( m_ev->m_lock || m_farm->DoIt( 10 ))
148  {
149  if (!m_farm->FP_Slurry( m_field, 0.0,
150  g_date->DayInYear( 1,10 ) - g_date->DayInYear())) {
151  SimpleEvent( g_date->Date() + 1, wwpt_ferti_p1, true );
152  break;
153  }
154  }
155  SimpleEvent( g_date->Date(),wwpt_autumn_plough, false );
156  break;
157 
158  case wwpt_ferti_s1:
159  if (!m_farm->FA_Slurry( m_field, 0.0,
160  g_date->DayInYear( 1,10 ) - g_date->DayInYear())) {
161  SimpleEvent( g_date->Date() + 1, wwpt_ferti_s1, true );
162  break;
163  }
164  // This may cause two applications of fertilizer in one day...
165  // --FN--
166  SimpleEvent( g_date->Date(),wwpt_ferti_s2, false );
167  // --FN--
168  break;
169 
170  case wwpt_ferti_s2:
171  if ( m_ev->m_lock || m_farm->DoIt( 10 ))
172  {
173  if (!m_farm->FA_Manure( m_field, 0.0,
174  g_date->DayInYear( 1,10 ) - g_date->DayInYear())) {
175  SimpleEvent( g_date->Date() + 1, wwpt_ferti_s2, true );
176  break;
177  }
178  }
179  SimpleEvent( g_date->Date(),wwpt_autumn_plough, false );
180  break;
181 
182  case wwpt_autumn_plough:
183  if ( m_ev->m_lock || m_farm->DoIt( 95 ))
184  {
185  if (!m_farm->AutumnPlough( m_field, 0.0,
186  g_date->DayInYear( 1,10 ) - g_date->DayInYear())) {
187  SimpleEvent( g_date->Date() + 1, wwpt_autumn_plough, true );
188  break;
189  }
190  else
191  {
192  WWP_AUTUMN_PLOUGH=true;
193  SimpleEvent( g_date->Date()+1,wwpt_autumn_harrow, false );
194  break;
195  }
196  }
197  SimpleEvent( g_date->Date()+1,wwpt_stubble_harrow1, false );
198  break;
199 
200  case wwpt_autumn_harrow:
201  if (!m_farm->AutumnHarrow( m_field, 0.0,
202  g_date->DayInYear( 10,10 ) - g_date->DayInYear())) {
203  SimpleEvent( g_date->Date() + 1, wwpt_autumn_harrow, true );
204  break;
205  }
206  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 10,9 ),
207  wwpt_autumn_sow, false );
208  break;
209 
211  if (!m_farm->StubbleHarrowing( m_field, 0.0,
212  g_date->DayInYear( 10,10 ) - g_date->DayInYear())) {
213  SimpleEvent( g_date->Date() + 1, wwpt_stubble_harrow1, true );
214  break;
215  }
216  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 10,9 ),
217  wwpt_autumn_sow, false );
218  break;
219 
220  case wwpt_autumn_sow:
221  if (!m_farm->AutumnSow( m_field, 0.0,
222  g_date->DayInYear( 20,10 ) - g_date->DayInYear())) {
223  SimpleEvent( g_date->Date() + 1, wwpt_autumn_sow, true );
224  break;
225  }
226  SimpleEvent( g_date->Date() + 1, wwpt_autumn_roll, false );
227  break;
228 
229  case wwpt_autumn_roll:
230  if (( m_ev->m_lock || m_farm->DoIt( 5 ))&& (WWP_AUTUMN_PLOUGH))
231  {
232  if (!m_farm->AutumnRoll( m_field, 0.0,
233  g_date->DayInYear( 27,10 ) - g_date->DayInYear())) {
234  SimpleEvent( g_date->Date() + 1, wwpt_autumn_roll, true );
235  break;
236  }
237  }
238  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15,9 ),
239  wwpt_ferti_p2, false );
240  break;
241 
242  case wwpt_ferti_p2:
243  if (( m_ev->m_lock || m_farm->DoIt( 20 )) && (!m_farm->IsStockFarmer()))
244  {
245  if ( m_field->GetVegBiomass()>0)
246  //only when there has been a bit of growth
247  {
248  if (!m_farm->FP_ManganeseSulphate( m_field, 0.0,
249  g_date->DayInYear( 30,10 ) - g_date->DayInYear()))
250  {
251  SimpleEvent( g_date->Date() + 1, wwpt_ferti_p2, true );
252  break;
253  }
254  }
255  }
256  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 20,9 ),
257  wwpt_herbicide1, false );
258  break;
259 
260  case wwpt_herbicide1:
261  if ( m_ev->m_lock || m_farm->DoIt( (int) (100*cfg_herbi_app_prop.value() )))
262  {
263  if (!m_farm->HerbicideTreat( m_field, 0.0,
264  g_date->DayInYear( 5,10 ) - g_date->DayInYear())) {
265  SimpleEvent( g_date->Date() + 1, wwpt_herbicide1, true );
266  break;
267  }
268  }
269  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1,4 )+365,
270  wwpt_spring_roll, false );
271  break;
272 
273  case wwpt_spring_roll:
274  if ( m_ev->m_lock || m_farm->DoIt( 5 ))
275  {
276  if (!m_farm->SpringRoll( m_field, 0.0,
277  g_date->DayInYear( 30,4 ) - g_date->DayInYear())) {
278  SimpleEvent( g_date->Date() + 1, wwpt_spring_roll, true );
279  break;
280  }
281  }
282  if (m_farm->IsStockFarmer()) // StockFarmer
283  {
284  SimpleEvent( g_date->Date() + 1, wwpt_ferti_s3, false );
285  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 10,4 ),
286  wwpt_ferti_s4, false );
287  }
288  else
289  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 25,3 ),
290  wwpt_ferti_p3, false );
291  // All need the next threads
292  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15,4 ),
293  wwpt_herbicide2, false );
294  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 25,4 ),
295  wwpt_GR, false );
296  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 20,4 ),
297  wwpt_fungicide, false );
298  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 10,4 ),
299  wwpt_strigling1, false );
300  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1,5 ),
301  wwpt_water1, false );
303  SimpleEvent(g_date->OldDays() + cfg_pest_productapplic_startdate.value(),
304  wwpt_insecticide1, false);
305  }
306  break;
307 
308  case wwpt_herbicide2:
309  if ( m_ev->m_lock || m_farm->DoIt((int) (40*cfg_herbi_app_prop.value() )))
310  {
311  if (!m_farm->HerbicideTreat( m_field, 0.0,
312  g_date->DayInYear( 30,4 ) - g_date->DayInYear())) {
313  SimpleEvent( g_date->Date() + 1, wwpt_herbicide2, true );
314  break;
315  }
316  }
317  // End of thread
318  break;
319 
320  case wwpt_GR:
321  if ( m_ev->m_lock || m_farm->DoIt( (int)(15*cfg_greg_app_prop.value() )))
322  {
323  // --FN--
324  if (!m_farm->GrowthRegulator( m_field, 0.0,
325  g_date->DayInYear( 10,5 ) - g_date->DayInYear())) {
326  SimpleEvent( g_date->Date() + 1, wwpt_GR, true );
327  break;
328  }
329  }
330  // End of thread
331  break;
332 
333  case wwpt_fungicide:
334  if ( m_ev->m_lock || m_farm->DoIt( (int) (70*cfg_fungi_app_prop1.value() )))
335  {
336  if (!m_farm->FungicideTreat( m_field, 0.0,
337  g_date->DayInYear( 10,5 ) - g_date->DayInYear())) {
338  SimpleEvent( g_date->Date() + 1, wwpt_fungicide, true );
339  break;
340  }
341  }
342  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 20,5 ),
343  wwpt_fungicide2, false );
344  break;
345 
346  case wwpt_fungicide2:
347  if ( m_ev->m_lock || m_farm->DoIt( (int) (50*cfg_fungi_app_prop1.value() )))
348  {
349  if (!m_farm->FungicideTreat( m_field, 0.0,
350  g_date->DayInYear( 15,5 ) - g_date->DayInYear())) {
351  SimpleEvent( g_date->Date() + 1, wwpt_fungicide2, true );
352  break;
353  }
354  }
355  // End of thread
356  break;
357 
358  case wwpt_insecticide1:
359  /* // NB this version use crop growth stage
360  if (!m_farm->Trial_PesticideTreat_GS( m_field, 0.0, 0 )) {
361  SimpleEvent( g_date->Date() + 1, sbpt_insecticide1, false );
362  }
363  g_pest->DailyQueueAdd( m_field, l_pest_insecticide_amount.value() );
364  SimpleEvent( g_date->Date() + 7, sbpt_insecticide3, false ); // use sbpt_insecticde3 if you only want two applications
365  SBPT_INSECT_DATE = g_date->Date();
366  break;
367  */
368  // NB this version forces date based spraying - no weather constraints or probabilities
370  SimpleEvent(g_date->Date() + 14, wwpt_insecticide3, false); // use sbpt_insecticde3 if you only want two applications
371  break;
372 
373  case wwpt_insecticide2:
374  // NB this version forces date based spraying - no weather constraints or probabilities
376  SimpleEvent(g_date->Date() + 14, wwpt_insecticide3, false);
377  break;
378 
379  case wwpt_insecticide3:
380  // NB this version forces date based spraying - no weather constraints or probabilities
382  break;
383  // End of thread
384 
385  case wwpt_strigling1:
386  if (m_ev->m_lock || m_farm->DoIt(5))
387  {
388  if (!m_farm->Strigling(m_field, 0.0,
389  g_date->DayInYear(25, 4) - g_date->DayInYear())) {
390  SimpleEvent(g_date->Date() + 1, wwpt_strigling1, true);
391  break;
392  }
393  else {
394  if ((g_date->Date() + 7)<(g_date->OldDays() + g_date->DayInYear(15, 6)))
395  SimpleEvent(g_date->OldDays() + g_date->DayInYear(25, 4),
396  wwpt_strigling2, false);
397  else SimpleEvent(g_date->Date() + 7, wwpt_strigling2, false);
398  }
399  }
400  break;
401  case wwpt_strigling2:
402  if (!m_farm->Strigling(m_field, 0.0, g_date->DayInYear(5, 5) - g_date->DayInYear())) {
403  SimpleEvent(g_date->Date() + 1, wwpt_strigling2, true);
404  break;
405  }
406  // End of thread
407  break;
408 
409  case wwpt_water1:
410  if (m_ev->m_lock || m_farm->DoIt(10)) // **CJT** Soil type 1-4 only
411  {
412  if (!m_farm->Water(m_field, 0.0, g_date->DayInYear(15, 5) - g_date->DayInYear())) {
413  SimpleEvent(g_date->Date() + 1, wwpt_water1, true);
414  break;
415  }
416  else
417  if ((g_date->Date() + 5)<(g_date->OldDays() + g_date->DayInYear(2, 5)))
418  SimpleEvent(g_date->OldDays() + g_date->DayInYear(2, 5), wwpt_water2, false);
419  else SimpleEvent(g_date->Date() + 5, wwpt_water2, false);
420  }
421  break;
422 
423  case wwpt_water2:
424  if (!m_farm->Water( m_field, 0.0,
425  g_date->DayInYear( 1,6 ) - g_date->DayInYear())) {
426  SimpleEvent( g_date->Date() + 1, wwpt_water2, true );
427  break;
428  }
429  // End of thread
430  break;
431 
432  case wwpt_ferti_p3:
433  if (!m_farm->FP_NPK( m_field, 0.0,
434  g_date->DayInYear( 15,4 ) - g_date->DayInYear())) {
435  SimpleEvent( g_date->Date() + 1, wwpt_ferti_p3, true );
436  break;
437  }
438 
439  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 25,4 ),
440  wwpt_ferti_p4, false );
441  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1,4 ),
442  wwpt_ferti_p5, false );
443  break;
444 
445  case wwpt_ferti_p4:
446  if ( m_ev->m_lock || m_farm->DoIt( 50 ))
447  {
448  if (!m_farm->FP_NPK( m_field, 0.0,
449  g_date->DayInYear( 15,5 ) - g_date->DayInYear())) {
450  SimpleEvent( g_date->Date() + 1, wwpt_ferti_p4, true );
451  break;
452  }
453  }
454 
455  // The Main thread
456  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 5,8 ),
457  wwpt_harvest, false );
458  break;
459 
460  case wwpt_ferti_p5:
461  if ( m_ev->m_lock || m_farm->DoIt( 20 ))
462  {
463  if (!m_farm->FP_ManganeseSulphate( m_field, 0.0,
464  g_date->DayInYear( 5,5 ) - g_date->DayInYear())) {
465  SimpleEvent( g_date->Date() + 1, wwpt_ferti_p5, true );
466  break;
467  }
468  }
469  break;
470 
471  case wwpt_ferti_s3:
472  if (!m_farm->FA_Slurry(m_field, 0.0,
473  g_date->DayInYear( 30,4 ) - g_date->DayInYear())) {
474  SimpleEvent( g_date->Date() + 1, wwpt_ferti_s3, true );
475  break;
476  }
477  // The Main thread
478  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 5,8 ),
479  wwpt_harvest, false );
480  break;
481 
482  case wwpt_ferti_s4:
483  if ( m_ev->m_lock || m_farm->DoIt( 75 ))
484  {
485  if (!m_farm->FA_NPK( m_field, 0.0,
486  g_date->DayInYear( 20,4 ) - g_date->DayInYear())) {
487  SimpleEvent( g_date->Date() + 1, wwpt_ferti_s4, true );
488  break;
489  }
490  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 21,4 ),
491  wwpt_ferti_s5, false );
492  }
493  break;
494 
495  case wwpt_ferti_s5:
496  if ( m_ev->m_lock || m_farm->DoIt( 40 ))
497  {
498  if (!m_farm->FA_NPK( m_field, 0.0,
499  g_date->DayInYear( 1,5 ) - g_date->DayInYear())) {
500  SimpleEvent( g_date->Date() + 1, wwpt_ferti_s5, true );
501  break;
502  }
503  }
504  break;
505 
506  case wwpt_harvest:
507  if (!m_farm->Harvest( m_field, 0.0,
508  g_date->DayInYear( 20,8 ) - g_date->DayInYear()))
509  {
510  SimpleEvent( g_date->Date() + 1, wwpt_harvest, true );
511  break;
512  }
513  SimpleEvent( g_date->Date(), wwpt_straw_chopping, false );
514  break;
515 
516  case wwpt_straw_chopping:
517  if ( m_ev->m_lock || m_farm->DoIt( 75 ))
518  {
519  if (!m_farm->StrawChopping( m_field, 0.0,
520  m_field->GetMDates(1,0) - g_date->DayInYear())) {
521  SimpleEvent( g_date->Date() + 1, wwpt_straw_chopping, true );
522  break;
523  }
524  else
525  {
526  SimpleEvent( g_date->Date()+1, wwpt_stubble_harrow2, false );
527  }
528  }
529  else
530  {
531  SimpleEvent( g_date->Date()+1, wwpt_hay_turning, false );
532  }
533  break;
534 
535  case wwpt_hay_turning:
536  if ( m_ev->m_lock || m_farm->DoIt( 5 ))
537  {
538  if (!m_farm->HayTurning( m_field, 0.0,
539  m_field->GetMDates(1,1) - g_date->DayInYear())) {
540  SimpleEvent( g_date->Date() + 1, wwpt_hay_turning, true );
541  break;
542  }
543  }
544  SimpleEvent( g_date->OldDays() + m_field->GetMDates(0,2),
545  wwpt_hay_baling, false );
546  break;
547 
548  case wwpt_hay_baling:
549  if (!m_farm->HayBailing( m_field, 0.0,
550  m_field->GetMDates(1,2) - g_date->DayInYear())) {
551  SimpleEvent( g_date->Date() + 1, wwpt_hay_baling, true );
552  break;
553  }
554  SimpleEvent( g_date->OldDays() + m_field->GetMDates(0,3),
555  wwpt_stubble_harrow2, false );
556  break;
557 
559  if ( m_ev->m_lock || m_farm->DoIt( 65 ))
560  {
561  if (!m_farm->StubbleHarrowing( m_field, 0.0,
562  m_field->GetMDates(1,3) - g_date->DayInYear())) {
563  SimpleEvent( g_date->Date() + 1, wwpt_stubble_harrow2, true );
564  break;
565  }
566  }
567  SimpleEvent( g_date->OldDays() + m_field->GetMDates(0,4),
568  wwpt_grubning, false );
569  break;
570 
571  case wwpt_grubning:
572  if ( m_ev->m_lock || m_farm->DoIt( 10 ))
573  {
574  if (!m_farm->DeepPlough( m_field, 0.0,
575  m_field->GetMDates(1,4) - g_date->DayInYear())) {
576  SimpleEvent( g_date->Date() + 1, wwpt_grubning, true );
577  break;
578  }
579  }
580  done=true;
581  // END OF MAIN THREAD
582  break;
583 
584  default:
585  g_msg->Warn( WARN_BUG, "WWheatPTreatment::Do(): "
586  "Unknown event type! ", "" );
587  exit( 1 );
588  }
589  return done;
590 }
591 
Farm::SpringRoll
virtual bool SpringRoll(LE *a_field, double a_user, int a_days)
Carry out a roll event in the spring on a_field.
Definition: farmfuncs.cpp:525
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:965
wwpt_fungicide2
Definition: WWheatPTreatment.h:61
wwpt_grubning
Definition: WWheatPTreatment.h:80
Farm::HerbicideTreat
virtual bool HerbicideTreat(LE *a_field, double a_user, int a_days)
Apply herbicide to a_field.
Definition: farmfuncs.cpp:1156
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: farm.h:905
Farm::Strigling
virtual bool Strigling(LE *a_field, double a_user, int a_days)
Carry out a mechanical weeding on a_field.
Definition: farmfuncs.cpp:1545
wwpt_water1
Definition: WWheatPTreatment.h:67
cfg_productapplicendyear
CfgInt cfg_productapplicendyear
wwpt_harvest
Definition: WWheatPTreatment.h:75
Farm::Harvest
virtual bool Harvest(LE *a_field, double a_user, int a_days)
Carry out a harvest on a_field.
Definition: farmfuncs.cpp:1769
FarmEvent::m_lock
bool m_lock
Definition: farm.h:465
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:727
Farm::ProductApplication
virtual bool ProductApplication(LE *a_field, double a_user, int a_days, double a_applicationrate, PlantProtectionProducts a_ppp)
Apply test pesticide to a_field.
Definition: farmfuncs.cpp:1445
FarmEvent
A struct to hold the information required to trigger a farm event.
Definition: farm.h:463
Farm::FP_NPK
virtual bool FP_NPK(LE *a_field, double a_user, int a_days)
Apply NPK fertilizer, on a_field owned by an arable farmer.
Definition: farmfuncs.cpp:629
wwpt_autumn_sow
Definition: WWheatPTreatment.h:53
cfg_productapplicstartyear
CfgInt cfg_productapplicstartyear
Farm::DoIt
bool DoIt(double a_probability)
Return chance out of 0 to 100.
Definition: farm.cpp:800
cfg_herbi_app_prop
CfgFloat cfg_herbi_app_prop
wwpt_ferti_p4
Definition: WWheatPTreatment.h:70
FarmEvent::m_first_year
bool m_first_year
Definition: farm.h:467
cfg_pest_productapplic_startdate2
CfgInt cfg_pest_productapplic_startdate2
wwpt_hay_baling
Definition: WWheatPTreatment.h:78
wwpt_herbicide2
Definition: WWheatPTreatment.h:58
wwpt_hay_turning
Definition: WWheatPTreatment.h:77
WWheatPTreatment::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: WWheatPTreatment.cpp:44
Farm::FA_Manure
virtual bool FA_Manure(LE *a_field, double a_user, int a_days)
Spread manure on a_field owned by an stock farmer.
Definition: farmfuncs.cpp:1036
wwpt_ferti_s3
Definition: WWheatPTreatment.h:72
wwpt_ferti_s1
Definition: WWheatPTreatment.h:48
wwpt_ferti_p2
Definition: WWheatPTreatment.h:55
wwpt_strigling1
Definition: WWheatPTreatment.h:65
cfg_pest_productapplic_startdate
CfgInt cfg_pest_productapplic_startdate
Crop::m_first_date
int m_first_date
Definition: farm.h:540
FarmEvent::m_startday
int m_startday
Definition: farm.h:466
Farm::FA_NPK
virtual bool FA_NPK(LE *a_field, double a_user, int a_days)
Apply NPK fertilizer to a_field owned by an stock farmer.
Definition: farmfuncs.cpp:917
wwpt_autumn_harrow
Definition: WWheatPTreatment.h:51
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: farmfuncs.cpp:1279
wwpt_ferti_s2
Definition: WWheatPTreatment.h:49
cfg_pest_product_1_amount
CfgFloat cfg_pest_product_1_amount
Crop::SimpleEvent
void SimpleEvent(long a_date, int a_todo, bool a_lock)
Adds an event to this crop management.
Definition: farm.cpp:307
wwpt_straw_chopping
Definition: WWheatPTreatment.h:76
wwpt_insecticide1
Definition: WWheatPTreatment.h:62
Farm::AutumnSow
virtual bool AutumnSow(LE *a_field, double a_user, int a_days)
Carry out a sowing event in the autumn on a_field.
Definition: farmfuncs.cpp:364
wwpt_insecticide3
Definition: WWheatPTreatment.h:64
wwpt_start
Definition: WWheatPTreatment.h:45
WWP_WAIT_FOR_PLOUGH
#define WWP_WAIT_FOR_PLOUGH
Definition: WheatPControl.h:37
cfg_pest_productapplic_startdate3
CfgInt cfg_pest_productapplic_startdate3
wwpt_stubble_harrow2
Definition: WWheatPTreatment.h:79
wwpt_ferti_p5
Definition: WWheatPTreatment.h:71
wwpt_stubble_harrow1
Definition: WWheatPTreatment.h:52
Farm::HayBailing
virtual bool HayBailing(LE *a_field, double a_user, int a_days)
Carry out hay bailing on a_field.
Definition: farmfuncs.cpp:2184
Farm::StrawChopping
virtual bool StrawChopping(LE *a_field, double a_user, int a_days)
Carry out straw chopping on a_field.
Definition: farmfuncs.cpp:2132
WWP_AUTUMN_PLOUGH
#define WWP_AUTUMN_PLOUGH
Definition: WheatPControl.h:38
cfg_fungi_app_prop1
CfgFloat cfg_fungi_app_prop1
wwpt_strigling2
Definition: WWheatPTreatment.h:66
wwpt_ferti_p3
Definition: WWheatPTreatment.h:69
wwpt_water2
Definition: WWheatPTreatment.h:68
Landscape::SupplyYearNumber
int SupplyYearNumber(void)
Definition: Landscape.h:1616
wwpt_autumn_plough
Definition: WWheatPTreatment.h:50
Crop::m_farm
Farm * m_farm
Definition: farm.h:537
Crop::m_field
LE * m_field
Definition: farm.h:538
wwpt_ferti_s4
Definition: WWheatPTreatment.h:73
FarmEvent::m_todo
int m_todo
Definition: farm.h:469
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:288
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:701
ppp_1
Definition: farm.h:422
wwpt_autumn_roll
Definition: WWheatPTreatment.h:54
Farm::Water
virtual bool Water(LE *a_field, double a_user, int a_days)
Carry out a watering on a_field.
Definition: farmfuncs.cpp:1717
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:132
wwpt_spring_roll
Definition: WWheatPTreatment.h:57
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:261
wwpt_herbicide1
Definition: WWheatPTreatment.h:56
Farm
The base class for all farm types.
Definition: farm.h:767
Farm::DeepPlough
virtual bool DeepPlough(LE *a_field, double a_user, int a_days)
Carry out a deep ploughing event on a_field.
Definition: farmfuncs.cpp:417
Farm::GrowthRegulator
virtual bool GrowthRegulator(LE *a_field, double a_user, int a_days)
Apply growth regulator to a_field.
Definition: farmfuncs.cpp:1250
wwpt_GR
Definition: WWheatPTreatment.h:59
wwpt_ferti_s5
Definition: WWheatPTreatment.h:74
cfg_greg_app_prop
CfgFloat cfg_greg_app_prop
cfg_ins_app_prop1
CfgFloat cfg_ins_app_prop1
wwpt_ferti_p1
Definition: WWheatPTreatment.h:47
wwpt_fungicide
Definition: WWheatPTreatment.h:60
Farm::HayTurning
virtual bool HayTurning(LE *a_field, double a_user, int a_days)
Carry out hay turning on a_field.
Definition: farmfuncs.cpp:2159
Crop::m_ev
FarmEvent * m_ev
Definition: farm.h:539
g_landscape_p
Landscape * g_landscape_p
Definition: Landscape.cpp:258
Farm::StubbleHarrowing
virtual bool StubbleHarrowing(LE *a_field, double a_user, int a_days)
Carry out stubble harrowing on a_field.
Definition: farmfuncs.cpp:2209
wwpt_insecticide2
Definition: WWheatPTreatment.h:63