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
PLBeet Class Reference

PLBeet class
. More...

#include <PLBeet.h>

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

PLBeet class
.

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

◆ PLBeet()

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

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

Member Function Documentation

◆ Do()

bool PLBeet::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 beet.

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_PLBeet; // 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_be_start:
82  {
83  // pl_be_start just sets up all the starting conditions and reference dates that are needed to start a pl_sw
84  PL_BE_FERTI_P1 = false;
85  PL_BE_FERTI_S1 = false;
86  PL_BE_STUBBLE_PLOUGH = false;
87  PL_BE_WINTER_PLOUGH = false;
89  PL_BE_WATER_DATE = 0;
90  PL_BE_HERBI_DATE = 0;
91  PL_BE_HERBI1 = false;
92  PL_BE_HERBI3 = false;
93  a_field->ClearManagementActionSum();
94  // Set up the date management stuff
95  // The next bit of code just allows for altering dates after harvest if it is necessary
96  // to allow for a crop which starts its management early.
97 
98  // 2 start and stop dates for all 'movable' events for this crop
99  int noDates = 2;
100  m_field->SetMDates(0, 0, g_date->DayInYear(30, 12)); // last possible day of harvest
101  m_field->SetMDates(1, 0, g_date->DayInYear(30, 12)); // end day of calcium application
102  m_field->SetMDates(0, 1, 0);
103  m_field->SetMDates(1, 1, g_date->DayInYear(30, 12));
104 
105  m_field->SetMConstants(0, 1);
106 
107  // Check the next crop for early start, unless it is a spring crop
108  // in which case we ASSUME that no checking is necessary!!!!
109  // So DO NOT implement a crop that runs over the year boundary (i.e. from spring to spring!), at least not without fixing this.
110 
111  //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)
112  //optimising farms not used for now so most of related code is removed (but not in 'start' case)
113  if (!(m_farm->GetType() == tof_OptimisingFarm && g_date->GetYearNumber() > 0)) {
114 
115  if (m_ev->m_startday > g_date->DayInYear(1, 7)) {
116  if (m_field->GetMDates(0, 0) >= m_ev->m_startday)
117  {
118  g_msg->Warn(WARN_BUG, "PLBeet::Do(): ", "Harvest too late for the next crop to start!!!");
119  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
120  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
121  }
122  // Now fix any late finishing problems
123  for (int i = 0; i < noDates; i++) {
124  if (m_field->GetMDates(0, i) >= m_ev->m_startday) {
125  m_field->SetMDates(0, i, m_ev->m_startday - 1); //move the starting date
126  }
127  if (m_field->GetMDates(1, i) >= m_ev->m_startday) {
128  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)
129  m_field->SetMDates(1, i, m_ev->m_startday - 1); //move the finishing date
130  }
131  }
132  }
133  // Now no operations can be timed after the start of the next crop.
134 
135  if (!m_ev->m_first_year) {
136  // Are we before July 1st?
137  d1 = g_date->OldDays() + g_date->DayInYear(1, 7);
138  if (g_date->Date() < d1) {
139  // Yes, too early. We assumme this is because the last crop was late
140  printf("Poly: %d\n", m_field->GetPoly());
141  g_msg->Warn(WARN_BUG, "PLBeet::Do(): ", "Crop start attempt between 1st Jan & 1st July");
142  int prev = m_field->GetLandscape()->BackTranslateVegTypes(m_field->GetOwner()->GetPreviousTov(m_field->GetRotIndex()));
143  g_msg->Warn(WARN_BUG, "Previous Crop ", prev);
144  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
145  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
146  }
147  else {
148  d1 = g_date->OldDays() + m_first_date; // Add 365 for spring crop
149  if (g_date->Date() > d1) {
150  // Yes too late - should not happen - raise an error
151  g_msg->Warn(WARN_BUG, "PLBeet::Do(): ", "Crop start attempt after last possible start date");
152  g_msg->Warn(WARN_BUG, "Previous Crop ", "");
154  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
155  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
156  }
157  }
158  }
159  else {
160  // Is the first year
161  // Some special code to cope with that first start-up year in ALMaSS - ignore for all practical purposes
162  // Code for first spring treatment used
164  break;
165  }
166  }//if
167 
168  // End single block date checking code. Please see next line comment as well.
169  // Reinit d1 to first possible starting date.
170  d1 = g_date->OldDays() + g_date->DayInYear(20, 7);
171  // OK, let's go.
172  // Here we queue up the first event - this differs depending on whether we have a
173  // stock or arable farmer
174  if (m_farm->IsStockFarmer()) { // StockFarmer
176  }
177  else SimpleEvent_(d1, pl_be_ferti_p1, false, m_farm, m_field);
178  }
179  break;
180 
181  // This is the first real farm operation
182  case pl_be_ferti_p1:
183  // In total 50% of arable farmers do PK in the autumn, either before stubble plough/harrow or later before winter plough
184  // We therefore assume that half of them (25%) do it now
185  if (m_ev->m_lock || m_farm->DoIt(25))
186  {
187  if (!m_farm->FP_PK(m_field, 0.0, g_date->DayInYear(5, 11) - g_date->DayInYear())) {
189  break;
190  }
191  else
192  {
193  //Rest of farmers do PK before winter plough so we need to remeber who already did it
194  PL_BE_FERTI_P1 = true;
195  }
196  }
197  // Queue up the next event -in this case stubble ploughing
199  break;
200  case pl_be_ferti_s1:
201  // In total 50% of stock farmers do PK in the autumn, either before stubble plough/harrow or later before winter plough
202  // We therefore assume that half of them (25%) do it now
203  if (m_ev->m_lock || m_farm->DoIt(25))
204  {
205  if (!m_farm->FA_PK(m_field, 0.0, g_date->DayInYear(5, 11) - g_date->DayInYear())) {
207  break;
208  }
209  else
210  {
211  //Rest of farmers do slurry before autumn plough/stubble cultivation so we need to remeber who already did it
212  PL_BE_FERTI_S1 = true;
213  }
214  }
215  // Queue up the next event -in this case stubble ploughing
217  break;
219  // 55% will do stubble plough, but rest will get away with non-inversion cultivation
220  if (m_ev->m_lock || m_farm->DoIt(55))
221  {
222  if (!m_farm->StubblePlough(m_field, 0.0, g_date->DayInYear(5, 11) - g_date->DayInYear())) {
224  break;
225  }
226  else
227  {
228  // 55% of farmers will do this, but the other 45% won't so we need to remember whether we are in one or the other group
229  PL_BE_STUBBLE_PLOUGH = true;
230  // Queue up the next event
232  break;
233  }
234  }
236  break;
238  if (!m_farm->AutumnHarrow(m_field, 0.0, g_date->DayInYear(5, 11) - g_date->DayInYear())) {
240  break;
241  }
243  break;
245  if (m_ev->m_lock || m_farm->DoIt(40))
246  {
247  if (!m_farm->AutumnHarrow(m_field, 0.0, g_date->Date() + 7 - g_date->DayInYear())) {
249  break;
250  }
251  }
252  d1 = g_date->Date() + 1;
253  if (d1 < g_date->OldDays() + g_date->DayInYear(10, 9)) {
254  d1 = g_date->OldDays() + g_date->DayInYear(10, 9);
255  }
256  if (m_farm->IsStockFarmer()) //Stock Farmer
257  {
259  }
260  else SimpleEvent_(d1, pl_be_ferti_p2, false, m_farm, m_field);
261  break;
263  if (!m_farm->StubbleHarrowing(m_field, 0.0, g_date->DayInYear(10, 11) - g_date->DayInYear())) {
265  break;
266  }
267  d1 = g_date->Date() + 1;
268  if (d1 < g_date->OldDays() + g_date->DayInYear(10, 9)) {
269  d1 = g_date->OldDays() + g_date->DayInYear(10, 9);
270  }
271  if (m_farm->IsStockFarmer()) //Stock Farmer
272  {
274  }
275  else SimpleEvent_(d1, pl_be_ferti_p2, false, m_farm, m_field);
276  break;
277  case pl_be_ferti_p2:
278  // In total 50% of arable farmers do PK in the autumn, either before stubble plough/harrow or later before winter plough
279  // We therefore assume that half of them (25%) do it now (if haven't done before)
280  if ((m_ev->m_lock || m_farm->DoIt(static_cast<int>((25.0/75.0)*100)))&&(PL_BE_FERTI_P1==false))
281  {
282  if (!m_farm->FP_PK(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
284  break;
285  }
286  }
288  break;
289  case pl_be_ferti_s2:
290  // In total 50% of stock farmers do PK in the autumn, either before stubble plough/harrow or later before winter plough
291  // We therefore assume that half of them (25%) do it now (if haven't done before)
292  if ((m_ev->m_lock || m_farm->DoIt(static_cast<int>((25.0/75.0)*100))) && (PL_BE_FERTI_S1==false))
293  {
294  if (!m_farm->FA_PK(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
296  break;
297  }
298  }
300  break;
301  case pl_be_ferti_p3:
302  if (m_ev->m_lock || m_farm->DoIt(74))
303  {
304  if (!m_farm->FP_Slurry(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
306  break;
307  }
308  }
310  break;
311  case pl_be_ferti_s3:
312  if (m_ev->m_lock || m_farm->DoIt(74))
313  {
314  if (!m_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
316  break;
317  }
318  }
320  break;
321  case pl_be_winter_plough:
322  // 88% will do winter plough, but 8% will get away with non-inversion cultivation
323  if (m_ev->m_lock || m_farm->DoIt(88))
324  {
325  if (!m_farm->WinterPlough(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
327  break;
328  }
329  else
330  {
331  PL_BE_WINTER_PLOUGH = true;
332  // Queue up the next event
334  break;
335  }
336  }
338  break;
340  // 8% will get away with non-inversion cultivation
341  if (m_ev->m_lock || m_farm->DoIt(67)) // 67% of remaining 12% of farmers who didn't do winter plough
342  {
345  break;
346  }
347  }
349  break;
350 
351  case pl_be_spring_harrow:
352  if ((m_ev->m_lock) || m_farm->DoIt(50))
353  {
354  if (!m_farm->SpringHarrow(m_field, 0.0, g_date->DayInYear(31, 3) - g_date->DayInYear())) {
356  break;
357  }
358  }
359  d1 = g_date->Date() + 1;
360  if (d1 < g_date->OldDays() + g_date->DayInYear(15, 3)) {
361  d1 = g_date->OldDays() + g_date->DayInYear(15, 3);
362  }
363  if (m_farm->IsStockFarmer()) //Stock Farmer
364  {
366  }
367  else SimpleEvent_(d1, pl_be_ferti_p4, false, m_farm, m_field);
368  break;
369  case pl_be_ferti_p4:
370  if (m_ev->m_lock || m_farm->DoIt(98))
371  {
372  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(10, 4) - g_date->DayInYear())) {
374  break;
375  }
376  PL_BE_SPRING_FERTI = true;
377  }
379  break;
380  case pl_be_ferti_s4:
381  if (m_ev->m_lock || m_farm->DoIt(98))
382  {
383  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(10, 4) - g_date->DayInYear())) {
385  break;
386  }
387  PL_BE_SPRING_FERTI = true;
388  }
390  break;
391  case pl_be_ferti_p5:
392  if (m_ev->m_lock || m_farm->DoIt(25))
393  {
394  if (!m_farm->FP_PK(m_field, 0.0, g_date->DayInYear(10, 4) - g_date->DayInYear())) {
396  break;
397  }
398  PL_BE_SPRING_FERTI = true;
399  }
401  break;
402  case pl_be_ferti_s5:
403  if (m_ev->m_lock || m_farm->DoIt(25))
404  {
405  if (!m_farm->FA_PK(m_field, 0.0, g_date->DayInYear(10, 4) - g_date->DayInYear())) {
407  break;
408  }
409  PL_BE_SPRING_FERTI = 1;
410  }
412  break;
414  if (PL_BE_SPRING_FERTI == 1)
415  {
418  break;
419  }
420  }
421  d1 = g_date->Date() + 1;
422  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 4)) {
423  d1 = g_date->OldDays() + g_date->DayInYear(1, 4);
424  }
426  break;
428  // 90% will do preseeding cultivation, the rest will do it together with sow
429  if (m_ev->m_lock || m_farm->DoIt(90))
430  {
431  if (!m_farm->PreseedingCultivator(m_field, 0.0, g_date->DayInYear(19, 4) - g_date->DayInYear())) {
433  break;
434  }
436  break;
437  }
439  break;
440  case pl_be_spring_sow:
441  if (cfg_seedcoating_beet_on.value() && a_field->GetLandscape()->SupplyShouldSpray()) {
442  if (!m_farm->SpringSow(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear(),
445  break;
446  }
447  }
448  else {
449  if (!m_farm->SpringSow(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
451  break;
452  }
453  }
454 
455  // Here is a fork leading to four parallel events
456  SimpleEvent_(g_date->Date() + 5, pl_be_harrow_before_emergence, false, m_farm, m_field); // Harrowing before emergence, followed by thinning after emergence
457  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 5), pl_be_watering1, false, m_farm, m_field); // Watering thread
458  SimpleEvent_(g_date->Date() + 5, pl_be_herbicide1, false, m_farm, m_field); // Herbicide thread
459  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 7), pl_be_fungicide1, false, m_farm, m_field); // Fungicide thread = MAIN THREAD
460  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(15, 6) + m_date_modifier, pl_be_insecticide, false, m_farm, m_field); // Insecticide thread
461  if (m_farm->IsStockFarmer()) //Stock Farmer
462  {
463  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(25, 4), pl_be_ferti_s6, false, m_farm, m_field); // Fertilizers thread
464  }
466  break;
468  // 10% will do preseeding cultivation with sow
471  break;
472  }
473  // Here is a fork leading to four parallel events
474  SimpleEvent_(g_date->Date() + 5, pl_be_harrow_before_emergence, false, m_farm, m_field); // Harrowing before emergence, followed by thinning after emergence
475  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 5), pl_be_watering1, false, m_farm, m_field); // Watering thread
476  SimpleEvent_(g_date->Date() + 5, pl_be_herbicide1, false, m_farm, m_field); // Herbicide thread
477  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 7), pl_be_fungicide1, false, m_farm, m_field); // Fungicide thread = MAIN THREAD
478  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(15, 6) + m_date_modifier, pl_be_insecticide, false, m_farm, m_field); // Insecticide thread
479  if (m_farm->IsStockFarmer()) //Stock Farmer
480  {
481  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 5), pl_be_ferti_s6, false, m_farm, m_field); // Fertilizers thread
482  }
484  break;
486  if (m_field->GetGreenBiomass() <= 0)
487  {
488  if (m_ev->m_lock || m_farm->DoIt(3))
489  {
490  if (!m_farm->SpringHarrow(m_field, 0.0, g_date->DayInYear(25, 4) - g_date->DayInYear())) {
492  break;
493  }
494  }
496  break;
497  }
498  else {
500  }
501  break;
502  case pl_be_thinning:
503  if (m_ev->m_lock || m_farm->DoIt(5))
504  {
505  if (m_field->GetGreenBiomass() <= 0) {
507  }
508  else
509  {
510  if (!m_farm->RowCultivation(m_field, 0.0, g_date->DayInYear(5, 5) - g_date->DayInYear())) {
512  break;
513  }
514  }
515  }
516  // End of thread
517  break;
518  case pl_be_watering1:
519  if (m_ev->m_lock || m_farm->DoIt(3))
520  {
521  if (m_field->GetGreenBiomass() <= 0) {
523  }
524  else
525  {
526  if (!m_farm->Water(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
528  break;
529  }
531  }
532  d1 = g_date->Date() + 7;
533  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 6)) {
534  d1 = g_date->OldDays() + g_date->DayInYear(1, 6);
535  }
537  break;
538  }
539  break;
540 
541  case pl_be_watering2:
542  if (!m_farm->Water(m_field, 0.0, g_date->DayInYear(30, 6) - g_date->DayInYear())) {
544  break;
545  }
547  d1 = g_date->Date() + 7;
548  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 7)) {
549  d1 = g_date->OldDays() + g_date->DayInYear(1, 7);
550  }
552  break;
553  case pl_be_watering3:
554  if (!m_farm->Water(m_field, 0.0, g_date->DayInYear(31, 7) - g_date->DayInYear())) {
556  break;
557  }
559  // End of thread
560  break;
561  case pl_be_ferti_p6:
562  // Here comes fertilizers thread
563  if (m_field->GetGreenBiomass() <= 0) {
565  }
566  else
567  {
568  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(25, 5) - g_date->DayInYear())) {
570  break;
571  }
572  d1 = g_date->Date() + 1;
573  if (d1 < g_date->OldDays() + g_date->DayInYear(20, 5)) {
574  d1 = g_date->OldDays() + g_date->DayInYear(20, 5);
575  }
577  break;
578  }
579  break;
580  case pl_be_ferti_s6:
581  if (m_field->GetGreenBiomass() <= 0) {
583  }
584  else
585  {
586  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(25, 5) - g_date->DayInYear())) {
588  break;
589  }
590  d1 = g_date->Date() + 1;
591  if (d1 < g_date->OldDays() + g_date->DayInYear(20, 5)) {
592  d1 = g_date->OldDays() + g_date->DayInYear(20, 5);
593  }
595  break;
596  }
597  break;
598  case pl_be_ferti_p7:
599  if (m_ev->m_lock || m_farm->DoIt(89))
600  {
601  if (!m_farm->FP_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(10, 6) - g_date->DayInYear())) {
603  break;
604  }
605  }
606  // End of thread
607  break;
608  case pl_be_ferti_s7:
609  if (m_ev->m_lock || m_farm->DoIt(89))
610  {
611  if (!m_farm->FA_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(10, 6) - g_date->DayInYear())) {
613  break;
614  }
615  }
616  // End of thread
617  break;
618  case pl_be_herbicide1: // The first of the pesticide managements.
619  // Here comes the herbicide thread
620  // We assume that farmers do max 3 herbicide treatments
621  if (m_field->GetGreenBiomass() <= 0)
622  {
623  if (m_ev->m_lock || m_farm->DoIt(43))
624  {
625  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(25, 4) - g_date->DayInYear())) {
627  break;
628  }
629  PL_BE_HERBI1 = true;
631  }
633  break;
634  }
636  break;
637  case pl_be_herbicide2:
638  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
640  break;
641  }
644  break;
645  case pl_be_herbicide3:
646  if (m_ev->m_lock || m_farm->DoIt(93))
647  {
648  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(10, 6) - g_date->DayInYear())) {
650  break;
651  }
653  PL_BE_HERBI3 = true;
654  }
656  break;
657  case pl_be_herbicide4:
658  if (m_ev->m_lock || (m_farm->DoIt(81) && (PL_BE_HERBI1 == false || PL_BE_HERBI3 == false))) // which gives 46% of all farmers (and 81% of those who did not apply herbicides before beet emergence)
659  {
660  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(20, 6) - g_date->DayInYear())) {
662  break;
663  }
665  }
666  // End of thread
667  break;
668  case pl_be_fungicide1:
669  // Here comes the fungicide thread
670  if (m_ev->m_lock || m_farm->DoIt(83))
671  {
672  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(5, 8) - g_date->DayInYear())) {
674  break;
675  }
676  }
678  break;
679  case pl_be_fungicide2:
680  if (m_ev->m_lock || m_farm->DoIt(63))
681  {
682  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(25, 8) - g_date->DayInYear())) {
684  break;
685  }
686  }
688  break;
689  case pl_be_insecticide:
690  // Here comes the insecticide thread
691 
692  if (PL_BE_HERBI_DATE >= g_date->Date() - 2) { // Should by at least 3 days after herbicide
694  }
695  else
696  {
697  if (m_ev->m_lock || m_farm->DoIt(58))
698  {
699  // here we check whether we are using ERA pesticide or not
700  d1 = g_date->DayInYear(25, 7) - g_date->DayInYear();
701  if (!cfg_pest_beet_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
702  {
703  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
704  }
705  else {
706  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 3);
707  }
708  if (!flag) {
710  break;
711  }
712  }
713  }
714  // End of thread
715  break;
716  case pl_be_harvest:
717  // Here the MAIN thread continues
718  // We don't move harvest days
719  if (!m_farm->Harvest(m_field, 0.0, m_field->GetMDates(0, 0) - g_date->DayInYear())) {
721  break;
722  }
723  if (m_farm->IsStockFarmer()) //Stock Farmer
724  {
726  }
727  else SimpleEvent_(g_date->Date() + 1, pl_be_ferti_p8, false, m_farm, m_field);
728  break;
729 
730  case pl_be_ferti_p8:
731  if (m_ev->m_lock || m_farm->DoIt(28))
732  {
733  if (m_field->GetMConstants(3) == 0) {
734  if (!m_farm->FP_Calcium(m_field, 0.0, -1)) { // raise an error
735  g_msg->Warn(WARN_BUG, "PLBeet::Do(): failure in 'FP_Calcium' execution", "");
736  exit(1);
737  }
738  }
739  else {
740  if (!m_farm->FP_Calcium(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
742  break;
743  }
744  }
745  }
746  done = true;
747  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
748  // END of MAIN THREAD
749  break;
750  case pl_be_ferti_s8:
751  if (m_ev->m_lock || m_farm->DoIt(28))
752  {
753  if (m_field->GetMConstants(3) == 0) {
754  if (!m_farm->FA_Calcium(m_field, 0.0, -1)) { // raise an error
755  g_msg->Warn(WARN_BUG, "PLBeet::Do(): failure in 'FA_Calcium' execution", "");
756  exit(1);
757  }
758  }
759  else {
760  if (!m_farm->FA_Calcium(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
762  break;
763  }
764  }
765  }
766  done = true;
767  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
768  // END of MAIN THREAD
769  break;
770  default:
771  g_msg->Warn(WARN_BUG, "PLBeet::Do(): "
772  "Unknown event type! ", "");
773  exit(1);
774  }
775  return done;
776 }

