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

PLFodderLucerne1 class
. More...

#include <PLFodderLucerne1.h>

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

PLFodderLucerne1 class
.

See PLFodderLucerne1.h::PLFodderLucerne1ToDo for a complete list of all possible events triggered codes by the fodder lucerne1 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

◆ PLFodderLucerne1()

PLFodderLucerne1::PLFodderLucerne1 ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
84  : Crop(a_tov, a_toc, a_L)
85  {
86  // When we start it off, the first possible date for a farm operation is 31th October
87  // This information is used by other crops when they decide how much post processing of
88  // the management is allowed after harvest before the next crop starts.
89  m_first_date=g_date->DayInYear( 1,12 );
91  }

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

Member Function Documentation

◆ Do()

bool PLFodderLucerne1::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 fodder lucerne in the first year.

Reimplemented from Crop.

58 {
59  /******************** This block can be added to the top of all Crop::Do methods ***********************************************/
60  m_farm = a_farm; // These assignments are necessary, not for this method but for related event calls
61  m_field = a_field;
62  m_ev = a_ev;
63  bool done = false; // The boolean value done indicates when we are totally finished with this plan (i.e. it is set to true).
64  int d1 = 0;
65  int noDates = 1;
66  TTypesOfVegetation l_tov = tov_PLFodderLucerne1; // The current type - change to match the crop you have
67 /**********************************************To Here *************************************************************************/
68 
69  // Depending what event has occured jump to the correct bit of code
70  switch (m_ev->m_todo)
71  {
72  case pl_fl1_start:
73  {
74  // pl_fl1_start just sets up all the starting conditions and reference dates that are needed to start a pl_sw
75  PL_FL1_FERTI_P1 = false;
76  PL_FL1_FERTI_S1 = false;
77  PL_FL1_STUBBLE_PLOUGH = false;
78  PL_FL1_WINTER_PLOUGH = false;
80  PL_FL1_HERBICIDE1 = false;
83 
84  // Set up the date management stuff
85 
86  // Check the next crop for early start, unless it is a spring crop
87  // in which case we ASSUME that no checking is necessary!!!!
88  // So DO NOT implement a crop that runs over the year boundary (i.e. from spring to spring!), at least not without fixing this.
89 
90  //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)
91  //optimising farms not used for now so most of related code is removed (but not in 'start' case)
92  if (!(m_farm->GetType() == tof_OptimisingFarm && g_date->GetYearNumber() > 0)) {
93 
94  if (m_ev->m_startday > g_date->DayInYear(1, 7)) {
95  if (g_date->DayInYear(10, 8) >= m_ev->m_startday)
96  {
97  g_msg->Warn(WARN_BUG, "PLFodderLucerne1::Do(): ", "Harvest too late for the next crop to start!!!");
98  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
99  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
100  exit(1);
101  }
102  }
103  // Now no operations can be timed after the start of the next crop.
104 
105  if (!m_ev->m_first_year) {
106  // Are we before July 1st?
107  d1 = g_date->OldDays() + g_date->DayInYear(1, 7);
108  if (g_date->Date() < d1) {
109  // Yes, too early. We assumme this is because the last crop was late
110  printf("Poly: %d\n", m_field->GetPoly());
111  g_msg->Warn(WARN_BUG, "PLFodderLucerne1::Do(): ", "Crop start attempt between 1st Jan & 1st July");
112  int prev = m_field->GetLandscape()->BackTranslateVegTypes(m_field->GetOwner()->GetPreviousTov(m_field->GetRotIndex()));
113  g_msg->Warn(WARN_BUG, "Previous Crop ", prev);
114  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
115  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
116  exit(1);
117  }
118  else {
119  d1 = g_date->OldDays() + m_first_date; // Add 365 for spring crop
120  if (g_date->Date() > d1) {
121  // Yes too late - should not happen - raise an error
122  g_msg->Warn(WARN_BUG, "PLFodderLucerne1::Do(): ", "Crop start attempt after last possible start date");
123  g_msg->Warn(WARN_BUG, "Previous Crop ", "");
125  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
126  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
127  exit(1);
128  }
129  }
130  }
131  else {
132  //Is the first year
133  // Some special code to cope with that first start-up year in ALMaSS - ignore for all practical purposes
134  // Code for first spring treatment used
135  d1 = g_date->OldDays() + g_date->DayInYear(1, 3);
136  if (g_date->Date() >= d1) d1 += 365;
138  break;
139  }
140  }//if
141 
142  // End single block date checking code. Please see next line comment as well.
143  // Reinit d1 to first possible starting date.
144 
145  d1 = g_date->OldDays() + g_date->DayInYear(20, 7);
146  if (m_ev->m_forcespring) {
147  int day_num_shift = 365;
148  if (g_date->DayInYear() < 70) day_num_shift = 0;
149 
150  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + day_num_shift, pl_fl1_spring_harrow, false, m_farm, m_field); // to fit with rots that contain the forcespring code
151  break;
152  }
154 
155 
156  }
157  break;
158 
159  // This is the first real farm operation
160  case pl_fl1_herbicide0:
161  if (m_ev->m_lock || m_farm->DoIt(28))
162  {
163  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
165  break;
166  }
167  }
168  if (m_farm->IsStockFarmer()) //Stock Farmer
169  {
171  }
172  else SimpleEvent_(g_date->Date() + 14, pl_fl1_ferti_p1, false, m_farm, m_field);
173  break;
174  case pl_fl1_ferti_p1:
175  // In total 64% of arable farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
176  // We therefore assume that half of them (32%) do it now
177  if (m_ev->m_lock || m_farm->DoIt(32))
178  {
179  if (!m_farm->FP_Slurry(m_field, 0.0, g_date->DayInYear(5, 11) - g_date->DayInYear())) {
180  // If we don't suceed on the first try, then try and try again (until 20/8 when we will suceed)
182  break;
183  }
184  else
185  {
186  //Rest of farmers do slurry before autumn plough/stubble cultivation so we need to remeber who already did it
187  PL_FL1_FERTI_P1 = true;
188  }
189  }
190  // Queue up the next event -in this case stubble ploughing
192  break;
193  case pl_fl1_ferti_s1:
194  // In total 64% of stock farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
195  // We therefore assume that half of them (32%) do it now
196  if (m_ev->m_lock || m_farm->DoIt(32))
197  {
198  if (!m_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(5, 11) - g_date->DayInYear())) {
200  break;
201  }
202  else
203  {
204  //Rest of farmers do slurry before autumn plough/stubble cultivation so we need to remeber who already did it
205  PL_FL1_FERTI_S1 = true;
206  }
207  }
208  // Queue up the next event -in this case stubble ploughing
210  break;
212  // 60% will do stubble plough, but rest will get away with non-inversion cultivation
213  if (m_ev->m_lock || m_farm->DoIt(60))
214  {
215  if (!m_farm->StubblePlough(m_field, 0.0, g_date->DayInYear(5, 11) - g_date->DayInYear())) {
217  break;
218  }
219  else
220  {
221  // 60% of farmers will do this, but the other 40% won't so we need to remember whether we are in one or the other group
222  PL_FL1_STUBBLE_PLOUGH = true;
223  // Queue up the next event
225  break;
226  }
227  }
229  break;
231  if (!m_farm->AutumnHarrow(m_field, 0.0, g_date->DayInYear(5, 11) - g_date->DayInYear())) {
233  break;
234  }
236  break;
238  if (m_ev->m_lock || m_farm->DoIt(40))
239  {
240  if (!m_farm->AutumnHarrow(m_field, 0.0, g_date->Date() + 7 - g_date->DayInYear())) {
242  break;
243  }
244  }
245  d1 = g_date->Date() + 1;
246  if (d1 < g_date->OldDays() + g_date->DayInYear(10, 9)) {
247  d1 = g_date->OldDays() + g_date->DayInYear(10, 9);
248  }
249  if (m_farm->IsStockFarmer()) //Stock Farmer
250  {
252  }
253  else SimpleEvent_(d1, pl_fl1_ferti_p2, false, m_farm, m_field);
254  break;
256  if (!m_farm->StubbleHarrowing(m_field, 0.0, g_date->DayInYear(10, 11) - g_date->DayInYear())) {
258  break;
259  }
260  d1 = g_date->Date() + 1;
261  if (d1 < g_date->OldDays() + g_date->DayInYear(10, 9)) {
262  d1 = g_date->OldDays() + g_date->DayInYear(10, 9);
263  }
264  if (m_farm->IsStockFarmer()) //Stock Farmer
265  {
267  }
268  else SimpleEvent_(d1, pl_fl1_ferti_p2, false, m_farm, m_field);
269  break;
270  case pl_fl1_ferti_p2:
271  // In total 64% of arable farmers do slurry in the autumn, either before stubble plough/harrow or later before autumn plough/cultivation
272  // We therefore assume that half of them (32%) do it now (if haven't done before)
273  if ((m_ev->m_lock || m_farm->DoIt(static_cast<int>((32.0/68.0)*100)))&&(PL_FL1_FERTI_P1==false))
274  {
275  if (!m_farm->FP_Slurry(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
277  break;
278  }
279  }
281  break;
282  case pl_fl1_ferti_s2:
283  // In total 64% of stock 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 (32%) do it now (if haven't done before)
285  if ((m_ev->m_lock || m_farm->DoIt(static_cast<int>((32.0/68.0)*100))) && (PL_FL1_FERTI_S1==false))
286  {
287  if (!m_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
289  break;
290  }
291  }
293  break;
294  case pl_fl1_ferti_p3:
295  if (m_ev->m_lock || m_farm->DoIt(41))
296  {
297  if (!m_farm->FP_NPK(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
299  break;
300  }
301  }
303  break;
304  case pl_fl1_ferti_s3:
305  if (m_ev->m_lock || m_farm->DoIt(41))
306  {
307  if (!m_farm->FA_NPK(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
309  break;
310  }
311  }
313  break;
315  // 88% will do winter plough, but rest will get away with non-inversion cultivation
316  if (m_ev->m_lock || m_farm->DoIt(88))
317  {
318  if (!m_farm->WinterPlough(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
320  break;
321  }
322  else
323  {
324  // 88% of farmers will do this, but the other 12% won't so we need to remember whether we are in one or the other group
325  PL_FL1_WINTER_PLOUGH = true;
326  // Queue up the next event
328  break;
329  }
330  }
332  break;
334  // the rest 12% who did not plough do heavy stubble cultivation
337  break;
338  }
340  break;
342  if ((m_ev->m_lock) || m_farm->DoIt(90))
343  {
344  if (!m_farm->SpringHarrow(m_field, 0.0, g_date->DayInYear(31, 3) - g_date->DayInYear())) {
346  break;
347  }
348  }
349  d1 = g_date->Date() + 1;
350  if (d1 < g_date->OldDays() + g_date->DayInYear(5, 3)) {
351  d1 = g_date->OldDays() + g_date->DayInYear(5, 3);
352  }
353  if (m_farm->IsStockFarmer()) //Stock Farmer
354  {
356  }
357  else SimpleEvent_(d1, pl_fl1_ferti_p4, false, m_farm, m_field);
358  break;
359  case pl_fl1_ferti_p4:
360  if (m_ev->m_lock || m_farm->DoIt(78))
361  {
362  if (!m_farm->FP_PK(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
364  break;
365  }
366  PL_FL1_SPRING_FERTI = true;
367  }
369  break;
370  case pl_fl1_ferti_s4:
371  if (m_ev->m_lock || m_farm->DoIt(78))
372  {
373  if (!m_farm->FA_PK(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
375  break;
376  }
378  }
380  break;
382  if (PL_FL1_SPRING_FERTI == 1)
383  {
386  break;
387  }
388  }
389  d1 = g_date->Date() + 3;
390  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 4)) {
391  d1 = g_date->OldDays() + g_date->DayInYear(1, 4);
392  }
394  break;
395  case pl_fl1_herbicide1:
396  // Together 30% of farmers will do glyphosate spraying, but 15% before sow and the rest before emergence
397  if (m_ev->m_lock || m_farm->DoIt(15))
398  {
399  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
401  break;
402  }
403  PL_FL1_HERBICIDE1 = true;
404  }
405  // Queue up the next event
406  d1 = g_date->Date() + 3;
407  if (d1 < g_date->OldDays() + g_date->DayInYear(20, 4)) {
408  d1 = g_date->OldDays() + g_date->DayInYear(20, 4);
409  }
411  break;
413  if (m_ev->m_lock || m_farm->DoIt(98))
414  {
417  break;
418  }
419  }
421  break;
422  case pl_fl1_spring_sow:
423  if (cfg_seedcoating_lucerne_on.value() && a_field->GetLandscape()->SupplyShouldSpray()) {
424  if (!m_farm->SpringSow(m_field, 0.0, g_date->DayInYear(5, 5) - g_date->DayInYear(),
427  break;
428  }
429  }
430  else {
431  if (!m_farm->SpringSow(m_field, 0.0, g_date->DayInYear(5, 5) - g_date->DayInYear())) {
433  break;
434  }
435  }
436 
437  // Here is a fork leading to four parallel events
438  SimpleEvent_(g_date->Date() + 3, pl_fl1_herbicide2, false, m_farm, m_field); // Herbidide thread
439  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(20, 5), pl_fl1_cut_to_silage1, false, m_farm, m_field); // Cutting thread
440  break;
441  case pl_fl1_herbicide2:
442  // Here comes the herbicide thread
443  // Check biomass
444  if (m_field->GetGreenBiomass() <= 0)
445  {
446  // The rest 15% of farmers do glyphosate spraying before emergence
447  if ((m_ev->m_lock || (m_farm->DoIt(static_cast<int>((15.0 / 85.0) * 100))) && (PL_FL1_HERBICIDE1 == false)))
448  {
449  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear())) {
451  break;
452  }
453  }
455  break;
456  }
457  else {
459  }
460  break;
461  case pl_fl1_herbicide3:
462  if (m_ev->m_lock || m_farm->DoIt(49))
463  {
464  if (m_field->GetGreenBiomass() <= 0) {
466  }
467  else
468  {
469  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(15, 7) - g_date->DayInYear())) {
471  break;
472  }
474  }
475  }
476  // End of thread
477  break;
479  // Here comes cutting thread
480  if (PL_FL1_HERBI_DATE >= g_date->Date() - 2) { // Should by at least 3 days after herbicide
482  }
483  else
484  {
485  if (!m_farm->CutToSilage(m_field, 0.0, g_date->DayInYear(10, 6) - g_date->DayInYear())) {
487  break;
488  }
489  }
491  break;
493  if (PL_FL1_HERBI_DATE >= g_date->Date() - 2) { // Should by at least 3 days after herbicide
495  }
496  else
497  {
498  if (m_ev->m_lock || m_farm->DoIt(73))
499  {
500  if (!m_farm->CutToSilage(m_field, 0.0, g_date->DayInYear(10, 8) - g_date->DayInYear())) {
502  break;
503  }
504  }
505  }
506  done = true;
507  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
508  // END of MAIN THREAD
509  break;
510  default:
511  g_msg->Warn(WARN_BUG, "PLFodderLucerne1::Do(): "
512  "Unknown event type! ", "");
513  exit(1);
514  }
515  return done;
516 }

