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

NLPermanentGrassGrazed class
. More...

#include <NLPermanentGrassGrazed.h>

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

NLPermanentGrassGrazed class
.

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

◆ NLPermanentGrassGrazed()

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

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

Member Function Documentation

◆ Do()

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

55 {
56  /******************** This block can be added to the top of all Crop::Do methods ***********************************************/
57  m_farm = a_farm;
58  m_field = a_field;
59  m_ev = a_ev;
60  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).
61  bool flag = false;
62  int d1 = 0;
63  int noDates = 1;
65  int l_nextcropstartdate;
66  /**********************************************To Here *************************************************************************/
67 
68  // Depending what event has occured jump to the correct bit of code
69  switch (m_ev->m_todo)
70  {
71  case nl_pgg_start:
72  {
74  NL_PGG_CUT_DATE = 0;
77 
78  m_last_date = g_date->DayInYear(31, 10); // Should match the last flexdate below
79  //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
80  std::vector<std::vector<int>> flexdates(1 + 1, std::vector<int>(2, 0));
81  // Set up the date management stuff
82  // Start and stop dates for all events after harvest
83  flexdates[0][1] = g_date->DayInYear(10, 10); // first possible day of finishing harvest - this is in effect day before the earliest date that a following crop can use
84 
85  flexdates[1][0] = -1; // This date will be moved back as far as necessary and potentially to flexdates 1 (start op 1)
86  flexdates[1][1] = g_date->DayInYear(31, 10); // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 1) - straw chopping
87 
88  // Below if this is a spring crop use 365, otherwise set this to 0, second parameter is fixed, and the third is the start up operation in the first year
89  int isSpring = 365;
90  if (StartUpCrop(isSpring, flexdates, int(nl_pgg_cut_to_silage1))) break;
91 
92  // End single block date checking code. Please see next line comment as well.
93  // Reinit d1 to first possible starting date.
94  d1 = g_date->OldDays() + g_date->DayInYear(1, 3) + isSpring;
95  // OK, let's go.
96  if (m_farm->IsStockFarmer()) //Stock Farmer
97  {
99  }
100  else SimpleEvent_(d1, nl_pgg_ferti_p1, false, m_farm, m_field);
101  break;
102  }
103  break;
104 
105  // This is the first real farm operation
106  case nl_pgg_ferti_p1:
107  if (m_farm->DoIt_prob(0.90)) {
108  if (!m_farm->FP_NPK(m_field, 0.0, g_date->DayInYear(30, 3) - g_date->DayInYear())) {
110  break;
111  }
112  }
113  if (m_farm->DoIt_prob(0.50)) {
115  }
117  break;
118  case nl_pgg_ferti_s1:
119  if (m_farm->DoIt_prob(0.90)) {
120  if (!m_farm->FA_NPK(m_field, 0.0, g_date->DayInYear(30, 3) - g_date->DayInYear())) {
122  break;
123  }
124  }
125  if (m_farm->DoIt_prob(0.50)) {
127  }
129  break;
131  // At least 7 days from last watering and 21 from last application of fertilizer.
132  if (g_date->Date() < NL_PGG_WATER_DATE + 7) {
134  break;
135  }
136  else
137  {
138  if (!m_farm->CutToSilage(m_field, 0.0, g_date->DayInYear(10, 5) - g_date->DayInYear())) {
140  break;
141  }
143  if (m_farm->IsStockFarmer()) //Stock Farmer
144  {
146  }
147  else SimpleEvent_(g_date->Date() + 1, nl_pgg_ferti_p2, false, m_farm, m_field);
148  // Start water thread
150  break;
151  }
152  break;
153 
154  case nl_pgg_ferti_s2:
155  if (!m_farm->FA_Slurry(m_field, 0.0, (NL_PGG_CUT_DATE + 4) - g_date->DayInYear())) {
157  break;
158  }
160  break;
161  case nl_pgg_ferti_p2:
162  if (!m_farm->FP_Slurry(m_field, 0.0, (NL_PGG_CUT_DATE + 4) - g_date->DayInYear())) {
164  break;
165  }
167  break;
168  case nl_pgg_ferti_s3:
169  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
170  {
171  if (!m_farm->FA_NPK(m_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear())) {
173  break;
174  }
175  }
177  break;
178  case nl_pgg_ferti_p3:
179  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
180  {
181  if (!m_farm->FP_NPK(m_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear())) {
183  break;
184  }
185  }
187  break;
189  // At least 7 days from last watering and 21 from last application of fertilizer.
190  if (g_date->Date() < NL_PGG_WATER_DATE + 7) {
192  break;
193  }
194  else
195  {
196  if (!m_farm->CutToSilage(m_field, 0.0, g_date->DayInYear(15, 6) - g_date->DayInYear())) {
198  break;
199  }
201  if (m_farm->IsStockFarmer()) //Stock Farmer
202  {
204  }
205  else SimpleEvent_(g_date->Date() + 1, nl_pgg_ferti_p4, false, m_farm, m_field);
206  break;
207  }
208  break;
209  case nl_pgg_ferti_s4:
210  if (!m_farm->FA_Slurry(m_field, 0.0, (NL_PGG_CUT_DATE + 4) - g_date->DayInYear())) {
212  break;
213  }
215  break;
216  case nl_pgg_ferti_p4:
217  if (!m_farm->FP_Slurry(m_field, 0.0, (NL_PGG_CUT_DATE + 4) - g_date->DayInYear())) {
219  break;
220  }
222  break;
223  case nl_pgg_ferti_s5:
224  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
225  {
226  if (!m_farm->FA_NPK(m_field, 0.0, g_date->DayInYear(25, 6) - g_date->DayInYear())) {
228  break;
229  }
230  }
232  break;
233  case nl_pgg_ferti_p5:
234  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
235  {
236  if (!m_farm->FP_NPK(m_field, 0.0, g_date->DayInYear(25, 6) - g_date->DayInYear())) {
238  break;
239  }
240  }
242  break;
244  // At least 7 days from last watering and 21 from last application of fertilizer.
245  if (g_date->Date() < NL_PGG_WATER_DATE + 7) {
247  break;
248  }
249  else
250  {
251  if (!m_farm->CutToSilage(m_field, 0.0, g_date->DayInYear(25, 7) - g_date->DayInYear())) {
253  break;
254  }
256  if (m_farm->IsStockFarmer()) //Stock Farmer
257  {
259  }
260  else SimpleEvent_(g_date->Date() + 1, nl_pgg_ferti_p6, false, m_farm, m_field);
261  break;
262  }
263  break;
264  case nl_pgg_ferti_s6:
265  if (!m_farm->FA_Slurry(m_field, 0.0, (NL_PGG_CUT_DATE + 4) - g_date->DayInYear())) {
267  break;
268  }
270  break;
271  case nl_pgg_ferti_p6:
272  if (!m_farm->FP_Slurry(m_field, 0.0, (NL_PGG_CUT_DATE + 4) - g_date->DayInYear())) {
274  break;
275  }
277  break;
278  case nl_pgg_ferti_s7:
279  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
280  {
281  if (!m_farm->FA_NPK(m_field, 0.0, g_date->DayInYear(5, 8) - g_date->DayInYear())) {
283  break;
284  }
285  }
287  break;
288  case nl_pgg_ferti_p7:
289  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
290  {
291  if (!m_farm->FP_NPK(m_field, 0.0, g_date->DayInYear(5, 8) - g_date->DayInYear())) {
293  break;
294  }
295  }
297  break;
299  // At least 7 days from last watering and 21 from last application of fertilizer.
300  if (g_date->Date() < NL_PGG_WATER_DATE + 7) {
302  break;
303  }
304  else
305  {
306  if (!m_farm->CutToSilage(m_field, 0.0, g_date->DayInYear(31, 8) - g_date->DayInYear())) {
308  break;
309  }
311  if (m_farm->IsStockFarmer()) //Stock Farmer
312  {
314  }
315  else SimpleEvent_(g_date->Date() + 1, nl_pgg_ferti_p8, false, m_farm, m_field);
316  break;
317  }
318  break;
319  case nl_pgg_ferti_s8:
320  if (!m_farm->FA_Slurry(m_field, 0.0, (NL_PGG_CUT_DATE + 4) - g_date->DayInYear())) {
322  break;
323  }
325  break;
326  case nl_pgg_ferti_p8:
327  if (!m_farm->FP_Slurry(m_field, 0.0, (NL_PGG_CUT_DATE + 4) - g_date->DayInYear())) {
329  break;
330  }
332  break;
333  case nl_pgg_ferti_s9:
334  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
335  {
336  if (!m_farm->FA_NPK(m_field, 0.0, g_date->DayInYear(10, 9) - g_date->DayInYear())) {
338  break;
339  }
340  }
342  break;
343  case nl_pgg_ferti_p9:
344  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
345  {
346  if (!m_farm->FP_NPK(m_field, 0.0, g_date->DayInYear(10, 9) - g_date->DayInYear())) {
348  break;
349  }
350  }
352  break;
354  // At least 7 days from last watering and 21 from last application of fertilizer.
355  if (g_date->Date() < NL_PGG_WATER_DATE + 7) {
357  break;
358  }
359  else
360  {
361  if (m_ev->m_lock || m_farm->DoIt_prob(0.40))
362  {
363  if (!m_farm->CutToSilage(m_field, 0.0, m_field->GetMDates(0, 0) - g_date->DayInYear())) {
365  break;
366  }
368  }
369  if (m_farm->IsStockFarmer()) //Stock Farmer
370  {
372  }
374  break;
375  }
376  break;
377  case nl_pgg_ferti_s11:
378  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
379  {
380  if (!m_farm->FA_NPK(m_field, 0.0, m_field->GetMDates(1, 1) - g_date->DayInYear())) {
382  break;
383  }
384  }
385  done = true;
386  break;
387  case nl_pgg_ferti_p11:
388  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
389  {
390  if (!m_farm->FP_NPK(m_field, 0.0, m_field->GetMDates(1, 1) - g_date->DayInYear())) {
392  break;
393  }
394  }
395  done = true;
396  break;
397  case nl_pgg_cattle_out:
398  if (!m_farm->CattleOut(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
400  break;
401  }
402  // Keep them out there
404  break;
405  case nl_pgg_cattle_is_out: // Keep the cattle out there
406  // CattleIsOut() returns false if it is not time to stop grazing
407  if (!m_farm->CattleIsOut(m_field, 0.0, g_date->DayInYear(31, 8) - g_date->DayInYear(), g_date->DayInYear(31, 8))) {
409  break;
410  }
411  if (m_farm->IsStockFarmer()) //Stock Farmer
412  {
414  }
415  else SimpleEvent_(g_date->Date() + 1, nl_pgg_ferti_p10, false, m_farm, m_field);
416  break;
417  case nl_pgg_ferti_s10:
418  if (!m_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(5, 9) - g_date->DayInYear())) {
420  break;
421  }
423  break;
424  case nl_pgg_ferti_p10:
425  if (!m_farm->FP_Slurry(m_field, 0.0, g_date->DayInYear(5, 9) - g_date->DayInYear())) {
427  break;
428  }
430  break;
432  if (!m_farm->CutToSilage(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
434  break;
435  }
436  if (m_farm->IsStockFarmer()) //Stock Farmer
437  {
439  }
441  break;
442  case nl_pgg_watering:
443  if (m_ev->m_lock || m_farm->DoIt_prob(0.40))
444  {
445  if (g_date->Date() < NL_PGG_CUT_DATE + 3) {
446  // Too close to silage cutting, so try again tomorrow.
448  }
449  else
450  {
451  if (!m_farm->Water(m_field, 0.0, g_date->DayInYear(31, 8) - g_date->DayInYear())) {
453  break;
454  }
456  }
457  }
458  // End of thread
459  break;
460  default:
461  g_msg->Warn(WARN_BUG, "NLPermanentGrassGrazed::Do(): "
462  "Unknown event type! ", "");
463  exit(1);
464  }
465  return done;
466 }

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::GetMDates(), Farm::IsStockFarmer(), Crop::m_ev, Crop::m_farm, Crop::m_field, Crop::m_last_date, FarmEvent::m_lock, FarmEvent::m_todo, nl_pgg_cattle_is_out, nl_pgg_cattle_out, NL_PGG_CUT_DATE, nl_pgg_cut_to_silage1, nl_pgg_cut_to_silage2, nl_pgg_cut_to_silage3, nl_pgg_cut_to_silage4, nl_pgg_cut_to_silage5, nl_pgg_cut_to_silage6, NL_PGG_FERTI_DATE, nl_pgg_ferti_p1, nl_pgg_ferti_p10, nl_pgg_ferti_p11, nl_pgg_ferti_p2, nl_pgg_ferti_p3, nl_pgg_ferti_p4, nl_pgg_ferti_p5, nl_pgg_ferti_p6, nl_pgg_ferti_p7, nl_pgg_ferti_p8, nl_pgg_ferti_p9, nl_pgg_ferti_s1, nl_pgg_ferti_s10, nl_pgg_ferti_s11, nl_pgg_ferti_s2, nl_pgg_ferti_s3, nl_pgg_ferti_s4, nl_pgg_ferti_s5, nl_pgg_ferti_s6, nl_pgg_ferti_s7, nl_pgg_ferti_s8, nl_pgg_ferti_s9, nl_pgg_start, NL_PGG_WATER_DATE, nl_pgg_watering, Calendar::OldDays(), Crop::SimpleEvent_(), Crop::StartUpCrop(), tov_NLPermanentGrassGrazed, MapErrorMsg::Warn(), WARN_BUG, and Farm::Water().

