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

PLWinterRape class
. More...

#include <PLWinterRape.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...
 
 PLWinterRape ()
 
- 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

PLWinterRape class
.

See PLWinterRape.h::PLWinterRapeToDo 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

◆ PLWinterRape()

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

References Crop::m_first_date.

Member Function Documentation

◆ Do()

bool PLWinterRape::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 rape.

Reimplemented from Crop.

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

References Landscape::BackTranslateVegTypes(), cfg_pest_product_1_amount, cfg_pest_winterrape_on, Farm::DoIt(), 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_wr_autumn_harrow1, pl_wr_autumn_harrow2, pl_wr_autumn_harrow3, pl_wr_autumn_plough, pl_wr_autumn_roll, pl_wr_autumn_sow, PL_WR_DECIDE_TO_GR, PL_WR_FERTI_P1, pl_wr_ferti_p1, pl_wr_ferti_p10, pl_wr_ferti_p2, pl_wr_ferti_p3, pl_wr_ferti_p4, pl_wr_ferti_p5, pl_wr_ferti_p6, pl_wr_ferti_p7, pl_wr_ferti_p8, pl_wr_ferti_p9, PL_WR_FERTI_S1, pl_wr_ferti_s1, pl_wr_ferti_s10, pl_wr_ferti_s2, pl_wr_ferti_s3, pl_wr_ferti_s4, pl_wr_ferti_s5, pl_wr_ferti_s6, pl_wr_ferti_s7, pl_wr_ferti_s8, pl_wr_ferti_s9, pl_wr_fungicide1, pl_wr_fungicide2, pl_wr_fungicide3, pl_wr_fungicide4, pl_wr_harvest, pl_wr_hay_bailing, pl_wr_herbicide1, pl_wr_herbicide2, pl_wr_herbicide3, pl_wr_herbicide4, pl_wr_insecticide1, pl_wr_insecticide2, pl_wr_insecticide3, pl_wr_insecticide4, pl_wr_insecticide5, pl_wr_insecticide6, pl_wr_molluscicide, pl_wr_preseeding_cultivator, pl_wr_start, pl_wr_straw_chopping, pl_wr_stubble_cultivator_heavy, pl_wr_stubble_harrow, PL_WR_STUBBLE_PLOUGH, pl_wr_stubble_plough, ppp_1, Crop::SimpleEvent_(), Landscape::SupplyShouldSpray(), and tof_OptimisingFarm.


