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

PLWinterRye class
. More...

#include <PLWinterRye.h>

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

PLWinterRye class
.

See PLWinterRye.h::PLWinterRyeToDo for a complete list of all possible events triggered codes by the winter rye 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

◆ PLWinterRye()

PLWinterRye::PLWinterRye ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
96  : Crop(a_tov, a_toc, a_L)
97  {
98  // When we start it off, the first possible date for a farm operation is 15th September
99  // This information is used by other crops when they decide how much post processing of
100  // the management is allowed after harvest before the next crop starts.
101  m_first_date=g_date->DayInYear( 15,9 );
103  }

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

Member Function Documentation

◆ Do()

bool PLWinterRye::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 rye.

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  int d1 = 0;
73  int noDates = 1;
74  TTypesOfVegetation l_tov = tov_PLWinterRye; // The current type - change to match the crop you have
75 /**********************************************To Here *************************************************************************/
76 
77  // Depending what event has occured jump to the correct bit of code
78  switch (m_ev->m_todo)
79  {
80  case pl_wrye_start:
81  {
82  // pl_wrye_start just sets up all the starting conditions and reference dates that are needed to start a pl_wrye
83  PL_WRYE_FERTI_P1 = false;
84  PL_WRYE_FERTI_S1 = false;
85  PL_WRYE_STUBBLE_PLOUGH = false;
86  a_field->ClearManagementActionSum();
87  // Set up the date management stuff
88  // The next bit of code just allows for altering dates after harvest if it is necessary
89  // to allow for a crop which starts its management early.
90 
91  // 5 start and stop dates for all 'movable' events for this crop
92  int noDates = 4;
93  m_field->SetMDates(0, 0, g_date->DayInYear(10, 8)); // last possible day of harvest
94  m_field->SetMDates(1, 0, g_date->DayInYear(15, 8)); // last possible day of starw chopping, equal to harvest in this case
95  m_field->SetMDates(0, 1, 0); // start day of hay bailing (not used as it depend on previous treatment)
96  m_field->SetMDates(1, 1, g_date->DayInYear(20, 8)); // end day of hay bailing
97  m_field->SetMDates(0, 2, 0); // start day of RSM
98  m_field->SetMDates(1, 2, g_date->DayInYear(25, 8)); // end day of RSM
99  m_field->SetMDates(0, 3, 0); // start day of calcium application
100  m_field->SetMDates(1, 3, g_date->DayInYear(25, 8)); // end day of calcium application
101  // Can be up to 10 of these. If the shortening code is triggered
102  // then these will be reduced in value to 0
103 
104  m_field->SetMConstants(0, 1);
105 
106  // Check the next crop for early start, unless it is a spring crop
107  // in which case we ASSUME that no checking is necessary!!!!
108  // So DO NOT implement a crop that runs over the year boundary (i.e. from spring to spring!), at least not without fixing this.
109 
110  //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)
111  //optimising farms not used for now so most of related code is removed (but not in 'start' case)
112  if (!(m_farm->GetType() == tof_OptimisingFarm && g_date->GetYearNumber() > 0)) {
113 
114  if (m_ev->m_startday > g_date->DayInYear(1, 7)) {
115  if (m_field->GetMDates(0, 0) >= m_ev->m_startday)
116  {
117  g_msg->Warn(WARN_BUG, "PLWinterRye::Do(): ", "Harvest too late for the next crop to start!!!");
118  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
119  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
120  }
121  // Now fix any late finishing problems
122  for (int i = 0; i < noDates; i++) {
123  if (m_field->GetMDates(0, i) >= m_ev->m_startday) {
124  m_field->SetMDates(0, i, m_ev->m_startday - 1); //move the starting date
125  }
126  if (m_field->GetMDates(1, i) >= m_ev->m_startday) {
127  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)
128  m_field->SetMDates(1, i, m_ev->m_startday - 1); //move the finishing date
129  }
130  }
131  }
132  // Now no operations can be timed after the start of the next crop.
133 
134  if (!m_ev->m_first_year) {
135  // Are we before July 1st?
136  d1 = g_date->OldDays() + g_date->DayInYear(1, 7);
137  if (g_date->Date() < d1) {
138  // Yes, too early. We assumme this is because the last crop was late
139  printf("Poly: %d\n", m_field->GetPoly());
140  g_msg->Warn(WARN_BUG, "PLWinterRye::Do(): ", "Crop start attempt between 1st Jan & 1st July");
141  int prev = m_field->GetLandscape()->BackTranslateVegTypes(m_field->GetOwner()->GetPreviousTov(m_field->GetRotIndex()));
142  g_msg->Warn(WARN_BUG, "Previous Crop ", prev);
143  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
144  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
145  }
146  else {
147  d1 = g_date->OldDays() + m_first_date; // Add 365 for spring crop
148  if (g_date->Date() > d1) {
149  // Yes too late - should not happen - raise an error
150  g_msg->Warn(WARN_BUG, "PLWinterRye::Do(): ", "Crop start attempt after last possible start date");
151  g_msg->Warn(WARN_BUG, "Previous Crop ", "");
153  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
154  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
155  }
156  }
157  }
158  else {
159  // Is the first year
160  // Some special code to cope with that first start-up year in ALMaSS - ignore for all practical purposes
161  // Code for first spring treatment used
162  if (m_farm->IsStockFarmer()) //Stock Farmer
163  {
165  }
167  break;
168  }
169  }//if
170 
171  // End single block date checking code. Please see next line comment as well.
172  // Reinit d1 to first possible starting date.
173  d1 = g_date->OldDays() + g_date->DayInYear(20, 7);
174  // OK, let's go.
175  // Here we queue up the first event - this differs depending on whether we have a
176  // stock or arable farmer
177  if (m_farm->IsStockFarmer()) { // StockFarmer
179  }
180  else SimpleEvent_(d1, pl_wrye_ferti_p1, false, m_farm, m_field);
181  }
182  break;
183 
184  // This is the first real farm operation
185  case pl_wrye_ferti_p1:
186  // In total 10% of arable farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
187  // We therefore assume that half of them (5%) do it now
188  if (m_ev->m_lock || m_farm->DoIt(5))
189  {
190  if (!m_farm->FP_Slurry(m_field, 0.0, g_date->DayInYear(15, 9) - g_date->DayInYear())) {
191  // If we don't suceed on the first try, then try and try again (until 20/8 when we will suceed)
193  break;
194  }
195  else
196  {
197  //Rest of farmers do slurry before autumn plough/stubble cultivation so we need to remeber who already did it
198  PL_WRYE_FERTI_P1 = true;
199  }
200  }
201  // Queue up the next event -in this case stubble ploughing
203  break;
204  case pl_wrye_ferti_s1:
205  // In total 80% of stock farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
206  // We therefore assume that half of them (40%) do it now
207  if (m_ev->m_lock || m_farm->DoIt(40))
208  {
209  if (!m_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(15, 9) - g_date->DayInYear())) {
211  break;
212  }
213  else
214  {
215  //Rest of farmers do slurry before autumn plough/stubble cultivation so we need to remeber who already did it
216  PL_WRYE_FERTI_S1 = true;
217  }
218  }
219  // Queue up the next event -in this case stubble ploughing
221  break;
223  // 50% will do stubble plough, but rest will get away with non-inversion cultivation
224  if (m_ev->m_lock || m_farm->DoIt(50))
225  {
226  if (!m_farm->StubblePlough(m_field, 0.0, g_date->DayInYear(15, 9) - g_date->DayInYear())) {
228  break;
229  }
230  else
231  {
232  // 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
233  PL_WRYE_STUBBLE_PLOUGH = true;
234  // Queue up the next event
236  break;
237  }
238  }
240  break;
242  if (!m_farm->AutumnHarrow(m_field, 0.0, g_date->DayInYear(15, 9) - g_date->DayInYear())) {
244  break;
245  }
247  break;
249  if (m_ev->m_lock || m_farm->DoIt(40))
250  {
251  if (!m_farm->AutumnHarrow(m_field, 0.0, g_date->Date() + 7 - g_date->DayInYear())) {
253  break;
254  }
255  }
256  d1 = g_date->Date() + 1;
257  if (d1 < g_date->OldDays() + g_date->DayInYear(10, 8)) {
258  d1 = g_date->OldDays() + g_date->DayInYear(10, 8);
259  }
260  if (m_farm->IsStockFarmer()) //Stock Farmer
261  {
263  }
264  else SimpleEvent_(d1, pl_wrye_ferti_p2, false, m_farm, m_field);
265  break;
267  if (!m_farm->StubbleHarrowing(m_field, 0.0, g_date->DayInYear(20, 9) - g_date->DayInYear())) {
269  break;
270  }
271  d1 = g_date->Date() + 1;
272  if (d1 < g_date->OldDays() + g_date->DayInYear(10, 8)) {
273  d1 = g_date->OldDays() + g_date->DayInYear(10, 8);
274  }
275  if (m_farm->IsStockFarmer()) //Stock Farmer
276  {
278  }
279  else SimpleEvent_(d1, pl_wrye_ferti_p2, false, m_farm, m_field);
280  break;
281  case pl_wrye_ferti_p2:
282  // In total 10% of arable farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
283  // We therefore assume that half of them (5%) do it now (if haven't done before)
284  if ((m_ev->m_lock || m_farm->DoIt(static_cast<int>((5.0 / 95.0) * 100))) && (PL_WRYE_FERTI_P1 == false))
285  {
286  if (!m_farm->FP_Slurry(m_field, 0.0, g_date->DayInYear(25, 9) - g_date->DayInYear())) {
288  break;
289  }
290  }
292  break;
293  case pl_wrye_ferti_s2:
294  // In total 80% of stock farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
295  // We therefore assume that half of them (40%) do it now (if haven't done before)
296  if ((m_ev->m_lock || m_farm->DoIt(static_cast<int>((40.0 / 60.0) * 100))) && (PL_WRYE_FERTI_S1 == false))
297  {
298  if (!m_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(25, 9) - g_date->DayInYear())) {
300  break;
301  }
302  }
304  break;
306  if (m_ev->m_lock || m_farm->DoIt(80))
307  {
308  if (!m_farm->AutumnPlough(m_field, 0.0, g_date->DayInYear(25, 9) - g_date->DayInYear())) {
310  break;
311  }
312  else
313  {
314  // Queue up the next event and if it's late (after 5/9) it has to be rolling, else next fertilizer
315  d1 = g_date->OldDays() + g_date->DayInYear(5, 9);
316  if (g_date->Date() > d1)
317  {
319  break;
320  }
321  else
322  {
323  if (m_farm->IsStockFarmer()) //Stock Farmer
324  {
326  }
328  break;
329  }
330  }
331  }
333  break;
334  case pl_wrye_autumn_roll:
335  if (!m_farm->AutumnRoll(m_field, 0.0, g_date->DayInYear(25, 9) - g_date->DayInYear())) {
337  break;
338  }
339  if (m_farm->IsStockFarmer()) //Stock Farmer
340  {
342  }
344  break;
346  // the rest 20% who did not plough do heavy stubble cultivation
349  break;
350  }
351  if (m_farm->IsStockFarmer()) //Stock Farmer
352  {
354  }
356  break;
357  case pl_wrye_ferti_p3:
358  if (m_ev->m_lock || m_farm->DoIt(45))
359  {
360  if (!m_farm->FP_NPKS(m_field, 0.0, g_date->DayInYear(28, 9) - g_date->DayInYear())) {
362  break;
363  }
364  }
366  break;
367  case pl_wrye_ferti_s3:
368  if (m_ev->m_lock || m_farm->DoIt(45))
369  {
370  if (!m_farm->FA_NPKS(m_field, 0.0, g_date->DayInYear(28, 9) - g_date->DayInYear())) {
372  break;
373  }
374  }
376  break;
378  // 30% will do preseeding cultivation, the rest will do it together with sow
379  if (m_ev->m_lock || m_farm->DoIt(30))
380  {
381  if (!m_farm->PreseedingCultivator(m_field, 0.0, g_date->DayInYear(29, 9) - g_date->DayInYear())) {
383  break;
384  }
386  break;
387  }
389  break;
390  case pl_wrye_autumn_sow:
391  if (cfg_seedcoating_winterrye_on.value() && a_field->GetLandscape()->SupplyShouldSpray()) {
392  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(20, 9) - g_date->DayInYear(),
395  break;
396  }
397  }
398  else {
399  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(20, 9) - g_date->DayInYear())) {
401  break;
402  }
403  }
404  // Here is a fork leading to four parallel events
405  SimpleEvent_(g_date->Date() + 3, pl_wrye_herbicide1, false, m_farm, m_field); // Herbidide thread
406  SimpleEvent_(g_date->Date() + 3, pl_wrye_fungicide1, false, m_farm, m_field); // Fungicide thread
407  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 4) + 365, pl_wrye_growth_regulator1, false, m_farm, m_field); // GR thread
408  if (m_farm->IsStockFarmer()) //Stock Farmer // PK thread
409  {
411  }
412  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wrye_ferti_p4, false, m_farm, m_field);
413  if (m_farm->IsStockFarmer()) //Stock Farmer // Main thread
414  {
416  }
417  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wrye_ferti_p5, false, m_farm, m_field);
418  if (m_farm->IsStockFarmer()) //Stock Farmer // Microelemnts thread
419  {
421  }
422  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 4) + 365, pl_wrye_ferti_p8, false, m_farm, m_field);
423  break;
425  // 70% will do preseeding cultivation with sow
428  break;
429  }
430  // Here is a fork leading to four parallel events
431  SimpleEvent_(g_date->Date() + 3, pl_wrye_herbicide1, false, m_farm, m_field); // Herbidide thread
432  SimpleEvent_(g_date->Date() + 3, pl_wrye_fungicide1, false, m_farm, m_field); // Fungicide thread
433  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 4) + 365, pl_wrye_growth_regulator1, false, m_farm, m_field); // GR thread
434  if (m_farm->IsStockFarmer()) //Stock Farmer // PK thread
435  {
437  }
438  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wrye_ferti_p4, false, m_farm, m_field);
439  if (m_farm->IsStockFarmer()) //Stock Farmer // Main thread
440  {
442  }
443  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wrye_ferti_p5, false, m_farm, m_field);
444  if (m_farm->IsStockFarmer()) //Stock Farmer // Microelemnts thread
445  {
447  }
448  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 4) + 365, pl_wrye_ferti_p8, false, m_farm, m_field);
449  break;
450  case pl_wrye_herbicide1: // The first of the pesticide managements.
451  // Here comes the herbicide thread
452  if (m_ev->m_lock || m_farm->DoIt(50))
453  {
454  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
456  break;
457  }
458  }
460  break;
461  case pl_wrye_herbicide2:
462  if (m_ev->m_lock || m_farm->DoIt(53))
463  {
464  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(10, 4) - g_date->DayInYear())) {
466  break;
467  }
468  }
469  // End of thread
470  break;
471  case pl_wrye_fungicide1:
472  // Here comes the fungicide thread
473  if (m_ev->m_lock || m_farm->DoIt(5))
474  {
475  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
477  break;
478  }
479  }
481  break;
482  case pl_wrye_fungicide2:
483  if (m_ev->m_lock || m_farm->DoIt(78))
484  {
485  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
487  break;
488  }
489  }
490  // End of thread
491  break;
493  // Here comes the GR thread
494  if (m_ev->m_lock || m_farm->DoIt(70))
495  {
496  if (!m_farm->GrowthRegulator(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
498  break;
499  }
500  }
501  // End of thread
502  break;
503  case pl_wrye_ferti_p4:
504  // Here comes the PK thread
505  if (m_ev->m_lock || m_farm->DoIt(58))
506  {
507  if (!m_farm->FP_PK(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
509  break;
510  }
511  }
512  // End of thread
513  break;
514  case pl_wrye_ferti_s4:
515  // Here comes the PK thread
516  if (m_ev->m_lock || m_farm->DoIt(58))
517  {
518  if (!m_farm->FA_PK(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
520  break;
521  }
522  }
523  // End of thread
524  break;
525  case pl_wrye_ferti_p5:
526  // Here comes the MAIN thread
527  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
529  break;
530  }
531  d1 = g_date->Date() + 10;
532  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 4)) {
533  d1 = g_date->OldDays() + g_date->DayInYear(1, 4);
534  }
536  break;
537  case pl_wrye_ferti_s5:
538  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
540  break;
541  }
542  d1 = g_date->Date() + 10;
543  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 4)) {
544  d1 = g_date->OldDays() + g_date->DayInYear(1, 4);
545  }
547  break;
548  case pl_wrye_ferti_p6:
549  if (m_ev->m_lock || m_farm->DoIt(85))
550  {
551  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
553  break;
554  }
555  }
557  break;
558  case pl_wrye_ferti_s6:
559  if (m_ev->m_lock || m_farm->DoIt(85))
560  {
561  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
563  break;
564  }
565  }
567  break;
568  case pl_wrye_ferti_p7:
569  if (m_ev->m_lock || m_farm->DoIt(15))
570  {
571  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(10, 6) - g_date->DayInYear())) {
573  break;
574  }
575  }
577  break;
578  case pl_wrye_ferti_s7:
579  if (m_ev->m_lock || m_farm->DoIt(15))
580  {
581  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(10, 6) - g_date->DayInYear())) {
583  break;
584  }
585  }
587  break;
588  case pl_wrye_ferti_p8:
589  // Here comes the mickroelements thread
590  if (m_ev->m_lock || m_farm->DoIt(24))
591  {
592  if (!m_farm->FP_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
594  break;
595  }
596  }
598  break;
599  case pl_wrye_ferti_s8:
600  if (m_ev->m_lock || m_farm->DoIt(24))
601  {
602  if (!m_farm->FA_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
604  break;
605  }
606  }
608  break;
609  case pl_wrye_ferti_p9:
610  if (m_ev->m_lock || m_farm->DoIt(3))
611  {
612  if (!m_farm->FP_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear())) {
614  break;
615  }
616  }
617  // End of thread
618  break;
619  case pl_wrye_ferti_s9:
620  if (m_ev->m_lock || m_farm->DoIt(3))
621  {
622  if (!m_farm->FA_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear())) {
624  break;
625  }
626  }
627  // End of thread
628  break;
629  case pl_wrye_harvest:
630  // Here the MAIN thread continues
631  // We don't move harvest days
632  if (!m_farm->Harvest(m_field, 0.0, m_field->GetMDates(0, 0) - g_date->DayInYear())) {
634  break;
635  }
637  break;
638 
639 
641  if (m_farm->IsStockFarmer()) //Stock Farmer
642  {
643  // 10% of stock farmers will do straw chopping, but rest will do hay bailing instead
644  if (m_ev->m_lock || m_farm->DoIt(10))
645  {
646  if (m_field->GetMConstants(0) == 0) {
647  if (!m_farm->StrawChopping(m_field, 0.0, -1)) { // raise an error
648  g_msg->Warn(WARN_BUG, "PLWinterRye::Do(): failure in 'StrawChopping' execution", "");
649  exit(1);
650  }
651  }
652  else {
653  if (!m_farm->StrawChopping(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
655  break;
656  }
657  else
658  {
659  // Queue up the next event
661  break;
662  }
663  }
664 
665  }
667  break;
668  }
669  else
670  {
671  // 90% of arable farmers will do straw chopping, but rest will do hay bailing instead
672  if (m_ev->m_lock || m_farm->DoIt(90))
673  {
674  if (m_field->GetMConstants(0) == 0) {
675  if (!m_farm->StrawChopping(m_field, 0.0, -1)) { // raise an error
676  g_msg->Warn(WARN_BUG, "PLWinterRye::Do(): failure in 'StrawChopping' execution", "");
677  exit(1);
678  }
679  }
680  else {
681  if (!m_farm->StrawChopping(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
683  break;
684  }
685  else
686  {
687  // Queue up the next event
689  break;
690  }
691  }
692 
693  }
695  break;
696  }
697  case pl_wrye_hay_bailing:
698  if (m_field->GetMConstants(1) == 0) {
699  if (!m_farm->HayBailing(m_field, 0.0, -1)) { // raise an error
700  g_msg->Warn(WARN_BUG, "PLWinterRye::Do(): failure in 'HayBailing' execution", "");
701  exit(1);
702  }
703  }
704  else {
705  if (!m_farm->HayBailing(m_field, 0.0, m_field->GetMDates(1, 1) - g_date->DayInYear())) {
707  break;
708  }
709  }
710  if (m_farm->IsStockFarmer()) //Stock Farmer
711  {
713  }
715  break;
716  case pl_wrye_ferti_p10:
717  if (m_ev->m_lock || m_farm->DoIt(8))
718  {
719  if (m_field->GetMConstants(2) == 0) {
720  if (!m_farm->FP_RSM(m_field, 0.0, -1)) { // raise an error
721  g_msg->Warn(WARN_BUG, "PLWinterRye::Do(): failure in 'FP_RSM' execution", "");
722  exit(1);
723  }
724  }
725  else {
726  if (!m_farm->FP_RSM(m_field, 0.0, m_field->GetMDates(1, 2) - g_date->DayInYear())) {
728  break;
729  }
730  }
731  }
732  if (m_farm->IsStockFarmer()) //Stock Farmer
733  {
735  }
737  break;
738  case pl_wrye_ferti_s10:
739  if (m_ev->m_lock || m_farm->DoIt(8))
740  {
741  if (m_field->GetMConstants(2) == 0) {
742  if (!m_farm->FA_RSM(m_field, 0.0, -1)) { // raise an error
743  g_msg->Warn(WARN_BUG, "PLWinterRye::Do(): failure in 'FA_RSM' execution", "");
744  exit(1);
745  }
746  }
747  else {
748  if (!m_farm->FA_RSM(m_field, 0.0, m_field->GetMDates(1, 2) - g_date->DayInYear())) {
750  break;
751  }
752  }
753  }
754  if (m_farm->IsStockFarmer()) //Stock Farmer
755  {
757  }
759  break;
760  case pl_wrye_ferti_p11:
761  if (m_ev->m_lock || m_farm->DoIt(21))
762  {
763  if (m_field->GetMConstants(3) == 0) {
764  if (!m_farm->FP_Calcium(m_field, 0.0, -1)) { // raise an error
765  g_msg->Warn(WARN_BUG, "PLWinterRye::Do(): failure in 'FP_Calcium' execution", "");
766  exit(1);
767  }
768  }
769  else {
770  if (!m_farm->FP_Calcium(m_field, 0.0, m_field->GetMDates(1, 3) - g_date->DayInYear())) {
772  break;
773  }
774  }
775  }
776  done = true;
777  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
778  // END of MAIN THREAD
779  break;
780  case pl_wrye_ferti_s11:
781  if (m_ev->m_lock || m_farm->DoIt(21))
782  {
783  if (m_field->GetMConstants(3) == 0) {
784  if (!m_farm->FA_Calcium(m_field, 0.0, -1)) { // raise an error
785  g_msg->Warn(WARN_BUG, "PLWinterRye::Do(): failure in 'FA_Calcium' execution", "");
786  exit(1);
787  }
788  }
789  else {
790  if (!m_farm->FA_Calcium(m_field, 0.0, m_field->GetMDates(1, 3) - g_date->DayInYear())) {
792  break;
793  }
794  }
795  }
796  done = true;
797  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
798  // END of MAIN THREAD
799  break;
800  default:
801  g_msg->Warn(WARN_BUG, "PLWinterRye::Do(): "
802  "Unknown event type! ", "");
803  exit(1);
804  }
805  return done;
806 }

