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

PLWinterTriticale class
. More...

#include <PLWinterTriticale.h>

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

PLWinterTriticale class
.

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

◆ PLWinterTriticale()

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

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

Member Function Documentation

◆ Do()

bool PLWinterTriticale::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 triticale.

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_PLWinterTriticale; // 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_wt_start:
82  {
83  // pl_wt_start just sets up all the starting conditions and reference dates that are needed to start a pl_wt
84  PL_WT_FERTI_P1 = false;
85  PL_WT_FERTI_S1 = false;
86  PL_WT_STUBBLE_PLOUGH = false;
87  a_field->ClearManagementActionSum();
88  // Set up the date management stuff
89  // The next bit of code just allows for altering dates after harvest if it is necessary
90  // to allow for a crop which starts its management early.
91 
92  // 5 start and stop dates for all 'movable' events for this crop
93  int noDates = 4;
94  m_field->SetMDates(0, 0, g_date->DayInYear(5, 8)); // last possible day of harvest
95  m_field->SetMDates(1, 0, g_date->DayInYear(10, 8)); // last possible day of starw chopping, equal to harvest in this case
96  m_field->SetMDates(0, 1, 0); // start day of hay bailing (not used as it depend on previous treatment)
97  m_field->SetMDates(1, 1, g_date->DayInYear(15, 8)); // end day of hay bailing
98  m_field->SetMDates(0, 2, 0); // start day of RSM
99  m_field->SetMDates(1, 2, g_date->DayInYear(25, 8)); // end day of RSM
100  m_field->SetMDates(0, 3, 0); // start day of calcium application
101  m_field->SetMDates(1, 3, g_date->DayInYear(25, 8)); // end day of calcium application
102  // Can be up to 10 of these. If the shortening code is triggered
103  // then these will be reduced in value to 0
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, "PLWinterTriticale::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, "PLWinterTriticale::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, "PLWinterTriticale::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
163  if (m_farm->IsStockFarmer()) //Stock Farmer
164  {
166  }
168  break;
169  }
170  }//if
171 
172  // End single block date checking code. Please see next line comment as well.
173  // Reinit d1 to first possible starting date.
174  d1 = g_date->OldDays() + g_date->DayInYear(20, 7);
175  // OK, let's go.
176  // Here we queue up the first event - this differs depending on whether we have a
177  // stock or arable farmer
178  if (m_farm->IsStockFarmer()) { // StockFarmer
180  }
181  else SimpleEvent_(d1, pl_wt_ferti_p1, false, m_farm, m_field);
182  }
183  break;
184 
185  // This is the first real farm operation
186  case pl_wt_ferti_p1:
187  // In total 10% of arable farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
188  // We therefore assume that half of them (5%) do it now
189  if (m_ev->m_lock || m_farm->DoIt(5))
190  {
191  if (!m_farm->FP_Slurry(m_field, 0.0, g_date->DayInYear(20, 9) - g_date->DayInYear())) {
192  // If we don't suceed on the first try, then try and try again (until 20/8 when we will suceed)
194  break;
195  }
196  else
197  {
198  //Rest of farmers do slurry before autumn plough/stubble cultivation so we need to remeber who already did it
199  PL_WT_FERTI_P1 = true;
200  }
201  }
202  // Queue up the next event -in this case stubble ploughing
204  break;
205  case pl_wt_ferti_s1:
206  // In total 80% of stock farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
207  // We therefore assume that half of them (40%) do it now
208  if (m_ev->m_lock || m_farm->DoIt(40))
209  {
210  if (!m_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(20, 9) - g_date->DayInYear())) {
212  break;
213  }
214  else
215  {
216  //Rest of farmers do slurry before autumn plough/stubble cultivation so we need to remeber who already did it
217  PL_WT_FERTI_S1 = true;
218  }
219  }
220  // Queue up the next event -in this case stubble ploughing
222  break;
224  // 40% will do stubble plough, but rest will get away with non-inversion cultivation
225  if (m_ev->m_lock || m_farm->DoIt(40))
226  {
227  if (!m_farm->StubblePlough(m_field, 0.0, g_date->DayInYear(20, 9) - g_date->DayInYear())) {
229  break;
230  }
231  else
232  {
233  // 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
234  PL_WT_STUBBLE_PLOUGH = true;
235  // Queue up the next event
237  break;
238  }
239  }
241  break;
243  if (!m_farm->AutumnHarrow(m_field, 0.0, g_date->DayInYear(20, 9) - g_date->DayInYear())) {
245  break;
246  }
248  break;
250  if (m_ev->m_lock || m_farm->DoIt(40))
251  {
252  if (!m_farm->AutumnHarrow(m_field, 0.0, g_date->Date() + 7 - g_date->DayInYear())) {
254  break;
255  }
256  }
257  d1 = g_date->Date() + 1;
258  if (d1 < g_date->OldDays() + g_date->DayInYear(20, 8)) {
259  d1 = g_date->OldDays() + g_date->DayInYear(20, 8);
260  }
261  if (m_farm->IsStockFarmer()) //Stock Farmer
262  {
264  }
265  else SimpleEvent_(d1, pl_wt_ferti_p2, false, m_farm, m_field);
266  break;
268  if (!m_farm->StubbleHarrowing(m_field, 0.0, g_date->DayInYear(25, 9) - g_date->DayInYear())) {
270  break;
271  }
272  d1 = g_date->Date() + 1;
273  if (d1 < g_date->OldDays() + g_date->DayInYear(20, 8)) {
274  d1 = g_date->OldDays() + g_date->DayInYear(20, 8);
275  }
276  if (m_farm->IsStockFarmer()) //Stock Farmer
277  {
279  }
280  else SimpleEvent_(d1, pl_wt_ferti_p2, false, m_farm, m_field);
281  break;
282  case pl_wt_ferti_p2:
283  // In total 10% of arable farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
284  // We therefore assume that half of them (5%) do it now (if haven't done before)
285  if ((m_ev->m_lock || m_farm->DoIt(static_cast<int>((5.0/95.0)*100)))&&(PL_WT_FERTI_P1==false))
286  {
287  if (!m_farm->FP_Slurry(m_field, 0.0, g_date->DayInYear(30, 9) - g_date->DayInYear())) {
289  break;
290  }
291  }
293  break;
294  case pl_wt_ferti_s2:
295  // In total 80% of stock farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
296  // We therefore assume that half of them (40%) do it now (if haven't done before)
297  if ((m_ev->m_lock || m_farm->DoIt(static_cast<int>((40.0/60.0)*100))) && (PL_WT_FERTI_S1==false))
298  {
299  if (!m_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(30, 9) - g_date->DayInYear())) {
301  break;
302  }
303  }
305  break;
306  case pl_wt_autumn_plough:
307  if (m_ev->m_lock || m_farm->DoIt(80))
308  {
309  if (!m_farm->AutumnPlough(m_field, 0.0, g_date->DayInYear(30, 9) - g_date->DayInYear())) {
311  break;
312  }
313  else
314  {
315  // Queue up the next event and if it's late (after 15/9) it has to be rolling, else next fertilizer
316  d1 = g_date->OldDays() + g_date->DayInYear(15, 9);
317  if (g_date->Date() > d1)
318  {
320  break;
321  }
322  else
323  {
324  if (m_farm->IsStockFarmer()) //Stock Farmer
325  {
327  }
329  break;
330  }
331  }
332  }
334  break;
335  case pl_wt_autumn_roll:
336  if (!m_farm->AutumnRoll(m_field, 0.0, g_date->DayInYear(30, 9) - g_date->DayInYear())) {
338  break;
339  }
340  if (m_farm->IsStockFarmer()) //Stock Farmer
341  {
343  }
345  break;
347  // the rest 20% who did not plough do heavy stubble cultivation
350  break;
351  }
352  if (m_farm->IsStockFarmer()) //Stock Farmer
353  {
355  }
357  break;
358  case pl_wt_ferti_p3:
359  if (m_ev->m_lock || m_farm->DoIt(45))
360  {
361  if (!m_farm->FP_NPKS(m_field, 0.0, g_date->DayInYear(3, 10) - g_date->DayInYear())) {
363  break;
364  }
365  }
367  break;
368  case pl_wt_ferti_s3:
369  if (m_ev->m_lock || m_farm->DoIt(45))
370  {
371  if (!m_farm->FA_NPKS(m_field, 0.0, g_date->DayInYear(3, 10) - g_date->DayInYear())) {
373  break;
374  }
375  }
377  break;
379  // 30% will do preseeding cultivation, the rest will do it together with sow
380  if (m_ev->m_lock || m_farm->DoIt(30))
381  {
382  if (!m_farm->PreseedingCultivator(m_field, 0.0, g_date->DayInYear(4, 10) - g_date->DayInYear())) {
384  break;
385  }
387  break;
388  }
390  break;
391  case pl_wt_autumn_sow:
392  if (cfg_seedcoating_wintertriticale_on.value() && a_field->GetLandscape()->SupplyShouldSpray()) {
393  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(5, 10) - g_date->DayInYear(),
396  break;
397  }
398  }
399  else {
400  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(5, 10) - g_date->DayInYear())) {
402  break;
403  }
404  }
405 
406  // Here is a fork leading to four parallel events
411  if (m_farm->IsStockFarmer()) //Stock Farmer
412  {
414  }
415  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wt_ferti_p4, false, m_farm, m_field);
416  if (m_farm->IsStockFarmer()) //Stock Farmer
417  {
419  }
420  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wt_ferti_p5, false, m_farm, m_field);
421  if (m_farm->IsStockFarmer()) //Stock Farmer
422  {
424  }
425  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 4) + 365, pl_wt_ferti_p8, false, m_farm, m_field);
426  break;
428  // 70% will do preseeding cultivation with sow
431  break;
432  }
433  // Here is a fork leading to four parallel events
438  if (m_farm->IsStockFarmer()) //Stock Farmer
439  {
441  }
442  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wt_ferti_p4, false, m_farm, m_field);
443  if (m_farm->IsStockFarmer()) //Stock Farmer
444  {
446  }
447  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wt_ferti_p5, false, m_farm, m_field);
448  if (m_farm->IsStockFarmer()) //Stock Farmer
449  {
451  }
452  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(5, 4) + 365, pl_wt_ferti_p8, false, m_farm, m_field);
453  break;
454  case pl_wt_herbicide1: // The first of the pesticide managements.
455  // Here comes the herbicide thread
456  if (m_ev->m_lock || m_farm->DoIt(80))
457  {
458  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
460  break;
461  }
462  }
464  break;
465  case pl_wt_herbicide2:
466  if (m_ev->m_lock || m_farm->DoIt(73))
467  {
468  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(10, 4) - g_date->DayInYear())) {
470  break;
471  }
472  }
473  // End of thread
474  break;
475  case pl_wt_fungicide1:
476  // Here comes the fungicide thread
477  if (m_ev->m_lock || m_farm->DoIt(5))
478  {
479  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
481  break;
482  }
483  }
485  break;
486  case pl_wt_fungicide2:
487  if (m_ev->m_lock || m_farm->DoIt(78))
488  {
489  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
491  break;
492  }
493  }
494  d1 = g_date->Date() + 14;
495  if (d1 < g_date->OldDays() + g_date->DayInYear(10, 5)) {
496  d1 = g_date->OldDays() + g_date->DayInYear(10, 5);
497  }
499  break;
500  case pl_wt_fungicide3:
501  if (m_ev->m_lock || m_farm->DoIt(68))
502  {
503  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(5, 6) - g_date->DayInYear())) {
505  break;
506  }
507  }
509  break;
510  case pl_wt_fungicide4:
511  if (m_ev->m_lock || m_farm->DoIt(10))
512  {
513  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(20, 6) - g_date->DayInYear())) {
515  break;
516  }
517  }
518  // End of thread
519  break;
520  case pl_wt_insecticide1:
521  // Here comes the insecticide thread
522  if (m_ev->m_lock || m_farm->DoIt(5))
523  {
524  if (m_field->GetGreenBiomass() <= 0) {
526  }
527  else
528  {
529  // here we check whether we are using ERA pesticide or not
530  d1 = g_date->DayInYear(15, 11) - g_date->DayInYear();
531  if (!cfg_pest_wintertriticale_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
532  {
533  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
534  }
535  else {
537  }
538  if (!flag) {
540  break;
541  }
543  break;
544  }
545  }
547  break;
548  case pl_wt_insecticide2:
549  if (m_ev->m_lock || m_farm->DoIt(67))
550  {
551  // here we check whether we are using ERA pesticide or not
552  d1 = g_date->DayInYear(10, 6) - g_date->DayInYear();
553  if (!cfg_pest_wintertriticale_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
554  {
555  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
556  }
557  else {
559  }
560  if (!flag) {
562  break;
563  }
564  }
566  break;
567  case pl_wt_insecticide3:
568  if (m_ev->m_lock || m_farm->DoIt(17))
569  {
570  // here we check whether we are using ERA pesticide or not
571  d1 = g_date->DayInYear(25, 6) - g_date->DayInYear();
572  if (!cfg_pest_wintertriticale_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
573  {
574  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
575  }
576  else {
578  }
579  if (!flag) {
581  break;
582  }
583  }
584  // End of thread
585  break;
587  // Here comes the GR thread
588  if (m_ev->m_lock || m_farm->DoIt(63))
589  {
590  if (!m_farm->GrowthRegulator(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
592  break;
593  }
594  }
595  // End of thread
596  break;
597  case pl_wt_ferti_p4:
598  // Here comes the PK thread
599  if (m_ev->m_lock || m_farm->DoIt(50))
600  {
601  if (!m_farm->FP_PK(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
603  break;
604  }
605  }
606  // End of thread
607  break;
608  case pl_wt_ferti_s4:
609  // Here comes the PK thread
610  if (m_ev->m_lock || m_farm->DoIt(50))
611  {
612  if (!m_farm->FA_PK(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
614  break;
615  }
616  }
617  // End of thread
618  break;
619  case pl_wt_ferti_p5:
620  // Here comes the MAIN thread
621  if (m_ev->m_lock || m_farm->DoIt(99))
622  {
623  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
625  break;
626  }
627  }
628  d1 = g_date->Date() + 10;
629  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 4)) {
630  d1 = g_date->OldDays() + g_date->DayInYear(1, 4);
631  }
633  break;
634  case pl_wt_ferti_s5:
635  if (m_ev->m_lock || m_farm->DoIt(99))
636  {
637  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
639  break;
640  }
641  }
642  d1 = g_date->Date() + 10;
643  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 4)) {
644  d1 = g_date->OldDays() + g_date->DayInYear(1, 4);
645  }
647  break;
648  case pl_wt_ferti_p6:
649  if (m_ev->m_lock || m_farm->DoIt(91))
650  {
651  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
653  break;
654  }
655  }
657  break;
658  case pl_wt_ferti_s6:
659  if (m_ev->m_lock || m_farm->DoIt(91))
660  {
661  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
663  break;
664  }
665  }
667  break;
668  case pl_wt_ferti_p7:
669  if (m_ev->m_lock || m_farm->DoIt(35))
670  {
671  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(10, 6) - g_date->DayInYear())) {
673  break;
674  }
675  }
677  break;
678  case pl_wt_ferti_s7:
679  if (m_ev->m_lock || m_farm->DoIt(35))
680  {
681  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(10, 6) - g_date->DayInYear())) {
683  break;
684  }
685  }
687  break;
688  case pl_wt_ferti_p8:
689  // Here comes the mickroelements thread
690  if (m_ev->m_lock || m_farm->DoIt(53))
691  {
692  if (!m_farm->FP_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
694  break;
695  }
696  }
698  break;
699  case pl_wt_ferti_s8:
700  if (m_ev->m_lock || m_farm->DoIt(53))
701  {
702  if (!m_farm->FA_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
704  break;
705  }
706  }
708  break;
709  case pl_wt_ferti_p9:
710  if (m_ev->m_lock || m_farm->DoIt(5))
711  {
712  if (!m_farm->FP_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear())) {
714  break;
715  }
716  }
717  // End of thread
718  break;
719  case pl_wt_ferti_s9:
720  if (m_ev->m_lock || m_farm->DoIt(5))
721  {
722  if (!m_farm->FA_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear())) {
724  break;
725  }
726  }
727  // End of thread
728  break;
729  case pl_wt_harvest:
730  // Here the MAIN thread continues
731  // We don't move harvest days
732  if (!m_farm->Harvest(m_field, 0.0, m_field->GetMDates(0, 0) - g_date->DayInYear())) {
734  break;
735  }
737  break;
739  if (m_farm->IsStockFarmer()) //Stock Farmer
740  {
741  // 10% of stock farmers will do straw chopping, but rest will do hay bailing instead
742  if (m_ev->m_lock || m_farm->DoIt(10))
743  {
744  if (m_field->GetMConstants(0) == 0) {
745  if (!m_farm->StrawChopping(m_field, 0.0, -1)) { // raise an error
746  g_msg->Warn(WARN_BUG, "PLWinterTriticale::Do(): failure in 'StrawChopping' execution", "");
747  exit(1);
748  }
749  }
750  else {
751  if (!m_farm->StrawChopping(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
753  break;
754  }
755  else
756  {
757  // Queue up the next event
759  break;
760  }
761  }
762 
763  }
765  break;
766  }
767  else
768  {
769  // 90% of arable farmers will do straw chopping, but rest will do hay bailing instead
770  if (m_ev->m_lock || m_farm->DoIt(90))
771  {
772  if (m_field->GetMConstants(0) == 0) {
773  if (!m_farm->StrawChopping(m_field, 0.0, -1)) { // raise an error
774  g_msg->Warn(WARN_BUG, "PLWinterTriticale::Do(): failure in 'StrawChopping' execution", "");
775  exit(1);
776  }
777  }
778  else {
779  if (!m_farm->StrawChopping(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
781  break;
782  }
783  else
784  {
785  // Queue up the next event
787  break;
788  }
789  }
790 
791  }
793  break;
794  }
795  case pl_wt_hay_bailing:
796  if (m_field->GetMConstants(1) == 0) {
797  if (!m_farm->HayBailing(m_field, 0.0, -1)) { // raise an error
798  g_msg->Warn(WARN_BUG, "PLWinterTriticale::Do(): failure in 'HayBailing' execution", "");
799  exit(1);
800  }
801  }
802  else {
803  if (!m_farm->HayBailing(m_field, 0.0, m_field->GetMDates(1, 1) - g_date->DayInYear())) {
805  break;
806  }
807  }
808  if (m_farm->IsStockFarmer()) //Stock Farmer
809  {
811  }
813  break;
814  case pl_wt_ferti_p10:
815  if (m_ev->m_lock || m_farm->DoIt(18))
816  {
817  if (m_field->GetMConstants(2) == 0) {
818  if (!m_farm->FP_RSM(m_field, 0.0, -1)) { // raise an error
819  g_msg->Warn(WARN_BUG, "PLWinterTriticale::Do(): failure in 'FP_RSM' execution", "");
820  exit(1);
821  }
822  }
823  else {
824  if (!m_farm->FP_RSM(m_field, 0.0, m_field->GetMDates(1, 2) - g_date->DayInYear())) {
826  break;
827  }
828  }
829  }
830  if (m_farm->IsStockFarmer()) //Stock Farmer
831  {
833  }
835  break;
836  case pl_wt_ferti_s10:
837  if (m_ev->m_lock || m_farm->DoIt(18))
838  {
839  if (m_field->GetMConstants(2) == 0) {
840  if (!m_farm->FA_RSM(m_field, 0.0, -1)) { // raise an error
841  g_msg->Warn(WARN_BUG, "PLWinterTriticale::Do(): failure in 'FA_RSM' execution", "");
842  exit(1);
843  }
844  }
845  else {
846  if (!m_farm->FA_RSM(m_field, 0.0, m_field->GetMDates(1, 2) - g_date->DayInYear())) {
848  break;
849  }
850  }
851  }
852  if (m_farm->IsStockFarmer()) //Stock Farmer
853  {
855  }
857  break;
858  case pl_wt_ferti_p11:
859  if (m_ev->m_lock || m_farm->DoIt(21))
860  {
861  if (m_field->GetMConstants(3) == 0) {
862  if (!m_farm->FP_Calcium(m_field, 0.0, -1)) { // raise an error
863  g_msg->Warn(WARN_BUG, "PLWinterTriticale::Do(): failure in 'FP_Calcium' execution", "");
864  exit(1);
865  }
866  }
867  else {
868  if (!m_farm->FP_Calcium(m_field, 0.0, m_field->GetMDates(1, 3) - g_date->DayInYear())) {
870  break;
871  }
872  }
873  }
874  done = true;
875  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
876  // END of MAIN THREAD
877  break;
878  case pl_wt_ferti_s11:
879  if (m_ev->m_lock || m_farm->DoIt(21))
880  {
881  if (m_field->GetMConstants(3) == 0) {
882  if (!m_farm->FA_Calcium(m_field, 0.0, -1)) { // raise an error
883  g_msg->Warn(WARN_BUG, "PLWinterTriticale::Do(): failure in 'FA_Calcium' execution", "");
884  exit(1);
885  }
886  }
887  else {
888  if (!m_farm->FA_Calcium(m_field, 0.0, m_field->GetMDates(1, 3) - g_date->DayInYear())) {
890  break;
891  }
892  }
893  }
894  done = true;
895  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
896  // END of MAIN THREAD
897  break;
898  default:
899  g_msg->Warn(WARN_BUG, "PLWinterTriticale::Do(): "
900  "Unknown event type! ", "");
901  exit(1);
902  }
903  return done;
904 }

