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

SE_SpringBarley class
. More...

#include <SE_SpringBarley.h>

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

SE_SpringBarley class
.

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

◆ SE_SpringBarley()

SE_SpringBarley::SE_SpringBarley ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
101  : Crop(a_tov, a_toc, a_L)
102  {
103  // When we start it off, the first possible date for a farm operation
104  // This information is used by other crops when they decide how much post processing of
105  // the management is allowed after harvest before the next crop starts.
106  m_first_date = g_date->DayInYear(10, 10);
108  }

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

Member Function Documentation

◆ Do()

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

101 {
102  m_field = a_field; // this is needed because of possible calls to other methods and currently we do not pass parameters.
103  m_farm = a_farm; // this is needed because of possible calls to other methods and currently we do not pass parameters.
104  bool done = false; // The boolean value done indicates when we are totally finished with this plan (i.e. it is set to true).
105 
106  // Depending what event has occured jump to the correct bit of code e.g. for ww_start jump to line 67 below
107  switch (a_ev->m_todo)
108  {
109  case se_sb_start:
110  {
111 
112  a_field->ClearManagementActionSum();
113 
114  // This is just to hold a local variable in scope and prevent compiler errors
115  // ww_start just sets up all the starting conditions and reference dates that are needed to start a ww
116  // crop off
117  // Record whether skylark scrapes are present and adjust flag accordingly
119  a_field->m_skylarkscrapes = true;
120  }
121  else {
122  a_field->m_skylarkscrapes = false;
123  }
124  // Set up the date management stuff
125  // The next bit of code just allows for altering dates after harvest if it is necessary
126  // to allow for a crop which starts its management early.
127 
128  // 3 start and stop dates for all events after harvest for this crop
129  int noDates = 1;
130  a_field->SetMDates(0, 0, g_date->DayInYear(25, 8)); // last possible day of harvest
131  a_field->SetMDates(1, 0, g_date->DayInYear(25, 8)); // last possible day of management after harvest
132  // Can be up to 10 of these. If the shortening code is triggered
133  // then these will be reduced in value to 0
134 
135  a_field->SetMConstants(0, 1);
136 
137  // Check the next crop for early start, unless it is a spring crop
138  // in which case we ASSUME that no checking is necessary!!!!
139  // So DO NOT implement a crop that runs over the year boundary (i.e. from spring to spring!), at least not without fixing this.
140 
141  //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)
142  int d1;
143  if (!(a_farm->GetType() == tof_OptimisingFarm && g_date->GetYearNumber() > 0)) {
144 
145  if (a_ev->m_startday > g_date->DayInYear(1, 7)) {
146  if (a_field->GetMDates(0, 0) >= a_ev->m_startday)
147  {
148  g_msg->Warn(WARN_BUG, "SE_SpringBarley::Do(): ", "Harvest too late for the next crop to start!!!");
149  int almassnum = a_field->GetLandscape()->BackTranslateVegTypes(a_ev->m_next_tov);
150  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
151  }
152  // Now fix any late finishing problems
153  for (int i = 0; i < noDates; i++) {
154  if (a_field->GetMDates(0, i) >= a_ev->m_startday) {
155  a_field->SetMDates(0, i, a_ev->m_startday - 1); //move the starting date
156  }
157  if (a_field->GetMDates(1, i) >= a_ev->m_startday) {
158  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)
159  a_field->SetMDates(1, i, a_ev->m_startday - 1); //move the finishing date
160  }
161  }
162  }
163  // Now no operations can be timed after the start of the next crop.
164 
165  if (!a_ev->m_first_year) {
166  // Are we before July 1st?
167  d1 = g_date->OldDays() + g_date->DayInYear(1, 7);
168  if (g_date->Date() < d1) {
169  // Yes, too early. We assumme this is because the last crop was late
170  printf("Poly: %d\n", a_field->GetPoly());
171  g_msg->Warn(WARN_BUG, "SE_SpringBarley::Do(): ", "Crop start attempt between 1st Jan & 1st July");
172  int prev = a_field->GetLandscape()->BackTranslateVegTypes(a_field->GetOwner()->GetPreviousTov(a_field->GetRotIndex()));
173  g_msg->Warn(WARN_BUG, "Previous Crop ", prev);
174  int almassnum = a_field->GetLandscape()->BackTranslateVegTypes(a_ev->m_next_tov);
175  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
176  }
177  else {
178  d1 = g_date->OldDays() + m_first_date; // Add 365 for spring crop
179  if (g_date->Date() > d1) {
180  // Yes too late - should not happen - raise an error
181  g_msg->Warn(WARN_BUG, "SE_SpringBarley::Do(): ", "Crop start attempt after last possible start date");
182  g_msg->Warn(WARN_BUG, "Previous Crop ", "");
183  a_field->GetOwner()->GetPreviousTov(a_field->GetRotIndex());
184  int almassnum = a_field->GetLandscape()->BackTranslateVegTypes(a_ev->m_next_tov);
185  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
186  }
187  }
188  }
189  else {
190  // Is the first year
191  // Some special code to cope with that first start-up year in ALMaSS - ignore for all practical purposes
193  break;
194  }
195  }//if
196 
197  // End single block date checking code. Please see next line comment as well.
198  // Reinit d1 to first possible starting date.
199  d1 = g_date->OldDays() + g_date->DayInYear(1, 8);
200  // OK, let's go.
201  SimpleEvent(d1, se_sb_straw_removal, false);
202  }
203  break;
204  // This is the first real farm operation
205  case se_sb_straw_removal:
206  if (a_ev->m_lock || a_farm->DoIt(40)) { // crop scheme says 30-50%
207  if (!a_farm->StrawRemoval(a_field, 0.0, g_date->DayInYear(20, 9) - g_date->DayInYear())) {
208  // If we don't suceed on the first try, then try and try again
210  break;
211  }
212  }
213  // Queue up the next event - in this case herbicide
215  break;
216  case se_sb_herbicide1:
217  if (a_ev->m_lock || a_farm->DoIt(60)) {
218  if (!a_farm->HerbicideTreat(a_field, 0.0, g_date->DayInYear(20, 9) - g_date->DayInYear())) {
219  // If we don't suceed on the first try, then try and try again
220  SimpleEvent(g_date->Date() + 1, se_sb_herbicide1, true);
221  break;
222  }
223  }
224  // Queue up the next event - in this case slurry (if livestock farmer - 5% of those)
225  SimpleEvent(g_date->Date(), se_sb_slurry1, false);
226  break;
227  case se_sb_slurry1:
228  if (a_farm->IsStockFarmer()) {//Stock Farmer
229  if (a_ev->m_lock || a_farm->DoIt(5)) {
230  if (!a_farm->FA_Slurry(a_field, 0.0, g_date->DayInYear(20, 9) - g_date->DayInYear())) {
231  // If we don't suceed on the first try, then try and try again
232  SimpleEvent(g_date->Date() + 1, se_sb_slurry1, true);
233  break;
234  }
235  }
236  }
237  // Queue up the next event - in this case autumn plough
239  break;
240  case se_sb_autumn_plough:
241  if (a_ev->m_lock || a_farm->DoIt(15)) { // crop scheme says 10-20%
242  if (!a_farm->AutumnPlough(a_field, 0.0, g_date->DayInYear(20, 9) - g_date->DayInYear())) {
244  break;
245  }
246  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, se_sb_slurry2, false);
247  break;
248  }
250  break;
251 
253  if (a_ev->m_lock || a_farm->DoIt(82)) { // 82% of remaining 85% = 70% of all
254  if (!a_farm->StubbleCultivatorHeavy(a_field, 0.0, g_date->DayInYear(20, 9) - g_date->DayInYear())) {
256  break;
257  }
259  break;
260  }
261  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, se_sb_slurry2, false);
262  break;
264  if (!a_farm->StubbleCultivatorHeavy(a_field, 0.0, g_date->DayInYear(3, 10) - g_date->DayInYear())) {
266  break;
267  }
268  // Queue up the next event - in this case slurry
269  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, se_sb_slurry2, false);
270  break;
271  case se_sb_slurry2:
272  if (a_farm->IsStockFarmer()) {//Stock Farmer
273  if (a_ev->m_lock || a_farm->DoIt(7)) { // crop scheme says 5-10%
274  if (!a_farm->FP_Slurry(a_field, 0.0,
275  g_date->DayInYear(30, 4) - g_date->DayInYear())) {
276  SimpleEvent(g_date->Date() + 1, se_sb_slurry2, true);
277  break;
278  }
279  }
280  }
282  break;
283  case se_sb_spring_plough:
284  if (a_ev->m_lock || a_farm->DoIt(15)) { // crop scheme says 10-20%
285  if (!a_farm->SpringPlough(a_field, 0.0,
286  g_date->DayInYear(30, 4) - g_date->DayInYear())) {
288  break;
289  }
290  }
292  break;
294  if (a_ev->m_lock || a_farm->DoIt(80)) {
295  if (!a_farm->SpringHarrow(a_field, 0.0,
296  g_date->DayInYear(10, 5) - g_date->DayInYear())) {
298  break;
299  }
300  }
302  break;
303  case se_sb_spring_sow:
304  if (a_ev->m_lock || a_farm->DoIt(25)) {
305  if (!a_farm->SpringSow(a_field, 0.0,
306  g_date->DayInYear(15, 5) - g_date->DayInYear())) {
307  SimpleEvent(g_date->Date() + 1, se_sb_spring_sow, true);
308  break;
309  }
310  SimpleEvent(g_date->Date(), se_sb_npk, false);
311  break;
312  }
313  else SimpleEvent(g_date->Date(), se_sb_spring_sow_w_ferti, false); // (together with sowing)
314  break;
316  if (!a_farm->SpringSowWithFerti(a_field, 0.0,
317  g_date->DayInYear(15, 5) - g_date->DayInYear())) {
319  break;
320  }
321  // LKM: Here is a fork leading to parallel events
322  SimpleEvent(g_date->OldDays() + g_date->DayInYear(7, 4), se_sb_spring_harrow2, false); // spring harrow thread
323  SimpleEvent(g_date->OldDays() + g_date->DayInYear(25, 4), se_sb_insecticide, false); // insecticide thread
324  SimpleEvent(g_date->OldDays() + g_date->DayInYear(15, 5), se_sb_ns, false); // fertilizer thread
325  SimpleEvent(g_date->OldDays() + g_date->DayInYear(25, 5), se_sb_herbicide2, false); // herbicide thread
326  SimpleEvent(g_date->OldDays() + g_date->DayInYear(15, 6), se_sb_fungicide, false); // fungicide thread - main thread
327  break;
328  case se_sb_npk:
329  if (a_ev->m_lock || a_farm->DoIt(20)) { // 5% of all = 20% of the 25% that sow without ferti at the same time
330  if (!a_farm->FP_NPK(a_field, 0.0,
331  g_date->DayInYear(15, 5) - g_date->DayInYear())) {
332  SimpleEvent(g_date->Date() + 1, se_sb_npk, true);
333  break;
334  }
335  // LKM: Here is a fork leading to parallel events
336  SimpleEvent(g_date->OldDays() + g_date->DayInYear(7, 4), se_sb_spring_harrow2, false); // spring harrow thread
337  SimpleEvent(g_date->OldDays() + g_date->DayInYear(25, 4), se_sb_insecticide, false); // insecticide thread
338  SimpleEvent(g_date->OldDays() + g_date->DayInYear(15, 5), se_sb_ns, false); // fertilizer thread
339  SimpleEvent(g_date->OldDays() + g_date->DayInYear(25, 5), se_sb_herbicide2, false); // herbicide thread
340  SimpleEvent(g_date->OldDays() + g_date->DayInYear(15, 6), se_sb_fungicide, false); // fungicide thread - main thread
341  break;
342  }
343  else SimpleEvent(g_date->Date(), se_sb_ns_manure, false); // NS in combination with manure
344  break;
345  case se_sb_ns_manure:
346  if (a_ev->m_lock || a_farm->DoIt(60/80)) { // 15% of all = 60% of the 25% that sow without ferti at the same time
347  if (!a_farm->FP_Manure(a_field, 0.0,
348  g_date->DayInYear(15, 5) - g_date->DayInYear())) {
349  SimpleEvent(g_date->Date() + 1, se_sb_ns_manure, true);
350  break;
351  }
352  }
353  SimpleEvent(g_date->OldDays() + g_date->DayInYear(7, 4), se_sb_spring_harrow2, false); // spring harrow thread
354  SimpleEvent(g_date->OldDays() + g_date->DayInYear(25, 4), se_sb_insecticide, false); // insecticide thread
355  SimpleEvent(g_date->OldDays() + g_date->DayInYear(25, 5), se_sb_herbicide2, false); // herbicide thread
356  SimpleEvent(g_date->OldDays() + g_date->DayInYear(15, 6), se_sb_fungicide, false); // fungicide thread - main thread
357  break;
358  case se_sb_spring_harrow2:// no dates
359  if (a_ev->m_lock || a_farm->DoIt(5)) {
360  if (!a_farm->SpringHarrow(a_field, 0.0,
361  g_date->DayInYear(30, 5) - g_date->DayInYear())) {
363  break;
364  }
365  }
366  break; // end of spring harrow thread
367  case se_sb_insecticide://
368  if (a_ev->m_lock || a_farm->DoIt(20)) { // crop scheme says 5-30%
369  if (!a_farm->InsecticideTreat(a_field, 0.0,
370  g_date->DayInYear(30, 6) - g_date->DayInYear())) {
371  SimpleEvent(g_date->Date() + 1, se_sb_insecticide, true);
372  break;
373  }
374  }
375  break; // end of insecticide thread
376  case se_sb_ns:
377  if (a_ev->m_lock || a_farm->DoIt(5)) {
378  if (!a_farm->FP_NS(a_field, 0.0,
379  g_date->DayInYear(15, 6) - g_date->DayInYear())) {
380  SimpleEvent(g_date->Date() + 1, se_sb_ns, true);
381  break;
382  }
383  }
384  break; // end of fertilizer thread
385  case se_sb_herbicide2://
386  if (a_ev->m_lock || a_farm->DoIt(90)) {
387  if (!a_farm->HerbicideTreat(a_field, 0.0,
388  g_date->DayInYear(15, 6) - g_date->DayInYear())) {
389  SimpleEvent(g_date->Date() + 1, se_sb_herbicide2, true);
390  break;
391  }
392  }
393  break; // end of herbicide thread
394  case se_sb_fungicide://
395  if (a_ev->m_lock || a_farm->DoIt(60)) { // crop scheme says 50-70%
396  if (!a_farm->FungicideTreat(a_field, 0.0,
397  g_date->DayInYear(30, 7) - g_date->DayInYear())) {
398  SimpleEvent(g_date->Date() + 1, se_sb_fungicide, true);
399  break;
400  }
401  }
402  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 8), se_sb_harvest, false); // no dates in scheme
403  break;
404  case se_sb_harvest:
405  // We don't move harvest days
406  if (!a_farm->Harvest(a_field, 0.0, a_field->GetMDates(0, 0) - g_date->DayInYear())) {
407  SimpleEvent(g_date->Date() + 1, se_sb_harvest, true);
408  break;
409  }
410  done = true;
411  // So we are done, and somewhere else the farmer will queue up the start event of the next crop
412  // END OF MAIN THREAD
413  break;
414  default:
415  g_msg->Warn(WARN_BUG, "SE_SpringBarley::Do(): "
416  "Unknown event type! ", "");
417  exit(1);
418  }
419  return done;
420 }

