Loading [MathJax]/extensions/ams.js
ALMaSS  1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
PLWinterWheatLate Class Reference

PLWinterWheatLate class
. More...

#include <PLWinterWheatLate.h>

Inheritance diagram for PLWinterWheatLate:
Crop

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 (TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
 
void SetUpFarmCategoryInformation ()
 
- Public Member Functions inherited from Crop
virtual ~Crop ()
 
 Crop (TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
 
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)
 
void GetCropType (TTypesOfCrops a_toc)
 
TTypesOfCrops GetCropType ()
 
FarmManagementCategory LookUpManagementCategory (int a_todo)
 
bool GetForceSpringOK ()
 

Additional Inherited Members

- Public Attributes inherited from Crop
TTypesOfVegetation m_tov
 
- 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...
 
bool StartUpCrop (int a_spring, std::vector< std::vector< int >> a_flexdates, int a_todo)
 
Holds the translation between the farm operation enum for each cropand the farm management category associated with it More...
 
bool AphidDamage (LE *a_field)
 Compares aphid numbers per m2 with a threshold to return true if threshold is exceeded. More...
 
- Protected Attributes inherited from Crop
Farmm_farm
 
LEm_field
 
FarmEventm_ev
 
int m_first_date
 
int m_count
 
int m_last_date
 
int m_ddegstoharvest
 
int m_base_elements_no
 
Landscapem_OurLandscape
 
bool m_forcespringpossible = false
 Used to signal that the crop can be forced to start in spring. More...
 
TTypesOfCrops m_toc
 The Crop type in terms of the TTypesOfCrops list (smaller list than tov, no country designation) More...
 
int m_CropClassification
 Contains information on whether this is a winter crop, spring crop, or catch crop that straddles the year boundary (0,1,2) More...
 
vector< FarmManagementCategorym_ManagementCategories
 Holds the translation between the farm operation enum for each crop and the farm management category associated with it. More...
 
- Static Protected Attributes inherited from Crop
static int m_date_modifier = 0
 Holds a value that shifts test pesticide use by this many days in crops modified to use it. More...
 

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 ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
104  : Crop(a_tov, a_toc, a_L)
105  {
106  // When we start it off, the first possible date for a farm operation is 20th September
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( 31,10 );
111  }

References Calendar::DayInYear(), g_date, Crop::m_first_date, and SetUpFarmCategoryInformation().

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 m_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.

66 {
67  /******************** This block can be added to the top of all Crop::Do methods ***********************************************/
68  m_farm = a_farm; // These assignments are necessary, not for this method but for related event calls
69  m_field = a_field;
70  m_ev = a_ev;
71  bool done = false; // The boolean value done indicates when we are totally finished with this plan (i.e. it is set to true).
72  bool flag = false;
73  int d1 = 0;
74  int noDates = 1;
75  TTypesOfVegetation l_tov = tov_PLWinterWheatLate; // The current type - change to match the crop you have
76 /**********************************************To Here *************************************************************************/
77 
78  // Depending what event has occured jump to the correct bit of code
79  switch (m_ev->m_todo)
80  {
81  case pl_wwl_start:
82  {
83  // pl_wwl_start just sets up all the starting conditions and reference dates that are needed to start a pl_ww
84  PL_WWL_FERTI_P1 = false;
85  PL_WWL_FERTI_S1 = false;
86  PL_WWL_STUBBLE_PLOUGH = false;
87  PL_WWL_DECIDE_TO_GR = false;
88  a_field->ClearManagementActionSum();
89  // Set up the date management stuff
90  // The next bit of code just allows for altering dates after harvest if it is necessary
91  // to allow for a crop which starts its management early.
92 
93  // 5 start and stop dates for all 'movable' events for this crop
94  int noDates = 4;
95  m_field->SetMDates(0, 0, g_date->DayInYear(5, 8)); // last possible day of harvest
96  m_field->SetMDates(1, 0, g_date->DayInYear(10, 8)); // last possible day of starw chopping, equal to harvest in this case
97  m_field->SetMDates(0, 1, 0); // start day of hay bailing (not used as it depend on previous treatment)
98  m_field->SetMDates(1, 1, g_date->DayInYear(15, 8)); // end day of hay bailing
99  m_field->SetMDates(0, 2, 0); // start day of RSM
100  m_field->SetMDates(1, 2, g_date->DayInYear(25, 8)); // end day of RSM
101  m_field->SetMDates(0, 3, 0); // start day of calcium application
102  m_field->SetMDates(1, 3, g_date->DayInYear(25, 8)); // end day of calcium application
103  // Can be up to 10 of these. If the shortening code is triggered
104  // then these will be reduced in value to 0
105 
106  m_field->SetMConstants(0, 1);
107 
108  // Check the next crop for early start, unless it is a spring crop
109  // in which case we ASSUME that no checking is necessary!!!!
110  // So DO NOT implement a crop that runs over the year boundary (i.e. from spring to spring!), at least not without fixing this.
111 
112  //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)
113  //optimising farms not used for now so most of related code is removed (but not in 'start' case)
114  if (!(m_farm->GetType() == tof_OptimisingFarm && g_date->GetYearNumber() > 0)) {
115 
116  if (m_ev->m_startday > g_date->DayInYear(1, 7)) {
117  if (m_field->GetMDates(0, 0) >= m_ev->m_startday)
118  {
119  g_msg->Warn(WARN_BUG, "PLWinterWheatLate::Do(): ", "Harvest too late for the next crop to start!!!");
120  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
121  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
122  }
123  // Now fix any late finishing problems
124  for (int i = 0; i < noDates; i++) {
125  if (m_field->GetMDates(0, i) >= m_ev->m_startday) {
126  m_field->SetMDates(0, i, m_ev->m_startday - 1); //move the starting date
127  }
128  if (m_field->GetMDates(1, i) >= m_ev->m_startday) {
129  m_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)
130  m_field->SetMDates(1, i, m_ev->m_startday - 1); //move the finishing date
131  }
132  }
133  }
134  // Now no operations can be timed after the start of the next crop.
135 
136  if (!m_ev->m_first_year) {
137  // Are we before July 1st?
138  d1 = g_date->OldDays() + g_date->DayInYear(1, 7);
139  if (g_date->Date() < d1) {
140  // Yes, too early. We assumme this is because the last crop was late
141  printf("Poly: %d\n", m_field->GetPoly());
142  g_msg->Warn(WARN_BUG, "PLWinterWheatLate::Do(): ", "Crop start attempt between 1st Jan & 1st July");
143  int prev = m_field->GetLandscape()->BackTranslateVegTypes(m_field->GetOwner()->GetPreviousTov(m_field->GetRotIndex()));
144  g_msg->Warn(WARN_BUG, "Previous Crop ", prev);
145  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
146  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
147  }
148  else {
149  d1 = g_date->OldDays() + m_first_date; // Add 365 for spring crop
150  if (g_date->Date() > d1) {
151  // Yes too late - should not happen - raise an error
152  g_msg->Warn(WARN_BUG, "PLWinterWheatLate::Do(): ", "Crop start attempt after last possible start date");
153  g_msg->Warn(WARN_BUG, "Previous Crop ", "");
155  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
156  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
157  }
158  }
159  }
160  else {
161  // Is the first year
162  // Some special code to cope with that first start-up year in ALMaSS - ignore for all practical purposes
163  // Code for first spring treatment used
164  if (m_farm->IsStockFarmer()) //Stock Farmer
165  {
167  }
169  break;
170  }
171  }//if
172 
173  // End single block date checking code. Please see next line comment as well.
174  // Reinit d1 to first possible starting date.
175  d1 = g_date->OldDays() + g_date->DayInYear(20, 7);
176  // OK, let's go.
177  // Here we queue up the first event - this differs depending on whether we have a
178  // stock or arable farmer
179  if (m_farm->IsStockFarmer()) { // StockFarmer
181  }
182  else SimpleEvent_(d1, pl_wwl_ferti_p1, false, m_farm, m_field);
183  }
184  break;
185 
186  // This is the first real farm operation
187  case pl_wwl_ferti_p1:
188  // In total 10% of arable farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
189  // We therefore assume that half of them (5%) do it now
190  if (m_ev->m_lock || m_farm->DoIt(5))
191  {
192  if (!m_farm->FP_Slurry(m_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
193  // If we don't suceed on the first try, then try and try again (until 20/8 when we will suceed)
195  break;
196  }
197  else
198  {
199  //Rest of farmers do slurry before autumn plough/stubble cultivation so we need to remeber who already did it
200  PL_WWL_FERTI_P1 = true;
201  }
202  }
203  // Queue up the next event -in this case stubble ploughing
205  break;
206  case pl_wwl_ferti_s1:
207  // In total 80% of stock farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
208  // We therefore assume that half of them (40%) do it now
209  if (m_ev->m_lock || m_farm->DoIt(40))
210  {
211  if (!m_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
213  break;
214  }
215  else
216  {
217  //Rest of farmers do slurry before autumn plough/stubble cultivation so we need to remeber who already did it
218  PL_WWL_FERTI_S1 = true;
219  }
220  }
221  // Queue up the next event -in this case stubble ploughing
223  break;
225  // 50% will do stubble plough, but rest will get away with non-inversion cultivation
226  if (m_ev->m_lock || m_farm->DoIt(50))
227  {
228  if (!m_farm->StubblePlough(m_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
230  break;
231  }
232  else
233  {
234  // 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
235  PL_WWL_STUBBLE_PLOUGH = true;
236  // Queue up the next event
238  break;
239  }
240  }
242  break;
244  if (!m_farm->AutumnHarrow(m_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
246  break;
247  }
249  break;
251  if (m_ev->m_lock || m_farm->DoIt(40))
252  {
253  if (!m_farm->AutumnHarrow(m_field, 0.0, g_date->Date() + 7 - g_date->DayInYear())) {
255  break;
256  }
257  }
258  d1 = g_date->Date() + 1;
259  if (d1 < g_date->OldDays() + g_date->DayInYear(20, 8)) {
260  d1 = g_date->OldDays() + g_date->DayInYear(20, 8);
261  }
262  if (m_farm->IsStockFarmer()) //Stock Farmer
263  {
265  }
266  else SimpleEvent_(d1, pl_wwl_ferti_p2, false, m_farm, m_field);
267  break;
269  if (!m_farm->StubbleHarrowing(m_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
271  break;
272  }
273  d1 = g_date->Date() + 1;
274  if (d1 < g_date->OldDays() + g_date->DayInYear(20, 8)) {
275  d1 = g_date->OldDays() + g_date->DayInYear(20, 8);
276  }
277  if (m_farm->IsStockFarmer()) //Stock Farmer
278  {
280  }
281  else SimpleEvent_(d1, pl_wwl_ferti_p2, false, m_farm, m_field);
282  break;
283  case pl_wwl_ferti_p2:
284  // In total 10% of arable farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
285  // We therefore assume that half of them (5%) do it now (if haven't done before)
286  if ((m_ev->m_lock || m_farm->DoIt(static_cast<int>((5.0/95.0)*100)))&&(PL_WWL_FERTI_P1==false))
287  {
288  if (!m_farm->FP_Slurry(m_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
290  break;
291  }
292  }
294  break;
295  case pl_wwl_ferti_s2:
296  // In total 80% of stock farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
297  // We therefore assume that half of them (40%) do it now (if haven't done before)
298  if ((m_ev->m_lock || m_farm->DoIt(static_cast<int>((40.0/60.0)*100))) && (PL_WWL_FERTI_S1==false))
299  {
300  if (!m_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
302  break;
303  }
304  }
306  break;
308  if (m_ev->m_lock || m_farm->DoIt(80))
309  {
310  if (!m_farm->AutumnPlough(m_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
312  break;
313  }
314  else
315  {
316  // Queue up the next event and if it's late (after 15/9) it has to be rolling, else next fertilizer
317  d1 = g_date->OldDays() + g_date->DayInYear(15, 9);
318  if (g_date->Date() > d1)
319  {
321  break;
322  }
323  else
324  {
325  if (m_farm->IsStockFarmer()) //Stock Farmer
326  {
328  }
330  break;
331  }
332  }
333  }
335  break;
336  case pl_wwl_autumn_roll:
337  if (!m_farm->AutumnRoll(m_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
339  break;
340  }
341  if (m_farm->IsStockFarmer()) //Stock Farmer
342  {
344  }
346  break;
348  // the rest 20% who did not plough do heavy stubble cultivation
351  break;
352  }
353  if (m_farm->IsStockFarmer()) //Stock Farmer
354  {
356  }
358  break;
359  case pl_wwl_ferti_p3:
360  if (m_ev->m_lock || m_farm->DoIt(45))
361  {
362  if (!m_farm->FP_NPKS(m_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
364  break;
365  }
366  }
368  break;
369  case pl_wwl_ferti_s3:
370  if (m_ev->m_lock || m_farm->DoIt(45))
371  {
372  if (!m_farm->FA_NPKS(m_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
374  break;
375  }
376  }
378  break;
380  // 30% will do preseeding cultivation, the rest will do it together with sow
381  if (m_ev->m_lock || m_farm->DoIt(30))
382  {
383  if (!m_farm->PreseedingCultivator(m_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
385  break;
386  }
388  break;
389  }
391  break;
392  case pl_wwl_autumn_sow:
393  if (cfg_seedcoating_winterwheat_on.value() && a_field->GetLandscape()->SupplyShouldSpray()) {
394  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear(),
397  break;
398  }
399  }
400  else {
401  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
403  break;
404  }
405  }
406 
407  // Here is a fork leading to four parallel events
408  SimpleEvent_(g_date->Date() + 3, pl_wwl_herbicide1, false, m_farm, m_field); // Herbidide thread
409  SimpleEvent_(g_date->Date() + 3, pl_wwl_fungicide1, false, m_farm, m_field); // Fungicide thread
410  SimpleEvent_(g_date->Date() + 20 + m_date_modifier, pl_wwl_insecticide1, false, m_farm, m_field); // Insecticide thread
411  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 4) + 365, pl_wwl_growth_regulator1, false, m_farm, m_field); // GR thread
412  if (m_farm->IsStockFarmer()) //Stock Farmer // PK thread
413  {
415  }
416  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wwl_ferti_p4, false, m_farm, m_field);
417  if (m_farm->IsStockFarmer()) //Stock Farmer // Main thread
418  {
420  }
421  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wwl_ferti_p5, false, m_farm, m_field);
422  if (m_farm->IsStockFarmer()) //Stock Farmer // Microelemnts thread
423  {
425  }
426  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 4) + 365, pl_wwl_ferti_p8, false, m_farm, m_field);
427  break;
429  // 70% will do preseeding cultivation with sow
432  break;
433  }
434  // Here is a fork leading to four parallel events
435  SimpleEvent_(g_date->Date() + 3, pl_wwl_herbicide1, false, m_farm, m_field); // Herbidide thread
436  SimpleEvent_(g_date->Date() + 3, pl_wwl_fungicide1, false, m_farm, m_field); // Fungicide thread
437  SimpleEvent_(g_date->Date() + 20 + m_date_modifier, pl_wwl_insecticide1, false, m_farm, m_field); // Insecticide thread
438  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 4) + 365, pl_wwl_growth_regulator1, false, m_farm, m_field); // GR thread
439  if (m_farm->IsStockFarmer()) //Stock Farmer // PK thread
440  {
442  }
443  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wwl_ferti_p4, false, m_farm, m_field);
444  if (m_farm->IsStockFarmer()) //Stock Farmer // Main thread
445  {
447  }
448  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wwl_ferti_p5, false, m_farm, m_field);
449  if (m_farm->IsStockFarmer()) //Stock Farmer // Microelemnts thread
450  {
452  }
453  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 4) + 365, pl_wwl_ferti_p8, false, m_farm, m_field);
454  break;
455  case pl_wwl_herbicide1: // The first of the pesticide managements.
456  // Here comes the herbicide thread
457  if (m_ev->m_lock || m_farm->DoIt(80))
458  {
459  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
461  break;
462  }
463  }
465  break;
466  case pl_wwl_herbicide2:
467  if (m_ev->m_lock || m_farm->DoIt(73))
468  {
469  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(10, 4) - g_date->DayInYear())) {
471  break;
472  }
473  }
474  // End of thread
475  break;
476  case pl_wwl_fungicide1:
477  // Here comes the fungicide thread
478  if (m_ev->m_lock || m_farm->DoIt(5))
479  {
480  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
482  break;
483  }
484  }
486  break;
487  case pl_wwl_fungicide2:
488  if (m_ev->m_lock || m_farm->DoIt(80))
489  {
490  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
492  break;
493  }
494  }
495  d1 = g_date->Date() + 14;
496  if (d1 < g_date->OldDays() + g_date->DayInYear(10, 5)) {
497  d1 = g_date->OldDays() + g_date->DayInYear(10, 5);
498  }
500  break;
501  case pl_wwl_fungicide3:
502  if (m_ev->m_lock || m_farm->DoIt(68))
503  {
504  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(5, 6) - g_date->DayInYear())) {
506  break;
507  }
508  }
510  break;
511  case pl_wwl_fungicide4:
512  if (m_ev->m_lock || m_farm->DoIt(15))
513  {
514  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(20, 6) - g_date->DayInYear())) {
516  break;
517  }
518  }
519  // End of thread
520  break;
521  case pl_wwl_insecticide1:
522  // Here comes the insecticide thread
523 #ifdef ECOSTACK_BIOPESTICIDE
524  if (m_ev->m_lock || m_farm->DoIt(10))
525 #else
526  if (m_ev->m_lock || m_farm->DoIt(5))
527 #endif
528  {
529  if (m_field->GetGreenBiomass() <= 0) {
531  }
532  else
533  {
534  // here we check whether we are using ERA pesticide or not
535  d1 = g_date->DayInYear(15, 11) - g_date->DayInYear();
536  if (!cfg_pest_winterwheat_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
537  {
538 #ifdef ECOSTACK_BIOPESTICIDE
539  flag = m_farm->BiocideTreat(m_field, 0.0, d1);
540 #else
541  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
542 #endif
543  }
544  else {
546  }
547  if (!flag) {
549  break;
550  }
552  break;
553  }
554  }
556  break;
557  case pl_wwl_insecticide2:
558 #ifdef ECOSTACK_BIOPESTICIDE
559  if (m_ev->m_lock || m_farm->DoIt(74))
560 #else
561  if (m_ev->m_lock || m_farm->DoIt(74))
562 #endif
563  {
564  // here we check whether we are using ERA pesticide or not
565  d1 = g_date->DayInYear(10, 6) - g_date->DayInYear();
566  if (!cfg_pest_winterwheat_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
567  {
568 #ifdef ECOSTACK_BIOPESTICIDE
569  flag = m_farm->BiocideTreat(m_field, 0.0, d1);
570 #else
571  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
572 #endif
573  }
574  else {
576  }
577  if (!flag) {
579  break;
580  }
581 #ifdef ECOSTACK_BIOPESTICIDE
583  break;
584 #endif
585  }
587  break;
588 
589 #ifdef ECOSTACK_BIOPESTICIDE
591  if (m_ev->m_lock || m_farm->DoIt_prob(1.0)) {
592  // here we check whether we are using ERA pesticide or not
593  d1 = g_date->DayInYear(17, 6) - g_date->DayInYear();
594  flag = m_farm->BiocideTreat(m_field, 0.0, d1);
595  if (!flag) {
597  break;
598  }
599  }
600  break; // end of thread
601 #endif
602  case pl_wwl_insecticide3:
603 #ifdef ECOSTACK_BIOPESTICIDE
604  if (m_ev->m_lock || m_farm->DoIt(76))
605 #else
606  if (m_ev->m_lock || m_farm->DoIt(38))
607 #endif
608  {
609  // here we check whether we are using ERA pesticide or not
610  d1 = g_date->DayInYear(25, 6) - g_date->DayInYear();
611  if (!cfg_pest_winterwheat_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
612  {
613 #ifdef ECOSTACK_BIOPESTICIDE
614  flag = m_farm->BiocideTreat(m_field, 0.0, d1);
615 #else
616  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
617 #endif
618  }
619  else {
621  }
622  if (!flag) {
624  break;
625  }
626  }
627  // End of thread
628  break;
630  // Here comes the GR thread
631  if (m_ev->m_lock || m_farm->DoIt(68))
632  {
633  if (!m_farm->GrowthRegulator(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
635  break;
636  }
637  else
638  {
639  //We need to remeber who did GR I
640  PL_WWL_DECIDE_TO_GR = true;
641  }
642  }
644  break;
647  {
648  if (!m_farm->GrowthRegulator(m_field, 0.0, g_date->Date() + 21 - g_date->DayInYear())) {
650  break;
651  }
652  }
653  // End of thread
654  break;
655  case pl_wwl_ferti_p4:
656  // Here comes the PK thread
657  if (m_ev->m_lock || m_farm->DoIt(50))
658  {
659  if (!m_farm->FP_PK(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
661  break;
662  }
663  }
664  // End of thread
665  break;
666  case pl_wwl_ferti_s4:
667  // Here comes the PK thread
668  if (m_ev->m_lock || m_farm->DoIt(50))
669  {
670  if (!m_farm->FA_PK(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
672  break;
673  }
674  }
675  // End of thread
676  break;
677  case pl_wwl_ferti_p5:
678  // Here comes the MAIN thread
679  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
681  break;
682  }
683  d1 = g_date->Date() + 10;
684  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 4)) {
685  d1 = g_date->OldDays() + g_date->DayInYear(1, 4);
686  }
688  break;
689  case pl_wwl_ferti_s5:
690  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
692  break;
693  }
694  d1 = g_date->Date() + 10;
695  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 4)) {
696  d1 = g_date->OldDays() + g_date->DayInYear(1, 4);
697  }
699  break;
700  case pl_wwl_ferti_p6:
701  if (m_ev->m_lock || m_farm->DoIt(95))
702  {
703  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
705  break;
706  }
707  }
709  break;
710  case pl_wwl_ferti_s6:
711  if (m_ev->m_lock || m_farm->DoIt(95))
712  {
713  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
715  break;
716  }
717  }
719  break;
720  case pl_wwl_ferti_p7:
721  if (m_ev->m_lock || m_farm->DoIt(40))
722  {
723  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(10, 6) - g_date->DayInYear())) {
725  break;
726  }
727  }
729  break;
730  case pl_wwl_ferti_s7:
731  if (m_ev->m_lock || m_farm->DoIt(40))
732  {
733  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(10, 6) - g_date->DayInYear())) {
735  break;
736  }
737  }
739  break;
740  case pl_wwl_ferti_p8:
741  // Here comes the mickroelements thread
742  if (m_ev->m_lock || m_farm->DoIt(63))
743  {
744  if (!m_farm->FP_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
746  break;
747  }
748  }
750  break;
751  case pl_wwl_ferti_s8:
752  if (m_ev->m_lock || m_farm->DoIt(63))
753  {
754  if (!m_farm->FA_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
756  break;
757  }
758  }
760  break;
761  case pl_wwl_ferti_p9:
762  if (m_ev->m_lock || m_farm->DoIt(8))
763  {
764  if (!m_farm->FP_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear())) {
766  break;
767  }
768  }
769  // End of thread
770  break;
771  case pl_wwl_ferti_s9:
772  if (m_ev->m_lock || m_farm->DoIt(8))
773  {
774  if (!m_farm->FA_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear())) {
776  break;
777  }
778  }
779  // End of thread
780  break;
781  case pl_wwl_harvest:
782  // Here the MAIN thread continues
783  // We don't move harvest days
784  if (!m_farm->Harvest(m_field, 0.0, m_field->GetMDates(0, 0) - g_date->DayInYear())) {
786  break;
787  }
789  break;
790 
791 
793  if (m_farm->IsStockFarmer()) //Stock Farmer
794  {
795  // 10% of stock farmers will do straw chopping, but rest will do hay bailing instead
796  if (m_ev->m_lock || m_farm->DoIt(10))
797  {
798  if (m_field->GetMConstants(0) == 0) {
799  if (!m_farm->StrawChopping(m_field, 0.0, -1)) { // raise an error
800  g_msg->Warn(WARN_BUG, "PLWinterWheatLate::Do(): failure in 'StrawChopping' execution", "");
801  exit(1);
802  }
803  }
804  else {
805  if (!m_farm->StrawChopping(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
807  break;
808  }
809  else
810  {
811  // Queue up the next event
813  break;
814  }
815  }
816 
817  }
819  break;
820  }
821  else
822  {
823  // 90% of arable farmers will do straw chopping, but rest will do hay bailing instead
824  if (m_ev->m_lock || m_farm->DoIt(90))
825  {
826  if (m_field->GetMConstants(0) == 0) {
827  if (!m_farm->StrawChopping(m_field, 0.0, -1)) { // raise an error
828  g_msg->Warn(WARN_BUG, "PLWinterWheatLate::Do(): failure in 'StrawChopping' execution", "");
829  exit(1);
830  }
831  }
832  else {
833  if (!m_farm->StrawChopping(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
835  break;
836  }
837  else
838  {
839  // Queue up the next event
841  break;
842  }
843  }
844 
845  }
847  break;
848  }
849  case pl_wwl_hay_bailing:
850  if (m_field->GetMConstants(1) == 0) {
851  if (!m_farm->HayBailing(m_field, 0.0, -1)) { // raise an error
852  g_msg->Warn(WARN_BUG, "PLWinterWheatLate::Do(): failure in 'HayBailing' execution", "");
853  exit(1);
854  }
855  }
856  else {
857  if (!m_farm->HayBailing(m_field, 0.0, m_field->GetMDates(1,1) - g_date->DayInYear())) {
859  break;
860  }
861  }
862  if (m_farm->IsStockFarmer()) //Stock Farmer
863  {
865  }
867  break;
868  case pl_wwl_ferti_p10:
869  if (m_ev->m_lock || m_farm->DoIt(18))
870  {
871  if (m_field->GetMConstants(2) == 0) {
872  if (!m_farm->FP_RSM(m_field, 0.0, -1)) { // raise an error
873  g_msg->Warn(WARN_BUG, "PLWinterWheatLate::Do(): failure in 'FP_RSM' execution", "");
874  exit(1);
875  }
876  }
877  else {
878  if (!m_farm->FP_RSM(m_field, 0.0, m_field->GetMDates(1,2) - g_date->DayInYear())) {
880  break;
881  }
882  }
883  }
884  if (m_farm->IsStockFarmer()) //Stock Farmer
885  {
887  }
889  break;
890  case pl_wwl_ferti_s10:
891  if (m_ev->m_lock || m_farm->DoIt(18))
892  {
893  if (m_field->GetMConstants(2) == 0) {
894  if (!m_farm->FA_RSM(m_field, 0.0, -1)) { // raise an error
895  g_msg->Warn(WARN_BUG, "PLWinterWheatLate::Do(): failure in 'FA_RSM' execution", "");
896  exit(1);
897  }
898  }
899  else {
900  if (!m_farm->FA_RSM(m_field, 0.0, m_field->GetMDates(1, 2) - g_date->DayInYear())) {
902  break;
903  }
904  }
905  }
906  if (m_farm->IsStockFarmer()) //Stock Farmer
907  {
909  }
911  break;
912  case pl_wwl_ferti_p11:
913  if (m_ev->m_lock || m_farm->DoIt(23))
914  {
915  if (m_field->GetMConstants(3) == 0) {
916  if (!m_farm->FP_Calcium(m_field, 0.0, -1)) { // raise an error
917  g_msg->Warn(WARN_BUG, "PLWinterWheatLate::Do(): failure in 'FP_Calcium' execution", "");
918  exit(1);
919  }
920  }
921  else {
922  if (!m_farm->FP_Calcium(m_field, 0.0, m_field->GetMDates(1,3) - g_date->DayInYear())) {
924  break;
925  }
926  }
927  }
928  done = true;
929  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
930  // END of MAIN THREAD
931  break;
932  case pl_wwl_ferti_s11:
933  if (m_ev->m_lock || m_farm->DoIt(23))
934  {
935  if (m_field->GetMConstants(3) == 0) {
936  if (!m_farm->FA_Calcium(m_field, 0.0, -1)) { // raise an error
937  g_msg->Warn(WARN_BUG, "PLWinterWheatLate::Do(): failure in 'FA_Calcium' execution", "");
938  exit(1);
939  }
940  }
941  else {
942  if (!m_farm->FA_Calcium(m_field, 0.0, m_field->GetMDates(1, 3) - g_date->DayInYear())) {
944  break;
945  }
946  }
947  }
948  done = true;
949  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
950  // END of MAIN THREAD
951  break;
952  default:
953  g_msg->Warn(WARN_BUG, "PLWinterWheatLate::Do(): "
954  "Unknown event type! ", "");
955  exit(1);
956  }
957  return done;
958 }

