File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/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
PLPotatoes Class Reference

PLPotatoes class
. More...

#include <PLPotatoes.h>

Inheritance diagram for PLPotatoes:
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...
 
 PLPotatoes (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

PLPotatoes class
.

See PLPotatoes.h::PLPotatoesToDo for a complete list of all possible events triggered codes by the potatoes 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

◆ PLPotatoes()

PLPotatoes::PLPotatoes ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
105  : Crop(a_tov, a_toc, a_L)
106  {
107  // When we start it off, the first possible date for a farm operation is 5th November
108  // This information is used by other crops when they decide how much post processing of
109  // the management is allowed after harvest before the next crop starts.
110  m_first_date=g_date->DayInYear( 5,11 );
112  }

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

Member Function Documentation

◆ Do()

bool PLPotatoes::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 potatoes.

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_PLPotatoes; // 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_pot_start:
82  {
83  // pl_pot_start just sets up all the starting conditions and reference dates that are needed to start a pl_pot
84  PL_POT_FERTI_P1 = false;
85  PL_POT_FERTI_S1 = false;
86  PL_POT_STUBBLE_PLOUGH = false;
87  PL_POT_DID_STRIG1 = false;
88  PL_POT_DID_STRIG2 = false;
89  PL_POT_DID_STRIG3 = false;
90  PL_POT_HILL_DATE = 0;
91  PL_POT_DID_HILL = false;
92  PL_POT_DID_DESS = false;
94 
95  // Set up the date management stuff
96  // The next bit of code just allows for altering dates after harvest if it is necessary
97  // to allow for a crop which starts its management early.
98 
99  // 2 start and stop dates for all 'movable' events for this crop
100  int noDates = 2;
101  m_field->SetMDates(0, 0, g_date->DayInYear(25, 9)); // last possible day of harvest
102  m_field->SetMDates(1, 0, g_date->DayInYear(5, 10)); // end day of calcium application
103  m_field->SetMDates(0, 1, 0);
104  m_field->SetMDates(1, 1, g_date->DayInYear(5, 10));
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, "PLPotatoes::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, "PLPotatoes::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, "PLPotatoes::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
165  break;
166  }
167  }//if
168 
169  // End single block date checking code. Please see next line comment as well.
170  // Reinit d1 to first possible starting date.
171  d1 = g_date->OldDays() + g_date->DayInYear(20, 7);
172  // OK, let's go.
173  // Here we queue up the first event - this differs depending on whether we have a
174  // stock or arable farmer
175  if (m_farm->IsStockFarmer()) { // StockFarmer
177  }
178  else SimpleEvent_(d1, pl_pot_ferti_p1, false, m_farm, m_field);
179  }
180  break;
181 
182  // This is the first real farm operation
183  case pl_pot_ferti_p1:
184  // In total 10% of arable farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
185  // We therefore assume that half of them (5%) do it now
186  if (m_ev->m_lock || m_farm->DoIt(5))
187  {
188  if (!m_farm->FP_Slurry(m_field, 0.0, g_date->DayInYear(5, 11) - g_date->DayInYear())) {
189  // If we don't suceed on the first try, then try and try again (until 20/8 when we will suceed)
191  break;
192  }
193  else
194  {
195  //Rest of farmers do slurry before autumn plough/stubble cultivation so we need to remeber who already did it
196  PL_POT_FERTI_P1 = true;
197  }
198  }
199  // Queue up the next event -in this case stubble ploughing
201  break;
202  case pl_pot_ferti_s1:
203  // In total 40% of stock farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
204  // We therefore assume that half of them (40%) do it now
205  if (m_ev->m_lock || m_farm->DoIt(40))
206  {
207  if (!m_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(5, 11) - g_date->DayInYear())) {
209  break;
210  }
211  else
212  {
213  //Rest of farmers do slurry before autumn plough/stubble cultivation so we need to remeber who already did it
214  PL_POT_FERTI_S1 = true;
215  }
216  }
217  // Queue up the next event -in this case stubble ploughing
219  break;
221  // 65% will do stubble plough, but rest will get away with non-inversion cultivation
222  if (m_ev->m_lock || m_farm->DoIt(65))
223  {
224  if (!m_farm->StubblePlough(m_field, 0.0, g_date->DayInYear(5, 11) - g_date->DayInYear())) {
226  break;
227  }
228  else
229  {
230  // 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
231  PL_POT_STUBBLE_PLOUGH = true;
232  // Queue up the next event
234  break;
235  }
236  }
238  break;
240  if (!m_farm->AutumnHarrow(m_field, 0.0, g_date->DayInYear(5, 11) - g_date->DayInYear())) {
242  break;
243  }
245  break;
247  if (m_ev->m_lock || m_farm->DoIt(40))
248  {
249  if (!m_farm->AutumnHarrow(m_field, 0.0, g_date->Date() + 7 - g_date->DayInYear())) {
251  break;
252  }
253  }
254  d1 = g_date->Date() + 1;
255  if (d1 < g_date->OldDays() + g_date->DayInYear(10, 9)) {
256  d1 = g_date->OldDays() + g_date->DayInYear(10, 9);
257  }
258  if (m_farm->IsStockFarmer()) //Stock Farmer
259  {
261  }
262  else SimpleEvent_(d1, pl_pot_ferti_p2, false, m_farm, m_field);
263  break;
265  if (!m_farm->StubbleHarrowing(m_field, 0.0, g_date->DayInYear(10, 11) - g_date->DayInYear())) {
267  break;
268  }
269  d1 = g_date->Date() + 1;
270  if (d1 < g_date->OldDays() + g_date->DayInYear(10, 9)) {
271  d1 = g_date->OldDays() + g_date->DayInYear(10, 9);
272  }
273  if (m_farm->IsStockFarmer()) //Stock Farmer
274  {
276  }
277  else SimpleEvent_(d1, pl_pot_ferti_p2, false, m_farm, m_field);
278  break;
279  case pl_pot_ferti_p2:
280  // In total 10% of arable farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
281  // We therefore assume that half of them (5%) do it now (if haven't done before)
282  if ((m_ev->m_lock || m_farm->DoIt(static_cast<int>((5.0 / 95.0) * 100))) && (PL_POT_FERTI_P1 == false))
283  {
284  if (!m_farm->FP_Slurry(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
286  break;
287  }
288  }
290  break;
291  case pl_pot_ferti_s2:
292  // In total 80% of stock farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
293  // We therefore assume that half of them (40%) do it now (if haven't done before)
294  if ((m_ev->m_lock || m_farm->DoIt(static_cast<int>((40.0 / 60.0) * 100))) && (PL_POT_FERTI_S1 == false))
295  {
296  if (!m_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
298  break;
299  }
300  }
302  break;
303  case pl_pot_ferti_p3:
304  if (m_ev->m_lock || m_farm->DoIt(7))
305  {
306  if (!m_farm->FP_NPKS(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
308  break;
309  }
310  }
312  break;
313  case pl_pot_ferti_s3:
314  if (m_ev->m_lock || m_farm->DoIt(7))
315  {
316  if (!m_farm->FA_NPKS(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
318  break;
319  }
320  }
322  break;
324  if (!m_farm->WinterPlough(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
326  break;
327  }
328 
330  break;
332  if ((m_ev->m_lock) || m_farm->DoIt(98))
333  {
334  if (!m_farm->SpringHarrow(m_field, 0.0, g_date->DayInYear(10, 4) - g_date->DayInYear())) {
336  break;
337  }
338  }
339  d1 = g_date->Date() + 1;
340  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 4)) {
341  d1 = g_date->OldDays() + g_date->DayInYear(1, 4);
342  }
343  if (m_farm->IsStockFarmer()) //Stock Farmer
344  {
346  }
347  else SimpleEvent_(d1, pl_pot_ferti_p4, false, m_farm, m_field);
348  break;
349  case pl_pot_ferti_p4:
350  if (m_ev->m_lock || m_farm->DoIt(80))
351  {
352  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
354  break;
355  }
356  }
358  break;
359  case pl_pot_ferti_s4:
360  if (m_ev->m_lock || m_farm->DoIt(80))
361  {
362  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
364  break;
365  }
366  }
368  break;
370  if ((m_ev->m_lock) || m_farm->DoIt(22))
371  {
372  if (!m_farm->SpringHarrow(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
374  break;
375  }
376  }
377  d1 = g_date->Date() + 1;
378  if (d1 < g_date->OldDays() + g_date->DayInYear(5, 4)) {
379  d1 = g_date->OldDays() + g_date->DayInYear(5, 4);
380  }
381  if (m_farm->IsStockFarmer()) //Stock Farmer
382  {
384  }
385  else SimpleEvent_(d1, pl_pot_ferti_p5, false, m_farm, m_field);
386  break;
387  case pl_pot_ferti_p5:
388  if (m_ev->m_lock || m_farm->DoIt(70))
389  {
390  if (!m_farm->FP_PK(m_field, 0.0, g_date->DayInYear(25, 4) - g_date->DayInYear())) {
392  break;
393  }
394  }
396  break;
397  case pl_pot_ferti_s5:
398  if (m_ev->m_lock || m_farm->DoIt(70))
399  {
400  if (!m_farm->FA_PK(m_field, 0.0, g_date->DayInYear(25, 4) - g_date->DayInYear())) {
402  break;
403  }
404  }
406  break;
408  if (m_ev->m_lock || m_farm->DoIt(92))
409  {
410  if (!m_farm->SpringPlough(m_field, 0.0, g_date->DayInYear(25, 4) - g_date->DayInYear())) {
412  break;
413  }
414  }
415  d1 = g_date->Date() + 7;
416  if (d1 < g_date->OldDays() + g_date->DayInYear(20, 4)) {
417  d1 = g_date->OldDays() + g_date->DayInYear(20, 4);
418  }
420  break;
421  case pl_pot_bed_forming:
424  break;
425  }
427  break;
429  if (cfg_seedcoating_potatoes_on.value() && a_field->GetLandscape()->SupplyShouldSpray()) {
430  if (!m_farm->SpringSow(m_field, 0.0, g_date->DayInYear(5, 5) - g_date->DayInYear(),
433  break;
434  }
435  }
436  else {
437  if (!m_farm->SpringSow(m_field, 0.0, g_date->DayInYear(5, 5) - g_date->DayInYear())) {
439  break;
440  }
441  }
442 
443  // Fork of events
444  SimpleEvent_(g_date->Date() + 2, pl_pot_hilling1, false, m_farm, m_field); // Strigling followed by hilling and herbicides
445  if (m_farm->IsStockFarmer()) //Stock Farmer
446  {
447  SimpleEvent_(g_date->Date() + 1, pl_pot_ferti_s6, false, m_farm, m_field); // N before emergence
448  }
449  else SimpleEvent_(g_date->Date() + 1, pl_pot_ferti_p6, false, m_farm, m_field);
450  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(10, 6), pl_pot_fungicide1, false, m_farm, m_field); // Fungicide treat = MAIN TREAT
451  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(10, 6) + m_date_modifier, pl_pot_insecticide, false, m_farm, m_field); // Insecticide treat
452  break;
453  case pl_pot_hilling1:
454  if (m_field->GetGreenBiomass() <= 0)
455  {
456  if (m_ev->m_lock || m_farm->DoIt(90))
457  {
458  if (!m_farm->HillingUp(m_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear())) {
460  break;
461  }
462  // 90% of farmers remove weeds with strigling (and hilling), the rest will do herbicide
463  PL_POT_DID_STRIG1 = true;
464  // Queue up the second strigling_hill event after 7 days
466  break;
467  }
468  else {
470  break;
471  }
472  }
474  break;
475  case pl_pot_hilling2:
476  if (m_field->GetGreenBiomass() <= 0)
477  {
478  if (m_ev->m_lock || (m_farm->DoIt(81) && PL_POT_DID_STRIG1)) // which gives 73% of all farmers
479  {
480  if (!m_farm->HillingUp(m_field, 0.0, g_date->DayInYear(25, 5) - g_date->DayInYear())) {
482  break;
483  }
484  // 81% of farmers do strigling_hill second time, the rest will end up with herbicide
485  PL_POT_DID_STRIG2 = true;
486  // Queue up the third strigling_hill event after 7 days
488  break;
489  }
490  else {
492  break;
493  }
494  }
496  break;
497  case pl_pot_hilling3:
498  if (m_field->GetGreenBiomass() <= 0)
499  {
500  if (m_ev->m_lock || (m_farm->DoIt(73) && PL_POT_DID_STRIG2)) // which gives 53% of all farmers
501  {
502  if (!m_farm->HillingUp(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
504  break;
505  }
506  // 73% of farmers do strigling_hill third time, the rest will end up with herbicide.
507  PL_POT_DID_STRIG3 = true;
508  }
509  else {
511  break;
512  }
513  }
515  break;
516  case pl_pot_herbicide1:
517  if (m_field->GetGreenBiomass() <= 0)
518  {
519  if (m_ev->m_lock || m_farm->DoIt(93))
520  {
521  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(5, 6) - g_date->DayInYear())) {
523  break;
524  }
525  }
527  break;
528  }
530  break;
531  case pl_pot_hilling4:
532  if (m_ev->m_lock || m_farm->DoIt(38))
533  {
534  if (m_field->GetGreenBiomass() <= 0) {
536  }
537  else
538  {
539  if (!m_farm->HillingUp(m_field, 0.0, g_date->DayInYear(10, 6) - g_date->DayInYear())) {
541  break;
542  }
545  break;
546  }
547  }
549  break;
550  case pl_pot_hilling5:
551  if (!m_farm->HillingUp(m_field, 0.0, g_date->DayInYear(15, 6) - g_date->DayInYear())) {
553  break;
554  }
557  break;
558  case pl_pot_hilling6:
559  if (!m_farm->HillingUp(m_field, 0.0, g_date->DayInYear(20, 6) - g_date->DayInYear())) {
561  break;
562  }
564  PL_POT_DID_HILL = true;
565 
567  break;
568  case pl_pot_herbicide2:
569  if (m_ev->m_lock || m_farm->DoIt(40))
570  {
571  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(30, 6) - g_date->DayInYear())) {
573  break;
574  }
575  }
576  // End of thread
577  break;
578  case pl_pot_ferti_s6:
579  if (m_field->GetGreenBiomass() <= 0)
580  {
581  if (m_ev->m_lock || m_farm->DoIt(80))
582  {
583  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
585  break;
586  }
587  }
589  break;
590  }
592  break;
593 
594  case pl_pot_ferti_p6:
595  if (m_field->GetGreenBiomass() <= 0)
596  {
597  if (m_ev->m_lock || m_farm->DoIt(80))
598  {
599  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
601  break;
602  }
603  }
605  break;
606  }
608  break;
609  case pl_pot_ferti_s7:
610  if (m_ev->m_lock || m_farm->DoIt(53))
611  {
612  if (PL_POT_HILL_DATE >= g_date->Date() - 2){ // Should by at least 3 days after hilling
614  else
615  {
616  if (!m_farm->FA_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(15, 7) - g_date->DayInYear())) {
618  break;
619  }
620  }
621  }
622  // End of thread
623  break;
624  case pl_pot_ferti_p7:
625  if (m_ev->m_lock || m_farm->DoIt(53))
626  {
627  if (PL_POT_HILL_DATE >= g_date->Date() - 2) { // Should by at least 3 days after hilling
629  }
630  else
631  {
632  if (!m_farm->FP_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(15, 7) - g_date->DayInYear())) {
634  break;
635  }
636  }
637  }
638  // End of thread
639  break;
640  case pl_pot_fungicide1:
641  // Here comes the fungicide thread = MAIN THREAD
642  if (PL_POT_HILL_DATE >= g_date->Date() - 2) { // Should by at least 3 days after hilling
644  }
645  else
646  {
647  if (m_ev->m_lock || m_farm->DoIt(78))
648  {
649  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(31, 7) - g_date->DayInYear())) {
651  break;
652  }
653  }
655  break;
656  }
657  break;
658  case pl_pot_fungicide2:
659  if (m_ev->m_lock || m_farm->DoIt(63))
660  {
661  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(10, 8) - g_date->DayInYear())) {
663  break;
664  }
665  }
667  break;
668  case pl_pot_fungicide3:
669  if (m_ev->m_lock || m_farm->DoIt(63))
670  {
671  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(20, 8) - g_date->DayInYear())) {
673  break;
674  }
675  }
677  break;
678  case pl_pot_fungicide4:
679  if (m_ev->m_lock || m_farm->DoIt(38))
680  {
681  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(20, 8) - g_date->DayInYear())) {
683  break;
684  }
685  }
687  break;
688  case pl_pot_insecticide:
689 #ifdef ECOSTACK_BIOPESTICIDE
690  if (m_ev->m_lock || m_farm->DoIt(75))
691 #else
692  if (m_ev->m_lock || m_farm->DoIt(75))
693 #endif
694  {
695  if (PL_POT_HILL_DATE >= g_date->Date() - 2) {
697  }
698  else
699  {
700  // here we check whether we are using ERA pesticide or not
701  d1 = g_date->DayInYear(20, 7) - g_date->DayInYear();
702  if (!cfg_pest_potatoes_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
703  {
704 #ifdef ECOSTACK_BIOPESTICIDE
705  flag = m_farm->BiocideTreat(m_field, 0.0, d1);
706 #else
707  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
708 #endif
709  }
710  else {
711  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 3);
712  }
713  if (!flag) {
715  break;
716  }
717 #ifdef ECOSTACK_BIOPESTICIDE
718  SimpleEvent(g_date->Date() + 7, pl_pot_insecticideb, false);
719  break; // end of thread
720 #endif
721  }
722  }
723  // End of thread
724  break;
725 
726 #ifdef ECOSTACK_BIOPESTICIDE
727  case pl_pot_insecticideb:
728  if (m_ev->m_lock || m_farm->DoIt_prob(1.0)) {
729  // here we check whether we are using ERA pesticide or not
730  d1 = g_date->DayInYear(27, 7) - g_date->DayInYear();
731  flag = m_farm->BiocideTreat(m_field, 0.0, d1);
732  if (!flag) {
734  break;
735  }
736  }
737  break; // end of thread
738 #endif
739 
740  case pl_pot_dessication1:
741  // Here the MAIN thread continues
742  // This is the desiccation thread with glyphosate or diquat
743  if (m_ev->m_lock || m_farm->DoIt(35))
744  {
745  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(10, 9) - g_date->DayInYear())) {
747  break;
748  }
749  PL_POT_DID_DESS = true;
750  }
752  break;
753  case pl_pot_dessication2:
754  if (m_ev->m_lock || (m_farm->DoIt(17) && PL_POT_DID_DESS)) //which is 6% of all farmers
755  {
756  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(15, 9) - g_date->DayInYear())) {
758  break;
759  }
760  }
762  break;
763  case pl_pot_harvest:
764  // We don't move harvest days
765  if (!m_farm->Harvest(m_field, 0.0, m_field->GetMDates(0, 0) - g_date->DayInYear())) {
767  break;
768  }
769  if (m_farm->IsStockFarmer()) //Stock Farmer
770  {
772  }
773  else SimpleEvent_(g_date->Date() + 1, pl_pot_ferti_p8, false, m_farm, m_field);
774  break;
775  case pl_pot_ferti_p8:
776  if (m_ev->m_lock || m_farm->DoIt(23))
777  {
778  if (m_field->GetMConstants(3) == 0) {
779  if (!m_farm->FP_Calcium(m_field, 0.0, -1)) { // raise an error
780  g_msg->Warn(WARN_BUG, "PLPotatoes::Do(): failure in 'FP_Calcium' execution", "");
781  exit(1);
782  }
783  }
784  else {
785  if (!m_farm->FP_Calcium(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
787  break;
788  }
789  }
790  }
791  done = true;
792  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
793  // END of MAIN THREAD
794  break;
795  case pl_pot_ferti_s8:
796  if (m_ev->m_lock || m_farm->DoIt(23))
797  {
798  if (m_field->GetMConstants(3) == 0) {
799  if (!m_farm->FA_Calcium(m_field, 0.0, -1)) { // raise an error
800  g_msg->Warn(WARN_BUG, "PLPotatoes::Do(): failure in 'FA_Calcium' execution", "");
801  exit(1);
802  }
803  }
804  else {
805  if (!m_farm->FA_Calcium(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
807  break;
808  }
809  }
810  }
811  done = true;
812  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
813  // END of MAIN THREAD
814  break;
815  default:
816  g_msg->Warn(WARN_BUG, "PLPotatoes::Do(): "
817  "Unknown event type! ", "");
818  exit(1);
819  }
820  return done;
821 }

