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

DK_ChristmasTrees_Perm class
. More...

#include <DK_ChristmasTrees_Perm.h>

Inheritance diagram for DK_ChristmasTrees_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_ChristmasTrees_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_ChristmasTrees_Perm class
.

See DK_ChristmasTrees_Perm.h::DK_ChristmasTrees_PermToDo for a complete list of all possible events triggered codes by the DK_ChristmasTrees_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_ChristmasTrees_Perm()

DK_ChristmasTrees_Perm::DK_ChristmasTrees_Perm ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
189  : Crop(a_tov, a_toc, a_L)
190  {
191  // When we start it off, the first possible date for a farm operation
192  // This information is used by other crops when they decide how much post processing of
193  // the management is allowed after harvest before the next crop starts.
194  m_first_date = g_date->DayInYear(10, 3);
196  }

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

Member Function Documentation

◆ Do()

bool DK_ChristmasTrees_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.

99 {
100  m_field = a_field; // this is needed because of possible calls to other methods and currently we do not pass parameters.
101  m_farm = a_farm; // this is needed because of possible calls to other methods and currently we do not pass parameters.
102  m_ev = a_ev;
103  bool done = false; // The boolean value done indicates when we are totally finished with this plan (i.e. it is set to true).
104  bool flag = false;
105  int d1 = 0;
107  // Depending what event has occured jump to the correct bit of code e.g. for ww_start jump to line 67 below
108  switch (a_ev->m_todo)
109  {
110  case dk_ctp_start:
111  {
112  DK_CTP_YEAR = 0;
113  a_field->ClearManagementActionSum();
114  m_last_date = g_date->DayInYear(6, 10); // Should match the last flexdate below
115  //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
116  std::vector<std::vector<int>> flexdates(1 + 1, std::vector<int>(2, 0));
117  // Set up the date management stuff
118  // Start and stop dates for all events after harvest
119  flexdates[0][1] = g_date->DayInYear(5, 10); // last possible day of in this case row cultivation autumn (no harvest in this code)
120  // Now these are done in pairs, start & end for each operation. If its not used then -1
121  flexdates[1][0] = -1; // This date will be moved back as far as necessary and potentially to flexdates 1 (start op 1)
122  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
123 
124  // 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
125  if (StartUpCrop(365, flexdates, int(dk_ctp_sleep_all_day))) break;
126 
127  // End single block date checking code. Please see next line comment as well.
128  // Reinit d1 to first possible starting date.
129  // OK, let's go. - EST1 followed by 10 years of growing threes -> EST2 followed by 10 years of growing trees
130  if ((DK_CTP_YEAR + g_date->GetYearNumber()) % 22 == 0) // establishment year 1
131  {
132  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
133  SimpleEvent(d1, dk_ctp_sleep_all_day, false);
134  }
135  else if ((DK_CTP_YEAR + g_date->GetYearNumber()) % 22 == 1)// first year after est
136  {
137  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
138  SimpleEvent(d1, dk_ctp_ferti_sand_s2, false);
139  }
140  else if ((DK_CTP_YEAR + g_date->GetYearNumber()) % 22 == 2 || (DK_CTP_YEAR + g_date->GetYearNumber()) % 22 == 3) // 2nd + 3rd after
141  {
142  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
144  }
145  else if ((DK_CTP_YEAR + g_date->GetYearNumber()) % 22 == 4) //4th after
146  {
147  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
148  SimpleEvent(d1, dk_ctp_npk_s5, false);
149  }
150  else if ((DK_CTP_YEAR + g_date->GetYearNumber()) % 22 == 5) // 5th after
151  {
152  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
153  SimpleEvent(d1, dk_ctp_npk1_s6, false);
154  }
155  else if ((DK_CTP_YEAR + g_date->GetYearNumber()) % 22 == 6 || (DK_CTP_YEAR + g_date->GetYearNumber()) % 22 == 7) // 6th + 7th after
156  {
157  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
158  SimpleEvent(d1, dk_ctp_npk1_s7_8, false);
159  }
160  else if ((DK_CTP_YEAR + g_date->GetYearNumber()) % 22 == 8 || (DK_CTP_YEAR + g_date->GetYearNumber()) % 22 == 9) // 8th + 9th after
161  {
162  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
163  SimpleEvent(d1, dk_ctp_npk1_s9_10, false);
164  }
165  else if ((DK_CTP_YEAR + g_date->GetYearNumber()) % 22 == 10)
166  {
167  d1 = g_date->OldDays() + g_date->DayInYear(10, 3) + 365; // harvest year
168  SimpleEvent(d1, dk_ctp_npk1_s11, false);
169  }
170  else if ((DK_CTP_YEAR + g_date->GetYearNumber()) % 22 == 11) // second establishment
171  {
172  d1 = g_date->OldDays() + g_date->DayInYear(10, 3) + 365;
173  SimpleEvent(d1, dk_ctp_crush_trees, false);
174  }
175  else if ((DK_CTP_YEAR + g_date->GetYearNumber()) % 22 == 12)// first year after est
176  {
177  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
178  SimpleEvent(d1, dk_ctp_ferti_sand_s2, false);
179  }
180  else if ((DK_CTP_YEAR + g_date->GetYearNumber()) % 22 == 13 || (DK_CTP_YEAR + g_date->GetYearNumber()) % 22 == 14) // 2nd + 3rd after
181  {
182  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
184  }
185  else if ((DK_CTP_YEAR + g_date->GetYearNumber()) % 22 == 15) //4th after
186  {
187  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
188  SimpleEvent(d1, dk_ctp_npk_s5, false);
189  }
190  else if ((DK_CTP_YEAR + g_date->GetYearNumber()) % 22 == 16) // 5th after
191  {
192  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
193  SimpleEvent(d1, dk_ctp_npk1_s6, false);
194  }
195  else if ((DK_CTP_YEAR + g_date->GetYearNumber()) % 22 == 17 || (DK_CTP_YEAR + g_date->GetYearNumber()) % 22 == 18) // 6th + 7th after
196  {
197  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
198  SimpleEvent(d1, dk_ctp_npk1_s7_8, false);
199  }
200  else if ((DK_CTP_YEAR + g_date->GetYearNumber()) % 22 == 19 || (DK_CTP_YEAR + g_date->GetYearNumber()) % 22 == 20) // 8th + 9th after
201  {
202  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
203  SimpleEvent(d1, dk_ctp_npk1_s9_10, false);
204  }
205  else if ((DK_CTP_YEAR + g_date->GetYearNumber()) % 22 == 21)
206  {
207  d1 = g_date->OldDays() + g_date->DayInYear(10, 3) + 365; // harvest year
208  SimpleEvent(d1, dk_ctp_npk1_s11, false);
209  }
210  break;
211 
212  }
213  break;
214 
215  //EST 1
217  if (!a_farm->SleepAllDay(a_field, 0.0,
218  g_date->DayInYear(19, 8) - g_date->DayInYear())) {
220  break;
221  }
223  break;
224 
226  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)
227  {
228  if (!a_farm->AutumnPlough(a_field, 0.0,
229  g_date->DayInYear(10, 9) - g_date->DayInYear())) {
231  break;
232  }
234  break;
235  }
237  break; // sandy soils
238 
240  if (!a_farm->DeepPlough(a_field, 0.0,
241  g_date->DayInYear(10, 9) - g_date->DayInYear())) {
243  break;
244  }
246  break;
247 
249  if (!a_farm->AutumnPlough(a_field, 0.0,
250  g_date->DayInYear(20, 9) - g_date->DayInYear())) {
252  break;
253  }
255  break;
256 
258  if (!a_farm->StubbleHarrowing(a_field, 0.0,
259  g_date->DayInYear(20, 9) - g_date->DayInYear())) {
261  break;
262  }
264  break;
265 
267  if (!a_farm->AutumnSow(a_field, 0.0,
268  g_date->DayInYear(30, 9) - g_date->DayInYear())) {
270  break;
271  }
273  break;
274 
276  if (!a_farm->AutumnSow(a_field, 0.0,
277  g_date->DayInYear(30, 9) - g_date->DayInYear())) {
279  break;
280  }
282  break;
283 
285  if (!a_farm->RowCultivation(a_field, 0.0, g_date->DayInYear(5, 10) - g_date->DayInYear())) {
287  break;
288  }
290  break;
291 
293  if (!a_farm->AutumnHarrow(a_field, 0.0, g_date->DayInYear(6, 10) - g_date->DayInYear())) {
295  break;
296  }
297  done = true; // end of EST1
298  break;
299 
300  // EST2
301  case dk_ctp_crush_trees:
302  if (!m_farm->Shredding(m_field, 0.0,
303  g_date->DayInYear(31, 5) - g_date->DayInYear())) {
304  SimpleEvent(g_date->Date() + 1, dk_ctp_crush_trees, true);
305  break;
306  }
308  break;
309 
310  case dk_ctp_herbicide: // some do this (suggest 50%) others sow inter crops
311  if (m_ev->m_lock || m_farm->DoIt(50)) {
312  if (!m_farm->HerbicideTreat(m_field, 0.0,
313  g_date->DayInYear(30, 7) - g_date->DayInYear())) {
314  SimpleEvent(g_date->Date() + 1, dk_ctp_herbicide, true);
315  break;
316  }
318  break;
319  }
321  break;
322 
323  case dk_ctp_sow_catch_crop1: // may need changing
324  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(15, 8) - g_date->DayInYear())) {
326  break;
327  }
328  SimpleEvent(g_date->Date() + 1, dk_ctp_plant_trees, false);
329  break;
330 
331  case dk_ctp_sow_inter_crops: // may need changing
332  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(31, 7) - g_date->DayInYear())) {
334  break;
335  }
336  SimpleEvent(g_date->Date() + 50, dk_ctp_harrow, false);
337  break;
338 
339  case dk_ctp_harrow:
340  if (!m_farm->AutumnHarrow(m_field, 0.0, g_date->DayInYear(29, 9) - g_date->DayInYear())) {
341  SimpleEvent(g_date->Date() + 1, dk_ctp_harrow, true);
342  break;
343  }
344  SimpleEvent(g_date->Date() + 1, dk_ctp_plant_trees, false);
345  break;
346 
347  case dk_ctp_plant_trees:
348  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(30, 9) - g_date->DayInYear())) {
349  SimpleEvent(g_date->Date() + 1, dk_ctp_plant_trees, true);
350  break;
351  }
352  done = true; // end of EST2
353  break;
354 
355  // 1st year after EST
357  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)
358  {
359  if (a_farm->IsStockFarmer()) {
360  if (!m_farm->FA_Manure(m_field, 0.0,
361  g_date->DayInYear(30, 4) - g_date->DayInYear())) {
363  break;
364  }
366  break;
367  }
369  break;
370  }
372  break; // clay soils
373 
375  if (!m_farm->FP_Manure(m_field, 0.0,
376  g_date->DayInYear(30, 4) - g_date->DayInYear())) {
378  break;
379  }
381  break;
382 
384  if (a_farm->IsStockFarmer()) {
385  if (!m_farm->FA_Manure(m_field, 0.0,
386  g_date->DayInYear(15, 5) - g_date->DayInYear())) {
388  break;
389  }
391  break;
392  }
394  break;
395 
397  if (!m_farm->FP_Manure(m_field, 0.0,
398  g_date->DayInYear(15, 5) - g_date->DayInYear())) {
400  break;
401  }
403  break;
404 
406  if (!m_farm->ManualWeeding(m_field, 0.0,
407  g_date->DayInYear(16, 5) - g_date->DayInYear())) {
409  break;
410  }
411  SimpleEvent(g_date->Date() + 1, dk_ctp_herbicide1_2, false);
412  break;
413 
414  case dk_ctp_herbicide1_2:
415  if (!m_farm->HerbicideTreat(m_field, 0.0,
416  g_date->DayInYear(17, 5) - g_date->DayInYear())) {
418  break;
419  }
420  SimpleEvent(g_date->Date() + 10, dk_ctp_herbicide2_2, false);
421  break;
422 
423  case dk_ctp_herbicide2_2:
424  if (!m_farm->HerbicideTreat(m_field, 0.0,
425  g_date->DayInYear(31, 5) - g_date->DayInYear())) {
427  break;
428  }
429  SimpleEvent(g_date->Date() + 10, dk_ctp_herbicide3_2, false);
430  break;
431 
432  case dk_ctp_herbicide3_2:
433  if (!m_farm->HerbicideTreat(m_field, 0.0,
434  g_date->DayInYear(30, 6) - g_date->DayInYear())) {
436  break;
437  }
438  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 7), dk_ctp_wait, false);
439  break;
440 
441  case dk_ctp_wait:
442  // end of 1st year after
443  done = true;
444  break;
445 
446  // year 2nd + 3rd year after
448  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)
449  {
450  if (a_farm->IsStockFarmer())
451  {
452  if (!m_farm->FA_Manure(m_field, 0.0,
453  g_date->DayInYear(30, 4) - g_date->DayInYear())) {
455  break;
456  }
457  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_ctp_npk_sand1_s3_4, false); // fertilizer thread main thread
458  break;
459  }
460  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 1), dk_ctp_ferti_sand_p3_4, false); // fertilizer thread main thread
461  break;
462  }
464  break;
465 
466 
468  if (!m_farm->FP_Manure(m_field, 0.0,
469  g_date->DayInYear(30, 4) - g_date->DayInYear())) {
471  break;
472  }
473  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_ctp_npk_sand1_p3_4, false); // fertilizer thread main thread
474  break;
475 
477  if (a_farm->IsStockFarmer())
478  {
479  if (!m_farm->FA_Manure(m_field, 0.0,
480  g_date->DayInYear(15, 5) - g_date->DayInYear())) {
482  break;
483  }
485  break;
486  }
488  break;
489 
491  if (!m_farm->FP_Manure(m_field, 0.0,
492  g_date->DayInYear(15, 5) - g_date->DayInYear())) {
494  break;
495  }
497  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6), dk_ctp_grazing_3_4, false); // grazing thread
499  break;
500 
502  if (!m_farm->FA_NPK(m_field, 0.0,
503  g_date->DayInYear(16, 5) - g_date->DayInYear())) {
505  break;
506  }
507  SimpleEvent(g_date->Date() + 1, dk_ctp_manual_weeding_3_4, false); // weeding / herbicide thread
508  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6), dk_ctp_grazing_3_4, false); // grazing thread
510  break;
511 
513  if (!m_farm->FA_NPK(m_field, 0.0,
514  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
516  break;
517  }
518  SimpleEvent(g_date->Date() + 1, dk_ctp_manual_weeding_3_4, false); // weeding / herbicide thread
519  SimpleEvent(g_date->Date() + 1, dk_ctp_grazing_3_4, false); // grazing thread
521  break;
522 
524  if (!m_farm->FP_NPK(m_field, 0.0,
525  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
527  break;
528  }
529  SimpleEvent(g_date->Date() + 1, dk_ctp_manual_weeding_3_4, false); // weeding / herbicide thread
530  SimpleEvent(g_date->Date() + 1, dk_ctp_grazing_3_4, false); // grazing thread
532  break;
533 
535  if (!m_farm->ManualWeeding(m_field, 0.0,
536  g_date->DayInYear(16, 5) - g_date->DayInYear())) {
538  break;
539  }
541  break;
542 
544  if (!m_farm->HerbicideTreat(m_field, 0.0,
545  g_date->DayInYear(17, 5) - g_date->DayInYear())) {
547  break;
548  }
549  SimpleEvent(g_date->Date() + 10, dk_ctp_herbicide2_3_4, false);
550  break;
551 
553  if (!m_farm->HerbicideTreat(m_field, 0.0,
554  g_date->DayInYear(31, 5) - g_date->DayInYear())) {
556  break;
557  }
558  SimpleEvent(g_date->Date() + 10, dk_ctp_herbicide3_3_4, false);
559  break;
560 
562  if (!m_farm->HerbicideTreat(m_field, 0.0,
563  g_date->DayInYear(30, 6) - g_date->DayInYear())) {
565  break;
566  }
568  break;
569 
570  case dk_ctp_manual_cutting_3_4: // no specific timing for this trimming event
571  if (!m_farm->Pruning(m_field, 0.0,
572  g_date->DayInYear(31, 8) - g_date->DayInYear())) {
574  break;
575  }
576  break;
577 
578  // end of weeding / herbicide thread
579 
580  case dk_ctp_grazing_3_4:
581  if (m_ev->m_lock || m_farm->DoIt_prob(.10)) { // suggest it is not common
582  if (!m_farm->PigsOut(m_field, 0.0,
583  g_date->DayInYear(1, 7) - g_date->DayInYear())) {
584  SimpleEvent(g_date->Date() + 1, dk_ctp_grazing_3_4, true);
585  break;
586  }
588  break;
589  }
590  break;
591  case dk_ctp_pig_is_out_3_4: // Keep the pigs out there
592  // PigsAreOut() returns false if it is not time to stop grazing
593  if (!m_farm->PigsAreOut(m_field, 0.0,
594  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
596  break;
597  }
598  break; // end of grazing thread
599 
601  if (!m_farm->FA_NPK(m_field, 0.0,
602  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
604  break;
605  }
607  break;
608 
610  if (!m_farm->FP_NPK(m_field, 0.0,
611  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
613  break;
614  }
616  break;
617 
618  // year 5 (after establishment)
619  case dk_ctp_npk_s5:
620  if (a_farm->IsStockFarmer())
621  {
622  if (!m_farm->FA_NPK(m_field, 0.0,
623  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
624  SimpleEvent(g_date->Date() + 1, dk_ctp_npk_s5, true);
625  break;
626  }
627  SimpleEvent(g_date->Date() + 1, dk_ctp_manual_weeding_5, false); // weeding / herbicide thread
628  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6), dk_ctp_grazing_5, false); // grazing thread
629  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 8), dk_ctp_npk_sand_s5, false); // fertilizer thread - main thread
630  break;
631  }// here comes a fork of parallel events:
632  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 1), dk_ctp_npk_p5, false);
633  break;
634 
635  case dk_ctp_npk_p5:
636  if (!m_farm->FP_NPK(m_field, 0.0,
637  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
638  SimpleEvent(g_date->Date() + 1, dk_ctp_npk_p5, true);
639  break;
640  }
641  SimpleEvent(g_date->Date() + 1, dk_ctp_manual_weeding_5, false); // weeding / herbicide thread
642  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6), dk_ctp_grazing_5, false); // grazing thread
643  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 8), dk_ctp_npk_sand_p5, false); // fertilizer thread - main thread
644  break;
645 
647  if (!m_farm->ManualWeeding(m_field, 0.0,
648  g_date->DayInYear(16, 5) - g_date->DayInYear())) {
650  break;
651  }
652  SimpleEvent(g_date->Date() + 1, dk_ctp_herbicide1_5, false);
653  break;
654 
655  case dk_ctp_herbicide1_5:
656  if (!m_farm->HerbicideTreat(m_field, 0.0,
657  g_date->DayInYear(17, 5) - g_date->DayInYear())) {
659  break;
660  }
661  SimpleEvent(g_date->Date() + 10, dk_ctp_herbicide2_5, false);
662  break;
663 
664  case dk_ctp_herbicide2_5:
665  if (!m_farm->HerbicideTreat(m_field, 0.0,
666  g_date->DayInYear(31, 5) - g_date->DayInYear())) {
668  break;
669  }
670  SimpleEvent(g_date->Date() + 10, dk_ctp_herbicide3_5, false);
671  break;
672 
673  case dk_ctp_herbicide3_5:
674  if (!m_farm->HerbicideTreat(m_field, 0.0,
675  g_date->DayInYear(30, 6) - g_date->DayInYear())) {
677  break;
678  }
680  break;
681 
682  case dk_ctp_manual_cutting_5: // no specific timing for this trimming event
683  if (!m_farm->Pruning(m_field, 0.0,
684  g_date->DayInYear(31, 8) - g_date->DayInYear())) {
686  break;
687  }
688  break;
689 
690  case dk_ctp_grazing_5:
691  if (m_ev->m_lock || m_farm->DoIt_prob(.10)) { // suggest it is not common
692  if (!m_farm->PigsOut(m_field, 0.0,
693  g_date->DayInYear(1, 7) - g_date->DayInYear())) {
694  SimpleEvent(g_date->Date() + 1, dk_ctp_grazing_5, true);
695  break;
696  }
697  SimpleEvent(g_date->Date() + 1, dk_ctp_pig_is_out_5, false);
698  break;
699  }
700  break;
701  case dk_ctp_pig_is_out_5: // Keep the pigs out there
702  // PigsAreOut() returns false if it is not time to stop grazing
703  if (!m_farm->PigsAreOut(m_field, 0.0,
704  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
705  SimpleEvent(g_date->Date() + 1, dk_ctp_pig_is_out_5, false);
706  break;
707  }
708  break; // end of grazing thread
709 
710  case dk_ctp_npk_sand_s5:
711  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)
712  {
713  if (!m_farm->FA_NPK(m_field, 0.0,
714  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
715  SimpleEvent(g_date->Date() + 1, dk_ctp_npk_sand_s5, true);
716  break;
717  }
718  }
720  break;
721 
722  case dk_ctp_npk_sand_p5:
723  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)
724  {
725  if (!m_farm->FP_NPK(m_field, 0.0,
726  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
727  SimpleEvent(g_date->Date() + 1, dk_ctp_npk_sand_p5, true);
728  break;
729  }
730  }
732  break;
733 
734  case dk_ctp_sow_catch_crop2: // changes may be needed
735  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(16, 8) - g_date->DayInYear())) {
737  break;
738  }
739  SimpleEvent(g_date->Date() + 90, dk_ctp_herbicide4_3_4, false);
740  break;
741 
743  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(16, 11) - g_date->DayInYear())) {
745  break;
746  }
747  //end of year 2nd, 3rd and 4th year after
748  done = true;
749  break;
750 
751  // 5th year after
752  case dk_ctp_npk1_s6:
753  if (a_farm->IsStockFarmer())
754  {
755  if (!m_farm->FA_NPK(m_field, 0.0,
756  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
757  SimpleEvent(g_date->Date() + 1, dk_ctp_npk1_s6, true);
758  break;
759  }
760  // here comes a fork of parallel events:
761  SimpleEvent(g_date->Date() + 1, dk_ctp_manual_weeding_6, false); // weeding / herbicide thread
762  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6), dk_ctp_grazing_6, false); // grazing thread
764  break;
765  }
766  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 1), dk_ctp_npk1_p6, false);
767  break;
768 
769  case dk_ctp_npk1_p6:
770  if (!m_farm->FP_NPK(m_field, 0.0,
771  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
772  SimpleEvent(g_date->Date() + 1, dk_ctp_npk1_p6, true);
773  break;
774  }
775  // here comes a fork of parallel events:
776  SimpleEvent(g_date->Date() + 1, dk_ctp_manual_weeding_6, false); // weeding / herbicide thread
777  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6), dk_ctp_grazing_6, false); // grazing thread
779  break;
780 
781  case dk_ctp_npk2_s6:
782  if (!m_farm->FA_NPK(m_field, 0.0,
783  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
784  SimpleEvent(g_date->Date() + 1, dk_ctp_npk2_s6, true);
785  break;
786  }
788  break;
789 
790  case dk_ctp_npk2_p6:
791  if (!m_farm->FP_NPK(m_field, 0.0,
792  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
793  SimpleEvent(g_date->Date() + 1, dk_ctp_npk2_p6, true);
794  break;
795  }
797  break;
798 
799  case dk_ctp_calcium_s6:
800  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)
801  {
802  if (!m_farm->FA_Calcium(m_field, 0.0,
803  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
804  SimpleEvent(g_date->Date() + 1, dk_ctp_calcium_s6, true);
805  break;
806  }
807  }
809  break;
810 
811  case dk_ctp_calcium_p6:
812  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)
813  {
814  if (!m_farm->FP_Calcium(m_field, 0.0,
815  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
816  SimpleEvent(g_date->Date() + 1, dk_ctp_calcium_p6, true);
817  break;
818  }
819  }
821  break;
822 
823  case dk_ctp_grazing_6:
824  if (m_ev->m_lock || m_farm->DoIt_prob(.10)) { // suggest it is not common
825  if (!m_farm->PigsOut(m_field, 0.0,
826  g_date->DayInYear(1, 7) - g_date->DayInYear())) {
827  SimpleEvent(g_date->Date() + 1, dk_ctp_grazing_6, true);
828  break;
829  }
830  SimpleEvent(g_date->Date() + 1, dk_ctp_pig_is_out_6, false);
831  break;
832  }
833  break;
834  case dk_ctp_pig_is_out_6: // Keep the pigs out there
835  // PigsAreOut() returns false if it is not time to stop grazing
836  if (!m_farm->PigsAreOut(m_field, 0.0,
837  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
838  SimpleEvent(g_date->Date() + 1, dk_ctp_pig_is_out_6, false);
839  break;
840  }
841  break; // end of grazing thread
842 
844  if (!m_farm->ManualWeeding(m_field, 0.0,
845  g_date->DayInYear(16, 5) - g_date->DayInYear())) {
847  break;
848  }
849  SimpleEvent(g_date->Date() + 1, dk_ctp_herbicide1_6, false);
850  break;
851 
852  case dk_ctp_herbicide1_6:
853  if (!m_farm->HerbicideTreat(m_field, 0.0,
854  g_date->DayInYear(17, 5) - g_date->DayInYear())) {
856  break;
857  }
858  SimpleEvent(g_date->Date() + 10, dk_ctp_herbicide2_6, false);
859  break;
860 
861  case dk_ctp_herbicide2_6:
862  if (!m_farm->HerbicideTreat(m_field, 0.0,
863  g_date->DayInYear(31, 5) - g_date->DayInYear())) {
865  break;
866  }
867  SimpleEvent(g_date->Date() + 10, dk_ctp_herbicide3_6, false);
868  break;
869 
870  case dk_ctp_herbicide3_6:
871  if (!m_farm->HerbicideTreat(m_field, 0.0,
872  g_date->DayInYear(30, 6) - g_date->DayInYear())) {
874  break;
875  }
877  break;
878 
879  case dk_ctp_manual_cutting_6: // no specific timing for this trimming event
880  if (!m_farm->Pruning(m_field, 0.0,
881  g_date->DayInYear(31, 8) - g_date->DayInYear())) {
883  break;
884  }
885  break;
886 
887  // 6th + 7th year after
888  case dk_ctp_npk1_s7_8:
889  if (a_farm->IsStockFarmer())
890  {
891  if (!m_farm->FA_NPK(m_field, 0.0,
892  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
893  SimpleEvent(g_date->Date() + 1, dk_ctp_npk1_s7_8, true);
894  break;
895  }
896  // here comes a fork of parallel events:
897  SimpleEvent(g_date->Date() + 1, dk_ctp_manual_weeding_7_8, false); // weeding / herbicide thread
898  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6), dk_ctp_grazing_7_8, false); // grazing thread
899  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 8), dk_ctp_npk2_s7_8, false); // fertilizer thread
900  break;
901  }
902  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 1), dk_ctp_npk1_p7_8, false);
903  break;
904 
905  case dk_ctp_npk1_p7_8:
906  if (!m_farm->FP_NPK(m_field, 0.0,
907  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
908  SimpleEvent(g_date->Date() + 1, dk_ctp_npk1_p7_8, true);
909  break;
910  }
911  // here comes a fork of parallel events:
912  SimpleEvent(g_date->Date() + 1, dk_ctp_manual_weeding_7_8, false); // weeding / herbicide thread
913  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6), dk_ctp_grazing_7_8, false); // grazing thread
914  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 8), dk_ctp_npk2_p7_8, false); // fertilizer thread
915  break;
916 
917  case dk_ctp_npk2_s7_8:
918  if (!m_farm->FA_NPK(m_field, 0.0,
919  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
920  SimpleEvent(g_date->Date() + 1, dk_ctp_npk2_s7_8, true);
921  break;
922  }
924  break;
925 
926  case dk_ctp_npk2_p7_8:
927  if (!m_farm->FP_NPK(m_field, 0.0,
928  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
929  SimpleEvent(g_date->Date() + 1, dk_ctp_npk2_p7_8, true);
930  break;
931  }
933  break;
934 
935  case dk_ctp_calcium_s7_8:
936  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)
937  {
938  if (!m_farm->FA_Calcium(m_field, 0.0,
939  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
941  break;
942  }
943  }
945  break;
946 
947  case dk_ctp_calcium_p7_8:
948  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)
949  {
950  if (!m_farm->FP_Calcium(m_field, 0.0,
951  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
953  break;
954  }
955  }
957  break;
958 
959  case dk_ctp_grazing_7_8:
960  if (m_ev->m_lock || m_farm->DoIt_prob(.10)) { // suggest it is not common
961  if (!m_farm->PigsOut(m_field, 0.0,
962  g_date->DayInYear(1, 7) - g_date->DayInYear())) {
963  SimpleEvent(g_date->Date() + 1, dk_ctp_grazing_7_8, true);
964  break;
965  }
967  break;
968  }
969  break;
970  case dk_ctp_pig_is_out_7_8: // Keep the pigs out there
971  // PigsAreOut() returns false if it is not time to stop grazing
972  if (!m_farm->PigsAreOut(m_field, 0.0,
973  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
975  break;
976  }
977  break; // end of grazing thread
978 
980  if (!m_farm->ManualWeeding(m_field, 0.0,
981  g_date->DayInYear(16, 5) - g_date->DayInYear())) {
983  break;
984  }
986  break;
987 
989  if (!m_farm->HerbicideTreat(m_field, 0.0,
990  g_date->DayInYear(17, 5) - g_date->DayInYear())) {
992  break;
993  }
994  SimpleEvent(g_date->Date() + 10, dk_ctp_herbicide2_7_8, false);
995  break;
996 
998  if (!m_farm->HerbicideTreat(m_field, 0.0,
999  g_date->DayInYear(31, 5) - g_date->DayInYear())) {
1001  break;
1002  }
1003  SimpleEvent(g_date->Date() + 10, dk_ctp_herbicide3_7_8, false);
1004  break;
1005 
1006  case dk_ctp_herbicide3_7_8:
1007  if (!m_farm->HerbicideTreat(m_field, 0.0,
1008  g_date->DayInYear(30, 6) - g_date->DayInYear())) {
1010  break;
1011  }
1013  break;
1014 
1015  case dk_ctp_manual_cutting_7_8: // no specific timing for this trimming event
1016  if (!m_farm->Pruning(m_field, 0.0,
1017  g_date->DayInYear(31, 8) - g_date->DayInYear())) {
1019  break;
1020  }
1022  break;
1023 
1024  case dk_ctp_manual_cutting2_7_8: // no specific timing for this trimming event (removing faulty trees)
1025  if (!m_farm->Pruning(m_field, 0.0,
1026  g_date->DayInYear(15, 9) - g_date->DayInYear())) {
1028  break;
1029  }
1030  break;
1031 
1032  // 8th + 9th year after
1033  case dk_ctp_npk1_s9_10:
1034  if (a_farm->IsStockFarmer())
1035  {
1036  if (!m_farm->FA_NPK(m_field, 0.0,
1037  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
1038  SimpleEvent(g_date->Date() + 1, dk_ctp_npk1_s9_10, true);
1039  break;
1040  }
1041  // here comes a fork of parallel events:
1042  SimpleEvent(g_date->Date() + 1, dk_ctp_manual_weeding_9_10, false); // weeding / herbicide thread
1044  break;
1045  }
1046  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 1), dk_ctp_npk1_p9_10, false);
1047  break;
1048 
1049  case dk_ctp_npk1_p9_10:
1050  if (!m_farm->FP_NPK(m_field, 0.0,
1051  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
1052  SimpleEvent(g_date->Date() + 1, dk_ctp_npk1_p9_10, true);
1053  break;
1054  }
1055  // here comes a fork of parallel events:
1056  SimpleEvent(g_date->Date() + 1, dk_ctp_manual_weeding_9_10, false); // weeding / herbicide thread
1058  break;
1059 
1060  case dk_ctp_npk2_s9_10:
1061  if (!m_farm->FA_NPK(m_field, 0.0,
1062  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
1063  SimpleEvent(g_date->Date() + 1, dk_ctp_npk2_s9_10, true);
1064  break;
1065  }
1067  break;
1068 
1069  case dk_ctp_npk2_p9_10:
1070  if (!m_farm->FP_NPK(m_field, 0.0,
1071  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
1072  SimpleEvent(g_date->Date() + 1, dk_ctp_npk2_p9_10, true);
1073  break;
1074  }
1076  break;
1077 
1078  case dk_ctp_calcium_s9_10:
1079  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)
1080  {
1081  if (!m_farm->FA_Calcium(m_field, 0.0,
1082  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
1084  break;
1085  }
1086  }
1088  break;
1089 
1090  case dk_ctp_calcium_p9_10:
1091  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)
1092  {
1093  if (!m_farm->FP_Calcium(m_field, 0.0,
1094  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
1096  break;
1097  }
1098  }
1100  break;
1101 
1103  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(16, 8) - g_date->DayInYear())) {
1105  break;
1106  }
1107  SimpleEvent(g_date->Date() + 90, dk_ctp_herbicide4_9_10, false);
1108  break;
1109 
1111  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(16, 11) - g_date->DayInYear())) {
1113  break;
1114  }
1115  //end 5th-9th year after
1116  done = true;
1117  break;
1118 
1120  if (!m_farm->ManualWeeding(m_field, 0.0,
1121  g_date->DayInYear(16, 5) - g_date->DayInYear())) {
1123  break;
1124  }
1126  break;
1127 
1129  if (!m_farm->HerbicideTreat(m_field, 0.0,
1130  g_date->DayInYear(17, 5) - g_date->DayInYear())) {
1132  break;
1133  }
1134  SimpleEvent(g_date->Date() + 10, dk_ctp_herbicide2_9_10, false);
1135  break;
1136 
1138  if (!m_farm->HerbicideTreat(m_field, 0.0,
1139  g_date->DayInYear(31, 5) - g_date->DayInYear())) {
1141  break;
1142  }
1143  SimpleEvent(g_date->Date() + 10, dk_ctp_herbicide3_9_10, false);
1144  break;
1145 
1147  if (!m_farm->HerbicideTreat(m_field, 0.0,
1148  g_date->DayInYear(30, 6) - g_date->DayInYear())) {
1150  break;
1151  }
1152  // end of weeding / herbicide thread
1153  break;
1154 
1155  // year 10+ - harvest year
1156  case dk_ctp_npk1_s11:
1157  if (a_farm->IsStockFarmer())
1158  {
1159  if (!m_farm->FA_NPK(m_field, 0.0,
1160  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
1161  SimpleEvent(g_date->Date() + 1, dk_ctp_npk1_s11, true);
1162  break;
1163  }
1164  // here comes a fork of parallel events:
1165  SimpleEvent(g_date->Date() + 1, dk_ctp_manual_weeding_11, false); // weeding
1166  SimpleEvent(g_date->Date() + 1, dk_ctp_herbicide1, false); // herbi thread
1168  break;
1169  }
1170  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3), dk_ctp_npk1_p11, false);
1171  break;
1172 
1173  case dk_ctp_npk1_p11:
1174  if (!m_farm->FP_NPK(m_field, 0.0,
1175  g_date->DayInYear(1, 5) - g_date->DayInYear())) {
1176  SimpleEvent(g_date->Date() + 1, dk_ctp_npk1_p11, true);
1177  break;
1178  }
1179  // here comes a fork of parallel events:
1180  SimpleEvent(g_date->Date() + 1, dk_ctp_manual_weeding_11, false); // weeding
1181  SimpleEvent(g_date->Date() + 1, dk_ctp_herbicide1, false); // herbi thread
1183  break;
1184 
1185  case dk_ctp_npk2_s11:
1186  if (!m_farm->FA_NPK(m_field, 0.0,
1187  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
1188  SimpleEvent(g_date->Date() + 1, dk_ctp_npk2_s11, true);
1189  break;
1190  }
1192  break;
1193 
1194  case dk_ctp_npk2_p11:
1195  if (!m_farm->FP_NPK(m_field, 0.0,
1196  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
1197  SimpleEvent(g_date->Date() + 1, dk_ctp_npk2_p11, true);
1198  break;
1199  }
1201  break;
1202 
1203  case dk_ctp_calcium_s11:
1204  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)
1205  {
1206  if (!m_farm->FA_Calcium(m_field, 0.0,
1207  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
1208  SimpleEvent(g_date->Date() + 1, dk_ctp_calcium_s11, true);
1209  break;
1210  }
1211  }
1213  break;
1214 
1215  case dk_ctp_calcium_p11:
1216  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)
1217  {
1218  if (!m_farm->FP_Calcium(m_field, 0.0,
1219  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
1220  SimpleEvent(g_date->Date() + 1, dk_ctp_calcium_p11, true);
1221  break;
1222  }
1223  }
1225  break;
1226 
1228  if (!m_farm->AutumnSow(m_field, 0.0,
1229  g_date->DayInYear(17, 8) - g_date->DayInYear())) {
1231  break;
1232  }
1234  break;
1235 
1237  if (!m_farm->Pruning(m_field, 0.0, g_date->DayInYear(25, 12) - g_date->DayInYear())) {
1239  break;
1240  }
1241  SimpleEvent(g_date->Date(), dk_ctp_harvest, false);
1242  break;
1243 
1244  case dk_ctp_harvest:
1245  if (!m_farm->Harvest(m_field, 0.0, g_date->DayInYear(25, 12) - g_date->DayInYear())) {
1246  SimpleEvent(g_date->Date() + 1, dk_ctp_harvest, true);
1247  break;
1248  }
1249  //end of harvest year - end of Christmas tree management!
1250  done = true;
1251  break;
1252 
1254  if (!m_farm->ManualWeeding(m_field, 0.0,
1255  g_date->DayInYear(16, 8) - g_date->DayInYear())) {
1257  break;
1258  }
1259  break;
1260 
1261  case dk_ctp_herbicide1:
1262  if (!m_farm->HerbicideTreat(m_field, 0.0,
1263  g_date->DayInYear(17, 5) - g_date->DayInYear())) {
1264  SimpleEvent(g_date->Date() + 1, dk_ctp_herbicide1, true);
1265  break;
1266  }
1267  SimpleEvent(g_date->Date() + 10, dk_ctp_herbicide2, false);
1268  break;
1269 
1270  case dk_ctp_herbicide2:
1271  if (!m_farm->HerbicideTreat(m_field, 0.0,
1272  g_date->DayInYear(31, 5) - g_date->DayInYear())) {
1273  SimpleEvent(g_date->Date() + 1, dk_ctp_herbicide2, true);
1274  break;
1275  }
1276  SimpleEvent(g_date->Date() + 10, dk_ctp_herbicide3, false);
1277  break;
1278 
1279  case dk_ctp_herbicide3:
1280  if (!m_farm->HerbicideTreat(m_field, 0.0,
1281  g_date->DayInYear(30, 6) - g_date->DayInYear())) {
1282  SimpleEvent(g_date->Date() + 1, dk_ctp_herbicide3, true);
1283  break;
1284  }
1285  // end of weeding / herbicide thread
1286  break;
1287  // So we are done, and somewhere else the farmer will queue up the start event of the next crop
1288  // END OF MAIN THREAD
1289  g_msg->Warn(WARN_BUG, "DK_ChristmasTrees_Perm::Do(): "
1290  "Unknown event type! ", "");
1291  exit(1);
1292  }
1293  return done;
1294 }

