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

DK_OOrchOther class
. More...

#include <DK_OOrchOther.h>

Inheritance diagram for DK_OOrchOther:
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_OOrchOther (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_OOrchOther class
.

See DK_OOrchOther.h::DK_OOrchOtherToDo 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_OOrchOther()

DK_OOrchOther::DK_OOrchOther ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
103  : Crop(a_tov, a_toc, a_L)
104  {
105  // When we start it off, the first possible date for a farm operation is ...
106  // This information is used by other crops when they decide how much post processing of
107  // the management is allowed after harvest before the next crop starts.
108  m_first_date=g_date->DayInYear( 30,4 );
110  }

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

Member Function Documentation

◆ Do()

bool DK_OOrchOther::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.

59 {
60  m_farm = a_farm;
61  m_field = a_field;
62  m_ev = a_ev;
63  bool done = false; // The boolean value done indicates when we are totally finished with this plan (i.e. it is set to true, m_farm, m_field).
64  bool flag = false;
65  int d1 = 0;
66  int noDates = 1;
68 
69  // Depending what event has occured jump to the correct bit of code
70  switch (m_ev->m_todo)
71  {
72  case dk_ooot_start:
73  {
74  // dk_obfp1_start just sets up all the starting conditions and reference dates that are needed to start a dk_obfp1
75 
77  DK_OOOT_EST_YEAR = false;
78 
79  a_field->ClearManagementActionSum();
80 
81  m_last_date = g_date->DayInYear(31, 12); // Should match the last flexdate below
82  //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
83  std::vector<std::vector<int>> flexdates(1 + 1, std::vector<int>(2, 0));
84  // Set up the date management stuff
85  // Start and stop dates for all events after harvest
86  flexdates[0][1] = g_date->DayInYear(31, 12); // last possible day of cutting orch
87  // Now these are done in pairs, start & end for each operation. If its not used then -1
88  flexdates[1][0] = -1; // This date will be moved back as far as necessary and potentially to flexdates 1 (start op 1)
89  flexdates[1][1] = -1; // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 1)
90 
91  // 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
92  int isSpring = 365;
93  if (StartUpCrop(isSpring, flexdates, int(dk_ooot_spring_plough))) break;
94 
95  // End single block date checking code. Please see next line comment as well.
96  // Reinit d1 to first possible starting date.
97  // Here we queue up the first event
98  //Each field has assign randomly a DK_ooap_YEARS_AFTER_PLANT
99 
100  if ((DK_OOOT_YEARS_AFTER_PLANT + g_date->GetYearNumber()) % 1 == 1)
101  {
102  d1 = g_date->OldDays() + g_date->DayInYear(1, 3) + isSpring;
104  }
105  else if ((DK_OOOT_YEARS_AFTER_PLANT + g_date->GetYearNumber()) % 1 == 0)
106  {
107  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + isSpring;
109  }
110  break;
111 
112  }
113  break;
114 
115  // LKM: This is the first real farm operation
117  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
118  if (!m_farm->SpringPlough(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
120  break;
121  }
122  DK_OOOT_EST_YEAR = true;
123  }
125  break;
127  if (m_ev->m_lock || m_farm->DoIt_prob(1.00))
128  {
129  if (!a_farm->StubbleHarrowing(m_field, 0.0, g_date->DayInYear(5, 5) - g_date->DayInYear())) {
131  break;
132  }
133  }
135  break;
137  if (m_ev->m_lock || m_farm->DoIt_prob(0.50))
138  {
139  if (!a_farm->StubbleHarrowing(m_field, 0.0, g_date->DayInYear(10, 5) - g_date->DayInYear())) {
141  break;
142  }
143  }
144  if (a_farm->IsStockFarmer()) {
145  SimpleEvent(g_date->Date() + 1, dk_ooot_manure1_s, false);
146  break;
147  }
148  else SimpleEvent(g_date->Date() + 1, dk_ooot_manure1_p, false);
149  break;
150  case dk_ooot_manure1_s:
151  if (!a_farm->FA_Manure(m_field, 0.0, g_date->DayInYear(15, 5) - g_date->DayInYear())) {
152  SimpleEvent(g_date->Date() + 1, dk_ooot_manure1_s, true);
153  break;
154  }
155  SimpleEvent(g_date->Date() + 1, dk_ooot_water1, false);
156  break;
157 
158  case dk_ooot_manure1_p:
159  if (!a_farm->FP_Manure(m_field, 0.0, g_date->DayInYear(15, 5) - g_date->DayInYear())) {
160  SimpleEvent(g_date->Date() + 1, dk_ooot_manure1_p, true);
161  break;
162  }
163  SimpleEvent(g_date->Date() + 1, dk_ooot_water1, false);
164  break;
165  case dk_ooot_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_ooot_water1, true);
168  break;
169  }
171  break;
172  case dk_ooot_subsoiler:
173  if (!a_farm->DeepPlough(m_field, 0.0, g_date->DayInYear(25, 5) - g_date->DayInYear())) {
174  SimpleEvent(g_date->Date() + 1, dk_ooot_subsoiler, true);
175  break;
176  }
178  break;
179  case dk_ooot_planting:
180  if (!a_farm->SpringSow(m_field, 0.0, g_date->DayInYear(30, 5) - g_date->DayInYear())) {
181  SimpleEvent(g_date->Date() + 1, dk_ooot_planting, true);
182  break;
183  }
184  SimpleEvent(g_date->Date(), dk_ooot_sow_grass, false); // sow thread
185  SimpleEvent(g_date->Date(), dk_ooot_manual_cutting5, false); // cutting thread
186  break;
187 
188  case dk_ooot_sow_grass:
189  if (!a_farm->SpringSow(m_field, 0.0, g_date->DayInYear(30, 5) - g_date->DayInYear())) {
190  SimpleEvent(g_date->Date() + 1, dk_ooot_sow_grass, true);
191  break;
192  }
193  break; // end of thread
194 
195  // start of years after planting year:
197  if (!a_farm->SleepAllDay(m_field, 0.0, g_date->DayInYear(31, 1) - g_date->DayInYear())) {
199  break;
200  }
203  break;
204 
205  case dk_ooot_fungicide5:
206  if (!a_farm->OrganicFungicide(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
207  SimpleEvent(g_date->Date() + 1, dk_ooot_fungicide5, true);
208  break;
209  }
210  break;
211 
213  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(31, 1) - g_date->DayInYear())) {
215  break;
216  }
217  if (a_farm->IsStockFarmer()) {
218  SimpleEvent(g_date->Date() + 25, dk_ooot_manual_cutting2, false); // thread for manual cutting (once a month)
219  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3), dk_ooot_manure2_s, false); // main thread
220  SimpleEvent(g_date->OldDays() + g_date->DayInYear(20, 3), dk_ooot_copper_s, false); // fertilizer thread
221  SimpleEvent(g_date->OldDays() + g_date->DayInYear(20, 3), dk_ooot_fungicide1, false); // pesticide thread
222  break;
223  }
224  else SimpleEvent(g_date->Date() + 25, dk_ooot_manual_cutting2, false); // thread for manual cutting (once a month)
225  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3), dk_ooot_manure2_p, false); // main thread
226  SimpleEvent(g_date->OldDays() + g_date->DayInYear(20, 3), dk_ooot_copper_p, false); // fertilizer thread
227  SimpleEvent(g_date->OldDays() + g_date->DayInYear(20, 3), dk_ooot_fungicide1, false); // pesticide thread
228  break;
230  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(28, 2) - g_date->DayInYear())) {
232  break;
233  }
235  break;
237  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(31, 3) - g_date->DayInYear())) {
239  break;
240  }
242  break;
244  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
246  break;
247  }
249  break;
251  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
253  break;
254  }
256  break;
258  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(30, 6) - g_date->DayInYear())) {
260  break;
261  }
263  break;
265  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(31, 7) - g_date->DayInYear())) {
267  break;
268  }
270  break;
272  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(31, 8) - g_date->DayInYear())) {
274  break;
275  }
277  break;
279  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(30, 9) - g_date->DayInYear())) {
281  break;
282  }
284  break;
286  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
288  break;
289  }
291  break;
293  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(30, 11) - g_date->DayInYear())) {
295  break;
296  }
297  if (DK_OOOT_EST_YEAR == true) {
298  done = true;
299  break;
300  }
301  break;
302  // end of cutting thread
303  // fertilizer thread:
304  case dk_ooot_copper_s:
305  if (m_ev->m_lock || m_farm->DoIt_prob(0.10)) {
306  if (!a_farm->FA_Cu(m_field, 0.0, g_date->DayInYear(31, 3) - g_date->DayInYear())) {
307  SimpleEvent(g_date->Date() + 1, dk_ooot_copper_s, true);
308  break;
309  }
310  }
312  break;
313  case dk_ooot_boron_s:
314  if (m_ev->m_lock || m_farm->DoIt_prob(0.10)) {
315  if (!a_farm->FA_Boron(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
316  SimpleEvent(g_date->Date() + 1, dk_ooot_boron_s, true);
317  break;
318  }
319  }
320  break;
321  // end of fertilizer thread
322  case dk_ooot_copper_p:
323  if (m_ev->m_lock || m_farm->DoIt_prob(0.10)) {
324  if (!a_farm->FP_Cu(m_field, 0.0, g_date->DayInYear(31, 3) - g_date->DayInYear())) {
325  SimpleEvent(g_date->Date() + 1, dk_ooot_copper_p, true);
326  break;
327  }
328  }
330  break;
331  case dk_ooot_boron_p:
332  if (m_ev->m_lock || m_farm->DoIt_prob(0.10)) {
333  if (!a_farm->FP_Boron(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
334  SimpleEvent(g_date->Date() + 1, dk_ooot_boron_p, true);
335  break;
336  }
337  }
338  break;
339  // end of fertilizer thread
340  // pesticide thread:
341  case dk_ooot_fungicide1:
342  if (m_ev->m_lock || m_farm->DoIt_prob(0.10)) {
343  if (!a_farm->OrganicFungicide(m_field, 0.0, g_date->DayInYear(31, 3) - g_date->DayInYear())) {
344  SimpleEvent(g_date->Date() + 1, dk_ooot_fungicide1, true);
345  break;
346  }
347  }
350  break;
351 
352  case dk_ooot_insecticide:
353  if (m_ev->m_lock || m_farm->DoIt_prob(0.10)) {
354  if (!a_farm->OrganicInsecticide(m_field, 0.0, g_date->DayInYear(5, 5) - g_date->DayInYear())) {
356  break;
357  }
358  }
359  break;
360 
361  case dk_ooot_fungicide2:
362  if (m_ev->m_lock || m_farm->DoIt_prob(0.10)) {
363  if (!a_farm->OrganicFungicide(m_field, 0.0, g_date->DayInYear(25, 6) - g_date->DayInYear())) {
364  SimpleEvent(g_date->Date() + 1, dk_ooot_fungicide2, true);
365  break;
366  }
367  }
369  break;
370 
371  case dk_ooot_fungicide3:
372  if (m_ev->m_lock || m_farm->DoIt_prob(0.10)) {
373  if (!a_farm->OrganicFungicide(m_field, 0.0, g_date->DayInYear(30, 9) - g_date->DayInYear())) {
374  SimpleEvent(g_date->Date() + 1, dk_ooot_fungicide3, true);
375  break;
376  }
377  }
379  break;
380 
381  case dk_ooot_fungicide4:
382  if (!a_farm->OrganicFungicide(m_field, 0.0, g_date->DayInYear(31, 12) - g_date->DayInYear())) {
383  SimpleEvent(g_date->Date() + 1, dk_ooot_fungicide4, true);
384  break;
385  }
386  break;
387  // end of thread
388 
389  case dk_ooot_manure2_s:
390  if (!a_farm->FA_Manure(m_field, 0.0, g_date->DayInYear(1, 4) - g_date->DayInYear())) {
391  SimpleEvent(g_date->Date() + 1, dk_ooot_manure2_s, true);
392  break;
393  }
394  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_ooot_row_cultivation1, false); //row cultivation thread
395  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_ooot_water2, false); // water thread
396  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5), dk_ooot_cutting1, false); // cutting grass thread
397  SimpleEvent(g_date->OldDays() + g_date->DayInYear(15, 6), dk_ooot_remove_fruits, false); // main thread
398  break;
399 
400  case dk_ooot_manure2_p:
401  if (!a_farm->FP_Manure(m_field, 0.0, g_date->DayInYear(1, 4) - g_date->DayInYear())) {
402  SimpleEvent(g_date->Date() + 1, dk_ooot_manure2_p, true);
403  break;
404  }
405  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_ooot_row_cultivation1, false); //row cultivation thread
406  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 4), dk_ooot_water2, false); // water thread
407  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5), dk_ooot_cutting1, false); // cutting grass thread
408  SimpleEvent(g_date->OldDays() + g_date->DayInYear(15, 6), dk_ooot_remove_fruits, false); // main thread
409  break;
410 
412  if (!a_farm->RowCultivation(m_field, 0.0, g_date->DayInYear(31, 7) - g_date->DayInYear())) {
414  break;
415  }
417  break;
418 
420  if (!a_farm->RowCultivation(m_field, 0.0, g_date->DayInYear(30, 11) - g_date->DayInYear())) {
422  break;
423  }
424  break;
425  // end of thread
426 
427  //Here comes water thread:
428  case dk_ooot_water2:
429  if (!a_farm->Water(m_field, 0.0, g_date->DayInYear(1, 5) - g_date->DayInYear())) {
430  SimpleEvent(g_date->Date() + 1, dk_ooot_water2, true);
431  break;
432  }
433  SimpleEvent(g_date->Date() + 25, dk_ooot_water3, false);
434  break;
435  case dk_ooot_water3:
436  if (!a_farm->Water(m_field, 0.0, g_date->DayInYear(1, 6) - g_date->DayInYear())) {
437  SimpleEvent(g_date->Date() + 1, dk_ooot_water3, true);
438  break;
439  }
440  SimpleEvent(g_date->Date() + 25, dk_ooot_water4, false);
441  break;
442  case dk_ooot_water4:
443  if (!a_farm->Water(m_field, 0.0, g_date->DayInYear(1, 7) - g_date->DayInYear())) {
444  SimpleEvent(g_date->Date() + 1, dk_ooot_water4, true);
445  break;
446  }
447  SimpleEvent(g_date->Date() + 25, dk_ooot_water5, false);
448  break;
449  case dk_ooot_water5:
450  if (!a_farm->Water(m_field, 0.0, g_date->DayInYear(1, 8) - g_date->DayInYear())) {
451  SimpleEvent(g_date->Date() + 1, dk_ooot_water5, true);
452  break;
453  }
454  SimpleEvent(g_date->Date() + 25, dk_ooot_water6, false);
455  break;
456  case dk_ooot_water6:
457  if (!a_farm->Water(m_field, 0.0, g_date->DayInYear(1, 9) - g_date->DayInYear())) {
458  SimpleEvent(g_date->Date() + 1, dk_ooot_water6, true);
459  break;
460  }
461  SimpleEvent(g_date->Date() + 25, dk_ooot_water7, false);
462  break;
463  case dk_ooot_water7:
464  if (!a_farm->Water(m_field, 0.0, g_date->DayInYear(1, 10) - g_date->DayInYear())) {
465  SimpleEvent(g_date->Date() + 1, dk_ooot_water7, true);
466  break;
467  }
468  break;
469  // end of thread
470  // cutting grass thread:
471  //Here comes water thread:
472  case dk_ooot_cutting1:
473  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(1, 6) - g_date->DayInYear())) {
474  SimpleEvent(g_date->Date() + 1, dk_ooot_cutting1, true);
475  break;
476  }
477  SimpleEvent(g_date->Date() + 25, dk_ooot_cutting2, false);
478  break;
479  case dk_ooot_cutting2:
480  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(1, 7) - g_date->DayInYear())) {
481  SimpleEvent(g_date->Date() + 1, dk_ooot_cutting2, true);
482  break;
483  }
484  SimpleEvent(g_date->Date() + 25, dk_ooot_cutting3, false);
485  break;
486  case dk_ooot_cutting3:
487  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(1, 8) - g_date->DayInYear())) {
488  SimpleEvent(g_date->Date() + 1, dk_ooot_cutting3, true);
489  break;
490  }
491  SimpleEvent(g_date->Date() + 25, dk_ooot_cutting4, false);
492  break;
493  case dk_ooot_cutting4:
494  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(1, 9) - g_date->DayInYear())) {
495  SimpleEvent(g_date->Date() + 1, dk_ooot_cutting4, true);
496  break;
497  }
498  SimpleEvent(g_date->Date() + 25, dk_ooot_cutting5, false);
499  break;
500  case dk_ooot_cutting5:
501  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(1, 10) - g_date->DayInYear())) {
502  SimpleEvent(g_date->Date() + 1, dk_ooot_cutting5, true);
503  break;
504  }
505  SimpleEvent(g_date->Date() + 25, dk_ooot_cutting6, false);
506  break;
507  case dk_ooot_cutting6:
508  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(1, 11) - g_date->DayInYear())) {
509  SimpleEvent(g_date->Date() + 1, dk_ooot_cutting6, true);
510  break;
511  }
512  break;
513  // end of thread
514 
516  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(31, 8) - g_date->DayInYear())) {
518  break;
519  }
521  break;
522  case dk_ooot_harvest:
523  if (!a_farm->FruitHarvest(m_field, 0.0, g_date->DayInYear(1, 11) - g_date->DayInYear())) {
524  SimpleEvent(g_date->Date() + 1, dk_ooot_harvest, true);
525  break;
526  }
528  break;
530  if (!a_farm->Pruning(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
532  break;
533  }
534  done = true;
535  break;
536  // So we are done, and somewhere else the farmer will queue up the start event of the next crop (DK_OOrchOther)
537  // END of MAIN THREAD
538  break;
539  default:
540  g_msg->Warn(WARN_BUG, "DK_OOrchOther::Do(): "
541  "Unknown event type! ", "");
542  exit(1);
543  }
544  return done;
545 }

References LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), Farm::DeepPlough(), dk_ooot_boron_p, dk_ooot_boron_s, dk_ooot_copper_p, dk_ooot_copper_s, dk_ooot_cutting1, dk_ooot_cutting2, dk_ooot_cutting3, dk_ooot_cutting4, dk_ooot_cutting5, dk_ooot_cutting6, DK_OOOT_EST_YEAR, dk_ooot_fungicide1, dk_ooot_fungicide2, dk_ooot_fungicide3, dk_ooot_fungicide4, dk_ooot_fungicide5, dk_ooot_harvest, dk_ooot_insecticide, dk_ooot_manual_cutting1, dk_ooot_manual_cutting10, dk_ooot_manual_cutting11, dk_ooot_manual_cutting12, dk_ooot_manual_cutting2, dk_ooot_manual_cutting3, dk_ooot_manual_cutting4, dk_ooot_manual_cutting5, dk_ooot_manual_cutting6, dk_ooot_manual_cutting7, dk_ooot_manual_cutting8, dk_ooot_manual_cutting9, dk_ooot_manure1_p, dk_ooot_manure1_s, dk_ooot_manure2_p, dk_ooot_manure2_s, dk_ooot_planting, dk_ooot_remove_fruits, dk_ooot_row_cultivation1, dk_ooot_row_cultivation2, dk_ooot_sleep_all_day, dk_ooot_sow_grass, dk_ooot_spring_plough, dk_ooot_start, dk_ooot_stubble_harrow1, dk_ooot_stubble_harrow2, dk_ooot_subsoiler, dk_ooot_water1, dk_ooot_water2, dk_ooot_water3, dk_ooot_water4, dk_ooot_water5, dk_ooot_water6, dk_ooot_water7, DK_OOOT_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(), g_date, g_msg, LE::GetMDates(), Calendar::GetYearNumber(), Farm::IsStockFarmer(), Crop::m_ev, Crop::m_farm, Crop::m_field, Crop::m_last_date, FarmEvent::m_lock, FarmEvent::m_todo, Calendar::OldDays(), Farm::OrganicFungicide(), Farm::OrganicInsecticide(), Farm::Pruning(), Farm::RowCultivation(), Crop::SimpleEvent(), Farm::SleepAllDay(), Farm::SpringPlough(), Farm::SpringSow(), Crop::StartUpCrop(), Farm::StubbleHarrowing(), tov_DKOOrchOther, MapErrorMsg::Warn(), WARN_BUG, and Farm::Water().