References Farm::AutumnHarrow(), Farm::BiocideTreat(), cfg_pest_potatoes_on, cfg_pest_product_amounts, cfg_seedcoating_potatoes_on, cfg_seedcoating_product_amounts, 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_Slurry(), Farm::FP_AmmoniumSulphate(), Farm::FP_Calcium(), Farm::FP_ManganeseSulphate(), Farm::FP_NPKS(), Farm::FP_PK(), 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::Harvest(), Farm::HerbicideTreat(), Farm::HillingUp(), 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_pot_autumn_harrow1, pl_pot_autumn_harrow2, pl_pot_bed_forming, pl_pot_dessication1, pl_pot_dessication2, PL_POT_DID_DESS, PL_POT_DID_HILL, PL_POT_DID_STRIG1, PL_POT_DID_STRIG2, PL_POT_DID_STRIG3, PL_POT_FERTI_P1, pl_pot_ferti_p1, pl_pot_ferti_p2, pl_pot_ferti_p3, pl_pot_ferti_p4, pl_pot_ferti_p5, pl_pot_ferti_p6, pl_pot_ferti_p7, pl_pot_ferti_p8, PL_POT_FERTI_S1, pl_pot_ferti_s1, pl_pot_ferti_s2, pl_pot_ferti_s3, pl_pot_ferti_s4, pl_pot_ferti_s5, pl_pot_ferti_s6, pl_pot_ferti_s7, pl_pot_ferti_s8, pl_pot_fungicide1, pl_pot_fungicide2, pl_pot_fungicide3, pl_pot_fungicide4, pl_pot_harvest, pl_pot_herbicide1, pl_pot_herbicide2, PL_POT_HILL_DATE, pl_pot_hilling1, pl_pot_hilling2, pl_pot_hilling3, pl_pot_hilling4, pl_pot_hilling5, pl_pot_hilling6, pl_pot_insecticide, pl_pot_insecticideb, pl_pot_spring_harrow, pl_pot_spring_harrow2, pl_pot_spring_planting, pl_pot_spring_plough, pl_pot_start, pl_pot_stubble_harrow, PL_POT_STUBBLE_PLOUGH, pl_pot_stubble_plough, pl_pot_winter_plough, ppp_1, Farm::PreseedingCultivator(), Farm::ProductApplication(), LE::SetMConstants(), LE::SetMDates(), Crop::SimpleEvent(), Crop::SimpleEvent_(), Farm::SpringHarrow(), Farm::SpringPlough(), Farm::SpringSow(), Farm::StubbleHarrowing(), Farm::StubblePlough(), tof_OptimisingFarm, tov_PLPotatoes, CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), WARN_BUG, and Farm::WinterPlough().

