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

DK_OrchardCrop_Perm class
. More...

#include <DK_OrchardCrop_Perm.h>

Inheritance diagram for DK_OrchardCrop_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_OrchardCrop_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_OrchardCrop_Perm class
.

See DK_OrchardCrop_Perm.h::DK_OrchardCrop_PermToDo for a complete list of all possible events triggered codes by the 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_OrchardCrop_Perm()

DK_OrchardCrop_Perm::DK_OrchardCrop_Perm ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
131  : Crop(a_tov, a_toc, a_L)
132  {
133  // When we start it off, the first possible date for a farm operation is ...
134  // This information is used by other crops when they decide how much post processing of
135  // the management is allowed after harvest before the next crop starts.
136  m_first_date = g_date->DayInYear(30, 4);
138  }

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

Member Function Documentation

◆ Do()

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

65 {
66  m_farm = a_farm;
67  m_field = a_field;
68  m_ev = a_ev;
69  bool done = false; // The boolean value done indicates when we are totally finished with this plan (i.e. it is set to true, m_farm, m_field).
70  bool flag = false;
71  int d1 = 0;
72  int noDates = 1;
74  // Depending what event has occured jump to the correct bit of code
75  switch (m_ev->m_todo)
76  {
77  case dk_op_start:
78  {
79  // dk_op_start just sets up all the starting conditions and reference dates that are needed to start a dk_op
80 
82 
83  a_field->ClearManagementActionSum();
84 
85  m_last_date = g_date->DayInYear(31, 12); // Should match the last flexdate below
86  //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
87  std::vector<std::vector<int>> flexdates(1 + 1, std::vector<int>(2, 0));
88  // Set up the date management stuff
89  // Start and stop dates for all events after harvest
90  flexdates[0][1] = g_date->DayInYear(31, 12); // last possible day of cutting orch
91  // Now these are done in pairs, start & end for each operation. If its not used then -1
92  flexdates[1][0] = -1; // This date will be moved back as far as necessary and potentially to flexdates 1 (start op 1)
93  flexdates[1][1] = -1; // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 1)
94 
95  // 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
96  int isSpring = 365;
97  if (StartUpCrop(isSpring, flexdates, int(dk_op_spring_plough))) break;
98 
99  // End single block date checking code. Please see next line comment as well.
100  // Reinit d1 to first possible starting date.
101  // Here we queue up the first event
102  //Each field has assign randomly a DK_oap_YEARS_AFTER_PLANT
103 
104  if (m_ev->m_forcespring) {
105  int day_num_shift = 365;
106  if (g_date->DayInYear() < 70) day_num_shift = 0;
107  if ((DK_OP_YEARS_AFTER_PLANT + g_date->GetYearNumber()) % 1 == 1)
108  {
109  d1 = g_date->OldDays() + g_date->DayInYear(1, 3) + day_num_shift;
110  SimpleEvent(d1, dk_op_spring_plough, false);
111  }
112  else if ((DK_OP_YEARS_AFTER_PLANT + g_date->GetYearNumber()) % 1 == 0)
113  {
114  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + day_num_shift;
115  SimpleEvent(d1, dk_op_sleep_all_day, false);
116  }
117  break;
118  }
119  else
120  if ((DK_OP_YEARS_AFTER_PLANT + g_date->GetYearNumber()) % 1 == 1)
121  {
122  d1 = g_date->OldDays() + g_date->DayInYear(1, 3) + isSpring;
123  SimpleEvent(d1, dk_op_spring_plough, false);
124  }
125  else if ((DK_OP_YEARS_AFTER_PLANT + g_date->GetYearNumber()) % 1 == 0)
126  {
127  d1 = g_date->OldDays() + g_date->DayInYear(1, 1);
128  SimpleEvent(d1, dk_op_sleep_all_day, false);
129  }
130  break;
131  }
132  break;
133 
134  // LKM: This is the first real farm operation
135  case dk_op_spring_plough:
136  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
137  if (!m_farm->SpringPlough(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
139  break;
140  }
141  }
142  SimpleEvent(g_date->Date() + 1, dk_op_manure_s1, false);
143  break;
144 
145  case dk_op_manure_s1:
146  if (a_farm->IsStockFarmer()) {
147  if (!a_farm->FA_Manure(m_field, 0.0, g_date->DayInYear(15, 5) - g_date->DayInYear())) {
148  SimpleEvent(g_date->Date() + 1, dk_op_manure_s1, true);
149  break;
150  }
151  SimpleEvent(g_date->Date() + 1, dk_op_water1, false);
152  break;
153  }
154  SimpleEvent(g_date->Date() + 1, dk_op_manure_p1, false);
155  break;
156 
157  case dk_op_manure_p1:
158  if (!a_farm->FP_Manure(m_field, 0.0, g_date->DayInYear(15, 5) - g_date->DayInYear())) {
159  SimpleEvent(g_date->Date() + 1, dk_op_manure_p1, true);
160  break;
161  }
162  SimpleEvent(g_date->Date() + 1, dk_op_water1, false);
163  break;
164 
165  case dk_op_water1:
166  if (!a_farm->Water(m_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear())) {
167  SimpleEvent(g_date->Date() + 1, dk_op_water1, true);
168  break;
169  }
170  SimpleEvent(g_date->Date() + 1, dk_op_subsoiler, false);
171  break;
172 
173  case dk_op_subsoiler:
174  if (!a_farm->DeepPlough(m_field, 0.0, g_date->DayInYear(25, 5) - g_date->DayInYear())) {
175  SimpleEvent(g_date->Date() + 1, dk_op_subsoiler, true);
176  break;
177  }
178  d1 = g_date->Date();
179  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 4)) {
180  d1 = g_date->OldDays() + g_date->DayInYear(1, 4);
181  }
182  SimpleEvent(d1, dk_op_planting, false);
183  break;
184 
185  case dk_op_planting:
186  if (!a_farm->SpringSow(m_field, 0.0, g_date->DayInYear(30, 5) - g_date->DayInYear())) {
187  SimpleEvent(g_date->Date() + 1, dk_op_planting, true);
188  break;
189  }
190  SimpleEvent(g_date->Date(), dk_op_sow_grass, false); // sow thread
191  SimpleEvent(g_date->Date(), dk_op_manual_cutting5, false); // cutting thread
192  d1 = g_date->Date();
193  if (d1 > g_date->OldDays() + g_date->DayInYear(1, 5)) {
194  d1 = g_date->OldDays() + g_date->DayInYear(1, 5);
195  }
196  SimpleEvent(d1, dk_op_herbicide1, false); // main thread
197  break;
198 
199  case dk_op_sow_grass:
200  if (!a_farm->SpringSow(m_field, 0.0, g_date->DayInYear(30, 5) - g_date->DayInYear())) {
201  SimpleEvent(g_date->Date() + 1, dk_op_sow_grass, true);
202  break;
203  }
204  break; // end of thread
205 
206  case dk_op_herbicide1: // Starane
207  if (!a_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(30, 5) - g_date->DayInYear())) {
208  SimpleEvent(g_date->Date() + 1, dk_op_herbicide1, true);
209  break;
210  }
212  break;
213 
214  case dk_op_herbicide2: // Round Up
215  if (!a_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(30, 6) - g_date->DayInYear())) {
216  SimpleEvent(g_date->Date() + 1, dk_op_herbicide2, true);
217  break;
218  }
220  break;
221 
222  case dk_op_herbicide3: // MCPA
223  if (!a_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(30, 7) - g_date->DayInYear())) {
224  SimpleEvent(g_date->Date() + 1, dk_op_herbicide3, true);
225  break;
226  }
228  break;
229 
230  case dk_op_herbicide4: // Round Up
231  if (!a_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(30, 11) - g_date->DayInYear())) {
232  SimpleEvent(g_date->Date() + 1, dk_op_herbicide4, true);
233  break;
234  }
235  done = true;
236  break; // end of establishment
237 
238  // start of years after planting year:
239  case dk_op_sleep_all_day:
240  if (!a_farm->SleepAllDay(m_field, 0.0, g_date->DayInYear(31, 1) - g_date->DayInYear())) {
242  break;
243  }
245  break;
246 
248  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(31, 1) - g_date->DayInYear())) {
250  break;
251  }
252  SimpleEvent(g_date->Date() + 25, dk_op_manual_cutting2, false); // thread for manual cutting (once a month)
253  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3), dk_op_manure_s2, false); // main thread
254  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3), dk_op_herbicide5, false); // herbicide thread
255  SimpleEvent(g_date->OldDays() + g_date->DayInYear(20, 3), dk_op_copper_s, false); // fertilizer thread
256  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3), dk_op_fungicide1, false); // fungicide1 thread
257  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3), dk_op_fungicide2, false); // fungicide2 thread
258  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4) + m_date_modifier, dk_op_insecticide1, false); // insecticide thread
259  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_op_gr1, false); // growth regulator1 thread
260  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_op_gr3, false); // growth regulator3 thread
261  break;
263  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(28, 2) - g_date->DayInYear())) {
265  break;
266  }
267  SimpleEvent(g_date->Date() + 25, dk_op_manual_cutting3, false);
268  break;
270  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(31, 3) - g_date->DayInYear())) {
272  break;
273  }
274  SimpleEvent(g_date->Date() + 25, dk_op_manual_cutting4, false);
275  break;
277  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
279  break;
280  }
281  SimpleEvent(g_date->Date() + 25, dk_op_manual_cutting5, false);
282  break;
284  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
286  break;
287  }
288  SimpleEvent(g_date->Date() + 25, dk_op_manual_cutting6, false);
289  break;
291  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(30, 6) - g_date->DayInYear())) {
293  break;
294  }
295  SimpleEvent(g_date->Date() + 25, dk_op_manual_cutting7, false);
296  break;
298  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(31, 7) - g_date->DayInYear())) {
300  break;
301  }
302  SimpleEvent(g_date->Date() + 25, dk_op_manual_cutting8, false);
303  break;
305  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(31, 8) - g_date->DayInYear())) {
307  break;
308  }
309  SimpleEvent(g_date->Date() + 25, dk_op_manual_cutting9, false);
310  break;
312  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(30, 9) - g_date->DayInYear())) {
314  break;
315  }
317  break;
319  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
321  break;
322  }
324  break;
326  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(30, 11) - g_date->DayInYear())) {
328  break;
329  }
330  break;
331  // end of cutting thread
332 
333  case dk_op_herbicide5: // Round Up
334  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
335  if (!a_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(31, 3) - g_date->DayInYear())) {
336  SimpleEvent(g_date->Date() + 1, dk_op_herbicide5, true);
337  break;
338  }
339  }
341  break;
342 
343  case dk_op_herbicide6: // Starane
344  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
345  if (!a_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
346  SimpleEvent(g_date->Date() + 1, dk_op_herbicide6, true);
347  break;
348  }
349  }
351  break;
352 
353  case dk_op_herbicide7: // Round Up
354  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
355  if (!a_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(30, 6) - g_date->DayInYear())) {
356  SimpleEvent(g_date->Date() + 1, dk_op_herbicide7, true);
357  break;
358  }
359  }
361  break;
362 
363  case dk_op_herbicide8: // MCPA
364  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
365  if (!a_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(30, 7) - g_date->DayInYear())) {
366  SimpleEvent(g_date->Date() + 1, dk_op_herbicide8, true);
367  break;
368  }
369  }
371  break;
372 
373  case dk_op_herbicide9: //Round Up
374  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
375  if (!a_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(30, 11) - g_date->DayInYear())) {
376  SimpleEvent(g_date->Date() + 1, dk_op_herbicide9, true);
377  break;
378  }
379  }
380  break; // end of thread
381 
382  // fertilizer thread:
383  case dk_op_copper_s:
384  if (a_farm->IsStockFarmer()) {
385  if (m_ev->m_lock || m_farm->DoIt_prob(0.10)) {
386  if (!a_farm->FA_Cu(m_field, 0.0, g_date->DayInYear(31, 3) - g_date->DayInYear())) {
387  SimpleEvent(g_date->Date() + 1, dk_op_copper_s, true);
388  break;
389  }
390  }
392  break;
393  }
394  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(20, 3), dk_op_copper_p, false);
395  break;
396 
397  case dk_op_boron_s:
398  if (m_ev->m_lock || m_farm->DoIt_prob(0.10)) {
399  if (!a_farm->FA_Boron(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
400  SimpleEvent(g_date->Date() + 1, dk_op_boron_s, true);
401  break;
402  }
403  }
404  break;
405 
406  case dk_op_copper_p:
407  if (m_ev->m_lock || m_farm->DoIt_prob(0.10)) {
408  if (!a_farm->FP_Cu(m_field, 0.0, g_date->DayInYear(31, 3) - g_date->DayInYear())) {
409  SimpleEvent(g_date->Date() + 1, dk_op_copper_p, true);
410  break;
411  }
412  }
414  break;
415 
416  case dk_op_boron_p:
417  if (m_ev->m_lock || m_farm->DoIt_prob(0.10)) {
418  if (!a_farm->FP_Boron(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
419  SimpleEvent(g_date->Date() + 1, dk_op_boron_p, true);
420  break;
421  }
422  }
423  break;
424  // end of fertilizer thread
425  // fungi thread:
426  case dk_op_fungicide1: // Scala
427  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
428  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
429  SimpleEvent(g_date->Date() + 1, dk_op_fungicide1, true);
430  break;
431  }
432  }
433  break;
434 
435  case dk_op_fungicide2: // Syllit
436  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
437  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(19, 4) - g_date->DayInYear())) {
438  SimpleEvent(g_date->Date() + 1, dk_op_fungicide2, true);
439  break;
440  }
441  }
442  SimpleEvent(g_date->Date()+10, dk_op_fungicide3, false);
449  break;
450 
451  case dk_op_fungicide3: // Syllit
452  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
453  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
454  SimpleEvent(g_date->Date() + 1, dk_op_fungicide3, true);
455  break;
456  }
457  }
458  break;
459 
460  case dk_op_fungicide4: // Candit
461  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
462  SimpleEvent(g_date->Date() + 1, dk_op_fungicide4, true);
463  break;
464  }
465  break;
466 
467  case dk_op_fungicide5: // Delan WG
468  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(31, 7) - g_date->DayInYear())) {
469  SimpleEvent(g_date->Date() + 1, dk_op_fungicide5, true);
470  break;
471  }
472  SimpleEvent(g_date->Date() + 10, dk_op_fungicide6, false);
473  break;
474 
475  case dk_op_fungicide6: // Delan WG
476  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(10, 8) - g_date->DayInYear())) {
477  SimpleEvent(g_date->Date() + 1, dk_op_fungicide6, true);
478  break;
479  }
480  SimpleEvent(g_date->Date() + 10, dk_op_fungicide7, false);
481  break;
482 
483  case dk_op_fungicide7: // Delan WG
484  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(20, 8) - g_date->DayInYear())) {
485  SimpleEvent(g_date->Date() + 1, dk_op_fungicide7, true);
486  break;
487  }
488  SimpleEvent(g_date->Date() + 10, dk_op_fungicide8, false);
489  break;
490 
491  case dk_op_fungicide8: // Delan WG
492  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(31, 8) - g_date->DayInYear())) {
493  SimpleEvent(g_date->Date() + 1, dk_op_fungicide8, true);
494  break;
495  }
496  break;
497 
498 case dk_op_fungicide9: // Kumulus S
499  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(23, 4) - g_date->DayInYear())) {
500  SimpleEvent(g_date->Date() + 1, dk_op_fungicide9, true);
501  break;
502  }
503  SimpleEvent(g_date->Date() + 7, dk_op_fungicide10, false);
504  break;
505 
506  case dk_op_fungicide10: // Kumulus S
507  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
508  SimpleEvent(g_date->Date() + 1, dk_op_fungicide10, true);
509  break;
510  }
511  break;
512 
513  case dk_op_fungicide11: // Talius
514  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
515  SimpleEvent(g_date->Date() + 1, dk_op_fungicide11, true);
516  break;
517  }
518  break;
519 
520 case dk_op_fungicide12: // Difcor
521  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
522  SimpleEvent(g_date->Date() + 1, dk_op_fungicide12, true);
523  break;
524  }
525  break;
526 
527 case dk_op_fungicide13: // Kumulus S
528  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(23, 8) - g_date->DayInYear())) {
529  SimpleEvent(g_date->Date() + 1, dk_op_fungicide13, true);
530  break;
531  }
532  SimpleEvent(g_date->Date() + 7, dk_op_fungicide14, false);
533  break;
534 
535  case dk_op_fungicide14: // Kumulus S
536  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(31, 8) - g_date->DayInYear())) {
537  SimpleEvent(g_date->Date() + 1, dk_op_fungicide14, true);
538  break;
539  }
540  break;
541  // end of fungis threads
542 
543  case dk_op_insecticide1: // Teppeki/Mospilan
544  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
545  // here we check whether we are using ERA pesticide or not
546  d1 = g_date->DayInYear(29, 4) - g_date->DayInYear();
547  if (!cfg_pest_orchard_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
548  {
549  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
550  }
551  else {
552  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 1);
553  }
554  if (!flag) {
555  SimpleEvent(g_date->Date() + 1, dk_op_insecticide1, true);
556  break;
557  }
558  }
562  break;
563 
564  case dk_op_insecticide2: // Lamdex
565  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
566  // here we check whether we are using ERA pesticide or not
567  d1 = g_date->DayInYear(30, 4) - g_date->DayInYear();
568  if (!cfg_pest_orchard_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
569  {
570  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
571  }
572  else {
573  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 1);
574  }
575  if (!flag) {
576  SimpleEvent(g_date->Date() + 1, dk_op_insecticide2, true);
577  break;
578  }
579  }
580  break;
581 
582  case dk_op_insecticide3: // Mospilan
583  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
584  // here we check whether we are using ERA pesticide or not
585  d1 = g_date->DayInYear(31, 5) - g_date->DayInYear();
586  if (!cfg_pest_orchard_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
587  {
588  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
589  }
590  else {
591  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 1);
592  }
593  if (!flag) {
594  SimpleEvent(g_date->Date() + 1, dk_op_insecticide3, true);
595  break;
596  }
597 
598  }
599  break;
600 
601  case dk_op_insecticide4: // Steward
602  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
603  // here we check whether we are using ERA pesticide or not
604  d1 = g_date->DayInYear(31, 5) - g_date->DayInYear();
605  if (!cfg_pest_orchard_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
606  {
607  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
608  }
609  else {
610  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 1);
611  }
612  if (!flag) {
613  SimpleEvent(g_date->Date() + 1, dk_op_insecticide4, true);
614  break;
615  }
616 
617  }
621  break;
622 
623  case dk_op_insecticide5: // Madex Top
624  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
625  // here we check whether we are using ERA pesticide or not
626  d1 = g_date->DayInYear(10, 8) - g_date->DayInYear();
627  if (!cfg_pest_orchard_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
628  {
629  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
630  }
631  else {
632  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 1);
633  }
634  if (!flag) {
635  SimpleEvent(g_date->Date() + 1, dk_op_insecticide5, true);
636  break;
637  }
638  }
639  SimpleEvent(g_date->Date()+10, dk_op_insecticide6, false);
640  break;
641 
642  case dk_op_insecticide6: // Madex Top
643  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
644  // here we check whether we are using ERA pesticide or not
645  d1 = g_date->DayInYear(20, 8) - g_date->DayInYear();
646  if (!cfg_pest_orchard_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
647  {
648  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
649  }
650  else {
651  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 1);
652  }
653  if (!flag) {
654  SimpleEvent(g_date->Date() + 1, dk_op_insecticide6, true);
655  break;
656  }
657  }
658  SimpleEvent(g_date->Date() + 10, dk_op_insecticide7, false);
659  break;
660 
661  case dk_op_insecticide7: // Madex Top
662  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
663  // here we check whether we are using ERA pesticide or not
664  d1 = g_date->DayInYear(31, 8) - g_date->DayInYear();
665  if (!cfg_pest_orchard_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
666  {
667  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
668  }
669  else {
670  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 1);
671  }
672  if (!flag) {
673  SimpleEvent(g_date->Date() + 1, dk_op_insecticide7, true);
674  break;
675  }
676  }
677  break;
678 
679 
680  case dk_op_insecticide8: // Teppeki
681  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
682  // here we check whether we are using ERA pesticide or not
683  d1 = g_date->DayInYear(31, 8) - g_date->DayInYear();
684  if (!cfg_pest_orchard_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
685  {
686  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
687  }
688  else {
689  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 1);
690  }
691  if (!flag) {
692  SimpleEvent(g_date->Date() + 1, dk_op_insecticide8, true);
693  break;
694  }
695  }
696  break;
697 
698  case dk_op_insecticide9: // Signum
699  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
700  // here we check whether we are using ERA pesticide or not
701  d1 = g_date->DayInYear(2, 9) - g_date->DayInYear();
702  if (!cfg_pest_orchard_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
703  {
704  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
705  }
706  else {
707  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 1);
708  }
709  if (!flag) {
710  SimpleEvent(g_date->Date() + 1, dk_op_insecticide9, true);
711  break;
712  }
713  }
714  SimpleEvent(g_date->Date() + 10, dk_op_insecticide10, false);
715  break;
716 
717  case dk_op_insecticide10: // Signum
718  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
719  // here we check whether we are using ERA pesticide or not
720  d1 = g_date->DayInYear(12, 9) - g_date->DayInYear();
721  if (!cfg_pest_orchard_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
722  {
723  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
724  }
725  else {
726  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 1);
727  }
728  if (!flag) {
730  break;
731  }
732  }
733  break; // end of insectis threads
734 
735  //GR threads
736  case dk_op_gr1: // Cerone
737  if (!a_farm->GrowthRegulator(m_field, 0.0, g_date->DayInYear(20, 8) - g_date->DayInYear())) {
738  SimpleEvent(g_date->Date() + 1, dk_op_gr1, true);
739  break;
740  }
741  SimpleEvent(g_date->Date()+7, dk_op_gr2, false);
742  break;
743 
744  case dk_op_gr2: // Cerone
745  if (!a_farm->GrowthRegulator(m_field, 0.0, g_date->DayInYear(31, 8) - g_date->DayInYear())) {
746  SimpleEvent(g_date->Date() + 1, dk_op_gr2, true);
747  break;
748  }
749  break;
750 
751  case dk_op_gr3: // Regalis plus
752  if (!a_farm->GrowthRegulator(m_field, 0.0, g_date->DayInYear(7, 5) - g_date->DayInYear())) {
753  SimpleEvent(g_date->Date() + 1, dk_op_gr3, true);
754  break;
755  }
756  SimpleEvent(g_date->Date() + 21, dk_op_gr4, false);
757  break;
758 
759  case dk_op_gr4: // Regalis Plus
760  if (!a_farm->GrowthRegulator(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
761  SimpleEvent(g_date->Date() + 1, dk_op_gr4, true);
762  break;
763  }
764  break;
765  // end of GRs threads
766 
767  case dk_op_manure_s2:
768  if (a_farm->IsStockFarmer()) {
769  if (!a_farm->FA_Manure(m_field, 0.0, g_date->DayInYear(1, 4) - g_date->DayInYear())) {
770  SimpleEvent(g_date->Date() + 1, dk_op_manure_s2, true);
771  break;
772  }
773  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_op_row_cultivation1, false); //row cultivation thread
774  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_op_water2, false); // water thread
775  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5), dk_op_cutting1, false); // cutting grass thread
776  SimpleEvent(g_date->OldDays() + g_date->DayInYear(15, 6), dk_op_remove_fruits, false); // main thread
777  break;
778  }
779  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3), dk_op_manure_p2, false);
780  break;
781 
782  case dk_op_manure_p2:
783  if (!a_farm->FP_Manure(m_field, 0.0, g_date->DayInYear(1, 4) - g_date->DayInYear())) {
784  SimpleEvent(g_date->Date() + 1, dk_op_manure_s2, true);
785  break;
786  }
787  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_op_row_cultivation1, false); //row cultivation thread
788  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_op_water2, false); // water thread
789  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5), dk_op_cutting1, false); // cutting grass thread
790  SimpleEvent(g_date->OldDays() + g_date->DayInYear(15, 6), dk_op_remove_fruits, false); // main thread
791  break;
792 
794  if (m_ev->m_lock || m_farm->DoIt_prob(0.10)) { // suggestion - not so often in conv. orchards
795  if (!a_farm->RowCultivation(m_field, 0.0, g_date->DayInYear(31, 7) - g_date->DayInYear())) {
797  break;
798  }
799  }
801  break;
802 
804  if (m_ev->m_lock || m_farm->DoIt_prob(0.10)) { // suggestion - not so often in conv. orchards
805  if (!a_farm->RowCultivation(m_field, 0.0, g_date->DayInYear(30, 11) - g_date->DayInYear())) {
807  break;
808  }
809  }
810  break;
811  // end of thread
812 
813  //Here comes water thread:
814  case dk_op_water2:
815  if (!a_farm->Water(m_field, 0.0, g_date->DayInYear(1, 5) - g_date->DayInYear())) {
816  SimpleEvent(g_date->Date() + 1, dk_op_water2, true);
817  break;
818  }
819  SimpleEvent(g_date->Date() + 25, dk_op_water3, false);
820  break;
821  case dk_op_water3:
822  if (!a_farm->Water(m_field, 0.0, g_date->DayInYear(1, 6) - g_date->DayInYear())) {
823  SimpleEvent(g_date->Date() + 1, dk_op_water3, true);
824  break;
825  }
826  SimpleEvent(g_date->Date() + 25, dk_op_water4, false);
827  break;
828  case dk_op_water4:
829  if (!a_farm->Water(m_field, 0.0, g_date->DayInYear(1, 7) - g_date->DayInYear())) {
830  SimpleEvent(g_date->Date() + 1, dk_op_water4, true);
831  break;
832  }
833  SimpleEvent(g_date->Date() + 25, dk_op_water5, false);
834  break;
835  case dk_op_water5:
836  if (!a_farm->Water(m_field, 0.0, g_date->DayInYear(1, 8) - g_date->DayInYear())) {
837  SimpleEvent(g_date->Date() + 1, dk_op_water5, true);
838  break;
839  }
840  SimpleEvent(g_date->Date() + 25, dk_op_water6, false);
841  break;
842  case dk_op_water6:
843  if (!a_farm->Water(m_field, 0.0, g_date->DayInYear(1, 9) - g_date->DayInYear())) {
844  SimpleEvent(g_date->Date() + 1, dk_op_water6, true);
845  break;
846  }
847  SimpleEvent(g_date->Date() + 25, dk_op_water7, false);
848  break;
849  case dk_op_water7:
850  if (!a_farm->Water(m_field, 0.0, g_date->DayInYear(1, 10) - g_date->DayInYear())) {
851  SimpleEvent(g_date->Date() + 1, dk_op_water7, true);
852  break;
853  }
854  break;
855  // end of thread
856  // cutting grass thread:
857  //Here comes water thread:
858  case dk_op_cutting1:
859  if (!a_farm->CutOrch(m_field, 0.0, g_date->DayInYear(1, 6) - g_date->DayInYear())) {
860  SimpleEvent(g_date->Date() + 1, dk_op_cutting1, true);
861  break;
862  }
863  SimpleEvent(g_date->Date() + 25, dk_op_cutting2, false);
864  break;
865  case dk_op_cutting2:
866  if (!a_farm->CutOrch(m_field, 0.0, g_date->DayInYear(1, 7) - g_date->DayInYear())) {
867  SimpleEvent(g_date->Date() + 1, dk_op_cutting2, true);
868  break;
869  }
870  SimpleEvent(g_date->Date() + 25, dk_op_cutting3, false);
871  break;
872  case dk_op_cutting3:
873  if (!a_farm->CutOrch(m_field, 0.0, g_date->DayInYear(1, 8) - g_date->DayInYear())) {
874  SimpleEvent(g_date->Date() + 1, dk_op_cutting3, true);
875  break;
876  }
877  SimpleEvent(g_date->Date() + 25, dk_op_cutting4, false);
878  break;
879  case dk_op_cutting4:
880  if (!a_farm->CutOrch(m_field, 0.0, g_date->DayInYear(1, 9) - g_date->DayInYear())) {
881  SimpleEvent(g_date->Date() + 1, dk_op_cutting4, true);
882  break;
883  }
884  SimpleEvent(g_date->Date() + 25, dk_op_cutting5, false);
885  break;
886  case dk_op_cutting5:
887  if (!a_farm->CutOrch(m_field, 0.0, g_date->DayInYear(1, 10) - g_date->DayInYear())) {
888  SimpleEvent(g_date->Date() + 1, dk_op_cutting5, true);
889  break;
890  }
891  SimpleEvent(g_date->Date() + 25, dk_op_cutting6, false);
892  break;
893  case dk_op_cutting6:
894  if (!a_farm->CutOrch(m_field, 0.0, g_date->DayInYear(1, 11) - g_date->DayInYear())) {
895  SimpleEvent(g_date->Date() + 1, dk_op_cutting6, true);
896  break;
897  }
898  break;
899  // end of thread
900 
901  case dk_op_remove_fruits:
902  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(31, 8) - g_date->DayInYear())) {
904  break;
905  }
907  break;
908  case dk_op_harvest:
909  if (!a_farm->FruitHarvest(m_field, 0.0, g_date->DayInYear(1, 11) - g_date->DayInYear())) {
910  SimpleEvent(g_date->Date() + 1, dk_op_harvest, true);
911  break;
912  }
914  break;
916  if (!a_farm->Pruning(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
918  break;
919  }
920  done = true;
921  break;
922  // So we are done, and somewhere else the farmer will queue up the start event of the next crop (DK_OrchardCrop_Perm)
923  // END of MAIN THREAD
924  break;
925  default:
926  g_msg->Warn(WARN_BUG, "DK_OrchardCrop_Perm::Do(): "
927  "Unknown event type! ", "");
928  exit(1);
929  }
930  if (done) m_ev->m_forcespring = true; // Here we need to force the next crop to spring operation, so set the ev->forcespring to true
931  return done;
932 }