◆ SetUpFarmCategoryInformation()

void DK_OOrchOther::SetUpFarmCategoryInformation ( )
inline
111  {
112  const int elements = 2 + (dk_ooot_foobar - DK_OOOT_BASE);
114 
115  FarmManagementCategory catlist[elements] =
116  {
117  fmc_Others, // zero element unused but must be here
118  fmc_Others, // dk_ooot_start = 1, // Compulsory, must always be 1 (one).
119  fmc_Others, // dk_ooot_sleep_all_day = DK_OOOT_BASE,
120  fmc_Cultivation, //dk_ooot_spring_plough,
121  fmc_Cultivation, //dk_ooot_stubble_harrow1,
122  fmc_Cultivation, //dk_ooot_stubble_harrow2,
123  fmc_Fertilizer, //dk_ooot_manure1,
124  fmc_Watering, //dk_ooot_water1,
125  fmc_Cultivation, //dk_ooot_subsoiler,
126  fmc_Others, //dk_ooot_planting,
127  fmc_Others, //dk_ooot_sow_grass,
128  fmc_Cutting, //dk_ooot_manual_cutting1,
129  fmc_Cutting, //dk_ooot_manual_cutting2,
130  fmc_Cutting, //dk_ooot_manual_cutting3,
131  fmc_Cutting, //dk_ooot_manual_cutting4,
132  fmc_Cutting, //dk_ooot_manual_cutting5,
133  fmc_Cutting, //dk_ooot_manual_cutting6,
134  fmc_Cutting, //dk_ooot_manual_cutting7,
135  fmc_Cutting, //dk_ooot_manual_cutting8,
136  fmc_Cutting, //dk_ooot_manual_cutting9,
137  fmc_Cutting, //dk_ooot_manual_cutting10,
138  fmc_Cutting, //dk_ooot_manual_cutting11,
139  fmc_Cutting, //dk_ooot_manual_cutting12,
140  fmc_Cutting, //dk_ooot_manure2,
141  fmc_Cultivation, //dk_ooot_row_cultivation1,
142  fmc_Watering, //dk_ooot_water2,
143  fmc_Watering, //dk_ooot_water3,
144  fmc_Watering, //dk_ooot_water4,
145  fmc_Watering, //dk_ooot_water5,
146  fmc_Watering, //dk_ooot_water6,
147  fmc_Watering, //dk_ooot_water7,
148  fmc_Cutting, //dk_ooot_cutting1,
149  fmc_Cutting, //dk_ooot_cutting2,
150  fmc_Cutting, //dk_ooot_cutting3,
151  fmc_Cutting, //dk_ooot_cutting4,
152  fmc_Cutting, //dk_ooot_cutting5,
153  fmc_Cutting, //dk_ooot_cutting6,
154  fmc_Cultivation, //dk_ooot_row_cultivation2,
155  fmc_Fertilizer, //dk_ooot_coppper,
156  fmc_Others, //dk_ooot_fungicide1,
157  fmc_Fertilizer, //dk_ooot_boron,
158  fmc_Others, //dk_ooot_fungicide2,
159  fmc_Others, //dk_ooot_insecticide,
160  fmc_Cutting, //dk_ooot_remove_fruits,
161  fmc_Others, //dk_ooot_fungicide3,
162  fmc_Harvest, //dk_ooot_harvest,
163  fmc_Others, //dk_ooot_fungicide4,
164  fmc_Others, //dk_ooot_fungicide5,
165 
166 
167  // no foobar entry
168 
169  };
170  // Iterate over the catlist elements and copy them to vector
171  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
172 
173  }