◆ SetUpFarmCategoryInformation()

void PLPotatoes::SetUpFarmCategoryInformation ( )
inline
113  {
114  const int elements = 2 + (pl_pot_foobar - PLPOTATOES_BASE);
116 
117  FarmManagementCategory catlist[elements] =
118  {
119  fmc_Others, // zero element unused but must be here
120  fmc_Others,//pl_pot_start = 1, // Compulsory, must always be 1 (one).
121  fmc_Others,//pl_pot_sleep_all_day = PLPOTATOES_BASE,
122  fmc_Fertilizer,//pl_pot_ferti_s1,
123  fmc_Fertilizer,//pl_pot_ferti_p1,
124  fmc_Cultivation,//pl_pot_stubble_plough,
125  fmc_Cultivation,//pl_pot_autumn_harrow1,
126  fmc_Cultivation,//pl_pot_autumn_harrow2,
127  fmc_Cultivation,//pl_pot_stubble_harrow,
128  fmc_Fertilizer,//pl_pot_ferti_p2,
129  fmc_Fertilizer,//pl_pot_ferti_s2, //20910
130  fmc_Fertilizer,//pl_pot_ferti_p3,
131  fmc_Fertilizer,//pl_pot_ferti_s3,
132  fmc_Cultivation,//pl_pot_winter_plough,
133  fmc_Cultivation,//pl_pot_spring_harrow,
134  fmc_Fertilizer,//pl_pot_ferti_p4,
135  fmc_Fertilizer,//pl_pot_ferti_s4,
136  fmc_Cultivation,//pl_pot_spring_harrow2,
137  fmc_Fertilizer,//pl_pot_ferti_p5,
138  fmc_Fertilizer,//pl_pot_ferti_s5,
139  fmc_Cultivation,//pl_pot_spring_plough, //20920
140  fmc_Others,//pl_pot_bed_forming,
141  fmc_Others,//pl_pot_spring_planting,
142  fmc_Others,//pl_pot_hilling1,
143  fmc_Others,//pl_pot_hilling2,
144  fmc_Others,//pl_pot_hilling3,
145  fmc_Herbicide,//pl_pot_herbicide1,
146  fmc_Others,//pl_pot_hilling4,
147  fmc_Others,//pl_pot_hilling5,
148  fmc_Others,//pl_pot_hilling6,
149  fmc_Herbicide,//pl_pot_herbicide2, //20930
150  fmc_Fertilizer,//pl_pot_ferti_p6,
151  fmc_Fertilizer,//pl_pot_ferti_s6,
152  fmc_Fertilizer,//pl_pot_ferti_p7,
153  fmc_Fertilizer,//pl_pot_ferti_s7,
154  fmc_Fungicide,//pl_pot_fungicide1,
155  fmc_Fungicide,//pl_pot_fungicide2,
156  fmc_Fungicide,//pl_pot_fungicide3,
157  fmc_Fungicide,//pl_pot_fungicide4,
158  fmc_Insecticide,//pl_pot_insecticide,
159  fmc_Others,//pl_pot_dessication1, //20940
160  fmc_Others,//pl_pot_dessication2,
161  fmc_Harvest,//pl_pot_harvest,
162  fmc_Fertilizer,//pl_pot_ferti_p8,
163  fmc_Fertilizer,//pl_pot_ferti_s8,
164 
165  };
166  // Iterate over the catlist elements and copy them to vector
167  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
168 
169  }

