Loading [MathJax]/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
PTPermanentGrassGrazed Class Reference

PTPermanentGrassGrazed class
. More...

#include <PTPermanentGrassGrazed.h>

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

PTPermanentGrassGrazed class
.

See PTPermanentGrassGrazed.h::PTPermanentGrassGrazedToDo 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

◆ PTPermanentGrassGrazed()

PTPermanentGrassGrazed::PTPermanentGrassGrazed ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
105  : Crop(a_tov, a_toc, a_L)
106  {
107  // When we start it off, the first possible date for a farm operation is 31th November
108  // This information is used by other crops when they decide how much post processing of
109  // the management is allowed after harvest before the next crop starts.
110  m_first_date=g_date->DayInYear( 10,1 );//Last possible date to do the first operation, i.e. plough or sow
112  }

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

Member Function Documentation

◆ Do()

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

54 {
55  /******************** This block can be added to the top of all Crop::Do methods ***********************************************/
56  m_farm = a_farm; // These assignments are necessary, not for this method but for related event calls
57  m_field = a_field;
58  m_ev = a_ev;
59  bool done = false; // The boolean value done indicates when we are totally finished with this plan (i.e. it is set to true).
60  int d1 = 0;
61  TTypesOfVegetation l_tov = tov_PTPermanentGrassGrazed; // The current type - change to match the crop you have
62 /**********************************************To Here *************************************************************************/
63 
64  // Depending what event has occured jump to the correct bit of code
65  switch (m_ev->m_todo)
66  {
67  case pt_pgg_start:
68  {
72  PT_PGG_YEARS_AFTER_SOW = 0; //Here PT_PGG1_YEARS_AFTER_SOW flag should get randomly for each field a value from 1 to 5 ->
73  //THIS PART SHOULD BE SOMEWHERE ELSE OUTSIDE THE PLAN, SO THE STARTING CONDITIONS FOR FIELDS WITH PERMANENT GRASS (YEAR AFTER SOWING)
74  // IS SET ONLY ONCE AT THE SIMULATION START!!!
75 
77 
78  m_last_date = g_date->DayInYear(28, 12); // 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(28, 12); // last possible day of 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(28, 12); // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 1)
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(pt_pgg_cattle_out2))) 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, 10) + isSpring;
95  // OK, let's go.
96  // Here we queue up the first event
97 
98  //Each field has assign randomly a PT_PGG1_YEARS_AFTER_SOW flag value from 1 to 5
99  //if 1 then first year after sowing and cattle should graze in periods 1.02-15.03 and 1.05-30.09 instead of 1.01-30.09
100  //if 2, 3 or 4 then cattle is out between 1.01 and 30.09 and then NPK and then cattle is out again till the end of year
101  //if 0 then it is a re-sowing year and cattle should graze only till 1.09 and then the grass is sown again and fertilized
102 
103  if ((PT_PGG_YEARS_AFTER_SOW + g_date->GetYearNumber()) % 5 == 0)
104  {
105  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + isSpring;
107  }
108  else if ((PT_PGG_YEARS_AFTER_SOW + g_date->GetYearNumber()) % 5 == 1)
109  {
110  d1 = g_date->OldDays() + g_date->DayInYear(1, 2) + isSpring;
112  }
113  else
114  {
115  d1 = g_date->OldDays() + g_date->DayInYear(1, 1) + isSpring;
117  }
118  break;
119  }
120  break;
121 
122  // This is the first real farm operation
123  // This happens in the sowing year
124  case pt_pgg_cattle_out1:
125  if (!m_farm->CattleOutLowGrazing(m_field, 0.0, g_date->DayInYear(10, 1) - g_date->DayInYear())) {
127  break;
128  }
130  // Keep them out there
132  break;
133  case pt_pgg_cattle_is_out1: // Keep the cattle out there
134  // CattleIsOutLow() returns false if it is not time to stop grazing
137  break;
138  }
140  break;
141  case pt_pgg_plough:
142  if (m_ev->m_lock || m_farm->DoIt_prob(0.33))
143  {
144  if (!m_farm->AutumnPlough(m_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
146  break;
147  }
148  SimpleEvent_(g_date->Date() + 1, pt_pgg_sow, false, m_farm, m_field);
149  break;
150  }
152  break;
153  case pt_pgg_sow:
154  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(1, 11) - g_date->DayInYear())) {
155  SimpleEvent_(g_date->Date() + 1, pt_pgg_sow, true, m_farm, m_field);
156  break;
157  }
158  // Fork of two events: NPK/organic and calcium
159  if (m_farm->IsStockFarmer()) //Stock Farmer // slurry thread
160  {
162  }
163  else SimpleEvent_(g_date->Date()+1, pt_pgg_ferti_p2, false, m_farm, m_field);
164  if (m_farm->IsStockFarmer()) //Stock Farmer // calcium thread
165  {
167  }
168  else SimpleEvent_(g_date->Date()+1, pt_pgg_ferti_p4, false, m_farm, m_field);
169  break;
170  case pt_pgg_ferti_s2:
171  if (m_ev->m_lock || m_farm->DoIt_prob(0.25))
172  {
173  if (!m_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(2, 11) - g_date->DayInYear())) {
175  break;
176  }
177  d1 = g_date->Date();
178  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 11)) {
179  d1 = g_date->OldDays() + g_date->DayInYear(1, 11);
180  }
181  SimpleEvent_(d1, pt_pgg_wait, false, m_farm, m_field);
182  break;
183  }
185  break;
186  case pt_pgg_ferti_p2:
187  if (m_ev->m_lock || m_farm->DoIt_prob(0.25))
188  {
189  if (!m_farm->FP_Slurry(m_field, 0.0, g_date->DayInYear(2, 11) - g_date->DayInYear())) {
191  break;
192  }
193  d1 = g_date->Date();
194  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 11)) {
195  d1 = g_date->OldDays() + g_date->DayInYear(1, 11);
196  }
197  SimpleEvent_(d1, pt_pgg_wait, false, m_farm, m_field);
198  break;
199  }
201  break;
202  case pt_pgg_ferti_s3:
203  if (!m_farm->FA_NPK(m_field, 0.0, g_date->DayInYear(3, 11) - g_date->DayInYear())) {
205  break;
206  }
207  d1 = g_date->Date();
208  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 11)) {
209  d1 = g_date->OldDays() + g_date->DayInYear(1, 11);
210  }
211  SimpleEvent_(d1, pt_pgg_wait, false, m_farm, m_field);
212  break;
213  case pt_pgg_ferti_p3:
214  if (!m_farm->FP_NPK(m_field, 0.0, g_date->DayInYear(3, 11) - g_date->DayInYear())) {
216  break;
217  }
218  d1 = g_date->Date();
219  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 11)) {
220  d1 = g_date->OldDays() + g_date->DayInYear(1, 11);
221  }
222  SimpleEvent_(d1, pt_pgg_wait, false, m_farm, m_field);
223  break;
224  case pt_pgg_ferti_s4:
225  if (!m_farm->FA_Calcium(m_field, 0.0, g_date->DayInYear(2, 11) - g_date->DayInYear())) {
227  break;
228  }
229  // End of thread
230  break;
231  case pt_pgg_ferti_p4:
232  if (!m_farm->FP_Calcium(m_field, 0.0, g_date->DayInYear(2, 11) - g_date->DayInYear())) {
234  break;
235  }
236  // End of thread
237  break;
238  case pt_pgg_sow_psc:
241  break;
242  }
243  // Fork of two events: NPK/organic and calcium
244  if (m_farm->IsStockFarmer()) //Stock Farmer // NPK thread
245  {
247  }
248  else SimpleEvent_(g_date->Date()+1, pt_pgg_ferti_p5, false, m_farm, m_field);
249  if (m_farm->IsStockFarmer()) //Stock Farmer // calcium thread
250  {
252  }
253  else SimpleEvent_(g_date->Date()+1, pt_pgg_ferti_p4, false, m_farm, m_field);
254  break;
255  case pt_pgg_ferti_s5:
256  if (!m_farm->FA_NPK(m_field, 0.0, g_date->DayInYear(2, 11) - g_date->DayInYear())) {
258  break;
259  }
260  d1 = g_date->Date();
261  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 11)) {
262  d1 = g_date->OldDays() + g_date->DayInYear(1, 11);
263  }
264  SimpleEvent_(d1, pt_pgg_wait, false, m_farm, m_field);
265  break;
266  case pt_pgg_ferti_p5:
267  if (!m_farm->FP_NPK(m_field, 0.0, g_date->DayInYear(2, 11) - g_date->DayInYear())) {
269  break;
270  }
271  d1 = g_date->Date();
272  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 11)) {
273  d1 = g_date->OldDays() + g_date->DayInYear(1, 11);
274  }
275  SimpleEvent_(d1, pt_pgg_wait, false, m_farm, m_field);
276  break;
277  case pt_pgg_wait:
278  done = true;
279  break;
280  // End of Thread
281 
282  // This happens 1 year after sowing
283  case pt_pgg_cattle_out2:
284  if (!m_farm->CattleOutLowGrazing(m_field, 0.0, g_date->DayInYear(10, 2) - g_date->DayInYear())) {
286  break;
287  }
289  // Keep them out there
291  break;
292  case pt_pgg_cattle_is_out2: // Keep the cattle out there
293  // CattleIsOutLow() returns false if it is not time to stop grazing
296  break;
297  }
299  break;
300  case pt_pgg_cattle_out3:
301  if (!m_farm->CattleOutLowGrazing(m_field, 0.0, g_date->DayInYear(10, 5) - g_date->DayInYear())) {
303  break;
304  }
306  // Keep them out there
308  break;
309  case pt_pgg_cattle_is_out3: // Keep the cattle out there
310  // CattleIsOutLow() returns false if it is not time to stop grazing
313  break;
314  }
315  done = true;
316  break;
317 
318  // This happens 2, 3 and 4 years after sowing
319  case pt_pgg_cattle_out4:
320  if (!m_farm->CattleOutLowGrazing(m_field, 0.0, g_date->DayInYear(10, 1) - g_date->DayInYear())) {
322  break;
323  }
325  // Keep them out there
327  break;
328  case pt_pgg_cattle_is_out4: // Keep the cattle out there
329  // CattleIsOutLow() returns false if it is not time to stop grazing
332  break;
333  }
334  if (m_farm->IsStockFarmer()) //Stock Farmer // NPK thread
335  {
337  }
339  break;
340  case pt_pgg_ferti_s1:
341  if (m_ev->m_lock || m_farm->DoIt_prob(0.50))
342  {
343  if (!m_farm->FA_NPK(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
345  break;
346  }
347  SimpleEvent_(g_date->Date() + 1, pt_pgg_cattle_out5, false, m_farm, m_field); // check if cattle go out the next day after NPK or should wait couple days
348  break;
349  }
351  break;
352  case pt_pgg_ferti_p1:
353  if (m_ev->m_lock || m_farm->DoIt_prob(0.50))
354  {
355  if (!m_farm->FP_NPK(m_field, 0.0, g_date->DayInYear(15, 11) - g_date->DayInYear())) {
357  break;
358  }
359  SimpleEvent_(g_date->Date() + 1, pt_pgg_cattle_out5, false, m_farm, m_field); // check if cattle go out the next day after NPK or should wait couple days
360  break;
361  }
363  break;
364  case pt_pgg_cattle_out5:
365  if (!m_farm->CattleOutLowGrazing(m_field, 0.0, g_date->DayInYear(20, 11) - g_date->DayInYear())) {
367  break;
368  }
370  // Keep them out there
372  break;
373  case pt_pgg_cattle_is_out5: // Keep the cattle out there
374  // CattleIsOutLow() returns false if it is not time to stop grazing
377  break;
378  }
379  done = true;
380  break;
381 
382  default:
383  g_msg->Warn(WARN_BUG, "PTPermanentGrassGrazed::Do(): "
384  "Unknown event type! ", "");
385  exit(1);
386  }
387  return done;
388 }