References Farm::AutumnHarrow(), Farm::AutumnPlough(), Farm::AutumnRoll(), Farm::AutumnSow(), cfg_pest_product_amounts, cfg_pest_wintertriticale_on, cfg_seedcoating_product_amounts, cfg_seedcoating_wintertriticale_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::GetGreenBiomass(), LE::GetMConstants(), LE::GetMDates(), LE::GetOwner(), LE::GetPoly(), Farm::GetPreviousTov(), LE::GetRotIndex(), Farm::GetType(), Calendar::GetYearNumber(), Farm::GrowthRegulator(), Farm::Harvest(), Farm::HayBailing(), Farm::HerbicideTreat(), Farm::InsecticideTreat(), Farm::IsStockFarmer(), Crop::m_date_modifier, Crop::m_ev, Crop::m_farm, Crop::m_field, Crop::m_first_date, FarmEvent::m_first_year, FarmEvent::m_lock, FarmEvent::m_next_tov, FarmEvent::m_startday, FarmEvent::m_todo, Calendar::OldDays(), pl_wt_autumn_harrow1, pl_wt_autumn_harrow2, pl_wt_autumn_plough, pl_wt_autumn_roll, pl_wt_autumn_sow, PL_WT_FERTI_P1, pl_wt_ferti_p1, pl_wt_ferti_p10, pl_wt_ferti_p11, pl_wt_ferti_p2, pl_wt_ferti_p3, pl_wt_ferti_p4, pl_wt_ferti_p5, pl_wt_ferti_p6, pl_wt_ferti_p7, pl_wt_ferti_p8, pl_wt_ferti_p9, PL_WT_FERTI_S1, pl_wt_ferti_s1, pl_wt_ferti_s10, pl_wt_ferti_s11, pl_wt_ferti_s2, pl_wt_ferti_s3, pl_wt_ferti_s4, pl_wt_ferti_s5, pl_wt_ferti_s6, pl_wt_ferti_s7, pl_wt_ferti_s8, pl_wt_ferti_s9, pl_wt_fungicide1, pl_wt_fungicide2, pl_wt_fungicide3, pl_wt_fungicide4, pl_wt_growth_regulator1, pl_wt_harvest, pl_wt_hay_bailing, pl_wt_herbicide1, pl_wt_herbicide2, pl_wt_insecticide1, pl_wt_insecticide2, pl_wt_insecticide3, pl_wt_preseeding_cultivator, pl_wt_preseeding_cultivator_sow, pl_wt_start, pl_wt_straw_chopping, pl_wt_stubble_cultivator_heavy, pl_wt_stubble_harrow, PL_WT_STUBBLE_PLOUGH, pl_wt_stubble_plough, ppp_1, Farm::PreseedingCultivator(), Farm::PreseedingCultivatorSow(), Farm::ProductApplication(), LE::SetMConstants(), LE::SetMDates(), Crop::SimpleEvent_(), Farm::StrawChopping(), Farm::StubbleCultivatorHeavy(), Farm::StubbleHarrowing(), Farm::StubblePlough(), tof_OptimisingFarm, tov_PLWinterTriticale, CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), and WARN_BUG.