References Farm::AutumnHarrow(), cfg_seedcoating_lucerne_on, cfg_seedcoating_product_amounts, LE::ClearManagementActionSum(), Farm::CutToSilage(), Calendar::Date(), Calendar::DayInYear(), Farm::DoIt(), Farm::FA_NPK(), Farm::FA_PK(), Farm::FA_Slurry(), Farm::FP_NPK(), Farm::FP_PK(), Farm::FP_Slurry(), g_date, g_msg, LE::GetGreenBiomass(), LE::GetOwner(), LE::GetPoly(), Farm::GetPreviousTov(), LE::GetRotIndex(), Farm::GetType(), Calendar::GetYearNumber(), Farm::HeavyCultivatorAggregate(), Farm::HerbicideTreat(), Farm::IsStockFarmer(), Crop::m_ev, Crop::m_farm, Crop::m_field, Crop::m_first_date, FarmEvent::m_first_year, FarmEvent::m_forcespring, FarmEvent::m_lock, FarmEvent::m_next_tov, FarmEvent::m_startday, FarmEvent::m_todo, Calendar::OldDays(), pl_fl1_autumn_harrow1, pl_fl1_autumn_harrow2, pl_fl1_cut_to_silage1, pl_fl1_cut_to_silage2, PL_FL1_FERTI_P1, pl_fl1_ferti_p1, pl_fl1_ferti_p2, pl_fl1_ferti_p3, pl_fl1_ferti_p4, PL_FL1_FERTI_S1, pl_fl1_ferti_s1, pl_fl1_ferti_s2, pl_fl1_ferti_s3, pl_fl1_ferti_s4, pl_fl1_heavy_cultivator, PL_FL1_HERBI_DATE, pl_fl1_herbicide0, PL_FL1_HERBICIDE1, pl_fl1_herbicide1, pl_fl1_herbicide2, pl_fl1_herbicide3, pl_fl1_preseeding_cultivator, PL_FL1_SPRING_FERTI, pl_fl1_spring_harrow, pl_fl1_spring_sow, pl_fl1_start, pl_fl1_stubble_harrow, PL_FL1_STUBBLE_PLOUGH, pl_fl1_stubble_plough, PL_FL1_WINTER_PLOUGH, pl_fl1_winter_plough, pl_fl1_winter_stubble_cultivator_heavy, ppp_1, Farm::PreseedingCultivator(), Crop::SimpleEvent_(), Farm::SpringHarrow(), Farm::SpringSow(), Farm::StubbleCultivatorHeavy(), Farm::StubbleHarrowing(), Farm::StubblePlough(), tof_OptimisingFarm, tov_PLFodderLucerne1, CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), WARN_BUG, and Farm::WinterPlough().

