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

PLWinterBarley class
. More...

#include <PLWinterBarley.h>

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

PLWinterBarley class
.

See PLWinterBarley.h::PLWinterBarleyToDo for a complete list of all possible events triggered codes by the winter wheat management plan. When triggered these events are handled by Farm and are available as information for other objects such as animal and bird models.

Constructor & Destructor Documentation

◆ PLWinterBarley()

PLWinterBarley::PLWinterBarley ( 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 5th September
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,9 );
110  }

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

Member Function Documentation

◆ Do()

bool PLWinterBarley::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 barley.

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_PLWinterBarley; // 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_wb_start:
82  {
83  // pl_wb_start just sets up all the starting conditions and reference dates that are needed to start a pl_wb
84  PL_WB_FERTI_P1 = false;
85  PL_WB_FERTI_S1 = false;
86  PL_WB_STUBBLE_PLOUGH = false;
87  PL_WB_DECIDE_TO_GR = false;
88  a_field->ClearManagementActionSum();
89  // Set up the date management stuff
90  // The next bit of code just allows for altering dates after harvest if it is necessary
91  // to allow for a crop which starts its management early.
92 
93  // 5 start and stop dates for all 'movable' events for this crop
94  int noDates = 4;
95  m_field->SetMDates(0, 0, g_date->DayInYear(20, 7)); // last possible day of harvest
96  m_field->SetMDates(1, 0, g_date->DayInYear(25, 7)); // last possible day of starw chopping, equal to harvest in this case
97  m_field->SetMDates(0, 1, 0); // start day of hay bailing (not used as it depend on previous treatment)
98  m_field->SetMDates(1, 1, g_date->DayInYear(30, 7)); // end day of hay bailing
99  m_field->SetMDates(0, 2, 0); // start day of RSM
100  m_field->SetMDates(1, 2, g_date->DayInYear(25, 8)); // end day of RSM
101  m_field->SetMDates(0, 3, 0); // start day of calcium application
102  m_field->SetMDates(1, 3, g_date->DayInYear(25, 8)); // end day of calcium application
103  // Can be up to 10 of these. If the shortening code is triggered
104  // then these will be reduced in value to 0
105 
106  m_field->SetMConstants(0, 1);
107 
108  // Check the next crop for early start, unless it is a spring crop
109  // in which case we ASSUME that no checking is necessary!!!!
110  // So DO NOT implement a crop that runs over the year boundary (i.e. from spring to spring!), at least not without fixing this.
111 
112  //new if: do the check only for non-optimising farms and if year>0. (030713 - m_rotation used only in the hidden year, so I modified the condition from >7 to >0)
113  //optimising farms not used for now so most of related code is removed (but not in 'start' case)
114  if (!(m_farm->GetType() == tof_OptimisingFarm && g_date->GetYearNumber() > 0)) {
115 
116  if (m_ev->m_startday > g_date->DayInYear(1, 7)) {
117  if (m_field->GetMDates(0, 0) >= m_ev->m_startday)
118  {
119  g_msg->Warn(WARN_BUG, "PLWinterBarley::Do(): ", "Harvest too late for the next crop to start!!!");
120  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
121  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
122  }
123  // Now fix any late finishing problems
124  for (int i = 0; i < noDates; i++) {
125  if (m_field->GetMDates(0, i) >= m_ev->m_startday) {
126  m_field->SetMDates(0, i, m_ev->m_startday - 1); //move the starting date
127  }
128  if (m_field->GetMDates(1, i) >= m_ev->m_startday) {
129  m_field->SetMConstants(i, 0); //change the default value of the MConst (=1) to 0 (necessary to correctly execute farm events in case the finishing date (MDate) was moved)
130  m_field->SetMDates(1, i, m_ev->m_startday - 1); //move the finishing date
131  }
132  }
133  }
134  // Now no operations can be timed after the start of the next crop.
135 
136  if (!m_ev->m_first_year) {
137  // Are we before July 1st?
138  d1 = g_date->OldDays() + g_date->DayInYear(1, 7);
139  if (g_date->Date() < d1) {
140  // Yes, too early. We assumme this is because the last crop was late
141  printf("Poly: %d\n", m_field->GetPoly());
142  g_msg->Warn(WARN_BUG, "PLWinterBarley::Do(): ", "Crop start attempt between 1st Jan & 1st July");
143  int prev = m_field->GetLandscape()->BackTranslateVegTypes(m_field->GetOwner()->GetPreviousTov(m_field->GetRotIndex()));
144  g_msg->Warn(WARN_BUG, "Previous Crop ", prev);
145  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
146  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
147  }
148  else {
149  d1 = g_date->OldDays() + m_first_date; // Add 365 for spring crop
150  if (g_date->Date() > d1) {
151  // Yes too late - should not happen - raise an error
152  g_msg->Warn(WARN_BUG, "PLWinterBarley::Do(): ", "Crop start attempt after last possible start date");
153  g_msg->Warn(WARN_BUG, "Previous Crop ", "");
155  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
156  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
157  }
158  }
159  }
160  else {
161  // Is the first year
162  // Some special code to cope with that first start-up year in ALMaSS - ignore for all practical purposes
163  // Code for first spring treatment used
164  if (m_farm->IsStockFarmer()) //Stock Farmer
165  {
167  }
169  break;
170  }
171  }//if
172 
173  // End single block date checking code. Please see next line comment as well.
174  // Reinit d1 to first possible starting date.
175  d1 = g_date->OldDays() + g_date->DayInYear(20, 7);
176  // OK, let's go.
177  // Here we queue up the first event - this differs depending on whether we have a
178  // stock or arable farmer
179  if (m_farm->IsStockFarmer()) { // StockFarmer
181  }
182  else SimpleEvent_(d1, pl_wb_ferti_p1, false, m_farm, m_field);
183  }
184  break;
185 
186  // This is the first real farm operation
187  case pl_wb_ferti_p1:
188  // In total 10% of arable farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
189  // We therefore assume that half of them (5%) do it now
190  if (m_ev->m_lock || m_farm->DoIt(5))
191  {
192  if (!m_farm->FP_Slurry(m_field, 0.0, g_date->DayInYear(5, 9) - g_date->DayInYear())) {
193  // If we don't suceed on the first try, then try and try again (until 20/8 when we will suceed)
195  break;
196  }
197  else
198  {
199  //Rest of farmers do slurry before autumn plough/stubble cultivation so we need to remeber who already did it
200  PL_WB_FERTI_P1 = true;
201  }
202  }
203  // Queue up the next event -in this case stubble ploughing
205  break;
206  case pl_wb_ferti_s1:
207  // In total 80% of stock farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
208  // We therefore assume that half of them (40%) do it now
209  if (m_ev->m_lock || m_farm->DoIt(40))
210  {
211  if (!m_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(5, 9) - g_date->DayInYear())) {
213  break;
214  }
215  else
216  {
217  //Rest of farmers do slurry before autumn plough/stubble cultivation so we need to remeber who already did it
218  PL_WB_FERTI_S1 = true;
219  }
220  }
221  // Queue up the next event -in this case stubble ploughing
223  break;
225  // 50% will do stubble plough, but rest will get away with non-inversion cultivation
226  if (m_ev->m_lock || m_farm->DoIt(50))
227  {
228  if (!m_farm->StubblePlough(m_field, 0.0, g_date->DayInYear(5, 9) - g_date->DayInYear())) {
230  break;
231  }
232  else
233  {
234  // 50% of farmers will do this, but the other 50% won't so we need to remember whether we are in one or the other group
235  PL_WB_STUBBLE_PLOUGH = true;
236  // Queue up the next event
238  break;
239  }
240  }
242  break;
244  if (!m_farm->AutumnHarrow(m_field, 0.0, g_date->DayInYear(5, 9) - g_date->DayInYear())) {
246  break;
247  }
249  break;
251  if (m_ev->m_lock || m_farm->DoIt(40))
252  {
253  if (!m_farm->AutumnHarrow(m_field, 0.0, g_date->Date() + 7 - g_date->DayInYear())) {
255  break;
256  }
257  }
258  d1 = g_date->Date() + 1;
259  if (d1 < g_date->OldDays() + g_date->DayInYear(10, 8)) {
260  d1 = g_date->OldDays() + g_date->DayInYear(10, 8);
261  }
262  if (m_farm->IsStockFarmer()) //Stock Farmer
263  {
265  }
266  else SimpleEvent_(d1, pl_wb_ferti_p2, false, m_farm, m_field);
267  break;
269  if (!m_farm->StubbleHarrowing(m_field, 0.0, g_date->DayInYear(10, 9) - g_date->DayInYear())) {
271  break;
272  }
273  d1 = g_date->Date() + 1;
274  if (d1 < g_date->OldDays() + g_date->DayInYear(10, 8)) {
275  d1 = g_date->OldDays() + g_date->DayInYear(10, 8);
276  }
277  if (m_farm->IsStockFarmer()) //Stock Farmer
278  {
280  }
281  else SimpleEvent_(d1, pl_wb_ferti_p2, false, m_farm, m_field);
282  break;
283  case pl_wb_ferti_p2:
284  // In total 10% of arable farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
285  // We therefore assume that half of them (5%) do it now (if haven't done before)
286  if ((m_ev->m_lock || m_farm->DoIt(static_cast<int>((5.0 / 95.0) * 100))) && (PL_WB_FERTI_P1 == false))
287  {
288  if (!m_farm->FP_Slurry(m_field, 0.0, g_date->DayInYear(15, 9) - g_date->DayInYear())) {
290  break;
291  }
292  }
294  break;
295  case pl_wb_ferti_s2:
296  // In total 80% of stock farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
297  // We therefore assume that half of them (40%) do it now (if haven't done before)
298  if ((m_ev->m_lock || m_farm->DoIt(static_cast<int>((40.0 / 60.0) * 100))) && (PL_WB_FERTI_S1 == false))
299  {
300  if (!m_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(15, 9) - g_date->DayInYear())) {
302  break;
303  }
304  }
306  break;
307  case pl_wb_autumn_plough:
308  if (m_ev->m_lock || m_farm->DoIt(80))
309  {
310  if (!m_farm->AutumnPlough(m_field, 0.0, g_date->DayInYear(15, 9) - g_date->DayInYear())) {
312  break;
313  }
314  else
315  {
316  // Queue up the next event and if it's late (after 5/9) it has to be rolling, else next fertilizer
317  d1 = g_date->OldDays() + g_date->DayInYear(5, 9);
318  if (g_date->Date() > d1)
319  {
321  break;
322  }
323  else
324  {
325  if (m_farm->IsStockFarmer()) //Stock Farmer
326  {
328  }
330  break;
331  }
332  }
333  }
335  break;
336  case pl_wb_autumn_roll:
337  if (!m_farm->AutumnRoll(m_field, 0.0, g_date->DayInYear(15, 9) - g_date->DayInYear())) {
339  break;
340  }
341  if (m_farm->IsStockFarmer()) //Stock Farmer
342  {
344  }
346  break;
348  // the rest 20% who did not plough do heavy stubble cultivation
351  break;
352  }
353  if (m_farm->IsStockFarmer()) //Stock Farmer
354  {
356  }
358  break;
359  case pl_wb_ferti_p3:
360  if (m_ev->m_lock || m_farm->DoIt(45))
361  {
362  if (!m_farm->FP_NPKS(m_field, 0.0, g_date->DayInYear(18, 9) - g_date->DayInYear())) {
364  break;
365  }
366  }
368  break;
369  case pl_wb_ferti_s3:
370  if (m_ev->m_lock || m_farm->DoIt(45))
371  {
372  if (!m_farm->FA_NPKS(m_field, 0.0, g_date->DayInYear(18, 9) - g_date->DayInYear())) {
374  break;
375  }
376  }
378  break;
380  // 30% will do preseeding cultivation, the rest will do it together with sow
381  if (m_ev->m_lock || m_farm->DoIt(30))
382  {
383  if (!m_farm->PreseedingCultivator(m_field, 0.0, g_date->DayInYear(19, 9) - g_date->DayInYear())) {
385  break;
386  }
388  break;
389  }
391  break;
392  case pl_wb_autumn_sow:
393  if (cfg_seedcoating_winterbarley_on.value() && a_field->GetLandscape()->SupplyShouldSpray()) {
394  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(20, 9) - g_date->DayInYear(),
397  break;
398  }
399  }
400  else {
401  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(20, 9) - g_date->DayInYear())) {
403  break;
404  }
405  }
406 
407  // Here is a fork leading to four parallel events
408  SimpleEvent_(g_date->Date() + 3, pl_wb_herbicide1, false, m_farm, m_field); // Herbidide thread
409  SimpleEvent_(g_date->Date() + 3, pl_wb_fungicide1, false, m_farm, m_field); // Fungicide thread
410  SimpleEvent_(g_date->Date() + 20 + m_date_modifier, pl_wb_insecticide1, false, m_farm, m_field); // Insecticide thread
411  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(25, 3) + 365, pl_wb_growth_regulator1, false, m_farm, m_field); // GR thread
412  if (m_farm->IsStockFarmer()) //Stock Farmer // PK thread
413  {
415  }
416  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wb_ferti_p4, false, m_farm, m_field);
417  if (m_farm->IsStockFarmer()) //Stock Farmer // Main thread
418  {
420  }
421  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wb_ferti_p5, false, m_farm, m_field);
422  if (m_farm->IsStockFarmer()) //Stock Farmer // Microelemnts thread
423  {
424  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(25, 3) + 365, pl_wb_ferti_s8, false, m_farm, m_field);
425  }
426  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(25, 3) + 365, pl_wb_ferti_p8, false, m_farm, m_field);
427  break;
429  // 70% will do preseeding cultivation with sow
432  break;
433  }
434  // Here is a fork leading to four parallel events
435  SimpleEvent_(g_date->Date() + 3, pl_wb_herbicide1, false, m_farm, m_field); // Herbidide thread
436  SimpleEvent_(g_date->Date() + 3, pl_wb_fungicide1, false, m_farm, m_field); // Fungicide thread
437  SimpleEvent_(g_date->Date() + 20 + m_date_modifier, pl_wb_insecticide1, false, m_farm, m_field); // Insecticide thread
438  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(25, 3) + 365, pl_wb_growth_regulator1, false, m_farm, m_field); // GR thread
439  if (m_farm->IsStockFarmer()) //Stock Farmer // PK thread
440  {
442  }
443  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wb_ferti_p4, false, m_farm, m_field);
444  if (m_farm->IsStockFarmer()) //Stock Farmer // Main thread
445  {
447  }
448  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, pl_wb_ferti_p5, false, m_farm, m_field);
449  if (m_farm->IsStockFarmer()) //Stock Farmer // Microelemnts thread
450  {
451  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(25, 3) + 365, pl_wb_ferti_s8, false, m_farm, m_field);
452  }
453  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(25, 3) + 365, pl_wb_ferti_p8, false, m_farm, m_field);
454  break;
455  case pl_wb_herbicide1: // The first of the pesticide managements.
456  // Here comes the herbicide thread
457  if (m_ev->m_lock || m_farm->DoIt(80))
458  {
459  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
461  break;
462  }
463  }
465  break;
466  case pl_wb_herbicide2:
467  if (m_ev->m_lock || m_farm->DoIt(48))
468  {
469  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(31, 3) - g_date->DayInYear())) {
471  break;
472  }
473  }
474  // End of thread
475  break;
476  case pl_wb_fungicide1:
477  // Here comes the fungicide thread
478  if (m_ev->m_lock || m_farm->DoIt(5))
479  {
480  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
482  break;
483  }
484  }
486  break;
487  case pl_wb_fungicide2:
488  if (m_ev->m_lock || m_farm->DoIt(75))
489  {
490  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
492  break;
493  }
494  }
495  d1 = g_date->Date() + 14;
496  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 5)) {
497  d1 = g_date->OldDays() + g_date->DayInYear(1, 5);
498  }
500  break;
501  case pl_wb_fungicide3:
502  if (m_ev->m_lock || m_farm->DoIt(58))
503  {
504  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(25, 5) - g_date->DayInYear())) {
506  break;
507  }
508  }
510  break;
511  case pl_wb_fungicide4:
512  if (m_ev->m_lock || m_farm->DoIt(28))
513  {
514  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(10, 6) - g_date->DayInYear())) {
516  break;
517  }
518  }
519  // End of thread
520  break;
521  case pl_wb_insecticide1:
522  // Here comes the insecticide thread
523  if (m_ev->m_lock || m_farm->DoIt(15))
524  {
525  if (m_field->GetGreenBiomass() <= 0) {
527  }
528  else
529  {
530  // here we check whether we are using ERA pesticide or not
531  d1 = g_date->DayInYear(15, 11) - g_date->DayInYear();
532  if (!cfg_pest_winterbarley_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
533  {
534  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
535  }
536  else {
538  }
539  if (!flag) {
541  break;
542  }
544  break;
545  }
546  }
548  break;
549  case pl_wb_insecticide2:
550  if (m_ev->m_lock || m_farm->DoIt(23))
551  {
552  // here we check whether we are using ERA pesticide or not
553  d1 = g_date->DayInYear(30, 5) - g_date->DayInYear();
554  if (!cfg_pest_winterbarley_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
555  {
556  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
557  }
558  else {
560  }
561  if (!flag) {
563  break;
564  }
565  }
567  break;
568  case pl_wb_insecticide3:
569  if (m_ev->m_lock || m_farm->DoIt(23))
570  {
571  // here we check whether we are using ERA pesticide or not
572  d1 = g_date->DayInYear(15, 6) - g_date->DayInYear();
573  if (!cfg_pest_winterbarley_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
574  {
575  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
576  }
577  else {
579  }
580  if (!flag) {
582  break;
583  }
584  }
585  // End of thread
586  break;
588  // Here comes the GR thread
589  if (m_ev->m_lock || m_farm->DoIt(49))
590  {
591  if (!m_farm->GrowthRegulator(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
593  break;
594  }
595  else
596  {
597  //We need to remeber who did GR I
598  PL_WB_DECIDE_TO_GR = true;
599  }
600  }
602  break;
605  {
606  if (!m_farm->GrowthRegulator(m_field, 0.0, g_date->Date() + 21 - g_date->DayInYear())) {
608  break;
609  }
610  }
611  // End of thread
612  break;
613  case pl_wb_ferti_p4:
614  // Here comes the PK thread
615  if (m_ev->m_lock || m_farm->DoIt(28))
616  {
617  if (!m_farm->FP_PK(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
619  break;
620  }
621  }
622  // End of thread
623  break;
624  case pl_wb_ferti_s4:
625  // Here comes the PK thread
626  if (m_ev->m_lock || m_farm->DoIt(28))
627  {
628  if (!m_farm->FA_PK(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
630  break;
631  }
632  }
633  // End of thread
634  break;
635  case pl_wb_ferti_p5:
636  // Here comes the MAIN thread
637  if (m_ev->m_lock || m_farm->DoIt(95))
638  {
639  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
641  break;
642  }
643  }
644  d1 = g_date->Date() + 10;
645  if (d1 < g_date->OldDays() + g_date->DayInYear(20, 3)) {
646  d1 = g_date->OldDays() + g_date->DayInYear(20, 3);
647  }
649  break;
650  case pl_wb_ferti_s5:
651  if (m_ev->m_lock || m_farm->DoIt(95))
652  {
653  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
655  break;
656  }
657  }
658  d1 = g_date->Date() + 10;
659  if (d1 < g_date->OldDays() + g_date->DayInYear(20, 3)) {
660  d1 = g_date->OldDays() + g_date->DayInYear(20, 3);
661  }
663  break;
664  case pl_wb_ferti_p6:
665  if (m_ev->m_lock || m_farm->DoIt(93))
666  {
667  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
669  break;
670  }
671  }
673  break;
674  case pl_wb_ferti_s6:
675  if (m_ev->m_lock || m_farm->DoIt(93))
676  {
677  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
679  break;
680  }
681  }
683  break;
684  case pl_wb_ferti_p7:
685  if (m_ev->m_lock || m_farm->DoIt(43))
686  {
687  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
689  break;
690  }
691  }
693  break;
694  case pl_wb_ferti_s7:
695  if (m_ev->m_lock || m_farm->DoIt(43))
696  {
697  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
699  break;
700  }
701  }
703  break;
704  case pl_wb_ferti_p8:
705  // Here comes the mickroelements thread
706  if (m_ev->m_lock || m_farm->DoIt(28))
707  {
708  if (!m_farm->FP_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(10, 4) - g_date->DayInYear())) {
710  break;
711  }
712  }
714  break;
715  case pl_wb_ferti_s8:
716  if (m_ev->m_lock || m_farm->DoIt(28))
717  {
718  if (!m_farm->FA_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(10, 4) - g_date->DayInYear())) {
720  break;
721  }
722  }
724  break;
725  case pl_wb_ferti_p9:
726  if (m_ev->m_lock || m_farm->DoIt(5))
727  {
728  if (!m_farm->FP_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(10, 5) - g_date->DayInYear())) {
730  break;
731  }
732  }
733  // End of thread
734  break;
735  case pl_wb_ferti_s9:
736  if (m_ev->m_lock || m_farm->DoIt(5))
737  {
738  if (!m_farm->FA_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(10, 5) - g_date->DayInYear())) {
740  break;
741  }
742  }
743  // End of thread
744  break;
745  case pl_wb_harvest:
746  // Here the MAIN thread continues
747  // We don't move harvest days
748  if (!m_farm->Harvest(m_field, 0.0, m_field->GetMDates(0, 0) - g_date->DayInYear())) {
750  break;
751  }
753  break;
754 
755 
757  if (m_farm->IsStockFarmer()) //Stock Farmer
758  {
759  // 10% of stock farmers will do straw chopping, but rest will do hay bailing instead
760  if (m_ev->m_lock || m_farm->DoIt(10))
761  {
762  if (m_field->GetMConstants(0) == 0) {
763  if (!m_farm->StrawChopping(m_field, 0.0, -1)) { // raise an error
764  g_msg->Warn(WARN_BUG, "PLWinterBarley::Do(): failure in 'StrawChopping' execution", "");
765  exit(1);
766  }
767  }
768  else {
769  if (!m_farm->StrawChopping(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
771  break;
772  }
773  else
774  {
775  // Queue up the next event
777  break;
778  }
779  }
780 
781  }
783  break;
784  }
785  else
786  {
787  // 90% of arable farmers will do straw chopping, but rest will do hay bailing instead
788  if (m_ev->m_lock || m_farm->DoIt(90))
789  {
790  if (m_field->GetMConstants(0) == 0) {
791  if (!m_farm->StrawChopping(m_field, 0.0, -1)) { // raise an error
792  g_msg->Warn(WARN_BUG, "PLWinterBarley::Do(): failure in 'StrawChopping' execution", "");
793  exit(1);
794  }
795  }
796  else {
797  if (!m_farm->StrawChopping(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
799  break;
800  }
801  else
802  {
803  // Queue up the next event
805  break;
806  }
807  }
808 
809  }
811  break;
812  }
813  case pl_wb_hay_bailing:
814  if (m_field->GetMConstants(1) == 0) {
815  if (!m_farm->HayBailing(m_field, 0.0, -1)) { // raise an error
816  g_msg->Warn(WARN_BUG, "PLWinterBarley::Do(): failure in 'HayBailing' execution", "");
817  exit(1);
818  }
819  }
820  else {
821  if (!m_farm->HayBailing(m_field, 0.0, m_field->GetMDates(1, 1) - g_date->DayInYear())) {
823  break;
824  }
825  }
826  if (m_farm->IsStockFarmer()) //Stock Farmer
827  {
829  }
831  break;
832  case pl_wb_ferti_p10:
833  if (m_ev->m_lock || m_farm->DoIt(12))
834  {
835  if (m_field->GetMConstants(2) == 0) {
836  if (!m_farm->FP_RSM(m_field, 0.0, -1)) { // raise an error
837  g_msg->Warn(WARN_BUG, "PLWinterBarley::Do(): failure in 'FP_RSM' execution", "");
838  exit(1);
839  }
840  }
841  else {
842  if (!m_farm->FP_RSM(m_field, 0.0, m_field->GetMDates(1, 2) - g_date->DayInYear())) {
844  break;
845  }
846  }
847  }
848  if (m_farm->IsStockFarmer()) //Stock Farmer
849  {
851  }
853  break;
854  case pl_wb_ferti_s10:
855  if (m_ev->m_lock || m_farm->DoIt(12))
856  {
857  if (m_field->GetMConstants(2) == 0) {
858  if (!m_farm->FA_RSM(m_field, 0.0, -1)) { // raise an error
859  g_msg->Warn(WARN_BUG, "PLWinterBarley::Do(): failure in 'FA_RSM' execution", "");
860  exit(1);
861  }
862  }
863  else {
864  if (!m_farm->FA_RSM(m_field, 0.0, m_field->GetMDates(1, 2) - g_date->DayInYear())) {
866  break;
867  }
868  }
869  }
870  if (m_farm->IsStockFarmer()) //Stock Farmer
871  {
873  }
875  break;
876  case pl_wb_ferti_p11:
877  if (m_ev->m_lock || m_farm->DoIt(22))
878  {
879  if (m_field->GetMConstants(3) == 0) {
880  if (!m_farm->FP_Calcium(m_field, 0.0, -1)) { // raise an error
881  g_msg->Warn(WARN_BUG, "PLWinterBarley::Do(): failure in 'FP_Calcium' execution", "");
882  exit(1);
883  }
884  }
885  else {
886  if (!m_farm->FP_Calcium(m_field, 0.0, m_field->GetMDates(1, 3) - g_date->DayInYear())) {
888  break;
889  }
890  }
891  }
892  done = true;
893  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
894  // END of MAIN THREAD
895  break;
896  case pl_wb_ferti_s11:
897  if (m_ev->m_lock || m_farm->DoIt(22))
898  {
899  if (m_field->GetMConstants(3) == 0) {
900  if (!m_farm->FA_Calcium(m_field, 0.0, -1)) { // raise an error
901  g_msg->Warn(WARN_BUG, "PLWinterBarley::Do(): failure in 'FA_Calcium' execution", "");
902  exit(1);
903  }
904  }
905  else {
906  if (!m_farm->FA_Calcium(m_field, 0.0, m_field->GetMDates(1, 3) - g_date->DayInYear())) {
908  break;
909  }
910  }
911  }
912  done = true;
913  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
914  // END of MAIN THREAD
915  break;
916  default:
917  g_msg->Warn(WARN_BUG, "PLWinterBarley::Do(): "
918  "Unknown event type! ", "");
919  exit(1);
920  }
921  return done;
922 }