References Farm::AutumnHarrow(), Farm::AutumnPlough(), Farm::AutumnRoll(), Farm::AutumnSow(), Farm::BiocideTreat(), cfg_pest_product_amounts, cfg_pest_winterwheat_on, cfg_seedcoating_product_amounts, cfg_seedcoating_winterwheat_on, LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), Farm::DoIt(), Farm::DoIt_prob(), Farm::FA_AmmoniumSulphate(), Farm::FA_Calcium(), Farm::FA_ManganeseSulphate(), Farm::FA_NPKS(), Farm::FA_PK(), Farm::FA_RSM(), Farm::FA_Slurry(), Farm::FP_AmmoniumSulphate(), Farm::FP_Calcium(), Farm::FP_ManganeseSulphate(), Farm::FP_NPKS(), Farm::FP_PK(), Farm::FP_RSM(), Farm::FP_Slurry(), Farm::FungicideTreat(), g_date, g_msg, LE::GetGreenBiomass(), LE::GetMConstants(), LE::GetMDates(), LE::GetOwner(), LE::GetPoly(), Farm::GetPreviousTov(), LE::GetRotIndex(), Farm::GetType(), Calendar::GetYearNumber(), Farm::GrowthRegulator(), Farm::Harvest(), Farm::HayBailing(), Farm::HerbicideTreat(), Farm::InsecticideTreat(), Farm::IsStockFarmer(), Crop::m_date_modifier, Crop::m_ev, Crop::m_farm, Crop::m_field, Crop::m_first_date, FarmEvent::m_first_year, FarmEvent::m_lock, FarmEvent::m_next_tov, FarmEvent::m_startday, FarmEvent::m_todo, Calendar::OldDays(), 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_insecticide2b, 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, Farm::PreseedingCultivator(), Farm::PreseedingCultivatorSow(), Farm::ProductApplication(), LE::SetMConstants(), LE::SetMDates(), Crop::SimpleEvent(), Crop::SimpleEvent_(), Farm::StrawChopping(), Farm::StubbleCultivatorHeavy(), Farm::StubbleHarrowing(), Farm::StubblePlough(), tof_OptimisingFarm, tov_PLWinterWheatLate, CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), and WARN_BUG.

