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

PLWinterWheatLate class
. More...

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

PLWinterWheatLate class
.

See PLWinterWheatLate.h::PLWinterWheatLateToDo 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

◆ PLWinterWheatLate()

PLWinterWheatLate::PLWinterWheatLate ( )
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( 31,10 );
108  }

References Crop::m_first_date.

Member Function Documentation

◆ Do()

bool PLWinterWheatLate::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.

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_wwl_start:
72  {
73  // pl_wwl_start just sets up all the starting conditions and reference dates that are needed to start a pl_ww
74  PL_WWL_FERTI_P1 = false;
75  PL_WWL_FERTI_S1 = false;
76  PL_WWL_STUBBLE_PLOUGH = false;
77  PL_WWL_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(5, 8)); // last possible day of harvest
86  a_field->SetMDates(1, 0, g_date->DayInYear(10, 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(15, 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, "PLWinterWheatLate::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, "PLWinterWheatLate::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, "PLWinterWheatLate::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_wwl_ferti_s5, false, a_farm, a_field);
157  }
158  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3), pl_wwl_ferti_p5, 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(20, 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_wwl_ferti_s1, false, a_farm, a_field);
171  }
172  else SimpleEvent_(d1, pl_wwl_ferti_p1, false, a_farm, a_field);
173  }
174  break;
175 
176  // This is the first real farm operation
177  case pl_wwl_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(31, 10) - g_date->DayInYear())) {
183  // If we don't suceed on the first try, then try and try again (until 20/8 when we will suceed)
184  SimpleEvent_(g_date->Date() + 1, pl_wwl_ferti_p1, true, a_farm, a_field);
185  break;
186  }
187  else
188  {
189  //Rest of farmers do slurry before autumn plough/stubble cultivation so we need to remeber who already did it
190  PL_WWL_FERTI_P1 = true;
191  }
192  }
193  // Queue up the next event -in this case stubble ploughing
194  SimpleEvent_(g_date->Date() + 1, pl_wwl_stubble_plough, false, a_farm, a_field);
195  break;
196  case pl_wwl_ferti_s1:
197  // In total 80% of stock farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
198  // We therefore assume that half of them (40%) do it now
199  if (a_ev->m_lock || a_farm->DoIt(40))
200  {
201  if (!a_farm->FA_Slurry(a_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
202  SimpleEvent_(g_date->Date() + 1, pl_wwl_ferti_s1, true, a_farm, a_field);
203  break;
204  }
205  else
206  {
207  //Rest of farmers do slurry before autumn plough/stubble cultivation so we need to remeber who already did it
208  PL_WWL_FERTI_S1 = true;
209  }
210  }
211  // Queue up the next event -in this case stubble ploughing
212  SimpleEvent_(g_date->Date() + 1, pl_wwl_stubble_plough, false, a_farm, a_field);
213  break;
215  // 50% will do stubble plough, but rest will get away with non-inversion cultivation
216  if (a_ev->m_lock || a_farm->DoIt(50))
217  {
218  if (!a_farm->StubblePlough(a_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
219  SimpleEvent_(g_date->Date() + 1, pl_wwl_stubble_plough, true, a_farm, a_field);
220  break;
221  }
222  else
223  {
224  // 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
225  PL_WWL_STUBBLE_PLOUGH = true;
226  // Queue up the next event
227  SimpleEvent_(g_date->Date() + 1, pl_wwl_autumn_harrow1, false, a_farm, a_field);
228  break;
229  }
230  }
231  SimpleEvent_(g_date->Date() + 1, pl_wwl_stubble_harrow, false, a_farm, a_field);
232  break;
234  if (!a_farm->AutumnHarrow(a_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
235  SimpleEvent_(g_date->Date() + 1, pl_wwl_autumn_harrow1, true, a_farm, a_field);
236  break;
237  }
238  SimpleEvent_(g_date->Date() + 2, pl_wwl_autumn_harrow2, false, a_farm, a_field);
239  break;
241  if (a_ev->m_lock || a_farm->DoIt(40))
242  {
243  if (!a_farm->AutumnHarrow(a_field, 0.0, g_date->Date() + 7 - g_date->DayInYear())) {
244  SimpleEvent_(g_date->Date() + 1, pl_wwl_autumn_harrow2, true, a_farm, a_field);
245  break;
246  }
247  }
248  d1 = g_date->Date() + 1;
249  if (d1 < g_date->OldDays() + g_date->DayInYear(20, 8)) {
250  d1 = g_date->OldDays() + g_date->DayInYear(20, 8);
251  }
252  if (a_farm->IsStockFarmer()) //Stock Farmer
253  {
254  SimpleEvent_(d1, pl_wwl_ferti_s2, false, a_farm, a_field);
255  }
256  else SimpleEvent_(d1, pl_wwl_ferti_p2, false, a_farm, a_field);
257  break;
259  if (!a_farm->StubbleHarrowing(a_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
260  SimpleEvent_(g_date->Date() + 1, pl_wwl_stubble_harrow, true, a_farm, a_field);
261  break;
262  }
263  d1 = g_date->Date() + 1;
264  if (d1 < g_date->OldDays() + g_date->DayInYear(20, 8)) {
265  d1 = g_date->OldDays() + g_date->DayInYear(20, 8);
266  }
267  if (a_farm->IsStockFarmer()) //Stock Farmer
268  {
269  SimpleEvent_(d1, pl_wwl_ferti_s2, false, a_farm, a_field);
270  }
271  else SimpleEvent_(d1, pl_wwl_ferti_p2, false, a_farm, a_field);
272  break;
273  case pl_wwl_ferti_p2:
274  // In total 10% of arable farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
275  // We therefore assume that half of them (5%) do it now (if haven't done before)
276  if ((a_ev->m_lock || a_farm->DoIt(static_cast<int>((5.0/95.0)*100)))&&(PL_WWL_FERTI_P1==false))
277  {
278  if (!a_farm->FP_Slurry(a_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
279  SimpleEvent_(g_date->Date() + 1, pl_wwl_ferti_p2, true, a_farm, a_field);
280  break;
281  }
282  }
283  SimpleEvent_(g_date->Date() + 1, pl_wwl_autumn_plough, false, a_farm, a_field);
284  break;
285  case pl_wwl_ferti_s2:
286  // In total 80% of stock farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
287  // We therefore assume that half of them (40%) do it now (if haven't done before)
288  if ((a_ev->m_lock || a_farm->DoIt(static_cast<int>((40.0/60.0)*100))) && (PL_WWL_FERTI_S1==false))
289  {
290  if (!a_farm->FA_Slurry(a_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
291  SimpleEvent_(g_date->Date() + 1, pl_wwl_ferti_s2, true, a_farm, a_field);
292  break;
293  }
294  }
295  SimpleEvent_(g_date->Date() + 1, pl_wwl_autumn_plough, false, a_farm, a_field);
296  break;
298  if (a_ev->m_lock || a_farm->DoIt(80))
299  {
300  if (!a_farm->AutumnPlough(a_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
301  SimpleEvent_(g_date->Date() + 1, pl_wwl_autumn_plough, true, a_farm, a_field);
302  break;
303  }
304  else
305  {
306  // Queue up the next event and if it's late (after 15/9) it has to be rolling, else next fertilizer
307  d1 = g_date->OldDays() + g_date->DayInYear(15, 9);
308  if (g_date->Date() > d1)
309  {
310  SimpleEvent_(g_date->Date() + 1, pl_wwl_autumn_roll, true, a_farm, a_field);
311  break;
312  }
313  else
314  {
315  if (a_farm->IsStockFarmer()) //Stock Farmer
316  {
317  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(15, 9), pl_wwl_ferti_s3, false, a_farm, a_field);
318  }
319  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(15, 9), pl_wwl_ferti_p3, false, a_farm, a_field);
320  break;
321  }
322  }
323  }
324  SimpleEvent_(g_date->Date(), pl_wwl_stubble_cultivator_heavy, false, a_farm, a_field);
325  break;
326  case pl_wwl_autumn_roll:
327  if (!a_farm->AutumnRoll(a_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
328  SimpleEvent_(g_date->Date() + 1, pl_wwl_autumn_roll, true, a_farm, a_field);
329  break;
330  }
331  if (a_farm->IsStockFarmer()) //Stock Farmer
332  {
333  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(15, 9), pl_wwl_ferti_s3, false, a_farm, a_field);
334  }
335  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(15, 9), pl_wwl_ferti_p3, false, a_farm, a_field);
336  break;
338  // the rest 20% who did not plough do heavy stubble cultivation
339  if (!a_farm->StubbleCultivatorHeavy(a_field, 0.0, g_date->DayInYear(31,10) - g_date->DayInYear())) {
340  SimpleEvent_(g_date->Date() + 1, pl_wwl_stubble_cultivator_heavy, 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_wwl_ferti_s3, false, a_farm, a_field);
346  }
347  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(15, 9), pl_wwl_ferti_p3, false, a_farm, a_field);
348  break;
349  case pl_wwl_ferti_p3:
350  if (a_ev->m_lock || a_farm->DoIt(45))
351  {
352  if (!a_farm->FP_NPKS(a_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
353  SimpleEvent_(g_date->Date() + 1, pl_wwl_ferti_p3, true, a_farm, a_field);
354  break;
355  }
356  }
357  SimpleEvent_(g_date->Date() + 1, pl_wwl_preseeding_cultivator, false, a_farm, a_field);
358  break;
359  case pl_wwl_ferti_s3:
360  if (a_ev->m_lock || a_farm->DoIt(45))
361  {
362  if (!a_farm->FA_NPKS(a_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
363  SimpleEvent_(g_date->Date() + 1, pl_wwl_ferti_s3, true, a_farm, a_field);
364  break;
365  }
366  }
367  SimpleEvent_(g_date->Date() + 1, pl_wwl_preseeding_cultivator, false, a_farm, a_field);
368  break;
370  // 30% will do preseeding cultivation, the rest will do it together with sow
371  if (a_ev->m_lock || a_farm->DoIt(30))
372  {
373  if (!a_farm->PreseedingCultivator(a_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
374  SimpleEvent_(g_date->Date() + 1, pl_wwl_preseeding_cultivator, true, a_farm, a_field);
375  break;
376  }
377  SimpleEvent_(g_date->Date() + 1, pl_wwl_autumn_sow, false, a_farm, a_field);
378  break;
379  }
380  SimpleEvent_(g_date->Date() + 1, pl_wwl_preseeding_cultivator_sow, false, a_farm, a_field);
381  break;
382  case pl_wwl_autumn_sow:
383  if (!a_farm->AutumnSow(a_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
384  SimpleEvent_(g_date->Date() + 1, pl_wwl_autumn_sow, true, a_farm, a_field);
385  break;
386  }
387  // Here is a fork leading to four parallel events
388  SimpleEvent_(g_date->Date() + 3, pl_wwl_herbicide1, false, a_farm, a_field); // Herbidide thread
389  SimpleEvent_(g_date->Date() + 3, pl_wwl_fungicide1, false, a_farm, a_field); // Fungicide thread
390  SimpleEvent_(g_date->Date() + 20, pl_wwl_insecticide1, false, a_farm, a_field); // Insecticide thread
391  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 4) + 365, pl_wwl_growth_regulator1, false, a_farm, a_field); // GR thread
392  if (a_farm->IsStockFarmer()) //Stock Farmer // PK thread
393  {
394  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wwl_ferti_s4, false, a_farm, a_field);
395  }
396  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wwl_ferti_p4, false, a_farm, a_field);
397  if (a_farm->IsStockFarmer()) //Stock Farmer // Main thread
398  {
399  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wwl_ferti_s5, false, a_farm, a_field);
400  }
401  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wwl_ferti_p5, false, a_farm, a_field);
402  if (a_farm->IsStockFarmer()) //Stock Farmer // Microelemnts thread
403  {
404  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 4) + 365, pl_wwl_ferti_s8, false, a_farm, a_field);
405  }
406  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 4) + 365, pl_wwl_ferti_p8, false, a_farm, a_field);
407  break;
409  // 70% will do preseeding cultivation with sow
410  if (!a_farm->PreseedingCultivatorSow(a_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
411  SimpleEvent_(g_date->Date() + 1, pl_wwl_preseeding_cultivator_sow, true, a_farm, a_field);
412  break;
413  }
414  // Here is a fork leading to four parallel events
415  SimpleEvent_(g_date->Date() + 3, pl_wwl_herbicide1, false, a_farm, a_field); // Herbidide thread
416  SimpleEvent_(g_date->Date() + 3, pl_wwl_fungicide1, false, a_farm, a_field); // Fungicide thread
417  SimpleEvent_(g_date->Date() + 20, pl_wwl_insecticide1, false, a_farm, a_field); // Insecticide thread
418  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 4) + 365, pl_wwl_growth_regulator1, false, a_farm, a_field); // GR thread
419  if (a_farm->IsStockFarmer()) //Stock Farmer // PK thread
420  {
421  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wwl_ferti_s4, false, a_farm, a_field);
422  }
423  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wwl_ferti_p4, false, a_farm, a_field);
424  if (a_farm->IsStockFarmer()) //Stock Farmer // Main thread
425  {
426  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wwl_ferti_s5, false, a_farm, a_field);
427  }
428  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wwl_ferti_p5, false, a_farm, a_field);
429  if (a_farm->IsStockFarmer()) //Stock Farmer // Microelemnts thread
430  {
431  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 4) + 365, pl_wwl_ferti_s8, false, a_farm, a_field);
432  }
433  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 4) + 365, pl_wwl_ferti_p8, false, a_farm, a_field);
434  break;
435  case pl_wwl_herbicide1: // The first of the pesticide managements.
436  // Here comes the herbicide thread
437  if (a_ev->m_lock || a_farm->DoIt(80))
438  {
439  if (!a_farm->HerbicideTreat(a_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
440  SimpleEvent_(g_date->Date() + 1, pl_wwl_herbicide1, true, a_farm, a_field);
441  break;
442  }
443  }
444  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wwl_herbicide2, false, a_farm, a_field);
445  break;
446  case pl_wwl_herbicide2:
447  if (a_ev->m_lock || a_farm->DoIt(73))
448  {
449  if (!a_farm->HerbicideTreat(a_field, 0.0, g_date->DayInYear(10, 4) - g_date->DayInYear())) {
450  SimpleEvent_(g_date->Date() + 1, pl_wwl_herbicide2, true, a_farm, a_field);
451  break;
452  }
453  }
454  // End of thread
455  break;
456  case pl_wwl_fungicide1:
457  // Here comes the fungicide thread
458  if (a_ev->m_lock || a_farm->DoIt(5))
459  {
460  if (!a_farm->FungicideTreat(a_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
461  SimpleEvent_(g_date->Date() + 1, pl_wwl_fungicide1, true, a_farm, a_field);
462  break;
463  }
464  }
465  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 4) + 365, pl_wwl_fungicide2, false, a_farm, a_field);
466  break;
467  case pl_wwl_fungicide2:
468  if (a_ev->m_lock || a_farm->DoIt(80))
469  {
470  if (!a_farm->FungicideTreat(a_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
471  SimpleEvent_(g_date->Date() + 1, pl_wwl_fungicide2, true, a_farm, a_field);
472  break;
473  }
474  }
475  d1 = g_date->Date() + 14;
476  if (d1 < g_date->OldDays() + g_date->DayInYear(10, 5)) {
477  d1 = g_date->OldDays() + g_date->DayInYear(10, 5);
478  }
479  SimpleEvent_(d1, pl_wwl_fungicide3, false, a_farm, a_field);
480  break;
481  case pl_wwl_fungicide3:
482  if (a_ev->m_lock || a_farm->DoIt(68))
483  {
484  if (!a_farm->FungicideTreat(a_field, 0.0, g_date->DayInYear(5, 6) - g_date->DayInYear())) {
485  SimpleEvent_(g_date->Date() + 1, pl_wwl_fungicide3, true, a_farm, a_field);
486  break;
487  }
488  }
489  SimpleEvent_(g_date->Date() + 14, pl_wwl_fungicide4, false, a_farm, a_field);
490  break;
491  case pl_wwl_fungicide4:
492  if (a_ev->m_lock || a_farm->DoIt(15))
493  {
494  if (!a_farm->FungicideTreat(a_field, 0.0, g_date->DayInYear(20, 6) - g_date->DayInYear())) {
495  SimpleEvent_(g_date->Date() + 1, pl_wwl_fungicide4, true, a_farm, a_field);
496  break;
497  }
498  }
499  // End of thread
500  break;
501  case pl_wwl_insecticide1:
502  // Here comes the insecticide thread
503  if (a_ev->m_lock || a_farm->DoIt(5))
504  {
505  if (a_field->GetGreenBiomass() <= 0) {
506  SimpleEvent_(g_date->Date() + 1, pl_wwl_insecticide1, true, a_farm, a_field);
507  }
508  else
509  {
510  // here we check wheter we are using ERA pesticide or not
511  if (!cfg_pest_winterwheat_on.value() ||
512  !g_landscape_p->SupplyShouldSpray()) // Not using pesticide spray
513  {
514  if (!a_farm->InsecticideTreat(a_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
515  SimpleEvent_(g_date->Date() + 1, pl_wwl_insecticide1, true, a_farm, a_field);
516  break;
517  }
518  }
519  else {
520  a_farm->ProductApplication(a_field, 0.0, 0, cfg_pest_product_1_amount.value(), ppp_1);
521  }
522  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(20, 4) + 365, pl_wwl_insecticide2, false, a_farm, a_field);
523  break;
524  }
525  }
526  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(20, 4) + 365, pl_wwl_insecticide2, false, a_farm, a_field);
527  break;
528  case pl_wwl_insecticide2:
529  if (a_ev->m_lock || a_farm->DoIt(74))
530  {
531  // here we check wheter we are using ERA pesticide or not
532  if (!cfg_pest_winterwheat_on.value() ||
533  !g_landscape_p->SupplyShouldSpray()) // Not using pesticide spray
534  {
535  if (!a_farm->InsecticideTreat(a_field, 0.0, g_date->DayInYear(10, 6) - g_date->DayInYear())) {
536  SimpleEvent_(g_date->Date() + 1, pl_wwl_insecticide2, true, a_farm, a_field);
537  break;
538  }
539  }
540  else {
541  a_farm->ProductApplication(a_field, 0.0, 0, cfg_pest_product_1_amount.value(), ppp_1);
542  }
543  }
544  SimpleEvent_(g_date->Date() + 14, pl_wwl_insecticide3, false, a_farm, a_field);
545  break;
546  case pl_wwl_insecticide3:
547  if (a_ev->m_lock || a_farm->DoIt(38))
548  {
549  // here we check wheter we are using ERA pesticide or not
550  if (!cfg_pest_winterwheat_on.value() ||
551  !g_landscape_p->SupplyShouldSpray()) // Not using pesticide spray
552  {
553  if (!a_farm->InsecticideTreat(a_field, 0.0, g_date->DayInYear(25, 6) - g_date->DayInYear())) {
554  SimpleEvent_(g_date->Date() + 1, pl_wwl_insecticide3, true, a_farm, a_field);
555  break;
556  }
557  }
558  else {
559  a_farm->ProductApplication(a_field, 0.0, 0, cfg_pest_product_1_amount.value(), ppp_1);
560  }
561  }
562  // End of thread
563  break;
565  // Here comes the GR thread
566  if (a_ev->m_lock || a_farm->DoIt(68))
567  {
568  if (!a_farm->GrowthRegulator(a_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
569  SimpleEvent_(g_date->Date() + 1, pl_wwl_growth_regulator1, true, a_farm, a_field);
570  break;
571  }
572  else
573  {
574  //We need to remeber who did GR I
575  PL_WWL_DECIDE_TO_GR = true;
576  }
577  }
578  SimpleEvent_(g_date->Date() + 7, pl_wwl_growth_regulator2, false, a_farm, a_field);
579  break;
581  if (a_ev->m_lock || a_farm->DoIt(24*PL_WWL_DECIDE_TO_GR))
582  {
583  if (!a_farm->GrowthRegulator(a_field, 0.0, g_date->Date() + 21 - g_date->DayInYear())) {
584  SimpleEvent_(g_date->Date() + 1, pl_wwl_growth_regulator2, true, a_farm, a_field);
585  break;
586  }
587  }
588  // End of thread
589  break;
590  case pl_wwl_ferti_p4:
591  // Here comes the PK thread
592  if (a_ev->m_lock || a_farm->DoIt(50))
593  {
594  if (!a_farm->FP_PK(a_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
595  SimpleEvent_(g_date->Date() + 1, pl_wwl_ferti_p4, true, a_farm, a_field);
596  break;
597  }
598  }
599  // End of thread
600  break;
601  case pl_wwl_ferti_s4:
602  // Here comes the PK thread
603  if (a_ev->m_lock || a_farm->DoIt(50))
604  {
605  if (!a_farm->FA_PK(a_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
606  SimpleEvent_(g_date->Date() + 1, pl_wwl_ferti_s4, true, a_farm, a_field);
607  break;
608  }
609  }
610  // End of thread
611  break;
612  case pl_wwl_ferti_p5:
613  // Here comes the MAIN thread
614  if (!a_farm->FP_AmmoniumSulphate(a_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
615  SimpleEvent_(g_date->Date() + 1, pl_wwl_ferti_p5, true, a_farm, a_field);
616  break;
617  }
618  d1 = g_date->Date() + 10;
619  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 4)) {
620  d1 = g_date->OldDays() + g_date->DayInYear(1, 4);
621  }
622  SimpleEvent_(d1, pl_wwl_ferti_p6, false, a_farm, a_field);
623  break;
624  case pl_wwl_ferti_s5:
625  if (!a_farm->FA_AmmoniumSulphate(a_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
626  SimpleEvent_(g_date->Date() + 1, pl_wwl_ferti_s5, true, a_farm, a_field);
627  break;
628  }
629  d1 = g_date->Date() + 10;
630  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 4)) {
631  d1 = g_date->OldDays() + g_date->DayInYear(1, 4);
632  }
633  SimpleEvent_(d1, pl_wwl_ferti_s6, false, a_farm, a_field);
634  break;
635  case pl_wwl_ferti_p6:
636  if (a_ev->m_lock || a_farm->DoIt(95))
637  {
638  if (!a_farm->FP_AmmoniumSulphate(a_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
639  SimpleEvent_(g_date->Date() + 1, pl_wwl_ferti_p6, true, a_farm, a_field);
640  break;
641  }
642  }
643  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 6), pl_wwl_ferti_p7, false, a_farm, a_field);
644  break;
645  case pl_wwl_ferti_s6:
646  if (a_ev->m_lock || a_farm->DoIt(95))
647  {
648  if (!a_farm->FA_AmmoniumSulphate(a_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
649  SimpleEvent_(g_date->Date() + 1, pl_wwl_ferti_s6, true, a_farm, a_field);
650  break;
651  }
652  }
653  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 6), pl_wwl_ferti_s7, false, a_farm, a_field);
654  break;
655  case pl_wwl_ferti_p7:
656  if (a_ev->m_lock || a_farm->DoIt(40))
657  {
658  if (!a_farm->FP_AmmoniumSulphate(a_field, 0.0, g_date->DayInYear(10, 6) - g_date->DayInYear())) {
659  SimpleEvent_(g_date->Date() + 1, pl_wwl_ferti_p7, true, a_farm, a_field);
660  break;
661  }
662  }
663  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(15, 7), pl_wwl_harvest, false, a_farm, a_field);
664  break;
665  case pl_wwl_ferti_s7:
666  if (a_ev->m_lock || a_farm->DoIt(40))
667  {
668  if (!a_farm->FA_AmmoniumSulphate(a_field, 0.0, g_date->DayInYear(10, 6) - g_date->DayInYear())) {
669  SimpleEvent_(g_date->Date() + 1, pl_wwl_ferti_s7, true, a_farm, a_field);
670  break;
671  }
672  }
673  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(15, 7), pl_wwl_harvest, false, a_farm, a_field);
674  break;
675  case pl_wwl_ferti_p8:
676  // Here comes the mickroelements thread
677  if (a_ev->m_lock || a_farm->DoIt(63))
678  {
679  if (!a_farm->FP_ManganeseSulphate(a_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
680  SimpleEvent_(g_date->Date() + 1, pl_wwl_ferti_p8, true, a_farm, a_field);
681  break;
682  }
683  }
684  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 5), pl_wwl_ferti_p9, false, a_farm, a_field);
685  break;
686  case pl_wwl_ferti_s8:
687  if (a_ev->m_lock || a_farm->DoIt(63))
688  {
689  if (!a_farm->FA_ManganeseSulphate(a_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
690  SimpleEvent_(g_date->Date() + 1, pl_wwl_ferti_s8, true, a_farm, a_field);
691  break;
692  }
693  }
694  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 5), pl_wwl_ferti_s9, false, a_farm, a_field);
695  break;
696  case pl_wwl_ferti_p9:
697  if (a_ev->m_lock || a_farm->DoIt(8))
698  {
699  if (!a_farm->FP_ManganeseSulphate(a_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear())) {
700  SimpleEvent_(g_date->Date() + 1, pl_wwl_ferti_p9, true, a_farm, a_field);
701  break;
702  }
703  }
704  // End of thread
705  break;
706  case pl_wwl_ferti_s9:
707  if (a_ev->m_lock || a_farm->DoIt(8))
708  {
709  if (!a_farm->FA_ManganeseSulphate(a_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear())) {
710  SimpleEvent_(g_date->Date() + 1, pl_wwl_ferti_s9, true, a_farm, a_field);
711  break;
712  }
713  }
714  // End of thread
715  break;
716  case pl_wwl_harvest:
717  // Here the MAIN thread continues
718  // We don't move harvest days
719  if (!a_farm->Harvest(a_field, 0.0, a_field->GetMDates(0, 0) - g_date->DayInYear())) {
720  SimpleEvent_(g_date->Date() + 1, pl_wwl_harvest, true, a_farm, a_field);
721  break;
722  }
723  SimpleEvent_(g_date->Date() + 1, pl_wwl_straw_chopping, false, a_farm, a_field);
724  break;
725 
726 
728  if (a_farm->IsStockFarmer()) //Stock Farmer
729  {
730  // 10% of stock farmers will do straw chopping, but rest will do hay bailing instead
731  if (a_ev->m_lock || a_farm->DoIt(10))
732  {
733  if (a_field->GetMConstants(0) == 0) {
734  if (!a_farm->StrawChopping(a_field, 0.0, -1)) { // raise an error
735  g_msg->Warn(WARN_BUG, "PLWinterWheatLate::Do(): failure in 'StrawChopping' execution", "");
736  exit(1);
737  }
738  }
739  else {
740  if (!a_farm->StrawChopping(a_field, 0.0, a_field->GetMDates(1, 0) - g_date->DayInYear())) {
741  SimpleEvent_(g_date->Date() + 1, pl_wwl_straw_chopping, true, a_farm, a_field);
742  break;
743  }
744  else
745  {
746  // Queue up the next event
747  SimpleEvent_(g_date->Date(), pl_wwl_ferti_s10, false, a_farm, a_field);
748  break;
749  }
750  }
751 
752  }
753  SimpleEvent_(g_date->Date() + 1, pl_wwl_hay_bailing, false, a_farm, a_field);
754  break;
755  }
756  else
757  {
758  // 90% of arable farmers will do straw chopping, but rest will do hay bailing instead
759  if (a_ev->m_lock || a_farm->DoIt(90))
760  {
761  if (a_field->GetMConstants(0) == 0) {
762  if (!a_farm->StrawChopping(a_field, 0.0, -1)) { // raise an error
763  g_msg->Warn(WARN_BUG, "PLWinterWheatLate::Do(): failure in 'StrawChopping' execution", "");
764  exit(1);
765  }
766  }
767  else {
768  if (!a_farm->StrawChopping(a_field, 0.0, a_field->GetMDates(1, 0) - g_date->DayInYear())) {
769  SimpleEvent_(g_date->Date() + 1, pl_wwl_straw_chopping, true, a_farm, a_field);
770  break;
771  }
772  else
773  {
774  // Queue up the next event
775  SimpleEvent_(g_date->Date(), pl_wwl_ferti_p10, false, a_farm, a_field);
776  break;
777  }
778  }
779 
780  }
781  SimpleEvent_(g_date->Date() + 1, pl_wwl_hay_bailing, false, a_farm, a_field);
782  break;
783  }
784  case pl_wwl_hay_bailing:
785  if (a_field->GetMConstants(1) == 0) {
786  if (!a_farm->HayBailing(a_field, 0.0, -1)) { // raise an error
787  g_msg->Warn(WARN_BUG, "PLWinterWheatLate::Do(): failure in 'HayBailing' execution", "");
788  exit(1);
789  }
790  }
791  else {
792  if (!a_farm->HayBailing(a_field, 0.0, a_field->GetMDates(1,1) - g_date->DayInYear())) {
793  SimpleEvent_(g_date->Date() + 1, pl_wwl_hay_bailing, true, a_farm, a_field);
794  break;
795  }
796  }
797  if (a_farm->IsStockFarmer()) //Stock Farmer
798  {
799  SimpleEvent_(g_date->Date(), pl_wwl_ferti_s11, false, a_farm, a_field);
800  }
801  else SimpleEvent_(g_date->Date(), pl_wwl_ferti_p11, false, a_farm, a_field);
802  break;
803  case pl_wwl_ferti_p10:
804  if (a_ev->m_lock || a_farm->DoIt(18))
805  {
806  if (a_field->GetMConstants(2) == 0) {
807  if (!a_farm->FP_RSM(a_field, 0.0, -1)) { // raise an error
808  g_msg->Warn(WARN_BUG, "PLWinterWheatLate::Do(): failure in 'FP_RSM' execution", "");
809  exit(1);
810  }
811  }
812  else {
813  if (!a_farm->FP_RSM(a_field, 0.0, a_field->GetMDates(1,2) - g_date->DayInYear())) {
814  SimpleEvent_(g_date->Date() + 1, pl_wwl_ferti_p10, true, a_farm, a_field);
815  break;
816  }
817  }
818  }
819  if (a_farm->IsStockFarmer()) //Stock Farmer
820  {
821  SimpleEvent_(g_date->Date(), pl_wwl_ferti_s11, false, a_farm, a_field);
822  }
823  else SimpleEvent_(g_date->Date(), pl_wwl_ferti_p11, false, a_farm, a_field);
824  break;
825  case pl_wwl_ferti_s10:
826  if (a_ev->m_lock || a_farm->DoIt(18))
827  {
828  if (a_field->GetMConstants(2) == 0) {
829  if (!a_farm->FA_RSM(a_field, 0.0, -1)) { // raise an error
830  g_msg->Warn(WARN_BUG, "PLWinterWheatLate::Do(): failure in 'FA_RSM' execution", "");
831  exit(1);
832  }
833  }
834  else {
835  if (!a_farm->FA_RSM(a_field, 0.0, a_field->GetMDates(1, 2) - g_date->DayInYear())) {
836  SimpleEvent_(g_date->Date() + 1, pl_wwl_ferti_s10, true, a_farm, a_field);
837  break;
838  }
839  }
840  }
841  if (a_farm->IsStockFarmer()) //Stock Farmer
842  {
843  SimpleEvent_(g_date->Date(), pl_wwl_ferti_s11, false, a_farm, a_field);
844  }
845  else SimpleEvent_(g_date->Date(), pl_wwl_ferti_p11, false, a_farm, a_field);
846  break;
847  case pl_wwl_ferti_p11:
848  if (a_ev->m_lock || a_farm->DoIt(23))
849  {
850  if (a_field->GetMConstants(3) == 0) {
851  if (!a_farm->FP_Calcium(a_field, 0.0, -1)) { // raise an error
852  g_msg->Warn(WARN_BUG, "PLWinterWheatLate::Do(): failure in 'FP_Calcium' execution", "");
853  exit(1);
854  }
855  }
856  else {
857  if (!a_farm->FP_Calcium(a_field, 0.0, a_field->GetMDates(1,3) - g_date->DayInYear())) {
858  SimpleEvent_(g_date->Date() + 1, pl_wwl_ferti_p11, true, a_farm, a_field);
859  break;
860  }
861  }
862  }
863  done = true;
864  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
865  // END of MAIN THREAD
866  break;
867  case pl_wwl_ferti_s11:
868  if (a_ev->m_lock || a_farm->DoIt(23))
869  {
870  if (a_field->GetMConstants(3) == 0) {
871  if (!a_farm->FA_Calcium(a_field, 0.0, -1)) { // raise an error
872  g_msg->Warn(WARN_BUG, "PLWinterWheatLate::Do(): failure in 'FA_Calcium' execution", "");
873  exit(1);
874  }
875  }
876  else {
877  if (!a_farm->FA_Calcium(a_field, 0.0, a_field->GetMDates(1, 3) - g_date->DayInYear())) {
878  SimpleEvent_(g_date->Date() + 1, pl_wwl_ferti_s11, true, a_farm, a_field);
879  break;
880  }
881  }
882  }
883  done = true;
884  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
885  // END of MAIN THREAD
886  break;
887  default:
888  g_msg->Warn(WARN_BUG, "PLWinterWheatLate::Do(): "
889  "Unknown event type! ", "");
890  exit(1);
891  }
892  return done;
893 }

