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

FR_Grassland class
. More...

#include <FR_Grassland.h>

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

FR_Grassland class
.

See FR_Grassland.h::FR_GrasslandToDo for a complete list of all possible events triggered codes by the management plan. When triggered these events are handled by Farm and are available as information for other objects such as animal and bird models.

Constructor & Destructor Documentation

◆ FR_Grassland()

FR_Grassland::FR_Grassland ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
111  : Crop(a_tov, a_toc, a_L)
112  {
113  // When we start it off, the first possible date for a farm operation is 1st October
114  // This information is used by other crops when they decide how much post processing of
115  // the management is allowed after harvest before the next crop starts.
116  m_first_date = g_date->DayInYear(1, 12);
118  }

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

Member Function Documentation

◆ Do()

bool FR_Grassland::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 winter wheat.

Reimplemented from Crop.

99 {
100  m_field = a_field; // this is needed because of possible calls to other methods and currently we do not pass parameters.
101  m_farm = a_farm; // this is needed because of possible calls to other methods and currently we do not pass parameters.
102  bool done = false; // The boolean value done indicates when we are totally finished with this plan (i.e. it is set to true).
103  int d1 = 0;
104  m_ev = a_ev;
105  // Depending what event has occured jump to the correct bit of code e.g. for ww_start jump to line 67 below
106  switch (a_ev->m_todo)
107  {
108  case fr_g_start:
109  {
110  // This is just to hold a local variable in scope and prevent compiler errors
111  // ww_start just sets up all the starting conditions and reference dates that are needed to start a ww
112  // crop off
113 
114  FR_G_SOW_YEAR = 0;
115  FR_G_CUT = false;
116  FR_G_CUT_ONLY = false;
117  FR_G_GRAZE_ONLY = false;
118  FR_G_CUT_GRAZE = false;
119 
120  a_field->ClearManagementActionSum();
121 
122  m_last_date = g_date->DayInYear(10, 10); // Should match the last flexdate below
123  //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
124  std::vector<std::vector<int>> flexdates(3 + 1, std::vector<int>(2, 0));
125  // Set up the date management stuff
126  // Start and stop dates for all events after harvest
127  flexdates[0][1] = g_date->DayInYear(31, 8); // last possible day harvest
128  // Now these are done in pairs, start & end for each operation. If its not used then -1
129  flexdates[1][0] = -1; // This date will be moved back as far as necessary and potentially to flexdates 1 (start op 1)
130  flexdates[1][1] = g_date->DayInYear(5, 9); // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 1)
131  flexdates[2][0] = -1; // This date will be moved back as far as necessary and potentially to flexdates 2 (start op 2)
132  flexdates[2][1] = g_date->DayInYear(10, 9); // This date will be moved back as far as necessary and potentially to flexdates 2 (end op 2)
133  flexdates[3][0] = -1; //
134  flexdates[3][1] = g_date->DayInYear(10, 10); //
135 
136  // 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
137  int isSpring = 0;
138  if (StartUpCrop(isSpring, flexdates, int(fr_g_n_mineral1))) break;
139 
140  // End single block date checking code. Please see next line comment as well.
141  // Reinit d1 to first possible starting date.
142  d1 = g_date->OldDays() + g_date->DayInYear(1, 9);
143  // OK, let's go.
144  // Here we queue up the first event which changes dependent on whether it is a forced spring sow or not
145  if (m_ev->m_forcespring) {
146  int day_num_shift = 365;
147  if (g_date->DayInYear() < 70) day_num_shift = 0;
148  if ((FR_G_SOW_YEAR + g_date->GetYearNumber()) % 2 == 2)
149  {
150  d1 = g_date->OldDays() + g_date->DayInYear(3, 2) + day_num_shift,
151  SimpleEvent(d1, fr_g_n_mineral1, false);
152  }
153  else if ((FR_G_SOW_YEAR + g_date->GetYearNumber()) % 2 == 1)
154  {
155  d1 = g_date->OldDays() + g_date->DayInYear(3, 2) + day_num_shift,
156  SimpleEvent(d1, fr_g_n_mineral1, false);
157  }
158  else if ((FR_G_SOW_YEAR + g_date->GetYearNumber()) % 2 == 0)
159  {
160  d1 = g_date->OldDays() + g_date->DayInYear(1, 1);
161  if (g_date->Date() >= d1) d1 += 365;
162  SimpleEvent(d1, fr_g_sleep_cg, false);
163  }
164  break;
165  }
166  else if ((FR_G_SOW_YEAR + g_date->GetYearNumber()) % 2 == 2)
167  {
168  d1 = g_date->OldDays() + g_date->DayInYear(21, 9);
169  SimpleEvent(d1, fr_g_slurry1, false);
170  }
171  else if ((FR_G_SOW_YEAR + g_date->GetYearNumber()) % 2 == 1)
172  {
173  d1 = g_date->OldDays() + g_date->DayInYear(21, 9);
174  SimpleEvent(d1, fr_g_slurry1, false);
175  }
176  else if ((FR_G_SOW_YEAR + g_date->GetYearNumber()) % 2 == 0)
177  {
178  d1 = g_date->OldDays() + g_date->DayInYear(1, 1);
179  if (g_date->Date() >= d1) d1 += 365;
180  SimpleEvent(d1, fr_g_sleep_cg, false);
181  }
182  break;
183  }
184  break;
185  // This is the first real farm operation
186 
187  case fr_g_slurry1:
188  if (a_ev->m_lock || a_farm->DoIt_prob(.45)) {
189  if (!a_farm->FP_Slurry(a_field, 0.0, g_date->DayInYear(23, 11) - g_date->DayInYear())) {
190  SimpleEvent(g_date->Date() + 1, fr_g_slurry1, true);
191  break;
192  }
193  }
194  SimpleEvent(g_date->Date() + 7, fr_g_winter_plough, false);
195  break;
196  case fr_g_winter_plough:
197  if (!a_farm->WinterPlough(a_field, 0.0, g_date->DayInYear(30, 11) - g_date->DayInYear())) {
198  SimpleEvent(g_date->Date() + 1, fr_g_winter_plough, true);
199  break;
200  }
201  SimpleEvent(g_date->OldDays() + g_date->DayInYear(3, 2) + 365, fr_g_n_mineral1, false);
202  break;
203 
204  case fr_g_n_mineral1:
205  if (a_ev->m_lock || a_farm->DoIt(50)) { //
206  if (!a_farm->FP_N(a_field, 0.0, g_date->DayInYear(13, 3) - g_date->DayInYear())) {
207  SimpleEvent(g_date->Date() + 1, fr_g_n_mineral1, true);
208  break;
209  }
210  }
211  SimpleEvent(g_date->Date() + 7, fr_g_preseed_sow, false);
212  break;
213 
214  case fr_g_preseed_sow:
215  if (!a_farm->PreseedingCultivatorSow(a_field, 0.0, g_date->DayInYear(20, 3) - g_date->DayInYear())) {
216  SimpleEvent(g_date->Date() + 1, fr_g_preseed_sow, true);
217  break;
218  }
219  SimpleEvent(g_date->Date() + 30, fr_g_herbicide, false);
221  break;
222 
223  case fr_g_herbicide:
224  if (a_ev->m_lock || a_farm->DoIt(10)) {
225  if (!a_farm->HerbicideTreat(a_field, 0.0, g_date->DayInYear(13, 5) - g_date->DayInYear())) {
226  SimpleEvent(g_date->Date() + 1, fr_g_herbicide, true);
227  break;
228  }
229  }
230  break;
231 
232  case fr_g_cutting1:
233  if (a_ev->m_lock || a_farm->DoIt_prob(.50)) {
234  if (!a_farm->CutToSilage(a_field, 0.0,
235  g_date->DayInYear(5, 5) - g_date->DayInYear())) {
236  SimpleEvent(g_date->Date() + 1, fr_g_cutting1, true);
237  break;
238  }
239  else
240  {
241  //remember who did cut (1st year)
242  FR_G_CUT = true;
243  }
244  }
245  SimpleEvent(g_date->Date() <4, fr_g_slurry2, false);
246  break;
247 
248  case fr_g_slurry2:
249  if (a_ev->m_lock || a_farm->DoIt_prob(.30)) {
250  if (!a_farm->FP_Slurry(a_field, 0.0, g_date->DayInYear(9, 5) - g_date->DayInYear())) {
251  SimpleEvent(g_date->Date() + 1, fr_g_slurry2, true);
252  break;
253  }
254  }
255  SimpleEvent(g_date->Date(), fr_g_n_mineral2, false); // no timing or info on 40% of all or not?
256  break;
257 
258  case fr_g_n_mineral2:
259  if (a_ev->m_lock || a_farm->DoIt_prob(.40)) {
260  if (!a_farm->FP_N(a_field, 0.0, g_date->DayInYear(9, 5) - g_date->DayInYear())) {
261  SimpleEvent(g_date->Date() + 1, fr_g_n_mineral2, true);
262  break;
263  }
264  }
265  SimpleEvent(g_date->Date() + 21, fr_g_cutting2, false);
266  break;
267 
268  case fr_g_cutting2:
269  if ((FR_G_CUT == true) || (FR_G_CUT_GRAZE == true) || (FR_G_CUT_ONLY == true)) {
270  if (!a_farm->CutToSilage(a_field, 0.0, g_date->DayInYear(15, 6) - g_date->DayInYear())) {
271  SimpleEvent(g_date->Date() + 1, fr_g_cutting2, true);
272  break;
273  }
274  }
275  SimpleEvent(g_date->Date() < 4, fr_g_slurry3, false);
276  break;
277 
278  case fr_g_slurry3:
279  if (a_ev->m_lock || a_farm->DoIt_prob(1.0)) {
280  if (!a_farm->FP_Slurry(a_field, 0.0, g_date->DayInYear(19, 6) - g_date->DayInYear())) {
281  SimpleEvent(g_date->Date() + 1, fr_g_slurry3, true);
282  break;
283  }
284  }
285  SimpleEvent(g_date->Date()+1, fr_g_npk1, false);
286  break;
287 
288  case fr_g_npk1:
289  if (a_ev->m_lock || a_farm->DoIt_prob(0.9)) {
290  if (!a_farm->FP_NPK(a_field, 0.0, g_date->DayInYear(25, 6) - g_date->DayInYear())) {
291  SimpleEvent(g_date->Date() + 1, fr_g_npk1, true);
292  break;
293  }
294  }
295  SimpleEvent(g_date->Date() + 21, fr_g_cutting3, false);
296  break;
297 
298  case fr_g_cutting3:
299  if ((FR_G_CUT == true) || (FR_G_CUT_GRAZE == true) || (FR_G_CUT_ONLY == true)) {
300  if (!a_farm->CutToSilage(a_field, 0.0, g_date->DayInYear(25, 7) - g_date->DayInYear())) {
301  SimpleEvent(g_date->Date() + 1, fr_g_cutting3, true);
302  break;
303  }
304  }
305  SimpleEvent(g_date->Date() < 4, fr_g_slurry4, false);
306  break;
307 
308  case fr_g_slurry4:
309  if (a_ev->m_lock || a_farm->DoIt_prob(1.0)) {
310  if (!a_farm->FP_Slurry(a_field, 0.0, g_date->DayInYear(29, 7) - g_date->DayInYear())) {
311  SimpleEvent(g_date->Date() + 1, fr_g_slurry4, true);
312  break;
313  }
314  }
315  SimpleEvent(g_date->Date() + 1, fr_g_npk2, false);
316  break;
317 
318  case fr_g_npk2:
319  if (a_ev->m_lock || a_farm->DoIt_prob(0.9)) {
320  if (!a_farm->FP_NPK(a_field, 0.0, g_date->DayInYear(5, 8) - g_date->DayInYear())) {
321  SimpleEvent(g_date->Date() + 1, fr_g_npk2, true);
322  break;
323  }
324  }
325  SimpleEvent(g_date->Date() + 21, fr_g_cutting4, false);
326  break;
327 
328  case fr_g_cutting4:
329  if ((FR_G_CUT == true) || (FR_G_CUT_GRAZE == true) || (FR_G_CUT_ONLY == true)){
330  if (!a_farm->CutToSilage(a_field, 0.0, a_field->GetMDates(1, 0) - g_date->DayInYear())) {
331  SimpleEvent(g_date->Date() + 1, fr_g_cutting4, true);
332  break;
333  }
334  }
335  SimpleEvent(g_date->Date() < 4, fr_g_slurry5, false);
336  break;
337 
338  case fr_g_slurry5:
339  if (a_ev->m_lock || a_farm->DoIt_prob(1.0)) {
340  if (!a_farm->FP_Slurry(a_field, 0.0, a_field->GetMDates(1, 1) - g_date->DayInYear())) {
341  SimpleEvent(g_date->Date() + 1, fr_g_slurry5, true);
342  break;
343  }
344  }
345  SimpleEvent(g_date->Date() + 1, fr_g_npk3, false);
346  break;
347 
348  case fr_g_npk3:
349  if (a_ev->m_lock || a_farm->DoIt_prob(0.9)) {
350  if (!a_farm->FP_NPK(a_field, 0.0, a_field->GetMDates(1, 2) - g_date->DayInYear())) {
351  SimpleEvent(g_date->Date() + 1, fr_g_npk3, true);
352  break;
353  }
354  }
355  SimpleEvent(g_date->Date() + 21, fr_g_cutting5, false);
356  break;
357 
358  case fr_g_cutting5:
359  if ((FR_G_CUT == true) || (FR_G_CUT_GRAZE == true) || (FR_G_CUT_ONLY == true)) {
360  if (a_ev->m_lock || a_farm->DoIt_prob(0.5)) {
361  if (!a_farm->CutToSilage(a_field, 0.0, a_field->GetMDates(1, 3) - g_date->DayInYear())) {
362  SimpleEvent(g_date->Date() + 1, fr_g_cutting5, true);
363  break;
364  }
365  }
366  }
367  done = true;
368  break;
369 
370  // next years
371  case fr_g_sleep_cg:
372  if (a_ev->m_lock || a_farm->DoIt_prob(.52)) {
373  if (!a_farm->SleepAllDay(a_field, 0.0,
374  g_date->DayInYear(20, 3) - g_date->DayInYear())) {
375  SimpleEvent(g_date->Date() + 1, fr_g_sleep_cg, true);
376  break;
377  }
378  else {// remember who does both
379  FR_G_CUT_GRAZE = true;
380  }
381  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3), fr_g_grazing, false);
383  break;
384  } // grazing only (no cutting)
385  else if (a_ev->m_lock || a_farm->DoIt_prob(.36/.48)) {
386  SimpleEvent(g_date->Date(), fr_g_sleep_g, false);
387  break;
388  } // cutting only (no grazing)
389  else SimpleEvent(g_date->Date(), fr_g_sleep_c, false);
390  break;
391 
392  case fr_g_sleep_g:
393  if (!a_farm->SleepAllDay(a_field, 0.0,
394  g_date->DayInYear(20, 3) - g_date->DayInYear())) {
395  SimpleEvent(g_date->Date() + 1, fr_g_sleep_g, true);
396  break;
397  }
398  else {// remember who does grazing only
399  FR_G_GRAZE_ONLY = true;
400  }
401  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3), fr_g_grazing, false);
402  SimpleEvent(g_date->OldDays() + g_date->DayInYear(9, 4), fr_g_slurry2, false);
403  break;
404 
405  case fr_g_sleep_c:
406  if (!a_farm->SleepAllDay(a_field, 0.0,
407  g_date->DayInYear(20, 3) - g_date->DayInYear())) {
408  SimpleEvent(g_date->Date() + 1, fr_g_sleep_c, true);
409  break;
410  }
411  else {// remember who does cutting only
412  FR_G_CUT_ONLY = true;
413  }
415  SimpleEvent(g_date->OldDays() + g_date->DayInYear(25, 4), fr_g_water, false);
416  break;
417 
418  case fr_g_grazing: // grazing for 65 days
419  if ((FR_G_CUT_GRAZE == true) || (FR_G_GRAZE_ONLY == true)){
420  if (!a_farm->CattleOut(a_field, 0.0,
421  g_date->DayInYear(25, 5) - g_date->DayInYear())) {
422  SimpleEvent(g_date->Date() + 1, fr_g_grazing, true);
423  break;
424  }
425  SimpleEvent(g_date->Date() + 1, fr_g_cattle_is_out, false);
426  SimpleEvent(g_date->Date() + 65, fr_g_slurry6, false);
427  break;
428  }
429 
430  case fr_g_cattle_is_out: // Keep the cattle out there
431  // CattleIsOut() returns false if it is not time to stop grazing
432  if (!a_farm->CattleIsOut(a_field, 0.0, g_date->DayInYear(3, 8) - g_date->DayInYear(), g_date->DayInYear(3, 8))) {
433  SimpleEvent(g_date->Date() + 1, fr_g_cattle_is_out, false);
434  break;
435  }
436  break;
437 
438  case fr_g_slurry6:
439  if (!a_farm->FP_Slurry(a_field, 0.0, g_date->DayInYear(7, 8) - g_date->DayInYear())) {
440  SimpleEvent(g_date->Date() + 1, fr_g_slurry6, true);
441  break;
442  }
443  break;
444 
445  case fr_g_cutting_ny:
446  if ((FR_G_GRAZE_ONLY == false)) {
447  if (!a_farm->CutToSilage(a_field, 0.0,
448  g_date->DayInYear(5, 5) - g_date->DayInYear())) {
449  SimpleEvent(g_date->Date() + 1, fr_g_cutting_ny, true);
450  break;
451  }
452  }
453  SimpleEvent(g_date->Date() < 4, fr_g_slurry2, false);
454  break;
455 
456  case fr_g_water: // 25% of cutting only
457  if ((FR_G_CUT_ONLY == true) && (a_ev->m_lock || a_farm->DoIt(25))) {
458  if (!a_farm->Water(a_field, 0.0,
459  g_date->DayInYear(31, 8) - g_date->DayInYear())) {
460  SimpleEvent(g_date->Date() + 1, fr_g_water, true);
461  break;
462  }
463  }
464  break;
465 
466  default:
467  g_msg->Warn(WARN_BUG, "FR_Grassland::Do(): "
468  "Unknown event type! ", "");
469  exit(1);
470  }
471  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
472  return done;
473 }