◆ SetUpFarmCategoryInformation()

void PLWinterWheatLate::SetUpFarmCategoryInformation ( )
inline
112  {
113  const int elements = 2 + (pl_wwl_foobar - PLWINTERWHEATLATE_BASE);
115 
116  FarmManagementCategory catlist[elements] =
117  {
118  fmc_Others, // zero element unused but must be here
119  fmc_Others,//pl_wwl_start = 1, // Compulsory, must always be 1 (one).
120  fmc_Others,//pl_wwl_sleep_all_day = PLWINTERWHEATLATE_BASE,
121  fmc_Fertilizer,//pl_wwl_ferti_p1, // 21501
122  fmc_Fertilizer,//pl_wwl_ferti_s1,
123  fmc_Cultivation,//pl_wwl_stubble_plough,
124  fmc_Cultivation,//pl_wwl_autumn_harrow1,
125  fmc_Cultivation,//pl_wwl_autumn_harrow2,
126  fmc_Cultivation,//pl_wwl_stubble_harrow,
127  fmc_Fertilizer,//pl_wwl_ferti_p2,
128  fmc_Fertilizer,//pl_wwl_ferti_s2,
129  fmc_Cultivation,//pl_wwl_autumn_plough,
130  fmc_Others,//pl_wwl_autumn_roll, // 21510
131  fmc_Cultivation,//pl_wwl_stubble_cultivator_heavy,
132  fmc_Fertilizer,//pl_wwl_ferti_p3,
133  fmc_Fertilizer,//pl_wwl_ferti_s3,
134  fmc_Cultivation,//pl_wwl_preseeding_cultivator,
135  fmc_Cultivation,//pl_wwl_preseeding_cultivator_sow,
136  fmc_Others,//pl_wwl_autumn_sow, // 21516
137  fmc_Herbicide,//pl_wwl_herbicide1,
138  fmc_Fungicide,//pl_wwl_fungicide1,
139  fmc_Insecticide,//pl_wwl_insecticide1,
140  fmc_Fertilizer,//pl_wwl_ferti_p4, // 21520
141  fmc_Fertilizer,//pl_wwl_ferti_s4,
142  fmc_Fertilizer,//pl_wwl_ferti_p5,
143  fmc_Fertilizer,//pl_wwl_ferti_s5,
144  fmc_Fertilizer,//pl_wwl_ferti_p6,
145  fmc_Fertilizer,//pl_wwl_ferti_s6,
146  fmc_Fertilizer,//pl_wwl_ferti_p7,
147  fmc_Fertilizer,//pl_wwl_ferti_s7,
148  fmc_Fertilizer,//pl_wwl_ferti_p8,
149  fmc_Fertilizer,//pl_wwl_ferti_s8,
150  fmc_Fertilizer,//pl_wwl_ferti_p9, // 21530
151  fmc_Fertilizer,//pl_wwl_ferti_s9,
152  fmc_Herbicide,//pl_wwl_herbicide2,
153  fmc_Fungicide,//pl_wwl_fungicide2,
154  fmc_Fungicide,//pl_wwl_fungicide3,
155  fmc_Fungicide,//pl_wwl_fungicide4,
156  fmc_Insecticide,//pl_wwl_insecticide2,
157  fmc_Insecticide,//pl_wwl_insecticide3,
158  fmc_Others,//pl_wwl_growth_regulator1,
159  fmc_Others,//pl_wwl_growth_regulator2,
160  fmc_Harvest,//pl_wwl_harvest, // 21540
161  fmc_Others,//pl_wwl_straw_chopping,
162  fmc_Others,//pl_wwl_hay_bailing,
163  fmc_Fertilizer,//pl_wwl_ferti_p10,
164  fmc_Fertilizer,//pl_wwl_ferti_s10,
165  fmc_Fertilizer,//pl_wwl_ferti_p11,
166  fmc_Fertilizer//pl_wwl_ferti_s11, // 21546
167  };
168  // Iterate over the catlist elements and copy them to vector
169  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
170 
171  }

