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

DK_Cabbages class
. More...

#include <DK_Cabbages.h>

Inheritance diagram for DK_Cabbages:
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_Cabbages (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_Cabbages class
.

See DK_Cabbages.h::DK_CabbagesToDo for a complete list of all possible events triggered codes by the cabbage 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_Cabbages()

DK_Cabbages::DK_Cabbages ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
81  : Crop(a_tov, a_toc, a_L)
82  {
83  // When we start it off, the first possible date for a farm operation is ...
84  // This information is used by other crops when they decide how much post processing of
85  // the management is allowed after harvest before the next crop starts.
86  m_first_date=g_date->DayInYear( 1, 12 );
88  }

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

Member Function Documentation

◆ Do()

bool DK_Cabbages::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 - in this case conventional cabbage.

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_ca_start:
78  {
79  // dk_ca_start just sets up all the starting conditions and reference dates that are needed to start a dk_ca
80  DK_CA_WINTER_PLOUGH = false;
81  DK_CA_FORCESPRING = false;
82  m_last_date = g_date->DayInYear(30, 11); // Should match the last flexdate below
83  //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
84  std::vector<std::vector<int>> flexdates(1 + 1, std::vector<int>(2, 0));
85  // Set up the date management stuff
86  // Start and stop dates for all events after harvest
87  flexdates[0][1] = g_date->DayInYear(30, 11); // last possible day of harvest - this is in effect day before the earliest date that a following crop can use
88  // Now these are done in pairs, start & end for each operation. If its not used then -1
89  flexdates[1][0] = -1; // This date will be moved back as far as necessary and potentially to flexdates 1 (start op 1)
90  flexdates[1][1] = -1; // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 1)
91 
92 
93  // 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
94  int isSpring = 0;
95  if (StartUpCrop(isSpring, flexdates, int(dk_ca_molluscicide1))) break;
96 
97  // End single block date checking code. Please see next line comment as well.
98  // Reinit d1 to first possible starting date.
99  d1 = g_date->OldDays() + g_date->DayInYear(1, 9);
100  // OK, let's go.
101  // Here we queue up the first event which changes dependent on whether it is a forced spring sow or not
102  if (m_ev->m_forcespring) {
103  int day_num_shift = 365;
104  if (g_date->DayInYear() < 70) day_num_shift = 0;
105  SimpleEvent(g_date->OldDays() + g_date->DayInYear(25, 2) + day_num_shift, dk_ca_molluscicide1, false);
106  break;
107  DK_CA_FORCESPRING = true;
108  }
109  else SimpleEvent(d1, dk_ca_autumn_harrow_clay, false);
110  break;
111  }
112  break;
113 
114  // LKM: This is the first real farm operation - autumn plough if clay soil - done before 30th of October, if not done, try again until the 30th of October when we will succeed
116  if (m_field->GetSoilType() != tos_Sand && m_field->GetSoilType() != tos_LoamySand && m_field->GetSoilType() != tos_SandyLoam && m_field->GetSoilType() != tos_SandyClayLoam) // on clay soils (NL KLEI & VEEN)
117  {
118  if (!m_farm->AutumnHarrow(m_field, 0.0, g_date->DayInYear(1, 12) - g_date->DayInYear())) {
120  break;
121  }
122  SimpleEvent(g_date->OldDays() + g_date->DayInYear(25, 2) + 365, dk_ca_molluscicide1, false);
123  break;
124  }
125  else
126  {
127  SimpleEvent(g_date->OldDays() + g_date->DayInYear(25, 2) + 365, dk_ca_molluscicide1, false);
128  break;
129  }
130  // LKM: do it before the 10th of May (suggests 50% of all do this - after the 25th of February next year)
131  case dk_ca_molluscicide1:
132  if (m_ev->m_lock || m_farm->DoIt_prob(0.50))
133  {
134  if (!a_farm->Molluscicide(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
136  break;
137  }
138  }
139  // LKM: Queue up the next event - shallow harrow1 (making seedbed) done after the 1st of March and before the 30th of April - if not done, try again +1 day until the 30th of April when we will succeed
141  break;
142  case dk_ca_sharrow1:
143  if (!m_farm->ShallowHarrow(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear()))
144  {
145  SimpleEvent(g_date->Date() + 1, dk_ca_sharrow1, true);
146  break;
147  }
148  // LKM: Queue up the next event - shallow harrow2 (making seedbed) done 5 days after, and before the 10th of May - if not done, try again +1 day until the 10th of May when we will succeed
149  SimpleEvent(g_date->Date() + 10, dk_ca_sharrow2, false);
150  break;
151  case dk_ca_sharrow2:
152  if (!m_farm->ShallowHarrow(m_field, 0.0, g_date->DayInYear(10, 5) - g_date->DayInYear()))
153  {
154  SimpleEvent(g_date->Date() + 1, dk_ca_sharrow2, true);
155  break;
156  }
157  // LKM: Queue up the next event - shallow harrow3 (making seedbed) done 5 days after, and before the 20th of May - if not done, try again +1 day until the 20th of May when we will succeed
158  SimpleEvent(g_date->Date() + 10, dk_ca_sharrow3, false);
159  break;
160  case dk_ca_sharrow3:
161  if (!m_farm->ShallowHarrow(m_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear()))
162  {
163  SimpleEvent(g_date->Date() + 1, dk_ca_sharrow3, true);
164  break;
165  }
166  // LKM: Queue up the next event - shallow harrow4 (making seedbed) done 5 days after, and before the 30th of May - if not done, try again +1 day until the 30th of May when we will succeed
167  SimpleEvent(g_date->Date() + 10, dk_ca_sharrow4, false);
168  break;
169  case dk_ca_sharrow4:
170  if (!m_farm->ShallowHarrow(m_field, 0.0, g_date->DayInYear(30, 5) - g_date->DayInYear()))
171  {
172  SimpleEvent(g_date->Date() + 1, dk_ca_sharrow4, true);
173  break;
174  }
175  // LKM: Queue up next event - herbicide1, used if still weeds after false seedbed (same day, before planting, no later than 30th of May)
177  break;
178  case dk_ca_herbicide1:
179  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(30, 5) - g_date->DayInYear()))
180  {
181  SimpleEvent(g_date->Date() + 1, dk_ca_herbicide1, true);
182  break;
183  }
184  // LKM: Queue up the next event - planting done (together with fertilizer) the day after, and before 30th of May - if not done, try again +1 day until the 30th of May when we will succeed
185  SimpleEvent(g_date->Date() + 1, dk_ca_plant, false);
186  break;
187  case dk_ca_plant:
189  {
190  SimpleEvent(g_date->Date() + 1, dk_ca_plant, true);
191  break;
192  }
193  // LKM: Queue up the next event - watering done same day as planting, and before 30th of May - if not done, try again +1 day until the 30th of May when we will succeed
194  SimpleEvent(g_date->Date(), dk_ca_water, false);
195  break;
196  case dk_ca_water:
197  if (!m_farm->Water(m_field, 0.0, g_date->DayInYear(30, 5) - g_date->DayInYear()))
198  {
199  SimpleEvent(g_date->Date() + 1, dk_ca_water, true);
200  break;
201  }
202  //LKM: Queue up next event molluscicide 2 (suggests 50% of all do this
203  SimpleEvent(g_date->Date() + 1, dk_ca_molluscicide2, false);
204  break;
205  // LKM: do it before the 1st of June
206  case dk_ca_molluscicide2:
207  if (m_ev->m_lock || m_farm->DoIt_prob(0.50))
208  {
209  if (!m_farm->Molluscicide(m_field, 0.0, g_date->DayInYear(1, 6) - g_date->DayInYear())) {
211  break;
212  }
213  }
214  // LKM: Queue up next event - herbicide2, just after planting (same day, before planting, no later than 3rd of June)
216  break;
217  case dk_ca_herbicide2:
218  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(3, 6) - g_date->DayInYear()))
219  {
220  SimpleEvent(g_date->Date() + 1, dk_ca_herbicide2, true);
221  break;
222  }
223  // LKM: Here is a fork leading to five parallel events
224  SimpleEvent(g_date->Date() + 7, dk_ca_strigling1, false); // Strigling thread
225  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5), dk_ca_herbicide3, false); // Herbicide thread
226  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5), dk_ca_row_cultivation_clay, false); // Weeding thread
227  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5) + m_date_modifier, dk_ca_insecticide1, false); // Insecticide thread
228  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6), dk_ca_fungicide1, false); // Fungicide thread, main thread
229  break;
230  case dk_ca_strigling1:
231  // Here comes the strigling thread
232  if (!m_farm->Strigling(m_field, 0.0, g_date->DayInYear(10, 6) - g_date->DayInYear()))
233  {
234  SimpleEvent(g_date->Date() + 1, dk_ca_strigling1, true);
235  break;
236  }
237  // LKM: Queue up the next event - strigling2 (making seedbed) done 8 days after, and before the 18th of June - if not done, try again +1 day until the 15th of June when we will succeed
238  SimpleEvent(g_date->Date() + 8, dk_ca_strigling2, false);
239  break;
240  case dk_ca_strigling2:
241  if (!m_farm->Strigling(m_field, 0.0, g_date->DayInYear(18, 6) - g_date->DayInYear()))
242  {
243  SimpleEvent(g_date->Date() + 1, dk_ca_strigling2, true);
244  break;
245  }
246  // LKM: Queue up the next event - strigling3 (making seedbed) done 8 days after, and before the 26th of June - if not done, try again +1 day until the 23th of June when we will succeed
247  SimpleEvent(g_date->Date() + 8, dk_ca_strigling3, false);
248  break;
249  case dk_ca_strigling3:
250  if (!m_farm->Strigling(m_field, 0.0, g_date->DayInYear(26, 6) - g_date->DayInYear()))
251  {
252  SimpleEvent(g_date->Date() + 1, dk_ca_strigling3, true);
253  break;
254  }
255  // End of thread
256  break;
257  case dk_ca_herbicide3:
258  // Here comes the herbicide thread
259  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(30, 6) - g_date->DayInYear()))
260  {
261  SimpleEvent(g_date->Date() + 1, dk_ca_herbicide3, true);
262  break;
263  }
264  // LKM: Queue up next event - herbicide4, done in May-July if still weeds
265  SimpleEvent(g_date->Date() + 1, dk_ca_herbicide4, false);
266  break;
267  case dk_ca_herbicide4:
268  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(30, 7) - g_date->DayInYear()))
269  {
270  SimpleEvent(g_date->Date() + 1, dk_ca_herbicide4, true);
271  break;
272  }
273  // End of Thread
274  break;
276  // Here comes the weeding thread - row cultivation (if clay soil) done before the 30th of June - if not done, try again +1 day until the 30th of June when we will succeed
277  if (m_field->GetSoilType() != tos_Sand && m_field->GetSoilType() != tos_LoamySand && m_field->GetSoilType() != tos_SandyLoam && m_field->GetSoilType() != tos_SandyClayLoam) // on clay soils (NL KLEI & VEEN)
278  {
279 
280  if (!m_farm->RowCultivation(m_field, 0.0, g_date->DayInYear(30, 6) - g_date->DayInYear())) {
282  break;
283  }
284 
285  }
286  // LKM: Queue up the next event - manual weeding, done before the 30th of July - if not done, try again +1 day until the 30th of July when we will succeed
288  break;
290  if (!m_farm->ManualWeeding(m_field, 0.0, g_date->DayInYear(30, 7) - g_date->DayInYear()))
291  {
293  break;
294  }
295  // LKM: Queue up the next event - fertilizer2 done after the 20th of July, and before 10th of August - if not done, try again +1 day until the 10th of August when we will succeed
296  SimpleEvent(g_date->Date() + 1, dk_ca_ferti2, false);
297  break;
298  case dk_ca_ferti2:
299  if (!m_farm->FP_Manure(m_field, 0.0, g_date->DayInYear(10, 8) - g_date->DayInYear()))
300  {
301  SimpleEvent(g_date->Date() + 1, dk_ca_ferti2, true);
302  break;
303  }
304  // End of thread
305  break;
306  case dk_ca_insecticide1:
307  // here we check whether we are using ERA pesticide or not
308  d1 = g_date->DayInYear(15, 8) - g_date->DayInYear();
309  if (!cfg_pest_cabbage_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
310  {
311  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
312  }
313  else {
314  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 3);
315  }
316  if (!flag) {
317  SimpleEvent(g_date->Date() + 1, dk_ca_insecticide1, true);
318  break;
319  }
321  break;
322  // LKM: Queue up next event - insecticides (split into 3 suggest 33% does each)
323  // LKM: do insecticide1_2b 7 days after first spray, no later than 22nd of August
325  if (m_ev->m_lock || m_farm->DoIt_prob(0.33) || AphidDamage(m_field)) {
326  // here we check whether we are using ERA pesticide or not
327  d1 = g_date->DayInYear(22, 8) - g_date->DayInYear();
328  if (!cfg_pest_cabbage_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
329  {
330  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
331  }
332  else {
333  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 3);
334  }
335  if (!flag) {
337  break;
338  }
339  }
340  else if (m_ev->m_lock || m_farm->DoIt_prob(0.33 / 0.67) || AphidDamage(m_field))
341  {
342  SimpleEvent(g_date->Date() + 14, dk_ca_insecticide1_2a, false);
343  }
344  break;
345  // LKM: do insecticide1_2a 14 days after first spray, no later than 30th of August
347  // here we check whether we are using ERA pesticide or not
348  d1 = g_date->DayInYear(30, 8) - g_date->DayInYear();
349  if (!cfg_pest_cabbage_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
350  {
351  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
352  }
353  else {
354  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 3);
355  }
356  if (!flag) {
358  break;
359  }
360  // end insecticide thread
361  break;
362  // LKM: do insecticide1_3b
364  // here we check whether we are using ERA pesticide or not
365  d1 = g_date->DayInYear(30, 8) - g_date->DayInYear();
366  if (!cfg_pest_cabbage_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
367  {
368  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
369  }
370  else {
371  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 3);
372  }
373  if (!flag) {
375  break;
376  }
377  //End of thread
378  break;
379  // LKM: fungicide1 done before the 30th of August
380  case dk_ca_fungicide1:
381  // Here comes the fungicide thread
382  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(30, 8) - g_date->DayInYear()))
383  {
384  SimpleEvent(g_date->Date() + 1, dk_ca_fungicide1, true);
385  break;
386  }
387  SimpleEvent(g_date->Date() + 14, dk_ca_fungicide1_2, false);
388  break;
389  // Queue up next event - more sprays of fungicide (suggesting only 50% do this) - no earlier than 14 days after, but before no later than 21st of September
390  case dk_ca_fungicide1_2:
391  if (m_ev->m_lock || m_farm->DoIt_prob(0.50)) {
392  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(21, 9) - g_date->DayInYear()))
393  {
394  SimpleEvent(g_date->Date() + 1, dk_ca_fungicide1_2, true);
395  break;
396  }
397  SimpleEvent(g_date->Date() + 14, dk_ca_fungicide1_3, false);
398  break;
399  }
400  else
401  {
402  SimpleEvent(g_date->OldDays() + g_date->DayInYear(15, 6), dk_ca_harvest, false);
403  break;
404  }
405  case dk_ca_fungicide1_3:
406  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(15, 10) - g_date->DayInYear()))
407  {
408  SimpleEvent(g_date->Date() + 1, dk_ca_fungicide1_3, true);
409  break;
410  }
411  // End of thread
412  // LKM: Queue up the next event - harvest cabbages, done before the 30th of November - if not done, try again +1 day until the 30th of November when we will succeed
413  SimpleEvent(g_date->OldDays() + g_date->DayInYear(15, 6), dk_ca_harvest, false);
414  break;
415  case dk_ca_harvest:
416  if (!m_farm->Harvest(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
417  SimpleEvent(g_date->Date() + 1, dk_ca_harvest, true);
418  break;
419  //if (!m_farm->Harvest(m_field, 0.0, g_date->DayInYear(30, 11) - g_date->DayInYear()))
420  //{
421  // SimpleEvent(g_date->Date() + 1, dk_ca_harvest, true);
422  // break;
423  //}
424  }
425  d1 = g_date->Date();
426  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 7)) {
427  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 7), dk_ca_wait, false);
428  // Because we are ending harvest before 1.7 so we need to wait until the 1.7
429  break;
430  }
431  else {
432  done = true; // end of plan
433  }
434  case dk_ca_wait:
435  done = true;
436  break;
437  // So we are done, and somewhere else the farmer will queue up the start event of the next crop
438  // END of MAIN THREAD
439  break;
440  default:
441  g_msg->Warn(WARN_BUG, "DK_Cabbages::Do(): "
442  "Unknown event type! ", "");
443  exit(1);
444  }
445  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
446  return done;
447 }

