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

PLWinterBarley class
. More...

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

PLWinterBarley class
.

See PLWinterBarley.h::PLWinterBarleyToDo 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

◆ PLWinterBarley()

PLWinterBarley::PLWinterBarley ( )
inline
103  {
104  // When we start it off, the first possible date for a farm operation is 5th 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( 5,9 );
108  }

References Crop::m_first_date.

Member Function Documentation

◆ Do()

bool PLWinterBarley::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 barley.

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_wb_start:
72  {
73  // pl_wb_start just sets up all the starting conditions and reference dates that are needed to start a pl_wb
74  PL_WB_FERTI_P1 = false;
75  PL_WB_FERTI_S1 = false;
76  PL_WB_STUBBLE_PLOUGH = false;
77  PL_WB_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(20, 7)); // last possible day of harvest
86  a_field->SetMDates(1, 0, g_date->DayInYear(25, 7)); // 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(30, 7)); // 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, "PLWinterBarley::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, "PLWinterBarley::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, "PLWinterBarley::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_wb_ferti_s5, false, a_farm, a_field);
157  }
158  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3), pl_wb_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_wb_ferti_s1, false, a_farm, a_field);
171  }
172  else SimpleEvent_(d1, pl_wb_ferti_p1, false, a_farm, a_field);
173  }
174  break;
175 
176  // This is the first real farm operation
177  case pl_wb_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(5, 9) - 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_wb_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_WB_FERTI_P1 = true;
191  }
192  }
193  // Queue up the next event -in this case stubble ploughing
194  SimpleEvent_(g_date->Date() + 1, pl_wb_stubble_plough, false, a_farm, a_field);
195  break;
196  case pl_wb_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(5, 9) - g_date->DayInYear())) {
202  SimpleEvent_(g_date->Date() + 1, pl_wb_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_WB_FERTI_S1 = true;
209  }
210  }
211  // Queue up the next event -in this case stubble ploughing
212  SimpleEvent_(g_date->Date() + 1, pl_wb_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(5, 9) - g_date->DayInYear())) {
219  SimpleEvent_(g_date->Date() + 1, pl_wb_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_WB_STUBBLE_PLOUGH = true;
226  // Queue up the next event
227  SimpleEvent_(g_date->Date() + 1, pl_wb_autumn_harrow1, false, a_farm, a_field);
228  break;
229  }
230  }
231  SimpleEvent_(g_date->Date() + 1, pl_wb_stubble_harrow, false, a_farm, a_field);
232  break;
234  if (!a_farm->AutumnHarrow(a_field, 0.0, g_date->DayInYear(5, 9) - g_date->DayInYear())) {
235  SimpleEvent_(g_date->Date() + 1, pl_wb_autumn_harrow1, true, a_farm, a_field);
236  break;
237  }
238  SimpleEvent_(g_date->Date() + 2, pl_wb_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_wb_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(10, 8)) {
250  d1 = g_date->OldDays() + g_date->DayInYear(10, 8);
251  }
252  if (a_farm->IsStockFarmer()) //Stock Farmer
253  {
254  SimpleEvent_(d1, pl_wb_ferti_s2, false, a_farm, a_field);
255  }
256  else SimpleEvent_(d1, pl_wb_ferti_p2, false, a_farm, a_field);
257  break;
259  if (!a_farm->StubbleHarrowing(a_field, 0.0, g_date->DayInYear(10, 9) - g_date->DayInYear())) {
260  SimpleEvent_(g_date->Date() + 1, pl_wb_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(10, 8)) {
265  d1 = g_date->OldDays() + g_date->DayInYear(10, 8);
266  }
267  if (a_farm->IsStockFarmer()) //Stock Farmer
268  {
269  SimpleEvent_(d1, pl_wb_ferti_s2, false, a_farm, a_field);
270  }
271  else SimpleEvent_(d1, pl_wb_ferti_p2, false, a_farm, a_field);
272  break;
273  case pl_wb_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_WB_FERTI_P1 == false))
277  {
278  if (!a_farm->FP_Slurry(a_field, 0.0, g_date->DayInYear(15, 9) - g_date->DayInYear())) {
279  SimpleEvent_(g_date->Date() + 1, pl_wb_ferti_p2, true, a_farm, a_field);
280  break;
281  }
282  }
283  SimpleEvent_(g_date->Date() + 1, pl_wb_autumn_plough, false, a_farm, a_field);
284  break;
285  case pl_wb_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_WB_FERTI_S1 == false))
289  {
290  if (!a_farm->FA_Slurry(a_field, 0.0, g_date->DayInYear(15, 9) - g_date->DayInYear())) {
291  SimpleEvent_(g_date->Date() + 1, pl_wb_ferti_s2, true, a_farm, a_field);
292  break;
293  }
294  }
295  SimpleEvent_(g_date->Date() + 1, pl_wb_autumn_plough, false, a_farm, a_field);
296  break;
297  case pl_wb_autumn_plough:
298  if (a_ev->m_lock || a_farm->DoIt(80))
299  {
300  if (!a_farm->AutumnPlough(a_field, 0.0, g_date->DayInYear(15, 9) - g_date->DayInYear())) {
301  SimpleEvent_(g_date->Date() + 1, pl_wb_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 5/9) it has to be rolling, else next fertilizer
307  d1 = g_date->OldDays() + g_date->DayInYear(5, 9);
308  if (g_date->Date() > d1)
309  {
310  SimpleEvent_(g_date->Date() + 1, pl_wb_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(5, 9), pl_wb_ferti_s3, false, a_farm, a_field);
318  }
319  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 9), pl_wb_ferti_p3, false, a_farm, a_field);
320  break;
321  }
322  }
323  }
324  SimpleEvent_(g_date->Date(), pl_wb_stubble_cultivator_heavy, false, a_farm, a_field);
325  break;
326  case pl_wb_autumn_roll:
327  if (!a_farm->AutumnRoll(a_field, 0.0, g_date->DayInYear(15, 9) - g_date->DayInYear())) {
328  SimpleEvent_(g_date->Date() + 1, pl_wb_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(5, 9), pl_wb_ferti_s3, false, a_farm, a_field);
334  }
335  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 9), pl_wb_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(15, 9) - g_date->DayInYear())) {
340  SimpleEvent_(g_date->Date() + 1, pl_wb_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(5, 9), pl_wb_ferti_s3, false, a_farm, a_field);
346  }
347  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 9), pl_wb_ferti_p3, false, a_farm, a_field);
348  break;
349  case pl_wb_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(18, 9) - g_date->DayInYear())) {
353  SimpleEvent_(g_date->Date() + 1, pl_wb_ferti_p3, true, a_farm, a_field);
354  break;
355  }
356  }
357  SimpleEvent_(g_date->Date() + 1, pl_wb_preseeding_cultivator, false, a_farm, a_field);
358  break;
359  case pl_wb_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(18, 9) - g_date->DayInYear())) {
363  SimpleEvent_(g_date->Date() + 1, pl_wb_ferti_s3, true, a_farm, a_field);
364  break;
365  }
366  }
367  SimpleEvent_(g_date->Date() + 1, pl_wb_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(19, 9) - g_date->DayInYear())) {
374  SimpleEvent_(g_date->Date() + 1, pl_wb_preseeding_cultivator, true, a_farm, a_field);
375  break;
376  }
377  SimpleEvent_(g_date->Date() + 1, pl_wb_autumn_sow, false, a_farm, a_field);
378  break;
379  }
380  SimpleEvent_(g_date->Date() + 1, pl_wb_preseeding_cultivator_sow, false, a_farm, a_field);
381  break;
382  case pl_wb_autumn_sow:
383  if (!a_farm->AutumnSow(a_field, 0.0, g_date->DayInYear(20, 9) - g_date->DayInYear())) {
384  SimpleEvent_(g_date->Date() + 1, pl_wb_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_wb_herbicide1, false, a_farm, a_field); // Herbidide thread
389  SimpleEvent_(g_date->Date() + 3, pl_wb_fungicide1, false, a_farm, a_field); // Fungicide thread
390  SimpleEvent_(g_date->Date() + 20, pl_wb_insecticide1, false, a_farm, a_field); // Insecticide thread
391  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(25, 3) + 365, pl_wb_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_wb_ferti_s4, false, a_farm, a_field);
395  }
396  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wb_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_wb_ferti_s5, false, a_farm, a_field);
400  }
401  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wb_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(25, 3) + 365, pl_wb_ferti_s8, false, a_farm, a_field);
405  }
406  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(25, 3) + 365, pl_wb_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(20, 9) - g_date->DayInYear())) {
411  SimpleEvent_(g_date->Date() + 1, pl_wb_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_wb_herbicide1, false, a_farm, a_field); // Herbidide thread
416  SimpleEvent_(g_date->Date() + 3, pl_wb_fungicide1, false, a_farm, a_field); // Fungicide thread
417  SimpleEvent_(g_date->Date() + 20, pl_wb_insecticide1, false, a_farm, a_field); // Insecticide thread
418  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(25, 3) + 365, pl_wb_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_wb_ferti_s4, false, a_farm, a_field);
422  }
423  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wb_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_wb_ferti_s5, false, a_farm, a_field);
427  }
428  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wb_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(25, 3) + 365, pl_wb_ferti_s8, false, a_farm, a_field);
432  }
433  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(25, 3) + 365, pl_wb_ferti_p8, false, a_farm, a_field);
434  break;
435  case pl_wb_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_wb_herbicide1, true, a_farm, a_field);
441  break;
442  }
443  }
444  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wb_herbicide2, false, a_farm, a_field);
445  break;
446  case pl_wb_herbicide2:
447  if (a_ev->m_lock || a_farm->DoIt(48))
448  {
449  if (!a_farm->HerbicideTreat(a_field, 0.0, g_date->DayInYear(31, 3) - g_date->DayInYear())) {
450  SimpleEvent_(g_date->Date() + 1, pl_wb_herbicide2, true, a_farm, a_field);
451  break;
452  }
453  }
454  // End of thread
455  break;
456  case pl_wb_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_wb_fungicide1, true, a_farm, a_field);
462  break;
463  }
464  }
465  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 4) + 365, pl_wb_fungicide2, false, a_farm, a_field);
466  break;
467  case pl_wb_fungicide2:
468  if (a_ev->m_lock || a_farm->DoIt(75))
469  {
470  if (!a_farm->FungicideTreat(a_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
471  SimpleEvent_(g_date->Date() + 1, pl_wb_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(1, 5)) {
477  d1 = g_date->OldDays() + g_date->DayInYear(1, 5);
478  }
479  SimpleEvent_(d1, pl_wb_fungicide3, false, a_farm, a_field);
480  break;
481  case pl_wb_fungicide3:
482  if (a_ev->m_lock || a_farm->DoIt(58))
483  {
484  if (!a_farm->FungicideTreat(a_field, 0.0, g_date->DayInYear(25, 5) - g_date->DayInYear())) {
485  SimpleEvent_(g_date->Date() + 1, pl_wb_fungicide3, true, a_farm, a_field);
486  break;
487  }
488  }
489  SimpleEvent_(g_date->Date() + 14, pl_wb_fungicide4, false, a_farm, a_field);
490  break;
491  case pl_wb_fungicide4:
492  if (a_ev->m_lock || a_farm->DoIt(28))
493  {
494  if (!a_farm->FungicideTreat(a_field, 0.0, g_date->DayInYear(10, 6) - g_date->DayInYear())) {
495  SimpleEvent_(g_date->Date() + 1, pl_wb_fungicide4, true, a_farm, a_field);
496  break;
497  }
498  }
499  // End of thread
500  break;
501  case pl_wb_insecticide1:
502  // Here comes the insecticide thread
503  if (a_ev->m_lock || a_farm->DoIt(15))
504  {
505  if (a_field->GetGreenBiomass() <= 0) {
506  SimpleEvent_(g_date->Date() + 1, pl_wb_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_winterbarley_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_wb_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(10, 4) + 365, pl_wb_insecticide2, false, a_farm, a_field);
523  break;
524  }
525  }
526  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(10, 4) + 365, pl_wb_insecticide2, false, a_farm, a_field);
527  break;
528  case pl_wb_insecticide2:
529  if (a_ev->m_lock || a_farm->DoIt(23))
530  {
531  // here we check wheter we are using ERA pesticide or not
532  if (!cfg_pest_winterbarley_on.value() ||
533  !g_landscape_p->SupplyShouldSpray()) // Not using pesticide spray
534  {
535  if (!a_farm->InsecticideTreat(a_field, 0.0, g_date->DayInYear(30, 5) - g_date->DayInYear())) {
536  SimpleEvent_(g_date->Date() + 1, pl_wb_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_wb_insecticide3, false, a_farm, a_field);
545  break;
546  case pl_wb_insecticide3:
547  if (a_ev->m_lock || a_farm->DoIt(23))
548  {
549  // here we check wheter we are using ERA pesticide or not
550  if (!cfg_pest_winterbarley_on.value() ||
551  !g_landscape_p->SupplyShouldSpray()) // Not using pesticide spray
552  {
553  if (!a_farm->InsecticideTreat(a_field, 0.0, g_date->DayInYear(15, 6) - g_date->DayInYear())) {
554  SimpleEvent_(g_date->Date() + 1, pl_wb_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(49))
567  {
568  if (!a_farm->GrowthRegulator(a_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
569  SimpleEvent_(g_date->Date() + 1, pl_wb_growth_regulator1, true, a_farm, a_field);
570  break;
571  }
572  else
573  {
574  //We need to remeber who did GR I
575  PL_WB_DECIDE_TO_GR = true;
576  }
577  }
578  SimpleEvent_(g_date->Date() + 7, pl_wb_growth_regulator2, false, a_farm, a_field);
579  break;
581  if (a_ev->m_lock || a_farm->DoIt(14*PL_WB_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_wb_growth_regulator2, true, a_farm, a_field);
585  break;
586  }
587  }
588  // End of thread
589  break;
590  case pl_wb_ferti_p4:
591  // Here comes the PK thread
592  if (a_ev->m_lock || a_farm->DoIt(28))
593  {
594  if (!a_farm->FP_PK(a_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
595  SimpleEvent_(g_date->Date() + 1, pl_wb_ferti_p4, true, a_farm, a_field);
596  break;
597  }
598  }
599  // End of thread
600  break;
601  case pl_wb_ferti_s4:
602  // Here comes the PK thread
603  if (a_ev->m_lock || a_farm->DoIt(28))
604  {
605  if (!a_farm->FA_PK(a_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
606  SimpleEvent_(g_date->Date() + 1, pl_wb_ferti_s4, true, a_farm, a_field);
607  break;
608  }
609  }
610  // End of thread
611  break;
612  case pl_wb_ferti_p5:
613  // Here comes the MAIN thread
614  if (a_ev->m_lock || a_farm->DoIt(95))
615  {
616  if (!a_farm->FP_AmmoniumSulphate(a_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
617  SimpleEvent_(g_date->Date() + 1, pl_wb_ferti_p5, true, a_farm, a_field);
618  break;
619  }
620  }
621  d1 = g_date->Date() + 10;
622  if (d1 < g_date->OldDays() + g_date->DayInYear(20, 3)) {
623  d1 = g_date->OldDays() + g_date->DayInYear(20, 3);
624  }
625  SimpleEvent_(d1, pl_wb_ferti_p6, false, a_farm, a_field);
626  break;
627  case pl_wb_ferti_s5:
628  if (a_ev->m_lock || a_farm->DoIt(95))
629  {
630  if (!a_farm->FA_AmmoniumSulphate(a_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
631  SimpleEvent_(g_date->Date() + 1, pl_wb_ferti_s5, true, a_farm, a_field);
632  break;
633  }
634  }
635  d1 = g_date->Date() + 10;
636  if (d1 < g_date->OldDays() + g_date->DayInYear(20, 3)) {
637  d1 = g_date->OldDays() + g_date->DayInYear(20, 3);
638  }
639  SimpleEvent_(d1, pl_wb_ferti_s6, false, a_farm, a_field);
640  break;
641  case pl_wb_ferti_p6:
642  if (a_ev->m_lock || a_farm->DoIt(93))
643  {
644  if (!a_farm->FP_AmmoniumSulphate(a_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
645  SimpleEvent_(g_date->Date() + 1, pl_wb_ferti_p6, true, a_farm, a_field);
646  break;
647  }
648  }
649  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(20, 5), pl_wb_ferti_p7, false, a_farm, a_field);
650  break;
651  case pl_wb_ferti_s6:
652  if (a_ev->m_lock || a_farm->DoIt(93))
653  {
654  if (!a_farm->FA_AmmoniumSulphate(a_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
655  SimpleEvent_(g_date->Date() + 1, pl_wb_ferti_s6, true, a_farm, a_field);
656  break;
657  }
658  }
659  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(20, 5), pl_wb_ferti_s7, false, a_farm, a_field);
660  break;
661  case pl_wb_ferti_p7:
662  if (a_ev->m_lock || a_farm->DoIt(43))
663  {
664  if (!a_farm->FP_AmmoniumSulphate(a_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
665  SimpleEvent_(g_date->Date() + 1, pl_wb_ferti_p7, true, a_farm, a_field);
666  break;
667  }
668  }
669  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 7), pl_wb_harvest, false, a_farm, a_field);
670  break;
671  case pl_wb_ferti_s7:
672  if (a_ev->m_lock || a_farm->DoIt(43))
673  {
674  if (!a_farm->FA_AmmoniumSulphate(a_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
675  SimpleEvent_(g_date->Date() + 1, pl_wb_ferti_s7, true, a_farm, a_field);
676  break;
677  }
678  }
679  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 7), pl_wb_harvest, false, a_farm, a_field);
680  break;
681  case pl_wb_ferti_p8:
682  // Here comes the mickroelements thread
683  if (a_ev->m_lock || a_farm->DoIt(28))
684  {
685  if (!a_farm->FP_ManganeseSulphate(a_field, 0.0, g_date->DayInYear(10, 4) - g_date->DayInYear())) {
686  SimpleEvent_(g_date->Date() + 1, pl_wb_ferti_p8, true, a_farm, a_field);
687  break;
688  }
689  }
690  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(25, 4), pl_wb_ferti_p9, false, a_farm, a_field);
691  break;
692  case pl_wb_ferti_s8:
693  if (a_ev->m_lock || a_farm->DoIt(28))
694  {
695  if (!a_farm->FA_ManganeseSulphate(a_field, 0.0, g_date->DayInYear(10, 4) - g_date->DayInYear())) {
696  SimpleEvent_(g_date->Date() + 1, pl_wb_ferti_s8, true, a_farm, a_field);
697  break;
698  }
699  }
700  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(25, 4), pl_wb_ferti_s9, false, a_farm, a_field);
701  break;
702  case pl_wb_ferti_p9:
703  if (a_ev->m_lock || a_farm->DoIt(5))
704  {
705  if (!a_farm->FP_ManganeseSulphate(a_field, 0.0, g_date->DayInYear(10, 5) - g_date->DayInYear())) {
706  SimpleEvent_(g_date->Date() + 1, pl_wb_ferti_p9, true, a_farm, a_field);
707  break;
708  }
709  }
710  // End of thread
711  break;
712  case pl_wb_ferti_s9:
713  if (a_ev->m_lock || a_farm->DoIt(5))
714  {
715  if (!a_farm->FA_ManganeseSulphate(a_field, 0.0, g_date->DayInYear(10, 5) - g_date->DayInYear())) {
716  SimpleEvent_(g_date->Date() + 1, pl_wb_ferti_s9, true, a_farm, a_field);
717  break;
718  }
719  }
720  // End of thread
721  break;
722  case pl_wb_harvest:
723  // Here the MAIN thread continues
724  // We don't move harvest days
725  if (!a_farm->Harvest(a_field, 0.0, a_field->GetMDates(0, 0) - g_date->DayInYear())) {
726  SimpleEvent_(g_date->Date() + 1, pl_wb_harvest, true, a_farm, a_field);
727  break;
728  }
729  SimpleEvent_(g_date->Date() + 1, pl_wb_straw_chopping, false, a_farm, a_field);
730  break;
731 
732 
734  if (a_farm->IsStockFarmer()) //Stock Farmer
735  {
736  // 10% of stock farmers will do straw chopping, but rest will do hay bailing instead
737  if (a_ev->m_lock || a_farm->DoIt(10))
738  {
739  if (a_field->GetMConstants(0) == 0) {
740  if (!a_farm->StrawChopping(a_field, 0.0, -1)) { // raise an error
741  g_msg->Warn(WARN_BUG, "PLWinterBarley::Do(): failure in 'StrawChopping' execution", "");
742  exit(1);
743  }
744  }
745  else {
746  if (!a_farm->StrawChopping(a_field, 0.0, a_field->GetMDates(1, 0) - g_date->DayInYear())) {
747  SimpleEvent_(g_date->Date() + 1, pl_wb_straw_chopping, true, a_farm, a_field);
748  break;
749  }
750  else
751  {
752  // Queue up the next event
753  SimpleEvent_(g_date->Date(), pl_wb_ferti_s10, false, a_farm, a_field);
754  break;
755  }
756  }
757 
758  }
759  SimpleEvent_(g_date->Date() + 1, pl_wb_hay_bailing, false, a_farm, a_field);
760  break;
761  }
762  else
763  {
764  // 90% of arable farmers will do straw chopping, but rest will do hay bailing instead
765  if (a_ev->m_lock || a_farm->DoIt(90))
766  {
767  if (a_field->GetMConstants(0) == 0) {
768  if (!a_farm->StrawChopping(a_field, 0.0, -1)) { // raise an error
769  g_msg->Warn(WARN_BUG, "PLWinterBarley::Do(): failure in 'StrawChopping' execution", "");
770  exit(1);
771  }
772  }
773  else {
774  if (!a_farm->StrawChopping(a_field, 0.0, a_field->GetMDates(1, 0) - g_date->DayInYear())) {
775  SimpleEvent_(g_date->Date() + 1, pl_wb_straw_chopping, true, a_farm, a_field);
776  break;
777  }
778  else
779  {
780  // Queue up the next event
781  SimpleEvent_(g_date->Date(), pl_wb_ferti_p10, false, a_farm, a_field);
782  break;
783  }
784  }
785 
786  }
787  SimpleEvent_(g_date->Date() + 1, pl_wb_hay_bailing, false, a_farm, a_field);
788  break;
789  }
790  case pl_wb_hay_bailing:
791  if (a_field->GetMConstants(1) == 0) {
792  if (!a_farm->HayBailing(a_field, 0.0, -1)) { // raise an error
793  g_msg->Warn(WARN_BUG, "PLWinterBarley::Do(): failure in 'HayBailing' execution", "");
794  exit(1);
795  }
796  }
797  else {
798  if (!a_farm->HayBailing(a_field, 0.0, a_field->GetMDates(1, 1) - g_date->DayInYear())) {
799  SimpleEvent_(g_date->Date() + 1, pl_wb_hay_bailing, true, a_farm, a_field);
800  break;
801  }
802  }
803  if (a_farm->IsStockFarmer()) //Stock Farmer
804  {
805  SimpleEvent_(g_date->Date(), pl_wb_ferti_s11, false, a_farm, a_field);
806  }
807  else SimpleEvent_(g_date->Date(), pl_wb_ferti_p11, false, a_farm, a_field);
808  break;
809  case pl_wb_ferti_p10:
810  if (a_ev->m_lock || a_farm->DoIt(12))
811  {
812  if (a_field->GetMConstants(2) == 0) {
813  if (!a_farm->FP_RSM(a_field, 0.0, -1)) { // raise an error
814  g_msg->Warn(WARN_BUG, "PLWinterBarley::Do(): failure in 'FP_RSM' execution", "");
815  exit(1);
816  }
817  }
818  else {
819  if (!a_farm->FP_RSM(a_field, 0.0, a_field->GetMDates(1, 2) - g_date->DayInYear())) {
820  SimpleEvent_(g_date->Date() + 1, pl_wb_ferti_p10, true, a_farm, a_field);
821  break;
822  }
823  }
824  }
825  if (a_farm->IsStockFarmer()) //Stock Farmer
826  {
827  SimpleEvent_(g_date->Date(), pl_wb_ferti_s11, false, a_farm, a_field);
828  }
829  else SimpleEvent_(g_date->Date(), pl_wb_ferti_p11, false, a_farm, a_field);
830  break;
831  case pl_wb_ferti_s10:
832  if (a_ev->m_lock || a_farm->DoIt(12))
833  {
834  if (a_field->GetMConstants(2) == 0) {
835  if (!a_farm->FA_RSM(a_field, 0.0, -1)) { // raise an error
836  g_msg->Warn(WARN_BUG, "PLWinterBarley::Do(): failure in 'FA_RSM' execution", "");
837  exit(1);
838  }
839  }
840  else {
841  if (!a_farm->FA_RSM(a_field, 0.0, a_field->GetMDates(1, 2) - g_date->DayInYear())) {
842  SimpleEvent_(g_date->Date() + 1, pl_wb_ferti_s10, true, a_farm, a_field);
843  break;
844  }
845  }
846  }
847  if (a_farm->IsStockFarmer()) //Stock Farmer
848  {
849  SimpleEvent_(g_date->Date(), pl_wb_ferti_s11, false, a_farm, a_field);
850  }
851  else SimpleEvent_(g_date->Date(), pl_wb_ferti_p11, false, a_farm, a_field);
852  break;
853  case pl_wb_ferti_p11:
854  if (a_ev->m_lock || a_farm->DoIt(22))
855  {
856  if (a_field->GetMConstants(3) == 0) {
857  if (!a_farm->FP_Calcium(a_field, 0.0, -1)) { // raise an error
858  g_msg->Warn(WARN_BUG, "PLWinterBarley::Do(): failure in 'FP_Calcium' execution", "");
859  exit(1);
860  }
861  }
862  else {
863  if (!a_farm->FP_Calcium(a_field, 0.0, a_field->GetMDates(1, 3) - g_date->DayInYear())) {
864  SimpleEvent_(g_date->Date() + 1, pl_wb_ferti_p11, true, a_farm, a_field);
865  break;
866  }
867  }
868  }
869  done = true;
870  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
871  // END of MAIN THREAD
872  break;
873  case pl_wb_ferti_s11:
874  if (a_ev->m_lock || a_farm->DoIt(22))
875  {
876  if (a_field->GetMConstants(3) == 0) {
877  if (!a_farm->FA_Calcium(a_field, 0.0, -1)) { // raise an error
878  g_msg->Warn(WARN_BUG, "PLWinterBarley::Do(): failure in 'FA_Calcium' execution", "");
879  exit(1);
880  }
881  }
882  else {
883  if (!a_farm->FA_Calcium(a_field, 0.0, a_field->GetMDates(1, 3) - g_date->DayInYear())) {
884  SimpleEvent_(g_date->Date() + 1, pl_wb_ferti_s11, true, a_farm, a_field);
885  break;
886  }
887  }
888  }
889  done = true;
890  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
891  // END of MAIN THREAD
892  break;
893  default:
894  g_msg->Warn(WARN_BUG, "PLWinterBarley::Do(): "
895  "Unknown event type! ", "");
896  exit(1);
897  }
898  return done;
899 }

References Landscape::BackTranslateVegTypes(), cfg_pest_product_1_amount, cfg_pest_winterbarley_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_wb_autumn_harrow1, pl_wb_autumn_harrow2, pl_wb_autumn_plough, pl_wb_autumn_roll, pl_wb_autumn_sow, PL_WB_DECIDE_TO_GR, PL_WB_FERTI_P1, pl_wb_ferti_p1, pl_wb_ferti_p10, pl_wb_ferti_p11, pl_wb_ferti_p2, pl_wb_ferti_p3, pl_wb_ferti_p4, pl_wb_ferti_p5, pl_wb_ferti_p6, pl_wb_ferti_p7, pl_wb_ferti_p8, pl_wb_ferti_p9, PL_WB_FERTI_S1, pl_wb_ferti_s1, pl_wb_ferti_s10, pl_wb_ferti_s11, pl_wb_ferti_s2, pl_wb_ferti_s3, pl_wb_ferti_s4, pl_wb_ferti_s5, pl_wb_ferti_s6, pl_wb_ferti_s7, pl_wb_ferti_s8, pl_wb_ferti_s9, pl_wb_fungicide1, pl_wb_fungicide2, pl_wb_fungicide3, pl_wb_fungicide4, pl_wb_growth_regulator1, pl_wb_growth_regulator2, pl_wb_harvest, pl_wb_hay_bailing, pl_wb_herbicide1, pl_wb_herbicide2, pl_wb_insecticide1, pl_wb_insecticide2, pl_wb_insecticide3, pl_wb_preseeding_cultivator, pl_wb_preseeding_cultivator_sow, pl_wb_start, pl_wb_straw_chopping, pl_wb_stubble_cultivator_heavy, pl_wb_stubble_harrow, PL_WB_STUBBLE_PLOUGH, pl_wb_stubble_plough, ppp_1, Crop::SimpleEvent_(), Landscape::SupplyShouldSpray(), and tof_OptimisingFarm.


The documentation for this class was generated from the following files:
pl_wb_insecticide2
Definition: PLWinterBarley.h:76
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: farm.h:905
pl_wb_ferti_p8
Definition: PLWinterBarley.h:68
FarmEvent::m_lock
bool m_lock
Definition: farm.h:465
pl_wb_autumn_plough
Definition: PLWinterBarley.h:49
Landscape::SupplyShouldSpray
bool SupplyShouldSpray()
Definition: Landscape.h:357
pl_wb_fungicide3
Definition: PLWinterBarley.h:74
Farm::DoIt
bool DoIt(double a_probability)
Return chance out of 0 to 100.
Definition: farm.cpp:800
pl_wb_herbicide2
Definition: PLWinterBarley.h:72
FarmEvent::m_first_year
bool m_first_year
Definition: farm.h:467
PL_WB_FERTI_P1
#define PL_WB_FERTI_P1
A flag used to indicate autumn ploughing status.
Definition: PLWinterBarley.h:28
tof_OptimisingFarm
Definition: farm.h:273
pl_wb_ferti_p5
Definition: PLWinterBarley.h:62
cfg_pest_product_1_amount
CfgFloat cfg_pest_product_1_amount
Landscape::BackTranslateVegTypes
int BackTranslateVegTypes(TTypesOfVegetation VegReference)
Definition: Landscape.h:1669
pl_wb_ferti_p3
Definition: PLWinterBarley.h:52
pl_wb_fungicide2
Definition: PLWinterBarley.h:73
pl_wb_stubble_harrow
Definition: PLWinterBarley.h:46
Farm::GetType
TTypesOfFarm GetType(void)
Definition: farm.h:901
Crop::m_first_date
int m_first_date
Definition: farm.h:540
FarmEvent::m_startday
int m_startday
Definition: farm.h:466
pl_wb_stubble_plough
Definition: PLWinterBarley.h:43
pl_wb_harvest
Definition: PLWinterBarley.h:80
pl_wb_preseeding_cultivator
Definition: PLWinterBarley.h:54
pl_wb_ferti_s2
Definition: PLWinterBarley.h:48
pl_wb_start
Definition: PLWinterBarley.h:39
pl_wb_ferti_s11
Definition: PLWinterBarley.h:86
pl_wb_ferti_p11
Definition: PLWinterBarley.h:85
cfg_pest_winterbarley_on
CfgBool cfg_pest_winterbarley_on
pl_wb_ferti_s10
Definition: PLWinterBarley.h:84
pl_wb_autumn_sow
Definition: PLWinterBarley.h:56
pl_wb_ferti_s1
Definition: PLWinterBarley.h:42
pl_wb_ferti_p9
Definition: PLWinterBarley.h:70
pl_wb_ferti_p6
Definition: PLWinterBarley.h:64
pl_wb_ferti_s6
Definition: PLWinterBarley.h:65
pl_wb_ferti_p2
Definition: PLWinterBarley.h:47
pl_wb_growth_regulator1
Definition: PLWinterBarley.h:78
pl_wb_ferti_s4
Definition: PLWinterBarley.h:61
pl_wb_insecticide3
Definition: PLWinterBarley.h:77
pl_wb_ferti_s7
Definition: PLWinterBarley.h:67
FarmEvent::m_next_tov
TTypesOfVegetation m_next_tov
Definition: farm.h:471
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
pl_wb_ferti_s3
Definition: PLWinterBarley.h:53
pl_wb_hay_bailing
Definition: PLWinterBarley.h:82
ppp_1
Definition: farm.h:422
PL_WB_FERTI_S1
#define PL_WB_FERTI_S1
Definition: PLWinterBarley.h:29
pl_wb_preseeding_cultivator_sow
Definition: PLWinterBarley.h:55
PL_WB_DECIDE_TO_GR
#define PL_WB_DECIDE_TO_GR
Definition: PLWinterBarley.h:31
pl_wb_ferti_p7
Definition: PLWinterBarley.h:66
pl_wb_ferti_s8
Definition: PLWinterBarley.h:69
pl_wb_ferti_s5
Definition: PLWinterBarley.h:63
pl_wb_fungicide1
Definition: PLWinterBarley.h:58
pl_wb_ferti_p1
Definition: PLWinterBarley.h:41
pl_wb_fungicide4
Definition: PLWinterBarley.h:75
pl_wb_stubble_cultivator_heavy
Definition: PLWinterBarley.h:51
pl_wb_straw_chopping
Definition: PLWinterBarley.h:81
pl_wb_herbicide1
Definition: PLWinterBarley.h:57
pl_wb_insecticide1
Definition: PLWinterBarley.h:59
pl_wb_autumn_harrow1
Definition: PLWinterBarley.h:44
pl_wb_ferti_s9
Definition: PLWinterBarley.h:71
pl_wb_ferti_p10
Definition: PLWinterBarley.h:83
pl_wb_autumn_harrow2
Definition: PLWinterBarley.h:45
pl_wb_autumn_roll
Definition: PLWinterBarley.h:50
g_landscape_p
Landscape * g_landscape_p
Definition: Landscape.cpp:258
pl_wb_ferti_p4
Definition: PLWinterBarley.h:60
pl_wb_growth_regulator2
Definition: PLWinterBarley.h:79
PL_WB_STUBBLE_PLOUGH
#define PL_WB_STUBBLE_PLOUGH
Definition: PLWinterBarley.h:30
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