References Farm::AutumnHarrow(), Farm::AutumnPlough(), Farm::AutumnSow(), LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), Farm::DeepPlough(), dk_ctp_calcium_p11, dk_ctp_calcium_p6, dk_ctp_calcium_p7_8, dk_ctp_calcium_p9_10, dk_ctp_calcium_s11, dk_ctp_calcium_s6, dk_ctp_calcium_s7_8, dk_ctp_calcium_s9_10, dk_ctp_crush_trees, dk_ctp_depth_plough_autumn, dk_ctp_ferti_clay_p2, dk_ctp_ferti_clay_p3_4, dk_ctp_ferti_clay_s2, dk_ctp_ferti_clay_s3_4, dk_ctp_ferti_sand_p2, dk_ctp_ferti_sand_p3_4, dk_ctp_ferti_sand_s2, dk_ctp_ferti_sand_s3_4, dk_ctp_grazing_3_4, dk_ctp_grazing_5, dk_ctp_grazing_6, dk_ctp_grazing_7_8, dk_ctp_harrow, dk_ctp_harrow_autumn, dk_ctp_harvest, dk_ctp_herbicide, dk_ctp_herbicide1, dk_ctp_herbicide1_2, dk_ctp_herbicide1_3_4, dk_ctp_herbicide1_5, dk_ctp_herbicide1_6, dk_ctp_herbicide1_7_8, dk_ctp_herbicide1_9_10, dk_ctp_herbicide2, dk_ctp_herbicide2_2, dk_ctp_herbicide2_3_4, dk_ctp_herbicide2_5, dk_ctp_herbicide2_6, dk_ctp_herbicide2_7_8, dk_ctp_herbicide2_9_10, dk_ctp_herbicide3, dk_ctp_herbicide3_2, dk_ctp_herbicide3_3_4, dk_ctp_herbicide3_5, dk_ctp_herbicide3_6, dk_ctp_herbicide3_7_8, dk_ctp_herbicide3_9_10, dk_ctp_herbicide4_3_4, dk_ctp_herbicide4_9_10, dk_ctp_manual_cutting2_7_8, dk_ctp_manual_cutting_11, dk_ctp_manual_cutting_3_4, dk_ctp_manual_cutting_5, dk_ctp_manual_cutting_6, dk_ctp_manual_cutting_7_8, dk_ctp_manual_weeding_11, dk_ctp_manual_weeding_2, dk_ctp_manual_weeding_3_4, dk_ctp_manual_weeding_5, dk_ctp_manual_weeding_6, dk_ctp_manual_weeding_7_8, dk_ctp_manual_weeding_9_10, dk_ctp_npk1_p11, dk_ctp_npk1_p6, dk_ctp_npk1_p7_8, dk_ctp_npk1_p9_10, dk_ctp_npk1_s11, dk_ctp_npk1_s6, dk_ctp_npk1_s7_8, dk_ctp_npk1_s9_10, dk_ctp_npk2_p11, dk_ctp_npk2_p6, dk_ctp_npk2_p7_8, dk_ctp_npk2_p9_10, dk_ctp_npk2_s11, dk_ctp_npk2_s6, dk_ctp_npk2_s7_8, dk_ctp_npk2_s9_10, dk_ctp_npk_clay_s3_4, dk_ctp_npk_p5, dk_ctp_npk_s5, dk_ctp_npk_sand1_p3_4, dk_ctp_npk_sand1_s3_4, dk_ctp_npk_sand2_p3_4, dk_ctp_npk_sand2_s3_4, dk_ctp_npk_sand_p5, dk_ctp_npk_sand_s5, dk_ctp_pig_is_out_3_4, dk_ctp_pig_is_out_5, dk_ctp_pig_is_out_6, dk_ctp_pig_is_out_7_8, dk_ctp_plant_trees, dk_ctp_plant_trees_autumn, dk_ctp_plough1_autumn, dk_ctp_plough2_autumn, dk_ctp_row_cultivation_autumn, dk_ctp_sleep_all_day, dk_ctp_sow_catch_crop1, dk_ctp_sow_catch_crop2, dk_ctp_sow_catch_crop3, dk_ctp_sow_catch_crop_11, dk_ctp_sow_cover_crop_autumn, dk_ctp_sow_inter_crops, dk_ctp_start, dk_ctp_stubble_harrow_autumn, dk_ctp_wait, DK_CTP_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::HerbicideTreat(), 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_DKChristmasTrees_Perm, MapErrorMsg::Warn(), and WARN_BUG.