References Landscape::BackTranslateVegTypes(), cfg_pest_product_1_amount, cfg_pest_winterwheat_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_wwl_autumn_harrow1, pl_wwl_autumn_harrow2, pl_wwl_autumn_plough, pl_wwl_autumn_roll, pl_wwl_autumn_sow, PL_WWL_DECIDE_TO_GR, PL_WWL_FERTI_P1, pl_wwl_ferti_p1, pl_wwl_ferti_p10, pl_wwl_ferti_p11, pl_wwl_ferti_p2, pl_wwl_ferti_p3, pl_wwl_ferti_p4, pl_wwl_ferti_p5, pl_wwl_ferti_p6, pl_wwl_ferti_p7, pl_wwl_ferti_p8, pl_wwl_ferti_p9, PL_WWL_FERTI_S1, pl_wwl_ferti_s1, pl_wwl_ferti_s10, pl_wwl_ferti_s11, pl_wwl_ferti_s2, pl_wwl_ferti_s3, pl_wwl_ferti_s4, pl_wwl_ferti_s5, pl_wwl_ferti_s6, pl_wwl_ferti_s7, pl_wwl_ferti_s8, pl_wwl_ferti_s9, pl_wwl_fungicide1, pl_wwl_fungicide2, pl_wwl_fungicide3, pl_wwl_fungicide4, pl_wwl_growth_regulator1, pl_wwl_growth_regulator2, pl_wwl_harvest, pl_wwl_hay_bailing, pl_wwl_herbicide1, pl_wwl_herbicide2, pl_wwl_insecticide1, pl_wwl_insecticide2, pl_wwl_insecticide3, pl_wwl_preseeding_cultivator, pl_wwl_preseeding_cultivator_sow, pl_wwl_start, pl_wwl_straw_chopping, pl_wwl_stubble_cultivator_heavy, pl_wwl_stubble_harrow, PL_WWL_STUBBLE_PLOUGH, pl_wwl_stubble_plough, ppp_1, Crop::SimpleEvent_(), Landscape::SupplyShouldSpray(), and tof_OptimisingFarm.


