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

UKPotatoes class
. More...

#include <UKPotatoes.h>

Inheritance diagram for UKPotatoes:
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...
 
 UKPotatoes (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

UKPotatoes class
.

See UKPotatoes.h::UKPotatoesToDo for a complete list of all possible events triggered codes by the potatoes 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

◆ UKPotatoes()

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

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

Member Function Documentation

◆ Do()

bool UKPotatoes::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 m_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 potatoes.

Reimplemented from Crop.

66 {
67  /******************** This block can be added to the top of all Crop::Do methods ***********************************************/
68  m_farm = a_farm; // These assignments are necessary, not for this method but for related event calls
69  m_field = a_field;
70  m_ev = a_ev;
71  bool done = false; // The boolean value done indicates when we are totally finished with this plan (i.e. it is set to true).
72  int d1 = 0;
73  int noDates = 1;
74  TTypesOfVegetation l_tov = tov_UKPotatoes; // The current type - change to match the crop you have
75 /**********************************************To Here *************************************************************************/
76 
77  // Depending what event has occured jump to the correct bit of code
78  switch (m_ev->m_todo)
79  {
80  case uk_pot_start:
81  {
82  // uk_pot_start just sets up all the starting conditions and reference dates that are needed to start a uk_pot
83  UK_POT_STUBBLE_HARROW = false;
84 
86 
87  // Set up the date management stuff
88  // The next bit of code just allows for altering dates after harvest if it is necessary
89  // to allow for a crop which starts its management early.
90 
91  // 2 start and stop dates for all 'movable' events for this crop
92  int noDates = 1;
93  m_field->SetMDates(0, 0, g_date->DayInYear(31, 10)); // last possible day of harvest
94  m_field->SetMDates(1, 0, g_date->DayInYear(31, 10));
95 
96  m_field->SetMConstants(0, 1);
97 
98  // Check the next crop for early start, unless it is a spring crop
99  // in which case we ASSUME that no checking is necessary!!!!
100  // So DO NOT implement a crop that runs over the year boundary (i.e. from spring to spring!), at least not without fixing this.
101 
102  //new if: do the check only for non-optimising farms and if year>0. (030713 - ms_rotation used only in the hidden year, so I modified the condition from >7 to >0)
103  //optimising farms not used for now so most of related code is removed (but not in 'start' case)
104  if (!(m_farm->GetType() == tof_OptimisingFarm && g_date->GetYearNumber() > 0)) {
105 
106  if (m_ev->m_startday > g_date->DayInYear(1, 7)) {
107  if (m_field->GetMDates(0, 0) >= m_ev->m_startday)
108  {
109  g_msg->Warn(WARN_BUG, "UKPotatoes::Do(): ", "Harvest too late for the next crop to start!!!");
110  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
111  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
112  }
113  // Now fix any late finishing problems
114  for (int i = 0; i < noDates; i++) {
115  if (m_field->GetMDates(0, i) >= m_ev->m_startday) {
116  m_field->SetMDates(0, i, m_ev->m_startday - 1); //move the starting date
117  }
118  if (m_field->GetMDates(1, i) >= m_ev->m_startday) {
119  m_field->SetMConstants(i, 0); //change the default value of the MConst (=1) to 0 (necessary to correctly execute farm events in case the finishing date (MDate) was moved)
120  m_field->SetMDates(1, i, m_ev->m_startday - 1); //move the finishing date
121  }
122  }
123  }
124  // Now no operations can be timed after the start of the next crop.
125 
126  if (!m_ev->m_first_year) {
127  // Are we before July 1st?
128  d1 = g_date->OldDays() + g_date->DayInYear(1, 7);
129  if (g_date->Date() < d1) {
130  // Yes, too early. We assumme this is because the last crop was late
131  printf("Poly: %d\n", m_field->GetPoly());
132  g_msg->Warn(WARN_BUG, "UKPotatoes::Do(): ", "Crop start attempt between 1st Jan & 1st July");
133  int prev = m_field->GetLandscape()->BackTranslateVegTypes(m_field->GetOwner()->GetPreviousTov(m_field->GetRotIndex()));
134  g_msg->Warn(WARN_BUG, "Previous Crop ", prev);
135  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
136  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
137  exit(1);
138  }
139  else {
140  d1 = g_date->OldDays() + m_first_date; // Add 365 for spring crop
141  if (g_date->Date() > d1) {
142  // Yes too late - should not happen - raise an error
143  g_msg->Warn(WARN_BUG, "UKPotatoes::Do(): ", "Crop start attempt after last possible start date");
144  int prev = m_field->GetLandscape()->BackTranslateVegTypes(m_field->GetOwner()->GetPreviousTov(m_field->GetRotIndex()));
145  g_msg->Warn(WARN_BUG, "Previous Crop ", prev);
146  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
147  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
148  exit(1);
149  }
150  }
151  }
152  else {
153  // Is the first year
154  // Some special code to cope with that first start-up year in ALMaSS - ignore for all practical purposes
155  // Code for first spring treatment used
157  break;
158  }
159  }//if
160 
161  // End single block date checking code. Please see next line comment as well.
162  // Reinit d1 to first possible starting date.
163  d1 = g_date->OldDays() + g_date->DayInYear(1, 9);
165  }
166  break;
167  // This is the first real farm operation
168 
169  // Stubble cultivation / Stubble Harrow 100% September - October
171  if (!m_farm->StubbleHarrowing(m_field, 0.0, g_date->DayInYear(2, 11) - g_date->DayInYear())) {
173  break;
174  }
176  break;
177  // Winter plough 50% October - December.
179  if (m_ev->m_lock || m_farm->DoIt_prob(0.5))
180  {
181  if (!m_farm->WinterPlough(m_field, 0.0, g_date->DayInYear(1, 12) - g_date->DayInYear())) {
183  break;
184  }
185  if (m_farm->IsStockFarmer()) //Stock Farmer // setting the next step which is NPK fertiliser application
186  {
188  }
189  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(15, 3)+365, uk_pot_ferti_p1, false, m_farm, m_field);
190  break;
191  }
193  break;
195  if (!m_farm->SpringPlough(m_field, 0.0, g_date->DayInYear(28, 4) - g_date->DayInYear())) {
197  break;
198  }
199  if (m_farm->IsStockFarmer()) //Stock Farmer // setting the next step which is NPK fertiliser application
200  {
202  }
204  break;
205 
206  // Slurry Application 100% March-April.
207  // Slurry s1 and p1 - leads to s2 or p2
208  case uk_pot_ferti_s1:
209  if (!m_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(29, 4) - g_date->DayInYear())) {
211  break;
212  }
214  break;
215  case uk_pot_ferti_p1:
216  if (!m_farm->FP_Slurry(m_field, 0.0, g_date->DayInYear(29, 4) - g_date->DayInYear())) {
218  break;
219  }
221  break;
222  // NPK with sow 75% April
223  case uk_pot_ferti_s2:
224  if (m_ev->m_lock || m_farm->DoIt_prob(0.75))
225  {
226  if (!m_farm->FA_NPK(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
228  break;
229  }
230  }
232  break;
233  case uk_pot_ferti_p2:
234  if (m_ev->m_lock || m_farm->DoIt_prob(0.75))
235  {
236  if (!m_farm->FP_NPK(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
238  break;
239  }
240  }
242  break;
243  // Bed forming / Preseeding cultivation 100% April-May
244  case uk_pot_bed_forming:
245  if (!m_farm->BedForming(m_field, 0.0, g_date->DayInYear(9, 5) - g_date->DayInYear())) {
247  break;
248  }
250  break;
251  // Planting 100% April - May
253  if (!m_farm->SpringSow(m_field, 0.0, g_date->DayInYear(10, 5) - g_date->DayInYear())) {
255  break;
256  }
257  // Here is a fork leading to five parallel events
258  // Hilling, watering and Herbicides is MAIN THREAD. Fertiliser. Fungicide. Insecticide.
259  SimpleEvent_(g_date->Date() + 14, uk_pot_hilling1, false, m_farm, m_field); // Hilling + herbicides = MAIN THREAD
260  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 6), uk_pot_fungicide1, false, m_farm, m_field); // Fungicide thread
261  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 6), uk_pot_insecticide1, false, m_farm, m_field); // Insecticide thread
262  if (m_farm->IsStockFarmer()) //Stock Farmer // N thread
263  {
265  }
267  break;
268 
269  // N and MG+S THREAD
270  // Here comes N thread
271  // stock farmers thread first
272  // arable farmers thread second
273 
274  //stock farmers N thread
275  // N 75% June
276  case uk_pot_ferti_s3:
277  if (m_ev->m_lock || m_farm->DoIt_prob(0.75))
278  {
279  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(29, 6) - g_date->DayInYear())) {
281  break;
282  }
283  }
285  break;
286  // MG+S 25% June
287  case uk_pot_ferti_s4:
288  if (m_ev->m_lock || m_farm->DoIt_prob(0.25))
289  {
290  if (!m_farm->FA_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(30, 6) - g_date->DayInYear())) {
292  break;
293  }
294  }
295  // End of thread
296  break;
297 
298  //arable farmers N thread
299  // N 75% June
300  case uk_pot_ferti_p3:
301  if (m_ev->m_lock || m_farm->DoIt_prob(0.75))
302  {
303  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(29, 6) - g_date->DayInYear())) {
305  break;
306  }
307  }
309  break;
310  // MG+S 25% June
311  case uk_pot_ferti_p4:
312  if (m_ev->m_lock || m_farm->DoIt_prob(0.25))
313  {
314  if (!m_farm->FP_ManganeseSulphate(m_field, 0.0, g_date->DayInYear(30, 6) - g_date->DayInYear())) {
316  break;
317  }
318  }
319  // End of thread
320  break;
321 
322  // MAIN THREAD
323  // HILLING I + herbicides I-II
324  // Hilling 100% 2 weeks after planting
325  case uk_pot_hilling1:
326  if (!m_farm->HillingUp(m_field, 0.0, g_date->DayInYear(24, 5) - g_date->DayInYear())) {
328  break;
329  }
331  break;
332  // Herbicide1 80% after Hilling
333  case uk_pot_herbicide1:
334  if (m_ev->m_lock || m_farm->DoIt_prob(0.8))
335  {
336  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(25, 5) - g_date->DayInYear())) {
338  break;
339  }
340  }
342  break;
343  // Herbicide 2 50% 2-4 weeks after Herbicide 1
344  case uk_pot_herbicide2:
345  if (m_ev->m_lock || m_farm->DoIt_prob(0.5))
346  {
347  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(25, 6) - g_date->DayInYear())) {
349  break;
350  }
351  }
353  break;
354  // End of thread
355 
356  // Fungicide thread I-XIV
357  // Fungicide 1 100% June 1-7
358  case uk_pot_fungicide1:
359  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(7, 6) - g_date->DayInYear())) {
361  break;
362  }
364  break;
365  // Fungicide 2 100% June 8-14
366  case uk_pot_fungicide2:
367  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(14, 6) - g_date->DayInYear())) {
369  break;
370  }
372  break;
373  // Fungicide 3 100% June 15-21
374  case uk_pot_fungicide3:
375  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(21, 6) - g_date->DayInYear())) {
377  break;
378  }
380  break;
381  // Fungicide 4 100% June 22-29
382  case uk_pot_fungicide4:
383  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(28, 6) - g_date->DayInYear())) {
385  break;
386  }
388  break;
389  // Fungicide 5 100% July 1-7
390  case uk_pot_fungicide5:
391  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(7, 7) - g_date->DayInYear())) {
393  break;
394  }
396  break;
397  // Fungicide 6 100% July 8-14
398  case uk_pot_fungicide6:
399  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(14, 7) - g_date->DayInYear())) {
401  break;
402  }
404  break;
405  // Fungicide 7 100% July 15-21
406  case uk_pot_fungicide7:
407  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(21, 7) - g_date->DayInYear())) {
409  break;
410  }
412  break;
413  // Fungicide 8 80% July 22-28
414  case uk_pot_fungicide8:
415  if (m_ev->m_lock || m_farm->DoIt_prob(0.8))
416  {
417  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(28, 7) - g_date->DayInYear())) {
419  break;
420  }
421  }
423  break;
424  // Fungicide 9 80% August 1-7
425  case uk_pot_fungicide9:
426  if (m_ev->m_lock || m_farm->DoIt_prob(0.8))
427  {
428  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(7, 8) - g_date->DayInYear())) {
430  break;
431  }
432  }
434  break;
435  // Fungicide 10 70% August 8-14
436  case uk_pot_fungicide10:
437  if (m_ev->m_lock || m_farm->DoIt_prob(0.7))
438  {
439  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(14, 8) - g_date->DayInYear())) {
441  break;
442  }
443  }
445  break;
446  // Fungicide 11 70% August 15-21
447  case uk_pot_fungicide11:
448  if (m_ev->m_lock || m_farm->DoIt_prob(0.7))
449  {
450  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(21, 8) - g_date->DayInYear())) {
452  break;
453  }
454  }
456  break;
457  // Fungicide 12 60% August 22-29
458  case uk_pot_fungicide12:
459  if (m_ev->m_lock || m_farm->DoIt_prob(0.6))
460  {
461  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(28, 8) - g_date->DayInYear())) {
463  break;
464  }
465  }
467  break;
468  // Fungicide 13 60% September 1-7
469  case uk_pot_fungicide13:
470  if (m_ev->m_lock || m_farm->DoIt_prob(0.6))
471  {
472  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(7, 9) - g_date->DayInYear())) {
474  break;
475  }
476  }
478  break;
479  // Fungicide 14 60% September 8-14
480  case uk_pot_fungicide14:
481  if (m_ev->m_lock || m_farm->DoIt_prob(0.6))
482  {
483  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(14, 9) - g_date->DayInYear())) {
485  break;
486  }
487  }
488  // End of thread
489  break;
490 
491  // Insecticide thread I
492  // Insecticide 1 60% June
493  case uk_pot_insecticide1:
494  if (m_ev->m_lock || m_farm->DoIt_prob(0.6))
495  {
496  // here we check wheter we are using ERA pesticide or not
497  if (!cfg_pest_potatoes_on.value() ||
498  !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
499  {
500  if (!m_farm->InsecticideTreat(m_field, 0.0, g_date->DayInYear(30, 6) - g_date->DayInYear())) {
502  break;
503  }
504  }
505  else {
507  }
508  }
509  // End of thread
510  break;
511  // BACK TO MAIN THREAD
512  // Dessication I-II
513  // Dessication 1 100% 14 days before Harvest
514  case uk_pot_dessication1:
515  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(15, 10) - g_date->DayInYear())) {
517  break;
518  }
520  break;
521  // Dessication 2 75% 4-6 days after Dessication 1
522  case uk_pot_dessication2:
523  if (m_ev->m_lock || m_farm->DoIt_prob(0.75))
524  {
525  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(21, 10) - g_date->DayInYear())) {
527  break;
528  }
530  break;
531  }
533  break;
534 
535  // HARVEST
536  // Harvest 100% October
537  case uk_pot_harvest:
538  // We don't move harvest days
539  if (!m_farm->Harvest(m_field, 0.0, m_field->GetMDates(0, 0) - g_date->DayInYear())) {
541  break;
542  }
543  done = true;
544  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
545  // END of MAIN THREAD
546  break;
547  default:
548  g_msg->Warn(WARN_BUG, "UKPotatoes::Do(): "
549  "Unknown event type! ", "");
550  exit(1);
551  }
552  return done;
553 }