References Farm::AutumnHarrow(), Farm::AutumnPlough(), Farm::AutumnRoll(), Farm::AutumnSow(), cfg_seedcoating_product_amounts, cfg_seedcoating_winterrye_on, LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), Farm::DoIt(), 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::GetMConstants(), LE::GetMDates(), LE::GetOwner(), LE::GetPoly(), Farm::GetPreviousTov(), LE::GetRotIndex(), Farm::GetType(), Calendar::GetYearNumber(), Farm::GrowthRegulator(), Farm::Harvest(), Farm::HayBailing(), Farm::HerbicideTreat(), Farm::IsStockFarmer(), 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_wrye_autumn_harrow1, pl_wrye_autumn_harrow2, pl_wrye_autumn_plough, pl_wrye_autumn_roll, pl_wrye_autumn_sow, PL_WRYE_FERTI_P1, pl_wrye_ferti_p1, pl_wrye_ferti_p10, pl_wrye_ferti_p11, pl_wrye_ferti_p2, pl_wrye_ferti_p3, pl_wrye_ferti_p4, pl_wrye_ferti_p5, pl_wrye_ferti_p6, pl_wrye_ferti_p7, pl_wrye_ferti_p8, pl_wrye_ferti_p9, PL_WRYE_FERTI_S1, pl_wrye_ferti_s1, pl_wrye_ferti_s10, pl_wrye_ferti_s11, pl_wrye_ferti_s2, pl_wrye_ferti_s3, pl_wrye_ferti_s4, pl_wrye_ferti_s5, pl_wrye_ferti_s6, pl_wrye_ferti_s7, pl_wrye_ferti_s8, pl_wrye_ferti_s9, pl_wrye_fungicide1, pl_wrye_fungicide2, pl_wrye_growth_regulator1, pl_wrye_harvest, pl_wrye_hay_bailing, pl_wrye_herbicide1, pl_wrye_herbicide2, pl_wrye_preseeding_cultivator, pl_wrye_preseeding_cultivator_sow, pl_wrye_start, pl_wrye_straw_chopping, pl_wrye_stubble_cultivator_heavy, pl_wrye_stubble_harrow, PL_WRYE_STUBBLE_PLOUGH, pl_wrye_stubble_plough, ppp_1, Farm::PreseedingCultivator(), Farm::PreseedingCultivatorSow(), LE::SetMConstants(), LE::SetMDates(), Crop::SimpleEvent_(), Farm::StrawChopping(), Farm::StubbleCultivatorHeavy(), Farm::StubbleHarrowing(), Farm::StubblePlough(), tof_OptimisingFarm, tov_PLWinterRye, CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), and WARN_BUG.

