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

UKPermanentGrass class
. More...

#include <UKPermanentGrass.h>

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

UKPermanentGrass class
.

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

◆ UKPermanentGrass()

UKPermanentGrass::UKPermanentGrass ( 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 March
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.
92  }

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

Member Function Documentation

◆ Do()

bool UKPermanentGrass::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 PermanentGrassGrazed.

Reimplemented from Crop.

56 {
57  /******************** This block can be added to the top of all Crop::Do methods ***********************************************/
58  m_farm = a_farm; // These assignments are necessary, not for this method but for related event calls
59  m_field = a_field;
60  m_ev = a_ev;
61  bool done = false; // The boolean value done indicates when we are totally finished with this plan (i.e. it is set to true).
62  int d1 = 0;
63  int noDates = 1;
64  TTypesOfVegetation l_tov = tov_UKPermanentGrass; // The current type - change to match the crop you have
65 /**********************************************To Here *************************************************************************/
66 
67  // Depending what event has occured jump to the correct bit of code
68  switch (m_ev->m_todo)
69  {
70  case uk_pg_start:
71  {
72  // uk_pg_start just sets up all the starting conditions and reference dates that are needed to start a uk_pot
73  UK_PG_FERTI_DATE = 0;
74  UK_PG_CUT_DATE = 0;
75  UK_PG_WATER_DATE = 0;
76 
78 
79  // Set up the date management stuff
80  // The next bit of code just allows for altering dates after harvest if it is necessary
81  // to allow for a crop which starts its management early.
82 
83  // 1 start and stop dates for all 'movable' events for this crop
84  int noDates = 1;
85  m_field->SetMDates(0, 0, g_date->DayInYear(10, 10)); // last possible day of last cutting
86  m_field->SetMDates(1, 0, g_date->DayInYear(30, 10)); // last possible day of NPK application
87 
88  m_field->SetMConstants(0, 1);
89 
90  // Check the next crop for early start, unless it is a spring crop
91  // in which case we ASSUME that no checking is necessary!!!!
92  // So DO NOT implement a crop that runs over the year boundary (i.e. from spring to spring!), at least not without fixing this.
93 
94  //new if: do the check only for non-optimising farms and if year>0. (030713 - m_rotation used only in the hidden year, so I modified the condition from >7 to >0)
95  //optimising farms not used for now so most of related code is removed (but not in 'start' case)
96  if (!(m_farm->GetType() == tof_OptimisingFarm && g_date->GetYearNumber() > 0)) {
97 
98  if (m_ev->m_startday > g_date->DayInYear(1, 7)) {
99  if (m_field->GetMDates(0, 0) >= m_ev->m_startday)
100  {
101  g_msg->Warn(WARN_BUG, "UKPermanentGrass::Do(): ", "Harvest too late for the next crop to start!!!");
102  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
103  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
104  }
105  }
106 
107  if (!m_ev->m_first_year) {
108  // Are we before July 1st?
109  d1 = g_date->OldDays() + g_date->DayInYear(1, 7);
110  if (g_date->Date() < d1) {
111  // Yes, too early. We assumme this is because the last crop was late
112  printf("Poly: %d\n", m_field->GetPoly());
113  g_msg->Warn(WARN_BUG, "UKPermanentGrass::Do(): ", "Crop start attempt between 1st Jan & 1st July");
114  int prev = m_field->GetLandscape()->BackTranslateVegTypes(m_field->GetOwner()->GetPreviousTov(m_field->GetRotIndex()));
115  g_msg->Warn(WARN_BUG, "Previous Crop ", prev);
116  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
117  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
118  exit(1);
119  }
120  else {
121  d1 = g_date->OldDays() + m_first_date + 365; // Add 365 for spring crop
122  if (g_date->Date() > d1) {
123  // Yes too late - should not happen - raise an error
124  g_msg->Warn(WARN_BUG, "UKPermanentGrass::Do(): ", "Crop start attempt after last possible start date");
125  int prev = m_field->GetLandscape()->BackTranslateVegTypes(m_field->GetOwner()->GetPreviousTov(m_field->GetRotIndex()));
126  g_msg->Warn(WARN_BUG, "Previous Crop ", prev);
127  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
128  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
129  exit(1);
130  }
131  }
132  }
133  else {
135  break;
136  }
137  }//if
138 
139  // End single block date checking code. Please see next line comment as well.
140  // Reinit d1 to first possible starting date.
141 
142  d1 = g_date->OldDays() + g_date->DayInYear(1, 3);
143  if (g_date->Date() >= d1) d1 += 365;
144  if (m_farm->IsStockFarmer()) //Stock Farmer
145  {
147  }
148  else SimpleEvent_(d1, uk_pg_ferti_p1, false, m_farm, m_field);
149  break;
150  }
151  break;
152 
153  // This is the first real farm operation
154  case uk_pg_ferti_p1:
155  if (m_farm->DoIt_prob(0.90)) {
156  if (!m_farm->FP_NPK(m_field, 0.0, g_date->DayInYear(31, 3) - g_date->DayInYear())) {
158  break;
159  }
160  }
161  if (m_farm->DoIt_prob(0.50)) {
163  }
165  break;
166  case uk_pg_ferti_s1:
167  if (m_farm->DoIt_prob(0.90)) {
168  if (!m_farm->FA_NPK(m_field, 0.0, g_date->DayInYear(31, 3) - g_date->DayInYear())) {
170  break;
171  }
172  }
173  if (m_farm->DoIt_prob(0.50)) {
175  }
177  break;
179  // At least 7 days from last watering and 21 from last application of fertilizer.
180  if (g_date->Date() < UK_PG_WATER_DATE + 7) {
182  break;
183  }
184  else
185  {
186  if (!m_farm->CutToSilage(m_field, 0.0, g_date->DayInYear(10, 5) - g_date->DayInYear())) {
188  break;
189  }
191  if (m_farm->IsStockFarmer()) //Stock Farmer
192  {
194  }
195  else SimpleEvent_(g_date->Date() + 1, uk_pg_ferti_p2, false, m_farm, m_field);
196  // Start water thread
198  break;
199  }
200  break;
201 
202  case uk_pg_ferti_s2:
203  if (!m_farm->FA_Slurry(m_field, 0.0, (UK_PG_CUT_DATE + 4) - g_date->DayInYear())) {
205  break;
206  }
208  break;
209  case uk_pg_ferti_p2:
210  if (!m_farm->FP_Slurry(m_field, 0.0, (UK_PG_CUT_DATE + 4) - g_date->DayInYear())) {
212  break;
213  }
215  break;
216  case uk_pg_ferti_s3:
217  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
218  {
219  if (!m_farm->FA_NPK(m_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear())) {
221  break;
222  }
223  }
225  break;
226  case uk_pg_ferti_p3:
227  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
228  {
229  if (!m_farm->FP_NPK(m_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear())) {
231  break;
232  }
233  }
235  break;
237  // At least 7 days from last watering and 21 from last application of fertilizer.
238  if (g_date->Date() < UK_PG_WATER_DATE + 7) {
240  break;
241  }
242  else
243  {
244  if (!m_farm->CutToSilage(m_field, 0.0, g_date->DayInYear(15, 6) - g_date->DayInYear())) {
246  break;
247  }
249  if (m_farm->IsStockFarmer()) //Stock Farmer
250  {
252  }
253  else SimpleEvent_(g_date->Date() + 1, uk_pg_ferti_p4, false, m_farm, m_field);
254  break;
255  }
256  break;
257  case uk_pg_ferti_s4:
258  if (!m_farm->FA_Slurry(m_field, 0.0, (UK_PG_CUT_DATE + 4) - g_date->DayInYear())) {
260  break;
261  }
263  break;
264  case uk_pg_ferti_p4:
265  if (!m_farm->FP_Slurry(m_field, 0.0, (UK_PG_CUT_DATE + 4) - g_date->DayInYear())) {
267  break;
268  }
270  break;
271  case uk_pg_ferti_s5:
272  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
273  {
274  if (!m_farm->FA_NPK(m_field, 0.0, g_date->DayInYear(25, 6) - g_date->DayInYear())) {
276  break;
277  }
278  }
280  break;
281  case uk_pg_ferti_p5:
282  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
283  {
284  if (!m_farm->FP_NPK(m_field, 0.0, g_date->DayInYear(25, 6) - g_date->DayInYear())) {
286  break;
287  }
288  }
290  break;
292  // At least 7 days from last watering and 21 from last application of fertilizer.
293  if (g_date->Date() < UK_PG_WATER_DATE + 7) {
295  break;
296  }
297  else
298  {
299  if (!m_farm->CutToSilage(m_field, 0.0, g_date->DayInYear(25, 7) - g_date->DayInYear())) {
301  break;
302  }
304  if (m_farm->IsStockFarmer()) //Stock Farmer
305  {
307  }
308  else SimpleEvent_(g_date->Date() + 1, uk_pg_ferti_p6, false, m_farm, m_field);
309  break;
310  }
311  break;
312  case uk_pg_ferti_s6:
313  if (!m_farm->FA_Slurry(m_field, 0.0, (UK_PG_CUT_DATE + 4) - g_date->DayInYear())) {
315  break;
316  }
318  break;
319  case uk_pg_ferti_p6:
320  if (!m_farm->FP_Slurry(m_field, 0.0, (UK_PG_CUT_DATE + 4) - g_date->DayInYear())) {
322  break;
323  }
325  break;
326  case uk_pg_ferti_s7:
327  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
328  {
329  if (!m_farm->FA_NPK(m_field, 0.0, g_date->DayInYear(5, 8) - g_date->DayInYear())) {
331  break;
332  }
333  }
335  break;
336  case uk_pg_ferti_p7:
337  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
338  {
339  if (!m_farm->FP_NPK(m_field, 0.0, g_date->DayInYear(5, 8) - g_date->DayInYear())) {
341  break;
342  }
343  }
345  break;
347  // At least 7 days from last watering and 21 from last application of fertilizer.
348  if (g_date->Date() < UK_PG_WATER_DATE + 7) {
350  break;
351  }
352  else
353  {
354  if (!m_farm->CutToSilage(m_field, 0.0, g_date->DayInYear(31, 8) - g_date->DayInYear())) {
356  break;
357  }
359  if (m_farm->IsStockFarmer()) //Stock Farmer
360  {
362  }
363  else SimpleEvent_(g_date->Date() + 1, uk_pg_ferti_p8, false, m_farm, m_field);
364  break;
365  }
366  break;
367  case uk_pg_ferti_s8:
368  if (!m_farm->FA_Slurry(m_field, 0.0, (UK_PG_CUT_DATE + 4) - g_date->DayInYear())) {
370  break;
371  }
373  break;
374  case uk_pg_ferti_p8:
375  if (!m_farm->FP_Slurry(m_field, 0.0, (UK_PG_CUT_DATE + 4) - g_date->DayInYear())) {
377  break;
378  }
380  break;
381  case uk_pg_ferti_s9:
382  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
383  {
384  if (!m_farm->FA_NPK(m_field, 0.0, g_date->DayInYear(10, 9) - g_date->DayInYear())) {
386  break;
387  }
388  }
390  break;
391  case uk_pg_ferti_p9:
392  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
393  {
394  if (!m_farm->FP_NPK(m_field, 0.0, g_date->DayInYear(10, 9) - g_date->DayInYear())) {
396  break;
397  }
398  }
400  break;
402  // At least 7 days from last watering and 21 from last application of fertilizer.
403  if (g_date->Date() < UK_PG_WATER_DATE + 7) {
405  break;
406  }
407  else
408  {
409  if (m_ev->m_lock || m_farm->DoIt_prob(0.40))
410  {
411  if (!m_farm->CutToSilage(m_field, 0.0, m_field->GetMDates(0, 0) - g_date->DayInYear())) {
413  break;
414  }
416  }
417  if (m_farm->IsStockFarmer()) //Stock Farmer
418  {
420  }
421  else SimpleEvent_(g_date->Date() + 1, uk_pg_ferti_p11, false, m_farm, m_field);
422  break;
423  }
424  break;
425  case uk_pg_ferti_s11:
426  if (m_field->GetMConstants(0) == 0) {
427  if (!m_farm->FA_NPK(m_field, 0.0, -1)) { // raise an error
428  g_msg->Warn(WARN_BUG, "UKPermanentGrass::Do(): failure in 'NPK application' execution", "");
429  exit(1);
430  }
431  }
432  else {
433  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
434  {
435  if (!m_farm->FA_NPK(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
437  break;
438  }
439  }
440  }
441  done = true;
442  break;
443  case uk_pg_ferti_p11:
444  if (m_field->GetMConstants(0) == 0) {
445  if (!m_farm->FP_NPK(m_field, 0.0, -1)) { // raise an error
446  g_msg->Warn(WARN_BUG, "UKPermanentGrass::Do(): failure in 'NPK application' execution", "");
447  exit(1);
448  }
449  }
450  else {
451  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
452  {
453  if (!m_farm->FP_NPK(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
455  break;
456  }
457  }
458  }
459  done = true;
460  break;
461  case uk_pg_cattle_out:
462  if (!m_farm->CattleOut(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
464  break;
465  }
466  // Keep them out there
468  break;
469  case uk_pg_cattle_is_out: // Keep the cattle out there
470  // CattleIsOut() returns false if it is not time to stop grazing
471  if (!m_farm->CattleIsOut(m_field, 0.0, g_date->DayInYear(31, 8) - g_date->DayInYear(), g_date->DayInYear(31, 8))) {
473  break;
474  }
475  if (m_farm->IsStockFarmer()) //Stock Farmer
476  {
478  }
479  else SimpleEvent_(g_date->Date() + 1, uk_pg_ferti_p10, false, m_farm, m_field);
480  break;
481  case uk_pg_ferti_s10:
482  if (!m_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(5, 9) - g_date->DayInYear())) {
484  break;
485  }
487  break;
488  case uk_pg_ferti_p10:
489  if (!m_farm->FP_Slurry(m_field, 0.0, g_date->DayInYear(5, 9) - g_date->DayInYear())) {
491  break;
492  }
494  break;
496  if (!m_farm->CutToSilage(m_field, 0.0, m_field->GetMDates(0, 0) - g_date->DayInYear())) {
498  break;
499  }
500  if (m_farm->IsStockFarmer()) //Stock Farmer
501  {
503  }
504  else SimpleEvent_(g_date->Date() + 1, uk_pg_ferti_p11, false, m_farm, m_field);
505  break;
506  case uk_pg_watering:
507  if (m_ev->m_lock || m_farm->DoIt_prob(0.40))
508  {
509  if (g_date->Date() < UK_PG_CUT_DATE + 3) {
510  // Too close to silage cutting, so try again tomorrow.
512  }
513  else
514  {
515  if (!m_farm->Water(m_field, 0.0, g_date->DayInYear(31, 8) - g_date->DayInYear())) {
517  break;
518  }
520  }
521  }
522  // End of thread
523  break;
524  default:
525  g_msg->Warn(WARN_BUG, "UKPermanentGrass::Do(): "
526  "Unknown event type! ", "");
527  exit(1);
528  }
529  return done;
530 }

References Farm::CattleIsOut(), Farm::CattleOut(), LE::ClearManagementActionSum(), Farm::CutToSilage(), Calendar::Date(), Calendar::DayInYear(), Farm::DoIt_prob(), Farm::FA_NPK(), Farm::FA_Slurry(), Farm::FP_NPK(), Farm::FP_Slurry(), g_date, g_msg, LE::GetMConstants(), LE::GetMDates(), LE::GetOwner(), LE::GetPoly(), Farm::GetPreviousTov(), LE::GetRotIndex(), Farm::GetType(), Calendar::GetYearNumber(), 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(), LE::SetMConstants(), LE::SetMDates(), Crop::SimpleEvent_(), tof_OptimisingFarm, tov_UKPermanentGrass, uk_pg_cattle_is_out, uk_pg_cattle_out, UK_PG_CUT_DATE, uk_pg_cut_to_silage1, uk_pg_cut_to_silage2, uk_pg_cut_to_silage3, uk_pg_cut_to_silage4, uk_pg_cut_to_silage5, uk_pg_cut_to_silage6, UK_PG_FERTI_DATE, uk_pg_ferti_p1, uk_pg_ferti_p10, uk_pg_ferti_p11, uk_pg_ferti_p2, uk_pg_ferti_p3, uk_pg_ferti_p4, uk_pg_ferti_p5, uk_pg_ferti_p6, uk_pg_ferti_p7, uk_pg_ferti_p8, uk_pg_ferti_p9, uk_pg_ferti_s1, uk_pg_ferti_s10, uk_pg_ferti_s11, uk_pg_ferti_s2, uk_pg_ferti_s3, uk_pg_ferti_s4, uk_pg_ferti_s5, uk_pg_ferti_s6, uk_pg_ferti_s7, uk_pg_ferti_s8, uk_pg_ferti_s9, uk_pg_start, UK_PG_WATER_DATE, uk_pg_watering, MapErrorMsg::Warn(), WARN_BUG, and Farm::Water().

◆ SetUpFarmCategoryInformation()

void UKPermanentGrass::SetUpFarmCategoryInformation ( )
inline
93  {
94  const int elements = 2 + (uk_pg_foobar - UKPERMANENTGRASS_BASE);
96  FarmManagementCategory catlist[elements] =
97  {
98  fmc_Others, // this needs to be at the zero line
99  fmc_Others,//uk_pg_start = 1, // Compulsory, must always be 1 (one).
100  fmc_Others,//uk_pg_sleep_all_day = UKPERMANENTGRASS_BASE,
101  fmc_Fertilizer,//uk_pg_ferti_p1, // NPK I 90% March
102  fmc_Fertilizer,//uk_pg_ferti_s1,
103  fmc_Cutting,//uk_pg_cut_to_silage1, // Cutting 1 50% April-May (The rest graze)
104  fmc_Cutting,//uk_pg_cut_to_silage2, // Cutting 2 100% 21 days after ferti_2
105  fmc_Cutting,//uk_pg_cut_to_silage3, // Cutting 3 100% 21 days after ferti 4
106  fmc_Cutting,//uk_pg_cut_to_silage4, // Cutting 4 100% August
107  fmc_Cutting,//uk_pg_cut_to_silage5, // Cutting 5 40% 21 days after ferti 9
108  fmc_Cutting,//uk_pg_cut_to_silage6, // Cutting 6 90% August-Oct 10 (if grazing)
109  fmc_Fertilizer,//uk_pg_ferti_p2, // Slurry I 100% after Cutting 1
110  fmc_Fertilizer,//uk_pg_ferti_s2,
111  fmc_Fertilizer,//uk_pg_ferti_p3, // NPK II 90% After Slurry I
112  fmc_Fertilizer,//uk_pg_ferti_s3,
113  fmc_Fertilizer,//uk_pg_ferti_p4, // Slurry II 100% after Cutting 2
114  fmc_Fertilizer,//uk_pg_ferti_s4,
115  fmc_Fertilizer,//uk_pg_ferti_p5, // NPK III 90% before June 25
116  fmc_Fertilizer,//uk_pg_ferti_s5,
117  fmc_Fertilizer,//uk_pg_ferti_p6, // Slurry IV 100% after Cutting 3
118  fmc_Fertilizer,//uk_pg_ferti_s6,
119  fmc_Fertilizer,//uk_pg_ferti_p7, // NPK IV 90% before August 5
120  fmc_Fertilizer,//uk_pg_ferti_s7,
121  fmc_Fertilizer,//uk_pg_ferti_p8, // Slurry V 100% after Cutting 4
122  fmc_Fertilizer,//uk_pg_ferti_s8,
123  fmc_Fertilizer,//uk_pg_ferti_p9, // NPK V 90% before September 10
124  fmc_Fertilizer,//uk_pg_ferti_s9,
125  fmc_Fertilizer,//uk_pg_ferti_p10, // Slurry VI 100% 7 dats after Grazing (cattle out) ends
126  fmc_Fertilizer,//uk_pg_ferti_s10,
127  fmc_Fertilizer,//uk_pg_ferti_p11, // NPK VI 90% before Oct 30
128  fmc_Fertilizer,//uk_pg_ferti_s11,
129  fmc_Watering,//uk_pg_watering, // Water 20% April - August (as needed)
130  fmc_Grazing,//uk_pg_cattle_out, // Grazing 50% (The rest cut) April-August
131  fmc_Grazing,//uk_pg_cattle_is_out, // Grazing continues
132  };
133  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
134  }

References fmc_Cutting, fmc_Fertilizer, fmc_Grazing, fmc_Others, fmc_Watering, Crop::m_base_elements_no, Crop::m_ManagementCategories, uk_pg_foobar, and UKPERMANENTGRASS_BASE.

Referenced by UKPermanentGrass().


The documentation for this class was generated from the following files:
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
UK_PG_CUT_DATE
#define UK_PG_CUT_DATE
Definition: UKPermanentGrass.h:26
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
uk_pg_ferti_p11
Definition: UKPermanentGrass.h:64
LE::SetMDates
void SetMDates(int a, int b, int c)
Definition: Elements.h:406
UK_PG_FERTI_DATE
#define UK_PG_FERTI_DATE
A flag used to indicate autumn ploughing status.
Definition: UKPermanentGrass.h:25
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
uk_pg_ferti_p3
Definition: UKPermanentGrass.h:48
LE::GetMConstants
int GetMConstants(int a)
Definition: Elements.h:407
Farm::CattleIsOut
virtual bool CattleIsOut(LE *a_field, double a_user, int a_days, int a_max)
Generate a 'cattle_out' event for every day the cattle are on a_field.
Definition: FarmFuncs.cpp:2470
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
Farm::CutToSilage
virtual bool CutToSilage(LE *a_field, double a_user, int a_days)
Cut vegetation for silage on a_field.
Definition: FarmFuncs.cpp:1644
uk_pg_cut_to_silage5
Definition: UKPermanentGrass.h:44
Calendar::GetYearNumber
int GetYearNumber(void)
Definition: Calendar.h:72
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
uk_pg_ferti_s1
Definition: UKPermanentGrass.h:39
LE::GetPoly
int GetPoly(void)
Returns the polyref number for this polygon.
Definition: Elements.h:238
uk_pg_watering
Definition: UKPermanentGrass.h:66
uk_pg_ferti_p9
Definition: UKPermanentGrass.h:60
uk_pg_foobar
Definition: UKPermanentGrass.h:69
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
UKPERMANENTGRASS_BASE
#define UKPERMANENTGRASS_BASE
Definition: UKPermanentGrass.h:21
UK_PG_WATER_DATE
#define UK_PG_WATER_DATE
Definition: UKPermanentGrass.h:27
Farm::GetPreviousTov
TTypesOfVegetation GetPreviousTov(int a_index)
Definition: Farm.h:966
Farm::GetType
TTypesOfFarm GetType(void)
Definition: Farm.h:956
uk_pg_cattle_out
Definition: UKPermanentGrass.h:67
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
uk_pg_cut_to_silage4
Definition: UKPermanentGrass.h:43
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
tov_UKPermanentGrass
Definition: LandscapeFarmingEnums.h:281
fmc_Cutting
Definition: LandscapeFarmingEnums.h:1009
uk_pg_ferti_s6
Definition: UKPermanentGrass.h:55
uk_pg_cattle_is_out
Definition: UKPermanentGrass.h:68
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
uk_pg_ferti_s8
Definition: UKPermanentGrass.h:59
uk_pg_ferti_p6
Definition: UKPermanentGrass.h:54
Calendar::Date
long Date(void)
Definition: Calendar.h:57
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
fmc_Watering
Definition: LandscapeFarmingEnums.h:1011
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
uk_pg_ferti_p10
Definition: UKPermanentGrass.h:62
uk_pg_ferti_s10
Definition: UKPermanentGrass.h:63
uk_pg_start
Definition: UKPermanentGrass.h:36
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
LE::GetRotIndex
int GetRotIndex(void)
Definition: Elements.h:373
uk_pg_cut_to_silage6
Definition: UKPermanentGrass.h:45
uk_pg_ferti_s7
Definition: UKPermanentGrass.h:57
uk_pg_ferti_s5
Definition: UKPermanentGrass.h:53
FarmEvent::m_next_tov
TTypesOfVegetation m_next_tov
Definition: Farm.h:390
uk_pg_ferti_p2
Definition: UKPermanentGrass.h:46
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
UKPermanentGrass::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: UKPermanentGrass.h:93
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
uk_pg_ferti_s11
Definition: UKPermanentGrass.h:65
uk_pg_cut_to_silage2
Definition: UKPermanentGrass.h:41
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
tof_OptimisingFarm
Definition: LandscapeFarmingEnums.h:696
uk_pg_ferti_s9
Definition: UKPermanentGrass.h:61
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
uk_pg_cut_to_silage3
Definition: UKPermanentGrass.h:42
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
uk_pg_ferti_s2
Definition: UKPermanentGrass.h:47
fmc_Grazing
Definition: LandscapeFarmingEnums.h:1010
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
uk_pg_ferti_p7
Definition: UKPermanentGrass.h:56
uk_pg_cut_to_silage1
Definition: UKPermanentGrass.h:40
uk_pg_ferti_p4
Definition: UKPermanentGrass.h:50
uk_pg_ferti_p8
Definition: UKPermanentGrass.h:58
LE::GetOwner
Farm * GetOwner(void)
Definition: Elements.h:256
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
uk_pg_ferti_p1
Definition: UKPermanentGrass.h:38
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
Farm::CattleOut
virtual bool CattleOut(LE *a_field, double a_user, int a_days)
Start a grazing event on a_field today.
Definition: FarmFuncs.cpp:2368
WARN_BUG
Definition: MapErrorMsg.h:34
uk_pg_ferti_p5
Definition: UKPermanentGrass.h:52
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
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_pg_ferti_s4
Definition: UKPermanentGrass.h:51
uk_pg_ferti_s3
Definition: UKPermanentGrass.h:49