References Farm::BedForming(), cfg_pest_potatoes_on, cfg_pest_product_amounts, LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), Farm::DoIt_prob(), Farm::FA_AmmoniumSulphate(), Farm::FA_ManganeseSulphate(), Farm::FA_NPK(), Farm::FA_Slurry(), Farm::FP_AmmoniumSulphate(), Farm::FP_ManganeseSulphate(), Farm::FP_NPK(), Farm::FP_Slurry(), Farm::FungicideTreat(), g_date, g_msg, LE::GetMDates(), LE::GetOwner(), LE::GetPoly(), Farm::GetPreviousTov(), LE::GetRotIndex(), Farm::GetType(), Calendar::GetYearNumber(), Farm::Harvest(), Farm::HerbicideTreat(), Farm::HillingUp(), Farm::InsecticideTreat(), Farm::IsStockFarmer(), Crop::m_ev, Crop::m_farm, Crop::m_field, Crop::m_first_date, FarmEvent::m_first_year, FarmEvent::m_lock, FarmEvent::m_next_tov, FarmEvent::m_startday, FarmEvent::m_todo, Calendar::OldDays(), ppp_1, Farm::ProductApplication(), LE::SetMConstants(), LE::SetMDates(), Crop::SimpleEvent_(), Farm::SpringPlough(), Farm::SpringSow(), Farm::StubbleHarrowing(), tof_OptimisingFarm, tov_UKPotatoes, uk_pot_bed_forming, uk_pot_dessication1, uk_pot_dessication2, uk_pot_ferti_p1, uk_pot_ferti_p2, uk_pot_ferti_p3, uk_pot_ferti_p4, uk_pot_ferti_s1, uk_pot_ferti_s2, uk_pot_ferti_s3, uk_pot_ferti_s4, uk_pot_fungicide1, uk_pot_fungicide10, uk_pot_fungicide11, uk_pot_fungicide12, uk_pot_fungicide13, uk_pot_fungicide14, uk_pot_fungicide2, uk_pot_fungicide3, uk_pot_fungicide4, uk_pot_fungicide5, uk_pot_fungicide6, uk_pot_fungicide7, uk_pot_fungicide8, uk_pot_fungicide9, uk_pot_harvest, uk_pot_herbicide1, uk_pot_herbicide2, uk_pot_hilling1, uk_pot_insecticide1, uk_pot_spring_planting, uk_pot_spring_plough, uk_pot_start, UK_POT_STUBBLE_HARROW, uk_pot_stubble_harrow, uk_pot_winter_plough, CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), WARN_BUG, and Farm::WinterPlough().