References Farm::AutumnPlough(), Farm::AutumnSow(), Farm::CattleIsOutLow2(), Farm::CattleOutLowGrazing(), LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), Farm::DoIt_prob(), Farm::FA_Calcium(), Farm::FA_NPK(), Farm::FA_Slurry(), Farm::FP_Calcium(), Farm::FP_NPK(), Farm::FP_Slurry(), g_date, g_msg, LE::GetMDates(), Calendar::GetYearNumber(), Farm::IsStockFarmer(), Crop::m_ev, Crop::m_farm, Crop::m_field, Crop::m_last_date, FarmEvent::m_lock, FarmEvent::m_todo, Calendar::OldDays(), Farm::PreseedingCultivatorSow(), PT_PGG1_CATTLEOUT_DATE, PT_PGG2_CATTLEOUT_DATE, PT_PGG3_CATTLEOUT_DATE, PT_PGG4_CATTLEOUT_DATE, PT_PGG5_CATTLEOUT_DATE, pt_pgg_cattle_is_out1, pt_pgg_cattle_is_out2, pt_pgg_cattle_is_out3, pt_pgg_cattle_is_out4, pt_pgg_cattle_is_out5, pt_pgg_cattle_out1, pt_pgg_cattle_out2, pt_pgg_cattle_out3, pt_pgg_cattle_out4, pt_pgg_cattle_out5, pt_pgg_ferti_p1, pt_pgg_ferti_p2, pt_pgg_ferti_p3, pt_pgg_ferti_p4, pt_pgg_ferti_p5, pt_pgg_ferti_s1, pt_pgg_ferti_s2, pt_pgg_ferti_s3, pt_pgg_ferti_s4, pt_pgg_ferti_s5, pt_pgg_plough, pt_pgg_sow, pt_pgg_sow_psc, pt_pgg_start, pt_pgg_wait, PT_PGG_YEARS_AFTER_SOW, Crop::SimpleEvent_(), Crop::StartUpCrop(), tov_PTPermanentGrassGrazed, MapErrorMsg::Warn(), and WARN_BUG.

