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

DK_OChristmasTrees_Perm class
. More...

#include <DK_OChristmasTrees_Perm.h>

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

DK_OChristmasTrees_Perm class
.

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

◆ DK_OChristmasTrees_Perm()

DK_OChristmasTrees_Perm::DK_OChristmasTrees_Perm ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
171  : Crop(a_tov, a_toc, a_L)
172  {
173  // When we start it off, the first possible date for a farm operation
174  // This information is used by other crops when they decide how much post processing of
175  // the management is allowed after harvest before the next crop starts.
176  m_first_date = g_date->DayInYear(1, 12);
178  }

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

Member Function Documentation

◆ Do()

bool DK_OChristmasTrees_Perm::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 a_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.

Reimplemented from Crop.

88 {
89  m_field = a_field; // this is needed because of possible calls to other methods and currently we do not pass parameters.
90  m_farm = a_farm; // this is needed because of possible calls to other methods and currently we do not pass parameters.
91  m_ev = a_ev;
92  bool done = false; // The boolean value done indicates when we are totally finished with this plan (i.e. it is set to true).
93  bool flag = false;
94  int d1 = 0;
96  // Depending what event has occured jump to the correct bit of code e.g. for ww_start jump to line 67 below
97  switch (a_ev->m_todo)
98  {
99  case dk_octp_start:
100  {
101  DK_OCTP_YEAR = 0;
102  a_field->ClearManagementActionSum();
103  m_last_date = g_date->DayInYear(6, 10); // Should match the last flexdate below
104  //Create a 2d array of 1 plus the number of operations you use. Change only 4+1 to what you need in the line below
105  std::vector<std::vector<int>> flexdates(1 + 1, std::vector<int>(2, 0));
106  // Set up the date management stuff
107  // Start and stop dates for all events after harvest
108  flexdates[0][1] = g_date->DayInYear(5, 10); // last possible day of in this case row cultivation autumn (no harvest in this code)
109  // Now these are done in pairs, start & end for each operation. If its not used then -1
110  flexdates[1][0] = -1; // This date will be moved back as far as necessary and potentially to flexdates 1 (start op 1)
111  flexdates[1][1] = g_date->DayInYear(6, 10); // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 1) harrow autumn
112 
113  // Below if this is a spring crop use 365, otherwise first parameter is always 0, second parameter is fixed, and the third is the start up operation in the first year
114  if (StartUpCrop(365, flexdates, int(dk_octp_sleep_all_day))) break;
115 
116  // End single block date checking code. Please see next line comment as well.
117  // Reinit d1 to first possible starting date.
118  // OK, let's go. - EST1 followed by 10 years of growing threes -> EST2 followed by 10 years of growing trees
119  if ((DK_OCTP_YEAR + g_date->GetYearNumber()) % 22 == 0) // establishment year 1
120  {
121  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
123  }
124  else if ((DK_OCTP_YEAR + g_date->GetYearNumber()) % 22 == 1)// first year after est
125  {
126  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
128  }
129  else if ((DK_OCTP_YEAR + g_date->GetYearNumber()) % 22 == 2 || (DK_OCTP_YEAR + g_date->GetYearNumber()) % 22 == 3) // 2nd + 3rd after
130  {
131  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
133  }
134  else if ((DK_OCTP_YEAR + g_date->GetYearNumber()) % 22 == 4) //4th after
135  {
136  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
137  SimpleEvent(d1, dk_octp_npk_s5, false);
138  }
139  else if ((DK_OCTP_YEAR + g_date->GetYearNumber()) % 22 == 5) // 5th after
140  {
141  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
142  SimpleEvent(d1, dk_octp_npk1_s6, false);
143  }
144  else if ((DK_OCTP_YEAR + g_date->GetYearNumber()) % 22 == 6 || (DK_OCTP_YEAR + g_date->GetYearNumber()) % 22 == 7) // 6th + 7th after
145  {
146  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
147  SimpleEvent(d1, dk_octp_npk1_s7_8, false);
148  }
149  else if ((DK_OCTP_YEAR + g_date->GetYearNumber()) % 22 == 8 || (DK_OCTP_YEAR + g_date->GetYearNumber()) % 22 == 9) // 8th + 9th after
150  {
151  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
152  SimpleEvent(d1, dk_octp_npk1_s9_10, false);
153  }
154  else if ((DK_OCTP_YEAR + g_date->GetYearNumber()) % 22 == 10)
155  {
156  d1 = g_date->OldDays() + g_date->DayInYear(10, 3) + 365; // harvest year
157  SimpleEvent(d1, dk_octp_npk1_s11, false);
158  }
159  else if ((DK_OCTP_YEAR + g_date->GetYearNumber()) % 22 == 11) // second establishment
160  {
161  d1 = g_date->OldDays() + g_date->DayInYear(10, 3) + 365;
162  SimpleEvent(d1, dk_octp_crush_trees, false);
163  }
164  else if ((DK_OCTP_YEAR + g_date->GetYearNumber()) % 22 == 12)// first year after est
165  {
166  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
168  }
169  else if ((DK_OCTP_YEAR + g_date->GetYearNumber()) % 22 == 13 || (DK_OCTP_YEAR + g_date->GetYearNumber()) % 22 == 14) // 2nd + 3rd after
170  {
171  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
173  }
174  else if ((DK_OCTP_YEAR + g_date->GetYearNumber()) % 22 == 15) //4th after
175  {
176  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
177  SimpleEvent(d1, dk_octp_npk_s5, false);
178  }
179  else if ((DK_OCTP_YEAR + g_date->GetYearNumber()) % 22 == 16) // 5th after
180  {
181  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
182  SimpleEvent(d1, dk_octp_npk1_s6, false);
183  }
184  else if ((DK_OCTP_YEAR + g_date->GetYearNumber()) % 22 == 17 || (DK_OCTP_YEAR + g_date->GetYearNumber()) % 22 == 18) // 6th + 7th after
185  {
186  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
187  SimpleEvent(d1, dk_octp_npk1_s7_8, false);
188  }
189  else if ((DK_OCTP_YEAR + g_date->GetYearNumber()) % 22 == 19 || (DK_OCTP_YEAR + g_date->GetYearNumber()) % 22 == 20) // 8th + 9th after
190  {
191  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
192  SimpleEvent(d1, dk_octp_npk1_s9_10, false);
193  }
194  else if ((DK_OCTP_YEAR + g_date->GetYearNumber()) % 22 == 21)
195  {
196  d1 = g_date->OldDays() + g_date->DayInYear(10, 3) + 365; // harvest year
197  SimpleEvent(d1, dk_octp_npk1_s11, false);
198  }
199  break;
200 
201  }
202  break;
203 
204  //EST 1
206  if (!a_farm->SleepAllDay(a_field, 0.0,
207  g_date->DayInYear(19, 8) - g_date->DayInYear())) {
209  break;
210  }
212  break;
213 
215  if (m_field->GetSoilType() != tos_Sand && m_field->GetSoilType() != tos_LoamySand && m_field->GetSoilType() != tos_SandyLoam && m_field->GetSoilType() != tos_SandyClayLoam) // on clay soils (NL KLEI & VEEN)
216  {
217  if (!a_farm->AutumnPlough(a_field, 0.0,
218  g_date->DayInYear(10, 9) - g_date->DayInYear())) {
220  break;
221  }
223  break;
224  }
226  break; // sandy soils
227 
229  if (!a_farm->DeepPlough(a_field, 0.0,
230  g_date->DayInYear(10, 9) - g_date->DayInYear())) {
232  break;
233  }
235  break;
236 
238  if (!a_farm->AutumnPlough(a_field, 0.0,
239  g_date->DayInYear(20, 9) - g_date->DayInYear())) {
241  break;
242  }
244  break;
245 
247  if (!a_farm->StubbleHarrowing(a_field, 0.0,
248  g_date->DayInYear(20, 9) - g_date->DayInYear())) {
250  break;
251  }
253  break;
254 
256  if (!a_farm->AutumnSow(a_field, 0.0,
257  g_date->DayInYear(30, 9) - g_date->DayInYear())) {
259  break;
260  }
262  break;
263 
265  if (!a_farm->AutumnSow(a_field, 0.0,
266  g_date->DayInYear(30, 9) - g_date->DayInYear())) {
268  break;
269  }
271  break;
272 
274  if (!a_farm->RowCultivation(a_field, 0.0, g_date->DayInYear(5, 10) - g_date->DayInYear())) {
276  break;
277  }
279  break;
280 
282  if (!a_farm->AutumnHarrow(a_field, 0.0, g_date->DayInYear(6, 10) - g_date->DayInYear())) {
284  break;
285  }
286  done = true; // end of EST1
287  break;
288 
289  // EST2
290  case dk_octp_crush_trees:
291  if (!m_farm->Shredding(m_field, 0.0,
292  g_date->DayInYear(31, 5) - g_date->DayInYear())) {
294  break;
295  }
297  break;
298 
299  case dk_octp_sow_catch_crop1: // may need changing // some do this (suggest 50%) others sow inter crops
300  if (m_ev->m_lock || m_farm->DoIt(50)) {
301  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(15, 8) - g_date->DayInYear())) {
303  break;
304  }
305  SimpleEvent(g_date->Date() + 1, dk_octp_plant_trees, false);
306  break;
307  }
309  break;
310 
311  case dk_octp_sow_inter_crops: // may need changing
312  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(31, 7) - g_date->DayInYear())) {
314  break;
315  }
316  SimpleEvent(g_date->Date() + 50, dk_octp_harrow, false);
317  break;
318 
319  case dk_octp_harrow:
320  if (!m_farm->AutumnHarrow(m_field, 0.0, g_date->DayInYear(29, 9) - g_date->DayInYear())) {
321  SimpleEvent(g_date->Date() + 1, dk_octp_harrow, true);
322  break;
323  }
324  SimpleEvent(g_date->Date() + 1, dk_octp_plant_trees, false);
325  break;
326 
327  case dk_octp_plant_trees:
328  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(30, 9) - g_date->DayInYear())) {
330  break;
331  }
332  done = true; // end of EST2
333  break;
334 
335  // 1st year after EST
337  if (m_field->GetSoilType() == tos_Sand || m_field->GetSoilType() == tos_LoamySand || m_field->GetSoilType() == tos_SandyLoam || m_field->GetSoilType() == tos_SandyClayLoam) // on sandy soils (NL ZAND & LOSS)
338  {
339  if (a_farm->IsStockFarmer()) {
340  if (!m_farm->FA_Manure(m_field, 0.0,
341  g_date->DayInYear(30, 4) - g_date->DayInYear())) {
343  break;
344  }
346  break;
347  }
349  break;
350  }
352  break; // clay soils
353 
355  if (!m_farm->FP_Manure(m_field, 0.0,
356  g_date->DayInYear(30, 4) - g_date->DayInYear())) {
358  break;
359  }
361  break;
362 
364  if (a_farm->IsStockFarmer()) {
365  if (!m_farm->FA_Manure(m_field, 0.0,
366  g_date->DayInYear(15, 5) - g_date->DayInYear())) {
368  break;
369  }
371  break;
372  }
374  break;
375 
377  if (!m_farm->FP_Manure(m_field, 0.0,
378  g_date->DayInYear(15, 5) - g_date->DayInYear())) {
380  break;
381  }
383  break;
384 
386  if (!m_farm->ManualWeeding(m_field, 0.0,
387  g_date->DayInYear(16, 5) - g_date->DayInYear())) {
389  break;
390  }
392  break;
393 
395  if (!m_farm->ManualWeeding(m_field, 0.0,
396  g_date->DayInYear(16, 6) - g_date->DayInYear())) {
398  break;
399  }
400  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 7), dk_octp_wait, false);
401  break;
402 
403  case dk_octp_wait:
404  // end of 1st year after
405  done = true;
406  break;
407 
408  // year 2nd + 3rd year after
410  if (m_field->GetSoilType() == tos_Sand || m_field->GetSoilType() == tos_LoamySand || m_field->GetSoilType() == tos_SandyLoam || m_field->GetSoilType() == tos_SandyClayLoam) // on sandy soils (NL ZAND & LOSS)
411  {
412  if (a_farm->IsStockFarmer())
413  {
414  if (!m_farm->FA_Manure(m_field, 0.0,
415  g_date->DayInYear(30, 4) - g_date->DayInYear())) {
417  break;
418  }
419  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_octp_npk_sand1_s3_4, false); // fertilizer thread main thread
420  break;
421  }
422  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 1), dk_octp_ferti_sand_p3_4, false); // fertilizer thread main thread
423  break;
424  }
426  break;
427 
428 
430  if (!m_farm->FP_Manure(m_field, 0.0,
431  g_date->DayInYear(30, 4) - g_date->DayInYear())) {
433  break;
434  }
435  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_octp_npk_sand1_p3_4, false); // fertilizer thread main thread
436  break;
437 
439  if (a_farm->IsStockFarmer())
440  {
441  if (!m_farm->FA_Manure(m_field, 0.0,
442  g_date->DayInYear(15, 5) - g_date->DayInYear())) {
444  break;
445  }
447  break;
448  }
450  break;
451 
453  if (!m_farm->FP_Manure(m_field, 0.0,
454  g_date->DayInYear(15, 5) - g_date->DayInYear())) {
456  break;
457  }
459  break;
460 
462  if (!m_farm->FA_NPK(m_field, 0.0,
463  g_date->DayInYear(16, 5) - g_date->DayInYear())) {
465  break;
466  }
467  SimpleEvent(g_date->Date() + 1, dk_octp_manual_weeding_3_4, false); // weeding / herbicide thread
468  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6), dk_octp_grazing_3_4, false); // grazing thread
470  break;
471 
473  if (!m_farm->FP_NPK(m_field, 0.0,
474  g_date->DayInYear(16, 5) - g_date->DayInYear())) {
476  break;
477  }
478  SimpleEvent(g_date->Date() + 1, dk_octp_manual_weeding_3_4, false); // weeding / herbicide thread
479  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6), dk_octp_grazing_3_4, false); // grazing thread
481  break;
482 
484  if (!m_farm->FA_NPK(m_field, 0.0,
485  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
487  break;
488  }
489  SimpleEvent(g_date->Date() + 1, dk_octp_manual_weeding_3_4, false); // weeding / herbicide thread
490  SimpleEvent(g_date->Date() + 1, dk_octp_grazing_3_4, false); // grazing thread
492  break;
493 
495  if (!m_farm->FP_NPK(m_field, 0.0,
496  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
498  break;
499  }
500  SimpleEvent(g_date->Date() + 1, dk_octp_manual_weeding_3_4, false); // weeding / herbicide thread
501  SimpleEvent(g_date->Date() + 1, dk_octp_grazing_3_4, false); // grazing thread
503  break;
504 
506  if (!m_farm->ManualWeeding(m_field, 0.0,
507  g_date->DayInYear(16, 5) - g_date->DayInYear())) {
509  break;
510  }
512  break;
513 
514  case dk_octp_manual_cutting_3_4: // no specific timing for this trimming event
515  if (!m_farm->Pruning(m_field, 0.0,
516  g_date->DayInYear(31, 8) - g_date->DayInYear())) {
518  break;
519  }
521  break;
522 
524  if (!m_farm->ManualWeeding(m_field, 0.0,
525  g_date->DayInYear(30, 9) - g_date->DayInYear())) {
527  break;
528  }
529  break;
530 
531  // end of weeding
532 
533  case dk_octp_grazing_3_4:
534  if (m_ev->m_lock || m_farm->DoIt_prob(.10)) { // suggest it is not common
535  if (!m_farm->PigsOut(m_field, 0.0,
536  g_date->DayInYear(1, 7) - g_date->DayInYear())) {
538  break;
539  }
541  break;
542  }
543  break;
544 
545  case dk_octp_pig_is_out_3_4: // Keep the pigs out there
546  // PigsAreOut() returns false if it is not time to stop grazing
547  if (!m_farm->PigsAreOut(m_field, 0.0,
548  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
550  break;
551  }
552  break; // end of grazing thread
553 
555  if (!m_farm->FA_NPK(m_field, 0.0,
556  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
558  break;
559  }
561  break;
562 
564  if (!m_farm->FP_NPK(m_field, 0.0,
565  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
567  break;
568  }
570  break;
571 
572  // y4th year after
573  case dk_octp_npk_s5:
574  if (a_farm->IsStockFarmer())
575  {
576  if (!m_farm->FA_NPK(m_field, 0.0,
577  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
578  SimpleEvent(g_date->Date() + 1, dk_octp_npk_s5, true);
579  break;
580  }
581  SimpleEvent(g_date->Date() + 1, dk_octp_manual_weeding_5, false); // weeding / herbicide thread
582  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6), dk_octp_grazing_5, false); // grazing thread
583  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 8), dk_octp_npk_sand_s5, false); // fertilizer thread - main thread
584  break;
585  }// here comes a fork of parallel events:
586  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 1), dk_octp_npk_p5, false);
587  break;
588 
589  case dk_octp_npk_p5:
590  if (!m_farm->FP_NPK(m_field, 0.0,
591  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
592  SimpleEvent(g_date->Date() + 1, dk_octp_npk_p5, true);
593  break;
594  }
595  SimpleEvent(g_date->Date() + 1, dk_octp_manual_weeding_5, false); // weeding / herbicide thread
596  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6), dk_octp_grazing_5, false); // grazing thread
597  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 8), dk_octp_npk_sand_p5, false); // fertilizer thread - main thread
598  break;
599 
601  if (!m_farm->ManualWeeding(m_field, 0.0,
602  g_date->DayInYear(16, 5) - g_date->DayInYear())) {
604  break;
605  }
607  break;
608 
609  case dk_octp_manual_cutting_5: // no specific timing for this trimming event
610  if (!m_farm->Pruning(m_field, 0.0,
611  g_date->DayInYear(31, 8) - g_date->DayInYear())) {
612 
613 
615  break;
616  }
618  break;
619 
621  if (!m_farm->ManualWeeding(m_field, 0.0,
622  g_date->DayInYear(30, 9) - g_date->DayInYear())) {
624  break;
625  }
626  break;
627 
628  case dk_octp_grazing_5:
629  if (m_ev->m_lock || m_farm->DoIt_prob(.10)) { // suggest it is not common
630  if (!m_farm->PigsOut(m_field, 0.0,
631  g_date->DayInYear(1, 7) - g_date->DayInYear())) {
632  SimpleEvent(g_date->Date() + 1, dk_octp_grazing_5, true);
633  break;
634  }
636  break;
637  }
638  break;
639  case dk_octp_pig_is_out_5: // Keep the pigs out there
640  // PigsAreOut() returns false if it is not time to stop grazing
641  if (!m_farm->PigsAreOut(m_field, 0.0,
642  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
644  break;
645  }
646  break; // end of grazing thread
647 
648  case dk_octp_npk_sand_s5:
649  if (m_field->GetSoilType() == tos_Sand || m_field->GetSoilType() == tos_LoamySand || m_field->GetSoilType() == tos_SandyLoam || m_field->GetSoilType() == tos_SandyClayLoam) // on sandy soils (NL ZAND & LOSS)
650  {
651  if (!m_farm->FA_NPK(m_field, 0.0,
652  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
654  break;
655  }
656  }
658  break;
659 
660  case dk_octp_npk_sand_p5:
661  if (m_field->GetSoilType() == tos_Sand || m_field->GetSoilType() == tos_LoamySand || m_field->GetSoilType() == tos_SandyLoam || m_field->GetSoilType() == tos_SandyClayLoam) // on sandy soils (NL ZAND & LOSS)
662  {
663  if (!m_farm->FP_NPK(m_field, 0.0,
664  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
666  break;
667  }
668  }
670  break;
671 
672  case dk_octp_sow_catch_crop2: // changes may be needed
673  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(16, 8) - g_date->DayInYear())) {
675  break;
676  }
677  done = true;
678  break;
679  //end of year 2nd, 3rd and 4th year after
680 
681  // 5th year after
682  case dk_octp_npk1_s6:
683  if (a_farm->IsStockFarmer())
684  {
685  if (!m_farm->FA_NPK(m_field, 0.0,
686  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
687  SimpleEvent(g_date->Date() + 1, dk_octp_npk1_s6, true);
688  break;
689  }
690  // here comes a fork of parallel events:
691  SimpleEvent(g_date->Date() + 1, dk_octp_manual_weeding_6, false); // weeding / herbicide thread
692  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6), dk_octp_grazing_6, false); // grazing thread
693  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 8), dk_octp_npk2_s6, false); // fertilizer thread - main thread
694  break;
695  }
696  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 1), dk_octp_npk1_p6, false);
697  break;
698 
699  case dk_octp_npk1_p6:
700  if (!m_farm->FP_NPK(m_field, 0.0,
701  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
702  SimpleEvent(g_date->Date() + 1, dk_octp_npk1_p6, true);
703  break;
704  }
705  // here comes a fork of parallel events:
706  SimpleEvent(g_date->Date() + 1, dk_octp_manual_weeding_6, false); // weeding
707  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6), dk_octp_grazing_6, false); // grazing thread
709  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 8), dk_octp_npk2_p6, false); // fertilizer thread - main thread
710  break;
711 
712  case dk_octp_grazing_6:
713  if (m_ev->m_lock || m_farm->DoIt_prob(.10)) { // suggest it is not common
714  if (!m_farm->PigsOut(m_field, 0.0,
715  g_date->DayInYear(1, 7) - g_date->DayInYear())) {
716  SimpleEvent(g_date->Date() + 1, dk_octp_grazing_6, true);
717  break;
718  }
720  break;
721  }
722  break;
723 
724  case dk_octp_pig_is_out_6: // Keep the pigs out there
725  // PigsAreOut() returns false if it is not time to stop grazing
726  if (!m_farm->PigsAreOut(m_field, 0.0,
727  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
729  break;
730  }
731  break; // end of grazing thread
732 
734  if (!m_farm->ManualWeeding(m_field, 0.0,
735  g_date->DayInYear(16, 5) - g_date->DayInYear())) {
737  break;
738  }
740  break;
741 
742  case dk_octp_manual_cutting_6: // no specific timing for this trimming event
743  if (!m_farm->Pruning(m_field, 0.0,
744  g_date->DayInYear(16, 7) - g_date->DayInYear())) {
746  break;
747  }
749  break;
751  if (!m_farm->ManualWeeding(m_field, 0.0,
752  g_date->DayInYear(16, 8) - g_date->DayInYear())) {
754  break;
755  }
756  break;
757 
758  case dk_octp_npk2_s6:
759  if (!m_farm->FA_NPK(m_field, 0.0,
760  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
761  SimpleEvent(g_date->Date() + 1, dk_octp_npk2_s6, true);
762  break;
763  }
765  break;
766 
767  case dk_octp_npk2_p6:
768  if (!m_farm->FP_NPK(m_field, 0.0,
769  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
770  SimpleEvent(g_date->Date() + 1, dk_octp_npk2_p6, true);
771  break;
772  }
774  break;
775 
776  case dk_octp_calcium_s6:
777  if (m_field->GetSoilType() != tos_Sand && m_field->GetSoilType() != tos_LoamySand && m_field->GetSoilType() != tos_SandyLoam && m_field->GetSoilType() != tos_SandyClayLoam) // on clay soils (NL KLEI & VEEN)
778  {
779  if (!m_farm->FA_Calcium(m_field, 0.0,
780  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
781  SimpleEvent(g_date->Date() + 1, dk_octp_calcium_s6, true);
782  break;
783  }
784  }
786  break;
787 
788  case dk_octp_calcium_p6:
789  if (m_field->GetSoilType() != tos_Sand && m_field->GetSoilType() != tos_LoamySand && m_field->GetSoilType() != tos_SandyLoam && m_field->GetSoilType() != tos_SandyClayLoam) // on clay soils (NL KLEI & VEEN)
790  {
791  if (!m_farm->FP_Calcium(m_field, 0.0,
792  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
793  SimpleEvent(g_date->Date() + 1, dk_octp_calcium_p6, true);
794  break;
795  }
796  }
798  break;
799 
800  // 6th + 7th year after
801  case dk_octp_npk1_s7_8:
802  if (a_farm->IsStockFarmer())
803  {
804  if (!m_farm->FA_NPK(m_field, 0.0,
805  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
806  SimpleEvent(g_date->Date() + 1, dk_octp_npk1_s7_8, true);
807  break;
808  }
809  // here comes a fork of parallel events:
810  SimpleEvent(g_date->Date() + 1, dk_octp_manual_weeding_7_8, false); // weeding / herbicide thread
811  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6), dk_octp_grazing_7_8, false); // grazing thread
813  break;
814  }
815  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 1), dk_octp_npk1_p7_8, false);
816  break;
817 
818  case dk_octp_npk1_p7_8:
819  if (!m_farm->FP_NPK(m_field, 0.0,
820  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
821  SimpleEvent(g_date->Date() + 1, dk_octp_npk1_p7_8, true);
822  break;
823  }
824  // here comes a fork of parallel events:
825  SimpleEvent(g_date->Date() + 1, dk_octp_manual_weeding_7_8, false); // weeding / herbicide thread
826  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6), dk_octp_grazing_7_8, false); // grazing thread
828  break;
829 
830  case dk_octp_grazing_7_8:
831  if (m_ev->m_lock || m_farm->DoIt_prob(.10)) { // suggest it is not common
832  if (!m_farm->PigsOut(m_field, 0.0,
833  g_date->DayInYear(1, 7) - g_date->DayInYear())) {
835  break;
836  }
838  break;
839  }
840  break;
841  case dk_octp_pig_is_out_7_8: // Keep the pigs out there
842  // PigsAreOut() returns false if it is not time to stop grazing
843  if (!m_farm->PigsAreOut(m_field, 0.0,
844  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
846  break;
847  }
848  break; // end of grazing thread
849 
851  if (!m_farm->ManualWeeding(m_field, 0.0,
852  g_date->DayInYear(16, 5) - g_date->DayInYear())) {
854  break;
855  }
857  break;
858 
859  case dk_octp_manual_cutting_7_8: // no specific timing for this trimming event
860  if (!m_farm->Pruning(m_field, 0.0,
861  g_date->DayInYear(10, 8) - g_date->DayInYear())) {
863  break;
864  }
866  break;
867 
868  case dk_octp_manual_cutting2_7_8: // no specific timing for this trimming event (removing faulty trees)
869  if (!m_farm->Pruning(m_field, 0.0,
870  g_date->DayInYear(13, 8) - g_date->DayInYear())) {
872  break;
873  }
875  break;
876 
878  if (!m_farm->ManualWeeding(m_field, 0.0,
879  g_date->DayInYear(16, 8) - g_date->DayInYear())) {
881  break;
882  }
883  break;
884 
885  case dk_octp_npk2_s7_8:
886  if (!m_farm->FA_NPK(m_field, 0.0,
887  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
888  SimpleEvent(g_date->Date() + 1, dk_octp_npk2_s7_8, true);
889  break;
890  }
892  break;
893 
895  if (m_field->GetSoilType() != tos_Sand && m_field->GetSoilType() != tos_LoamySand && m_field->GetSoilType() != tos_SandyLoam && m_field->GetSoilType() != tos_SandyClayLoam) // on clay soils (NL KLEI & VEEN)
896  {
897  if (!m_farm->FA_Calcium(m_field, 0.0,
898  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
900  break;
901  }
902  }
904  break;
905 
906  case dk_octp_npk2_p7_8:
907  if (!m_farm->FP_NPK(m_field, 0.0,
908  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
909  SimpleEvent(g_date->Date() + 1, dk_octp_npk2_p7_8, true);
910  break;
911  }
913  break;
914 
916  if (m_field->GetSoilType() != tos_Sand && m_field->GetSoilType() != tos_LoamySand && m_field->GetSoilType() != tos_SandyLoam && m_field->GetSoilType() != tos_SandyClayLoam) // on clay soils (NL KLEI & VEEN)
917  {
918  if (!m_farm->FP_Calcium(m_field, 0.0,
919  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
921  break;
922  }
923  }
925  break;
926 
927  // 8th + 9th year after
928  case dk_octp_npk1_s9_10:
929  if (a_farm->IsStockFarmer())
930  {
931  if (!m_farm->FA_NPK(m_field, 0.0,
932  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
933  SimpleEvent(g_date->Date() + 1, dk_octp_npk1_s9_10, true);
934  break;
935  }
936  // here comes a fork of parallel events:
937  SimpleEvent(g_date->Date() + 1, dk_octp_manual_weeding_9_10, false); // weeding
939  break;
940  }
941  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 1), dk_octp_npk1_p9_10, false);
942  break;
943 
944  case dk_octp_npk1_p9_10:
945  if (!m_farm->FP_NPK(m_field, 0.0,
946  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
947  SimpleEvent(g_date->Date() + 1, dk_octp_npk1_p9_10, true);
948  break;
949  }
950  SimpleEvent(g_date->Date() + 1, dk_octp_manual_weeding_9_10, false); // weeding
952  break;
953 
954  case dk_octp_npk2_s9_10:
955  if (!m_farm->FA_NPK(m_field, 0.0,
956  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
957  SimpleEvent(g_date->Date() + 1, dk_octp_npk2_s9_10, true);
958  break;
959  }
961  break;
962 
963  case dk_octp_npk2_p9_10:
964  if (!m_farm->FP_NPK(m_field, 0.0,
965  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
966  SimpleEvent(g_date->Date() + 1, dk_octp_npk2_p9_10, true);
967  break;
968  }
970  break;
971 
973  if (m_field->GetSoilType() != tos_Sand && m_field->GetSoilType() != tos_LoamySand && m_field->GetSoilType() != tos_SandyLoam && m_field->GetSoilType() != tos_SandyClayLoam) // on clay soils (NL KLEI & VEEN)
974  {
975  if (!m_farm->FA_Calcium(m_field, 0.0,
976  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
978  break;
979  }
980  }
982  break;
983 
985  if (m_field->GetSoilType() != tos_Sand && m_field->GetSoilType() != tos_LoamySand && m_field->GetSoilType() != tos_SandyLoam && m_field->GetSoilType() != tos_SandyClayLoam) // on clay soils (NL KLEI & VEEN)
986  {
987  if (!m_farm->FP_Calcium(m_field, 0.0,
988  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
990  break;
991  }
992  }
994  break;
995 
997  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(16, 8) - g_date->DayInYear())) {
999  break;
1000  }
1001  done = true;
1002  break;
1003  //end 5th-9th year after
1004 
1006  if (!m_farm->ManualWeeding(m_field, 0.0,
1007  g_date->DayInYear(16, 5) - g_date->DayInYear())) {
1009  break;
1010  }
1012  break;
1013 
1015  if (!m_farm->ManualWeeding(m_field, 0.0,
1016  g_date->DayInYear(16, 8) - g_date->DayInYear())) {
1018  break;
1019  }
1020  // end of weeding thread
1021  break;
1022 
1023  // year 10+ - harvest year
1024  case dk_octp_npk1_s11:
1025  if (a_farm->IsStockFarmer())
1026  {
1027  if (!m_farm->FA_NPK(m_field, 0.0,
1028  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
1029  SimpleEvent(g_date->Date() + 1, dk_octp_npk1_s11, true);
1030  break;
1031  }
1032  // here comes a fork of parallel events:
1033  SimpleEvent(g_date->Date() + 1, dk_octp_manual_weeding_11, false); // weeding
1035  break;
1036  }
1037  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3), dk_octp_npk1_p11, false);
1038  break;
1039 
1040  case dk_octp_npk1_p11:
1041  if (!m_farm->FP_NPK(m_field, 0.0,
1042  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
1043  SimpleEvent(g_date->Date() + 1, dk_octp_npk1_p11, true);
1044  break;
1045  }
1046  // here comes a fork of parallel events:
1047  SimpleEvent(g_date->Date() + 1, dk_octp_manual_weeding_11, false); // weeding
1049  break;
1050 
1051  case dk_octp_npk2_s11:
1052  if (!m_farm->FA_NPK(m_field, 0.0,
1053  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
1054  SimpleEvent(g_date->Date() + 1, dk_octp_npk2_s11, true);
1055  break;
1056  }
1058  break;
1059 
1060  case dk_octp_npk2_p11:
1061  if (!m_farm->FP_NPK(m_field, 0.0,
1062  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
1063  SimpleEvent(g_date->Date() + 1, dk_octp_npk2_p11, true);
1064  break;
1065  }
1067  break;
1068 
1069  case dk_octp_calcium_s11:
1070  if (m_field->GetSoilType() != tos_Sand && m_field->GetSoilType() != tos_LoamySand && m_field->GetSoilType() != tos_SandyLoam && m_field->GetSoilType() != tos_SandyClayLoam) // on clay soils (NL KLEI & VEEN)
1071  {
1072  if (!m_farm->FA_Calcium(m_field, 0.0,
1073  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
1074  SimpleEvent(g_date->Date() + 1, dk_octp_calcium_s11, true);
1075  break;
1076  }
1077  }
1079  break;
1080 
1081  case dk_octp_calcium_p11:
1082  if (m_field->GetSoilType() != tos_Sand && m_field->GetSoilType() != tos_LoamySand && m_field->GetSoilType() != tos_SandyLoam && m_field->GetSoilType() != tos_SandyClayLoam) // on clay soils (NL KLEI & VEEN)
1083  {
1084  if (!m_farm->FP_Calcium(m_field, 0.0,
1085  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
1086  SimpleEvent(g_date->Date() + 1, dk_octp_calcium_p11, true);
1087  break;
1088  }
1089  }
1091  break;
1092 
1094  if (!m_farm->AutumnSow(m_field, 0.0,
1095  g_date->DayInYear(17, 8) - g_date->DayInYear())) {
1097  break;
1098  }
1100  break;
1101 
1103  if (!m_farm->Pruning(m_field, 0.0, g_date->DayInYear(25, 12) - g_date->DayInYear())) {
1105  break;
1106  }
1107  SimpleEvent(g_date->Date(), dk_octp_harvest, false);
1108  break;
1109 
1110  case dk_octp_harvest:
1111  if (!m_farm->Harvest(m_field, 0.0, g_date->DayInYear(25, 12) - g_date->DayInYear())) {
1112  SimpleEvent(g_date->Date() + 1, dk_octp_harvest, true);
1113  break;
1114  }
1115  //end of harvest year - end of Christmas tree management!
1116  done = true;
1117  break;
1118 
1120  if (!m_farm->ManualWeeding(m_field, 0.0,
1121  g_date->DayInYear(16, 8) - g_date->DayInYear())) {
1123  break;
1124  }
1126  break;
1127 
1129  if (!m_farm->ManualWeeding(m_field, 0.0,
1130  g_date->DayInYear(30, 9) - g_date->DayInYear())) {
1132  break;
1133  }
1134  // end of weeding
1135  break;
1136 
1137  // So we are done, and somewhere else the farmer will queue up the start event of the DK_ChristmasTrees_Perm2 (for 4 years) if conventional christmas tree management, the start event of the DK_OChristmasTrees_Perm2 (for 4 years) if organic christmas tree management,
1138  // END OF MAIN THREAD
1139  default:
1140  g_msg->Warn(WARN_BUG, "DK_OChristmasTrees_Perm::Do(): "
1141  "Unknown event type! ", "");
1142  exit(1);
1143  }
1144  return done;
1145 }

References Farm::AutumnHarrow(), Farm::AutumnPlough(), Farm::AutumnSow(), LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), Farm::DeepPlough(), dk_octp_calcium_p11, dk_octp_calcium_p6, dk_octp_calcium_p7_8, dk_octp_calcium_p9_10, dk_octp_calcium_s11, dk_octp_calcium_s6, dk_octp_calcium_s7_8, dk_octp_calcium_s9_10, dk_octp_crush_trees, dk_octp_depth_plough_autumn, dk_octp_ferti_clay_p2, dk_octp_ferti_clay_p3_4, dk_octp_ferti_clay_s2, dk_octp_ferti_clay_s3_4, dk_octp_ferti_sand_p2, dk_octp_ferti_sand_p3_4, dk_octp_ferti_sand_s2, dk_octp_ferti_sand_s3_4, dk_octp_grazing_3_4, dk_octp_grazing_5, dk_octp_grazing_6, dk_octp_grazing_7_8, dk_octp_harrow, dk_octp_harrow_autumn, dk_octp_harvest, dk_octp_manual_cutting2_7_8, dk_octp_manual_cutting_11, dk_octp_manual_cutting_3_4, dk_octp_manual_cutting_5, dk_octp_manual_cutting_6, dk_octp_manual_cutting_7_8, dk_octp_manual_weeding2_11, dk_octp_manual_weeding2_2, dk_octp_manual_weeding2_3_4, dk_octp_manual_weeding2_5, dk_octp_manual_weeding2_6, dk_octp_manual_weeding2_7_8, dk_octp_manual_weeding2_9_10, dk_octp_manual_weeding_11, dk_octp_manual_weeding_2, dk_octp_manual_weeding_3_4, dk_octp_manual_weeding_5, dk_octp_manual_weeding_6, dk_octp_manual_weeding_7_8, dk_octp_manual_weeding_9_10, dk_octp_npk1_p11, dk_octp_npk1_p6, dk_octp_npk1_p7_8, dk_octp_npk1_p9_10, dk_octp_npk1_s11, dk_octp_npk1_s6, dk_octp_npk1_s7_8, dk_octp_npk1_s9_10, dk_octp_npk2_p11, dk_octp_npk2_p6, dk_octp_npk2_p7_8, dk_octp_npk2_p9_10, dk_octp_npk2_s11, dk_octp_npk2_s6, dk_octp_npk2_s7_8, dk_octp_npk2_s9_10, dk_octp_npk_clay_p3_4, dk_octp_npk_clay_s3_4, dk_octp_npk_p5, dk_octp_npk_s5, dk_octp_npk_sand1_p3_4, dk_octp_npk_sand1_s3_4, dk_octp_npk_sand2_p3_4, dk_octp_npk_sand2_s3_4, dk_octp_npk_sand_p5, dk_octp_npk_sand_s5, dk_octp_pig_is_out_3_4, dk_octp_pig_is_out_5, dk_octp_pig_is_out_6, dk_octp_pig_is_out_7_8, dk_octp_plant_trees, dk_octp_plant_trees_autumn, dk_octp_plough1_autumn, dk_octp_plough2_autumn, dk_octp_row_cultivation_autumn, dk_octp_sleep_all_day, dk_octp_sow_catch_crop1, dk_octp_sow_catch_crop2, dk_octp_sow_catch_crop3, dk_octp_sow_catch_crop_11, dk_octp_sow_cover_crop_autumn, dk_octp_sow_inter_crops, dk_octp_start, dk_octp_stubble_harrow_autumn, dk_octp_wait, DK_OCTP_YEAR, Farm::DoIt(), Farm::DoIt_prob(), Farm::FA_Calcium(), Farm::FA_Manure(), Farm::FA_NPK(), Farm::FP_Calcium(), Farm::FP_Manure(), Farm::FP_NPK(), g_date, g_msg, LE::GetSoilType(), Calendar::GetYearNumber(), Farm::Harvest(), Farm::IsStockFarmer(), Crop::m_ev, Crop::m_farm, Crop::m_field, Crop::m_last_date, FarmEvent::m_lock, FarmEvent::m_todo, Farm::ManualWeeding(), Calendar::OldDays(), Farm::PigsAreOut(), Farm::PigsOut(), Farm::Pruning(), Farm::RowCultivation(), Farm::Shredding(), Crop::SimpleEvent(), Farm::SleepAllDay(), Crop::StartUpCrop(), Farm::StubbleHarrowing(), tos_LoamySand, tos_Sand, tos_SandyClayLoam, tos_SandyLoam, tov_DKOChristmasTrees_Perm, MapErrorMsg::Warn(), and WARN_BUG.

◆ SetUpFarmCategoryInformation()

void DK_OChristmasTrees_Perm::SetUpFarmCategoryInformation ( )
inline
179  {
180  const int elements = 2 + (dk_octp_foobar - DK_OCTP_BASE);
182 
183  FarmManagementCategory catlist[elements] =
184  {
185  fmc_Others, // zero element unused but must be here
186  fmc_Others, // dk_octp_start = 1, // Compulsory, must always be 1 (one).
187  fmc_Others, // dk_octp_sleep_all_day = DK_CTP1_BASE,
188  fmc_Cultivation, // dk_octp_plough1_autumn,
189  fmc_Cultivation, // dk_octp_depth_plough_autumn,
190  fmc_Cultivation, // dk_octp_plough2_autumn,
191  fmc_Cultivation, // dk_octp_stubble_harrow_autumn,
192  fmc_Others, // dk_octp_sow_cover_crop_autumn,
193  fmc_Others, // dk_octp_plant_trees_autumn,
194  fmc_Cultivation, // dk_octp_row_cultivation_autumn,
195  fmc_Cultivation, // dk_octp_harrow_autumn,
196  fmc_Cutting, //dk_octpe_crush_trees,
197  fmc_Others, //dk_octpe_sow_inter_crops,
198  fmc_Cultivation, // dk_octpe_harrow,
199  fmc_Others, // dk_octpe_sow_catch_crops,
200  fmc_Others, // dk_octpe_plant_trees,
201  fmc_Fertilizer, //dk_octp_ferti_clay_s2,
202  fmc_Fertilizer, //dk_octp_ferti_sand_s2,
203  fmc_Fertilizer, //dk_octp_ferti_clay_p2,
204  fmc_Fertilizer, //dk_octp_ferti_sand_p2,
205  fmc_Cultivation, //dk_octp_manual_weeding_2,
206  fmc_Cultivation, // dk_octp_manual_weeding
207  fmc_Fertilizer, //dk_octp_ferti_clay_s3_4,
208  fmc_Fertilizer, //dk_octp_ferti_sand_s3_4,
209  fmc_Fertilizer, //dk_octp_npk_clay_s3_4,
210  fmc_Fertilizer, //dk_octp_npk_sand1_s3_4,
211  fmc_Fertilizer, //dk_octp_npk_sand2_s3_4,
212  fmc_Fertilizer, //dk_octp_ferti_clay_p3_4,
213  fmc_Fertilizer, //dk_octp_ferti_sand_p3_4,
214  fmc_Fertilizer, //dk_octp_npk_clay_p3_4,
215  fmc_Fertilizer, //dk_octp_npk_sand1_p3_4,
216  fmc_Fertilizer, //dk_octp_npk_sand2_p3_4,
217  fmc_Cultivation, //dk_octp_manual_weeding_3_4,
218  fmc_Cultivation, // dk_octp_manual_weeding
219  fmc_Cutting, // dk_octp_manual_cutting_3_4
220  fmc_Grazing, //dk_octp_grazing_3_4,
221  fmc_Grazing, //dk_octp_pig_is_out_3_4,
222  fmc_Others, //dk_octp_sow_catch_crop,
223  fmc_Fertilizer, //dk_octp_npk_s5,
224  fmc_Fertilizer, //dk_octp_npk_sand_s5,
225  fmc_Fertilizer, //dk_octp_npk_p5,
226  fmc_Fertilizer, //dk_octp_npk_sand_p5,
227  fmc_Grazing, //dk_octp_grazing_5,
228  fmc_Grazing, //dk_octp_pig_is_out_5,
229  fmc_Cultivation, //dk_octp_manual_weeding_5,
230  fmc_Cultivation, // dk_octp_manual_weeding
231  fmc_Cutting, //dk_octp_manual_cutting_5,
232  fmc_Fertilizer, //dk_octp_npk1_s6,
233  fmc_Fertilizer, //dk_octp_npk2_s6,
234  fmc_Fertilizer, //dk_octp_calcium_s6,
235  fmc_Fertilizer, //dk_octp_npk1_p6,
236  fmc_Fertilizer, //dk_octp_npk2_p6,
237  fmc_Fertilizer, //dk_octp_calcium_p6,
238  fmc_Grazing, //dk_octp_grazing_6,
239  fmc_Grazing, //dk_octp_pig_is_out_6,
240  fmc_Cultivation, //dk_octp_manual_weeding_6,
241  fmc_Cultivation, // dk_octp_manual_weeding
242  fmc_Cutting, //dk_octp_manual_cutting_6,
243  fmc_Fertilizer, //dk_octp_npk1_s7_8,
244  fmc_Fertilizer, //dk_octp_npk2_s7_8,
245  fmc_Fertilizer, //dk_octp_calcium_s7_8,
246  fmc_Fertilizer, //dk_octp_npk1_p7_8,
247  fmc_Fertilizer, //dk_octp_npk2_p7_8,
248  fmc_Fertilizer, //dk_octp_calcium_p7_8,
249  fmc_Grazing, //dk_octp_grazing_7_8,
250  fmc_Grazing, //dk_octp_pig_is_out_7_8,
251  fmc_Cultivation, //dk_octp_manual_weeding_7_8,
252  fmc_Cultivation, // dk_octp_manual_weeding
253  fmc_Cutting, //dk_octp_manual_cutting_7_8,
254  fmc_Cutting, //dk_octp_manual_cutting2_7_8,
255  fmc_Fertilizer, //dk_octp_npk1_s9_10,
256  fmc_Fertilizer, //dk_octp_npk2_s9_10,
257  fmc_Fertilizer, //dk_octp_calcium_s9_10,
258  fmc_Fertilizer, //dk_octp_npk1_p9_10,
259  fmc_Fertilizer, //dk_octp_npk2_p9_10,
260  fmc_Fertilizer, //dk_octp_calcium_p9_10,
261  fmc_Others, // dk_octp_sow_catch_crop,
262  fmc_Cultivation, // dk_octp_manual_weeding_9_10,
263  fmc_Cultivation, // dk_octp_manual_weeding_9_10,
264  fmc_Fertilizer, //dk_octp_npk1_s11,
265  fmc_Fertilizer, //dk_octp_npk2_s11,
266  fmc_Fertilizer, //dk_octp_calcium_s11,
267  fmc_Fertilizer, //dk_octp_npk1_p11,
268  fmc_Fertilizer, //dk_octp_npk2_p11,
269  fmc_Fertilizer, //dk_octp_calcium_p11,
270  fmc_Cultivation, //dk_octp_manual_weeding_11,
271  fmc_Cultivation, // dk_octp_manual_weeding
272  fmc_Others, //dk_octp_sow_catch_crop_11,
273  fmc_Cutting, //dk_octp_manual_cutting_11,
274  fmc_Harvest, //dk_octp_harvest,
275  fmc_Others, //dk_octp_wait
276 
277 
278  // no foobar entry
279 
280  };
281  // Iterate over the catlist elements and copy them to vector
282  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
283 
284  }

References DK_OCTP_BASE, dk_octp_foobar, fmc_Cultivation, fmc_Cutting, fmc_Fertilizer, fmc_Grazing, fmc_Harvest, fmc_Others, Crop::m_base_elements_no, and Crop::m_ManagementCategories.

Referenced by DK_OChristmasTrees_Perm().


The documentation for this class was generated from the following files:
dk_octp_npk1_p9_10
Definition: DK_OChristmasTrees_Perm.h:136
Farm::PigsAreOut
virtual bool PigsAreOut(LE *a_field, double a_user, int a_days)
Start a pig grazing event on a_field today or soon.
Definition: FarmFuncs.cpp:2703
tov_DKOChristmasTrees_Perm
Definition: LandscapeFarmingEnums.h:447
dk_octp_npk_sand1_p3_4
Definition: DK_OChristmasTrees_Perm.h:93
dk_octp_manual_weeding2_11
Definition: DK_OChristmasTrees_Perm.h:149
dk_octp_npk2_s9_10
Definition: DK_OChristmasTrees_Perm.h:134
dk_octp_grazing_6
Definition: DK_OChristmasTrees_Perm.h:116
dk_octp_npk1_s7_8
Definition: DK_OChristmasTrees_Perm.h:121
dk_octp_manual_weeding2_3_4
Definition: DK_OChristmasTrees_Perm.h:96
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
Farm::Harvest
virtual bool Harvest(LE *a_field, double a_user, int a_days)
Carry out a harvest on a_field.
Definition: FarmFuncs.cpp:1364
dk_octp_ferti_sand_p3_4
Definition: DK_OChristmasTrees_Perm.h:91
dk_octp_ferti_clay_p3_4
Definition: DK_OChristmasTrees_Perm.h:90
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
dk_octp_pig_is_out_6
Definition: DK_OChristmasTrees_Perm.h:117
dk_octp_manual_weeding2_9_10
Definition: DK_OChristmasTrees_Perm.h:141
dk_octp_row_cultivation_autumn
Definition: DK_OChristmasTrees_Perm.h:72
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
dk_octp_calcium_p6
Definition: DK_OChristmasTrees_Perm.h:115
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
dk_octp_manual_weeding_3_4
Definition: DK_OChristmasTrees_Perm.h:95
dk_octp_grazing_7_8
Definition: DK_OChristmasTrees_Perm.h:127
tos_SandyClayLoam
Definition: LandscapeFarmingEnums.h:722
dk_octp_npk2_s7_8
Definition: DK_OChristmasTrees_Perm.h:122
Farm::DoIt_prob
bool DoIt_prob(double a_probability)
Return chance out of 0 to 1.
Definition: Farm.cpp:864
dk_octp_plant_trees
Definition: DK_OChristmasTrees_Perm.h:78
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
dk_octp_npk2_p11
Definition: DK_OChristmasTrees_Perm.h:146
dk_octp_manual_weeding2_2
Definition: DK_OChristmasTrees_Perm.h:84
dk_octp_manual_weeding_5
Definition: DK_OChristmasTrees_Perm.h:107
dk_octp_npk1_p11
Definition: DK_OChristmasTrees_Perm.h:145
dk_octp_npk2_p7_8
Definition: DK_OChristmasTrees_Perm.h:125
Farm::FA_Manure
virtual bool FA_Manure(LE *a_field, double a_user, int a_days)
Spread manure on a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1110
tos_SandyLoam
Definition: LandscapeFarmingEnums.h:721
dk_octp_calcium_p9_10
Definition: DK_OChristmasTrees_Perm.h:138
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
dk_octp_calcium_s9_10
Definition: DK_OChristmasTrees_Perm.h:135
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
dk_octp_harvest
Definition: DK_OChristmasTrees_Perm.h:152
dk_octp_ferti_clay_s3_4
Definition: DK_OChristmasTrees_Perm.h:85
dk_octp_ferti_sand_p2
Definition: DK_OChristmasTrees_Perm.h:82
Crop::SimpleEvent
void SimpleEvent(long a_date, int a_todo, bool a_lock)
Adds an event to this crop management.
Definition: Farm.cpp:747
dk_octp_sow_catch_crop_11
Definition: DK_OChristmasTrees_Perm.h:150
dk_octp_npk_sand_s5
Definition: DK_OChristmasTrees_Perm.h:102
dk_octp_npk_sand2_s3_4
Definition: DK_OChristmasTrees_Perm.h:89
DK_OCTP_BASE
#define DK_OCTP_BASE
Definition: DK_OChristmasTrees_Perm.h:53
Farm::FP_Manure
virtual bool FP_Manure(LE *a_field, double a_user, int a_days)
Spread manure on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:896
fmc_Cutting
Definition: LandscapeFarmingEnums.h:1009
dk_octp_grazing_3_4
Definition: DK_OChristmasTrees_Perm.h:98
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
dk_octp_plough1_autumn
Definition: DK_OChristmasTrees_Perm.h:66
dk_octp_grazing_5
Definition: DK_OChristmasTrees_Perm.h:105
dk_octp_npk2_s11
Definition: DK_OChristmasTrees_Perm.h:143
DK_OCTP_YEAR
#define DK_OCTP_YEAR
A flag used to indicate year.
Definition: DK_OChristmasTrees_Perm.h:57
dk_octp_manual_weeding2_7_8
Definition: DK_OChristmasTrees_Perm.h:130
Calendar::Date
long Date(void)
Definition: Calendar.h:57
dk_octp_sow_inter_crops
Definition: DK_OChristmasTrees_Perm.h:75
dk_octp_calcium_s6
Definition: DK_OChristmasTrees_Perm.h:114
dk_octp_ferti_clay_s2
Definition: DK_OChristmasTrees_Perm.h:79
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
LE::GetSoilType
int GetSoilType()
Definition: Elements.h:302
dk_octp_npk_clay_p3_4
Definition: DK_OChristmasTrees_Perm.h:92
dk_octp_calcium_p11
Definition: DK_OChristmasTrees_Perm.h:147
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
dk_octp_crush_trees
Definition: DK_OChristmasTrees_Perm.h:74
dk_octp_harrow_autumn
Definition: DK_OChristmasTrees_Perm.h:73
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
dk_octp_stubble_harrow_autumn
Definition: DK_OChristmasTrees_Perm.h:69
dk_octp_npk_clay_s3_4
Definition: DK_OChristmasTrees_Perm.h:87
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
Crop::StartUpCrop
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 a...
Definition: Farm.cpp:652
dk_octp_manual_weeding_6
Definition: DK_OChristmasTrees_Perm.h:118
dk_octp_manual_cutting_7_8
Definition: DK_OChristmasTrees_Perm.h:131
dk_octp_npk1_s6
Definition: DK_OChristmasTrees_Perm.h:110
dk_octp_ferti_clay_p2
Definition: DK_OChristmasTrees_Perm.h:81
dk_octp_sow_catch_crop1
Definition: DK_OChristmasTrees_Perm.h:77
dk_octp_manual_cutting_11
Definition: DK_OChristmasTrees_Perm.h:151
Farm::ManualWeeding
virtual bool ManualWeeding(LE *a_field, double a_user, int a_days)
Manual weeding on a_field - no tramlines since weeding by hand, the bush stays on field with same veg...
Definition: FarmFuncs.cpp:2002
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
dk_octp_harrow
Definition: DK_OChristmasTrees_Perm.h:76
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
dk_octp_npk_p5
Definition: DK_OChristmasTrees_Perm.h:103
dk_octp_start
Definition: DK_OChristmasTrees_Perm.h:64
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
tos_Sand
Definition: LandscapeFarmingEnums.h:719
dk_octp_manual_cutting_5
Definition: DK_OChristmasTrees_Perm.h:109
dk_octp_sleep_all_day
Definition: DK_OChristmasTrees_Perm.h:65
Farm::SleepAllDay
virtual bool SleepAllDay(LE *a_field, double a_user, int a_days)
Nothing to to today on a_field.
Definition: FarmFuncs.cpp:272
dk_octp_foobar
Definition: DK_OChristmasTrees_Perm.h:154
Farm::RowCultivation
virtual bool RowCultivation(LE *a_field, double a_user, int a_days)
Carry out a harrowing between crop rows on a_field.
Definition: FarmFuncs.cpp:1183
dk_octp_npk2_p6
Definition: DK_OChristmasTrees_Perm.h:113
dk_octp_manual_cutting_6
Definition: DK_OChristmasTrees_Perm.h:120
dk_octp_manual_weeding_9_10
Definition: DK_OChristmasTrees_Perm.h:140
Crop::m_last_date
int m_last_date
Definition: Farm.h:503
dk_octp_calcium_s7_8
Definition: DK_OChristmasTrees_Perm.h:123
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
dk_octp_ferti_sand_s3_4
Definition: DK_OChristmasTrees_Perm.h:86
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
DK_OChristmasTrees_Perm::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: DK_OChristmasTrees_Perm.h:179
dk_octp_npk_sand_p5
Definition: DK_OChristmasTrees_Perm.h:104
fmc_Grazing
Definition: LandscapeFarmingEnums.h:1010
dk_octp_pig_is_out_7_8
Definition: DK_OChristmasTrees_Perm.h:128
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
dk_octp_npk_sand2_p3_4
Definition: DK_OChristmasTrees_Perm.h:94
dk_octp_npk1_p6
Definition: DK_OChristmasTrees_Perm.h:112
dk_octp_ferti_sand_s2
Definition: DK_OChristmasTrees_Perm.h:80
Farm::Shredding
virtual bool Shredding(LE *a_field, double a_user, int a_days)
Shredding (destruction of the pruning residues with a shredders using hammer mower) applied on a_fiel...
Definition: FarmFuncs.cpp:1912
Farm::DeepPlough
virtual bool DeepPlough(LE *a_field, double a_user, int a_days)
Carry out a deep ploughing event on a_field.
Definition: FarmFuncs.cpp:408
dk_octp_pig_is_out_3_4
Definition: DK_OChristmasTrees_Perm.h:99
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
dk_octp_pig_is_out_5
Definition: DK_OChristmasTrees_Perm.h:106
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
Farm::Pruning
virtual bool Pruning(LE *a_field, double a_user, int a_days)
Pruning applied on a_field - details needs to be added (e.g., impact on biomass, influence/impacts in...
Definition: FarmFuncs.cpp:1897
dk_octp_manual_weeding_11
Definition: DK_OChristmasTrees_Perm.h:148
dk_octp_npk_s5
Definition: DK_OChristmasTrees_Perm.h:101
dk_octp_depth_plough_autumn
Definition: DK_OChristmasTrees_Perm.h:67
dk_octp_npk_sand1_s3_4
Definition: DK_OChristmasTrees_Perm.h:88
dk_octp_sow_catch_crop2
Definition: DK_OChristmasTrees_Perm.h:100
dk_octp_npk1_s11
Definition: DK_OChristmasTrees_Perm.h:142
dk_octp_manual_cutting2_7_8
Definition: DK_OChristmasTrees_Perm.h:132
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
dk_octp_npk1_s9_10
Definition: DK_OChristmasTrees_Perm.h:133
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
dk_octp_plant_trees_autumn
Definition: DK_OChristmasTrees_Perm.h:71
dk_octp_manual_weeding_2
Definition: DK_OChristmasTrees_Perm.h:83
dk_octp_manual_weeding_7_8
Definition: DK_OChristmasTrees_Perm.h:129
dk_octp_manual_weeding2_6
Definition: DK_OChristmasTrees_Perm.h:119
dk_octp_sow_catch_crop3
Definition: DK_OChristmasTrees_Perm.h:139
dk_octp_manual_cutting_3_4
Definition: DK_OChristmasTrees_Perm.h:97
dk_octp_manual_weeding2_5
Definition: DK_OChristmasTrees_Perm.h:108
Farm::PigsOut
virtual bool PigsOut(LE *a_field, double a_user, int a_days)
Generate a 'pigs_out' event for every day the cattle are on a_field.
Definition: FarmFuncs.cpp:2650
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
tos_LoamySand
Definition: LandscapeFarmingEnums.h:720
dk_octp_wait
Definition: DK_OChristmasTrees_Perm.h:153
dk_octp_npk1_p7_8
Definition: DK_OChristmasTrees_Perm.h:124
WARN_BUG
Definition: MapErrorMsg.h:34
dk_octp_plough2_autumn
Definition: DK_OChristmasTrees_Perm.h:68
dk_octp_npk2_s6
Definition: DK_OChristmasTrees_Perm.h:111
dk_octp_calcium_p7_8
Definition: DK_OChristmasTrees_Perm.h:126
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
dk_octp_sow_cover_crop_autumn
Definition: DK_OChristmasTrees_Perm.h:70
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
dk_octp_npk2_p9_10
Definition: DK_OChristmasTrees_Perm.h:137
dk_octp_calcium_s11
Definition: DK_OChristmasTrees_Perm.h:144