File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/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_OrchCherry Class Reference

DK_OrchCherry class
. More...

#include <DK_OrchCherry.h>

Inheritance diagram for DK_OrchCherry:
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_OrchCherry (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_OrchCherry class
.

See DK_OrchCherry.h::DK_OrchCherryToDo 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_OrchCherry()

DK_OrchCherry::DK_OrchCherry ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
125  : Crop(a_tov, a_toc, a_L)
126  {
127  // When we start it off, the first possible date for a farm operation is ...
128  // This information is used by other crops when they decide how much post processing of
129  // the management is allowed after harvest before the next crop starts.
130  m_first_date=g_date->DayInYear( 31,1 );
132  }

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

Member Function Documentation

◆ Do()

bool DK_OrchCherry::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_och_start:
78  {
79  // dk_och_start just sets up all the starting conditions and reference dates that are needed to start a dk_och
80 
82  DK_OCH_YEARS_HARVEST = false;
83  DK_OCH_EST_YEAR = false;
84 
85  a_field->ClearManagementActionSum();
86 
87  m_last_date = g_date->DayInYear(31, 12); // Should match the last flexdate below
88  //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
89  std::vector<std::vector<int>> flexdates(1 + 1, std::vector<int>(2, 0));
90  // Set up the date management stuff
91  // Start and stop dates for all events after harvest
92  flexdates[0][1] = g_date->DayInYear(31, 12); // last possible day of cutting orch
93  // Now these are done in pairs, start & end for each operation. If its not used then -1
94  flexdates[1][0] = -1; // This date will be moved back as far as necessary and potentially to flexdates 1 (start op 1)
95  flexdates[1][1] = -1; // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 1)
96 
97  // 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
98  if (StartUpCrop(365, flexdates, int(dk_och_wait))) break;
99 
100  // End single block date checking code. Please see next line comment as well.
101  // Reinit d1 to first possible starting date.
102  // Here we queue up the first event
103  //Each field has assign randomly a DK_och_YEARS_AFTER_PLANT
104 
105  if ((DK_OCH_YEARS_AFTER_PLANT + g_date->GetYearNumber()) % 10 == 0)
106  {
107  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
108  SimpleEvent(d1, dk_och_wait, false);
109  }
110  else if ((DK_OCH_YEARS_AFTER_PLANT + g_date->GetYearNumber()) % 10 == 1)
111  {
112  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
114  }
115  else if ((DK_OCH_YEARS_AFTER_PLANT + g_date->GetYearNumber()) % 10 == 2)
116  {
117  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
119  }
120  else
121  {
122  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + 365;
123  SimpleEvent(d1, dk_och_sleep_all_day, false);
124  }
125  break;
126 
127  }
128  break;
129 
130  // LKM: This is the first real farm operation
131  case dk_och_wait:
132  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
133  if (!m_farm->SleepAllDay(m_field, 0.0, g_date->DayInYear(31, 1) - g_date->DayInYear())) {
134  SimpleEvent(g_date->Date() + 1, dk_och_wait, true);
135  break;
136  }
137  }
139  break;
140 
142  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
143  if (!m_farm->AutumnPlough(m_field, 0.0, g_date->DayInYear(31, 8) - g_date->DayInYear())) {
145  break;
146  }
147  }
148  DK_OCH_EST_YEAR = true;
149  SimpleEvent(g_date->Date() + 1, dk_och_manure_s1, false);
150  break;
151 
152  case dk_och_manure_s1:
153  if (a_farm->IsStockFarmer()) {
154  if (!a_farm->FA_Manure(m_field, 0.0, g_date->DayInYear(1, 9) - g_date->DayInYear())) {
155  SimpleEvent(g_date->Date() + 1, dk_och_manure_s1, true);
156  break;
157  }
158  SimpleEvent(g_date->Date() + 1, dk_och_subsoiler, false);
159  break;
160  }
161  else SimpleEvent(g_date->Date(), dk_och_manure_p1, false);
162  break;
163 
164  case dk_och_manure_p1:
165  if (!a_farm->FP_Manure(m_field, 0.0, g_date->DayInYear(1, 9) - g_date->DayInYear())) {
166  SimpleEvent(g_date->Date() + 1, dk_och_manure_p1, true);
167  break;
168  }
169  SimpleEvent(g_date->Date() + 1, dk_och_subsoiler, false);
170  break;
171 
172  case dk_och_subsoiler:
173  if (!a_farm->DeepPlough(m_field, 0.0, g_date->DayInYear(2, 9) - g_date->DayInYear())) {
174  SimpleEvent(g_date->Date() + 1, dk_och_subsoiler, true);
175  break;
176  }
177  SimpleEvent(g_date->Date() + 25, dk_och_water1, false);
178  break;
179 
180  case dk_och_water1:
181  if (!a_farm->Water(m_field, 0.0, g_date->DayInYear(30, 9) - g_date->DayInYear())) {
182  SimpleEvent(g_date->Date() + 1, dk_och_water1, true);
183  break;
184  }
186  break;
187  case dk_och_planting:
188  if (!a_farm->SpringSow(m_field, 0.0, g_date->DayInYear(30, 9) - g_date->DayInYear())) {
189  SimpleEvent(g_date->Date() + 1, dk_och_planting, true);
190  break;
191  }
192  SimpleEvent(g_date->Date(), dk_och_sow_grass, false); // sow thread
193  SimpleEvent(g_date->Date(), dk_och_manual_cutting10, false); // cutting thread
194  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 11), dk_och_herbicide1, false); // herbicide thread
195  break;
196 
197  case dk_och_sow_grass:
198  if (!a_farm->SpringSow(m_field, 0.0, g_date->DayInYear(30, 9) - g_date->DayInYear())) {
199  SimpleEvent(g_date->Date() + 1, dk_och_sow_grass, true);
200  break;
201  }
202  break; // end of thread
203 
204  case dk_och_herbicide1: // Round Up
205  if (!a_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(30, 11) - g_date->DayInYear())) {
206  SimpleEvent(g_date->Date() + 1, dk_och_herbicide1, true);
207  break;
208  }
209  if (DK_OCH_EST_YEAR == true) {
210  done = true;
211  break; // end of thread and establishment
212  }
213  break;
214 
215  // start of year 3 after planting year (harvest years):
217  if (!a_farm->SleepAllDay(m_field, 0.0, g_date->DayInYear(31, 1) - g_date->DayInYear())) {
219  break;
220  }
221  DK_OCH_YEARS_HARVEST = true; // we need to remember who do this (they should harvest)
223  break;
224 
225  // start of year 1+2 after planting year:
227  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(31, 1) - g_date->DayInYear())) {
229  break;
230  }
231  SimpleEvent(g_date->Date() + 25, dk_och_manual_cutting2, false); // thread for manual cutting (once a month)
232  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3), dk_och_manure_s2, false); // main thread
233  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3), dk_och_herbicide2, false); // herbicide thread
234  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3), dk_och_fungicide1, false); // fungicide thread
235  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3) + m_date_modifier, dk_och_insecticide1, false); // insecticide1 thread
236  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3) + m_date_modifier, dk_och_insecticide2, false); // insecticide2 thread
237  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_och_gr1, false); // growth regulator1 thread
238  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_och_gr3, false); // growth regulator3 thread
239  break;
241  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(28, 2) - g_date->DayInYear())) {
243  break;
244  }
246  break;
248  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(31, 3) - g_date->DayInYear())) {
250  break;
251  }
253  break;
255  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
257  break;
258  }
260  break;
262  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
264  break;
265  }
267  break;
269  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(30, 6) - g_date->DayInYear())) {
271  break;
272  }
274  break;
276  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(31, 7) - g_date->DayInYear())) {
278  break;
279  }
281  break;
283  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(31, 8) - g_date->DayInYear())) {
285  break;
286  }
288  break;
290  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(30, 9) - g_date->DayInYear())) {
292  break;
293  }
295  break;
297  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
299  break;
300  }
302  break;
304  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(30, 11) - g_date->DayInYear())) {
306  break;
307  }
308  break;
309  // end of cutting thread
310 
311  case dk_och_herbicide2:// Round Up
312  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
313  if (!a_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(31, 3) - g_date->DayInYear())) {
314  SimpleEvent(g_date->Date() + 1, dk_och_herbicide2, true);
315  break;
316  }
317  }
319  break;
320 
321  case dk_och_herbicide3:// Starane
322  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
323  if (!a_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
324  SimpleEvent(g_date->Date() + 1, dk_och_herbicide3, true);
325  break;
326  }
327  }
329  break;
330 
331  case dk_och_herbicide4: // Round Up
332  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
333  if (!a_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(30, 6) - g_date->DayInYear())) {
334  SimpleEvent(g_date->Date() + 1, dk_och_herbicide4, true);
335  break;
336  }
337  }
339  break;
340 
341  case dk_och_herbicide5: // MCPA
342  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
343  if (!a_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(31, 7) - g_date->DayInYear())) {
344  SimpleEvent(g_date->Date() + 1, dk_och_herbicide5, true);
345  break;
346  }
347  }
349  break;
350 
351  // pesticide thread:
352  case dk_och_fungicide1: // Scala
353  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
354  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
355  SimpleEvent(g_date->Date() + 1, dk_och_fungicide1, true);
356  break;
357  }
358  }
360  break;
361 
362  case dk_och_fungicide2: // Candit
363  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
364  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
365  SimpleEvent(g_date->Date() + 1, dk_och_fungicide2, true);
366  break;
367  }
368  }
374  break;
375 
376  case dk_och_fungicide3: // Syllit
377  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
378  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(21, 7) - g_date->DayInYear())) {
379  SimpleEvent(g_date->Date() + 1, dk_och_fungicide3, true);
380  break;
381  }
382  }
383  SimpleEvent(g_date->Date() + 10, dk_och_fungicide4, false);
384  break;
385 
386  case dk_och_fungicide4: // Syllit
387  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
388  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(31, 7) - g_date->DayInYear())) {
389  SimpleEvent(g_date->Date() + 1, dk_och_fungicide4, true);
390  break;
391  }
392  }
393  break;
394 
395  case dk_och_fungicide5:// Delan WG
396  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(30, 6) - g_date->DayInYear())) {
397  SimpleEvent(g_date->Date() + 1, dk_och_fungicide5, true);
398  break;
399  }
400  SimpleEvent(g_date->Date() + 10, dk_och_fungicide6, false);
401  break;
402 
403  case dk_och_fungicide6:// Delan WG
404  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(10, 7) - g_date->DayInYear())) {
405  SimpleEvent(g_date->Date() + 1, dk_och_fungicide6, true);
406  break;
407  }
408  SimpleEvent(g_date->Date() + 10, dk_och_fungicide7, false);
409  break;
410 
411  case dk_och_fungicide7:// Delan WG
412  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(20, 7) - g_date->DayInYear())) {
413  SimpleEvent(g_date->Date() + 1, dk_och_fungicide7, true);
414  break;
415  }
416  SimpleEvent(g_date->Date() + 10, dk_och_fungicide8, false);
417  break;
418 
419  case dk_och_fungicide8:// Delan WG
420  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(31, 7) - g_date->DayInYear())) {
421  SimpleEvent(g_date->Date() + 1, dk_och_fungicide8, true);
422  break;
423  }
424  break;
425 
426  case dk_och_fungicide9: // Difcor
427  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
428  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
429  SimpleEvent(g_date->Date() + 1, dk_och_fungicide9, true);
430  break;
431  }
432  }
433  break;
434 
435  case dk_och_fungicide10: // Talius
436  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
437  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
438  SimpleEvent(g_date->Date() + 1, dk_och_fungicide10, true);
439  break;
440  }
441  }
442  break;
443 
444  case dk_och_fungicide11:// Kumulus S
445  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(7, 7) - g_date->DayInYear())) {
446  SimpleEvent(g_date->Date() + 1, dk_och_fungicide11, true);
447  break;
448  }
449  SimpleEvent(g_date->Date() + 7, dk_och_fungicide12, false);
450  break;
451 
452  case dk_och_fungicide12:// Kumulus S
453  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(15, 7) - g_date->DayInYear())) {
454  SimpleEvent(g_date->Date() + 1, dk_och_fungicide12, true);
455  break;
456  }
457  SimpleEvent(g_date->Date() + 7, dk_och_fungicide13, false);
458  break;
459 
460  case dk_och_fungicide13:// Kumulus S
461  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(23, 7) - g_date->DayInYear())) {
462  SimpleEvent(g_date->Date() + 1, dk_och_fungicide13, true);
463  break;
464  }
465  SimpleEvent(g_date->Date() + 7, dk_och_fungicide14, false);
466  break;
467 
468  case dk_och_fungicide14:// Kumulus S
469  if (!a_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(31, 7) - g_date->DayInYear())) {
470  SimpleEvent(g_date->Date() + 1, dk_och_fungicide14, true);
471  break;
472  }
473  break;
474  // end of thread
475 
476  case dk_och_insecticide1: // Lamdex
477  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
478  // here we check whether we are using ERA pesticide or not
479  d1 = g_date->DayInYear(31, 7) - g_date->DayInYear();
480  if (!cfg_pest_orchard_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
481  {
482  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
483  }
484  else {
485  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 1);
486  }
487  if (!flag) {
489  break;
490  }
491  }
492  break;
493 
494  case dk_och_insecticide2: // Teppeki/Mospilan
495  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
496  // here we check whether we are using ERA pesticide or not
497  d1 = g_date->DayInYear(30, 4) - g_date->DayInYear();
498  if (!cfg_pest_orchard_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
499  {
500  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
501  }
502  else {
503  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 1);
504  }
505  if (!flag) {
507  break;
508  }
509  }
515  break;
516 
517  case dk_och_insecticide3: // Steward
518  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
519  // here we check whether we are using ERA pesticide or not
520  d1 = g_date->DayInYear(31, 5) - g_date->DayInYear();
521  if (!cfg_pest_orchard_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
522  {
523  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
524  }
525  else {
526  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 1);
527  }
528  if (!flag) {
530  break;
531  }
532  }
533  break;
534 
535  case dk_och_insecticide4: // Signum
536  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
537  // here we check whether we are using ERA pesticide or not
538  d1 = g_date->DayInYear(21, 7) - g_date->DayInYear();
539  if (!cfg_pest_orchard_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
540  {
541  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
542  }
543  else {
544  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 1);
545  }
546  if (!flag) {
548  break;
549  }
550  }
551  SimpleEvent(g_date->Date() + 10, dk_och_insecticide5, false);
552  break;
553 
554  case dk_och_insecticide5: // Signum
555  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
556  // here we check whether we are using ERA pesticide or not
557  d1 = g_date->DayInYear(31, 7) - g_date->DayInYear();
558  if (!cfg_pest_orchard_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
559  {
560  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
561  }
562  else {
563  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 1);
564  }
565  if (!flag) {
567  break;
568  }
569  }
570  break;
571 
572  case dk_och_insecticide6: // Mospilan
573  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
574  // here we check whether we are using ERA pesticide or not
575  d1 = g_date->DayInYear(31, 7) - g_date->DayInYear();
576  if (!cfg_pest_orchard_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
577  {
578  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
579  }
580  else {
581  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 1);
582  }
583  if (!flag) {
585  break;
586  }
587  }
588  break;
589 
590  case dk_och_insecticide7: // Teppeki
591  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
592  // here we check whether we are using ERA pesticide or not
593  d1 = g_date->DayInYear(31, 8) - g_date->DayInYear();
594  if (!cfg_pest_orchard_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
595  {
596  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
597  }
598  else {
599  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 1);
600  }
601  if (!flag) {
603  break;
604  }
605  }
606  break;
607 
608  case dk_och_insecticide8: // Madex Top
609  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
610  // here we check whether we are using ERA pesticide or not
611  d1 = g_date->DayInYear(10, 8) - g_date->DayInYear();
612  if (!cfg_pest_orchard_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
613  {
614  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
615  }
616  else {
617  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 1);
618  }
619  if (!flag) {
621  break;
622  }
623  }
624  SimpleEvent(g_date->Date() + 10, dk_och_insecticide9, false);
625  break;
626 
627  case dk_och_insecticide9: // Madex Top
628  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
629  // here we check whether we are using ERA pesticide or not
630  d1 = g_date->DayInYear(20, 8) - g_date->DayInYear();
631  if (!cfg_pest_orchard_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
632  {
633  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
634  }
635  else {
636  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 1);
637  }
638  if (!flag) {
640  break;
641  }
642  }
643  SimpleEvent(g_date->Date() + 10, dk_och_insecticide10, false);
644  break;
645 
646  case dk_och_insecticide10: // Madex Top
647  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
648  // here we check whether we are using ERA pesticide or not
649  d1 = g_date->DayInYear(31, 8) - g_date->DayInYear();
650  if (!cfg_pest_orchard_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
651  {
652  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
653  }
654  else {
655  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 1);
656  }
657  if (!flag) {
659  break;
660  }
661  }
662  break;
663  // end of thread
664 
665  //growth regulators
666  case dk_och_gr1: // Cerone
667  if (!a_farm->GrowthRegulator(m_field, 0.0, g_date->DayInYear(23, 8) - g_date->DayInYear())) {
668  SimpleEvent(g_date->Date() + 1, dk_och_gr1, true);
669  break;
670  }
671  SimpleEvent(g_date->Date() + 7, dk_och_gr2, false);
672  break;
673 
674  case dk_och_gr2: // Cerone
675  if (!a_farm->GrowthRegulator(m_field, 0.0, g_date->DayInYear(31, 8) - g_date->DayInYear())) {
676  SimpleEvent(g_date->Date() + 1, dk_och_gr2, true);
677  break;
678  }
679  break;
680 
681  case dk_och_gr3: // Regalis Plus
682  if (!a_farm->GrowthRegulator(m_field, 0.0, g_date->DayInYear(7, 5) - g_date->DayInYear())) {
683  SimpleEvent(g_date->Date() + 1, dk_och_gr3, true);
684  break;
685  }
686  SimpleEvent(g_date->Date() + 21, dk_och_gr4, false);
687  break;
688 
689  case dk_och_gr4: // Regalis Plus
690  if (!a_farm->GrowthRegulator(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
691  SimpleEvent(g_date->Date() + 1, dk_och_gr4, true);
692  break;
693  }
694  break;
695  //end of GRs
696 
697  case dk_och_manure_s2:
698  if (a_farm->IsStockFarmer()) {
699  if (!a_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(31, 3) - g_date->DayInYear())) {
700  SimpleEvent(g_date->Date() + 1, dk_och_manure_s2, true);
701  break;
702  }
703  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)
704  {
705  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_och_row_cultivation1, false); //row cultivation thread
706  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_och_water2, false); // water thread
707  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5), dk_och_cutting1, false); // cutting grass thread
708  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 8), dk_och_harvest, false); // harvest thread
709  break;
710  }
711  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_och_row_cultivation1, false); //row cultivation thread
712  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5), dk_och_cutting1, false); // cutting grass thread
713  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 8), dk_och_harvest, false); // harvest thread
714  break;
715  }
716  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_och_manure_p2, false);
717  break;
718 
719  case dk_och_manure_p2:
720  if (!a_farm->FP_NPK(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
721  SimpleEvent(g_date->Date() + 1, dk_och_manure_p2, true);
722  break;
723  }
724  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)
725  {
726  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_och_row_cultivation1, false); //row cultivation thread
727  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_och_water2, false); // water thread
728  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5), dk_och_cutting1, false); // cutting grass thread
729  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 8), dk_och_harvest, false); // harvest thread
730  break;
731  }
732  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_och_row_cultivation1, false); //row cultivation thread
733  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5), dk_och_cutting1, false); // cutting grass thread
734  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 8), dk_och_harvest, false); // harvest thread
735  break;
736 
738  if (m_ev->m_lock || m_farm->DoIt_prob(0.10)) { // suggestion - not so often in conv. orchards
739  if (!a_farm->RowCultivation(m_field, 0.0, g_date->DayInYear(31, 7) - g_date->DayInYear())) {
741  break;
742  }
743  }
745  break;
746 
748  if (m_ev->m_lock || m_farm->DoIt_prob(0.10)) { // suggestion - not so often in conv. orchards
749  if (!a_farm->RowCultivation(m_field, 0.0, g_date->DayInYear(30, 11) - g_date->DayInYear())) {
751  break;
752  }
753  }
754  break;
755  // end of thread
756 
757  //Here comes water thread:
758  case dk_och_water2:
759  if (!a_farm->Water(m_field, 0.0, g_date->DayInYear(1, 5) - g_date->DayInYear())) {
760  SimpleEvent(g_date->Date() + 1, dk_och_water2, true);
761  break;
762  }
763  SimpleEvent(g_date->Date() + 25, dk_och_water3, false);
764  break;
765 
766  case dk_och_water3:
767  if (!a_farm->Water(m_field, 0.0, g_date->DayInYear(1, 6) - g_date->DayInYear())) {
768  SimpleEvent(g_date->Date() + 1, dk_och_water3, true);
769  break;
770  }
771  SimpleEvent(g_date->Date() + 25, dk_och_water4, false);
772  break;
773  case dk_och_water4:
774  if (!a_farm->Water(m_field, 0.0, g_date->DayInYear(1, 7) - g_date->DayInYear())) {
775  SimpleEvent(g_date->Date() + 1, dk_och_water4, true);
776  break;
777  }
778  SimpleEvent(g_date->Date() + 25, dk_och_water5, false);
779  break;
780  case dk_och_water5:
781  if (!a_farm->Water(m_field, 0.0, g_date->DayInYear(1, 8) - g_date->DayInYear())) {
782  SimpleEvent(g_date->Date() + 1, dk_och_water5, true);
783  break;
784  }
785  SimpleEvent(g_date->Date() + 25, dk_och_water6, false);
786  break;
787  case dk_och_water6:
788  if (!a_farm->Water(m_field, 0.0, g_date->DayInYear(1, 9) - g_date->DayInYear())) {
789  SimpleEvent(g_date->Date() + 1, dk_och_water6, true);
790  break;
791  }
792  SimpleEvent(g_date->Date() + 25, dk_och_water7, false);
793  break;
794  case dk_och_water7:
795  if (!a_farm->Water(m_field, 0.0, g_date->DayInYear(1, 10) - g_date->DayInYear())) {
796  SimpleEvent(g_date->Date() + 1, dk_och_water7, true);
797  break;
798  }
799  break;
800  // end of thread
801  // cutting grass thread:
802  case dk_och_cutting1:
803  if (!a_farm->CutOrch(m_field, 0.0, g_date->DayInYear(1, 6) - g_date->DayInYear())) {
804  SimpleEvent(g_date->Date() + 1, dk_och_cutting1, true);
805  break;
806  }
807  SimpleEvent(g_date->Date() + 25, dk_och_cutting2, false);
808  break;
809  case dk_och_cutting2:
810  if (!a_farm->CutOrch(m_field, 0.0, g_date->DayInYear(1, 7) - g_date->DayInYear())) {
811  SimpleEvent(g_date->Date() + 1, dk_och_cutting2, true);
812  break;
813  }
814  SimpleEvent(g_date->Date() + 25, dk_och_cutting3, false);
815  break;
816  case dk_och_cutting3:
817  if (!a_farm->CutOrch(m_field, 0.0, g_date->DayInYear(1, 8) - g_date->DayInYear())) {
818  SimpleEvent(g_date->Date() + 1, dk_och_cutting3, true);
819  break;
820  }
821  SimpleEvent(g_date->Date() + 25, dk_och_cutting4, false);
822  break;
823  case dk_och_cutting4:
824  if (!a_farm->CutOrch(m_field, 0.0, g_date->DayInYear(1, 9) - g_date->DayInYear())) {
825  SimpleEvent(g_date->Date() + 1, dk_och_cutting4, true);
826  break;
827  }
828  SimpleEvent(g_date->Date() + 25, dk_och_cutting5, false);
829  break;
830  case dk_och_cutting5:
831  if (!a_farm->CutOrch(m_field, 0.0, g_date->DayInYear(1, 10) - g_date->DayInYear())) {
832  SimpleEvent(g_date->Date() + 1, dk_och_cutting5, true);
833  break;
834  }
835  SimpleEvent(g_date->Date() + 25, dk_och_cutting6, false);
836  break;
837  case dk_och_cutting6:
838  if (!a_farm->CutOrch(m_field, 0.0, g_date->DayInYear(1, 11) - g_date->DayInYear())) {
839  SimpleEvent(g_date->Date() + 1, dk_och_cutting6, true);
840  break;
841  }
842  break;
843  // end of thread
844 
845  case dk_och_harvest:
846  if (DK_OCH_YEARS_HARVEST == true) {
847  if (!a_farm->FruitHarvest(m_field, 0.0, g_date->DayInYear(15, 9) - g_date->DayInYear())) {
848  SimpleEvent(g_date->Date() + 1, dk_och_harvest, true);
849  break;
850  }
852  break;
853  }
854  else
856  break;
857 
859  if (!a_farm->Pruning(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
861  break;
862  }
863  done = true;
864  break;
865  // So we are done, and somewhere else the farmer will queue up the start event of the next crop (DK_OrchCherry)
866  // END of MAIN THREAD
867  break;
868  default:
869  g_msg->Warn(WARN_BUG, "DK_OrchCherry::Do(): "
870  "Unknown event type! ", "");
871  exit(1);
872  }
873  return done;
874 }