References cfg_pest_orchard_on, cfg_pest_product_amounts, LE::ClearManagementActionSum(), Farm::CutOrch(), Calendar::Date(), Calendar::DayInYear(), Farm::DeepPlough(), dk_op_boron_p, dk_op_boron_s, dk_op_copper_p, dk_op_copper_s, dk_op_cutting1, dk_op_cutting2, dk_op_cutting3, dk_op_cutting4, dk_op_cutting5, dk_op_cutting6, dk_op_fungicide1, dk_op_fungicide10, dk_op_fungicide11, dk_op_fungicide12, dk_op_fungicide13, dk_op_fungicide14, dk_op_fungicide2, dk_op_fungicide3, dk_op_fungicide4, dk_op_fungicide5, dk_op_fungicide6, dk_op_fungicide7, dk_op_fungicide8, dk_op_fungicide9, dk_op_gr1, dk_op_gr2, dk_op_gr3, dk_op_gr4, dk_op_harvest, dk_op_herbicide1, dk_op_herbicide2, dk_op_herbicide3, dk_op_herbicide4, dk_op_herbicide5, dk_op_herbicide6, dk_op_herbicide7, dk_op_herbicide8, dk_op_herbicide9, dk_op_insecticide1, dk_op_insecticide10, dk_op_insecticide2, dk_op_insecticide3, dk_op_insecticide4, dk_op_insecticide5, dk_op_insecticide6, dk_op_insecticide7, dk_op_insecticide8, dk_op_insecticide9, dk_op_manual_cutting1, dk_op_manual_cutting10, dk_op_manual_cutting11, dk_op_manual_cutting12, dk_op_manual_cutting2, dk_op_manual_cutting3, dk_op_manual_cutting4, dk_op_manual_cutting5, dk_op_manual_cutting6, dk_op_manual_cutting7, dk_op_manual_cutting8, dk_op_manual_cutting9, dk_op_manure_p1, dk_op_manure_p2, dk_op_manure_s1, dk_op_manure_s2, dk_op_planting, dk_op_remove_fruits, dk_op_row_cultivation1, dk_op_row_cultivation2, dk_op_sleep_all_day, dk_op_sow_grass, dk_op_spring_plough, dk_op_start, dk_op_subsoiler, dk_op_water1, dk_op_water2, dk_op_water3, dk_op_water4, dk_op_water5, dk_op_water6, dk_op_water7, DK_OP_YEARS_AFTER_PLANT, Farm::DoIt_prob(), Farm::FA_Boron(), Farm::FA_Cu(), Farm::FA_Manure(), Farm::FP_Boron(), Farm::FP_Cu(), Farm::FP_Manure(), Farm::FruitHarvest(), Farm::FungicideTreat(), g_date, g_msg, LE::GetMDates(), Calendar::GetYearNumber(), Farm::GrowthRegulator(), Farm::HerbicideTreat(), Farm::InsecticideTreat(), Farm::IsStockFarmer(), Crop::m_date_modifier, Crop::m_ev, Crop::m_farm, Crop::m_field, FarmEvent::m_forcespring, Crop::m_last_date, FarmEvent::m_lock, FarmEvent::m_todo, Calendar::OldDays(), ppp_1, Farm::ProductApplication(), Farm::Pruning(), Farm::RowCultivation(), Crop::SimpleEvent(), Farm::SleepAllDay(), Farm::SpringPlough(), Farm::SpringSow(), Crop::StartUpCrop(), tov_DKOrchardCrop_Perm, CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), WARN_BUG, and Farm::Water().