References Crop::AphidDamage(), Farm::AutumnHarrow(), cfg_pest_cabbage_on, cfg_pest_product_amounts, Calendar::Date(), Calendar::DayInYear(), dk_ca_autumn_harrow_clay, dk_ca_ferti2, DK_CA_FORCESPRING, dk_ca_fungicide1, dk_ca_fungicide1_2, dk_ca_fungicide1_3, dk_ca_harvest, dk_ca_herbicide1, dk_ca_herbicide2, dk_ca_herbicide3, dk_ca_herbicide4, dk_ca_insecticide1, dk_ca_insecticide1_2a, dk_ca_insecticide1_2b, dk_ca_insecticide1_3b, dk_ca_manual_weeding, dk_ca_molluscicide1, dk_ca_molluscicide2, dk_ca_plant, dk_ca_row_cultivation_clay, dk_ca_sharrow1, dk_ca_sharrow2, dk_ca_sharrow3, dk_ca_sharrow4, dk_ca_start, dk_ca_strigling1, dk_ca_strigling2, dk_ca_strigling3, dk_ca_wait, dk_ca_water, DK_CA_WINTER_PLOUGH, Farm::DoIt_prob(), Farm::FP_Manure(), Farm::FungicideTreat(), g_date, g_msg, LE::GetMDates(), LE::GetSoilType(), Farm::Harvest(), Farm::HerbicideTreat(), Farm::InsecticideTreat(), 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, Farm::ManualWeeding(), Farm::Molluscicide(), Calendar::OldDays(), ppp_1, Farm::ProductApplication(), Farm::RowCultivation(), Farm::ShallowHarrow(), Crop::SimpleEvent(), Farm::SpringSowWithFerti(), Crop::StartUpCrop(), Farm::Strigling(), tos_LoamySand, tos_Sand, tos_SandyClayLoam, tos_SandyLoam, tov_DKCabbages, CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), WARN_BUG, and Farm::Water().