References Farm::AutumnHarrow(), Farm::AutumnPlough(), Farm::AutumnRoll(), Farm::AutumnSow(), cfg_pest_product_amounts, cfg_pest_winterbarley_on, cfg_seedcoating_product_amounts, cfg_seedcoating_winterbarley_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_wb_autumn_harrow1, pl_wb_autumn_harrow2, pl_wb_autumn_plough, pl_wb_autumn_roll, pl_wb_autumn_sow, PL_WB_DECIDE_TO_GR, PL_WB_FERTI_P1, pl_wb_ferti_p1, pl_wb_ferti_p10, pl_wb_ferti_p11, pl_wb_ferti_p2, pl_wb_ferti_p3, pl_wb_ferti_p4, pl_wb_ferti_p5, pl_wb_ferti_p6, pl_wb_ferti_p7, pl_wb_ferti_p8, pl_wb_ferti_p9, PL_WB_FERTI_S1, pl_wb_ferti_s1, pl_wb_ferti_s10, pl_wb_ferti_s11, pl_wb_ferti_s2, pl_wb_ferti_s3, pl_wb_ferti_s4, pl_wb_ferti_s5, pl_wb_ferti_s6, pl_wb_ferti_s7, pl_wb_ferti_s8, pl_wb_ferti_s9, pl_wb_fungicide1, pl_wb_fungicide2, pl_wb_fungicide3, pl_wb_fungicide4, pl_wb_growth_regulator1, pl_wb_growth_regulator2, pl_wb_harvest, pl_wb_hay_bailing, pl_wb_herbicide1, pl_wb_herbicide2, pl_wb_insecticide1, pl_wb_insecticide2, pl_wb_insecticide3, pl_wb_preseeding_cultivator, pl_wb_preseeding_cultivator_sow, pl_wb_start, pl_wb_straw_chopping, pl_wb_stubble_cultivator_heavy, pl_wb_stubble_harrow, PL_WB_STUBBLE_PLOUGH, pl_wb_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_PLWinterBarley, CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), and WARN_BUG.