References Farm::CattleIsOut(), Farm::CattleOut(), LE::ClearManagementActionSum(), Farm::CutToSilage(), Calendar::Date(), Calendar::DayInYear(), Farm::DoIt(), Farm::DoIt_prob(), Farm::FP_N(), Farm::FP_NPK(), Farm::FP_Slurry(), fr_g_cattle_is_out, FR_G_CUT, FR_G_CUT_GRAZE, FR_G_CUT_ONLY, fr_g_cutting1, fr_g_cutting2, fr_g_cutting3, fr_g_cutting4, fr_g_cutting5, fr_g_cutting_ny, FR_G_GRAZE_ONLY, fr_g_grazing, fr_g_herbicide, fr_g_n_mineral1, fr_g_n_mineral2, fr_g_npk1, fr_g_npk2, fr_g_npk3, fr_g_preseed_sow, fr_g_sleep_c, fr_g_sleep_cg, fr_g_sleep_g, fr_g_slurry1, fr_g_slurry2, fr_g_slurry3, fr_g_slurry4, fr_g_slurry5, fr_g_slurry6, FR_G_SOW_YEAR, fr_g_start, fr_g_water, fr_g_winter_plough, g_date, g_msg, LE::GetMDates(), Calendar::GetYearNumber(), Farm::HerbicideTreat(), Crop::m_ev, Crop::m_farm, Crop::m_field, FarmEvent::m_forcespring, Crop::m_last_date, FarmEvent::m_lock, FarmEvent::m_todo, Calendar::OldDays(), Farm::PreseedingCultivatorSow(), Crop::SimpleEvent(), Farm::SleepAllDay(), Crop::StartUpCrop(), MapErrorMsg::Warn(), WARN_BUG, Farm::Water(), and Farm::WinterPlough().