◆ SetUpFarmCategoryInformation()

void UKPotatoes::SetUpFarmCategoryInformation ( )
inline
93  {
94  const int elements = 2 + (uk_pot_foobar - UKPOTATOES_BASE);
96  FarmManagementCategory catlist[elements] =
97  {
98  fmc_Others, // this needs to be at the zero line
99  fmc_Others,//uk_pot_start = 1, // Compulsory, must always be 1 (one).
100  fmc_Others,//uk_pot_sleep_all_day = UKPOTATOES_BASE,
101  fmc_Cultivation,//uk_pot_stubble_harrow, // Stubble cultivation 100% September-October
102  fmc_Cultivation,//uk_pot_winter_plough, // Winter plough 50% October-December
103  fmc_Fertilizer,//uk_pot_ferti_p1, // Slurry 100% March-April (if winter plough)
104  fmc_Fertilizer,//uk_pot_ferti_s1,
105  fmc_Cultivation,//uk_pot_spring_plough, // Spring plough 50% March-April (if no winter plough)
106  fmc_Fertilizer,//uk_pot_ferti_p2, // NPK with sow 75% April
107  fmc_Fertilizer,//uk_pot_ferti_s2,
108  fmc_Cultivation,//uk_pot_bed_forming, // Bed forming / Preseeding cultivation 100% April-May
109  fmc_Others,//uk_pot_spring_planting, // Planting 100% April-May
110  fmc_Fertilizer,//uk_pot_ferti_p3, // N 75% June
111  fmc_Fertilizer,//uk_pot_ferti_s3,
112  fmc_Fertilizer,//uk_pot_ferti_p4, // MG+S 25% June
113  fmc_Fertilizer,//uk_pot_ferti_s4,
114  fmc_Cultivation,//uk_pot_hilling1, // Hilling 100% 2 weeks after planting
115  fmc_Herbicide,//uk_pot_herbicide1, // Herbicide1 80% after Hilling
116  fmc_Herbicide,//uk_pot_herbicide2, // Herbicide2 50% 2-4 weeks after Herbicide1
117  fmc_Fungicide,//uk_pot_fungicide1, // Fungicide1 100% June 1-7
118  fmc_Fungicide,//uk_pot_fungicide2, // Fungicide2 100% June 8-14
119  fmc_Fungicide,//uk_pot_fungicide3, // Fungicide3 100% June 15-21
120  fmc_Fungicide,//uk_pot_fungicide4, // Fungicide4 100% June 22-29
121  fmc_Fungicide,//uk_pot_fungicide5, // Fungicide5 100% July 1-7
122  fmc_Fungicide,//uk_pot_fungicide6, // Fungicide6 100% July 8-14
123  fmc_Fungicide,//uk_pot_fungicide7, // Fungicide7 100% July 15-21
124  fmc_Fungicide,//uk_pot_fungicide8, // Fungicide8 80% July 22-28
125  fmc_Fungicide,//uk_pot_fungicide9, // Fungicide9 80% August 1-7
126  fmc_Fungicide,//uk_pot_fungicide10, // Fungicide10 70% August 8-14
127  fmc_Fungicide,//uk_pot_fungicide11, // Fungicide11 70% August 15-21
128  fmc_Fungicide,//uk_pot_fungicide12, // Fungicide12 60% August 22-29
129  fmc_Fungicide,//uk_pot_fungicide13, // Fungicide13 60% September 1-7
130  fmc_Fungicide,//uk_pot_fungicide14, // Fungicide14 60% September 8-14
131  fmc_Insecticide,//uk_pot_insecticide1, // Insecticide1 60% June
132  fmc_Herbicide,//uk_pot_dessication1, // Dessication1 100% 14 days before Harvest
133  fmc_Herbicide,//uk_pot_dessication2, // Dessication2 75% 4-6 days after Dessication 1
134  fmc_Harvest,//uk_pot_harvest, // Harvest 100% October
135  };
136  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
137  }