◆ SetUpFarmCategoryInformation()

void PLFodderLucerne1::SetUpFarmCategoryInformation ( )
inline
92  {
93  const int elements = 2 + (pl_fl1_foobar - PLFODDERLUCERNE1_BASE);
95 
96  FarmManagementCategory catlist[elements] =
97  {
98  fmc_Others, // zero element unused but must be here
99  fmc_Others,//pl_fl1_start = 1, // Compulsory, must always be 1 (one).
100  fmc_Others,//pl_fl1_sleep_all_day = PLFODDERLUCERNE1_BASE,
101  fmc_Herbicide,//pl_fl1_herbicide0,
102  fmc_Fertilizer,//pl_fl1_ferti_p1,
103  fmc_Fertilizer,//pl_fl1_ferti_s1,
104  fmc_Cultivation,//pl_fl1_stubble_plough,
105  fmc_Cultivation,//pl_fl1_autumn_harrow1,
106  fmc_Cultivation,//pl_fl1_autumn_harrow2,
107  fmc_Cultivation,//pl_fl1_stubble_harrow,
108  fmc_Fertilizer,//pl_fl1_ferti_p2,
109  fmc_Fertilizer,//pl_fl1_ferti_s2,
110  fmc_Fertilizer,//pl_fl1_ferti_p3,
111  fmc_Fertilizer,//pl_fl1_ferti_s3,
112  fmc_Cultivation,//pl_fl1_winter_plough,
113  fmc_Cultivation,//pl_fl1_winter_stubble_cultivator_heavy,
114  fmc_Cultivation,//pl_fl1_spring_harrow,
115  fmc_Fertilizer,//pl_fl1_ferti_p4,
116  fmc_Fertilizer,//pl_fl1_ferti_s4,
117  fmc_Cultivation,//pl_fl1_heavy_cultivator,
118  fmc_Herbicide,//pl_fl1_herbicide1,
119  fmc_Cultivation,//pl_fl1_preseeding_cultivator,
120  fmc_Others,//pl_fl1_spring_sow,
121  fmc_Herbicide,//pl_fl1_herbicide2,
122  fmc_Herbicide,//pl_fl1_herbicide3,
123  fmc_Cutting,//pl_fl1_cut_to_silage1,
124  fmc_Cutting//pl_fl1_cut_to_silage2,
125  };
126  // Iterate over the catlist elements and copy them to vector
127  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
128 
129  }