◆ SetUpFarmCategoryInformation()

void PLWinterTriticale::SetUpFarmCategoryInformation ( )
inline
109  {
110  const int elements = 2 + (pl_wt_foobar - PLWINTERTRITICALE_BASE);
112 
113  FarmManagementCategory catlist[elements] =
114  {
115  fmc_Others, // zero element unused but must be here
116  fmc_Others,//pl_wt_start = 1, // Compulsory, must always be 1 (one).
117  fmc_Others,//pl_wt_sleep_all_day = PLWINTERTRITICALE_BASE,
118  fmc_Fertilizer,//pl_wt_ferti_p1, // 20301
119  fmc_Fertilizer,//pl_wt_ferti_s1,
120  fmc_Cultivation,//pl_wt_stubble_plough,
121  fmc_Cultivation,//pl_wt_autumn_harrow1,
122  fmc_Cultivation,//pl_wt_autumn_harrow2,
123  fmc_Cultivation,//pl_wt_stubble_harrow,
124  fmc_Fertilizer,//pl_wt_ferti_p2,
125  fmc_Fertilizer,//pl_wt_ferti_s2,
126  fmc_Cultivation,//pl_wt_autumn_plough,
127  fmc_Others,//pl_wt_autumn_roll, // 20310
128  fmc_Cultivation,//pl_wt_stubble_cultivator_heavy,
129  fmc_Fertilizer,//pl_wt_ferti_p3,
130  fmc_Fertilizer,//pl_wt_ferti_s3,
131  fmc_Cultivation,//pl_wt_preseeding_cultivator,
132  fmc_Cultivation,//pl_wt_preseeding_cultivator_sow,
133  fmc_Others,//pl_wt_autumn_sow, // 20316
134  fmc_Herbicide,//pl_wt_herbicide1,
135  fmc_Fungicide,//pl_wt_fungicide1,
136  fmc_Insecticide,//pl_wt_insecticide1,
137  fmc_Fertilizer,//pl_wt_ferti_p4, // 20320
138  fmc_Fertilizer,//pl_wt_ferti_s4,
139  fmc_Fertilizer,//pl_wt_ferti_p5,
140  fmc_Fertilizer,//pl_wt_ferti_s5,
141  fmc_Fertilizer,//pl_wt_ferti_p6,
142  fmc_Fertilizer,//pl_wt_ferti_s6,
143  fmc_Fertilizer,//pl_wt_ferti_p7,
144  fmc_Fertilizer,//pl_wt_ferti_s7,
145  fmc_Fertilizer,//pl_wt_ferti_p8,
146  fmc_Fertilizer,//pl_wt_ferti_s8,
147  fmc_Fertilizer,//pl_wt_ferti_p9, // 20330
148  fmc_Fertilizer,//pl_wt_ferti_s9,
149  fmc_Herbicide,//pl_wt_herbicide2,
150  fmc_Fungicide,//pl_wt_fungicide2,
151  fmc_Fungicide,//pl_wt_fungicide3,
152  fmc_Fungicide,//pl_wt_fungicide4,
153  fmc_Insecticide,//pl_wt_insecticide2,
154  fmc_Insecticide,//pl_wt_insecticide3,
155  fmc_Others,//pl_wt_growth_regulator1,
156  fmc_Harvest,//pl_wt_harvest,
157  fmc_Others,//pl_wt_straw_chopping, // 20340
158  fmc_Others,//pl_wt_hay_bailing,
159  fmc_Fertilizer,//pl_wt_ferti_p10,
160  fmc_Fertilizer,//pl_wt_ferti_s10,
161  fmc_Fertilizer,//pl_wt_ferti_p11,
162  fmc_Fertilizer//pl_wt_ferti_s11, // 20345
163 
164  };
165  // Iterate over the catlist elements and copy them to vector
166  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
167 
168  }