References Farm::AutumnPlough(), cfg_SE_SpringBarley_SkScrapes, LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), Farm::DoIt(), Farm::FA_Slurry(), Farm::FP_Manure(), Farm::FP_NPK(), Farm::FP_NS(), Farm::FP_Slurry(), Farm::FungicideTreat(), g_date, g_msg, LE::GetMDates(), LE::GetOwner(), LE::GetPoly(), Farm::GetPreviousTov(), LE::GetRotIndex(), Farm::GetType(), Calendar::GetYearNumber(), Farm::Harvest(), Farm::HerbicideTreat(), Farm::InsecticideTreat(), Farm::IsStockFarmer(), Crop::m_farm, Crop::m_field, Crop::m_first_date, FarmEvent::m_first_year, FarmEvent::m_lock, FarmEvent::m_next_tov, LE::m_skylarkscrapes, FarmEvent::m_startday, FarmEvent::m_todo, Calendar::OldDays(), se_sb_autumn_plough, se_sb_fungicide, se_sb_harvest, se_sb_herbicide1, se_sb_herbicide2, se_sb_insecticide, se_sb_npk, se_sb_ns, se_sb_ns_manure, se_sb_slurry1, se_sb_slurry2, se_sb_spring_harrow1, se_sb_spring_harrow2, se_sb_spring_plough, se_sb_spring_sow, se_sb_spring_sow_w_ferti, se_sb_start, se_sb_straw_removal, se_sb_stubble_cultivator1, se_sb_stubble_cultivator2, LE::SetMConstants(), LE::SetMDates(), Crop::SimpleEvent(), Farm::SpringHarrow(), Farm::SpringPlough(), Farm::SpringSow(), Farm::SpringSowWithFerti(), Farm::StrawRemoval(), Farm::StubbleCultivatorHeavy(), tof_OptimisingFarm, CfgBool::value(), MapErrorMsg::Warn(), and WARN_BUG.