◆ SetUpFarmCategoryInformation()

void PLWinterBarley::SetUpFarmCategoryInformation ( )
inline
111  {
112  const int elements = 2 + (pl_wb_foobar - PLWINTERBARLEY_BASE);
114 
115  FarmManagementCategory catlist[elements] =
116  {
117  fmc_Others, // zero element unused but must be here
118  fmc_Others,//pl_wb_start = 1, // Compulsory, must always be 1 (one).
119  fmc_Others,//pl_wb_sleep_all_day = PLWINTERBARLEY_BASE,
120  fmc_Fertilizer,//pl_wb_ferti_p1, // 20201
121  fmc_Fertilizer,//pl_wb_ferti_s1,
122  fmc_Cultivation,//pl_wb_stubble_plough,
123  fmc_Cultivation,//pl_wb_autumn_harrow1,
124  fmc_Cultivation,//pl_wb_autumn_harrow2,
125  fmc_Cultivation,//pl_wb_stubble_harrow,
126  fmc_Fertilizer,//pl_wb_ferti_p2,
127  fmc_Fertilizer,//pl_wb_ferti_s2,
128  fmc_Cultivation,//pl_wb_autumn_plough,
129  fmc_Others,//pl_wb_autumn_roll, // 20210
130  fmc_Cultivation,//pl_wb_stubble_cultivator_heavy,
131  fmc_Fertilizer,//pl_wb_ferti_p3,
132  fmc_Fertilizer,//pl_wb_ferti_s3,
133  fmc_Cultivation,//pl_wb_preseeding_cultivator,
134  fmc_Cultivation,//pl_wb_preseeding_cultivator_sow,
135  fmc_Others,//pl_wb_autumn_sow, // 20216
136  fmc_Herbicide,//pl_wb_herbicide1,
137  fmc_Fungicide,//pl_wb_fungicide1,
138  fmc_Insecticide,//pl_wb_insecticide1,
139  fmc_Fertilizer,//pl_wb_ferti_p4, // 20220
140  fmc_Fertilizer,//pl_wb_ferti_s4,
141  fmc_Fertilizer,//pl_wb_ferti_p5,
142  fmc_Fertilizer,//pl_wb_ferti_s5,
143  fmc_Fertilizer,//pl_wb_ferti_p6,
144  fmc_Fertilizer,//pl_wb_ferti_s6,
145  fmc_Fertilizer,//pl_wb_ferti_p7,
146  fmc_Fertilizer,//pl_wb_ferti_s7,
147  fmc_Fertilizer,//pl_wb_ferti_p8,
148  fmc_Fertilizer,//pl_wb_ferti_s8,
149  fmc_Fertilizer,//pl_wb_ferti_p9, // 20230
150  fmc_Fertilizer,//pl_wb_ferti_s9,
151  fmc_Herbicide,//pl_wb_herbicide2,
152  fmc_Fungicide,//pl_wb_fungicide2,
153  fmc_Fungicide,//pl_wb_fungicide3,
154  fmc_Fungicide,//pl_wb_fungicide4,
155  fmc_Insecticide,//pl_wb_insecticide2,
156  fmc_Insecticide,//pl_wb_insecticide3,
157  fmc_Others,//pl_wb_growth_regulator1,
158  fmc_Others,//pl_wb_growth_regulator2,
159  fmc_Harvest,//pl_wb_harvest, // 20240
160  fmc_Others,//pl_wb_straw_chopping,
161  fmc_Others,//pl_wb_hay_bailing,
162  fmc_Fertilizer,//pl_wb_ferti_p10,
163  fmc_Fertilizer,//pl_wb_ferti_s10,
164  fmc_Fertilizer,//pl_wb_ferti_p11,
165  fmc_Fertilizer//pl_wb_ferti_s11, // 20246
166 
167  };
168  // Iterate over the catlist elements and copy them to vector
169  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
170 
171  }