◆ SetUpFarmCategoryInformation()

void DK_ChristmasTrees_Perm::SetUpFarmCategoryInformation ( )
inline
197  {
198  const int elements = 2 + (dk_ctp_foobar - DK_CTP_BASE);
200 
201  FarmManagementCategory catlist[elements] =
202  {
203  fmc_Others, // zero element unused but must be here
204  fmc_Others, // dk_ctp_start = 1, // Compulsory, must always be 1 (one).
205  fmc_Others, // dk_ctp_sleep_all_day = DK_CTP_BASE,
206  fmc_Cultivation, // dk_ctp_plough1_autumn,
207  fmc_Cultivation, // dk_ctp_depth_plough_autumn,
208  fmc_Cultivation, // dk_ctp_plough2_autumn,
209  fmc_Cultivation, // dk_ctp_stubble_harrow_autumn,
210  fmc_Others, // dk_ctp_sow_cover_crop_autumn,
211  fmc_Others, // dk_ctp_plant_trees_autumn,
212  fmc_Cultivation, // dk_ctp_row_cultivation_autumn,
213  fmc_Cultivation, // dk_ctp_harrow_autumn,
214  fmc_Cutting, //dk_ctp2e_crush_trees,
215  fmc_Others, //dk_ctp2e_sow_inter_crops,
216  fmc_Cultivation, // dk_ctp2e_harrow,
217  fmc_Herbicide, //dk_ctp2e_herbicide,
218  fmc_Others, // dk_ctp2e_sow_catch_crops,
219  fmc_Others, // dk_ctp2e_plant_trees,
220  fmc_Fertilizer, //dk_ctp2_ferti_clay_s2,
221  fmc_Fertilizer, //dk_ctp2_ferti_sand_s2,
222  fmc_Fertilizer, //dk_ctp2_ferti_clay_p2,
223  fmc_Fertilizer, //dk_ctp2_ferti_sand_p2,
224  fmc_Cultivation, //dk_ctp2_manual_weeding_2,
225  fmc_Herbicide, //dk_ctp2_herbicide1_2,
226  fmc_Herbicide, //dk_ctp2_herbicide2_2,
227  fmc_Herbicide, //dk_ctp2_herbicide3_2,
228  fmc_Fertilizer, //dk_ctp2_ferti_clay_s3_4,
229  fmc_Fertilizer, //dk_ctp2_ferti_sand_s3_4,
230  fmc_Fertilizer, //dk_ctp2_npk_clay_s3_4,
231  fmc_Fertilizer, //dk_ctp2_npk_sand1_s3_4,
232  fmc_Fertilizer, //dk_ctp2_npk_sand2_s3_4,
233  fmc_Fertilizer, //dk_ctp2_ferti_clay_p3_4,
234  fmc_Fertilizer, //dk_ctp2_ferti_sand_p3_4,
235  fmc_Fertilizer, //dk_ctp2_npk_clay_p3_4,
236  fmc_Fertilizer, //dk_ctp2_npk_sand1_p3_4,
237  fmc_Fertilizer, //dk_ctp2_npk_sand2_p3_4,
238  fmc_Cultivation, //dk_ctp2_manual_weeding_3_4,
239  fmc_Herbicide, //dk_ctp2_herbicide1_3_4,
240  fmc_Herbicide, //dk_ctp2_herbicide2_3_4,
241  fmc_Herbicide, //dk_ctp2_herbicide3_3_4,
242  fmc_Cutting, // dk_ctp2_manual_cutting_3_4
243  fmc_Grazing, //dk_ctp2_grazing_3_4,
244  fmc_Grazing, //dk_ctp2_pig_is_out_3_4,
245  fmc_Others, //dk_ctp2_sow_catch_crop,
246  fmc_Herbicide, //dk_ctp2_herbicide4,
247  fmc_Fertilizer, //dk_ctp2_npk_s5,
248  fmc_Fertilizer, //dk_ctp2_npk_sand_s5,
249  fmc_Fertilizer, //dk_ctp2_npk_p5,
250  fmc_Fertilizer, //dk_ctp2_npk_sand_p5,
251  fmc_Grazing, //dk_ctp2_grazing_5,
252  fmc_Grazing, //dk_ctp2_pig_is_out_5,
253  fmc_Cultivation, //dk_ctp2_manual_weeding_5,
254  fmc_Herbicide, //dk_ctp2_herbicide1_5,
255  fmc_Herbicide, //dk_ctp2_herbicide2_5,
256  fmc_Herbicide, //dk_ctp2_herbicide3_5,
257  fmc_Cutting, //dk_ctp2_manual_cutting_5,
258  fmc_Fertilizer, //dk_ctp3_npk1_s6,
259  fmc_Fertilizer, //dk_ctp3_npk2_s6,
260  fmc_Fertilizer, //dk_ctp3_calcium_s6,
261  fmc_Fertilizer, //dk_ctp3_npk1_p6,
262  fmc_Fertilizer, //dk_ctp3_npk2_p6,
263  fmc_Fertilizer, //dk_ctp3_calcium_p6,
264  fmc_Grazing, //dk_ctp3_grazing_6,
265  fmc_Grazing, //dk_ctp3_pig_is_out_6,
266  fmc_Cultivation, //dk_ctp3_manual_weeding_6,
267  fmc_Herbicide, //dk_ctp3_herbicide1_6,
268  fmc_Herbicide, //dk_ctp3_herbicide2_6,
269  fmc_Herbicide, //dk_ctp3_herbicide3_6,
270  fmc_Cutting, //dk_ctp3_manual_cutting_6,
271  fmc_Fertilizer, //dk_ctp3_npk1_s7_8,
272  fmc_Fertilizer, //dk_ctp3_npk2_s7_8,
273  fmc_Fertilizer, //dk_ctp3_calcium_s7_8,
274  fmc_Fertilizer, //dk_ctp3_npk1_p7_8,
275  fmc_Fertilizer, //dk_ctp3_npk2_p7_8,
276  fmc_Fertilizer, //dk_ctp3_calcium_p7_8,
277  fmc_Grazing, //dk_ctp3_grazing_7_8,
278  fmc_Grazing, //dk_ctp3_pig_is_out_7_8,
279  fmc_Cultivation, //dk_ctp3_manual_weeding_7_8,
280  fmc_Herbicide, //dk_ctp3_herbicide1_7_8,
281  fmc_Herbicide, //dk_ctp3_herbicide2_7_8,
282  fmc_Herbicide, //dk_ctp3_herbicide3_7_8,
283  fmc_Cutting, //dk_ctp3_manual_cutting_7_8,
284  fmc_Cutting, //dk_ctp3_manual_cutting2_7_8,
285  fmc_Fertilizer, //dk_ctp3_npk1_s9_10,
286  fmc_Fertilizer, //dk_ctp3_npk2_s9_10,
287  fmc_Fertilizer, //dk_ctp3_calcium_s9_10,
288  fmc_Fertilizer, //dk_ctp3_npk1_p9_10,
289  fmc_Fertilizer, //dk_ctp3_npk2_p9_10,
290  fmc_Fertilizer, //dk_ctp3_calcium_p9_10,
291  fmc_Others, // dk_ctp3_sow_catch_crop,
292  fmc_Herbicide, //dk_ctp3_herbicide4,
293  fmc_Cultivation, // dk_ctp3_manual_weeding_9_10,
294  fmc_Herbicide, //dk_ctp3_herbicide1_9_10,
295  fmc_Herbicide, //dk_ctp3_herbicide2_9_10,
296  fmc_Herbicide, //dk_ctp3_herbicide3_9_10,
297  fmc_Fertilizer, //dk_ctp2_npk1_s11,
298  fmc_Fertilizer, //dk_ctp2_npk2_s11,
299  fmc_Fertilizer, //dk_ctp2_calcium_s11,
300  fmc_Fertilizer, //dk_ctp2_npk1_p11,
301  fmc_Fertilizer, //dk_ctp2_npk2_p11,
302  fmc_Fertilizer, //dk_ctp2_calcium_p11,
303  fmc_Cultivation, //dk_ctp2_manual_weeding_11,
304  fmc_Herbicide, //dk_ctp4_herbicide1,
305  fmc_Herbicide, //dk_ctp4_herbicide2,
306  fmc_Herbicide, //dk_ctp4_herbicide3,
307  fmc_Others, //dk_ctp2_sow_catch_crop_11,
308  fmc_Cutting, //dk_ctp2_manual_cutting_11,
309  fmc_Harvest, //dk_ctp2_harvest,
310  fmc_Others, //dk_ctp_wait
311  // no foobar entry
312 
313  };
314  // Iterate over the catlist elements and copy them to vector
315  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
316 
317  }