References fmc_Cultivation, fmc_Fertilizer, fmc_Fungicide, fmc_Harvest, fmc_Herbicide, fmc_Insecticide, fmc_Others, Crop::m_base_elements_no, Crop::m_ManagementCategories, pl_pot_foobar, and PLPOTATOES_BASE.

Referenced by PLPotatoes().


The documentation for this class was generated from the following files:
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
pl_pot_herbicide1
Definition: PLPotatoes.h:69
pl_pot_ferti_s6
Definition: PLPotatoes.h:75
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
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
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::SpringPlough
virtual bool SpringPlough(LE *a_field, double a_user, int a_days)
Carry out a ploughing event in the spring on a_field.
Definition: FarmFuncs.cpp:421
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
pl_pot_fungicide2
Definition: PLPotatoes.h:79
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
pl_pot_hilling6
Definition: PLPotatoes.h:72
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
PLPotatoes::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: PLPotatoes.h:113
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
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
PL_POT_DID_HILL
#define PL_POT_DID_HILL
Definition: PLPotatoes.h:35
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
pl_pot_hilling2
Definition: PLPotatoes.h:67
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
pl_pot_dessication1
Definition: PLPotatoes.h:84
Farm::GetPreviousTov
TTypesOfVegetation GetPreviousTov(int a_index)
Definition: Farm.h:966
Farm::SpringSow
virtual bool SpringSow(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 spring on a_field.
Definition: FarmFuncs.cpp:501
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
pl_pot_ferti_s5
Definition: PLPotatoes.h:62
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
pl_pot_harvest
Definition: PLPotatoes.h:86
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
FarmEvent::m_startday
int m_startday
Definition: Farm.h:385
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
Farm::HillingUp
virtual bool HillingUp(LE *a_field, double a_user, int a_days)
Do hilling up on a_field, probably of potatoes.
Definition: FarmFuncs.cpp:1302
PL_POT_DID_DESS
#define PL_POT_DID_DESS
Definition: PLPotatoes.h:36
pl_pot_bed_forming
Definition: PLPotatoes.h:64
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_pot_autumn_harrow1
Definition: PLPotatoes.h:49
CfgBool::value
bool value() const
Definition: Configurator.h:164
pl_pot_ferti_s4
Definition: PLPotatoes.h:59
cfg_seedcoating_potatoes_on
CfgBool cfg_seedcoating_potatoes_on
Turn on seed coating for potatoes.
PL_POT_STUBBLE_PLOUGH
#define PL_POT_STUBBLE_PLOUGH
Definition: PLPotatoes.h:30
pl_pot_ferti_p8
Definition: PLPotatoes.h:87
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
pl_pot_ferti_p3
Definition: PLPotatoes.h:54
cfg_pest_potatoes_on
CfgBool cfg_pest_potatoes_on
Turn on pesticides for potatoes.
pl_pot_spring_plough
Definition: PLPotatoes.h:63
pl_pot_ferti_s7
Definition: PLPotatoes.h:77
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
PL_POT_HILL_DATE
#define PL_POT_HILL_DATE
Definition: PLPotatoes.h:34
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::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_pot_autumn_harrow2
Definition: PLPotatoes.h:50
pl_pot_stubble_harrow
Definition: PLPotatoes.h:51
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.
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
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_pot_ferti_p2
Definition: PLPotatoes.h:52
pl_pot_fungicide1
Definition: PLPotatoes.h:78
FarmEvent::m_next_tov
TTypesOfVegetation m_next_tov
Definition: Farm.h:390
pl_pot_fungicide4
Definition: PLPotatoes.h:81
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 ...
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
tov_PLPotatoes
Definition: LandscapeFarmingEnums.h:241
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
pl_pot_ferti_p7
Definition: PLPotatoes.h:76
CfgArray_Double::value
std::vector< double > value() const
Definition: Configurator.h:219
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_pot_ferti_s1
Definition: PLPotatoes.h:46
pl_pot_start
Definition: PLPotatoes.h:44
pl_pot_hilling1
Definition: PLPotatoes.h:66
pl_pot_insecticide
Definition: PLPotatoes.h:82
LE::GetGreenBiomass
virtual double GetGreenBiomass(void)
Definition: Elements.h:160
pl_pot_herbicide2
Definition: PLPotatoes.h:73
Farm::FP_Slurry
virtual bool FP_Slurry(LE *a_field, double a_user, int a_days)
Apply slurry to a_field owned by an arable farmer.
Definition: FarmFuncs.cpp: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_pot_ferti_s8
Definition: PLPotatoes.h:88
tof_OptimisingFarm
Definition: LandscapeFarmingEnums.h:696
pl_pot_ferti_p5
Definition: PLPotatoes.h:61
PL_POT_DID_STRIG2
#define PL_POT_DID_STRIG2
Definition: PLPotatoes.h:32
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_pot_spring_harrow
Definition: PLPotatoes.h:57
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
pl_pot_hilling5
Definition: PLPotatoes.h:71
PL_POT_FERTI_S1
#define PL_POT_FERTI_S1
Definition: PLPotatoes.h:29
PL_POT_DID_STRIG1
#define PL_POT_DID_STRIG1
Definition: PLPotatoes.h:31
PLPOTATOES_BASE
#define PLPOTATOES_BASE
Definition: PLPotatoes.h:24
pl_pot_spring_planting
Definition: PLPotatoes.h:65
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
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
pl_pot_stubble_plough
Definition: PLPotatoes.h:48
Farm::WinterPlough
virtual bool WinterPlough(LE *a_field, double a_user, int a_days)
Carry out a ploughing event in the winter on a_field.
Definition: FarmFuncs.cpp:395
pl_pot_ferti_p1
Definition: PLPotatoes.h:47
LE::GetOwner
Farm * GetOwner(void)
Definition: Elements.h:256
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
pl_pot_fungicide3
Definition: PLPotatoes.h:80
pl_pot_insecticideb
Definition: PLPotatoes.h:83
pl_pot_winter_plough
Definition: PLPotatoes.h:56
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
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_pot_ferti_p4
Definition: PLPotatoes.h:58
pl_pot_ferti_s3
Definition: PLPotatoes.h:55
pl_pot_ferti_p6
Definition: PLPotatoes.h:74
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
pl_pot_hilling3
Definition: PLPotatoes.h:68
pl_pot_foobar
Definition: PLPotatoes.h:89
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
pl_pot_spring_harrow2
Definition: PLPotatoes.h:60
pl_pot_ferti_s2
Definition: PLPotatoes.h:53
PL_POT_DID_STRIG3
#define PL_POT_DID_STRIG3
Definition: PLPotatoes.h:33
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
pl_pot_hilling4
Definition: PLPotatoes.h:70
PL_POT_FERTI_P1
#define PL_POT_FERTI_P1
A flag used to indicate autumn ploughing status.
Definition: PLPotatoes.h:28
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::SpringHarrow
virtual bool SpringHarrow(LE *a_field, double a_user, int a_days)
Carry out a harrow event in the spring on a_field.
Definition: FarmFuncs.cpp:459
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
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
pl_pot_dessication2
Definition: PLPotatoes.h:85