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

BEMaize class
. More...

#include <BEMaizeCC.h>

Inheritance diagram for BEMaizeCC:
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...
 
 BEMaizeCC (TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
 
- 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

BEMaize class
.

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

◆ BEMaizeCC()

BEMaizeCC::BEMaizeCC ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
66  : Crop(a_tov, a_toc, a_L)
67  {
68  // When we start it off, the first possible date for a farm operation is 5th November
69  // This information is used by other crops when they decide how much post processing of
70  // the management is allowed after harvest before the next crop starts.
71  m_first_date=g_date->DayInYear( 31,10 );
72  m_forcespringpossible = true;
73  }

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

Member Function Documentation

◆ Do()

bool BEMaizeCC::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 maize.

Reimplemented from Crop.

57 {
58  /******************** This block can be added to the top of all Crop::Do methods ***********************************************/
59  m_farm = a_farm; // These assignments are necessary, not for this method but for related event calls
60  m_field = a_field;
61  m_ev = a_ev;
62  bool done = false; // The boolean value done indicates when we are totally finished with this plan (i.e. it is set to true).
63  bool flag = false;
64  int d1 = 0;
65  int noDates = 1;
66  TTypesOfVegetation l_tov = tov_BEMaizeCC; // The current type - change to match the crop you have
67  /**********************************************To Here *************************************************************************/
68  int l_nextcropstartdate;
69  // Depending what event has occured jump to the correct bit of code
70  switch (a_ev->m_todo)
71  {
72  case BE_mcc_start:
73  {
74  // BE_mcc_start just sets up all the starting conditions and reference dates that are needed to start a BE_maize
75  BE_MCC_START_FERTI = false;
76  // Set up the date management stuff
77  // The next bit of code just allows for altering dates after harvest if it is necessary
78  // to allow for a crop which starts its management early.
79 
80  // 5 start and stop dates for all 'movable' events for this crop
81  int noDates = 1;
82  a_field->SetMDates(0, 0, g_date->DayInYear(5, 10)); // last possible day of harvest
83  a_field->SetMDates(1, 0, g_date->DayInYear(10, 10)); // last possible day of straw chopping
84  // then these will be reduced in value to 0
85 
86  a_field->SetMConstants(0, 1);
87 
88  // Check the next crop for early start, uBEess it is a spring crop
89  // in which case we ASSUME that no checking is necessary!!!!
90  // So DO NOT implement a crop that runs over the year boundary (i.e. from spring to spring!), at least not without fixing this.
91 
92  //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)
93  //optimising farms not used for now so most of related code is removed (but not in 'start' case)
94  if (!(a_farm->GetType() == tof_OptimisingFarm && g_date->GetYearNumber() > 0)) {
95 
96  if (a_ev->m_startday > g_date->DayInYear(1, 7)) {
97  if (a_field->GetMDates(0, 0) >= a_ev->m_startday)
98  {
99  g_msg->Warn(WARN_BUG, "BEMaizeCC::Do(): ", "Harvest too late for the next crop to start!!!");
100  int almassnum = a_field->GetLandscape()->BackTranslateVegTypes(a_ev->m_next_tov);
101  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
102  }
103  // Now fix any late finishing problems
104  for (int i = 0; i < noDates; i++) {
105  if (a_field->GetMDates(0, i) >= a_ev->m_startday) {
106  a_field->SetMDates(0, i, a_ev->m_startday - 1); //move the starting date
107  }
108  if (a_field->GetMDates(1, i) >= a_ev->m_startday) {
109  a_field->SetMConstants(i, 0); //change the default value of the MConst (=1) to 0 (necessary to correctly execute farm events in case the finishing date (MDate) was moved)
110  a_field->SetMDates(1, i, a_ev->m_startday - 1); //move the finishing date
111  }
112  }
113  }
114  // Now no operations can be timed after the start of the next crop.
115 
116  if (!a_ev->m_first_year) {
117  // Are we before July 1st?
118  d1 = g_date->OldDays() + g_date->DayInYear(1, 7);
119  if (g_date->Date() < d1) {
120  // Yes, too early. We assumme this is because the last crop was late
121  printf("Poly: %d\n", a_field->GetPoly());
122  g_msg->Warn(WARN_BUG, "BEMaizeCC::Do(): ", "Crop start attempt between 1st Jan & 1st July");
123  int prev = a_field->GetLandscape()->BackTranslateVegTypes(a_field->GetOwner()->GetPreviousTov(a_field->GetRotIndex()));
124  g_msg->Warn(WARN_BUG, "Previous Crop ", prev);
125  int almassnum = a_field->GetLandscape()->BackTranslateVegTypes(a_ev->m_next_tov);
126  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
127  exit(1);
128  }
129  else {
130  d1 = g_date->OldDays() + m_first_date; // Add 365 for spring crop
131  if (g_date->Date() > d1) {
132  // Yes too late - should not happen - raise an error
133  g_msg->Warn(WARN_BUG, "BEMaizeCC::Do(): ", "Crop start attempt after last possible start date");
134  int prev = a_field->GetLandscape()->BackTranslateVegTypes(a_field->GetOwner()->GetPreviousTov(a_field->GetRotIndex()));
135  g_msg->Warn(WARN_BUG, "Previous Crop ", prev);
136  int almassnum = a_field->GetLandscape()->BackTranslateVegTypes(a_ev->m_next_tov);
137  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
138  exit(1);
139  }
140  }
141  }
142  else {
143  // Is the first year
144  // Some special code to cope with that first start-up year in ALMaSS - ignore for all practical purposes
145  // Code for first spring treatment used
146  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(15, 4), BE_mcc_spring_sow, false, a_farm, a_field);
147  break;
148  }
149  }//if
150 
151  // End single block date checking code. Please see next line comment as well.
152  // Reinit d1 to first possible starting date.
153  d1 = g_date->OldDays() + g_date->DayInYear(1, 9);
154  // OK, let's go.
155  // Here we queue up the first event - this differs depending on whether we have field on snady or clay soils
156  if (a_field->GetSoilType() <= 5 || a_field->GetSoilType() == 7) { // on sandy soils (BE ZAND & LOSS)
157  SimpleEvent_(d1, BE_mcc_stubble_harrow1, false, a_farm, a_field);
158  }
159  else SimpleEvent_(d1, BE_mcc_stubble_harrow2, false, a_farm, a_field);
160  }
161  break;
162 
163  // This is the first real farm operation
165  if (a_ev->m_lock || a_farm->DoIt_prob(0.70))
166  {
167  if (!a_farm->StubbleHarrowing(a_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
168  SimpleEvent_(g_date->Date() + 1, BE_mcc_stubble_harrow1, true, a_farm, a_field);
169  break;
170  }
171  }
172  d1 = g_date->Date() + 10;
173  if (d1 < g_date->OldDays() + g_date->DayInYear(15, 10)) {
174  d1 = g_date->OldDays() + g_date->DayInYear(15, 10);
175  }
176  SimpleEvent_(d1, BE_mcc_winter_plough1, false, a_farm, a_field);
177  break;
179  if (a_ev->m_lock || a_farm->DoIt_prob(0))
180  {
181  if (!a_farm->WinterPlough(a_field, 0.0, g_date->DayInYear(1, 12) - g_date->DayInYear())) {
182  SimpleEvent_(g_date->Date() + 1, BE_mcc_winter_plough1, true, a_farm, a_field);
183  break;
184  }
185  }
186  if (a_farm->IsStockFarmer()) //Stock Farmer
187  {
188  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 4) + 365, BE_mcc_ferti_s1, false, a_farm, a_field);
189  }
190  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 4) + 365, BE_mcc_ferti_p1, false, a_farm, a_field);
191  break;
193  if (a_ev->m_lock || a_farm->DoIt_prob(0.20))
194  {
195  if (!a_farm->StubbleHarrowing(a_field, 0.0, g_date->DayInYear(31, 10) - g_date->DayInYear())) {
196  SimpleEvent_(g_date->Date() + 1, BE_mcc_stubble_harrow2, true, a_farm, a_field);
197  break;
198  }
199  }
200  d1 = g_date->Date() + 10;
201  if (d1 < g_date->OldDays() + g_date->DayInYear(15, 11)) {
202  d1 = g_date->OldDays() + g_date->DayInYear(15, 11);
203  }
204  SimpleEvent_(d1, BE_mcc_winter_plough2, false, a_farm, a_field);
205  break;
207  if (a_ev->m_lock || a_farm->DoIt_prob(1.00))
208  {
209  if (!a_farm->WinterPlough(a_field, 0.0, g_date->DayInYear(1, 12) - g_date->DayInYear())) {
210  SimpleEvent_(g_date->Date() + 1, BE_mcc_winter_plough2, true, a_farm, a_field);
211  break;
212  }
213  }
214  if (a_farm->IsStockFarmer()) //Stock Farmer
215  {
216  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 4) + 365, BE_mcc_ferti_s1, false, a_farm, a_field);
217  }
218  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 4) + 365, BE_mcc_ferti_p1, false, a_farm, a_field);
219  break;
220  case BE_mcc_ferti_p1:
221  if (!a_farm->FP_Slurry(a_field, 0.0, g_date->DayInYear(23, 4) - g_date->DayInYear())) {
222  SimpleEvent_(g_date->Date() + 1, BE_mcc_ferti_p1, true, a_farm, a_field);
223  break;
224  }
225  if (a_field->GetSoilType() <= 5 || a_field->GetSoilType() == 7) { // on sandy soils (BE ZAND & LOSS)
226  SimpleEvent_(g_date->Date() + 1, BE_mcc_spring_plough1, false, a_farm, a_field);
227  }
228  else SimpleEvent_(g_date->Date() + 1, BE_mcc_spring_plough2, false, a_farm, a_field);
229  break;
230  case BE_mcc_ferti_s1:
231  if (!a_farm->FA_Slurry(a_field, 0.0, g_date->DayInYear(23, 4) - g_date->DayInYear())) {
232  SimpleEvent_(g_date->Date() + 1, BE_mcc_ferti_s1, true, a_farm, a_field);
233  break;
234  }
235  if (a_field->GetSoilType() <= 5 || a_field->GetSoilType() == 7) { // on sandy soils (BE ZAND & LOSS)
236  SimpleEvent_(g_date->Date() + 1, BE_mcc_spring_plough1, false, a_farm, a_field);
237  }
238  else SimpleEvent_(g_date->Date() + 1, BE_mcc_spring_plough2, false, a_farm, a_field);
239  break;
241  if (a_ev->m_lock || a_farm->DoIt_prob(0.80))
242  {
243  if (!a_farm->SpringPlough(a_field, 0.0, g_date->DayInYear(24, 4) - g_date->DayInYear())) {
244  SimpleEvent_(g_date->Date() + 1, BE_mcc_spring_plough1, true, a_farm, a_field);
245  break;
246  }
247  }
248  SimpleEvent_(g_date->Date() + 10, BE_mcc_preseeding_cultivator, false, a_farm, a_field);
249  break;
251  if (a_ev->m_lock || a_farm->DoIt_prob(0))
252  {
253  if (!a_farm->SpringPlough(a_field, 0.0, g_date->DayInYear(24, 4) - g_date->DayInYear())) {
254  SimpleEvent_(g_date->Date() + 1, BE_mcc_spring_plough2, true, a_farm, a_field);
255  break;
256  }
257  }
258  SimpleEvent_(g_date->Date() + 10, BE_mcc_preseeding_cultivator, false, a_farm, a_field);
259  break;
261  if (!a_farm->PreseedingCultivator(a_field, 0.0, g_date->DayInYear(4, 5) - g_date->DayInYear())) {
262  SimpleEvent_(g_date->Date() + 1, BE_mcc_preseeding_cultivator, true, a_farm, a_field);
263  break;
264  }
265  SimpleEvent_(g_date->Date() + 1, BE_mcc_spring_sow_with_ferti, false, a_farm, a_field);
266  break;
268  // 95% will do sow with firtilizer
269  if (a_ev->m_lock || a_farm->DoIt_prob(0.95))
270  {
271  if (!a_farm->SpringSowWithFerti(a_field, 0.0, g_date->DayInYear(5, 5) - g_date->DayInYear())) {
272  SimpleEvent_(g_date->Date() + 1, BE_mcc_spring_sow_with_ferti, true, a_farm, a_field);
273  break;
274  }
275  else
276  {
277  // 95% of farmers will do this, but the other 5% won't so we need to remember whether we are in one or the other group
278  BE_MCC_START_FERTI = true;
279  // Here is a fork leading to parallel events
280  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 5), BE_mcc_herbicide1, false, a_farm, a_field); // Herbidide thread
281  if (a_farm->IsStockFarmer()) //Stock Farmer // N thread = MAIN
282  {
283  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(20, 5), BE_mcc_ferti_s2, false, a_farm, a_field);
284  }
285  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(20, 5), BE_mcc_ferti_p2, false, a_farm, a_field);
286  break;
287  }
288  }
289  SimpleEvent_(g_date->Date() + 1, BE_mcc_spring_sow, false, a_farm, a_field);
290  break;
291  case BE_mcc_spring_sow:
292  if (!a_farm->SpringSow(a_field, 0.0, g_date->DayInYear(5, 5) - g_date->DayInYear())) {
293  SimpleEvent_(g_date->Date() + 1, BE_mcc_spring_sow, true, a_farm, a_field);
294  break;
295  }
296  // Here is a fork leading to parallel events
297  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 5), BE_mcc_herbicide1, false, a_farm, a_field); // Herbidide thread
298  if (a_farm->IsStockFarmer()) //Stock Farmer // N thread = MAIN
299  {
300  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(20, 5), BE_mcc_ferti_s2, false, a_farm, a_field);
301  }
302  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(20, 5), BE_mcc_ferti_p2, false, a_farm, a_field);
303  break;
304  case BE_mcc_ferti_p2:
305  // Here comes N thread
306  if (a_ev->m_lock || a_farm->DoIt_prob(1.00) && (BE_MCC_START_FERTI==0))
307  {
308  if (!a_farm->FP_AmmoniumSulphate(a_field, 0.0, g_date->DayInYear(10, 6) - g_date->DayInYear())) {
309  SimpleEvent_(g_date->Date() + 1, BE_mcc_ferti_p2, true, a_farm, a_field);
310  break;
311  }
312  }
313  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(10, 9), BE_mcc_harvest, false, a_farm, a_field);
314  break;
315  case BE_mcc_ferti_s2:
316  if (a_ev->m_lock || a_farm->DoIt_prob(1.00) && (BE_MCC_START_FERTI == 0))
317  {
318  if (!a_farm->FA_AmmoniumSulphate(a_field, 0.0, g_date->DayInYear(10, 6) - g_date->DayInYear())) {
319  SimpleEvent_(g_date->Date() + 1, BE_mcc_ferti_s2, true, a_farm, a_field);
320  break;
321  }
322  }
323  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(30, 9), BE_mcc_harvest, false, a_farm, a_field);
324  break;
325  case BE_mcc_herbicide1:
326  // Here comes the herbicide thread
327  if (a_field->GetGreenBiomass() <= 0)
328  {
329  SimpleEvent_(g_date->Date() + 1, BE_mcc_herbicide1, false, a_farm, a_field);
330  }
331  else
332  {
333  if (a_ev->m_lock || a_farm->DoIt_prob(0.90))
334  {
335  if (!a_farm->HerbicideTreat(a_field, 0.0, g_date->DayInYear(30, 6) - g_date->DayInYear())) {
336  SimpleEvent_(g_date->Date() + 1, BE_mcc_herbicide1, true, a_farm, a_field);
337  break;
338  }
339  }
340  }
341  // End of thread
342  break;
343  case BE_mcc_harvest:
344  // Here the MAIN thread continues
345  // We don't move harvest days
346  if (!a_farm->Harvest(a_field, 0.0, a_field->GetMDates(0, 0) - g_date->DayInYear())) {
347  SimpleEvent_(g_date->Date() + 1, BE_mcc_harvest, true, a_farm, a_field);
348  break;
349  }
350  SimpleEvent_(g_date->Date() + 1, BE_mcc_straw_chopping, false, a_farm, a_field);
351  break;
353  if (a_field->GetMConstants(0) == 0) {
354  if (!a_farm->StrawChopping(a_field, 0.0, -1)) { // raise an error
355  g_msg->Warn(WARN_BUG, "BEMaizeCC::Do(): failure in 'StrawChopping' execution", "");
356  exit(1);
357  }
358  }
359  else {
360  if (!a_farm->StrawChopping(a_field, 0.0, a_field->GetMDates(1, 0) - g_date->DayInYear())) {
361  SimpleEvent_(g_date->Date() + 1, BE_mcc_straw_chopping, true, a_farm, a_field);
362  break;
363  }
364  }
365  // So we are done,but this crop uses a catch crop
366  l_nextcropstartdate = m_farm->GetNextCropStartDate(m_ev->m_field, l_tov);
367  m_field->BumpRunNum();
368  m_field->SetVegPatchy(false); // reverse the patchy before the next crop
369  m_farm->AddNewEvent(tov_BECatchPeaCrop, g_date->Date(), m_ev->m_field, PROG_START, m_ev->m_field->GetRunNum(), false, l_nextcropstartdate, false, l_tov, fmc_Others, false, false);
370  m_field->SetVegType(tov_BECatchPeaCrop, tov_Undefined); // Two vegetation curves are specified
371  // NB no "done = true" because this crop effectively continues into the catch crop.
372  if (m_field->GetUnsprayedMarginPolyRef() != -1)
373  {
376  }
377  break;
378 
379  default:
380  g_msg->Warn(WARN_BUG, "BEMaizeCC::Do(): "
381  "Unknown event type! ", "");
382  exit(1);
383  }
384  return done;
385 }