The documentation for this class was generated from the following files:
pl_wwl_ferti_s9
Definition: PLWinterWheatLate.h:71
pl_wwl_start
Definition: PLWinterWheatLate.h:39
pl_wwl_preseeding_cultivator_sow
Definition: PLWinterWheatLate.h:55
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: farm.h:905
FarmEvent::m_lock
bool m_lock
Definition: farm.h:465
Landscape::SupplyShouldSpray
bool SupplyShouldSpray()
Definition: Landscape.h:357
Farm::DoIt
bool DoIt(double a_probability)
Return chance out of 0 to 100.
Definition: farm.cpp:800
pl_wwl_herbicide1
Definition: PLWinterWheatLate.h:57
cfg_pest_winterwheat_on
CfgBool cfg_pest_winterwheat_on
FarmEvent::m_first_year
bool m_first_year
Definition: farm.h:467
pl_wwl_ferti_p11
Definition: PLWinterWheatLate.h:85
tof_OptimisingFarm
Definition: farm.h:273
pl_wwl_ferti_p4
Definition: PLWinterWheatLate.h:60
Landscape::BackTranslateVegTypes
int BackTranslateVegTypes(TTypesOfVegetation VegReference)
Definition: Landscape.h:1669
pl_wwl_ferti_s3
Definition: PLWinterWheatLate.h:53
pl_wwl_preseeding_cultivator
Definition: PLWinterWheatLate.h:54
PL_WWL_DECIDE_TO_GR
#define PL_WWL_DECIDE_TO_GR
Definition: PLWinterWheatLate.h:31
pl_wwl_autumn_sow
Definition: PLWinterWheatLate.h:56
Farm::GetType
TTypesOfFarm GetType(void)
Definition: farm.h:901
pl_wwl_stubble_cultivator_heavy
Definition: PLWinterWheatLate.h:51
Crop::m_first_date
int m_first_date
Definition: farm.h:540
FarmEvent::m_startday
int m_startday
Definition: farm.h:466
pl_wwl_autumn_harrow1
Definition: PLWinterWheatLate.h:44
pl_wwl_autumn_harrow2
Definition: PLWinterWheatLate.h:45
cfg_pest_product_1_amount
CfgFloat cfg_pest_product_1_amount
pl_wwl_ferti_p8
Definition: PLWinterWheatLate.h:68
pl_wwl_straw_chopping
Definition: PLWinterWheatLate.h:81
pl_wwl_ferti_s8
Definition: PLWinterWheatLate.h:69
PL_WWL_FERTI_S1
#define PL_WWL_FERTI_S1
Definition: PLWinterWheatLate.h:29
pl_wwl_ferti_p5
Definition: PLWinterWheatLate.h:62
pl_wwl_ferti_s7
Definition: PLWinterWheatLate.h:67
pl_wwl_insecticide2
Definition: PLWinterWheatLate.h:76
pl_wwl_ferti_p7
Definition: PLWinterWheatLate.h:66
pl_wwl_herbicide2
Definition: PLWinterWheatLate.h:72
pl_wwl_stubble_harrow
Definition: PLWinterWheatLate.h:46
pl_wwl_fungicide3
Definition: PLWinterWheatLate.h:74
pl_wwl_fungicide1
Definition: PLWinterWheatLate.h:58
FarmEvent::m_next_tov
TTypesOfVegetation m_next_tov
Definition: farm.h:471
pl_wwl_ferti_s1
Definition: PLWinterWheatLate.h:42
pl_wwl_hay_bailing
Definition: PLWinterWheatLate.h:82
pl_wwl_insecticide3
Definition: PLWinterWheatLate.h:77
FarmEvent::m_todo
int m_todo
Definition: farm.h:469
pl_wwl_ferti_p6
Definition: PLWinterWheatLate.h:64
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_wwl_ferti_s11
Definition: PLWinterWheatLate.h:86
ppp_1
Definition: farm.h:422
pl_wwl_growth_regulator2
Definition: PLWinterWheatLate.h:79
pl_wwl_ferti_p1
Definition: PLWinterWheatLate.h:41
pl_wwl_autumn_plough
Definition: PLWinterWheatLate.h:49
pl_wwl_ferti_p2
Definition: PLWinterWheatLate.h:47
pl_wwl_insecticide1
Definition: PLWinterWheatLate.h:59
PL_WWL_STUBBLE_PLOUGH
#define PL_WWL_STUBBLE_PLOUGH
Definition: PLWinterWheatLate.h:30
pl_wwl_autumn_roll
Definition: PLWinterWheatLate.h:50
PL_WWL_FERTI_P1
#define PL_WWL_FERTI_P1
A flag used to indicate autumn ploughing status.
Definition: PLWinterWheatLate.h:28
pl_wwl_ferti_p10
Definition: PLWinterWheatLate.h:83
pl_wwl_ferti_p9
Definition: PLWinterWheatLate.h:70
pl_wwl_ferti_p3
Definition: PLWinterWheatLate.h:52
pl_wwl_ferti_s5
Definition: PLWinterWheatLate.h:63
pl_wwl_ferti_s4
Definition: PLWinterWheatLate.h:61
pl_wwl_stubble_plough
Definition: PLWinterWheatLate.h:43
pl_wwl_fungicide4
Definition: PLWinterWheatLate.h:75
pl_wwl_ferti_s2
Definition: PLWinterWheatLate.h:48
pl_wwl_harvest
Definition: PLWinterWheatLate.h:80
pl_wwl_ferti_s6
Definition: PLWinterWheatLate.h:65
pl_wwl_growth_regulator1
Definition: PLWinterWheatLate.h:78
pl_wwl_fungicide2
Definition: PLWinterWheatLate.h:73
pl_wwl_ferti_s10
Definition: PLWinterWheatLate.h:84
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