The documentation for this class was generated from the following files:
pl_wr_fungicide2
Definition: PLWinterRape.h:75
pl_wr_autumn_roll
Definition: PLWinterRape.h:50
PL_WR_FERTI_P1
#define PL_WR_FERTI_P1
A flag used to indicate autumn ploughing status.
Definition: PLWinterRape.h:28
pl_wr_ferti_s1
Definition: PLWinterRape.h:42
pl_wr_autumn_harrow1
Definition: PLWinterRape.h:44
PL_WR_FERTI_S1
#define PL_WR_FERTI_S1
Definition: PLWinterRape.h:29
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: farm.h:905
pl_wr_ferti_p1
Definition: PLWinterRape.h:41
pl_wr_ferti_p3
Definition: PLWinterRape.h:52
pl_wr_ferti_p7
Definition: PLWinterRape.h:70
FarmEvent::m_lock
bool m_lock
Definition: farm.h:465
Landscape::SupplyShouldSpray
bool SupplyShouldSpray()
Definition: Landscape.h:357
pl_wr_ferti_s6
Definition: PLWinterRape.h:69
Farm::DoIt
bool DoIt(double a_probability)
Return chance out of 0 to 100.
Definition: farm.cpp:800
pl_wr_herbicide2
Definition: PLWinterRape.h:58
pl_wr_insecticide5
Definition: PLWinterRape.h:79
FarmEvent::m_first_year
bool m_first_year
Definition: farm.h:467
pl_wr_ferti_p6
Definition: PLWinterRape.h:68
tof_OptimisingFarm
Definition: farm.h:273
pl_wr_ferti_p9
Definition: PLWinterRape.h:85
Landscape::BackTranslateVegTypes
int BackTranslateVegTypes(TTypesOfVegetation VegReference)
Definition: Landscape.h:1669
pl_wr_preseeding_cultivator
Definition: PLWinterRape.h:54
pl_wr_ferti_p5
Definition: PLWinterRape.h:66
pl_wr_insecticide4
Definition: PLWinterRape.h:78
pl_wr_start
Definition: PLWinterRape.h:39
pl_wr_ferti_p8
Definition: PLWinterRape.h:72
Farm::GetType
TTypesOfFarm GetType(void)
Definition: farm.h:901
pl_wr_fungicide1
Definition: PLWinterRape.h:59
Crop::m_first_date
int m_first_date
Definition: farm.h:540
FarmEvent::m_startday
int m_startday
Definition: farm.h:466
pl_wr_autumn_harrow3
Definition: PLWinterRape.h:55
pl_wr_molluscicide
Definition: PLWinterRape.h:63
pl_wr_insecticide1
Definition: PLWinterRape.h:60
pl_wr_insecticide2
Definition: PLWinterRape.h:61
cfg_pest_winterrape_on
CfgBool cfg_pest_winterrape_on
pl_wr_ferti_p10
Definition: PLWinterRape.h:87
pl_wr_harvest
Definition: PLWinterRape.h:82
pl_wr_herbicide4
Definition: PLWinterRape.h:81
pl_wr_autumn_harrow2
Definition: PLWinterRape.h:45
pl_wr_insecticide6
Definition: PLWinterRape.h:80
pl_wr_ferti_s7
Definition: PLWinterRape.h:71
pl_wr_autumn_sow
Definition: PLWinterRape.h:56
pl_wr_fungicide3
Definition: PLWinterRape.h:76
pl_wr_ferti_s3
Definition: PLWinterRape.h:53
pl_wr_stubble_cultivator_heavy
Definition: PLWinterRape.h:51
pl_wr_herbicide3
Definition: PLWinterRape.h:74
FarmEvent::m_next_tov
TTypesOfVegetation m_next_tov
Definition: farm.h:471
cfg_pest_product_1_amount
CfgFloat cfg_pest_product_1_amount
FarmEvent::m_todo
int m_todo
Definition: farm.h:469
pl_wr_ferti_s8
Definition: PLWinterRape.h:73
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
pl_wr_stubble_plough
Definition: PLWinterRape.h:43
ppp_1
Definition: farm.h:422
pl_wr_stubble_harrow
Definition: PLWinterRape.h:46
pl_wr_ferti_s4
Definition: PLWinterRape.h:65
pl_wr_ferti_s10
Definition: PLWinterRape.h:88
pl_wr_ferti_p2
Definition: PLWinterRape.h:47
pl_wr_herbicide1
Definition: PLWinterRape.h:57
pl_wr_fungicide4
Definition: PLWinterRape.h:77
pl_wr_ferti_s5
Definition: PLWinterRape.h:67
pl_wr_straw_chopping
Definition: PLWinterRape.h:83
PL_WR_DECIDE_TO_GR
#define PL_WR_DECIDE_TO_GR
Definition: PLWinterRape.h:31
pl_wr_autumn_plough
Definition: PLWinterRape.h:49
pl_wr_ferti_p4
Definition: PLWinterRape.h:64
pl_wr_ferti_s2
Definition: PLWinterRape.h:48
pl_wr_hay_bailing
Definition: PLWinterRape.h:84
pl_wr_ferti_s9
Definition: PLWinterRape.h:86
pl_wr_insecticide3
Definition: PLWinterRape.h:62
PL_WR_STUBBLE_PLOUGH
#define PL_WR_STUBBLE_PLOUGH
Definition: PLWinterRape.h:30
g_landscape_p
Landscape * g_landscape_p
Definition: Landscape.cpp:258
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