◆ SetUpFarmCategoryInformation()

void SE_SpringBarley::SetUpFarmCategoryInformation ( )
inline
109  {
110  const int elements = 2 + (se_sb_foobar - SE_SB_BASE);
112 
113  FarmManagementCategory catlist[elements] =
114  {
115  fmc_Others, // zero element unused but must be here
116  fmc_Others, // se_sb_start = 1, // Compulsory, must always be 1 (one).
117  fmc_Others, // se_sb_straw_removal = SE_SB_BASE,
118  fmc_Herbicide, // se_sb_herbicide1,
119  fmc_Fertilizer, // se_sb_slurry1,
120  fmc_Cultivation, // se_sb_autumn_plough,
121  fmc_Cultivation, // se_sb_stubble_cultivator1,
122  fmc_Cultivation, // se_sb_stubble_cultivator2,
123  fmc_Fertilizer, // se_sb_slurry2,
124  fmc_Cultivation, // se_sb_spring_plough,
125  fmc_Cultivation, // se_sb_spring_harrow1,
126  fmc_Others, // se_sb_spring_sow,
127  fmc_Fertilizer, // se_sb_spring_sow_w_ferti,
128  fmc_Fertilizer, // se_sb_npk,
129  fmc_Fertilizer, // se_sb_ns_manure,
130  fmc_Cultivation, // se_sb_spring_harrow2,
131  fmc_Fertilizer, // se_sb_ns,
132  fmc_Herbicide, // se_sb_herbicide2,
133  fmc_Fungicide, // se_sb_fungicide,
134  fmc_Insecticide, // se_sb_insecticide,
135  fmc_Harvest // se_sb_harvest,
136 
137 
138  // no foobar entry
139 
140  };
141  // Iterate over the catlist elements and copy them to vector
142  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
143 
144  }