References fmc_Cultivation, fmc_Fertilizer, fmc_Fungicide, fmc_Harvest, fmc_Herbicide, fmc_Insecticide, fmc_Others, Crop::m_base_elements_no, Crop::m_ManagementCategories, pl_wt_foobar, and PLWINTERTRITICALE_BASE.

Referenced by PLWinterTriticale().


The documentation for this class was generated from the following files:
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
pl_wt_ferti_p3
Definition: PLWinterTriticale.h:51
pl_wt_ferti_s9
Definition: PLWinterTriticale.h:70
pl_wt_herbicide1
Definition: PLWinterTriticale.h:56
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
pl_wt_foobar
Definition: PLWinterTriticale.h:85
pl_wt_growth_regulator1
Definition: PLWinterTriticale.h:77
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_wt_ferti_s3
Definition: PLWinterTriticale.h:52
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_wt_ferti_s4
Definition: PLWinterTriticale.h:60
PL_WT_FERTI_P1
#define PL_WT_FERTI_P1
A flag used to indicate autumn ploughing status.
Definition: PLWinterTriticale.h:28
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
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.
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
pl_wt_ferti_p8
Definition: PLWinterTriticale.h:67
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
PLWinterTriticale::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: PLWinterTriticale.h:109
LE::GetMConstants
int GetMConstants(int a)
Definition: Elements.h:407
LE::ClearManagementActionSum
void ClearManagementActionSum()
clears the management action counters
Definition: Elements.h:247
Farm::DoIt
bool DoIt(double a_probability)
Return chance out of 0 to 100.
Definition: Farm.cpp:856
Calendar::GetYearNumber
int GetYearNumber(void)
Definition: Calendar.h:72
pl_wt_herbicide2
Definition: PLWinterTriticale.h:71
pl_wt_autumn_plough
Definition: PLWinterTriticale.h:48
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
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
pl_wt_ferti_p5
Definition: PLWinterTriticale.h:61
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
Farm::GetPreviousTov
TTypesOfVegetation GetPreviousTov(int a_index)
Definition: Farm.h:966
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::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_wt_fungicide4
Definition: PLWinterTriticale.h:74
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
pl_wt_ferti_s7
Definition: PLWinterTriticale.h:66
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
pl_wt_insecticide1
Definition: PLWinterTriticale.h:58
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
cfg_pest_wintertriticale_on
CfgBool cfg_pest_wintertriticale_on
Turn on pesticides for winter triticale.
pl_wt_insecticide3
Definition: PLWinterTriticale.h:76
CfgBool::value
bool value() const
Definition: Configurator.h:164
tov_PLWinterTriticale
Definition: LandscapeFarmingEnums.h:235
pl_wt_ferti_p6
Definition: PLWinterTriticale.h:63
pl_wt_ferti_s11
Definition: PLWinterTriticale.h:84
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_wt_ferti_p11
Definition: PLWinterTriticale.h:83
pl_wt_straw_chopping
Definition: PLWinterTriticale.h:79
Calendar::Date
long Date(void)
Definition: Calendar.h:57
Farm::FP_AmmoniumSulphate
virtual bool FP_AmmoniumSulphate(LE *a_field, double a_user, int a_days)
Apply Ammonium Sulphate to a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:882
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
Farm::HayBailing
virtual bool HayBailing(LE *a_field, double a_user, int a_days)
Carry out hay bailing on a_field.
Definition: FarmFuncs.cpp:1507
pl_wt_autumn_harrow1
Definition: PLWinterTriticale.h:43
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
Farm::FA_Calcium
virtual bool FA_Calcium(LE *a_field, double a_user, int a_days)
Calcium applied on a_field owned by a stock farmer.
Definition: FarmFuncs.cpp:1168
Farm::StrawChopping
virtual bool StrawChopping(LE *a_field, double a_user, int a_days)
Carry out straw chopping on a_field.
Definition: FarmFuncs.cpp:1475
pl_wt_autumn_roll
Definition: PLWinterTriticale.h:49
pl_wt_preseeding_cultivator
Definition: PLWinterTriticale.h:53
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_wt_ferti_s2
Definition: PLWinterTriticale.h:47
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_wt_ferti_s10
Definition: PLWinterTriticale.h:82
pl_wt_ferti_p4
Definition: PLWinterTriticale.h:59
PL_WT_FERTI_S1
#define PL_WT_FERTI_S1
Definition: PLWinterTriticale.h:29
pl_wt_ferti_p2
Definition: PLWinterTriticale.h:46
FarmEvent::m_next_tov
TTypesOfVegetation m_next_tov
Definition: Farm.h:390
pl_wt_ferti_p9
Definition: PLWinterTriticale.h:69
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
pl_wt_ferti_p10
Definition: PLWinterTriticale.h:81
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
pl_wt_fungicide1
Definition: PLWinterTriticale.h:57
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_wt_ferti_s1
Definition: PLWinterTriticale.h:41
Farm::InsecticideTreat
virtual bool InsecticideTreat(LE *a_field, double a_user, int a_days)
Apply insecticide to a_field.
Definition: FarmFuncs.cpp:2135
pl_wt_autumn_harrow2
Definition: PLWinterTriticale.h:44
pl_wt_ferti_p1
Definition: PLWinterTriticale.h:40
Farm::AutumnRoll
virtual bool AutumnRoll(LE *a_field, double a_user, int a_days)
Carry out a roll event in the autumn on a_field.
Definition: FarmFuncs.cpp:299
LE::GetGreenBiomass
virtual double GetGreenBiomass(void)
Definition: Elements.h:160
Farm::FP_Slurry
virtual bool FP_Slurry(LE *a_field, double a_user, int a_days)
Apply slurry to a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:823
tof_OptimisingFarm
Definition: LandscapeFarmingEnums.h:696
pl_wt_ferti_p7
Definition: PLWinterTriticale.h:65
pl_wt_harvest
Definition: PLWinterTriticale.h:78
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_wt_ferti_s6
Definition: PLWinterTriticale.h:64
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_wt_hay_bailing
Definition: PLWinterTriticale.h:80
pl_wt_stubble_cultivator_heavy
Definition: PLWinterTriticale.h:50
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
pl_wt_ferti_s5
Definition: PLWinterTriticale.h:62
pl_wt_preseeding_cultivator_sow
Definition: PLWinterTriticale.h:54
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
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_wt_stubble_harrow
Definition: PLWinterTriticale.h:45
pl_wt_ferti_s8
Definition: PLWinterTriticale.h:68
Farm::GrowthRegulator
virtual bool GrowthRegulator(LE *a_field, double a_user, int a_days)
Apply growth regulator to a_field.
Definition: FarmFuncs.cpp:2070
cfg_seedcoating_wintertriticale_on
CfgBool cfg_seedcoating_wintertriticale_on
Turn on seed coating for winter triticale.
LE::GetOwner
Farm * GetOwner(void)
Definition: Elements.h:256
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
pl_wt_fungicide3
Definition: PLWinterTriticale.h:73
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
PLWINTERTRITICALE_BASE
#define PLWINTERTRITICALE_BASE
Definition: PLWinterTriticale.h:24
pl_wt_start
Definition: PLWinterTriticale.h:38
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
pl_wt_insecticide2
Definition: PLWinterTriticale.h:75
pl_wt_fungicide2
Definition: PLWinterTriticale.h:72
pl_wt_stubble_plough
Definition: PLWinterTriticale.h:42
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
Farm::StubbleHarrowing
virtual bool StubbleHarrowing(LE *a_field, double a_user, int a_days)
Carry out stubble harrowing on a_field.
Definition: FarmFuncs.cpp:1523
Farm::FP_NPKS
virtual bool FP_NPKS(LE *a_field, double a_user, int a_days)
Apply NPKS fertilizer, on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:630
pl_wt_autumn_sow
Definition: PLWinterTriticale.h:55
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_WT_STUBBLE_PLOUGH
#define PL_WT_STUBBLE_PLOUGH
Definition: PLWinterTriticale.h:30