ALMaSS Hare ODDox  1.1
The hare model description following ODdox protocol
WinterRye.cpp
Go to the documentation of this file.
1 //
2 // WinterRye.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/WinterRye.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 
37 bool WinterRye::Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev )
38 {
39  m_farm = a_farm;
40  m_field = a_field;
41  m_ev = a_ev;
42  bool done = false;
43 
44  switch ( m_ev->m_todo )
45  {
46  case wry_start:
47  {
49  // Set up the date management stuff
50  m_last_date=g_date->DayInYear(1,9);
51  // Start and stop dates for all events after harvest
52  int noDates=4;
53  m_field->SetMDates(0,0,g_date->DayInYear(15,8));
54  // Determined by harvest date - used to see if at all possible
55  m_field->SetMDates(1,0,g_date->DayInYear(15,8));
56  m_field->SetMDates(0,1,g_date->DayInYear(10,8)); // Subbleharrow start
57  m_field->SetMDates(1,1,g_date->DayInYear(1,9)); // Stubbleharrow end
58  m_field->SetMDates(0,2,g_date->DayInYear(3,8)); // alternative to 1st
59  m_field->SetMDates(1,2,g_date->DayInYear(25,8));
60  m_field->SetMDates(0,3,g_date->DayInYear(3,8)); // follows last one
61  m_field->SetMDates(1,3,g_date->DayInYear(25,8));
62  // Check the next crop for early start, unless it is a spring crop
63  // in which case we ASSUME that no checking is necessary!!!!
64  // So DO NOT implement a crop that runs over the year boundary
65 
66  //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)
67  int d1;
68  if(!(m_farm->GetType() == tof_OptimisingFarm && g_date->GetYearNumber()>0)){
69 
70  if (m_ev->m_startday>g_date->DayInYear(1,7))
71  {
72  if (m_field->GetMDates(0,0) >=m_ev->m_startday)
73  {
74  g_msg->Warn( WARN_BUG, "WinterRye::Do(): "
75  "Harvest too late for the next crop to start!!!", "" );
76  exit( 1 );
77  }
78  // Now fix any late finishing problems
79  for (int i=0; i<noDates; i++) {
80  if(m_field->GetMDates(0,i)>=m_ev->m_startday) {
81  m_field->SetMDates(0,i,m_ev->m_startday-1); //move the starting date
82  }
83  if(m_field->GetMDates(1,i)>=m_ev->m_startday){
84  m_field->SetMConstants(i,0);
85  m_field->SetMDates(1,i,m_ev->m_startday-1); //move the finishing date
86  }
87  }
88  }
89  // Now no operations can be timed after the start of the next crop.
90 
91  // CJT note:
92  // Start single block date checking code to be cut-'n-pasted...
93 
94  if ( ! m_ev->m_first_year )
95  {
96  // Are we before July 1st?
97  d1 = g_date->OldDays() + g_date->DayInYear( 1,7 );
98  if (g_date->Date() < d1)
99  {
100  // Yes, too early. We assumme this is because the last crop was late
101  g_msg->Warn( WARN_BUG, "WinterRye::Do(): "
102  "Crop start attempt between 1st Jan & 1st July", "" );
103  exit( 1 );
104  }
105  else
106  {
107  d1 = g_date->OldDays() + m_first_date; // Add 365 for spring crop
108  if (g_date->Date() > d1)
109  {
110  // Yes too late - should not happen - raise an error
111  g_msg->Warn( WARN_BUG, "WinterRye::Do(): "
112  "Crop start attempt after last possible start date", "" );
113  exit( 1 );
114  }
115  }
116  }
117  else
118  {
119  // Is the first year
120  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1,8 ),
121  wry_harvest, false );
122  break;
123  }
124  }//if
125 
126  // End single block date checking code. Please see next line
127  // comment as well.
128  // Reinit d1 to first possible starting date.
129  // OK, let's go.
130 
131  if ( m_farm->IsStockFarmer())
132  {
133  d1 = g_date->OldDays() + g_date->DayInYear( 10,9 );
134  }
135  else
136  {
137  d1 = g_date->OldDays() + g_date->DayInYear( 15,9 );
138  }
139  if ( g_date->Date() > d1 ) // This allows a later start up to 11,10
140  {
141  d1 = g_date->Date();
142  }
143 
144  if ( m_farm->IsStockFarmer()) {
145  WRY_DID_MANURE = false;
146  WRY_DID_SLUDGE = false;
147  SimpleEvent( d1, wry_fertmanure_stock, false );
148  SimpleEvent( d1, wry_fertsludge_stock, false );
149  } else {
150  SimpleEvent( d1, wry_autumn_plough, false );
151  }
152  }
153  break;
154 
156  if ( m_ev->m_lock || m_farm->DoIt( 15 )) {
157  if (!m_farm->FA_Manure( m_field, 0.0,
158  g_date->DayInYear( 11, 10 ) -
159  g_date->DayInYear())) {
160  SimpleEvent( g_date->Date() + 1, wry_fertmanure_stock, true );
161  break;
162  }
163  }
164  WRY_DID_MANURE = true;
165  if ( WRY_DID_SLUDGE ) {
166  // We are the last thread.
167  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15,9 ),
168  wry_autumn_plough, false );
169  }
170  break;
171 
173  if ( m_ev->m_lock || m_farm->DoIt( 5 )) {
174  if (!m_farm->FA_Sludge( m_field, 0.0,
175  g_date->DayInYear( 10, 10 ) -
176  g_date->DayInYear())) {
177  SimpleEvent( g_date->Date() + 1, wry_fertsludge_stock, true );
178  break;
179  }
180  }
181  WRY_DID_SLUDGE = true;
182  if ( WRY_DID_MANURE ) {
183  // No, *we* are the last thread!
184  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15,9 ),
185  wry_autumn_plough, false );
186  }
187  break;
188 
189  case wry_autumn_plough:
190  if (!m_farm->AutumnPlough( m_field, 0.0,
191  g_date->DayInYear( 15, 10 ) -
192  g_date->DayInYear())) {
193  SimpleEvent( g_date->Date() + 1, wry_autumn_plough, true );
194  break;
195  }
196  SimpleEvent( g_date->Date(), wry_autumn_harrow, false );
197  break;
198 
199  case wry_autumn_harrow:
200  if (!m_farm->AutumnHarrow( m_field, 0.0,
201  g_date->DayInYear( 15, 10 ) -
202  g_date->DayInYear())) {
203  SimpleEvent( g_date->Date() + 1, wry_autumn_harrow, true );
204  break;
205  }
206  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1,10 ),
207  wry_autumn_sow, false );
208  break;
209 
210  case wry_autumn_sow:
211  if (!m_farm->AutumnSow( m_field, 0.0,
212  g_date->DayInYear( 1, 11 ) -
213  g_date->DayInYear())) {
214  SimpleEvent( g_date->Date() + 1, wry_autumn_sow, true );
215  break;
216  }
217  SimpleEvent( g_date->Date(), wry_autumn_roll, false );
218  break;
219 
220  case wry_autumn_roll:
221  if ( m_ev->m_lock || m_farm->DoIt( 20 )) {
222  if (!m_farm->AutumnRoll( m_field, 0.0,
223  g_date->DayInYear( 1, 11 ) -
224  g_date->DayInYear())) {
225  SimpleEvent( g_date->Date() + 1, wry_autumn_roll, true );
226  break;
227  }
228  }
229 
230  if ( m_farm->IsStockFarmer()) {
231  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1,4 ) + 365,
232  wry_fertslurry_stock, false );
233  } else {
234  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 2,10 ),
236  }
237  break;
238 
240  if ( m_ev->m_lock || m_farm->DoIt( 20 )) {
241  if (!m_farm->FP_ManganeseSulphate( m_field, 0.0,
242  g_date->DayInYear( 30, 10 ) -
243  g_date->DayInYear())) {
244  SimpleEvent( g_date->Date() + 1, wry_fertmanganese_plant_one, true );
245  break;
246  }
247  // Did first application, then queue up second for next year.
248  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1,4 ) + 365,
250  }
251  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 5,3 ) + 365,
252  wry_fertnpk_plant, false );
253  break;
254 
256  if (!m_farm->FP_ManganeseSulphate( m_field, 0.0,
257  g_date->DayInYear( 5, 5 ) -
258  g_date->DayInYear())) {
259  SimpleEvent( g_date->Date() + 1, wry_fertmanganese_plant_two, true );
260  break;
261  }
262  // End of thread.
263  break;
264 
265  case wry_fertnpk_plant:
266  if (!m_farm->FP_NPK( m_field, 0.0,
267  g_date->DayInYear( 30, 4 ) -
268  g_date->DayInYear())) {
269  SimpleEvent( g_date->Date() + 1, wry_fertnpk_plant, true );
270  break;
271  }
272  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1,4 ),
273  wry_spring_roll, false );
274  break;
275 
277  if ( m_ev->m_lock || m_farm->DoIt( 65 )) {
278  if (!m_farm->FA_Slurry( m_field, 0.0,
279  g_date->DayInYear( 30, 4 ) -
280  g_date->DayInYear())) {
281  SimpleEvent( g_date->Date() + 1, wry_fertslurry_stock, true );
282  break;
283  }
284  }
285  SimpleEvent( g_date->Date(), wry_fert_ammonium_stock, false );
286  break;
287 
289  if ( m_ev->m_lock || m_farm->DoIt( 25 )) {
290  if (!m_farm->FA_AmmoniumSulphate( m_field, 0.0,
291  g_date->DayInYear( 30, 4 ) -
292  g_date->DayInYear())) {
293  SimpleEvent( g_date->Date() + 1, wry_fert_ammonium_stock, true );
294  break;
295  }
296  }
297  SimpleEvent( g_date->Date(), wry_spring_roll, false );
298  break;
299 
300  case wry_spring_roll:
301  if ( m_ev->m_lock || m_farm->DoIt( 10 )) {
302  if (!m_farm->SpringRoll( m_field, 0.0,
303  g_date->DayInYear( 25,4 ) -
304  g_date->DayInYear())) {
305  SimpleEvent( g_date->Date() + 1, wry_spring_roll, true );
306  break;
307  }
308  }
309  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 10,4 ),
310  wry_strigling, false );
311  break;
312 
313  case wry_strigling:
314  if ( m_ev->m_lock || m_farm->DoIt( 10 )) {
315  if (!m_farm->Strigling( m_field, 0.0,
316  g_date->DayInYear( 1,5 ) -
317  g_date->DayInYear())) {
318  SimpleEvent( g_date->Date() + 1, wry_strigling, true );
319  break;
320  }
321  }
322  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 20,4 ),
323  wry_growth_reg_one, false );
324  break;
325 
326  case wry_growth_reg_one:
327  if ( m_ev->m_lock || m_farm->DoIt( (int) ( 60*cfg_greg_app_prop.value() ))) {
328  if (!m_farm->GrowthRegulator( m_field, 0.0,
329  g_date->DayInYear( 2,5 ) -
330  g_date->DayInYear())) {
331  SimpleEvent( g_date->Date() + 1, wry_growth_reg_one, true );
332  break;
333  }
334  // Did first application of growth regulator, so
335  // queue up the second one too.
336  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 11,5 ),
337  wry_growth_reg_two, false );
338  }
339  {
340  int d1 = g_date->OldDays() + g_date->DayInYear( 25,4 );
341  if ( d1 <= g_date->Date()) {
342  d1 = g_date->Date() + 1;
343  }
344  SimpleEvent( d1, wry_herbicide, false );
345  }
346  break;
347 
348  case wry_growth_reg_two:
349  if (!m_farm->GrowthRegulator( m_field, 0.0,
350  g_date->DayInYear( 25,5 ) -
351  g_date->DayInYear())) {
352  SimpleEvent( g_date->Date() + 1, wry_growth_reg_two, true );
353  break;
354  }
355  // End of thread.
356  break;
357 
358  case wry_herbicide:
359  if ( m_ev->m_lock || m_farm->DoIt( (int) ( 80*cfg_herbi_app_prop.value() * m_farm->Prob_multiplier()))) { //modified probability
360 
361  //new - for decision making
362  TTypesOfVegetation tov = m_field->GetVegType();
363  if(!m_ev->m_lock && !m_farm->Spraying_herbicides(tov)){
364  Field * pf = dynamic_cast<Field*>(m_field);
365  pf->Add_missed_herb_app();
366  if(m_farm->DoIt(69)) pf->Add_missed_herb_app(); //the 2nd missed application
368  } //end of the part for dec. making
369  else{
370  if (!m_farm->HerbicideTreat( m_field, 0.0, g_date->DayInYear( 10,5 ) - g_date->DayInYear())) {
371  SimpleEvent( g_date->Date() + 1, wry_herbicide, true );
372  break;
373  }
374  }
375  }
376  SimpleEvent( g_date->OldDays() + g_date->DayInYear() + 14, //should we change this date?
377  wry_herbicide_two, false );
378  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15,5 ),
379  wry_fungicide, false );
380  break;
381 
382  case wry_herbicide_two:
383  if ( m_ev->m_lock || m_farm->DoIt( (int) ( 69*cfg_herbi_app_prop.value() * WRY_DECIDE_TO_HERB * m_farm->Prob_multiplier()))) { //modified probability
384  if (!m_farm->HerbicideTreat( m_field, 0.0, g_date->DayInYear( 10,5 ) - g_date->DayInYear())) {
385  SimpleEvent( g_date->Date() + 1, wry_herbicide_two, true );
386  break;
387  }
388  }
389  break;
390 
391  case wry_fungicide:
392  if ( m_ev->m_lock || m_farm->DoIt( (int) ( 75*cfg_fungi_app_prop1.value() * m_farm->Prob_multiplier()))) { //modified probability
393 
394  //new - for decision making
395  TTypesOfVegetation tov = m_field->GetVegType();
396  if(!m_ev->m_lock && !m_farm->Spraying_fungins(tov)){
397  Field * pf = dynamic_cast<Field*>(m_field);
398  pf->Add_missed_fi_app();
399  } //end of the part for dec. making
400  else{
401  if (!m_farm->FungicideTreat( m_field, 0.0, g_date->DayInYear( 30,5 ) - g_date->DayInYear())) {
402  SimpleEvent( g_date->Date() + 1, wry_fungicide, true );
403  break;
404  }
405  }
406  }
407  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 25,5 ),
408  wry_insecticide, false );
409  break;
410 
411  case wry_insecticide:
412  if ( m_ev->m_lock || m_farm->DoIt( (int) ( 16*cfg_ins_app_prop1.value() * m_farm->Prob_multiplier() ))) { //modified probability
413 
414  //new - for decision making
415  TTypesOfVegetation tov = m_field->GetVegType();
416  if(!m_ev->m_lock && !m_farm->Spraying_fungins(tov)){
417  Field * pf = dynamic_cast<Field*>(m_field);
418  pf->Add_missed_fi_app();
419  } //end of the part for dec. making
420  else{
421  if (!m_farm->InsecticideTreat( m_field, 0.0, g_date->DayInYear( 10,6 ) - g_date->DayInYear())) {
422  SimpleEvent( g_date->Date() + 1, wry_insecticide, true );
423  break;
424  }
425  }
426  }
427  {
428  int d1 = g_date->OldDays() + g_date->DayInYear( 1,6 );
429  if ( d1 <= g_date->Date()) {
430  d1 = g_date->Date() + 1;
431  }
432  SimpleEvent( d1, wry_water, false );
433  }
434  break;
435 
436  case wry_water:
437  if ( m_ev->m_lock || m_farm->DoIt( 5 ))
438  {
439  if (!m_farm->Water( m_field, 0.0,
440  g_date->DayInYear( 15,6 ) -
441  g_date->DayInYear())) {
442  SimpleEvent( g_date->Date() + 1, wry_water, true );
443  break;
444  }
445  }
446  ChooseNextCrop (4);
447  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1,8 ),
448  wry_harvest, false );
449  break;
450 
451  case wry_harvest:
452  if (!m_farm->Harvest( m_field, 0.0,
453  g_date->DayInYear( 15,8 ) -
454  g_date->DayInYear())) {
455  SimpleEvent( g_date->Date() + 1, wry_harvest, true );
456  break;
457  }
458  SimpleEvent( g_date->Date(), wry_straw_chopping, false );
459  break;
460 
461  case wry_straw_chopping:
462  if ( m_ev->m_lock || m_farm->DoIt( 60 )) {
463  if (m_field->GetMConstants(0)==0) {
464  if (!m_farm->StrawChopping( m_field, 0.0, -1)) { //raise an error
465  g_msg->Warn( WARN_BUG, "WinterRye::Do(): failure in 'StrawChopping' execution", "" );
466  exit( 1 );
467  }
468  }
469  else{
470  if (!m_farm->StrawChopping( m_field, 0.0, m_field->GetMDates(1,0) - g_date->DayInYear())) {
471  SimpleEvent( g_date->Date()+1, wry_straw_chopping, true );
472  break;
473  }
474  }
475  // OK, did chop, so go directly to stubbles.
476  SimpleEvent( g_date->OldDays() + m_field->GetMDates(0,1), wry_stubble_harrowing, false );
477  break;
478  }
479 
480  // No chopping, so do hay turning and bailing before stubbles.
481  SimpleEvent( g_date->OldDays() + m_field->GetMDates(0,2), wry_hay_turning, false );
482  break;
483 
484  case wry_hay_turning:
485  if ( m_ev->m_lock || m_farm->DoIt( 40 ))
486  {
487  if (m_field->GetMConstants(2)==0) {
488  if (!m_farm->HayTurning( m_field, 0.0, -1)) { //raise an error
489  g_msg->Warn( WARN_BUG, "WinterRye::Do(): failure in 'HayTurning' execution", "" );
490  exit( 1 );
491  }
492  }
493  else{
494  if (!m_farm->HayTurning( m_field, 0.0, m_field->GetMDates(1,2) - g_date->DayInYear())) {
495  SimpleEvent( g_date->Date() + 1, wry_hay_turning, true );
496  break;
497  }
498  }
499  }
500  SimpleEvent( g_date->OldDays() + m_field->GetMDates(0,3), wry_hay_bailing, false );
501  break;
502 
503  case wry_hay_bailing:
504  if (m_field->GetMConstants(3)==0) {
505  if (!m_farm->HayBailing( m_field, 0.0, -1)) { //raise an error
506  g_msg->Warn( WARN_BUG, "WinterRye::Do(): failure in 'HayBailing' execution", "" );
507  exit( 1 );
508  }
509  }
510  else{
511  if (!m_farm->HayBailing( m_field, 0.0, m_field->GetMDates(1,3) - g_date->DayInYear())) {
512  SimpleEvent( g_date->Date() + 1, wry_hay_bailing, true );
513  break;
514  }
515  }
516  SimpleEvent( g_date->OldDays() + m_field->GetMDates(0,1), wry_stubble_harrowing, false );
517  break;
518 
520  if ( m_ev->m_lock || m_farm->DoIt( 30 ))
521  {
522  if (m_field->GetMConstants(1)==0) {
523  if (!m_farm->StubbleHarrowing( m_field, 0.0, -1)) { //raise an error
524  g_msg->Warn( WARN_BUG, "WinterRye::Do(): failure in 'StubbleHarrowing' execution", "" );
525  exit( 1 );
526  }
527  }
528  else {
529  if (!m_farm->StubbleHarrowing( m_field, 0.0, m_field->GetMDates(1,1) - g_date->DayInYear())) {
530  SimpleEvent( g_date->Date() + 1, wry_stubble_harrowing, true );
531  break;
532  }
533  }
534  }
535  // End of main thread.
536  done = true;
537  break;
538 
539  default:
540  g_msg->Warn( WARN_BUG, "WinterRye::Do(): "
541  "Unknown event type! ", "" );
542  exit( 1 );
543  }
544 
545  return done;
546 }
547 
548 
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
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
wry_fungicide
Definition: WinterRye.h:64
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
wry_fertmanure_stock
Definition: WinterRye.h:47
wry_fertnpk_plant
Definition: WinterRye.h:54
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
Farm::DoIt
bool DoIt(double a_probability)
Return chance out of 0 to 100.
Definition: farm.cpp:800
wry_herbicide
Definition: WinterRye.h:61
FarmEvent::m_first_year
bool m_first_year
Definition: farm.h:467
tof_OptimisingFarm
Definition: farm.h:273
wry_water
Definition: WinterRye.h:66
wry_fert_ammonium_stock
Definition: WinterRye.h:57
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
Farm::FA_Sludge
virtual bool FA_Sludge(LE *a_field, double a_user, int a_days)
Spread sewege sludge on a_field owned by an stock farmer.
Definition: farmfuncs.cpp:1086
Farm::GetType
TTypesOfFarm GetType(void)
Definition: farm.h:901
wry_insecticide
Definition: WinterRye.h:65
Crop::m_first_date
int m_first_date
Definition: farm.h:540
FarmEvent::m_startday
int m_startday
Definition: farm.h:466
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: farmfuncs.cpp:1279
wry_hay_turning
Definition: WinterRye.h:69
cfg_ins_app_prop1
CfgFloat cfg_ins_app_prop1
WRY_DECIDE_TO_HERB
#define WRY_DECIDE_TO_HERB
Definition: WinterRye.h:43
wry_fertsludge_stock
Definition: WinterRye.h:48
Crop::SimpleEvent
void SimpleEvent(long a_date, int a_todo, bool a_lock)
Adds an event to this crop management.
Definition: farm.cpp:307
WRY_DID_MANURE
#define WRY_DID_MANURE
Definition: WinterRye.h:41
Farm::Prob_multiplier
virtual double Prob_multiplier()
Definition: farm.h:786
WRY_DID_SLUDGE
#define WRY_DID_SLUDGE
Definition: WinterRye.h:42
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
wry_growth_reg_two
Definition: WinterRye.h:63
TTypesOfVegetation
TTypesOfVegetation
Definition: tov_declaration.h:30
wry_autumn_roll
Definition: WinterRye.h:52
Farm::Spraying_herbicides
virtual bool Spraying_herbicides(TTypesOfVegetation)
Definition: farm.h:784
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
WinterRye::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: WinterRye.cpp:37
wry_harvest
Definition: WinterRye.h:67
wry_herbicide_two
Definition: WinterRye.h:62
wry_spring_roll
Definition: WinterRye.h:58
wry_autumn_plough
Definition: WinterRye.h:49
wry_autumn_sow
Definition: WinterRye.h:51
Crop::m_farm
Farm * m_farm
Definition: farm.h:537
Crop::m_field
LE * m_field
Definition: farm.h:538
cfg_greg_app_prop
CfgFloat cfg_greg_app_prop
wry_growth_reg_one
Definition: WinterRye.h:60
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
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::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
wry_straw_chopping
Definition: WinterRye.h:68
wry_fertmanganese_plant_two
Definition: WinterRye.h:55
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
cfg_herbi_app_prop
CfgFloat cfg_herbi_app_prop
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:990
wry_strigling
Definition: WinterRye.h:59
Farm
The base class for all farm types.
Definition: farm.h:767
wry_stubble_harrowing
Definition: WinterRye.h:71
Farm::GrowthRegulator
virtual bool GrowthRegulator(LE *a_field, double a_user, int a_days)
Apply growth regulator to a_field.
Definition: farmfuncs.cpp:1250
wry_fertmanganese_plant_one
Definition: WinterRye.h:53
cfg_fungi_app_prop1
CfgFloat cfg_fungi_app_prop1
wry_autumn_harrow
Definition: WinterRye.h:50
wry_start
Definition: WinterRye.h:46
wry_hay_bailing
Definition: WinterRye.h:70
Crop::ChooseNextCrop
void ChooseNextCrop(int a_no_dates)
Chooses the next crop to grow in a field.
Definition: farm.cpp:318
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
wry_fertslurry_stock
Definition: WinterRye.h:56
Farm::Spraying_fungins
virtual bool Spraying_fungins(TTypesOfVegetation)
Definition: farm.h:785
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