References Farm::AutumnPlough(), cfg_pest_orchard_on, cfg_pest_product_amounts, LE::ClearManagementActionSum(), Farm::CutOrch(), Calendar::Date(), Calendar::DayInYear(), Farm::DeepPlough(), dk_och_autumn_plough, dk_och_cutting1, dk_och_cutting2, dk_och_cutting3, dk_och_cutting4, dk_och_cutting5, dk_och_cutting6, DK_OCH_EST_YEAR, dk_och_fungicide1, dk_och_fungicide10, dk_och_fungicide11, dk_och_fungicide12, dk_och_fungicide13, dk_och_fungicide14, dk_och_fungicide2, dk_och_fungicide3, dk_och_fungicide4, dk_och_fungicide5, dk_och_fungicide6, dk_och_fungicide7, dk_och_fungicide8, dk_och_fungicide9, dk_och_gr1, dk_och_gr2, dk_och_gr3, dk_och_gr4, dk_och_harvest, dk_och_herbicide1, dk_och_herbicide2, dk_och_herbicide3, dk_och_herbicide4, dk_och_herbicide5, dk_och_insecticide1, dk_och_insecticide10, dk_och_insecticide2, dk_och_insecticide3, dk_och_insecticide4, dk_och_insecticide5, dk_och_insecticide6, dk_och_insecticide7, dk_och_insecticide8, dk_och_insecticide9, dk_och_manual_cutting1, dk_och_manual_cutting10, dk_och_manual_cutting11, dk_och_manual_cutting12, dk_och_manual_cutting2, dk_och_manual_cutting3, dk_och_manual_cutting4, dk_och_manual_cutting5, dk_och_manual_cutting6, dk_och_manual_cutting7, dk_och_manual_cutting8, dk_och_manual_cutting9, dk_och_manure_p1, dk_och_manure_p2, dk_och_manure_s1, dk_och_manure_s2, dk_och_planting, dk_och_row_cultivation1, dk_och_row_cultivation2, dk_och_sleep_all_day, dk_och_sow_grass, dk_och_start, dk_och_subsoiler, dk_och_wait, dk_och_water1, dk_och_water2, dk_och_water3, dk_och_water4, dk_och_water5, dk_och_water6, dk_och_water7, DK_OCH_YEARS_AFTER_PLANT, DK_OCH_YEARS_HARVEST, Farm::DoIt_prob(), Farm::FA_Manure(), Farm::FA_Slurry(), Farm::FP_Manure(), Farm::FP_NPK(), Farm::FruitHarvest(), Farm::FungicideTreat(), g_date, g_msg, LE::GetMDates(), LE::GetSoilType(), Calendar::GetYearNumber(), Farm::GrowthRegulator(), Farm::HerbicideTreat(), Farm::InsecticideTreat(), Farm::IsStockFarmer(), Crop::m_date_modifier, Crop::m_ev, Crop::m_farm, Crop::m_field, 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::SpringSow(), Crop::StartUpCrop(), tos_LoamySand, tos_Sand, tos_SandyClayLoam, tos_SandyLoam, tov_DKOrchCherry, CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), WARN_BUG, and Farm::Water().