◆ SetUpFarmCategoryInformation()

void PLWinterRye::SetUpFarmCategoryInformation ( )
inline
104  {
105  const int elements = 2 + (pl_wrye_foobar - PLWINTERRYE_BASE);
107 
108  FarmManagementCategory catlist[elements] =
109  {
110  fmc_Others, // zero element unused but must be here
111  fmc_Others,//pl_wrye_start = 1, // Compulsory, must always be 1 (one).
112  fmc_Others,//pl_wrye_sleep_all_day = PLWINTERRYE_BASE,
113  fmc_Fertilizer,//pl_wrye_ferti_p1, // 20401
114  fmc_Fertilizer,//pl_wrye_ferti_s1,
115  fmc_Cultivation,//pl_wrye_stubble_plough,
116  fmc_Cultivation,//pl_wrye_autumn_harrow1,
117  fmc_Cultivation,//pl_wrye_autumn_harrow2,
118  fmc_Cultivation,//pl_wrye_stubble_harrow,
119  fmc_Fertilizer,//pl_wrye_ferti_p2,
120  fmc_Fertilizer,//pl_wrye_ferti_s2,
121  fmc_Cultivation,//pl_wrye_autumn_plough,
122  fmc_Cultivation,//pl_wrye_autumn_roll, // 20410
123  fmc_Cultivation,//pl_wrye_stubble_cultivator_heavy,
124  fmc_Fertilizer,//pl_wrye_ferti_p3,
125  fmc_Fertilizer,//pl_wrye_ferti_s3,
126  fmc_Cultivation,//pl_wrye_preseeding_cultivator,
127  fmc_Cultivation,//pl_wrye_preseeding_cultivator_sow,
128  fmc_Others,//pl_wrye_autumn_sow, // 20416
129  fmc_Herbicide,//pl_wrye_herbicide1,
130  fmc_Fungicide,//pl_wrye_fungicide1,
131  fmc_Fertilizer,//pl_wrye_ferti_p4,
132  fmc_Fertilizer,//pl_wrye_ferti_s4, // 20420
133  fmc_Fertilizer,//pl_wrye_ferti_p5,
134  fmc_Fertilizer,//pl_wrye_ferti_s5,
135  fmc_Fertilizer,//pl_wrye_ferti_p6,
136  fmc_Fertilizer,//pl_wrye_ferti_s6,
137  fmc_Fertilizer,//pl_wrye_ferti_p7,
138  fmc_Fertilizer,//pl_wrye_ferti_s7,
139  fmc_Fertilizer,//pl_wrye_ferti_p8,
140  fmc_Fertilizer,//pl_wrye_ferti_s8,
141  fmc_Fertilizer,//pl_wrye_ferti_p9,
142  fmc_Fertilizer,//pl_wrye_ferti_s9, // 20430
143  fmc_Fertilizer,//pl_wrye_herbicide2,
144  fmc_Fertilizer,//pl_wrye_fungicide2,
145  fmc_Others,//pl_wrye_growth_regulator1,
146  fmc_Harvest,//pl_wrye_harvest,
147  fmc_Others,//pl_wrye_straw_chopping,
148  fmc_Others,//pl_wrye_hay_bailing,
149  fmc_Fertilizer,//pl_wrye_ferti_p10,
150  fmc_Fertilizer,//pl_wrye_ferti_s10,
151  fmc_Fertilizer,//pl_wrye_ferti_p11,
152  fmc_Fertilizer//pl_wrye_ferti_s11, // 20440
153  };
154  // Iterate over the catlist elements and copy them to vector
155  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
156 
157  }