References BE_mcc_ferti_p1, BE_mcc_ferti_p2, BE_mcc_ferti_s1, BE_mcc_ferti_s2, BE_mcc_harvest, BE_mcc_herbicide1, BE_mcc_preseeding_cultivator, BE_mcc_spring_plough1, BE_mcc_spring_plough2, BE_mcc_spring_sow, BE_mcc_spring_sow_with_ferti, BE_mcc_start, BE_MCC_START_FERTI, BE_mcc_straw_chopping, BE_mcc_stubble_harrow1, BE_mcc_stubble_harrow2, BE_mcc_winter_plough1, BE_mcc_winter_plough2, Calendar::Date(), Calendar::DayInYear(), fmc_Others, g_date, g_msg, Calendar::GetYearNumber(), Calendar::OldDays(), PROG_START, LE::SetVegType(), tof_OptimisingFarm, tov_BECatchPeaCrop, tov_Undefined, MapErrorMsg::Warn(), and WARN_BUG.


The documentation for this class was generated from the following files:
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
Landscape::SupplyLEPointer
LE * SupplyLEPointer(int a_polyref)
Returns a pointer to the object referred to by the polygon number.
Definition: Landscape.h:1722
LE::SetMDates
void SetMDates(int a, int b, int c)
Definition: Elements.h:406
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
LE::GetMConstants
int GetMConstants(int a)
Definition: Elements.h:407
Calendar::GetYearNumber
int GetYearNumber(void)
Definition: Calendar.h:72
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
BE_mcc_ferti_s1
Definition: BEMaizeCC.h:39
LE::GetPoly
int GetPoly(void)
Returns the polyref number for this polygon.
Definition: Elements.h:238
tov_BECatchPeaCrop
Definition: LandscapeFarmingEnums.h:291
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
BE_mcc_preseeding_cultivator
Definition: BEMaizeCC.h:42
Farm::GetPreviousTov
TTypesOfVegetation GetPreviousTov(int a_index)
Definition: Farm.h:966
Farm::GetNextCropStartDate
int GetNextCropStartDate(LE *a_field, TTypesOfVegetation &a_curr_veg)
Returns the start date of the next crop in the rotation.
Definition: Farm.cpp:920
Farm::AddNewEvent
void AddNewEvent(TTypesOfVegetation a_event, long a_date, LE *a_field, int a_todo, long a_num, bool a_lock, int a_start, bool a_first_year, TTypesOfVegetation a_crop, FarmManagementCategory a_fmc, bool a_forcespring, bool a_forcespringOK)
Adds an event to the event queue for a farm.
Definition: Farm.cpp:845
Farm::GetType
TTypesOfFarm GetType(void)
Definition: Farm.h:956
BE_mcc_stubble_harrow2
Definition: BEMaizeCC.h:35
BE_mcc_spring_plough1
Definition: BEMaizeCC.h:40
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
FarmEvent::m_startday
int m_startday
Definition: Farm.h:385
BE_mcc_winter_plough2
Definition: BEMaizeCC.h:37
BE_mcc_straw_chopping
Definition: BEMaizeCC.h:49
BE_mcc_ferti_p1
Definition: BEMaizeCC.h:38
BE_mcc_ferti_p2
Definition: BEMaizeCC.h:45
BE_mcc_spring_sow_with_ferti
Definition: BEMaizeCC.h:43
Calendar::Date
long Date(void)
Definition: Calendar.h:57
LE::GetSoilType
int GetSoilType()
Definition: Elements.h:302
BE_mcc_spring_sow
Definition: BEMaizeCC.h:44
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
LE::SetVegPatchy
void SetVegPatchy(bool p)
Definition: Elements.h:229
BE_mcc_ferti_s2
Definition: BEMaizeCC.h:46
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
BE_mcc_harvest
Definition: BEMaizeCC.h:48
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
FarmEvent::m_field
LE * m_field
Definition: Farm.h:391
FarmEvent::m_next_tov
TTypesOfVegetation m_next_tov
Definition: Farm.h:390
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
tov_Undefined
Definition: LandscapeFarmingEnums.h:610
LE::SetVegType
virtual void SetVegType(TTypesOfVegetation)
Definition: Elements.h:175
LE::GetGreenBiomass
virtual double GetGreenBiomass(void)
Definition: Elements.h:160
tof_OptimisingFarm
Definition: LandscapeFarmingEnums.h:696
LE
Definition: Elements.h:86
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
BE_mcc_spring_plough2
Definition: BEMaizeCC.h:41
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
tov_BEMaizeCC
Definition: LandscapeFarmingEnums.h:304
BE_mcc_herbicide1
Definition: BEMaizeCC.h:47
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
LE::GetUnsprayedMarginPolyRef
int GetUnsprayedMarginPolyRef(void)
Definition: Elements.h:383
LE::GetOwner
Farm * GetOwner(void)
Definition: Elements.h:256
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
BE_MCC_START_FERTI
#define BE_MCC_START_FERTI
A flag used to indicate autumn ploughing status.
Definition: BEMaizeCC.h:24
BE_mcc_start
Definition: BEMaizeCC.h:32
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
Crop::m_forcespringpossible
bool m_forcespringpossible
Used to signal that the crop can be forced to start in spring.
Definition: Farm.h:508
BE_mcc_stubble_harrow1
Definition: BEMaizeCC.h:34
PROG_START
#define PROG_START
Definition: Farm.h:69
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
BE_mcc_winter_plough1
Definition: BEMaizeCC.h:36
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
Crop::m_OurLandscape
Landscape * m_OurLandscape
Definition: Farm.h:506
WARN_BUG
Definition: MapErrorMsg.h:34
Farm::StubbleHarrowing
virtual bool StubbleHarrowing(LE *a_field, double a_user, int a_days)
Carry out stubble harrowing on a_field.
Definition: FarmFuncs.cpp:1523
Crop::SimpleEvent_
void SimpleEvent_(long a_date, int a_todo, bool a_lock, Farm *a_farm, LE *a_field)
Adds an event to this crop management without relying on member variables.
Definition: Farm.cpp:751