References fmc_Cultivation, fmc_Fertilizer, fmc_Fungicide, fmc_Harvest, fmc_Herbicide, fmc_Insecticide, fmc_Others, Crop::m_base_elements_no, Crop::m_ManagementCategories, uk_pot_foobar, and UKPOTATOES_BASE.

Referenced by UKPotatoes().


The documentation for this class was generated from the following files:
uk_pot_ferti_s2
Definition: UKPotatoes.h:41
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
uk_pot_fungicide8
Definition: UKPotatoes.h:58
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
LE::SetMDates
void SetMDates(int a, int b, int c)
Definition: Elements.h:406
Farm::SpringPlough
virtual bool SpringPlough(LE *a_field, double a_user, int a_days)
Carry out a ploughing event in the spring on a_field.
Definition: FarmFuncs.cpp:421
Farm::HerbicideTreat
virtual bool HerbicideTreat(LE *a_field, double a_user, int a_days)
Apply herbicide to a_field.
Definition: FarmFuncs.cpp:2025
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
uk_pot_fungicide2
Definition: UKPotatoes.h:52
uk_pot_ferti_s3
Definition: UKPotatoes.h:45
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
uk_pot_herbicide2
Definition: UKPotatoes.h:50
Farm::FP_ManganeseSulphate
virtual bool FP_ManganeseSulphate(LE *a_field, double a_user, int a_days)
Apply Manganse Sulphate to a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:840
uk_pot_fungicide3
Definition: UKPotatoes.h:53
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
uk_pot_fungicide7
Definition: UKPotatoes.h:57
Calendar::GetYearNumber
int GetYearNumber(void)
Definition: Calendar.h:72
uk_pot_fungicide6
Definition: UKPotatoes.h:56
UKPotatoes::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: UKPotatoes.h:93
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
uk_pot_harvest
Definition: UKPotatoes.h:68
LE::GetPoly
int GetPoly(void)
Returns the polyref number for this polygon.
Definition: Elements.h:238
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.
uk_pot_insecticide1
Definition: UKPotatoes.h:65
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
uk_pot_ferti_s4
Definition: UKPotatoes.h:47
Farm::BedForming
virtual bool BedForming(LE *a_field, double a_user, int a_days)
Do bed forming up on a_field, probably of carrots.
Definition: FarmFuncs.cpp:1316
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
Farm::GetPreviousTov
TTypesOfVegetation GetPreviousTov(int a_index)
Definition: Farm.h:966
uk_pot_fungicide10
Definition: UKPotatoes.h:60
uk_pot_ferti_p1
Definition: UKPotatoes.h:37
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
uk_pot_ferti_s1
Definition: UKPotatoes.h:38
Farm::GetType
TTypesOfFarm GetType(void)
Definition: Farm.h:956
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
FarmEvent::m_startday
int m_startday
Definition: Farm.h:385
Farm::FA_NPK
virtual bool FA_NPK(LE *a_field, double a_user, int a_days)
Apply NPK fertilizer to a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:982
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
Farm::HillingUp
virtual bool HillingUp(LE *a_field, double a_user, int a_days)
Do hilling up on a_field, probably of potatoes.
Definition: FarmFuncs.cpp:1302
uk_pot_ferti_p3
Definition: UKPotatoes.h:44
uk_pot_start
Definition: UKPotatoes.h:33
UKPOTATOES_BASE
#define UKPOTATOES_BASE
Definition: UKPotatoes.h:21
CfgBool::value
bool value() const
Definition: Configurator.h:164
uk_pot_ferti_p2
Definition: UKPotatoes.h:40
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
uk_pot_dessication1
Definition: UKPotatoes.h:66
tov_UKPotatoes
Definition: LandscapeFarmingEnums.h:282
Calendar::Date
long Date(void)
Definition: Calendar.h:57
uk_pot_fungicide4
Definition: UKPotatoes.h:54
Farm::FP_AmmoniumSulphate
virtual bool FP_AmmoniumSulphate(LE *a_field, double a_user, int a_days)
Apply Ammonium Sulphate to a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:882
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
uk_pot_hilling1
Definition: UKPotatoes.h:48
uk_pot_fungicide1
Definition: UKPotatoes.h:51
uk_pot_dessication2
Definition: UKPotatoes.h:67
Farm::FA_ManganeseSulphate
virtual bool FA_ManganeseSulphate(LE *a_field, double a_user, int a_days)
Apply manganese sulphate to a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1095
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
uk_pot_foobar
Definition: UKPotatoes.h:69
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
uk_pot_stubble_harrow
Definition: UKPotatoes.h:35
LE::GetRotIndex
int GetRotIndex(void)
Definition: Elements.h:373
uk_pot_fungicide9
Definition: UKPotatoes.h:59
UK_POT_STUBBLE_HARROW
#define UK_POT_STUBBLE_HARROW
A flag used to indicate autumn ploughing status.
Definition: UKPotatoes.h:25
FarmEvent::m_next_tov
TTypesOfVegetation m_next_tov
Definition: Farm.h:390
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
uk_pot_ferti_p4
Definition: UKPotatoes.h:46
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
Farm::FP_Slurry
virtual bool FP_Slurry(LE *a_field, double a_user, int a_days)
Apply slurry to a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:823
uk_pot_fungicide5
Definition: UKPotatoes.h:55
tof_OptimisingFarm
Definition: LandscapeFarmingEnums.h:696
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
Farm::FA_AmmoniumSulphate
virtual bool FA_AmmoniumSulphate(LE *a_field, double a_user, int a_days)
Apply ammonium sulphate to a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1081
uk_pot_spring_planting
Definition: UKPotatoes.h:43
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
uk_pot_winter_plough
Definition: UKPotatoes.h:36
uk_pot_bed_forming
Definition: UKPotatoes.h:42
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
Farm::WinterPlough
virtual bool WinterPlough(LE *a_field, double a_user, int a_days)
Carry out a ploughing event in the winter on a_field.
Definition: FarmFuncs.cpp:395
uk_pot_fungicide14
Definition: UKPotatoes.h:64
uk_pot_fungicide11
Definition: UKPotatoes.h:61
LE::GetOwner
Farm * GetOwner(void)
Definition: Elements.h:256
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
uk_pot_fungicide13
Definition: UKPotatoes.h:63
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
uk_pot_fungicide12
Definition: UKPotatoes.h:62
WARN_BUG
Definition: MapErrorMsg.h:34
cfg_pest_potatoes_on
CfgBool cfg_pest_potatoes_on
Turn on pesticides for potatoes.
ppp_1
Definition: LandscapeFarmingEnums.h:1079
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
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
Crop::SimpleEvent_
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.
Definition: Farm.cpp:751
uk_pot_spring_plough
Definition: UKPotatoes.h:39
uk_pot_herbicide1
Definition: UKPotatoes.h:49