◆ SetUpFarmCategoryInformation()

void DK_OrchCherry::SetUpFarmCategoryInformation ( )
inline
133  {
134  const int elements = 2 + (dk_och_foobar - DK_OCH_BASE);
136 
137  FarmManagementCategory catlist[elements] =
138  {
139  fmc_Others, // zero element unused but must be here
140  fmc_Others, // dk_och_start = 1, // Compulsory, must always be 1 (one).
141  fmc_Others, // dk_och_sleep_all_day = DK_OCH_BASE,
142  fmc_Others, // dk_och_wait,
143  fmc_Cultivation, //dk_och_spring_plough,
144  fmc_Fertilizer, //dk_och_manure_s1,
145  fmc_Fertilizer, //dk_och_manure_p1,
146  fmc_Watering, //dk_och_water1,
147  fmc_Cultivation, //dk_och_subsoiler,
148  fmc_Others, //dk_och_planting,
149  fmc_Others, //dk_och_sow_grass,
150  fmc_Insecticide, //dk_och_insecticide1,
151  fmc_Insecticide, //dk_och_insecticide2,
152  fmc_Insecticide, //dk_och_insecticide3,
153  fmc_Herbicide, //dk_och_herbicide1
154  fmc_Herbicide, //dk_och_herbicide2
155  fmc_Cutting, //dk_och_manual_cutting1,
156  fmc_Cutting, //dk_och_manual_cutting2,
157  fmc_Cutting, //dk_och_manual_cutting3,
158  fmc_Cutting, //dk_och_manual_cutting4,
159  fmc_Cutting, //dk_och_manual_cutting5,
160  fmc_Cutting, //dk_och_manual_cutting6,
161  fmc_Cutting, //dk_och_manual_cutting7,
162  fmc_Cutting, //dk_och_manual_cutting8,
163  fmc_Cutting, //dk_och_manual_cutting9,
164  fmc_Cutting, //dk_och_manual_cutting10,
165  fmc_Cutting, //dk_och_manual_cutting11,
166  fmc_Cutting, //dk_och_manual_cutting12,
167  fmc_Cutting, //dk_och_manure_s2,
168  fmc_Cutting, //dk_och_manure_p2,
169  fmc_Cultivation, //dk_och_row_cultivation1,
170  fmc_Watering, //dk_och_water2,
171  fmc_Watering, //dk_och_water3,
172  fmc_Watering, //dk_och_water4,
173  fmc_Watering, //dk_och_water5,
174  fmc_Watering, //dk_och_water6,
175  fmc_Watering, //dk_och_water7,
176  fmc_Cutting, //dk_och_cutting1,
177  fmc_Cutting, //dk_och_cutting2,
178  fmc_Cutting, //dk_och_cutting3,
179  fmc_Cutting, //dk_och_cutting4,
180  fmc_Cutting, //dk_och_cutting5,
181  fmc_Cutting, //dk_och_cutting6,
182  fmc_Cultivation, //dk_och_row_cultivation2,
183  fmc_Fungicide, //dk_och_fungicide1,
184  fmc_Fungicide, //dk_och_fungicide2,
185  fmc_Insecticide, //dk_och_insecticide4,
186  fmc_Insecticide, //dk_och_insecticide
187  fmc_Insecticide, //dk_och_insecticide
188  fmc_Insecticide, //dk_och_insecticide
189  fmc_Insecticide, //dk_och_insecticide
190  fmc_Insecticide, //dk_och_insecticide
191  fmc_Insecticide, //dk_och_insecticide
192  fmc_Herbicide, //dk_och_herbicide3
193  fmc_Herbicide, //dk_och_herbicide4
194  fmc_Herbicide, //dk_och_herbicide5
195  fmc_Fungicide, //dk_och_fungicide3,
196  fmc_Harvest, //dk_och_harvest,
197  fmc_Fungicide, //dk_och_fungicide4,
198  fmc_Fungicide, //dk_och_fungicide
199  fmc_Fungicide, //dk_och_fungicide
200  fmc_Fungicide, //dk_och_fungicide
201  fmc_Fungicide, //dk_och_fungicide
202  fmc_Fungicide, //dk_och_fungicide
203  fmc_Fungicide, //dk_och_fungicide
204  fmc_Fungicide, //dk_och_fungicide
205  fmc_Fungicide, //dk_och_fungicide
206  fmc_Fungicide, //dk_och_fungicide
207  fmc_Fungicide, //dk_och_fungicide
208  fmc_Others, // dk_och_gr1
209  fmc_Others, // dk_och_gr2
210  fmc_Others, // dk_och_gr3
211  fmc_Others, // dk_och_gr4
212  // no foobar entry
213 
214  };
215  // Iterate over the catlist elements and copy them to vector
216  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
217 
218  }