References Farm::AutumnHarrow(), cfg_pest_beet_on, cfg_pest_product_amounts, cfg_seedcoating_beet_on, cfg_seedcoating_product_amounts, LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), Farm::DoIt(), Farm::FA_AmmoniumSulphate(), Farm::FA_Calcium(), Farm::FA_ManganeseSulphate(), Farm::FA_PK(), Farm::FA_Slurry(), Farm::FP_AmmoniumSulphate(), Farm::FP_Calcium(), Farm::FP_ManganeseSulphate(), 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::HeavyCultivatorAggregate(), 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_be_autumn_harrow1, pl_be_autumn_harrow2, PL_BE_FERTI_P1, pl_be_ferti_p1, pl_be_ferti_p2, pl_be_ferti_p3, pl_be_ferti_p4, pl_be_ferti_p5, pl_be_ferti_p6, pl_be_ferti_p7, pl_be_ferti_p8, PL_BE_FERTI_S1, pl_be_ferti_s1, pl_be_ferti_s2, pl_be_ferti_s3, pl_be_ferti_s4, pl_be_ferti_s5, pl_be_ferti_s6, pl_be_ferti_s7, pl_be_ferti_s8, pl_be_fungicide1, pl_be_fungicide2, pl_be_harrow_before_emergence, pl_be_harvest, pl_be_heavy_cultivator, PL_BE_HERBI1, PL_BE_HERBI3, PL_BE_HERBI_DATE, pl_be_herbicide1, pl_be_herbicide2, pl_be_herbicide3, pl_be_herbicide4, pl_be_insecticide, pl_be_preseeding_cultivator, pl_be_preseeding_cultivator_sow, PL_BE_SPRING_FERTI, pl_be_spring_harrow, pl_be_spring_sow, pl_be_start, pl_be_stubble_harrow, PL_BE_STUBBLE_PLOUGH, pl_be_stubble_plough, pl_be_thinning, PL_BE_WATER_DATE, pl_be_watering1, pl_be_watering2, pl_be_watering3, PL_BE_WINTER_PLOUGH, pl_be_winter_plough, pl_be_winter_stubble_cultivator_heavy, ppp_1, Farm::PreseedingCultivator(), Farm::PreseedingCultivatorSow(), Farm::ProductApplication(), Farm::RowCultivation(), LE::SetMConstants(), LE::SetMDates(), Crop::SimpleEvent_(), Farm::SpringHarrow(), Farm::SpringSow(), Farm::StubbleCultivatorHeavy(), Farm::StubbleHarrowing(), Farm::StubblePlough(), tof_OptimisingFarm, tov_PLBeet, CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), WARN_BUG, Farm::Water(), and Farm::WinterPlough().

