ALMaSS Skylark ODDox  1.1
The skylark model description following ODdox protocol
PLWinterWheat Class Reference

PLWinterWheat class
. More...

#include <PLWinterWheat.h>

Public Member Functions

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

Additional Inherited Members

- Protected Member Functions inherited from Crop
void SimpleEvent (long a_date, int a_todo, bool a_lock)
 Adds an event to this crop management. More...
 
void SimpleEvent_ (long a_date, int a_todo, bool a_lock, Farm *a_farm, LE *a_field)
 Adds an event to this crop management without relying on member variables. More...
 
- Protected Attributes inherited from Crop
Farmm_farm
 
LE * m_field
 
FarmEventm_ev
 
int m_first_date
 
int m_count
 
int m_last_date
 
int m_ddegstoharvest
 
int m_CropClassification
 

Detailed Description

PLWinterWheat class
.

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

Constructor & Destructor Documentation

◆ PLWinterWheat()

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

References Crop::m_first_date.

Member Function Documentation

◆ Do()

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

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

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

Reimplemented from Crop.

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

References Landscape::BackTranslateVegTypes(), cfg_pest_product_1_amount, cfg_pest_winterwheat_on, cfg_WW_conv_tillage_prop1, cfg_WW_conv_tillage_prop2, cfg_WW_isecticide_prop1, cfg_WW_isecticide_prop2, cfg_WW_isecticide_prop3, cfg_WW_NINV_tillage_prop1, cfg_WW_NINV_tillage_prop2, Farm::DoIt_prob(), Farm::FP_Slurry(), g_landscape_p, Farm::GetType(), Farm::IsStockFarmer(), Crop::m_first_date, FarmEvent::m_first_year, FarmEvent::m_lock, FarmEvent::m_next_tov, FarmEvent::m_startday, FarmEvent::m_todo, pl_ww_autumn_harrow1, pl_ww_autumn_harrow2, pl_ww_autumn_plough, pl_ww_autumn_roll, pl_ww_autumn_sow, PL_WW_DECIDE_TO_GR, PL_WW_FERTI_P1, pl_ww_ferti_p1, pl_ww_ferti_p10, pl_ww_ferti_p11, pl_ww_ferti_p2, pl_ww_ferti_p3, pl_ww_ferti_p4, pl_ww_ferti_p5, pl_ww_ferti_p6, pl_ww_ferti_p7, pl_ww_ferti_p8, pl_ww_ferti_p9, PL_WW_FERTI_S1, pl_ww_ferti_s1, pl_ww_ferti_s10, pl_ww_ferti_s11, pl_ww_ferti_s2, pl_ww_ferti_s3, pl_ww_ferti_s4, pl_ww_ferti_s5, pl_ww_ferti_s6, pl_ww_ferti_s7, pl_ww_ferti_s8, pl_ww_ferti_s9, pl_ww_fungicide1, pl_ww_fungicide2, pl_ww_fungicide3, pl_ww_fungicide4, pl_ww_growth_regulator1, pl_ww_growth_regulator2, pl_ww_harvest, pl_ww_hay_bailing, pl_ww_herbicide1, pl_ww_herbicide2, pl_ww_insecticide1, pl_ww_insecticide2, pl_ww_insecticide3, pl_ww_preseeding_cultivator, pl_ww_preseeding_cultivator_sow, pl_ww_start, pl_ww_straw_chopping, pl_ww_stubble_cultivator_heavy, pl_ww_stubble_harrow, PL_WW_STUBBLE_PLOUGH, pl_ww_stubble_plough, ppp_1, Crop::SimpleEvent_(), Landscape::SupplyShouldSpray(), and tof_OptimisingFarm.