References DK_OOOT_BASE, dk_ooot_foobar, fmc_Cultivation, fmc_Cutting, fmc_Fertilizer, fmc_Harvest, fmc_Others, fmc_Watering, Crop::m_base_elements_no, and Crop::m_ManagementCategories.

Referenced by DK_OOrchOther().


The documentation for this class was generated from the following files:
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
dk_ooot_foobar
Definition: DK_OOrchOther.h:88
dk_ooot_manual_cutting5
Definition: DK_OOrchOther.h:52
Farm::OrganicInsecticide
virtual bool OrganicInsecticide(LE *a_field, double a_user, int a_days)
Biocide applied on a_field.
Definition: FarmFuncs.cpp:2195
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
DK_OOOT_EST_YEAR
#define DK_OOOT_EST_YEAR
Definition: DK_OOrchOther.h:24
dk_ooot_cutting2
Definition: DK_OOrchOther.h:70
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
dk_ooot_insecticide
Definition: DK_OOrchOther.h:82
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
dk_ooot_cutting6
Definition: DK_OOrchOther.h:74
dk_ooot_fungicide4
Definition: DK_OOrchOther.h:86
dk_ooot_manure1_s
Definition: DK_OOrchOther.h:42
dk_ooot_water7
Definition: DK_OOrchOther.h:68
LE::ClearManagementActionSum
void ClearManagementActionSum()
clears the management action counters
Definition: Elements.h:247
Calendar::GetYearNumber
int GetYearNumber(void)
Definition: Calendar.h:72
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
dk_ooot_stubble_harrow2
Definition: DK_OOrchOther.h:41
Farm::DoIt_prob
bool DoIt_prob(double a_probability)
Return chance out of 0 to 1.
Definition: Farm.cpp:864
dk_ooot_fungicide3
Definition: DK_OOrchOther.h:84
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
dk_ooot_sleep_all_day
Definition: DK_OOrchOther.h:38
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
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_ooot_boron_p
Definition: DK_OOrchOther.h:80
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
dk_ooot_manual_cutting6
Definition: DK_OOrchOther.h:53
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
dk_ooot_boron_s
Definition: DK_OOrchOther.h:79
dk_ooot_manual_cutting4
Definition: DK_OOrchOther.h:51
dk_ooot_subsoiler
Definition: DK_OOrchOther.h:45
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_ooot_water4
Definition: DK_OOrchOther.h:65
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_ooot_spring_plough
Definition: DK_OOrchOther.h:39
DK_OOrchOther::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: DK_OOrchOther.h:111
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
dk_ooot_remove_fruits
Definition: DK_OOrchOther.h:83
Calendar::Date
long Date(void)
Definition: Calendar.h:57
dk_ooot_cutting4
Definition: DK_OOrchOther.h:72
dk_ooot_harvest
Definition: DK_OOrchOther.h:85
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
dk_ooot_stubble_harrow1
Definition: DK_OOrchOther.h:40
dk_ooot_start
Definition: DK_OOrchOther.h:37
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
dk_ooot_manual_cutting1
Definition: DK_OOrchOther.h:48
tov_DKOOrchOther
Definition: LandscapeFarmingEnums.h:469
dk_ooot_manure2_p
Definition: DK_OOrchOther.h:61
fmc_Watering
Definition: LandscapeFarmingEnums.h:1011
DK_OOOT_YEARS_AFTER_PLANT
#define DK_OOOT_YEARS_AFTER_PLANT
Definition: DK_OOrchOther.h:23
dk_ooot_fungicide2
Definition: DK_OOrchOther.h:81
dk_ooot_cutting1
Definition: DK_OOrchOther.h:69
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
dk_ooot_manual_cutting3
Definition: DK_OOrchOther.h:50
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
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_ooot_fungicide5
Definition: DK_OOrchOther.h:87
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
dk_ooot_manual_cutting7
Definition: DK_OOrchOther.h:54
Crop::m_ManagementCategories
vector< FarmManagementCategory > m_ManagementCategories
Holds the translation between the farm operation enum for each crop and the farm management category ...
Definition: Farm.h:530
dk_ooot_manual_cutting10
Definition: DK_OOrchOther.h:57
dk_ooot_water6
Definition: DK_OOrchOther.h:67
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
dk_ooot_water2
Definition: DK_OOrchOther.h:63
dk_ooot_water1
Definition: DK_OOrchOther.h:44
dk_ooot_manual_cutting12
Definition: DK_OOrchOther.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
dk_ooot_cutting3
Definition: DK_OOrchOther.h:71
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
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_ooot_manual_cutting2
Definition: DK_OOrchOther.h:49
dk_ooot_planting
Definition: DK_OOrchOther.h:46
dk_ooot_copper_s
Definition: DK_OOrchOther.h:76
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
dk_ooot_manure2_s
Definition: DK_OOrchOther.h:60
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
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
dk_ooot_water5
Definition: DK_OOrchOther.h:66
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_ooot_manure1_p
Definition: DK_OOrchOther.h:43
dk_ooot_copper_p
Definition: DK_OOrchOther.h:77
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
Farm::OrganicFungicide
virtual bool OrganicFungicide(LE *a_field, double a_user, int a_days)
Biocide applied on a_field.
Definition: FarmFuncs.cpp:2231
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
dk_ooot_fungicide1
Definition: DK_OOrchOther.h:78
dk_ooot_manual_cutting11
Definition: DK_OOrchOther.h:58
DK_OOOT_BASE
#define DK_OOOT_BASE
Definition: DK_OOrchOther.h:26
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
dk_ooot_sow_grass
Definition: DK_OOrchOther.h:47
WARN_BUG
Definition: MapErrorMsg.h:34
dk_ooot_row_cultivation1
Definition: DK_OOrchOther.h:62
dk_ooot_cutting5
Definition: DK_OOrchOther.h:73
dk_ooot_row_cultivation2
Definition: DK_OOrchOther.h:75
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
dk_ooot_manual_cutting9
Definition: DK_OOrchOther.h:56
Farm::StubbleHarrowing
virtual bool StubbleHarrowing(LE *a_field, double a_user, int a_days)
Carry out stubble harrowing on a_field.
Definition: FarmFuncs.cpp:1523
dk_ooot_water3
Definition: DK_OOrchOther.h:64
dk_ooot_manual_cutting8
Definition: DK_OOrchOther.h:55