References fmc_Cultivation, fmc_Fertilizer, fmc_Fungicide, fmc_Harvest, fmc_Herbicide, fmc_Insecticide, fmc_Others, Crop::m_base_elements_no, Crop::m_ManagementCategories, pl_wb_foobar, and PLWINTERBARLEY_BASE.

Referenced by PLWinterBarley().


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
pl_wb_insecticide2
Definition: PLWinterBarley.h:76
Farm::PreseedingCultivator
virtual bool PreseedingCultivator(LE *a_field, double a_user, int a_days)
Carry out preseeding cultivation on a_field (tilling set including cultivator and string roller to co...
Definition: FarmFuncs.cpp:312
LE::SetMDates
void SetMDates(int a, int b, int c)
Definition: Elements.h:406
Farm::HerbicideTreat
virtual bool HerbicideTreat(LE *a_field, double a_user, int a_days)
Apply herbicide to a_field.
Definition: FarmFuncs.cpp:2025
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
pl_wb_ferti_p8
Definition: PLWinterBarley.h:68
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_wb_autumn_plough
Definition: PLWinterBarley.h:49
Farm::FP_ManganeseSulphate
virtual bool FP_ManganeseSulphate(LE *a_field, double a_user, int a_days)
Apply Manganse Sulphate to a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:840
Farm::ProductApplication
virtual bool ProductApplication(LE *a_field, double a_user, int a_days, double a_applicationrate, PlantProtectionProducts a_ppp, bool a_isgranularpesticide=false, int a_orcharddrifttype=0)
Apply test pesticide to a_field.
Definition: FarmFuncs.cpp:2267
Farm::StubbleCultivatorHeavy
virtual bool StubbleCultivatorHeavy(LE *a_field, double a_user, int a_days)
Carry out a stubble cultivation event on a_field. This is non-inversion type of cultivation which can...
Definition: FarmFuncs.cpp:245
pl_wb_fungicide3
Definition: PLWinterBarley.h:74
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_wb_herbicide2
Definition: PLWinterBarley.h:72
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
PL_WB_FERTI_P1
#define PL_WB_FERTI_P1
A flag used to indicate autumn ploughing status.
Definition: PLWinterBarley.h:28
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_wb_ferti_p5
Definition: PLWinterBarley.h:62
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.
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
Farm::GetPreviousTov
TTypesOfVegetation GetPreviousTov(int a_index)
Definition: Farm.h:966
pl_wb_ferti_p3
Definition: PLWinterBarley.h:52
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
pl_wb_fungicide2
Definition: PLWinterBarley.h:73
pl_wb_stubble_harrow
Definition: PLWinterBarley.h:46
Farm::GetType
TTypesOfFarm GetType(void)
Definition: Farm.h:956
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
pl_wb_foobar
Definition: PLWinterBarley.h:87
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
FarmEvent::m_startday
int m_startday
Definition: Farm.h:385
pl_wb_stubble_plough
Definition: PLWinterBarley.h:43
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
pl_wb_harvest
Definition: PLWinterBarley.h:80
pl_wb_preseeding_cultivator
Definition: PLWinterBarley.h:54
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_wb_ferti_s2
Definition: PLWinterBarley.h:48
pl_wb_start
Definition: PLWinterBarley.h:39
PLWinterBarley::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: PLWinterBarley.h:111
CfgBool::value
bool value() const
Definition: Configurator.h:164
pl_wb_ferti_s11
Definition: PLWinterBarley.h:86
pl_wb_ferti_p11
Definition: PLWinterBarley.h:85
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
cfg_pest_winterbarley_on
CfgBool cfg_pest_winterbarley_on
Turn on pesticides for winter barley.
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_wb_ferti_s10
Definition: PLWinterBarley.h:84
tov_PLWinterBarley
Definition: LandscapeFarmingEnums.h:234
pl_wb_autumn_sow
Definition: PLWinterBarley.h:56
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
pl_wb_ferti_s1
Definition: PLWinterBarley.h:42
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_wb_ferti_p9
Definition: PLWinterBarley.h:70
cfg_seedcoating_winterbarley_on
CfgBool cfg_seedcoating_winterbarley_on
Turn on seed coating for winter barley.
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_wb_ferti_p6
Definition: PLWinterBarley.h:64
pl_wb_ferti_s6
Definition: PLWinterBarley.h:65
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
pl_wb_ferti_p2
Definition: PLWinterBarley.h:47
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_wb_growth_regulator1
Definition: PLWinterBarley.h:78
pl_wb_ferti_s4
Definition: PLWinterBarley.h:61
pl_wb_insecticide3
Definition: PLWinterBarley.h:77
pl_wb_ferti_s7
Definition: PLWinterBarley.h:67
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
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
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
pl_wb_ferti_s3
Definition: PLWinterBarley.h:53
pl_wb_hay_bailing
Definition: PLWinterBarley.h:82
tof_OptimisingFarm
Definition: LandscapeFarmingEnums.h:696
PL_WB_FERTI_S1
#define PL_WB_FERTI_S1
Definition: PLWinterBarley.h:29
pl_wb_preseeding_cultivator_sow
Definition: PLWinterBarley.h:55
PL_WB_DECIDE_TO_GR
#define PL_WB_DECIDE_TO_GR
Definition: PLWinterBarley.h:31
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_wb_ferti_p7
Definition: PLWinterBarley.h:66
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_wb_ferti_s8
Definition: PLWinterBarley.h:69
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
pl_wb_ferti_s5
Definition: PLWinterBarley.h:63
pl_wb_fungicide1
Definition: PLWinterBarley.h:58
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
PLWINTERBARLEY_BASE
#define PLWINTERBARLEY_BASE
Definition: PLWinterBarley.h:24
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_wb_ferti_p1
Definition: PLWinterBarley.h:41
LE::GetOwner
Farm * GetOwner(void)
Definition: Elements.h:256
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
pl_wb_fungicide4
Definition: PLWinterBarley.h:75
pl_wb_stubble_cultivator_heavy
Definition: PLWinterBarley.h:51
pl_wb_straw_chopping
Definition: PLWinterBarley.h:81
pl_wb_herbicide1
Definition: PLWinterBarley.h:57
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
pl_wb_insecticide1
Definition: PLWinterBarley.h:59
pl_wb_autumn_harrow1
Definition: PLWinterBarley.h:44
pl_wb_ferti_s9
Definition: PLWinterBarley.h:71
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_wb_ferti_p10
Definition: PLWinterBarley.h:83
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
pl_wb_autumn_harrow2
Definition: PLWinterBarley.h:45
pl_wb_autumn_roll
Definition: PLWinterBarley.h:50
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
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_wb_ferti_p4
Definition: PLWinterBarley.h:60
pl_wb_growth_regulator2
Definition: PLWinterBarley.h:79
PL_WB_STUBBLE_PLOUGH
#define PL_WB_STUBBLE_PLOUGH
Definition: PLWinterBarley.h:30
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