◆ SetUpFarmCategoryInformation()

void DK_Cabbages::SetUpFarmCategoryInformation ( )
inline
89  {
90  const int elements = 2 + (dk_ca_foobar - DK_CA_BASE);
92 
93  FarmManagementCategory catlist[elements] =
94  {
95  fmc_Others, // zero element unused but must be here
96  fmc_Others, // dk_ca_start = 1, // Compulsory, must always be 1 (one).
97  fmc_Harvest, // dk_ca_harvest = DK_CA_BASE,
98  fmc_Insecticide, // dk_ca_molluscicide1,
99  fmc_Cultivation, // dk_ca_autumn_harrow_clay,
100  fmc_Cultivation, // dk_ca_sharrow1,
101  fmc_Cultivation, // dk_ca_sharrow2,
102  fmc_Cultivation, // dk_ca_sharrow3,
103  fmc_Cultivation, // dk_ca_sharrow4,
104  fmc_Herbicide, // dk_ca_herbicide1,
105  fmc_Others, // dk_ca_plant,
106  fmc_Watering, // dk_ca_water,
107  fmc_Insecticide, // dk_ca_molluscicide2,
108  fmc_Herbicide, // dk_ca_herbicide2,
109  fmc_Cultivation, // dk_ca_strigling1,
110  fmc_Cultivation, // dk_ca_strigling2,
111  fmc_Cultivation, // dk_ca_strigling3,
112  fmc_Herbicide, // dk_ca_herbicide3,
113  fmc_Cultivation, // dk_ca_row_cultivation_clay,
114  fmc_Herbicide, // dk_ca_herbicide4,
115  fmc_Insecticide, // dk_ca_insecticide1,
116  fmc_Insecticide, // dk_ca_insecticide1_2a,
117  fmc_Insecticide, // dk_ca_insecticide1_2b,
118  fmc_Insecticide, // dk_ca_insecticide1_3b,
119  fmc_Cultivation, // dk_ca_manual_weeding,
120  fmc_Fertilizer, // dk_ca_ferti2,
121  fmc_Fungicide, // dk_ca_fungicide1,
122  fmc_Fungicide, // dk_ca_fungicide1_2,
123  fmc_Fungicide, // dk_ca_fungicide1_3,
124  fmc_Others // dk_ca_wait,
125  // no foobar entry
126 
127  };
128  // Iterate over the catlist elements and copy them to vector
129  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
130  }