◆ SetUpFarmCategoryInformation()

void FR_Grassland::SetUpFarmCategoryInformation ( )
inline
119  {
120  const int elements = 2 + (fr_g_foobar - FR_G_BASE);
122 
123  FarmManagementCategory catlist[elements] =
124  {
125  fmc_Others, // zero element unused but must be here
126  fmc_Others, //fr_g_start = 1, // Compulsory, must always be 1 (one).
127  fmc_Others, //fr_g_sleep_all_day = FR_G_BASE,
128  fmc_Fertilizer, //fr_g_slurry1,
129  fmc_Cultivation, // fr_g_winter_plough,
130  fmc_Fertilizer, //fr_g_n_mineral1,
131  fmc_Others, //fr_g_preseed_sow,
132  fmc_Herbicide, //fr_g_herbicide,
133  fmc_Cutting, //fr_g_cutting1,
134  fmc_Grazing, //fr_g_grazing,
135  fmc_Grazing, //fr_g_cattle_is_out
136  fmc_Fertilizer, //fr_g_slurry2,
137  fmc_Fertilizer, //fr_g_n_mineral2,
138  fmc_Cutting, //fr_g_cutting2,
139  fmc_Fertilizer, //fr_g_slurry3,
140  fmc_Fertilizer, //fr_g_npk1
141  fmc_Cutting, //fr_g_cutting3,
142  fmc_Fertilizer, //fr_g_slurry4,
143  fmc_Fertilizer, //fr_g_npk2,
144  fmc_Cutting, // fr_g_cutting4,
145  fmc_Fertilizer, //fr_g_slurry5,
146  fmc_Fertilizer, //fr_g_npk3,
147  fmc_Cutting, //fr_g_cutting5,
148  fmc_Others, //fr_g_sleep_cg,
149  fmc_Others, //fr_g_sleep_c,
150  fmc_Others, //fr_g_sleep_g,
151  fmc_Cutting, //fr_g_cutting_ny,
152  fmc_Fertilizer, //fr_g_slurry6,
153  fmc_Watering, //fr_g_water,
154 
155  // no foobar entry
156 
157  };
158  // Iterate over the catlist elements and copy them to vector
159  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
160 
161  }