◆ SetUpFarmCategoryInformation()

void PLBeet::SetUpFarmCategoryInformation ( )
inline
111  {
112  const int elements = 2 + (pl_be_foobar - PLBEET_BASE);
114 
115  FarmManagementCategory catlist[elements] =
116  {
117  fmc_Others, // zero element unused but must be here
118  fmc_Others,//pl_be_start = 1, // Compulsory, must always be 1 (one).
119  fmc_Others,//pl_be_sleep_all_day = PLBEET_BASE,
120  fmc_Fertilizer,//pl_be_ferti_p1,
121  fmc_Fertilizer,//pl_be_ferti_s1,
122  fmc_Cultivation,//pl_be_stubble_plough,
123  fmc_Cultivation,//pl_be_autumn_harrow1,
124  fmc_Cultivation,//pl_be_autumn_harrow2,
125  fmc_Cultivation,//pl_be_stubble_harrow,
126  fmc_Fertilizer,//pl_be_ferti_p2,
127  fmc_Fertilizer,//pl_be_ferti_s2,
128  fmc_Fertilizer,//pl_be_ferti_p3,
129  fmc_Fertilizer,//pl_be_ferti_s3,
130  fmc_Cultivation,//pl_be_winter_plough,
131  fmc_Cultivation,//pl_be_winter_stubble_cultivator_heavy,
132  fmc_Cultivation,//pl_be_spring_harrow,
133  fmc_Fertilizer,//pl_be_ferti_p4,
134  fmc_Fertilizer,//pl_be_ferti_s4,
135  fmc_Fertilizer,//pl_be_ferti_p5,
136  fmc_Fertilizer,//pl_be_ferti_s5,
137  fmc_Cultivation,//pl_be_heavy_cultivator,
138  fmc_Cultivation,//pl_be_preseeding_cultivator,
139  fmc_Cultivation,//pl_be_preseeding_cultivator_sow,
140  fmc_Others,//pl_be_spring_sow,
141  fmc_Cultivation,//pl_be_harrow_before_emergence,
142  fmc_Others,//pl_be_thinning,
143  fmc_Watering,//pl_be_watering1,
144  fmc_Watering,//pl_be_watering2,
145  fmc_Watering,//pl_be_watering3,
146  fmc_Herbicide,//pl_be_herbicide1,
147  fmc_Herbicide,//pl_be_herbicide2,
148  fmc_Herbicide,//pl_be_herbicide3,
149  fmc_Herbicide,//pl_be_herbicide4,
150  fmc_Fungicide,//pl_be_fungicide1,
151  fmc_Fungicide,//pl_be_fungicide2,
152  fmc_Insecticide,//pl_be_insecticide,
153  fmc_Fertilizer,//pl_be_ferti_p6,
154  fmc_Fertilizer,//pl_be_ferti_s6,
155  fmc_Fertilizer,//pl_be_ferti_p7,
156  fmc_Fertilizer,//pl_be_ferti_s7,
157  fmc_Harvest,//pl_be_harvest,
158  fmc_Fertilizer,//pl_be_ferti_p8,
159  fmc_Fertilizer//pl_be_ferti_s8,
160 
161  };
162  // Iterate over the catlist elements and copy them to vector
163  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
164 
165  }