References fmc_Cultivation, fmc_Fertilizer, fmc_Fungicide, fmc_Harvest, fmc_Herbicide, fmc_Insecticide, fmc_Others, Crop::m_base_elements_no, Crop::m_ManagementCategories, pl_wwl_foobar, and PLWINTERWHEATLATE_BASE.

Referenced by PLWinterWheatLate().


The documentation for this class was generated from the following files:
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
Farm::FA_Slurry
virtual bool FA_Slurry(LE *a_field, double a_user, int a_days)
Spready slurry on a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1067
pl_wwl_ferti_s9
Definition: PLWinterWheatLate.h:71
pl_wwl_start
Definition: PLWinterWheatLate.h:39
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
pl_wwl_preseeding_cultivator_sow
Definition: PLWinterWheatLate.h:55
Farm::PreseedingCultivator
virtual bool PreseedingCultivator(LE *a_field, double a_user, int a_days)
Carry out preseeding cultivation on a_field (tilling set including cultivator and string roller to co...
Definition: FarmFuncs.cpp:312
LE::SetMDates
void SetMDates(int a, int b, int c)
Definition: Elements.h:406
Farm::HerbicideTreat
virtual bool HerbicideTreat(LE *a_field, double a_user, int a_days)
Apply herbicide to a_field.
Definition: FarmFuncs.cpp:2025
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
Farm::Harvest
virtual bool Harvest(LE *a_field, double a_user, int a_days)
Carry out a harvest on a_field.
Definition: FarmFuncs.cpp:1364
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
Farm::FP_ManganeseSulphate
virtual bool FP_ManganeseSulphate(LE *a_field, double a_user, int a_days)
Apply Manganse Sulphate to a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:840
Farm::ProductApplication
virtual bool ProductApplication(LE *a_field, double a_user, int a_days, double a_applicationrate, PlantProtectionProducts a_ppp, bool a_isgranularpesticide=false, int a_orcharddrifttype=0)
Apply test pesticide to a_field.
Definition: FarmFuncs.cpp:2267
Farm::StubbleCultivatorHeavy
virtual bool StubbleCultivatorHeavy(LE *a_field, double a_user, int a_days)
Carry out a stubble cultivation event on a_field. This is non-inversion type of cultivation which can...
Definition: FarmFuncs.cpp:245
cfg_seedcoating_winterwheat_on
CfgBool cfg_seedcoating_winterwheat_on
Turn on seed coating for winter wheat.
LE::GetMConstants
int GetMConstants(int a)
Definition: Elements.h:407
LE::ClearManagementActionSum
void ClearManagementActionSum()
clears the management action counters
Definition: Elements.h:247
Farm::DoIt
bool DoIt(double a_probability)
Return chance out of 0 to 100.
Definition: Farm.cpp:856
Calendar::GetYearNumber
int GetYearNumber(void)
Definition: Calendar.h:72
pl_wwl_herbicide1
Definition: PLWinterWheatLate.h:57
cfg_pest_winterwheat_on
CfgBool cfg_pest_winterwheat_on
Turn on pesticides for winter wheat.
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
pl_wwl_ferti_p11
Definition: PLWinterWheatLate.h:86
Farm::StubblePlough
virtual bool StubblePlough(LE *a_field, double a_user, int a_days)
Carry out a stubble ploughing event on a_field. This is similar to normal plough but shallow (normall...
Definition: FarmFuncs.cpp:232
LE::GetPoly
int GetPoly(void)
Returns the polyref number for this polygon.
Definition: Elements.h:238
PLWinterWheatLate::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: PLWinterWheatLate.h:112
pl_wwl_ferti_p4
Definition: PLWinterWheatLate.h:60
Farm::DoIt_prob
bool DoIt_prob(double a_probability)
Return chance out of 0 to 1.
Definition: Farm.cpp:864
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
Farm::GetPreviousTov
TTypesOfVegetation GetPreviousTov(int a_index)
Definition: Farm.h:966
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::FA_NPKS
virtual bool FA_NPKS(LE *a_field, double a_user, int a_days)
Apply NPKS fertilizer, on a_field owned by a stock farmer.
Definition: FarmFuncs.cpp:968
Farm::GetType
TTypesOfFarm GetType(void)
Definition: Farm.h:956
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
pl_wwl_stubble_cultivator_heavy
Definition: PLWinterWheatLate.h:51
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
FarmEvent::m_startday
int m_startday
Definition: Farm.h:385
pl_wwl_autumn_harrow1
Definition: PLWinterWheatLate.h:44
PLWINTERWHEATLATE_BASE
#define PLWINTERWHEATLATE_BASE
Definition: PLWinterWheatLate.h:24
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
pl_wwl_autumn_harrow2
Definition: PLWinterWheatLate.h:45
cfg_pest_product_amounts
CfgArray_Double cfg_pest_product_amounts
Amount of pesticide applied in grams of active substance per hectare for each of the 10 pesticides.
Farm::FP_PK
virtual bool FP_PK(LE *a_field, double a_user, int a_days)
Apply PK fertilizer, on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:673
Crop::SimpleEvent
void SimpleEvent(long a_date, int a_todo, bool a_lock)
Adds an event to this crop management.
Definition: Farm.cpp:747
pl_wwl_ferti_p8
Definition: PLWinterWheatLate.h:68
pl_wwl_straw_chopping
Definition: PLWinterWheatLate.h:82
CfgBool::value
bool value() const
Definition: Configurator.h:164
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
Farm::FA_RSM
virtual bool FA_RSM(LE *a_field, double a_user, int a_days)
RSM (ammonium nitrate solution) applied on a_field owned by a stock farmer.
Definition: FarmFuncs.cpp:1154
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
pl_wwl_insecticide2
Definition: PLWinterWheatLate.h:76
pl_wwl_ferti_p7
Definition: PLWinterWheatLate.h:66
cfg_seedcoating_product_amounts
CfgArray_Double cfg_seedcoating_product_amounts
Amount of seed coating pesticide applied in grams of active substance per hectare for each of the 10 ...
Calendar::Date
long Date(void)
Definition: Calendar.h:57
Farm::FP_AmmoniumSulphate
virtual bool FP_AmmoniumSulphate(LE *a_field, double a_user, int a_days)
Apply Ammonium Sulphate to a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:882
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
Farm::HayBailing
virtual bool HayBailing(LE *a_field, double a_user, int a_days)
Carry out hay bailing on a_field.
Definition: FarmFuncs.cpp:1507
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
Farm::FA_Calcium
virtual bool FA_Calcium(LE *a_field, double a_user, int a_days)
Calcium applied on a_field owned by a stock farmer.
Definition: FarmFuncs.cpp:1168
Farm::StrawChopping
virtual bool StrawChopping(LE *a_field, double a_user, int a_days)
Carry out straw chopping on a_field.
Definition: FarmFuncs.cpp:1475
pl_wwl_herbicide2
Definition: PLWinterWheatLate.h:72
Farm::FA_ManganeseSulphate
virtual bool FA_ManganeseSulphate(LE *a_field, double a_user, int a_days)
Apply manganese sulphate to a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1095
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
pl_wwl_stubble_harrow
Definition: PLWinterWheatLate.h:46
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
pl_wwl_fungicide3
Definition: PLWinterWheatLate.h:74
Farm::FP_Calcium
virtual bool FP_Calcium(LE *a_field, double a_user, int a_days)
Calcium applied on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:954
LE::GetRotIndex
int GetRotIndex(void)
Definition: Elements.h:373
pl_wwl_fungicide1
Definition: PLWinterWheatLate.h:58
FarmEvent::m_next_tov
TTypesOfVegetation m_next_tov
Definition: Farm.h:390
pl_wwl_ferti_s1
Definition: PLWinterWheatLate.h:42
pl_wwl_hay_bailing
Definition: PLWinterWheatLate.h:83
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
pl_wwl_insecticide3
Definition: PLWinterWheatLate.h:78
tov_PLWinterWheatLate
Definition: LandscapeFarmingEnums.h:247
Crop::m_ManagementCategories
vector< FarmManagementCategory > m_ManagementCategories
Holds the translation between the farm operation enum for each crop and the farm management category ...
Definition: Farm.h:530
CfgArray_Double::value
std::vector< double > value() const
Definition: Configurator.h:219
Farm::PreseedingCultivatorSow
virtual bool PreseedingCultivatorSow(LE *a_field, double a_user, int a_days, double a_seed_coating_amount=-1, PlantProtectionProducts a_ppp=ppp_foobar)
Carry out preseeding cultivation together with sow on a_field (tilling and sowing set including culti...
Definition: FarmFuncs.cpp:325
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
Farm::InsecticideTreat
virtual bool InsecticideTreat(LE *a_field, double a_user, int a_days)
Apply insecticide to a_field.
Definition: FarmFuncs.cpp:2135
pl_wwl_ferti_p6
Definition: PLWinterWheatLate.h:64
Farm::AutumnRoll
virtual bool AutumnRoll(LE *a_field, double a_user, int a_days)
Carry out a roll event in the autumn on a_field.
Definition: FarmFuncs.cpp:299
LE::GetGreenBiomass
virtual double GetGreenBiomass(void)
Definition: Elements.h:160
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:823
Farm::BiocideTreat
virtual bool BiocideTreat(LE *a_field, double a_user, int a_days)
Apply Biocide to a_field.
Definition: FarmFuncs.cpp:2175
pl_wwl_ferti_s11
Definition: PLWinterWheatLate.h:87
pl_wwl_growth_regulator2
Definition: PLWinterWheatLate.h:80
tof_OptimisingFarm
Definition: LandscapeFarmingEnums.h:696
pl_wwl_ferti_p1
Definition: PLWinterWheatLate.h:41
Farm::AutumnPlough
virtual bool AutumnPlough(LE *a_field, double a_user, int a_days)
Carry out a ploughing event in the autumn on a_field.
Definition: FarmFuncs.cpp:212
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
Farm::AutumnHarrow
virtual bool AutumnHarrow(LE *a_field, double a_user, int a_days)
Carry out a harrow event in the autumn on a_field.
Definition: FarmFuncs.cpp:285
Farm::FA_AmmoniumSulphate
virtual bool FA_AmmoniumSulphate(LE *a_field, double a_user, int a_days)
Apply ammonium sulphate to a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1081
pl_wwl_autumn_plough
Definition: PLWinterWheatLate.h:49
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
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
Crop::m_date_modifier
static int m_date_modifier
Holds a value that shifts test pesticide use by this many days in crops modified to use it.
Definition: Farm.h:514
pl_wwl_ferti_p10
Definition: PLWinterWheatLate.h:84
Farm::AutumnSow
virtual bool AutumnSow(LE *a_field, double a_user, int a_days, double a_seed_coating_amount=-1, PlantProtectionProducts a_ppp=ppp_foobar)
Carry out a sowing event in the autumn on a_field.
Definition: FarmFuncs.cpp:360
Farm::FP_RSM
virtual bool FP_RSM(LE *a_field, double a_user, int a_days)
RSM (ammonium nitrate solution) applied on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:940
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
pl_wwl_ferti_p9
Definition: PLWinterWheatLate.h:70
pl_wwl_ferti_p3
Definition: PLWinterWheatLate.h:52
pl_wwl_ferti_s5
Definition: PLWinterWheatLate.h:63
Farm::GrowthRegulator
virtual bool GrowthRegulator(LE *a_field, double a_user, int a_days)
Apply growth regulator to a_field.
Definition: FarmFuncs.cpp:2070
LE::GetOwner
Farm * GetOwner(void)
Definition: Elements.h:256
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
pl_wwl_ferti_s4
Definition: PLWinterWheatLate.h:61
pl_wwl_stubble_plough
Definition: PLWinterWheatLate.h:43
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
pl_wwl_fungicide4
Definition: PLWinterWheatLate.h:75
Farm::FA_PK
virtual bool FA_PK(LE *a_field, double a_user, int a_days)
Apply PK fertilizer to a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1010
pl_wwl_ferti_s2
Definition: PLWinterWheatLate.h:48
pl_wwl_foobar
Definition: PLWinterWheatLate.h:88
pl_wwl_harvest
Definition: PLWinterWheatLate.h:81
pl_wwl_ferti_s6
Definition: PLWinterWheatLate.h:65
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
pl_wwl_growth_regulator1
Definition: PLWinterWheatLate.h:79
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
pl_wwl_fungicide2
Definition: PLWinterWheatLate.h:73
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
pl_wwl_ferti_s10
Definition: PLWinterWheatLate.h:85
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
Farm::StubbleHarrowing
virtual bool StubbleHarrowing(LE *a_field, double a_user, int a_days)
Carry out stubble harrowing on a_field.
Definition: FarmFuncs.cpp:1523
Farm::FP_NPKS
virtual bool FP_NPKS(LE *a_field, double a_user, int a_days)
Apply NPKS fertilizer, on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:630
pl_wwl_insecticide2b
Definition: PLWinterWheatLate.h:77
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:751