References fmc_Cultivation, fmc_Cutting, fmc_Fertilizer, fmc_Grazing, fmc_Herbicide, fmc_Others, fmc_Watering, FR_G_BASE, fr_g_foobar, Crop::m_base_elements_no, and Crop::m_ManagementCategories.

Referenced by FR_Grassland().


The documentation for this class was generated from the following files:
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
FarmEvent::m_forcespring
bool m_forcespring
Definition: Farm.h:392
fr_g_cutting2
Definition: FR_Grassland.h:79
FR_G_SOW_YEAR
#define FR_G_SOW_YEAR
Definition: FR_Grassland.h:49
Farm::HerbicideTreat
virtual bool HerbicideTreat(LE *a_field, double a_user, int a_days)
Apply herbicide to a_field.
Definition: FarmFuncs.cpp:2025
fr_g_cutting_ny
Definition: FR_Grassland.h:92
fr_g_npk2
Definition: FR_Grassland.h:84
fr_g_sleep_g
Definition: FR_Grassland.h:91
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
fr_g_slurry3
Definition: FR_Grassland.h:80
fr_g_slurry5
Definition: FR_Grassland.h:86
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
Farm::DoIt
bool DoIt(double a_probability)
Return chance out of 0 to 100.
Definition: Farm.cpp:856
Calendar::GetYearNumber
int GetYearNumber(void)
Definition: Calendar.h:72
fr_g_grazing
Definition: FR_Grassland.h:75
FR_Grassland::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: FR_Grassland.h:119
fr_g_cutting3
Definition: FR_Grassland.h:82
FR_G_GRAZE_ONLY
#define FR_G_GRAZE_ONLY
Definition: FR_Grassland.h:52
Farm::DoIt_prob
bool DoIt_prob(double a_probability)
Return chance out of 0 to 1.
Definition: Farm.cpp:864
fr_g_n_mineral1
Definition: FR_Grassland.h:71
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
fr_g_winter_plough
Definition: FR_Grassland.h:70
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
fr_g_herbicide
Definition: FR_Grassland.h:73
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
fr_g_foobar
Definition: FR_Grassland.h:95
Crop::SimpleEvent
void SimpleEvent(long a_date, int a_todo, bool a_lock)
Adds an event to this crop management.
Definition: Farm.cpp:747
fr_g_sleep_c
Definition: FR_Grassland.h:90
fr_g_npk1
Definition: FR_Grassland.h:81
FR_G_CUT_GRAZE
#define FR_G_CUT_GRAZE
Definition: FR_Grassland.h:53
fmc_Cutting
Definition: LandscapeFarmingEnums.h:1009
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
fr_g_slurry4
Definition: FR_Grassland.h:83
FR_G_CUT
#define FR_G_CUT
Definition: FR_Grassland.h:50
Calendar::Date
long Date(void)
Definition: Calendar.h:57
fr_g_slurry6
Definition: FR_Grassland.h:93
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
fr_g_preseed_sow
Definition: FR_Grassland.h:72
Farm::FP_N
virtual bool FP_N(LE *a_field, double a_user, int a_days)
Apply N fertilizer, on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:700
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
fr_g_n_mineral2
Definition: FR_Grassland.h:78
fmc_Watering
Definition: LandscapeFarmingEnums.h:1011
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
FR_G_CUT_ONLY
#define FR_G_CUT_ONLY
Definition: FR_Grassland.h:51
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
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
fr_g_cutting5
Definition: FR_Grassland.h:88
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
fr_g_slurry1
Definition: FR_Grassland.h:69
fr_g_slurry2
Definition: FR_Grassland.h:77
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
Farm::PreseedingCultivatorSow
virtual bool PreseedingCultivatorSow(LE *a_field, double a_user, int a_days, double a_seed_coating_amount=-1, PlantProtectionProducts a_ppp=ppp_foobar)
Carry out preseeding cultivation together with sow on a_field (tilling and sowing set including culti...
Definition: FarmFuncs.cpp:325
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
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
Farm::SleepAllDay
virtual bool SleepAllDay(LE *a_field, double a_user, int a_days)
Nothing to to today on a_field.
Definition: FarmFuncs.cpp:272
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
fr_g_npk3
Definition: FR_Grassland.h:87
fmc_Grazing
Definition: LandscapeFarmingEnums.h:1010
fr_g_cutting4
Definition: FR_Grassland.h:85
fr_g_start
Definition: FR_Grassland.h:67
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
fr_g_water
Definition: FR_Grassland.h:94
fr_g_cutting1
Definition: FR_Grassland.h:74
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
fr_g_cattle_is_out
Definition: FR_Grassland.h:76
fr_g_sleep_cg
Definition: FR_Grassland.h:89
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
FR_G_BASE
#define FR_G_BASE
Definition: FR_Grassland.h:56
WARN_BUG
Definition: MapErrorMsg.h:34
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001