References DK_OCH_BASE, dk_och_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_OrchCherry().


The documentation for this class was generated from the following files:
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
dk_och_water3
Definition: DK_OrchCherry.h:69
dk_och_manual_cutting7
Definition: DK_OrchCherry.h:59
DK_OrchCherry::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: DK_OrchCherry.h:133
Farm::FA_Slurry
virtual bool FA_Slurry(LE *a_field, double a_user, int a_days)
Spready slurry on a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1067
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
dk_och_foobar
Definition: DK_OrchCherry.h:110
dk_och_fungicide2
Definition: DK_OrchCherry.h:82
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_och_insecticide2
Definition: DK_OrchCherry.h:49
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
dk_och_water5
Definition: DK_OrchCherry.h:71
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
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
Calendar::GetYearNumber
int GetYearNumber(void)
Definition: Calendar.h:72
dk_och_water1
Definition: DK_OrchCherry.h:44
dk_och_manual_cutting5
Definition: DK_OrchCherry.h:57
tos_SandyClayLoam
Definition: LandscapeFarmingEnums.h:722
dk_och_cutting1
Definition: DK_OrchCherry.h:74
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_och_manual_cutting9
Definition: DK_OrchCherry.h:61
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
dk_och_manual_cutting10
Definition: DK_OrchCherry.h:62
dk_och_gr3
Definition: DK_OrchCherry.h:108
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_och_fungicide14
Definition: DK_OrchCherry.h:105
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_och_autumn_plough
Definition: DK_OrchCherry.h:41
DK_OCH_YEARS_HARVEST
#define DK_OCH_YEARS_HARVEST
Definition: DK_OrchCherry.h:24
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
dk_och_wait
Definition: DK_OrchCherry.h:40
dk_och_row_cultivation1
Definition: DK_OrchCherry.h:67
dk_och_gr4
Definition: DK_OrchCherry.h:109
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
dk_och_manual_cutting4
Definition: DK_OrchCherry.h:56
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
dk_och_gr1
Definition: DK_OrchCherry.h:106
dk_och_insecticide1
Definition: DK_OrchCherry.h:48
dk_och_manual_cutting3
Definition: DK_OrchCherry.h:55
dk_och_start
Definition: DK_OrchCherry.h:38
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_och_manure_p2
Definition: DK_OrchCherry.h:66
dk_och_herbicide4
Definition: DK_OrchCherry.h:91
CfgBool::value
bool value() const
Definition: Configurator.h:164
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_och_manual_cutting8
Definition: DK_OrchCherry.h:60
dk_och_insecticide4
Definition: DK_OrchCherry.h:83
dk_och_manual_cutting6
Definition: DK_OrchCherry.h:58
fmc_Cutting
Definition: LandscapeFarmingEnums.h:1009
dk_och_manual_cutting2
Definition: DK_OrchCherry.h:54
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
dk_och_insecticide6
Definition: DK_OrchCherry.h:85
dk_och_fungicide1
Definition: DK_OrchCherry.h:81
dk_och_herbicide1
Definition: DK_OrchCherry.h:51
dk_och_herbicide3
Definition: DK_OrchCherry.h:90
dk_och_gr2
Definition: DK_OrchCherry.h:107
Calendar::Date
long Date(void)
Definition: Calendar.h:57
dk_och_water6
Definition: DK_OrchCherry.h:72
tov_DKOrchCherry
Definition: LandscapeFarmingEnums.h:464
dk_och_cutting4
Definition: DK_OrchCherry.h:77
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
LE::GetSoilType
int GetSoilType()
Definition: Elements.h:302
dk_och_fungicide12
Definition: DK_OrchCherry.h:103
dk_och_fungicide9
Definition: DK_OrchCherry.h:100
dk_och_fungicide3
Definition: DK_OrchCherry.h:93
dk_och_fungicide10
Definition: DK_OrchCherry.h:101
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
fmc_Watering
Definition: LandscapeFarmingEnums.h:1011
dk_och_insecticide3
Definition: DK_OrchCherry.h:50
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
DK_OCH_EST_YEAR
#define DK_OCH_EST_YEAR
Definition: DK_OrchCherry.h:25
dk_och_manual_cutting1
Definition: DK_OrchCherry.h:53
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
DK_OCH_BASE
#define DK_OCH_BASE
Definition: DK_OrchCherry.h:27
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
dk_och_insecticide8
Definition: DK_OrchCherry.h:87
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_och_manure_s2
Definition: DK_OrchCherry.h:65
DK_OCH_YEARS_AFTER_PLANT
#define DK_OCH_YEARS_AFTER_PLANT
Definition: DK_OrchCherry.h:23
dk_och_planting
Definition: DK_OrchCherry.h:46
dk_och_manure_p1
Definition: DK_OrchCherry.h:43
dk_och_cutting3
Definition: DK_OrchCherry.h:76
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
dk_och_insecticide7
Definition: DK_OrchCherry.h:86
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
dk_och_cutting5
Definition: DK_OrchCherry.h:78
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
tos_Sand
Definition: LandscapeFarmingEnums.h:719
dk_och_insecticide9
Definition: DK_OrchCherry.h:88
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_och_insecticide10
Definition: DK_OrchCherry.h:89
dk_och_water7
Definition: DK_OrchCherry.h:73
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_och_manual_cutting11
Definition: DK_OrchCherry.h:63
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
dk_och_fungicide13
Definition: DK_OrchCherry.h:104
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_och_fungicide7
Definition: DK_OrchCherry.h:98
dk_och_water4
Definition: DK_OrchCherry.h:70
dk_och_water2
Definition: DK_OrchCherry.h:68
dk_och_cutting6
Definition: DK_OrchCherry.h:79
dk_och_manure_s1
Definition: DK_OrchCherry.h:42
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
dk_och_herbicide2
Definition: DK_OrchCherry.h:52
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_och_sow_grass
Definition: DK_OrchCherry.h:47
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_och_fungicide5
Definition: DK_OrchCherry.h:96
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.
cfg_pest_orchard_on
CfgBool cfg_pest_orchard_on
Turn on pesticides for orchard.
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_och_insecticide5
Definition: DK_OrchCherry.h:84
dk_och_subsoiler
Definition: DK_OrchCherry.h:45
dk_och_fungicide6
Definition: DK_OrchCherry.h:97
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
dk_och_fungicide4
Definition: DK_OrchCherry.h:95
dk_och_herbicide5
Definition: DK_OrchCherry.h:92
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
dk_och_fungicide8
Definition: DK_OrchCherry.h:99
dk_och_fungicide11
Definition: DK_OrchCherry.h:102
dk_och_cutting2
Definition: DK_OrchCherry.h:75
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
tos_LoamySand
Definition: LandscapeFarmingEnums.h:720
dk_och_row_cultivation2
Definition: DK_OrchCherry.h:80
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
dk_och_manual_cutting12
Definition: DK_OrchCherry.h:64
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
dk_och_harvest
Definition: DK_OrchCherry.h:94
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
dk_och_sleep_all_day
Definition: DK_OrchCherry.h:39