ALMaSS Hare ODDox  1.1
The hare model description following ODdox protocol
SpringBarleySKManagement.cpp
Go to the documentation of this file.
1 //
2 // SpringBarleySKManagement.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/SpringBarleySKManagement.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 
37 bool SpringBarleySKManagement::Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev )
38 {
39 
40  double ins_app_prop=cfg_ins_app_prop1.value();
41  double herbi_app_prop=cfg_herbi_app_prop.value();
42  m_farm = a_farm;
43  m_field = a_field;
44  m_ev = a_ev;
45  bool done = false;
46  switch ( m_ev->m_todo )
47  {
48  case sbskm_start:
49  {
50  // Record that skylark scrapes are present and adjust flag accordingly
51  a_field->m_skylarkscrapes=true;
52  // Set up the date management stuff
53  // Could save the start day in case it is needed later
54  // m_field->m_startday = m_ev->m_startday;
55  m_last_date=g_date->DayInYear(30,8);
56  // Start and stop dates for all events after harvest
57  int noDates=2;
58  m_field->SetMDates(0,0,g_date->DayInYear(20,8));
59  // Determined by harvest date - used to see if at all possible
60  m_field->SetMDates(1,0,g_date->DayInYear(10,8));
61  m_field->SetMDates(0,1,g_date->DayInYear(10,8));
62  m_field->SetMDates(1,1,g_date->DayInYear(30,8));
63  // Check the next crop for early start, unless it is a spring crop
64  // in which case we ASSUME that no checking is necessary!!!!
65  // So DO NOT implement a crop that runs over the year boundary
66  if (m_ev->m_startday>g_date->DayInYear(1,7))
67  {
68  if (m_field->GetMDates(0,0) >=m_ev->m_startday)
69  {
70  g_msg->Warn( WARN_BUG, "SpringBarley::Do(): "
71  "Harvest too late for the next crop to start!!!", "" );
72  exit( 1 );
73  }
74  // Now fix any late finishing problems
75  for (int i=0; i<noDates; i++)
76  {
77  if (m_field->GetMDates(0,i)>=m_ev->m_startday)
78  m_field->SetMDates(0,i,m_ev->m_startday-1);
79  if (m_field->GetMDates(1,i)>=m_ev->m_startday)
80  m_field->SetMDates(1,i,m_ev->m_startday-1);
81  }
82  }
83  // Now no operations can be timed after the start of the next crop.
84 
85  int d1;
86  if ( ! m_ev->m_first_year )
87  {
88  int today=g_date->Date();
89  // Are we before July 1st?
90  d1 = g_date->OldDays() + g_date->DayInYear( 1,7 );
91  if (today < d1)
92  {
93  // Yes, too early. We assumme this is because the last crop was late
94  g_msg->Warn( WARN_BUG, "SpringBarley::Do(): "
95  "Crop start attempt between 1st Jan & 1st July", "" );
96  exit( 1 );
97  }
98  else
99  {
100  d1 = g_date->OldDays() + m_first_date; // Add 365 for spring crop
101  if (today > d1)
102  {
103  // Yes too late - should not happen - raise an error
104  g_msg->Warn( WARN_BUG, "SpringBarley::Do(): "
105  "Crop start attempt after last possible start date", "" );
106  exit( 1 );
107  }
108  }
109  }
110  else
111  {
112  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1,4 ),
113  sbskm_spring_plough, false );
114  break;
115  }
116  // End single block date checking code. Please see next line
117  // comment as well.
118  // Reinit d1 to first possible starting date.
119  d1 = g_date->OldDays() + g_date->DayInYear( 2,11 );
120  if ( g_date->Date() > d1 ) {
121  d1 = g_date->Date();
122  }
123 
124  // OK, let's go.
125  SimpleEvent( d1, sbskm_autumn_plough, false );
126  SBSKM_SLURRY_DONE=false;
127  SBSKM_MANURE_DONE=false;
128  SBSKM_SLURRY_EXEC=false;
129  SBSKM_MANURE_EXEC=false;
130  SBSKM_DID_AUTUMN_PLOUGH = false;
131  }
132  break;
133  case sbskm_autumn_plough:
134  if ( m_ev->m_lock || m_farm->DoIt( 70 )) // was 70
135  {
136  if (!m_farm->AutumnPlough( m_field, 0.0,
137  g_date->DayInYear( 30,11 ) - g_date->DayInYear())) {
138  SimpleEvent( g_date->Date() + 1, sbskm_autumn_plough, true );
139  break;
140  }
142  }
143  // +365 for next year
144  if (m_farm->IsStockFarmer()) // StockFarmer
145  {
146  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15,3 )+365, // was 15,3
147  sbskm_fertslurry_stock, false );
148  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15,3 )+365, // was 15,3
150  }
151  else { // PlantFarmer
152  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 20,3 )+365, // was 20/3
153  sbskm_spring_plough, false );
154  }
155  break;
156 
157  //*** The stock farmers thread
159  if ( m_ev->m_lock || m_farm->DoIt( 90 ))
160  {
161  if (!m_farm->FA_Slurry( m_field, 0.0,
162  g_date->DayInYear( 15,4 ) - g_date->DayInYear())) { // Was 15/4
163  SimpleEvent( g_date->Date() + 1, sbskm_fertslurry_stock, true );
164  break;
165  }
166  SBSKM_SLURRY_EXEC=true;
167  }
168  SBSKM_SLURRY_DONE = true;
169  if ( SBSKM_MANURE_DONE ) {
170  // We are the last thread, so queue up spring plough.
171  SimpleEvent( g_date->Date(), sbskm_spring_plough, false );
172  }
173  break;
174 
176  if ( m_ev->m_lock || m_farm->DoIt( 67 ))
177  {
178  if (!m_farm->FA_Manure( m_field, 0.0,
179  g_date->DayInYear( 15,5 ) - g_date->DayInYear())) { // Was 15/5
180  SimpleEvent( g_date->Date() + 1, sbskm_fertmanure_stock_one, true );
181  break;
182  }
183  SBSKM_MANURE_EXEC=true;
184  }
185  SBSKM_MANURE_DONE = true;
186  if ( SBSKM_SLURRY_DONE ) {
187  SimpleEvent( g_date->Date(), sbskm_spring_plough, false );
188  }
189  break;
190 
191  case sbskm_spring_plough:
192  if ( ! SBSKM_DID_AUTUMN_PLOUGH )
193  {
194  if (!m_farm->SpringPlough( m_field, 0.0,
195  g_date->DayInYear( 10,4 ) - // was 10,4
196  g_date->DayInYear())) {
197  SimpleEvent( g_date->Date()+1, sbskm_spring_plough, true );
198  break;
199  }
200  }
201  {
202  int d1 = g_date->Date();
203  if ( d1 < g_date->OldDays() + g_date->DayInYear( 20,3 )) {
204  d1 = g_date->OldDays() + g_date->DayInYear( 20,3 );
205  }
206  SimpleEvent( d1, sbskm_spring_harrow, false );
207  }
208  break;
209 
210  case sbskm_spring_harrow:
211  if (!m_farm->SpringHarrow( m_field, 0.0,
212  g_date->DayInYear( 10,4 ) - g_date->DayInYear())) { // WAS 10,4
213  SimpleEvent( g_date->Date() + 1, sbskm_spring_harrow, true );
214  break;
215  }
216  if (m_farm->IsStockFarmer()) {
217  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 5,4 ), // was 5,4
219  } else {
220  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 20,3 ),
221  sbskm_fertmanure_plant, false );
222  }
223  break;
224 
226  if ( m_ev->m_lock || m_farm->DoIt( 65 ) ||
228  {
229  if (!m_farm->FA_NPK( m_field, 0.0,
230  g_date->DayInYear( 10,4 ) - g_date->DayInYear())) { // was 10,4
231  SimpleEvent( g_date->Date() + 1, sbskm_fertmanure_stock_two, true );
232  break;
233  }
234  }
235  {
236  int d1 = g_date->Date();
237  if ( d1 < g_date->OldDays() + g_date->DayInYear( 25,3 )) {
238  d1 = g_date->OldDays() + g_date->DayInYear( 25,3 );
239  }
240  SimpleEvent( d1, sbskm_spring_sow, false );
241  }
242  break;
243 
245  if ( m_ev->m_lock || m_farm->DoIt( 75 ))
246  {
247  if (!m_farm->FP_NPK( m_field, 0.0,
248  g_date->DayInYear( 10, 4 ) - g_date->DayInYear())) { // WAS 10,4
249  SimpleEvent( g_date->Date() + 1, sbskm_fertmanure_plant, true );
250  break;
251  }
252  // Did FP_NPK so go directly to spring sow.
253  {
254  int d1 = g_date->Date();
255  if ( d1 < g_date->OldDays() + g_date->DayInYear( 25,3 )) { // was 25,3
256  d1 = g_date->OldDays() + g_date->DayInYear( 25,3 ); // was 25,3
257  }
258  SimpleEvent( d1, sbskm_spring_sow, false );
259  }
260  break;
261  }
262  SimpleEvent( g_date->Date(), sbskm_fertlnh3_plant, false );
263  break;
264 
266  if (!m_farm->FP_LiquidNH3( m_field, 0.0,
267  g_date->DayInYear( 10, 4 ) - // WAS 10,4
268  g_date->DayInYear())) {
269  SimpleEvent( g_date->Date() + 1, sbskm_fertlnh3_plant, true );
270  break;
271  }
272  SimpleEvent( g_date->Date(), sbskm_fertpk_plant, false );
273  break;
274 
275  case sbskm_fertpk_plant:
276  if (!m_farm->FP_PK( m_field, 0.0,
277  g_date->DayInYear( 10, 4 ) - // WAS 10,4
278  g_date->DayInYear())) {
279  SimpleEvent( g_date->Date() + 1, sbskm_fertpk_plant, true );
280  break;
281  }
282  {
283  int d1 = g_date->Date();
284  if ( d1 < g_date->OldDays() + g_date->DayInYear( 25,3 )) { // was 25,3
285  d1 = g_date->OldDays() + g_date->DayInYear( 25,3 ); // was 25,3
286  }
287  SimpleEvent( d1, sbskm_spring_sow, false );
288  }
289  break;
290 
291  case sbskm_spring_sow:
292  if (!m_farm->SpringSow( m_field, 0.0,
293  g_date->DayInYear( 10,4 ) - g_date->DayInYear())) { // WAS 10,4
294  SimpleEvent( g_date->Date() + 1, sbskm_spring_sow, true );
295  break;
296  }
297  {
298  int d1 = g_date->Date();
299  if ( d1 < g_date->OldDays() + g_date->DayInYear( 5,4 )) {
300  d1 = g_date->OldDays() + g_date->DayInYear( 5,4 );
301  }
302  SimpleEvent( d1, sbskm_spring_roll, false );
303  }
304  break;
305 
306  case sbskm_spring_roll:
307  if ( m_ev->m_lock || m_farm->DoIt( 0 )) // was 30
308  {
309  if (!m_farm->SpringRoll( m_field, 0.0,
310  g_date->DayInYear( 20,4 ) - g_date->DayInYear())) {
311  SimpleEvent( g_date->Date() + 1, sbskm_spring_roll, true );
312  break;
313  }
314  }
315  SBSKM_HERBI_DATE = 0;
316  SBSKM_GR_DATE = 0;
317  SBSKM_FUNGI_DATE = 0;
318  SBSKM_WATER_DATE = 0;
319  SBSKM_INSECT_DATE = 0;
320  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 5,5 ),
321  sbskm_herbicide_one, false );
322  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 10,5 ),
323  sbskm_fungicide_one, false ); // Main.
324  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 10,5 ),
325  sbskm_GR, false );
326  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15,5 ),
327  sbskm_water_one, false );
328  break;
329 
330  // Herbicide thread
331  case sbskm_herbicide_one:
332  if ( g_date->Date() < SBSKM_GR_DATE + 1 ) {
333  SimpleEvent( g_date->Date() + 1, sbskm_herbicide_one, m_ev->m_lock );
334  break;
335  }
336  if ( m_ev->m_lock || m_farm->DoIt( (int) floor(0.5+80*herbi_app_prop)))
337  {
338  if (!m_farm->HerbicideTreat( m_field, 0.0,
339  g_date->DayInYear( 15,5 ) - g_date->DayInYear()))
340  {
341  SimpleEvent( g_date->Date() + 1, sbskm_herbicide_one, true );
342  break;
343  }
344  SBSKM_HERBI_DATE = g_date->Date();
345  // Did first spray so see if should do another, 14 days later (min)
346  {
347  int d1 = g_date->Date() + 10;
348  if ( d1 < g_date->OldDays() + g_date->DayInYear( 16,5 )) {
349  d1 = g_date->OldDays() + g_date->DayInYear( 16,5 );
350  }
351  SimpleEvent( d1, sbskm_herbicide_two, false );
352  }
353  }
354  break;
355 
356  case sbskm_herbicide_two:
357  if ( g_date->Date() < SBSKM_GR_DATE + 1 ) {
358  SimpleEvent( g_date->Date() + 1, sbskm_herbicide_two, m_ev->m_lock );
359  break;
360  }
361  if ( m_ev->m_lock || m_farm->DoIt( (int) floor(0.5+50*herbi_app_prop)))
362  {
363  if (!m_farm->HerbicideTreat( m_field, 0.0,
364  g_date->DayInYear( 30,5 ) - g_date->DayInYear())) {
365  SimpleEvent( g_date->Date() + 1, sbskm_herbicide_two, true );
366  break;
367  }
368  SBSKM_HERBI_DATE = g_date->Date();
369  }
370  break;
371 
372  // GReg thread
373  case sbskm_GR:
374  if ( g_date->Date() < SBSKM_HERBI_DATE + 1 ||
375  g_date->Date() < SBSKM_FUNGI_DATE + 1 ) {
376  SimpleEvent( g_date->Date() + 1, sbskm_GR, m_ev->m_lock );
377  break;
378  }
379  if ( m_ev->m_lock || m_farm->DoIt( (int) floor(0.5+5*cfg_greg_app_prop.value())))
380  {
381  if (!m_farm->GrowthRegulator( m_field, 0.0,
382  g_date->DayInYear( 25,5 ) - g_date->DayInYear())) {
383  SimpleEvent( g_date->Date() + 1, sbskm_GR, true );
384  break;
385  }
386  SBSKM_GR_DATE = g_date->Date();
387  }
388  break;
389 
390  // Fungicide thread & MAIN THREAD
391  case sbskm_fungicide_one:
392  if ( g_date->Date() < SBSKM_HERBI_DATE + 1 ||
393  g_date->Date() < SBSKM_GR_DATE + 1 ) {
394  SimpleEvent( g_date->Date() + 1, sbskm_fungicide_one, m_ev->m_lock );
395  break;
396  }
397  if ( m_ev->m_lock || m_farm->DoIt( (int) floor(0.5+30*cfg_fungi_app_prop1.value())))
398  {
399  if (!m_farm->FungicideTreat( m_field, 0.0,
400  g_date->DayInYear( 25,5 ) - g_date->DayInYear())) {
401  SimpleEvent( g_date->Date() + 1, sbskm_fungicide_one, true );
402  break;
403  }
404  SBSKM_FUNGI_DATE = g_date->Date();
405  {
406  int d1 = g_date->Date() + 10;
407  if ( d1 < g_date->OldDays() + g_date->DayInYear( 25,5 )) {
408  d1 = g_date->OldDays() + g_date->DayInYear( 25,5 );
409  }
410  SimpleEvent( d1, sbskm_fungicide_two, false );
411  }
412  }
413  {
414  int d1 = g_date->Date();
415  if ( d1 < g_date->OldDays() + g_date->DayInYear( 15,5 )) {
416  d1 = g_date->OldDays() + g_date->DayInYear( 15,5 );
417  }
418  SimpleEvent( d1, sbskm_insecticide, false );
419  }
420  break;
421 
422  case sbskm_fungicide_two:
423  if ( g_date->Date() < SBSKM_HERBI_DATE + 1 ||
424  g_date->Date() < SBSKM_GR_DATE + 1 ) {
425  SimpleEvent( g_date->Date() + 1, sbskm_fungicide_two, m_ev->m_lock );
426  break;
427  }
428  if ( m_ev->m_lock || m_farm->DoIt( (int) floor(0.5+33*cfg_fungi_app_prop1.value()) ))
429  {
430  if (!m_farm->FungicideTreat( m_field, 0.0,
431  g_date->DayInYear( 10,6 ) - g_date->DayInYear())) {
432  SimpleEvent( g_date->Date() + 1, sbskm_fungicide_two, true );
433  break;
434  }
435  SBSKM_FUNGI_DATE = g_date->Date();
436  }
437  break;
438 
439  // Water thread
440  case sbskm_water_one:
441  if ( g_date->Date() < SBSKM_HERBI_DATE + 1 ||
442  g_date->Date() < SBSKM_FUNGI_DATE + 1 ) {
443  SimpleEvent( g_date->Date() + 1, sbskm_water_one, m_ev->m_lock );
444  break;
445  }
446  if ( m_ev->m_lock || m_farm->DoIt( 20 ))
447  {
448  if (!m_farm->Water( m_field, 0.0,
449  g_date->DayInYear( 30,5 ) - g_date->DayInYear())) {
450  SimpleEvent( g_date->Date() + 1, sbskm_water_one, true );
451  break;
452  }
453  SBSKM_WATER_DATE = g_date->Date();
454  }
455  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1,6 ),
456  sbskm_water_two, false );
457  break;
458 
459  case sbskm_water_two:
460  if ( g_date->Date() < SBSKM_INSECT_DATE + 1 ) {
461  SimpleEvent( g_date->Date() + 1, sbskm_water_two, m_ev->m_lock );
462  break;
463  }
464  if ( m_ev->m_lock || m_farm->DoIt( 10 ))
465  {
466  if (!m_farm->Water( m_field, 0.0,
467  g_date->DayInYear( 1,7 ) - g_date->DayInYear())) {
468  SimpleEvent( g_date->Date() + 1, sbskm_water_two, true );
469  break;
470  }
471  SBSKM_WATER_DATE = g_date->Date();
472  }
473  break;
474 
475  // Insecticide thread & MAIN THREAD
476  case sbskm_insecticide:
477  if ( g_date->Date() < SBSKM_WATER_DATE + 1 ) {
478  SimpleEvent( g_date->Date() + 1, sbskm_insecticide, m_ev->m_lock );
479  break;
480  }
481 // if ( m_ev->m_lock || m_farm->DoIt( (int) floor(0.5+35*cfg_ins_app_prop1.value()) ))
482  if ( m_ev->m_lock || m_farm->DoIt( (int) floor(0.5+100*ins_app_prop) ))
483  {
484  if (!m_farm->InsecticideTreat( m_field, 0.0,
485  g_date->DayInYear( 10,6 ) - g_date->DayInYear())) {
486  SimpleEvent( g_date->Date() + 1, sbskm_insecticide, true );
487  break;
488  }
489  SBSKM_INSECT_DATE = g_date->Date();
490  }
491  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1,8 ),
492  sbskm_harvest, false );
493  break;
494 
495  case sbskm_harvest:
496  if (!m_farm->Harvest( m_field, 0.0,
497  g_date->DayInYear( 20,8 ) - g_date->DayInYear())) {
498  SimpleEvent( g_date->Date() + 1, sbskm_harvest, true );
499  break;
500  }
501  SimpleEvent( g_date->Date(), sbskm_straw_chopping, false );
502  break;
503 
505  if ( m_ev->m_lock || m_farm->DoIt( 50 )) // was 50
506  {
507  // Force straw chopping to happen on the same day as harvest.
508  if (!m_farm->StrawChopping( m_field, 0.0, 0 )) {
509  // Shouldn't happen.
510  SimpleEvent( g_date->Date(), sbskm_straw_chopping, true );
511  break;
512  }
513  // Did chop, so go directly to stubble harrowing.
514  SimpleEvent( g_date->OldDays() + m_field->GetMDates(0,1),
515  sbskm_stubble_harrow, false );
516  break;
517  }
518  // Do hay baling first.
519  SimpleEvent( g_date->Date(), sbskm_hay_baling, false );
520  break;
521 
522  case sbskm_hay_baling:
523  if (!m_farm->HayBailing( m_field, 0.0,
524  m_field->GetMDates(1,0) - g_date->DayInYear())) {
525  SimpleEvent( g_date->Date() + 1, sbskm_hay_baling, true );
526  break;
527  }
528  SimpleEvent( g_date->OldDays() + m_field->GetMDates(0,1),
529  sbskm_stubble_harrow, false );
530  break;
531 
533  if ( m_ev->m_lock || m_farm->DoIt( 60 )) // WAS 60
534  {
535  if (!m_farm->StubbleHarrowing( m_field, 0.0,
536  m_field->GetMDates(1,1) - g_date->DayInYear())) {
537  SimpleEvent( g_date->Date() + 1, sbskm_stubble_harrow, true );
538  break;
539  }
540  }
541  // END MAIN THREAD
542  done=true;
543  break;
544 
545  default:
546  g_msg->Warn( WARN_BUG, "SpringBarley::Do(): "
547  "Unknown event type! ", "" );
548  exit( 1 );
549  }
550  return done;
551 }
552 
553 
554 
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
sbskm_autumn_plough
Definition: SpringBarleySKManagement.h:46
SBSKM_MANURE_DONE
#define SBSKM_MANURE_DONE
Definition: SpringBarleySKManagement.h:33
Farm::SpringPlough
virtual bool SpringPlough(LE *a_field, double a_user, int a_days)
Carry out a ploughing event in the spring on a_field.
Definition: farmfuncs.cpp:444
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
sbskm_herbicide_two
Definition: SpringBarleySKManagement.h:59
sbskm_water_two
Definition: SpringBarleySKManagement.h:65
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
FarmEvent
A struct to hold the information required to trigger a farm event.
Definition: farm.h:463
sbskm_fertmanure_stock_one
Definition: SpringBarleySKManagement.h:48
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
FarmEvent::m_first_year
bool m_first_year
Definition: farm.h:467
sbskm_water_one
Definition: SpringBarleySKManagement.h:64
sbskm_GR
Definition: SpringBarleySKManagement.h:60
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
SBSKM_INSECT_DATE
#define SBSKM_INSECT_DATE
Definition: SpringBarleySKManagement.h:42
cfg_ins_app_prop1
CfgFloat cfg_ins_app_prop1
SBSKM_HERBI_DATE
#define SBSKM_HERBI_DATE
Definition: SpringBarleySKManagement.h:38
sbskm_spring_harrow
Definition: SpringBarleySKManagement.h:50
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
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:653
Crop::SimpleEvent
void SimpleEvent(long a_date, int a_todo, bool a_lock)
Adds an event to this crop management.
Definition: farm.cpp:307
sbskm_start
Definition: SpringBarleySKManagement.h:45
cfg_herbi_app_prop
CfgFloat cfg_herbi_app_prop
sbskm_fertmanure_stock_two
Definition: SpringBarleySKManagement.h:54
sbskm_fertslurry_stock
Definition: SpringBarleySKManagement.h:47
sbskm_herbicide_one
Definition: SpringBarleySKManagement.h:58
sbskm_fertpk_plant
Definition: SpringBarleySKManagement.h:53
cfg_greg_app_prop
CfgFloat cfg_greg_app_prop
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
sbskm_insecticide
Definition: SpringBarleySKManagement.h:62
sbskm_stubble_harrow
Definition: SpringBarleySKManagement.h:69
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
SpringBarleySKManagement::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: SpringBarleySKManagement.cpp:37
SBSKM_WATER_DATE
#define SBSKM_WATER_DATE
Definition: SpringBarleySKManagement.h:41
Crop::m_farm
Farm * m_farm
Definition: farm.h:537
Crop::m_field
LE * m_field
Definition: farm.h:538
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
sbskm_spring_roll
Definition: SpringBarleySKManagement.h:57
SBSKM_DID_AUTUMN_PLOUGH
#define SBSKM_DID_AUTUMN_PLOUGH
Definition: SpringBarleySKManagement.h:36
SBSKM_MANURE_EXEC
#define SBSKM_MANURE_EXEC
Definition: SpringBarleySKManagement.h:35
sbskm_fertlnh3_plant
Definition: SpringBarleySKManagement.h:52
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::SpringSow
virtual bool SpringSow(LE *a_field, double a_user, int a_days)
Carry out a sowing event in the spring on a_field.
Definition: farmfuncs.cpp:546
SBSKM_GR_DATE
#define SBSKM_GR_DATE
Definition: SpringBarleySKManagement.h:39
Farm::FP_LiquidNH3
virtual bool FP_LiquidNH3(LE *a_field, double a_user, int a_days)
Apply liquid ammonia fertilizer to a_field owned by an arable farmer.
Definition: farmfuncs.cpp:677
Farm
The base class for all farm types.
Definition: farm.h:767
SBSKM_FUNGI_DATE
#define SBSKM_FUNGI_DATE
Definition: SpringBarleySKManagement.h:40
sbskm_fungicide_two
Definition: SpringBarleySKManagement.h:63
sbskm_fungicide_one
Definition: SpringBarleySKManagement.h:61
Farm::GrowthRegulator
virtual bool GrowthRegulator(LE *a_field, double a_user, int a_days)
Apply growth regulator to a_field.
Definition: farmfuncs.cpp:1250
SBSKM_SLURRY_EXEC
#define SBSKM_SLURRY_EXEC
Definition: SpringBarleySKManagement.h:34
sbskm_fertmanure_plant
Definition: SpringBarleySKManagement.h:51
sbskm_straw_chopping
Definition: SpringBarleySKManagement.h:67
sbskm_hay_baling
Definition: SpringBarleySKManagement.h:68
Crop::m_ev
FarmEvent * m_ev
Definition: farm.h:539
sbskm_harvest
Definition: SpringBarleySKManagement.h:66
sbskm_spring_plough
Definition: SpringBarleySKManagement.h:49
SBSKM_SLURRY_DONE
#define SBSKM_SLURRY_DONE
Definition: SpringBarleySKManagement.h:32
cfg_fungi_app_prop1
CfgFloat cfg_fungi_app_prop1
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
Farm::SpringHarrow
virtual bool SpringHarrow(LE *a_field, double a_user, int a_days)
Carry out a harrow event in the spring on a_field.
Definition: farmfuncs.cpp:471
sbskm_spring_sow
Definition: SpringBarleySKManagement.h:56