◆ SetUpFarmCategoryInformation()

void NLPermanentGrassGrazed::SetUpFarmCategoryInformation ( )
inline
96  {
97  const int elements = 2 + (nl_pgg_foobar - NLPERMANENTGRASSLANDGRAZED_BASE);
99 
100  FarmManagementCategory catlist[elements] =
101  {
102  fmc_Others, // zero element unused but must be here
103  fmc_Others,//nl_pgg_start = 1, // Compulsory, must always be 1 (one).
104  fmc_Others,//nl_pgg_sleep_all_day = NLPERMANENTGRASSLANDGRAZED_BASE,
105  fmc_Fertilizer,//nl_pgg_ferti_p1,
106  fmc_Fertilizer,//nl_pgg_ferti_s1,
107  fmc_Cutting,//nl_pgg_cut_to_silage1,
108  fmc_Cutting,//nl_pgg_cut_to_silage2,
109  fmc_Cutting,//nl_pgg_cut_to_silage3,
110  fmc_Cutting,//nl_pgg_cut_to_silage4,
111  fmc_Cutting,//nl_pgg_cut_to_silage5,
112  fmc_Cutting,//nl_pgg_cut_to_silage6,
113  fmc_Fertilizer,//nl_pgg_ferti_p2,
114  fmc_Fertilizer,//nl_pgg_ferti_s2,
115  fmc_Fertilizer,//nl_pgg_ferti_p3,
116  fmc_Fertilizer,//nl_pgg_ferti_s3,
117  fmc_Fertilizer,//nl_pgg_ferti_p4,
118  fmc_Fertilizer,//nl_pgg_ferti_s4,
119  fmc_Fertilizer,//nl_pgg_ferti_p5,
120  fmc_Fertilizer,//nl_pgg_ferti_s5,
121  fmc_Fertilizer,//nl_pgg_ferti_p6,
122  fmc_Fertilizer,//nl_pgg_ferti_s6,
123  fmc_Fertilizer,//nl_pgg_ferti_p7,
124  fmc_Fertilizer,//nl_pgg_ferti_s7,
125  fmc_Fertilizer,//nl_pgg_ferti_p8,
126  fmc_Fertilizer,//nl_pgg_ferti_s8,
127  fmc_Fertilizer,//nl_pgg_ferti_p9,
128  fmc_Fertilizer,//nl_pgg_ferti_s9,
129  fmc_Fertilizer,//nl_pgg_ferti_p10,
130  fmc_Fertilizer,//nl_pgg_ferti_s10,
131  fmc_Fertilizer,//nl_pgg_ferti_p11,
132  fmc_Fertilizer,//nl_pgg_ferti_s11,
133  fmc_Watering,//nl_pgg_watering,
134  fmc_Grazing,//nl_pgg_cattle_out,
135  fmc_Grazing//nl_pgg_cattle_is_out,
136 
137  // no foobar entry
138 
139  };
140  // Iterate over the catlist elements and copy them to vector
141  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
142 
143  }