References fmc_Cultivation, fmc_Cutting, fmc_Fertilizer, fmc_Herbicide, fmc_Others, Crop::m_base_elements_no, Crop::m_ManagementCategories, pl_fl1_foobar, and PLFODDERLUCERNE1_BASE.

Referenced by PLFodderLucerne1().


The documentation for this class was generated from the following files:
FarmEvent::m_forcespring
bool m_forcespring
Definition: Farm.h:392
pl_fl1_herbicide3
Definition: PLFodderLucerne1.h:65
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
pl_fl1_winter_plough
Definition: PLFodderLucerne1.h:55
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
Farm::HerbicideTreat
virtual bool HerbicideTreat(LE *a_field, double a_user, int a_days)
Apply herbicide to a_field.
Definition: FarmFuncs.cpp:2025
PLFodderLucerne1::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: PLFodderLucerne1.h:92
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
PLFODDERLUCERNE1_BASE
#define PLFODDERLUCERNE1_BASE
Definition: PLFodderLucerne1.h:24
pl_fl1_autumn_harrow1
Definition: PLFodderLucerne1.h:48
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
Farm::StubbleCultivatorHeavy
virtual bool StubbleCultivatorHeavy(LE *a_field, double a_user, int a_days)
Carry out a stubble cultivation event on a_field. This is non-inversion type of cultivation which can...
Definition: FarmFuncs.cpp:245
LE::ClearManagementActionSum
void ClearManagementActionSum()
clears the management action counters
Definition: Elements.h:247
Farm::FP_NPK
virtual bool FP_NPK(LE *a_field, double a_user, int a_days)
Apply NPK fertilizer, on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:645
Farm::CutToSilage
virtual bool CutToSilage(LE *a_field, double a_user, int a_days)
Cut vegetation for silage on a_field.
Definition: FarmFuncs.cpp:1644
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_fl1_autumn_harrow2
Definition: PLFodderLucerne1.h:49
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
pl_fl1_spring_harrow
Definition: PLFodderLucerne1.h:57
Farm::StubblePlough
virtual bool StubblePlough(LE *a_field, double a_user, int a_days)
Carry out a stubble ploughing event on a_field. This is similar to normal plough but shallow (normall...
Definition: FarmFuncs.cpp:232
LE::GetPoly
int GetPoly(void)
Returns the polyref number for this polygon.
Definition: Elements.h:238
PL_FL1_FERTI_S1
#define PL_FL1_FERTI_S1
Definition: PLFodderLucerne1.h:29
pl_fl1_herbicide1
Definition: PLFodderLucerne1.h:61
pl_fl1_ferti_s1
Definition: PLFodderLucerne1.h:46
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
Farm::GetPreviousTov
TTypesOfVegetation GetPreviousTov(int a_index)
Definition: Farm.h:966
pl_fl1_ferti_s2
Definition: PLFodderLucerne1.h:52
Farm::SpringSow
virtual bool SpringSow(LE *a_field, double a_user, int a_days, double a_seed_coating_amount=-1, PlantProtectionProducts a_ppp=ppp_foobar)
Carry out a sowing event in the spring on a_field.
Definition: FarmFuncs.cpp:501
Farm::GetType
TTypesOfFarm GetType(void)
Definition: Farm.h:956
cfg_seedcoating_product_amounts
CfgArray_Double cfg_seedcoating_product_amounts
Amount of seed coating pesticide applied in grams of active substance per hectare for each of the 10 ...
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
pl_fl1_herbicide0
Definition: PLFodderLucerne1.h:44
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
FarmEvent::m_startday
int m_startday
Definition: Farm.h:385
Farm::FA_NPK
virtual bool FA_NPK(LE *a_field, double a_user, int a_days)
Apply NPK fertilizer to a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:982
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
tov_PLFodderLucerne1
Definition: LandscapeFarmingEnums.h:243
CfgBool::value
bool value() const
Definition: Configurator.h:164
pl_fl1_stubble_harrow
Definition: PLFodderLucerne1.h:50
fmc_Cutting
Definition: LandscapeFarmingEnums.h:1009
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
Calendar::Date
long Date(void)
Definition: Calendar.h:57
PL_FL1_STUBBLE_PLOUGH
#define PL_FL1_STUBBLE_PLOUGH
Definition: PLFodderLucerne1.h:30
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
pl_fl1_start
Definition: PLFodderLucerne1.h:42
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
pl_fl1_preseeding_cultivator
Definition: PLFodderLucerne1.h:62
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
LE::GetRotIndex
int GetRotIndex(void)
Definition: Elements.h:373
pl_fl1_cut_to_silage1
Definition: PLFodderLucerne1.h:66
FarmEvent::m_next_tov
TTypesOfVegetation m_next_tov
Definition: Farm.h:390
PL_FL1_WINTER_PLOUGH
#define PL_FL1_WINTER_PLOUGH
Definition: PLFodderLucerne1.h:31
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
pl_fl1_heavy_cultivator
Definition: PLFodderLucerne1.h:60
pl_fl1_ferti_s3
Definition: PLFodderLucerne1.h:54
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
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
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_fl1_ferti_p1
Definition: PLFodderLucerne1.h:45
pl_fl1_stubble_plough
Definition: PLFodderLucerne1.h:47
tof_OptimisingFarm
Definition: LandscapeFarmingEnums.h:696
pl_fl1_cut_to_silage2
Definition: PLFodderLucerne1.h:67
PL_FL1_HERBICIDE1
#define PL_FL1_HERBICIDE1
Definition: PLFodderLucerne1.h:33
PL_FL1_SPRING_FERTI
#define PL_FL1_SPRING_FERTI
Definition: PLFodderLucerne1.h:32
pl_fl1_ferti_p3
Definition: PLFodderLucerne1.h:53
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
Farm::AutumnHarrow
virtual bool AutumnHarrow(LE *a_field, double a_user, int a_days)
Carry out a harrow event in the autumn on a_field.
Definition: FarmFuncs.cpp:285
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
pl_fl1_ferti_p4
Definition: PLFodderLucerne1.h:58
Farm::WinterPlough
virtual bool WinterPlough(LE *a_field, double a_user, int a_days)
Carry out a ploughing event in the winter on a_field.
Definition: FarmFuncs.cpp:395
PL_FL1_HERBI_DATE
#define PL_FL1_HERBI_DATE
Definition: PLFodderLucerne1.h:34
PL_FL1_FERTI_P1
#define PL_FL1_FERTI_P1
A flag used to indicate autumn ploughing status.
Definition: PLFodderLucerne1.h:28
LE::GetOwner
Farm * GetOwner(void)
Definition: Elements.h:256
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
pl_fl1_ferti_s4
Definition: PLFodderLucerne1.h:59
cfg_seedcoating_lucerne_on
CfgBool cfg_seedcoating_lucerne_on
Turn on seed coating for lucerne.
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
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
pl_fl1_ferti_p2
Definition: PLFodderLucerne1.h:51
pl_fl1_spring_sow
Definition: PLFodderLucerne1.h:63
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
Farm::HeavyCultivatorAggregate
virtual bool HeavyCultivatorAggregate(LE *a_field, double a_user, int a_days)
Carry out a heavy cultivation event on a_field. This is non-inversion type of cultivation which can b...
Definition: FarmFuncs.cpp:259
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
Farm::StubbleHarrowing
virtual bool StubbleHarrowing(LE *a_field, double a_user, int a_days)
Carry out stubble harrowing on a_field.
Definition: FarmFuncs.cpp:1523
Farm::SpringHarrow
virtual bool SpringHarrow(LE *a_field, double a_user, int a_days)
Carry out a harrow event in the spring on a_field.
Definition: FarmFuncs.cpp:459
pl_fl1_winter_stubble_cultivator_heavy
Definition: PLFodderLucerne1.h:56
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_fl1_foobar
Definition: PLFodderLucerne1.h:68
pl_fl1_herbicide2
Definition: PLFodderLucerne1.h:64