◆ SetUpFarmCategoryInformation()

void DK_OrchardCrop_Perm::SetUpFarmCategoryInformation ( )
inline
139  {
140  const int elements = 2 + (dk_op_foobar - DK_OP_BASE);
142 
143  FarmManagementCategory catlist[elements] =
144  {
145  fmc_Others, // zero element unused but must be here
146  fmc_Others, // dk_op_start = 1, // Compulsory, must always be 1 (one).
147  fmc_Others, // dk_op_sleep_all_day = DK_op_BASE,
148  fmc_Cultivation, //dk_op_spring_plough,
149  fmc_Fertilizer, //dk_op_manure_s1,
150  fmc_Fertilizer, //dk_op_manure_p1,
151  fmc_Watering, //dk_op_water1,
152  fmc_Cultivation, //dk_op_subsoiler,
153  fmc_Others, //dk_op_planting,
154  fmc_Others, //dk_op_sow_grass,
155  fmc_Insecticide, //dk_op_insecticide1,
156  fmc_Insecticide, //dk_op_insecticide2,
157  fmc_Insecticide, //dk_op_insecticide3,
158  fmc_Insecticide, //dk_op_insecticide4,
159  fmc_Insecticide, //dk_op_insecticide5,
160  fmc_Insecticide, //dk_op_insecticide6,
161  fmc_Insecticide, //dk_op_insecticide7,
162  fmc_Insecticide, //dk_op_insecticide8,
163  fmc_Insecticide, //dk_op_insecticide9,
164  fmc_Insecticide, //dk_op_insecticide10,
165  fmc_Herbicide, //dk_op_herbicide1
166  fmc_Herbicide, //dk_op_herbicide2
167  fmc_Cutting, //dk_op_manual_cutting1,
168  fmc_Cutting, //dk_op_manual_cutting2,
169  fmc_Cutting, //dk_op_manual_cutting3,
170  fmc_Cutting, //dk_op_manual_cutting4,
171  fmc_Cutting, //dk_op_manual_cutting5,
172  fmc_Cutting, //dk_op_manual_cutting6,
173  fmc_Cutting, //dk_op_manual_cutting7,
174  fmc_Cutting, //dk_op_manual_cutting8,
175  fmc_Cutting, //dk_op_manual_cutting9,
176  fmc_Cutting, //dk_op_manual_cutting10,
177  fmc_Cutting, //dk_op_manual_cutting11,
178  fmc_Cutting, //dk_op_manual_cutting12,
179  fmc_Cutting, //dk_op_manure_s2,
180  fmc_Cutting, //dk_op_manure_p2,
181  fmc_Cultivation, //dk_op_row_cultivation1,
182  fmc_Watering, //dk_op_water2,
183  fmc_Watering, //dk_op_water3,
184  fmc_Watering, //dk_op_water4,
185  fmc_Watering, //dk_op_water5,
186  fmc_Watering, //dk_op_water6,
187  fmc_Watering, //dk_op_water7,
188  fmc_Cutting, //dk_op_cutting1,
189  fmc_Cutting, //dk_op_cutting2,
190  fmc_Cutting, //dk_op_cutting3,
191  fmc_Cutting, //dk_op_cutting4,
192  fmc_Cutting, //dk_op_cutting5,
193  fmc_Cutting, //dk_op_cutting6,
194  fmc_Cultivation, //dk_op_row_cultivation2,
195  fmc_Fertilizer, //dk_op_coppper_s,
196  fmc_Fertilizer, //dk_op_coppper_p,
197  fmc_Fungicide, //dk_op_fungicide1,
198  fmc_Fertilizer, //dk_op_boron_s,
199  fmc_Fertilizer, //dk_op_boron_p,
200  fmc_Fungicide, //dk_op_fungicide2,
201  fmc_Herbicide, //dk_op_herbicide3
202  fmc_Herbicide, //dk_op_herbicide4
203  fmc_Herbicide, //dk_op_herbicide5
204  fmc_Herbicide, //dk_op_herbicide6
205  fmc_Herbicide, //dk_op_herbicide7
206  fmc_Herbicide, //dk_op_herbicide8
207  fmc_Herbicide, //dk_op_herbicide9
208  fmc_Cutting, //dk_op_remove_fruits,
209  fmc_Fungicide, //dk_op_fungicide3,
210  fmc_Fungicide, //dk_op_fungicide4,
211  fmc_Fungicide, //dk_op_fungicide5,
212  fmc_Fungicide, //dk_op_fungicide6,
213  fmc_Fungicide, //dk_op_fungicide7,
214  fmc_Fungicide, //dk_op_fungicide8,
215  fmc_Fungicide, //dk_op_fungicide9,
216  fmc_Fungicide, //dk_op_fungicide10,
217  fmc_Fungicide, //dk_op_fungicide11,
218  fmc_Fungicide, //dk_op_fungicide12,
219  fmc_Fungicide, //dk_op_fungicide13,
220  fmc_Fungicide, //dk_op_fungicide14,
221  fmc_Others, // de_op_gr1
222  fmc_Others, // de_op_gr3
223  fmc_Others, // de_op_gr2
224  fmc_Others, // de_op_gr4
225  fmc_Harvest, //dk_op_harvest,
226 
227  // no foobar entry
228 
229  };
230  // Iterate over the catlist elements and copy them to vector
231  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
232 
233  }