References fmc_Cutting, fmc_Fertilizer, fmc_Grazing, fmc_Others, fmc_Watering, Crop::m_base_elements_no, Crop::m_ManagementCategories, nl_pgg_foobar, and NLPERMANENTGRASSLANDGRAZED_BASE.

Referenced by NLPermanentGrassGrazed().


The documentation for this class was generated from the following files:
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
nl_pgg_ferti_p10
Definition: NLPermanentGrassGrazed.h:65
nl_pgg_cut_to_silage5
Definition: NLPermanentGrassGrazed.h:47
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
nl_pgg_ferti_p2
Definition: NLPermanentGrassGrazed.h:49
NL_PGG_FERTI_DATE
#define NL_PGG_FERTI_DATE
A flag used to indicate autumn ploughing status.
Definition: NLPermanentGrassGrazed.h:28
nl_pgg_ferti_s5
Definition: NLPermanentGrassGrazed.h:56
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
nl_pgg_ferti_s3
Definition: NLPermanentGrassGrazed.h:52
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
nl_pgg_ferti_p3
Definition: NLPermanentGrassGrazed.h:51
NL_PGG_WATER_DATE
#define NL_PGG_WATER_DATE
Definition: NLPermanentGrassGrazed.h:30
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_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
nl_pgg_ferti_s8
Definition: NLPermanentGrassGrazed.h:62
nl_pgg_ferti_p1
Definition: NLPermanentGrassGrazed.h:41
nl_pgg_ferti_s4
Definition: NLPermanentGrassGrazed.h:54
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
nl_pgg_ferti_s10
Definition: NLPermanentGrassGrazed.h:66
NLPERMANENTGRASSLANDGRAZED_BASE
#define NLPERMANENTGRASSLANDGRAZED_BASE
Definition: NLPermanentGrassGrazed.h:24
nl_pgg_cut_to_silage3
Definition: NLPermanentGrassGrazed.h:45
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
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
nl_pgg_ferti_p11
Definition: NLPermanentGrassGrazed.h:67
fmc_Cutting
Definition: LandscapeFarmingEnums.h:1009
tov_NLPermanentGrassGrazed
Definition: LandscapeFarmingEnums.h:261
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
nl_pgg_ferti_s9
Definition: NLPermanentGrassGrazed.h:64
nl_pgg_ferti_p8
Definition: NLPermanentGrassGrazed.h:61
Calendar::Date
long Date(void)
Definition: Calendar.h:57
nl_pgg_ferti_s6
Definition: NLPermanentGrassGrazed.h:58
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
fmc_Watering
Definition: LandscapeFarmingEnums.h:1011
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
nl_pgg_ferti_s2
Definition: NLPermanentGrassGrazed.h:50
nl_pgg_watering
Definition: NLPermanentGrassGrazed.h: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
nl_pgg_cattle_is_out
Definition: NLPermanentGrassGrazed.h:71
nl_pgg_foobar
Definition: NLPermanentGrassGrazed.h:72
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
nl_pgg_ferti_p6
Definition: NLPermanentGrassGrazed.h:57
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
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
nl_pgg_cut_to_silage2
Definition: NLPermanentGrassGrazed.h:44
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
fmc_Grazing
Definition: LandscapeFarmingEnums.h:1010
nl_pgg_ferti_s7
Definition: NLPermanentGrassGrazed.h:60
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
NLPermanentGrassGrazed::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: NLPermanentGrassGrazed.h:96
nl_pgg_ferti_p9
Definition: NLPermanentGrassGrazed.h:63
nl_pgg_ferti_p7
Definition: NLPermanentGrassGrazed.h:59
nl_pgg_cut_to_silage4
Definition: NLPermanentGrassGrazed.h:46
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
nl_pgg_ferti_p4
Definition: NLPermanentGrassGrazed.h:53
nl_pgg_start
Definition: NLPermanentGrassGrazed.h:39
nl_pgg_ferti_p5
Definition: NLPermanentGrassGrazed.h:55
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
nl_pgg_cut_to_silage6
Definition: NLPermanentGrassGrazed.h:48
nl_pgg_ferti_s1
Definition: NLPermanentGrassGrazed.h:42
nl_pgg_cut_to_silage1
Definition: NLPermanentGrassGrazed.h:43
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
NL_PGG_CUT_DATE
#define NL_PGG_CUT_DATE
Definition: NLPermanentGrassGrazed.h:29
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
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
nl_pgg_cattle_out
Definition: NLPermanentGrassGrazed.h:70
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
nl_pgg_ferti_s11
Definition: NLPermanentGrassGrazed.h:68