ALMaSS Hare ODDox  1.1
The hare model description following ODdox protocol
WinterBarleyStrigling.cpp
Go to the documentation of this file.
1 //
2 // WinterBarley.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/WinterBarleyStrigling.h"
30 #include <math.h>
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 CfgFloat cfg_strigling_prop;
37 
38 bool WinterBarleyStrigling::Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev )
39 {
40  m_farm = a_farm;
41  m_field = a_field;
42  m_ev = a_ev;
43  bool done = false;
44 
45  switch ( m_ev->m_todo )
46  {
47  case wbs_start:
48  {
49  // Set up the date management stuff
50  m_last_date=g_date->DayInYear(10,8);
51  // Start and stop dates for all events after harvest
52  int noDates= 3;
53  m_field->SetMDates(0,0,g_date->DayInYear(20,7));
54  // Determined by harvest date - used to see if at all possible
55  m_field->SetMDates(1,0,g_date->DayInYear(5,8));
56  m_field->SetMDates(0,1,g_date->DayInYear(25,7));
57  m_field->SetMDates(1,1,g_date->DayInYear(10,8));
58  m_field->SetMDates(0,2,g_date->DayInYear(20,7));
59  m_field->SetMDates(1,2,g_date->DayInYear(5,8));
60  // Check the next crop for early start, unless it is a spring crop
61  // in which case we ASSUME that no checking is necessary!!!!
62  // So DO NOT implement a crop that runs over the year boundary
63  if (m_ev->m_startday>g_date->DayInYear(1,7))
64  {
65  if (m_field->GetMDates(0,0) >=m_ev->m_startday)
66  {
67  g_msg->Warn( WARN_BUG, "WinterBarley::Do(): "
68  "Harvest too late for the next crop to start!!!", "" );
69  exit( 1 );
70  }
71  // Now fix any late finishing problems
72  for (int i=0; i<noDates; i++)
73  {
74  if (m_field->GetMDates(0,i)>=m_ev->m_startday)
75  m_field->SetMDates(0,i,m_ev->m_startday-1);
76  if (m_field->GetMDates(1,i)>=m_ev->m_startday)
77  m_field->SetMDates(1,i,m_ev->m_startday-1);
78  }
79  }
80  // Now no operations can be timed after the start of the next crop.
81 
82  int d1;
83  if ( ! m_ev->m_first_year )
84  {
85  int today=g_date->Date();
86  // Are we before July 1st?
87  d1 = g_date->OldDays() + g_date->DayInYear( 1,7 );
88  if (today < d1)
89  {
90  // Yes, too early. We assumme this is because the last crop was late
91  g_msg->Warn( WARN_BUG, "WinterBarley::Do(): "
92  "Crop start attempt between 1st Jan & 1st July", "" );
93  exit( 1 );
94  }
95  else
96  {
97  d1 = g_date->OldDays() + m_first_date; // Add 365 for spring crop
98  if (today > d1)
99  {
100  // Yes too late - should not happen - raise an error
101  g_msg->Warn( WARN_BUG, "WinterBarley::Do(): "
102  "Crop start attempt after last possible start date", "" );
103  exit( 1 );
104  }
105  }
106  }
107  else
108  {
109  // Is the first year so must start in spring like nothing was unusual
110  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 20,7 )
111  ,wbs_harvest, false );
112  }
113  // End single block date checking code. Please see next line
114  // comment as well.
115  // Reinit d1 to first possible starting date.
116  d1 = g_date->OldDays() + m_first_date; // Add 365 for spring crop
117  if ( g_date->Date() > d1 ) {
118  d1 = g_date->Date();
119  }
120  // OK, let's go.
121  WBS_DID_SEVEN_ONE = false;
122  WBS_DID_SEVEN_TWO = false;
123  WBS_DID_SEVEN_THREE = false;
124  WBS_DID_SEVEN_FOUR = false;
125  WBS_FUNGICIDE_DATE = 0;
126  WBS_HERBICIDE_DATE = 0;
127 
128  if ( m_farm->IsStockFarmer()) {
129  SimpleEvent( d1, wbs_fertmanure_stock, false );
130  d1 += 14;
132  } else {
134  }
135  }
136  break;
137 
139  if ( m_ev->m_lock || m_farm->DoIt( 10 ))
140  {
141  if (!m_farm->FA_Manure( m_field, 0.0,
142  g_date->DayInYear( 5, 9 ) -
143  g_date->DayInYear())) {
144  SimpleEvent( g_date->Date() + 1, wbs_fertmanure_stock, true );
145  break;
146  }
147  }
148  break;
149 
151  if ( m_ev->m_lock || m_farm->DoIt( 95 ))
152  {
153  if (!m_farm->FA_Slurry( m_field, 0.0,
154  g_date->DayInYear( 10, 9 ) -
155  g_date->DayInYear())) {
156  SimpleEvent( g_date->Date() + 1, wbs_fertslurry_stock_one, true );
157  break;
158  }
159  }
160  SimpleEvent( g_date->Date() + 1, wbs_autumn_plough, false );
161  break;
162 
164  if ( m_ev->m_lock || m_farm->DoIt( 10 ))
165  {
166  if (!m_farm->FP_Sludge( m_field, 0.0,
167  g_date->DayInYear( 5, 9 ) -
168  g_date->DayInYear())) {
169  SimpleEvent( g_date->Date() + 1, wbs_fertsludge_plant_one, true );
170  break;
171  }
172  }
173  SimpleEvent( g_date->Date() + 1, wbs_autumn_plough, false );
174  break;
175 
176  case wbs_autumn_plough:
177  if (!m_farm->AutumnPlough( m_field, 0.0,
178  g_date->DayInYear( 5, 9 ) -
179  g_date->DayInYear())) {
180  SimpleEvent( g_date->Date() + 1, wbs_autumn_plough, true );
181  break;
182  }
183  SimpleEvent( g_date->Date(), wbs_autumn_harrow, false );
184  break;
185 
186  case wbs_autumn_harrow:
187  if (!m_farm->AutumnHarrow( m_field, 0.0,
188  g_date->DayInYear( 5, 9 ) -
189  g_date->DayInYear())) {
190  SimpleEvent( g_date->Date() + 1, wbs_autumn_harrow, true );
191  break;
192  }
193  {
194  int d1 = g_date->Date();
195  if ( d1 < g_date->OldDays() + g_date->DayInYear( 1, 9 )) {
196  d1 = g_date->OldDays() + g_date->DayInYear( 1, 9 );
197  }
198  SimpleEvent( d1, wbs_autumn_sow, false );
199  }
200  break;
201 
202  case wbs_autumn_sow:
203  if (!m_farm->AutumnSow( m_field, 0.0,
204  g_date->DayInYear( 15,9 ) -
205  g_date->DayInYear())) {
206  SimpleEvent( g_date->Date() + 1, wbs_autumn_sow, true );
207  break;
208  }
209  {
210  int d1 = g_date->Date() + 10;
211  if ( d1 < g_date->OldDays() + g_date->DayInYear( 15, 9 )) {
212  d1 = g_date->OldDays() + g_date->DayInYear( 15, 9 );
213  }
214  SimpleEvent( d1, wbs_strigling_one, false );
215  }
216  break;
217 
218 case wbs_strigling_one:
219  if (!m_farm->Strigling( m_field, 0.0,
220  g_date->DayInYear( 10,10 ) -
221  g_date->DayInYear())) {
222  SimpleEvent( g_date->Date() + 1, wbs_strigling_one, true );
223  break;
224  }
225  if ( m_farm->IsStockFarmer()) {
226  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1,4 ) + 365,
227  wbs_fertslurry_stock_two, false );
228  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 5,4 ) + 365,
229  wbs_fertnpk_stock_one, false );
230  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1,5 ) + 365,
231  wbs_fungicide_one, false );
232  } else {
233  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 16,9 ),
235  }
236  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 5,4 ) + 365,
237  wbs_strigling_two, false );
238  break;
239 
241  if ( m_ev->m_lock || m_farm->DoIt( 20 ))
242  {
243  if (!m_farm->FP_ManganeseSulphate( m_field, 0.0,
244  g_date->DayInYear( 30,10 ) -
245  g_date->DayInYear())) {
246  SimpleEvent( g_date->Date() + 1, wbs_fertmanganese_plant_one, true );
247  break;
248  }
249  // Did first, so do second manganese too.
250  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1,4 ) + 365,
252  } else {
253  // Event 'wbs_fertmanganese_plant_two' was not queued up, so we will
254  // signal its completion already here...
255  WBS_DID_SEVEN_ONE = true;
256  }
257  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 5,4 ) + 365,
258  wbs_fertnpk_plant_one, false );
259  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1,5 ) + 365,
260  wbs_fungicide_one, false );
261  break;
262 
264  if (!m_farm->FP_ManganeseSulphate( m_field, 0.0,
265  g_date->DayInYear( 5,5 ) -
266  g_date->DayInYear())) {
267  SimpleEvent( g_date->Date() + 1, wbs_fertmanganese_plant_two, true );
268  break;
269  }
270  WBS_DID_SEVEN_ONE = true;
271  if ( WBS_DID_SEVEN_TWO &&
274  // We are the last surviving thread. Enter switchboard.
275  SimpleEvent( g_date->Date(), wbs_switchboard, false );
276  }
277  break;
278 
280  if (!m_farm->FP_NPK( m_field, 0.0,
281  g_date->DayInYear( 1,5 ) -
282  g_date->DayInYear())) {
283  SimpleEvent( g_date->Date() + 1, wbs_fertnpk_plant_one, true );
284  break;
285  }
286  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 2,5 ),
287  wbs_fertnpk_plant_two, false );
288  break;
289 
291  if ( m_ev->m_lock || m_farm->DoIt( 15 )) {
292  if (!m_farm->FP_NPK( m_field, 0.0,
293  g_date->DayInYear( 20,5 ) -
294  g_date->DayInYear())) {
295  SimpleEvent( g_date->Date() + 1, wbs_fertnpk_plant_two, true );
296  break;
297  }
298  }
299  WBS_DID_SEVEN_TWO = true;
300  if ( WBS_DID_SEVEN_ONE &&
303  // We are the last surviving thread. Enter switchboard.
304  SimpleEvent( g_date->Date(), wbs_switchboard, false );
305  }
306  break;
307 
309  if ( m_ev->m_lock || m_farm->DoIt( 20 )) {
310  if (!m_farm->FA_Slurry( m_field, 0.0,
311  g_date->DayInYear( 15,5 ) -
312  g_date->DayInYear())) {
313  SimpleEvent( g_date->Date() + 1, wbs_fertslurry_stock_two, true );
314  break;
315  }
316  }
317  WBS_DID_SEVEN_ONE = true;
318  if ( WBS_DID_SEVEN_TWO &&
321  // We are the last surviving thread. Enter switchboard.
322  SimpleEvent( g_date->Date(), wbs_switchboard, false );
323  }
324  break;
325 
327  if ( m_ev->m_lock || m_farm->DoIt( 90 )) {
328  if (!m_farm->FA_NPK( m_field, 0.0,
329  g_date->DayInYear( 30,4 ) -
330  g_date->DayInYear())) {
331  SimpleEvent( g_date->Date() + 1, wbs_fertnpk_stock_one, true );
332  break;
333  }
334  }
335  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1,5 ),
336  wbs_fertnpk_stock_two, false );
337  break;
338 
340  if ( m_ev->m_lock || m_farm->DoIt( 14 )) {
341  if (!m_farm->FA_NPK( m_field, 0.0,
342  g_date->DayInYear( 15,5 ) -
343  g_date->DayInYear())) {
344  SimpleEvent( g_date->Date() + 1, wbs_fertnpk_stock_two, true );
345  break;
346  }
347  }
348  WBS_DID_SEVEN_TWO = true;
349  if ( WBS_DID_SEVEN_ONE &&
352  // We are the last surviving thread. Enter switchboard.
353  SimpleEvent( g_date->Date(), wbs_switchboard, false );
354  }
355  break;
356 
357  case wbs_strigling_two:
358  if ( m_ev->m_lock || m_farm->DoIt( (int) ((int) (60*cfg_herbi_app_prop.value() )) )) {
359  if (!m_farm->HerbicideTreat( m_field, 0.0,
360  g_date->DayInYear( 25,5 ) -
361  g_date->DayInYear())) {
362  SimpleEvent( g_date->Date() + 1, wbs_strigling_two, true );
363  break;
364  }
365  WBS_HERBICIDE_DATE = g_date->Date();
366  }
367  WBS_DID_SEVEN_THREE = true;
368  if ( WBS_DID_SEVEN_ONE &&
371  // We are the last surviving thread. Enter switchboard.
372  SimpleEvent( g_date->Date(), wbs_switchboard, false );
373  }
374  break;
375 
376  case wbs_fungicide_one:
377  if ( m_ev->m_lock || m_farm->DoIt( (int) (90*cfg_fungi_app_prop1.value() ))) {
378  if (!m_farm->FungicideTreat( m_field, 0.0,
379  g_date->DayInYear( 15,5 ) -
380  g_date->DayInYear())) {
381  SimpleEvent( g_date->Date() + 1, wbs_fungicide_one, true );
382  break;
383  }
384  WBS_FUNGICIDE_DATE = g_date->Date();
385  }
386  WBS_DID_SEVEN_FOUR = true;
387  if ( WBS_DID_SEVEN_ONE &&
390  // We are the last surviving thread. Enter switchboard.
391  SimpleEvent( g_date->Date(), wbs_switchboard, false );
392  }
393  break;
394 
395  case wbs_switchboard:
396  // Welcome to the Winterbarley switchboard, where all threads
397  // meet and have a jolly good time.
398 
399  // Reset all flags for the second round of parallel execution.
400  // Flags double as date indicators when each action took place
401  // (for checking proximity to watering).
402  WBS_DID_EIGHT_ONE = false;
403  WBS_DID_EIGHT_TWO = false;
404  WBS_DID_EIGHT_THREE = false;
405  WBS_DID_EIGHT_FOUR = false;
406 
407  // Start all four threads.
408  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15,5 ),
409  wbs_fungicide_two, false );
410  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1,5 ),
411  wbs_growth_reg, false );
412  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15,5 ),
413  wbs_water, false );
414  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15,5 ),
415  wbs_insecticide, false );
416  break;
417 
418  case wbs_fungicide_two:
419  if ( g_date->Date() < WBS_DID_EIGHT_THREE + 1 ||
420  g_date->Date() < WBS_FUNGICIDE_DATE + 7 ) {
421  // Try again tomorrow.
422  SimpleEvent( g_date->Date() + 1, wbs_fungicide_two, m_ev->m_lock );
423  break;
424  }
425  if ( m_ev->m_lock || m_farm->DoIt( (int) (27*cfg_fungi_app_prop1.value() ))) {
426  if (!m_farm->FungicideTreat( m_field, 0.0,
427  g_date->DayInYear( 30,5 ) -
428  g_date->DayInYear())) {
429  SimpleEvent( g_date->Date() + 1, wbs_fungicide_two, true );
430  break;
431  }
432  }
433  WBS_DID_EIGHT_ONE = g_date->Date();
434  if ( WBS_DID_EIGHT_TWO &&
437  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 20,7 ),
438  wbs_harvest, false );
439  }
440  break;
441 
442  case wbs_growth_reg:
443  if ( g_date->Date() < WBS_DID_EIGHT_THREE + 1 ) {
444  // Try again tomorrow.
445  SimpleEvent( g_date->Date() + 1, wbs_growth_reg, m_ev->m_lock );
446  break;
447  }
448  if ( m_ev->m_lock || m_farm->DoIt( (int) (50*cfg_greg_app_prop.value() ))) {
449  if (!m_farm->GrowthRegulator( m_field, 0.0,
450  g_date->DayInYear( 31,5 ) -
451  g_date->DayInYear())) {
452  SimpleEvent( g_date->Date() + 1, wbs_growth_reg, true );
453  break;
454  }
455  }
456  WBS_DID_EIGHT_TWO = g_date->Date();
457  if ( WBS_DID_EIGHT_ONE &&
460  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 20,7 ),
461  wbs_harvest, false );
462  }
463  break;
464 
465  case wbs_water:
466  if ( g_date->Date() < WBS_HERBICIDE_DATE + 1 ||
467  g_date->Date() < WBS_DID_EIGHT_ONE + 1 ||
468  g_date->Date() < WBS_DID_EIGHT_TWO + 1 ||
469  g_date->Date() < WBS_DID_EIGHT_FOUR + 1 ) {
470  // Try again tomorrow.
471  SimpleEvent( g_date->Date() + 1, wbs_water, m_ev->m_lock );
472  break;
473  }
474  if ( m_ev->m_lock || m_farm->DoIt( 5 )) {
475  if (!m_farm->Water( m_field, 0.0,
476  g_date->DayInYear( 15,6 ) -
477  g_date->DayInYear())) {
478  SimpleEvent( g_date->Date() + 1, wbs_water, true );
479  break;
480  }
481  }
482  WBS_DID_EIGHT_THREE = g_date->Date();
483  if ( WBS_DID_EIGHT_ONE &&
486  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 20,7 ),
487  wbs_harvest, false );
488  }
489  break;
490 
491  case wbs_insecticide:
492  if ( g_date->Date() < WBS_DID_EIGHT_THREE + 1 ) {
493  // Try again tomorrow.
494  SimpleEvent( g_date->Date() + 1, wbs_insecticide, m_ev->m_lock );
495  break;
496  }
497  if ( m_ev->m_lock || m_farm->DoIt( (int) (5*cfg_ins_app_prop1.value() ))) {
498  if (!m_farm->InsecticideTreat( m_field, 0.0,
499  g_date->DayInYear( 1,6 ) -
500  g_date->DayInYear())) {
501  SimpleEvent( g_date->Date() + 1, wbs_insecticide, true );
502  break;
503  }
504  }
505  WBS_DID_EIGHT_FOUR = g_date->Date();
506  if ( WBS_DID_EIGHT_ONE &&
509  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 20,7 ),
510  wbs_harvest, false );
511  }
512  break;
513 
514  case wbs_harvest:
515  if (!m_farm->Harvest( m_field, 0.0,
516  m_field->GetMDates(1,0) -
517  g_date->DayInYear())) {
518  SimpleEvent( g_date->Date() + 1, wbs_harvest, true );
519  break;
520  }
521 
522  if ( m_farm->IsStockFarmer()) {
523  if ( m_farm->DoIt( 15 )) {
524  // Force straw chopping on the same day as harvest.
525  m_farm->StrawChopping( m_field, 0.0, 0 );
526  SimpleEvent( g_date->OldDays() + m_field->GetMDates(0,1),
527  wbs_stubble_harrowing, false );
528  break;
529  }
530  // No chopping and harrowing, so try hay turning.
531  SimpleEvent( g_date->OldDays() + m_field->GetMDates(0,2),
532  wbs_hay_turning, false );
533  break;
534  } else {
535  // Plant farmer.
536  if ( m_farm->DoIt( 75 )) {
537  // Force straw chopping on the same day as harvest.
538  m_farm->StrawChopping( m_field, 0.0, 0 );
539  SimpleEvent( g_date->OldDays() + m_field->GetMDates(0,1),
540  wbs_stubble_harrowing, false );
541  break;
542  }
543  SimpleEvent( g_date->OldDays() + m_field->GetMDates(0,2),
544  wbs_hay_turning, false );
545  }
546  break;
547 
548  case wbs_hay_turning:
549  if ( m_ev->m_lock || m_farm->DoIt( 50 ))
550  {
551  if (!m_farm->HayTurning( m_field, 0.0,
552  m_field->GetMDates(1,2) -
553  g_date->DayInYear())) {
554  SimpleEvent( g_date->Date() + 1, wbs_hay_turning, true );
555  break;
556  }
557  }
558  SimpleEvent( g_date->OldDays() + m_field->GetMDates(0,2),
559  wbs_hay_bailing, false );
560  break;
561 
562  case wbs_hay_bailing:
563  if (!m_farm->HayBailing( m_field, 0.0,
564  m_field->GetMDates(1,2) -
565  g_date->DayInYear())) {
566  SimpleEvent( g_date->Date() + 1, wbs_hay_bailing, true );
567  break;
568  }
569  {
570  int d1 = g_date->Date();
571  if ( d1 < g_date->OldDays() + m_field->GetMDates(0,1)) {
572  d1 = g_date->OldDays() + m_field->GetMDates(0,1);
573  }
574  SimpleEvent( d1, wbs_stubble_harrowing, false );
575  }
576  break;
577 
579  if ( m_ev->m_lock || m_farm->DoIt( 40 )) {
580  if (!m_farm->StubbleHarrowing( m_field, 0.0,
581  m_field->GetMDates(1,2) -
582  g_date->DayInYear())) {
583  SimpleEvent( g_date->Date() + 1, wbs_stubble_harrowing, true );
584  break;
585  }
586  }
587  done = true;
588  break;
589 
590  default:
591  g_msg->Warn( WARN_BUG, "WinterBarley::Do(): "
592  "Unknown event type! ", "" );
593  exit( 1 );
594  }
595 
596  return done;
597 }
598 
599 
Farm::FP_Sludge
virtual bool FP_Sludge(LE *a_field, double a_user, int a_days)
Spread sewege on a_field owned by an arable farmer.
Definition: farmfuncs.cpp:822
WBS_DID_EIGHT_FOUR
#define WBS_DID_EIGHT_FOUR
Definition: WinterBarleyStrigling.h:53
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
wbs_start
Definition: WinterBarleyStrigling.h:56
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
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
FarmEvent
A struct to hold the information required to trigger a farm event.
Definition: farm.h:463
cfg_herbi_app_prop
CfgFloat cfg_herbi_app_prop
WBS_DID_SEVEN_TWO
#define WBS_DID_SEVEN_TWO
Definition: WinterBarleyStrigling.h:43
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
Farm::DoIt
bool DoIt(double a_probability)
Return chance out of 0 to 100.
Definition: farm.cpp:800
wbs_water
Definition: WinterBarleyStrigling.h:76
wbs_autumn_harrow
Definition: WinterBarleyStrigling.h:61
wbs_fertnpk_plant_two
Definition: WinterBarleyStrigling.h:67
wbs_autumn_sow
Definition: WinterBarleyStrigling.h:62
FarmEvent::m_first_year
bool m_first_year
Definition: farm.h:467
wbs_fertnpk_stock_two
Definition: WinterBarleyStrigling.h:70
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
WBS_DID_SEVEN_FOUR
#define WBS_DID_SEVEN_FOUR
Definition: WinterBarleyStrigling.h:45
wbs_strigling_two
Definition: WinterBarleyStrigling.h:71
wbs_fertmanganese_plant_two
Definition: WinterBarleyStrigling.h:65
wbs_autumn_plough
Definition: WinterBarleyStrigling.h:60
wbs_hay_bailing
Definition: WinterBarleyStrigling.h:80
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
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: farmfuncs.cpp:1279
wbs_fertslurry_stock_one
Definition: WinterBarleyStrigling.h:59
cfg_ins_app_prop1
CfgFloat cfg_ins_app_prop1
WBS_DID_EIGHT_THREE
#define WBS_DID_EIGHT_THREE
Definition: WinterBarleyStrigling.h:52
Crop::SimpleEvent
void SimpleEvent(long a_date, int a_todo, bool a_lock)
Adds an event to this crop management.
Definition: farm.cpp:307
cfg_greg_app_prop
CfgFloat cfg_greg_app_prop
WBS_DID_EIGHT_TWO
#define WBS_DID_EIGHT_TWO
Definition: WinterBarleyStrigling.h:51
WBS_DID_EIGHT_ONE
#define WBS_DID_EIGHT_ONE
Definition: WinterBarleyStrigling.h:50
wbs_stubble_harrowing
Definition: WinterBarleyStrigling.h:81
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
wbs_insecticide
Definition: WinterBarleyStrigling.h:77
wbs_fungicide_two
Definition: WinterBarleyStrigling.h:74
wbs_fertsludge_plant_one
Definition: WinterBarleyStrigling.h:57
WinterBarleyStrigling::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: WinterBarleyStrigling.cpp:38
cfg_fungi_app_prop1
CfgFloat cfg_fungi_app_prop1
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
cfg_strigling_prop
CfgFloat cfg_strigling_prop
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
wbs_fertnpk_plant_one
Definition: WinterBarleyStrigling.h:66
WBS_HERBICIDE_DATE
#define WBS_HERBICIDE_DATE
Definition: WinterBarleyStrigling.h:48
WBS_FUNGICIDE_DATE
#define WBS_FUNGICIDE_DATE
Definition: WinterBarleyStrigling.h:47
wbs_fungicide_one
Definition: WinterBarleyStrigling.h:72
Crop::m_farm
Farm * m_farm
Definition: farm.h:537
Crop::m_field
LE * m_field
Definition: farm.h:538
wbs_strigling_one
Definition: WinterBarleyStrigling.h:63
FarmEvent::m_todo
int m_todo
Definition: farm.h:469
Farm::InsecticideTreat
virtual bool InsecticideTreat(LE *a_field, double a_user, int a_days)
Apply insecticide to a_field.
Definition: farmfuncs.cpp:1348
WBS_DID_SEVEN_ONE
#define WBS_DID_SEVEN_ONE
Definition: WinterBarleyStrigling.h:42
wbs_growth_reg
Definition: WinterBarleyStrigling.h:75
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
Crop::m_last_date
int m_last_date
Definition: farm.h:542
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
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
Farm
The base class for all farm types.
Definition: farm.h:767
wbs_fertnpk_stock_one
Definition: WinterBarleyStrigling.h:69
Farm::GrowthRegulator
virtual bool GrowthRegulator(LE *a_field, double a_user, int a_days)
Apply growth regulator to a_field.
Definition: farmfuncs.cpp:1250
wbs_fertslurry_stock_two
Definition: WinterBarleyStrigling.h:68
wbs_hay_turning
Definition: WinterBarleyStrigling.h:79
wbs_switchboard
Definition: WinterBarleyStrigling.h:73
wbs_harvest
Definition: WinterBarleyStrigling.h:78
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
wbs_fertmanure_stock
Definition: WinterBarleyStrigling.h:58
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
WBS_DID_SEVEN_THREE
#define WBS_DID_SEVEN_THREE
Definition: WinterBarleyStrigling.h:44
wbs_fertmanganese_plant_one
Definition: WinterBarleyStrigling.h:64