References fmc_Cultivation, fmc_Fertilizer, fmc_Fungicide, fmc_Harvest, fmc_Herbicide, fmc_Insecticide, fmc_Others, Crop::m_base_elements_no, Crop::m_ManagementCategories, SE_SB_BASE, and se_sb_foobar.

Referenced by SE_SpringBarley().


The documentation for this class was generated from the following files:
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
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
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
LE::SetMDates
void SetMDates(int a, int b, int c)
Definition: Elements.h:406
Farm::SpringPlough
virtual bool SpringPlough(LE *a_field, double a_user, int a_days)
Carry out a ploughing event in the spring on a_field.
Definition: FarmFuncs.cpp:421
Farm::HerbicideTreat
virtual bool HerbicideTreat(LE *a_field, double a_user, int a_days)
Apply herbicide to a_field.
Definition: FarmFuncs.cpp:2025
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
Farm::Harvest
virtual bool Harvest(LE *a_field, double a_user, int a_days)
Carry out a harvest on a_field.
Definition: FarmFuncs.cpp:1364
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
Farm::StubbleCultivatorHeavy
virtual bool StubbleCultivatorHeavy(LE *a_field, double a_user, int a_days)
Carry out a stubble cultivation event on a_field. This is non-inversion type of cultivation which can...
Definition: FarmFuncs.cpp:245
SE_SB_BASE
#define SE_SB_BASE
Definition: SE_SpringBarley.h:53
se_sb_stubble_cultivator2
Definition: SE_SpringBarley.h:71
se_sb_foobar
Definition: SE_SpringBarley.h:85
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::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
se_sb_fungicide
Definition: SE_SpringBarley.h:82
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
Farm::StrawRemoval
virtual bool StrawRemoval(LE *a_field, double a_user, int a_days)
Straw covering applied on a_field.
Definition: FarmFuncs.cpp:1752
LE::GetPoly
int GetPoly(void)
Returns the polyref number for this polygon.
Definition: Elements.h:238
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
se_sb_spring_plough
Definition: SE_SpringBarley.h:73
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
Farm::GetPreviousTov
TTypesOfVegetation GetPreviousTov(int a_index)
Definition: Farm.h:966
se_sb_autumn_plough
Definition: SE_SpringBarley.h:69
Farm::SpringSow
virtual bool SpringSow(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 spring on a_field.
Definition: FarmFuncs.cpp:501
Farm::GetType
TTypesOfFarm GetType(void)
Definition: Farm.h:956
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
se_sb_harvest
Definition: SE_SpringBarley.h:84
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
FarmEvent::m_startday
int m_startday
Definition: Farm.h:385
se_sb_ns
Definition: SE_SpringBarley.h:80
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
se_sb_stubble_cultivator1
Definition: SE_SpringBarley.h:70
Crop::SimpleEvent
void SimpleEvent(long a_date, int a_todo, bool a_lock)
Adds an event to this crop management.
Definition: Farm.cpp:747
CfgBool::value
bool value() const
Definition: Configurator.h:164
Farm::FP_Manure
virtual bool FP_Manure(LE *a_field, double a_user, int a_days)
Spread manure on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:896
se_sb_straw_removal
Definition: SE_SpringBarley.h:66
se_sb_npk
Definition: SE_SpringBarley.h:77
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
SE_SpringBarley::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: SE_SpringBarley.h:109
LE::m_skylarkscrapes
bool m_skylarkscrapes
For management testing of skylark scrapes.
Definition: Elements.h:95
Calendar::Date
long Date(void)
Definition: Calendar.h:57
se_sb_herbicide1
Definition: SE_SpringBarley.h:67
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
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
LE::GetRotIndex
int GetRotIndex(void)
Definition: Elements.h:373
Farm::FP_NS
virtual bool FP_NS(LE *a_field, double a_user, int a_days)
Apply NS fertilizer, on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:740
se_sb_spring_harrow1
Definition: SE_SpringBarley.h:74
se_sb_herbicide2
Definition: SE_SpringBarley.h:81
se_sb_start
Definition: SE_SpringBarley.h:65
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
se_sb_ns_manure
Definition: SE_SpringBarley.h:78
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::InsecticideTreat
virtual bool InsecticideTreat(LE *a_field, double a_user, int a_days)
Apply insecticide to a_field.
Definition: FarmFuncs.cpp:2135
se_sb_insecticide
Definition: SE_SpringBarley.h:83
se_sb_spring_sow_w_ferti
Definition: SE_SpringBarley.h:76
Farm::FP_Slurry
virtual bool FP_Slurry(LE *a_field, double a_user, int a_days)
Apply slurry to a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:823
tof_OptimisingFarm
Definition: LandscapeFarmingEnums.h:696
se_sb_spring_sow
Definition: SE_SpringBarley.h:75
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
Farm::SpringSowWithFerti
virtual bool SpringSowWithFerti(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 with start fertilizer in the spring on a_field.
Definition: FarmFuncs.cpp:537
se_sb_slurry2
Definition: SE_SpringBarley.h:72
se_sb_spring_harrow2
Definition: SE_SpringBarley.h:79
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
cfg_SE_SpringBarley_SkScrapes
CfgBool cfg_SE_SpringBarley_SkScrapes("SE_CROP_SB_SK_SCRAPES", CFG_CUSTOM, false)
LE::GetOwner
Farm * GetOwner(void)
Definition: Elements.h:256
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
se_sb_slurry1
Definition: SE_SpringBarley.h:68
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
WARN_BUG
Definition: MapErrorMsg.h:34
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
Farm::SpringHarrow
virtual bool SpringHarrow(LE *a_field, double a_user, int a_days)
Carry out a harrow event in the spring on a_field.
Definition: FarmFuncs.cpp:459