References DK_CA_BASE, dk_ca_foobar, fmc_Cultivation, 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_Cabbages().


The documentation for this class was generated from the following files:
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
dk_ca_herbicide2
Definition: DK_Cabbages.h:48
dk_ca_molluscicide1
Definition: DK_Cabbages.h:38
FarmEvent::m_forcespring
bool m_forcespring
Definition: Farm.h:392
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
Farm::HerbicideTreat
virtual bool HerbicideTreat(LE *a_field, double a_user, int a_days)
Apply herbicide to a_field.
Definition: FarmFuncs.cpp:2025
Farm::Strigling
virtual bool Strigling(LE *a_field, double a_user, int a_days)
Carry out a mechanical weeding on a_field.
Definition: FarmFuncs.cpp:1206
dk_ca_water
Definition: DK_Cabbages.h:46
Farm::Harvest
virtual bool Harvest(LE *a_field, double a_user, int a_days)
Carry out a harvest on a_field.
Definition: FarmFuncs.cpp:1364
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
dk_ca_ferti2
Definition: DK_Cabbages.h:60
dk_ca_foobar
Definition: DK_Cabbages.h:65
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_ca_fungicide1_3
Definition: DK_Cabbages.h:63
dk_ca_start
Definition: DK_Cabbages.h:36
Farm::Molluscicide
virtual bool Molluscicide(LE *a_field, double a_user, int a_days)
Apply molluscicide to a_field.
Definition: FarmFuncs.cpp:2310
tos_SandyClayLoam
Definition: LandscapeFarmingEnums.h:722
DK_CA_BASE
#define DK_CA_BASE
Definition: DK_Cabbages.h:23
dk_ca_row_cultivation_clay
Definition: DK_Cabbages.h:53
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
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
dk_ca_sharrow3
Definition: DK_Cabbages.h:42
dk_ca_insecticide1_2b
Definition: DK_Cabbages.h:57
tos_SandyLoam
Definition: LandscapeFarmingEnums.h:721
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
dk_ca_plant
Definition: DK_Cabbages.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
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
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
dk_ca_sharrow4
Definition: DK_Cabbages.h:43
dk_ca_herbicide4
Definition: DK_Cabbages.h:54
dk_ca_herbicide3
Definition: DK_Cabbages.h:52
DK_CA_WINTER_PLOUGH
#define DK_CA_WINTER_PLOUGH
A flag used to indicate autumn ploughing status.
Definition: DK_Cabbages.h:27
dk_ca_sharrow1
Definition: DK_Cabbages.h:40
Calendar::Date
long Date(void)
Definition: Calendar.h:57
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
dk_ca_wait
Definition: DK_Cabbages.h:64
LE::GetSoilType
int GetSoilType()
Definition: Elements.h:302
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
dk_ca_fungicide1
Definition: DK_Cabbages.h:61
fmc_Watering
Definition: LandscapeFarmingEnums.h:1011
dk_ca_strigling1
Definition: DK_Cabbages.h:49
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
dk_ca_insecticide1_2a
Definition: DK_Cabbages.h:56
dk_ca_herbicide1
Definition: DK_Cabbages.h:44
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
dk_ca_strigling3
Definition: DK_Cabbages.h:51
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::ManualWeeding
virtual bool ManualWeeding(LE *a_field, double a_user, int a_days)
Manual weeding on a_field - no tramlines since weeding by hand, the bush stays on field with same veg...
Definition: FarmFuncs.cpp:2002
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
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
tos_Sand
Definition: LandscapeFarmingEnums.h:719
Farm::ShallowHarrow
virtual bool ShallowHarrow(LE *a_field, double a_user, int a_days)
Carry out a shallow harrow event on a_field, e.g., after grass cutting event.
Definition: FarmFuncs.cpp:473
dk_ca_insecticide1_3b
Definition: DK_Cabbages.h:58
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
Farm::SpringSowWithFerti
virtual bool SpringSowWithFerti(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 with start fertilizer in the spring on a_field.
Definition: FarmFuncs.cpp:537
DK_CA_FORCESPRING
#define DK_CA_FORCESPRING
Definition: DK_Cabbages.h:28
Farm::AutumnHarrow
virtual bool AutumnHarrow(LE *a_field, double a_user, int a_days)
Carry out a harrow event in the autumn on a_field.
Definition: FarmFuncs.cpp:285
tov_DKCabbages
Definition: LandscapeFarmingEnums.h:351
dk_ca_harvest
Definition: DK_Cabbages.h:37
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
dk_ca_sharrow2
Definition: DK_Cabbages.h:41
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.
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
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
dk_ca_insecticide1
Definition: DK_Cabbages.h:55
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
dk_ca_fungicide1_2
Definition: DK_Cabbages.h:62
dk_ca_manual_weeding
Definition: DK_Cabbages.h:59
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
dk_ca_strigling2
Definition: DK_Cabbages.h:50
DK_Cabbages::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: DK_Cabbages.h:89
Crop::AphidDamage
bool AphidDamage(LE *a_field)
Compares aphid numbers per m2 with a threshold to return true if threshold is exceeded.
Definition: Farm.cpp:726
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
tos_LoamySand
Definition: LandscapeFarmingEnums.h:720
dk_ca_autumn_harrow_clay
Definition: DK_Cabbages.h:39
cfg_pest_cabbage_on
CfgBool cfg_pest_cabbage_on
Turn on pesticides for cabbage.
dk_ca_molluscicide2
Definition: DK_Cabbages.h:47
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001