◆ SetUpFarmCategoryInformation()

void PTPermanentGrassGrazed::SetUpFarmCategoryInformation ( )
inline
113  {
114  const int elements = 2 + (pt_pgg_foobar - PTPERMANENTGRASSLANDGRAZED_BASE);
116 
117  FarmManagementCategory catlist[elements] =
118  {
119  fmc_Others, // zero element unused but must be here
120  fmc_Others, //pt_pgg_start = 1, // Compulsory, must always be 1 (one).
121  fmc_Others, //pt_pgg_sleep_all_day = PTPERMANENTGRASSLANDGRAZED_BASE,
122  fmc_Grazing, //pt_pgg_cattle_out1,//Out means outside the barns. Out in the field to eat grass.
123  fmc_Grazing, //pt_pgg_cattle_is_out1,//Time that the catle is in the field.
124  fmc_Grazing, //pt_pgg_cattle_out2,
125  fmc_Grazing, //pt_pgg_cattle_is_out2,
126  fmc_Grazing, //pt_pgg_cattle_out3,
127  fmc_Grazing, //pt_pgg_cattle_is_out3,
128  fmc_Grazing, //pt_pgg_cattle_out4,
129  fmc_Grazing, //pt_pgg_cattle_is_out4,
130  fmc_Grazing, //pt_pgg_cattle_out5,
131  fmc_Grazing, //pt_pgg_cattle_is_out5,
132  fmc_Fertilizer, //pt_pgg_ferti_p1,//NPK in non-sowing year
133  fmc_Fertilizer, //pt_pgg_ferti_s1,//NPK in non-sowing year
134  fmc_Fertilizer, //pt_pgg_ferti_p2,//Slurry in sowing year
135  fmc_Fertilizer, //pt_pgg_ferti_s2,//Slurry in sowing year
136  fmc_Fertilizer, //pt_pgg_ferti_s3,//NPK in sowing year
137  fmc_Fertilizer, //pt_pgg_ferti_p3,//NPK in sowing year
138  fmc_Fertilizer, //pt_pgg_ferti_p4,//Calcium
139  fmc_Fertilizer, //pt_pgg_ferti_s4,//Calcium
140  fmc_Fertilizer, //pt_pgg_ferti_p5,//NPK
141  fmc_Fertilizer, //pt_pgg_ferti_s5,//NPK
142  fmc_Cultivation, //pt_pgg_plough,
143  fmc_Others, //pt_pgg_sow,
144  fmc_Cultivation, //pt_pgg_sow_psc,//Sow with preseeding cultivator
145  fmc_Others, //pt_pgg_wait,
146 
147  // no foobar entry
148 
149  };
150  // Iterate over the catlist elements and copy them to vector
151  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
152 
153  }