References fmc_Cultivation, fmc_Fertilizer, fmc_Fungicide, fmc_Harvest, fmc_Herbicide, fmc_Others, Crop::m_base_elements_no, Crop::m_ManagementCategories, pl_wrye_foobar, and PLWINTERRYE_BASE.

Referenced by PLWinterRye().


The documentation for this class was generated from the following files:
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
pl_wrye_ferti_s1
Definition: PLWinterRye.h:41
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
cfg_seedcoating_winterrye_on
CfgBool cfg_seedcoating_winterrye_on
Turn on seed coating for winter rye.
pl_wrye_ferti_s7
Definition: PLWinterRye.h:65
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_WRYE_STUBBLE_PLOUGH
#define PL_WRYE_STUBBLE_PLOUGH
Definition: PLWinterRye.h:30
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
pl_wrye_growth_regulator1
Definition: PLWinterRye.h:72
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::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
pl_wrye_autumn_harrow1
Definition: PLWinterRye.h:43
pl_wrye_ferti_s4
Definition: PLWinterRye.h:59
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_wrye_ferti_p9
Definition: PLWinterRye.h:68
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_wrye_ferti_p7
Definition: PLWinterRye.h:64
pl_wrye_ferti_p8
Definition: PLWinterRye.h:66
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
pl_wrye_ferti_p11
Definition: PLWinterRye.h:78
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
Farm::GetPreviousTov
TTypesOfVegetation GetPreviousTov(int a_index)
Definition: Farm.h:966
pl_wrye_harvest
Definition: PLWinterRye.h:73
pl_wrye_ferti_s2
Definition: PLWinterRye.h:47
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
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
FarmEvent::m_startday
int m_startday
Definition: Farm.h:385
pl_wrye_autumn_sow
Definition: PLWinterRye.h:55
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
pl_wrye_autumn_harrow2
Definition: PLWinterRye.h:44
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_wrye_autumn_plough
Definition: PLWinterRye.h:48
pl_wrye_preseeding_cultivator_sow
Definition: PLWinterRye.h:54
CfgBool::value
bool value() const
Definition: Configurator.h:164
PL_WRYE_FERTI_S1
#define PL_WRYE_FERTI_S1
Definition: PLWinterRye.h:29
pl_wrye_ferti_p6
Definition: PLWinterRye.h:62
pl_wrye_stubble_harrow
Definition: PLWinterRye.h:45
pl_wrye_ferti_p4
Definition: PLWinterRye.h:58
tov_PLWinterRye
Definition: LandscapeFarmingEnums.h:236
pl_wrye_ferti_s5
Definition: PLWinterRye.h:61
pl_wrye_ferti_s11
Definition: PLWinterRye.h:79
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_wrye_stubble_cultivator_heavy
Definition: PLWinterRye.h:50
pl_wrye_ferti_s6
Definition: PLWinterRye.h:63
Calendar::Date
long Date(void)
Definition: Calendar.h:57
pl_wrye_start
Definition: PLWinterRye.h:38
pl_wrye_herbicide2
Definition: PLWinterRye.h:70
pl_wrye_herbicide1
Definition: PLWinterRye.h:56
pl_wrye_foobar
Definition: PLWinterRye.h:80
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
pl_wrye_ferti_s3
Definition: PLWinterRye.h:52
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
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 ...
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
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_wrye_fungicide1
Definition: PLWinterRye.h:57
pl_wrye_fungicide2
Definition: PLWinterRye.h:71
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
pl_wrye_stubble_plough
Definition: PLWinterRye.h:42
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
FarmEvent::m_next_tov
TTypesOfVegetation m_next_tov
Definition: Farm.h:390
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
PL_WRYE_FERTI_P1
#define PL_WRYE_FERTI_P1
A flag used to indicate autumn ploughing status.
Definition: PLWinterRye.h:28
PLWINTERRYE_BASE
#define PLWINTERRYE_BASE
Definition: PLWinterRye.h:24
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
pl_wrye_straw_chopping
Definition: PLWinterRye.h:74
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
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
tof_OptimisingFarm
Definition: LandscapeFarmingEnums.h:696
pl_wrye_ferti_p2
Definition: PLWinterRye.h:46
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
pl_wrye_ferti_s8
Definition: PLWinterRye.h:67
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
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
pl_wrye_preseeding_cultivator
Definition: PLWinterRye.h:53
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_wrye_hay_bailing
Definition: PLWinterRye.h:75
Farm::GrowthRegulator
virtual bool GrowthRegulator(LE *a_field, double a_user, int a_days)
Apply growth regulator to a_field.
Definition: FarmFuncs.cpp:2070
pl_wrye_ferti_p1
Definition: PLWinterRye.h:40
LE::GetOwner
Farm * GetOwner(void)
Definition: Elements.h:256
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
pl_wrye_ferti_p3
Definition: PLWinterRye.h:51
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
pl_wrye_ferti_p5
Definition: PLWinterRye.h:60
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_wrye_ferti_s10
Definition: PLWinterRye.h:77
pl_wrye_autumn_roll
Definition: PLWinterRye.h:49
pl_wrye_ferti_p10
Definition: PLWinterRye.h:76
PLWinterRye::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: PLWinterRye.h:104
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
pl_wrye_ferti_s9
Definition: PLWinterRye.h:69
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
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