References DK_OP_BASE, dk_op_foobar, fmc_Cultivation, fmc_Cutting, fmc_Fertilizer, fmc_Fungicide, fmc_Harvest, fmc_Herbicide, fmc_Insecticide, fmc_Others, fmc_Watering, Crop::m_base_elements_no, and Crop::m_ManagementCategories.

Referenced by DK_OrchardCrop_Perm().


The documentation for this class was generated from the following files:
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
dk_op_water7
Definition: DK_OrchardCrop_Perm.h:77
cfg_pest_product_amounts
CfgArray_Double cfg_pest_product_amounts
Amount of pesticide applied in grams of active substance per hectare for each of the 10 pesticides.
FarmEvent::m_forcespring
bool m_forcespring
Definition: Farm.h:392
dk_op_fungicide10
Definition: DK_OrchardCrop_Perm.h:106
dk_op_fungicide12
Definition: DK_OrchardCrop_Perm.h:108
dk_op_fungicide4
Definition: DK_OrchardCrop_Perm.h:100
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
dk_op_insecticide2
Definition: DK_OrchardCrop_Perm.h:46
DK_OP_BASE
#define DK_OP_BASE
Definition: DK_OrchardCrop_Perm.h:25
cfg_pest_orchard_on
CfgBool cfg_pest_orchard_on
Turn on pesticides for orchard.
dk_op_start
Definition: DK_OrchardCrop_Perm.h:36
Farm::SpringPlough
virtual bool SpringPlough(LE *a_field, double a_user, int a_days)
Carry out a ploughing event in the spring on a_field.
Definition: FarmFuncs.cpp:421
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_op_manual_cutting6
Definition: DK_OrchardCrop_Perm.h:62
dk_op_insecticide4
Definition: DK_OrchardCrop_Perm.h:48
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
dk_op_manual_cutting2
Definition: DK_OrchardCrop_Perm.h:58
Farm::ProductApplication
virtual bool ProductApplication(LE *a_field, double a_user, int a_days, double a_applicationrate, PlantProtectionProducts a_ppp, bool a_isgranularpesticide=false, int a_orcharddrifttype=0)
Apply test pesticide to a_field.
Definition: FarmFuncs.cpp:2267
dk_op_gr4
Definition: DK_OrchardCrop_Perm.h:114
dk_op_water4
Definition: DK_OrchardCrop_Perm.h:74
LE::ClearManagementActionSum
void ClearManagementActionSum()
clears the management action counters
Definition: Elements.h:247
dk_op_insecticide1
Definition: DK_OrchardCrop_Perm.h:45
Calendar::GetYearNumber
int GetYearNumber(void)
Definition: Calendar.h:72
dk_op_cutting4
Definition: DK_OrchardCrop_Perm.h:81
dk_op_insecticide8
Definition: DK_OrchardCrop_Perm.h:52
Farm::FP_Cu
virtual bool FP_Cu(LE *a_field, double a_user, int a_days)
Apply Cu fertilizer, on a_field owned by plant farmer (orchard)
Definition: FarmFuncs.cpp:1974
Farm::DoIt_prob
bool DoIt_prob(double a_probability)
Return chance out of 0 to 1.
Definition: Farm.cpp:864
dk_op_water6
Definition: DK_OrchardCrop_Perm.h:76
dk_op_herbicide6
Definition: DK_OrchardCrop_Perm.h:94
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
dk_op_cutting3
Definition: DK_OrchardCrop_Perm.h:80
dk_op_fungicide13
Definition: DK_OrchardCrop_Perm.h:109
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
dk_op_boron_s
Definition: DK_OrchardCrop_Perm.h:88
dk_op_sow_grass
Definition: DK_OrchardCrop_Perm.h:44
dk_op_insecticide5
Definition: DK_OrchardCrop_Perm.h:49
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
DK_OrchardCrop_Perm::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: DK_OrchardCrop_Perm.h:139
dk_op_insecticide10
Definition: DK_OrchardCrop_Perm.h:54
dk_op_insecticide6
Definition: DK_OrchardCrop_Perm.h:50
Farm::SpringSow
virtual bool SpringSow(LE *a_field, double a_user, int a_days, double a_seed_coating_amount=-1, PlantProtectionProducts a_ppp=ppp_foobar)
Carry out a sowing event in the spring on a_field.
Definition: FarmFuncs.cpp:501
dk_op_fungicide5
Definition: DK_OrchardCrop_Perm.h:101
dk_op_fungicide14
Definition: DK_OrchardCrop_Perm.h:110
dk_op_gr1
Definition: DK_OrchardCrop_Perm.h:111
dk_op_fungicide2
Definition: DK_OrchardCrop_Perm.h:90
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
dk_op_remove_fruits
Definition: DK_OrchardCrop_Perm.h:98
dk_op_water3
Definition: DK_OrchardCrop_Perm.h:73
dk_op_herbicide1
Definition: DK_OrchardCrop_Perm.h:55
dk_op_foobar
Definition: DK_OrchardCrop_Perm.h:116
dk_op_herbicide7
Definition: DK_OrchardCrop_Perm.h:95
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
dk_op_cutting1
Definition: DK_OrchardCrop_Perm.h:78
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
dk_op_copper_p
Definition: DK_OrchardCrop_Perm.h:86
dk_op_fungicide1
Definition: DK_OrchardCrop_Perm.h:87
dk_op_manual_cutting8
Definition: DK_OrchardCrop_Perm.h:64
dk_op_manual_cutting4
Definition: DK_OrchardCrop_Perm.h:60
dk_op_water2
Definition: DK_OrchardCrop_Perm.h:72
dk_op_row_cultivation1
Definition: DK_OrchardCrop_Perm.h:71
dk_op_manure_s2
Definition: DK_OrchardCrop_Perm.h:69
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_op_herbicide5
Definition: DK_OrchardCrop_Perm.h:93
CfgBool::value
bool value() const
Definition: Configurator.h:164
dk_op_manual_cutting5
Definition: DK_OrchardCrop_Perm.h:61
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_op_manual_cutting10
Definition: DK_OrchardCrop_Perm.h:66
dk_op_spring_plough
Definition: DK_OrchardCrop_Perm.h:38
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
dk_op_manual_cutting9
Definition: DK_OrchardCrop_Perm.h:65
Calendar::Date
long Date(void)
Definition: Calendar.h:57
dk_op_copper_s
Definition: DK_OrchardCrop_Perm.h:85
dk_op_fungicide11
Definition: DK_OrchardCrop_Perm.h:107
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
dk_op_cutting2
Definition: DK_OrchardCrop_Perm.h:79
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
dk_op_fungicide6
Definition: DK_OrchardCrop_Perm.h:102
dk_op_water5
Definition: DK_OrchardCrop_Perm.h:75
fmc_Watering
Definition: LandscapeFarmingEnums.h:1011
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
dk_op_insecticide7
Definition: DK_OrchardCrop_Perm.h:51
dk_op_boron_p
Definition: DK_OrchardCrop_Perm.h:89
dk_op_sleep_all_day
Definition: DK_OrchardCrop_Perm.h:37
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
Farm::FA_Boron
virtual bool FA_Boron(LE *a_field, double a_user, int a_days)
Apply soluble Boron to a_field owned by a stock farmer.
Definition: FarmFuncs.cpp:868
dk_op_subsoiler
Definition: DK_OrchardCrop_Perm.h:42
Farm::CutOrch
virtual bool CutOrch(LE *a_field, double a_user, int a_days)
Cut vegetation on orchard crop. //based on cut to silage - values from cutting function of orchard.
Definition: FarmFuncs.cpp:1666
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
Farm::FP_Boron
virtual bool FP_Boron(LE *a_field, double a_user, int a_days)
Apply soluble Boron to a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:854
dk_op_water1
Definition: DK_OrchardCrop_Perm.h:41
dk_op_herbicide2
Definition: DK_OrchardCrop_Perm.h:56
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
dk_op_fungicide7
Definition: DK_OrchardCrop_Perm.h:103
Crop::m_ManagementCategories
vector< FarmManagementCategory > m_ManagementCategories
Holds the translation between the farm operation enum for each crop and the farm management category ...
Definition: Farm.h:530
CfgArray_Double::value
std::vector< double > value() const
Definition: Configurator.h:219
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
Farm::InsecticideTreat
virtual bool InsecticideTreat(LE *a_field, double a_user, int a_days)
Apply insecticide to a_field.
Definition: FarmFuncs.cpp:2135
dk_op_manual_cutting11
Definition: DK_OrchardCrop_Perm.h:67
dk_op_cutting6
Definition: DK_OrchardCrop_Perm.h:83
dk_op_manual_cutting3
Definition: DK_OrchardCrop_Perm.h:59
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
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_op_herbicide8
Definition: DK_OrchardCrop_Perm.h:96
dk_op_fungicide8
Definition: DK_OrchardCrop_Perm.h:104
Farm::Water
virtual bool Water(LE *a_field, double a_user, int a_days)
Carry out a watering on a_field.
Definition: FarmFuncs.cpp:1330
Crop::m_last_date
int m_last_date
Definition: Farm.h:503
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
dk_op_herbicide3
Definition: DK_OrchardCrop_Perm.h:91
DK_OP_YEARS_AFTER_PLANT
#define DK_OP_YEARS_AFTER_PLANT
Definition: DK_OrchardCrop_Perm.h:23
dk_op_fungicide9
Definition: DK_OrchardCrop_Perm.h:105
dk_op_harvest
Definition: DK_OrchardCrop_Perm.h:115
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
tov_DKOrchardCrop_Perm
Definition: LandscapeFarmingEnums.h:459
dk_op_manual_cutting1
Definition: DK_OrchardCrop_Perm.h:57
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
Crop::m_date_modifier
static int m_date_modifier
Holds a value that shifts test pesticide use by this many days in crops modified to use it.
Definition: Farm.h:514
dk_op_gr3
Definition: DK_OrchardCrop_Perm.h:113
dk_op_row_cultivation2
Definition: DK_OrchardCrop_Perm.h:84
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
Farm::FruitHarvest
virtual bool FruitHarvest(LE *a_field, double a_user, int a_days)
FruitHarvest (harvest of the mature fruits, e.g., grapes) applied on a_field.
Definition: FarmFuncs.cpp:1959
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_op_manual_cutting12
Definition: DK_OrchardCrop_Perm.h:68
Farm::GrowthRegulator
virtual bool GrowthRegulator(LE *a_field, double a_user, int a_days)
Apply growth regulator to a_field.
Definition: FarmFuncs.cpp:2070
dk_op_gr2
Definition: DK_OrchardCrop_Perm.h:112
dk_op_manure_p2
Definition: DK_OrchardCrop_Perm.h:70
dk_op_manure_p1
Definition: DK_OrchardCrop_Perm.h:40
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
Farm::FA_Cu
virtual bool FA_Cu(LE *a_field, double a_user, int a_days)
Apply Cu fertilizer, on a_field owned by stock farmer (orchard)
Definition: FarmFuncs.cpp:1988
dk_op_herbicide9
Definition: DK_OrchardCrop_Perm.h:97
dk_op_fungicide3
Definition: DK_OrchardCrop_Perm.h:99
dk_op_insecticide9
Definition: DK_OrchardCrop_Perm.h:53
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
dk_op_cutting5
Definition: DK_OrchardCrop_Perm.h:82
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
dk_op_insecticide3
Definition: DK_OrchardCrop_Perm.h:47
dk_op_herbicide4
Definition: DK_OrchardCrop_Perm.h:92
dk_op_manure_s1
Definition: DK_OrchardCrop_Perm.h:39
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
dk_op_planting
Definition: DK_OrchardCrop_Perm.h:43
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
dk_op_manual_cutting7
Definition: DK_OrchardCrop_Perm.h:63