References DK_CTP_BASE, dk_ctp_foobar, fmc_Cultivation, fmc_Cutting, fmc_Fertilizer, fmc_Grazing, fmc_Harvest, fmc_Herbicide, fmc_Others, Crop::m_base_elements_no, and Crop::m_ManagementCategories.

Referenced by DK_ChristmasTrees_Perm().


The documentation for this class was generated from the following files:
dk_ctp_calcium_s9_10
Definition: DK_ChristmasTrees_Perm.h:148
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
dk_ctp_row_cultivation_autumn
Definition: DK_ChristmasTrees_Perm.h:73
dk_ctp_ferti_sand_s3_4
Definition: DK_ChristmasTrees_Perm.h:90
dk_ctp_plant_trees_autumn
Definition: DK_ChristmasTrees_Perm.h:72
dk_ctp_sleep_all_day
Definition: DK_ChristmasTrees_Perm.h:66
dk_ctp_npk2_s7_8
Definition: DK_ChristmasTrees_Perm.h:133
dk_ctp_plough2_autumn
Definition: DK_ChristmasTrees_Perm.h:69
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
dk_ctp_npk2_p11
Definition: DK_ChristmasTrees_Perm.h:162
dk_ctp_npk_sand2_s3_4
Definition: DK_ChristmasTrees_Perm.h:93
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
dk_ctp_sow_catch_crop1
Definition: DK_ChristmasTrees_Perm.h:79
dk_ctp_herbicide3_5
Definition: DK_ChristmasTrees_Perm.h:117
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_ctp_grazing_6
Definition: DK_ChristmasTrees_Perm.h:125
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_ctp_herbicide2
Definition: DK_ChristmasTrees_Perm.h:166
dk_ctp_npk2_p7_8
Definition: DK_ChristmasTrees_Perm.h:136
dk_ctp_npk_sand2_p3_4
Definition: DK_ChristmasTrees_Perm.h:98
tos_SandyClayLoam
Definition: LandscapeFarmingEnums.h:722
dk_ctp_calcium_p9_10
Definition: DK_ChristmasTrees_Perm.h:151
Farm::DoIt_prob
bool DoIt_prob(double a_probability)
Return chance out of 0 to 1.
Definition: Farm.cpp:864
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
dk_ctp_npk2_s9_10
Definition: DK_ChristmasTrees_Perm.h:147
dk_ctp_herbicide1_9_10
Definition: DK_ChristmasTrees_Perm.h:155
dk_ctp_plough1_autumn
Definition: DK_ChristmasTrees_Perm.h:67
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
dk_ctp_calcium_s11
Definition: DK_ChristmasTrees_Perm.h:160
dk_ctp_herbicide1_3_4
Definition: DK_ChristmasTrees_Perm.h:100
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_CTP_YEAR
#define DK_CTP_YEAR
A flag used to indicate year.
Definition: DK_ChristmasTrees_Perm.h:57
dk_ctp_plant_trees
Definition: DK_ChristmasTrees_Perm.h:80
dk_ctp_grazing_3_4
Definition: DK_ChristmasTrees_Perm.h:104
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
dk_ctp_herbicide1_5
Definition: DK_ChristmasTrees_Perm.h:115
dk_ctp_ferti_clay_p3_4
Definition: DK_ChristmasTrees_Perm.h:94
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
dk_ctp_calcium_s6
Definition: DK_ChristmasTrees_Perm.h:123
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_ctp_npk_sand_p5
Definition: DK_ChristmasTrees_Perm.h:111
DK_CTP_BASE
#define DK_CTP_BASE
Definition: DK_ChristmasTrees_Perm.h:53
dk_ctp_npk1_p6
Definition: DK_ChristmasTrees_Perm.h:121
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_ctp_calcium_p7_8
Definition: DK_ChristmasTrees_Perm.h:137
dk_ctp_herbicide
Definition: DK_ChristmasTrees_Perm.h:78
dk_ctp_ferti_clay_s2
Definition: DK_ChristmasTrees_Perm.h:81
dk_ctp_manual_cutting_7_8
Definition: DK_ChristmasTrees_Perm.h:144
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
dk_ctp_herbicide3_9_10
Definition: DK_ChristmasTrees_Perm.h:157
dk_ctp_ferti_clay_s3_4
Definition: DK_ChristmasTrees_Perm.h:89
fmc_Cutting
Definition: LandscapeFarmingEnums.h:1009
dk_ctp_npk1_s9_10
Definition: DK_ChristmasTrees_Perm.h:146
dk_ctp_npk1_s6
Definition: DK_ChristmasTrees_Perm.h:119
dk_ctp_pig_is_out_3_4
Definition: DK_ChristmasTrees_Perm.h:105
dk_ctp_calcium_p11
Definition: DK_ChristmasTrees_Perm.h:163
dk_ctp_npk_p5
Definition: DK_ChristmasTrees_Perm.h:110
dk_ctp_manual_cutting_3_4
Definition: DK_ChristmasTrees_Perm.h:103
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
dk_ctp_npk_clay_s3_4
Definition: DK_ChristmasTrees_Perm.h:91
dk_ctp_stubble_harrow_autumn
Definition: DK_ChristmasTrees_Perm.h:70
dk_ctp_herbicide2_6
Definition: DK_ChristmasTrees_Perm.h:129
dk_ctp_herbicide3
Definition: DK_ChristmasTrees_Perm.h:167
dk_ctp_grazing_7_8
Definition: DK_ChristmasTrees_Perm.h:138
Calendar::Date
long Date(void)
Definition: Calendar.h:57
dk_ctp_pig_is_out_5
Definition: DK_ChristmasTrees_Perm.h:113
dk_ctp_herbicide2_7_8
Definition: DK_ChristmasTrees_Perm.h:142
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
dk_ctp_ferti_clay_p2
Definition: DK_ChristmasTrees_Perm.h:83
LE::GetSoilType
int GetSoilType()
Definition: Elements.h:302
dk_ctp_harvest
Definition: DK_ChristmasTrees_Perm.h:170
dk_ctp_herbicide3_6
Definition: DK_ChristmasTrees_Perm.h:130
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_ctp_npk_sand1_s3_4
Definition: DK_ChristmasTrees_Perm.h:92
dk_ctp_manual_weeding_2
Definition: DK_ChristmasTrees_Perm.h:85
dk_ctp_herbicide4_3_4
Definition: DK_ChristmasTrees_Perm.h:107
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
dk_ctp_npk_s5
Definition: DK_ChristmasTrees_Perm.h:108
dk_ctp_npk_sand1_p3_4
Definition: DK_ChristmasTrees_Perm.h:97
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
dk_ctp_grazing_5
Definition: DK_ChristmasTrees_Perm.h:112
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
dk_ctp_herbicide2_5
Definition: DK_ChristmasTrees_Perm.h:116
dk_ctp_npk1_p11
Definition: DK_ChristmasTrees_Perm.h:161
dk_ctp_pig_is_out_7_8
Definition: DK_ChristmasTrees_Perm.h:139
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_ctp_npk1_s11
Definition: DK_ChristmasTrees_Perm.h:158
dk_ctp_start
Definition: DK_ChristmasTrees_Perm.h:65
dk_ctp_sow_catch_crop3
Definition: DK_ChristmasTrees_Perm.h:152
dk_ctp_herbicide2_2
Definition: DK_ChristmasTrees_Perm.h:87
dk_ctp_pig_is_out_6
Definition: DK_ChristmasTrees_Perm.h:126
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_ctp_herbicide1
Definition: DK_ChristmasTrees_Perm.h:165
dk_ctp_herbicide4_9_10
Definition: DK_ChristmasTrees_Perm.h:153
dk_ctp_npk1_p9_10
Definition: DK_ChristmasTrees_Perm.h:149
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_ctp_herbicide1_2
Definition: DK_ChristmasTrees_Perm.h:86
dk_ctp_manual_cutting_6
Definition: DK_ChristmasTrees_Perm.h:131
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
tos_Sand
Definition: LandscapeFarmingEnums.h:719
tov_DKChristmasTrees_Perm
Definition: LandscapeFarmingEnums.h:446
dk_ctp_herbicide2_9_10
Definition: DK_ChristmasTrees_Perm.h:156
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_ctp_wait
Definition: DK_ChristmasTrees_Perm.h:171
dk_ctp_manual_weeding_7_8
Definition: DK_ChristmasTrees_Perm.h:140
dk_ctp_manual_weeding_6
Definition: DK_ChristmasTrees_Perm.h:127
dk_ctp_npk2_s11
Definition: DK_ChristmasTrees_Perm.h:159
dk_ctp_sow_catch_crop_11
Definition: DK_ChristmasTrees_Perm.h:168
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_ctp_npk2_s6
Definition: DK_ChristmasTrees_Perm.h:120
Crop::m_last_date
int m_last_date
Definition: Farm.h:503
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_ctp_harrow
Definition: DK_ChristmasTrees_Perm.h:77
dk_ctp_calcium_s7_8
Definition: DK_ChristmasTrees_Perm.h:134
DK_ChristmasTrees_Perm::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: DK_ChristmasTrees_Perm.h:197
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_ctp_npk2_p6
Definition: DK_ChristmasTrees_Perm.h:122
dk_ctp_npk_sand_s5
Definition: DK_ChristmasTrees_Perm.h:109
dk_ctp_ferti_sand_s2
Definition: DK_ChristmasTrees_Perm.h:82
fmc_Grazing
Definition: LandscapeFarmingEnums.h:1010
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
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
dk_ctp_depth_plough_autumn
Definition: DK_ChristmasTrees_Perm.h:68
dk_ctp_harrow_autumn
Definition: DK_ChristmasTrees_Perm.h:74
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_ctp_manual_weeding_5
Definition: DK_ChristmasTrees_Perm.h:114
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_ctp_ferti_sand_p3_4
Definition: DK_ChristmasTrees_Perm.h:95
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
dk_ctp_npk2_p9_10
Definition: DK_ChristmasTrees_Perm.h:150
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_ctp_herbicide3_3_4
Definition: DK_ChristmasTrees_Perm.h:102
dk_ctp_manual_cutting_5
Definition: DK_ChristmasTrees_Perm.h:118
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
dk_ctp_calcium_p6
Definition: DK_ChristmasTrees_Perm.h:124
dk_ctp_manual_weeding_9_10
Definition: DK_ChristmasTrees_Perm.h:154
dk_ctp_npk1_p7_8
Definition: DK_ChristmasTrees_Perm.h:135
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
dk_ctp_crush_trees
Definition: DK_ChristmasTrees_Perm.h:75
dk_ctp_ferti_sand_p2
Definition: DK_ChristmasTrees_Perm.h:84
dk_ctp_herbicide2_3_4
Definition: DK_ChristmasTrees_Perm.h:101
dk_ctp_manual_weeding_11
Definition: DK_ChristmasTrees_Perm.h:164
dk_ctp_herbicide1_7_8
Definition: DK_ChristmasTrees_Perm.h:141
dk_ctp_herbicide3_7_8
Definition: DK_ChristmasTrees_Perm.h:143
dk_ctp_sow_catch_crop2
Definition: DK_ChristmasTrees_Perm.h:106
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_ctp_sow_cover_crop_autumn
Definition: DK_ChristmasTrees_Perm.h:71
dk_ctp_herbicide3_2
Definition: DK_ChristmasTrees_Perm.h:88
dk_ctp_manual_weeding_3_4
Definition: DK_ChristmasTrees_Perm.h:99
dk_ctp_herbicide1_6
Definition: DK_ChristmasTrees_Perm.h:128
dk_ctp_sow_inter_crops
Definition: DK_ChristmasTrees_Perm.h:76
WARN_BUG
Definition: MapErrorMsg.h:34
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
dk_ctp_manual_cutting2_7_8
Definition: DK_ChristmasTrees_Perm.h:145
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_ctp_npk1_s7_8
Definition: DK_ChristmasTrees_Perm.h:132
dk_ctp_foobar
Definition: DK_ChristmasTrees_Perm.h:172
dk_ctp_manual_cutting_11
Definition: DK_ChristmasTrees_Perm.h:169