References fmc_Cultivation, fmc_Fertilizer, fmc_Grazing, fmc_Others, Crop::m_base_elements_no, Crop::m_ManagementCategories, pt_pgg_foobar, and PTPERMANENTGRASSLANDGRAZED_BASE.

Referenced by PTPermanentGrassGrazed().


The documentation for this class was generated from the following files:
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
pt_pgg_cattle_is_out2
Definition: PTPermanentGrassGrazed.h:67
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
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
PT_PGG_YEARS_AFTER_SOW
#define PT_PGG_YEARS_AFTER_SOW
A flag used to indicate cattle out dates.
Definition: PTPermanentGrassGrazed.h:49
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
Calendar::GetYearNumber
int GetYearNumber(void)
Definition: Calendar.h:72
pt_pgg_ferti_p1
Definition: PTPermanentGrassGrazed.h:74
pt_pgg_ferti_p3
Definition: PTPermanentGrassGrazed.h:79
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
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
Farm::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::CattleIsOutLow2
virtual bool CattleIsOutLow2(LE *a_field, double a_user, int a_days, int a_max, int a_max_days)
Generate a 'cattle_out_low2' event for every day the cattle are on a_field, cattle is low grazing and...
Definition: FarmFuncs.cpp:2607
Farm::CattleOutLowGrazing
virtual bool CattleOutLowGrazing(LE *a_field, double a_user, int a_days)
Start a extensive grazing event on a_field today.
Definition: FarmFuncs.cpp:2439
pt_pgg_cattle_is_out4
Definition: PTPermanentGrassGrazed.h:71
pt_pgg_sow_psc
Definition: PTPermanentGrassGrazed.h:86
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
pt_pgg_cattle_out4
Definition: PTPermanentGrassGrazed.h:70
pt_pgg_ferti_p2
Definition: PTPermanentGrassGrazed.h:76
pt_pgg_cattle_is_out3
Definition: PTPermanentGrassGrazed.h:69
Calendar::Date
long Date(void)
Definition: Calendar.h:57
pt_pgg_ferti_s5
Definition: PTPermanentGrassGrazed.h:83
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
pt_pgg_ferti_s3
Definition: PTPermanentGrassGrazed.h:78
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
Farm::FA_Calcium
virtual bool FA_Calcium(LE *a_field, double a_user, int a_days)
Calcium applied on a_field owned by a stock farmer.
Definition: FarmFuncs.cpp:1168
pt_pgg_ferti_s1
Definition: PTPermanentGrassGrazed.h:75
pt_pgg_cattle_is_out5
Definition: PTPermanentGrassGrazed.h:73
pt_pgg_ferti_s2
Definition: PTPermanentGrassGrazed.h:77
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
pt_pgg_cattle_out5
Definition: PTPermanentGrassGrazed.h:72
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
Farm::FP_Calcium
virtual bool FP_Calcium(LE *a_field, double a_user, int a_days)
Calcium applied on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:954
PT_PGG4_CATTLEOUT_DATE
#define PT_PGG4_CATTLEOUT_DATE
Definition: PTPermanentGrassGrazed.h:53
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
pt_pgg_ferti_s4
Definition: PTPermanentGrassGrazed.h:81
pt_pgg_sow
Definition: PTPermanentGrassGrazed.h:85
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
pt_pgg_plough
Definition: PTPermanentGrassGrazed.h:84
PT_PGG3_CATTLEOUT_DATE
#define PT_PGG3_CATTLEOUT_DATE
Definition: PTPermanentGrassGrazed.h:52
PTPermanentGrassGrazed::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: PTPermanentGrassGrazed.h:113
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
pt_pgg_cattle_is_out1
Definition: PTPermanentGrassGrazed.h:65
pt_pgg_cattle_out2
Definition: PTPermanentGrassGrazed.h:66
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
pt_pgg_cattle_out3
Definition: PTPermanentGrassGrazed.h:68
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
pt_pgg_foobar
Definition: PTPermanentGrassGrazed.h:88
PTPERMANENTGRASSLANDGRAZED_BASE
#define PTPERMANENTGRASSLANDGRAZED_BASE
Definition: PTPermanentGrassGrazed.h:45
Crop::m_last_date
int m_last_date
Definition: Farm.h:503
PT_PGG1_CATTLEOUT_DATE
#define PT_PGG1_CATTLEOUT_DATE
Definition: PTPermanentGrassGrazed.h:50
Farm::AutumnPlough
virtual bool AutumnPlough(LE *a_field, double a_user, int a_days)
Carry out a ploughing event in the autumn on a_field.
Definition: FarmFuncs.cpp:212
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
fmc_Grazing
Definition: LandscapeFarmingEnums.h:1010
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
pt_pgg_start
Definition: PTPermanentGrassGrazed.h:62
Farm::AutumnSow
virtual bool AutumnSow(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 autumn on a_field.
Definition: FarmFuncs.cpp:360
PT_PGG2_CATTLEOUT_DATE
#define PT_PGG2_CATTLEOUT_DATE
Definition: PTPermanentGrassGrazed.h:51
pt_pgg_ferti_p4
Definition: PTPermanentGrassGrazed.h:80
pt_pgg_cattle_out1
Definition: PTPermanentGrassGrazed.h:64
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
PT_PGG5_CATTLEOUT_DATE
#define PT_PGG5_CATTLEOUT_DATE
Definition: PTPermanentGrassGrazed.h:54
pt_pgg_wait
Definition: PTPermanentGrassGrazed.h:87
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
pt_pgg_ferti_p5
Definition: PTPermanentGrassGrazed.h:82
WARN_BUG
Definition: MapErrorMsg.h:34
tov_PTPermanentGrassGrazed
Definition: LandscapeFarmingEnums.h:308
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