The documentation for this class was generated from the following files:
pl_ww_ferti_s2
Definition: PLWinterWheat.h:48
cfg_pest_winterwheat_on
CfgBool cfg_pest_winterwheat_on
pl_ww_hay_bailing
Definition: PLWinterWheat.h:82
pl_ww_ferti_p6
Definition: PLWinterWheat.h:64
pl_ww_ferti_p2
Definition: PLWinterWheat.h:47
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: farm.h:905
pl_ww_autumn_plough
Definition: PLWinterWheat.h:49
pl_ww_ferti_s8
Definition: PLWinterWheat.h:69
pl_ww_herbicide2
Definition: PLWinterWheat.h:72
FarmEvent::m_lock
bool m_lock
Definition: farm.h:465
PL_WW_STUBBLE_PLOUGH
#define PL_WW_STUBBLE_PLOUGH
Definition: PLWinterWheat.h:30
Landscape::SupplyShouldSpray
bool SupplyShouldSpray()
Definition: Landscape.h:357
pl_ww_ferti_s7
Definition: PLWinterWheat.h:67
pl_ww_ferti_s10
Definition: PLWinterWheat.h:84
pl_ww_ferti_p11
Definition: PLWinterWheat.h:85
pl_ww_ferti_p4
Definition: PLWinterWheat.h:60
pl_ww_ferti_s6
Definition: PLWinterWheat.h:65
FarmEvent::m_first_year
bool m_first_year
Definition: farm.h:467
cfg_pest_product_1_amount
CfgFloat cfg_pest_product_1_amount
tof_OptimisingFarm
Definition: farm.h:273
pl_ww_fungicide3
Definition: PLWinterWheat.h:74
Farm::DoIt_prob
bool DoIt_prob(double a_probability)
Return chance out of 0 to 1.
Definition: farm.cpp:808
cfg_WW_NINV_tillage_prop2
CfgFloat cfg_WW_NINV_tillage_prop2
pl_ww_autumn_harrow2
Definition: PLWinterWheat.h:45
Landscape::BackTranslateVegTypes
int BackTranslateVegTypes(TTypesOfVegetation VegReference)
Definition: Landscape.h:1669
Farm::GetType
TTypesOfFarm GetType(void)
Definition: farm.h:901
pl_ww_preseeding_cultivator_sow
Definition: PLWinterWheat.h:55
pl_ww_ferti_p9
Definition: PLWinterWheat.h:70
pl_ww_ferti_s5
Definition: PLWinterWheat.h:63
Crop::m_first_date
int m_first_date
Definition: farm.h:540
FarmEvent::m_startday
int m_startday
Definition: farm.h:466
pl_ww_ferti_p3
Definition: PLWinterWheat.h:52
pl_ww_ferti_p10
Definition: PLWinterWheat.h:83
pl_ww_insecticide2
Definition: PLWinterWheat.h:76
pl_ww_insecticide3
Definition: PLWinterWheat.h:77
pl_ww_ferti_s4
Definition: PLWinterWheat.h:61
pl_ww_autumn_harrow1
Definition: PLWinterWheat.h:44
cfg_WW_isecticide_prop1
CfgFloat cfg_WW_isecticide_prop1
cfg_WW_conv_tillage_prop2
CfgFloat cfg_WW_conv_tillage_prop2
PL_WW_FERTI_P1
#define PL_WW_FERTI_P1
A flag used to indicate autumn ploughing status.
Definition: PLWinterWheat.h:28
pl_ww_start
Definition: PLWinterWheat.h:39
cfg_WW_isecticide_prop2
CfgFloat cfg_WW_isecticide_prop2
PL_WW_DECIDE_TO_GR
#define PL_WW_DECIDE_TO_GR
Definition: PLWinterWheat.h:31
pl_ww_fungicide2
Definition: PLWinterWheat.h:73
pl_ww_fungicide4
Definition: PLWinterWheat.h:75
pl_ww_herbicide1
Definition: PLWinterWheat.h:57
cfg_WW_isecticide_prop3
CfgFloat cfg_WW_isecticide_prop3
pl_ww_autumn_roll
Definition: PLWinterWheat.h:50
FarmEvent::m_next_tov
TTypesOfVegetation m_next_tov
Definition: farm.h:471
pl_ww_stubble_harrow
Definition: PLWinterWheat.h:46
pl_ww_stubble_plough
Definition: PLWinterWheat.h:43
pl_ww_harvest
Definition: PLWinterWheat.h:80
FarmEvent::m_todo
int m_todo
Definition: farm.h:469
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
pl_ww_fungicide1
Definition: PLWinterWheat.h:58
pl_ww_ferti_p8
Definition: PLWinterWheat.h:68
pl_ww_ferti_s9
Definition: PLWinterWheat.h:71
cfg_WW_conv_tillage_prop1
CfgFloat cfg_WW_conv_tillage_prop1
pl_ww_insecticide1
Definition: PLWinterWheat.h:59
pl_ww_growth_regulator1
Definition: PLWinterWheat.h:78
pl_ww_ferti_s3
Definition: PLWinterWheat.h:53
pl_ww_stubble_cultivator_heavy
Definition: PLWinterWheat.h:51
pl_ww_ferti_p5
Definition: PLWinterWheat.h:62
pl_ww_autumn_sow
Definition: PLWinterWheat.h:56
PL_WW_FERTI_S1
#define PL_WW_FERTI_S1
Definition: PLWinterWheat.h:29
pl_ww_preseeding_cultivator
Definition: PLWinterWheat.h:54
pl_ww_ferti_p7
Definition: PLWinterWheat.h:66
pl_ww_straw_chopping
Definition: PLWinterWheat.h:81
pl_ww_ferti_s11
Definition: PLWinterWheat.h:86
pl_ww_ferti_p1
Definition: PLWinterWheat.h:41
cfg_WW_NINV_tillage_prop1
CfgFloat cfg_WW_NINV_tillage_prop1
pl_ww_growth_regulator2
Definition: PLWinterWheat.h:79
g_landscape_p
Landscape * g_landscape_p
Definition: Landscape.cpp:258
pl_ww_ferti_s1
Definition: PLWinterWheat.h:42
Crop::SimpleEvent_
void SimpleEvent_(long a_date, int a_todo, bool a_lock, Farm *a_farm, LE *a_field)
Adds an event to this crop management without relying on member variables.
Definition: farm.cpp:312