References fmc_Cultivation, fmc_Fertilizer, fmc_Fungicide, fmc_Harvest, fmc_Herbicide, fmc_Insecticide, fmc_Others, fmc_Watering, Crop::m_base_elements_no, Crop::m_ManagementCategories, pl_be_foobar, and PLBEET_BASE.

Referenced by PLBeet().


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
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
pl_be_heavy_cultivator
Definition: PLBeet.h:64
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_be_ferti_s8
Definition: PLBeet.h:86
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
tov_PLBeet
Definition: LandscapeFarmingEnums.h:242
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
LE::GetMConstants
int GetMConstants(int a)
Definition: Elements.h:407
LE::ClearManagementActionSum
void ClearManagementActionSum()
clears the management action counters
Definition: Elements.h:247
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::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
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
pl_be_ferti_s5
Definition: PLBeet.h:63
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_be_ferti_p2
Definition: PLBeet.h:53
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
pl_be_herbicide3
Definition: PLBeet.h:75
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
PLBeet::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: PLBeet.h:111
Farm::GetPreviousTov
TTypesOfVegetation GetPreviousTov(int a_index)
Definition: Farm.h:966
pl_be_stubble_plough
Definition: PLBeet.h:49
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
pl_be_ferti_p5
Definition: PLBeet.h:62
Farm::GetType
TTypesOfFarm GetType(void)
Definition: Farm.h:956
pl_be_watering3
Definition: PLBeet.h:72
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
pl_be_ferti_s3
Definition: PLBeet.h:56
pl_be_stubble_harrow
Definition: PLBeet.h:52
pl_be_ferti_p4
Definition: PLBeet.h:60
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
PLBEET_BASE
#define PLBEET_BASE
Definition: PLBeet.h:24
pl_be_ferti_p6
Definition: PLBeet.h:80
pl_be_autumn_harrow1
Definition: PLBeet.h:50
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
pl_be_ferti_s4
Definition: PLBeet.h:61
PL_BE_WATER_DATE
#define PL_BE_WATER_DATE
Definition: PLBeet.h:33
CfgBool::value
bool value() const
Definition: Configurator.h:164
pl_be_herbicide1
Definition: PLBeet.h:73
pl_be_ferti_p1
Definition: PLBeet.h:47
pl_be_thinning
Definition: PLBeet.h:69
pl_be_winter_stubble_cultivator_heavy
Definition: PLBeet.h:58
pl_be_ferti_s6
Definition: PLBeet.h:81
pl_be_watering1
Definition: PLBeet.h:70
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
pl_be_ferti_p3
Definition: PLBeet.h:55
pl_be_preseeding_cultivator_sow
Definition: PLBeet.h:66
pl_be_ferti_s2
Definition: PLBeet.h:54
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_be_fungicide2
Definition: PLBeet.h:78
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
fmc_Watering
Definition: LandscapeFarmingEnums.h:1011
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
cfg_pest_beet_on
CfgBool cfg_pest_beet_on
Turn on pesticides for beet.
pl_be_spring_sow
Definition: PLBeet.h:67
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
pl_be_ferti_s1
Definition: PLBeet.h:48
PL_BE_STUBBLE_PLOUGH
#define PL_BE_STUBBLE_PLOUGH
Definition: PLBeet.h:30
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
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 ...
pl_be_spring_harrow
Definition: PLBeet.h:59
FarmEvent::m_next_tov
TTypesOfVegetation m_next_tov
Definition: Farm.h:390
PL_BE_FERTI_P1
#define PL_BE_FERTI_P1
A flag used to indicate autumn ploughing status.
Definition: PLBeet.h:28
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
pl_be_herbicide2
Definition: PLBeet.h:74
pl_be_harrow_before_emergence
Definition: PLBeet.h:68
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
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
pl_be_start
Definition: PLBeet.h:45
pl_be_winter_plough
Definition: PLBeet.h:57
PL_BE_WINTER_PLOUGH
#define PL_BE_WINTER_PLOUGH
Definition: PLBeet.h:31
Farm::RowCultivation
virtual bool RowCultivation(LE *a_field, double a_user, int a_days)
Carry out a harrowing between crop rows on a_field.
Definition: FarmFuncs.cpp:1183
tof_OptimisingFarm
Definition: LandscapeFarmingEnums.h:696
pl_be_insecticide
Definition: PLBeet.h:79
Farm::Water
virtual bool Water(LE *a_field, double a_user, int a_days)
Carry out a watering on a_field.
Definition: FarmFuncs.cpp:1330
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
pl_be_ferti_s7
Definition: PLBeet.h:83
PL_BE_SPRING_FERTI
#define PL_BE_SPRING_FERTI
Definition: PLBeet.h:32
PL_BE_HERBI_DATE
#define PL_BE_HERBI_DATE
Definition: PLBeet.h:34
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
pl_be_preseeding_cultivator
Definition: PLBeet.h:65
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
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
pl_be_ferti_p8
Definition: PLBeet.h:85
pl_be_herbicide4
Definition: PLBeet.h:76
PL_BE_HERBI1
#define PL_BE_HERBI1
Definition: PLBeet.h:35
pl_be_ferti_p7
Definition: PLBeet.h:82
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_be_harvest
Definition: PLBeet.h:84
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
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_be_watering2
Definition: PLBeet.h:71
pl_be_fungicide1
Definition: PLBeet.h:77
LE::GetOwner
Farm * GetOwner(void)
Definition: Elements.h:256
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
pl_be_foobar
Definition: PLBeet.h:87
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
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
cfg_seedcoating_beet_on
CfgBool cfg_seedcoating_beet_on
Turn on seed coating for beet.
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
PL_BE_FERTI_S1
#define PL_BE_FERTI_S1
Definition: PLBeet.h:29
Farm::HeavyCultivatorAggregate
virtual bool HeavyCultivatorAggregate(LE *a_field, double a_user, int a_days)
Carry out a heavy cultivation event on a_field. This is non-inversion type of cultivation which can b...
Definition: FarmFuncs.cpp:259
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
PL_BE_HERBI3
#define PL_BE_HERBI3
Definition: PLBeet.h:36
pl_be_autumn_harrow2
Definition: PLBeet.h:51
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
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