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

FI_SprSpringBarley_Fodder class
. More...

#include <FI_SprSpringBarley_Fodder.h>

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

FI_SprSpringBarley_Fodder class
.

See FI_SprSpringBarley_Fodder.h::FI_SprSpringBarley_FodderToDo for a complete list of all possible events triggered codes by the spring barley Fodder 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

◆ FI_SprSpringBarley_Fodder()

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

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

Member Function Documentation

◆ Do()

bool FI_SprSpringBarley_Fodder::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 spring barley Fodder.

Reimplemented from Crop.

99 {
100  m_field = a_field; // this is needed because of possible calls to other methods and currently we do not pass parameters.
101  m_farm = a_farm; // this is needed because of possible calls to other methods and currently we do not pass parameters.
102  bool done = false; // The boolean value done indicates when we are totally finished with this plan (i.e. it is set to true).
103  bool flag = false;
104  int d1 = 0;
105  // Depending what event has occured jump to the correct bit of code e.g. for ww_start jump to line 67 below
106  switch (a_ev->m_todo)
107  {
108  case fi_ssbf_start:
109  {
110  // This is just to hold a local variable in scope and prevent compiler errors
111  // ww_start just sets up all the starting conditions and reference dates that are needed to start a ww
112  // crop off
113  FI_SSBF_AUTUMN_PLOUGH = false;
116 
117  a_field->ClearManagementActionSum();
118 
119  // Record whether skylark scrapes are present and adjust flag accordingly
121  a_field->m_skylarkscrapes = true;
122  }
123  else {
124  a_field->m_skylarkscrapes = false;
125  }
126  // Set up the date management stuff
127  // The next bit of code just allows for altering dates after harvest if it is necessary
128  // to allow for a crop which starts its management early.
129 
130  // 3 start and stop dates for all events after harvest for this crop
131  int noDates = 4;
132  a_field->SetMDates(0, 0, g_date->DayInYear(30, 9)); // last possible day of harvest
133  a_field->SetMDates(1, 0, g_date->DayInYear(30, 9)); // last possible day of herbicide after harvest
134  a_field->SetMDates(0, 1, 0); // start day of straw chopping (not used as it depend on previous treatment)
135  a_field->SetMDates(1, 1, g_date->DayInYear(30, 9)); // end day of straw chopping
136  a_field->SetMDates(0, 2, 0); // start day of hay bailing
137  a_field->SetMDates(1, 2, g_date->DayInYear(30, 9)); // end day of hay bailing
138  a_field->SetMDates(0, 3, 0); // start day of stubble cultivator
139  a_field->SetMDates(1, 3, g_date->DayInYear(15, 10)); // end day of stubble cultivator
140  // Can be up to 10 of these. If the shortening code is triggered
141  // then these will be reduced in value to 0
142 
143  a_field->SetMConstants(0, 1);
144 
145  // Check the next crop for early start, unless it is a spring crop
146  // in which case we ASSUME that no checking is necessary!!!!
147  // So DO NOT implement a crop that runs over the year boundary (i.e. from spring to spring!), at least not without fixing this.
148 
149  //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)
150  int d1;
151  if (!(a_farm->GetType() == tof_OptimisingFarm && g_date->GetYearNumber() > 0)) {
152 
153  if (a_ev->m_startday > g_date->DayInYear(1, 7)) {
154  if (a_field->GetMDates(0, 0) >= a_ev->m_startday)
155  {
156  g_msg->Warn(WARN_BUG, "FI_SprSpringBarley_Fodder::Do(): ", "Harvest too late for the next crop to start!!!");
157  int almassnum = a_field->GetLandscape()->BackTranslateVegTypes(a_ev->m_next_tov);
158  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
159  }
160  // Now fix any late finishing problems
161  for (int i = 0; i < noDates; i++) {
162  if (a_field->GetMDates(0, i) >= a_ev->m_startday) {
163  a_field->SetMDates(0, i, a_ev->m_startday - 1); //move the starting date
164  }
165  if (a_field->GetMDates(1, i) >= a_ev->m_startday) {
166  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)
167  a_field->SetMDates(1, i, a_ev->m_startday - 1); //move the finishing date
168  }
169  }
170  }
171  // Now no operations can be timed after the start of the next crop.
172 
173  if (!a_ev->m_first_year) {
174  int today = g_date->Date();
175  d1 = g_date->OldDays() + m_first_date + 365; // Add 365 for spring crop
176  if (today > d1) {
177  // Yes too late - should not happen - raise an error
178  g_msg->Warn(WARN_BUG, "FI_SprSpringBarley_Fodder::Do(): " "Crop start attempt after last possible start date", "");
179  exit(1);
180  }
181  }
182  else {
183  // Is the first year
184  // Some special code to cope with that first start-up year in ALMaSS - ignore for all practical purposes (start woth the first event on the after winter time) - Date here is a suggestion (not stated in crop scheme!)
186  break;
187  }
188  }//if
189 
190  // End single block date checking code. Please see next line comment as well.
191  // Reinit d1 to first possible starting date.
192  d1 = g_date->OldDays() + g_date->DayInYear(20, 4);
193  // OK, let's go.
194  // LKM: Here we queue up the first event -
195  //
197  }
198  break;
199  // This is the first real farm operation - LKM: done if there is time between 1st September-10th of October - 25% do this
201  if (!a_farm->SpringPlough(a_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
203  break;
204  }
205  // Queue up the next event - in this case fungicide 1 (seed dressing) - 90% do this (but don't know how many actually do it on the farm?)
207  break;
208  case fi_ssbf_fungicide1:
209  if (a_ev->m_lock || a_farm->DoIt(90)) {
210  if (!a_farm->FungicideTreat(a_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
211  SimpleEvent(g_date->Date() + 1, fi_ssbf_fungicide1, true);
212  break;
213  }
214  }
215  //Here comes a fork with parallel events:
216  SimpleEvent(g_date->OldDays() + g_date->DayInYear(25, 4), fi_ssbf_preseeding_cultivation, false); //sowing thread - main thread
217  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5), fi_ssbf_slurry, false); //Slurry thread
218  break;
219  case fi_ssbf_slurry: // 10% do this (if stock farm)
220  if (m_farm->IsStockFarmer()) {
221  if (a_ev->m_lock || a_farm->DoIt(10)) {
222  if (!a_farm->FA_Slurry(a_field, 0.0,
223  g_date->DayInYear(20, 6) - g_date->DayInYear())) {
224  SimpleEvent(g_date->Date() + 1, fi_ssbf_slurry, true);
225  break;
226  }
227  }
228  }
229  break; //End of slurry thread
230  //Sowing thread - preseeding cultivation - 85% do this
232  break;
234  if (a_ev->m_lock || a_farm->DoIt(85)) {
235  if (!a_farm->PreseedingCultivator(a_field, 0.0,
236  g_date->DayInYear(15, 5) - g_date->DayInYear())) {
238  break;
239  }
240  SimpleEvent(g_date->Date(), fi_ssbf_sow, false);
241  break;
242  } // the rest (15%) do preseeding cultivator with sow
244  break;
245 
246  case fi_ssbf_sow: // sowing with fertilizer - says only 70% in crop scheme - changed to 85% so all farmers actually sow ...
247  if (!a_farm->SpringSowWithFerti(m_field, 0.0, g_date->DayInYear(15, 5) - g_date->DayInYear())) {
248  SimpleEvent(g_date->Date() + 1, fi_ssbf_sow, true);
249  break;
250  } // Queue up the next event - in this case harrow before emergence (suggest 7 days)
251  SimpleEvent(g_date->Date () +7, fi_ssbf_harrow, false);
252  break;
254  if (!a_farm->PreseedingCultivatorSow(m_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear())) {
256  break;
257  } // fertilizer when preseeding cultivator with sowing
259  break;
260  case fi_ssbf_fertilizer:
261  if (!a_farm->FP_NPKS(a_field, 0.0,
262  g_date->DayInYear(20, 5) - g_date->DayInYear())) {
263  SimpleEvent(g_date->Date() + 1, fi_ssbf_fertilizer, true);
264  break;
265  }
266  // 20% of farmers sow cover crops simultaneously with sowing barley!
267  // Queue up the next event - in this case harrow before emergence (suggest 7 days)
268  SimpleEvent(g_date->Date() + 7, fi_ssbf_harrow, false);
269  break;
270  case fi_ssbf_harrow: // 8% do this
271  if (a_ev->m_lock || a_farm->DoIt(8)) {
272  if (!a_farm->SpringHarrow(a_field, 0.0,
273  g_date->DayInYear(27, 5) - g_date->DayInYear())) {
274  SimpleEvent(g_date->Date() + 1, fi_ssbf_harrow, true);
275  break;
276  }
277  }
278  // LKM: Here is a fork leading to parallel events
279  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6), fi_ssbf_herbicide1, false); // Herbicide thread
280  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6) + m_date_modifier, fi_ssbf_insecticide, false); // insecticide thread
281  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6), fi_ssbf_growth_reg, false); // growth regulator thread
282  SimpleEvent(g_date->OldDays() + g_date->DayInYear(26, 6), fi_ssbf_fungicide2, false); // fungicide thread - main thread
283  break;
284  // Herbicide1 thread
285  case fi_ssbf_herbicide1:
286  if (a_ev->m_lock || a_farm->DoIt(90)) { //90% do herbicide1
287  if (!a_farm->HerbicideTreat(a_field, 0.0,
288  g_date->DayInYear(15, 6) - g_date->DayInYear())) {
289  SimpleEvent(g_date->Date() + 1, fi_ssbf_herbicide1, true);
290  break;
291  }
292  }
293  //LKM: end of herbicide thread
294  break;
295  // Insecticide thread
296  case fi_ssbf_insecticide:
297  if (a_ev->m_lock || a_farm->DoIt(5)) { //5% do insecticide
298  // here we check whether we are using ERA pesticide or not
299  d1 = g_date->DayInYear(30, 6) - g_date->DayInYear();
300  if (!cfg_pest_springbarley_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
301  {
302  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
303  }
304  else {
306  }
307  if (!flag) {
309  break;
310  }
311  }
312  //End of insecticide thread
313  break;
314  // growth regulator thread
315  case fi_ssbf_growth_reg:
316  if (a_ev->m_lock || a_farm->DoIt(30)) { //30% do growth reg
317  if (!a_farm->GrowthRegulator(a_field, 0.0,
318  g_date->DayInYear(30, 6) - g_date->DayInYear())) {
319  SimpleEvent(g_date->Date() + 1, fi_ssbf_growth_reg, true);
320  break;
321  }
322  }
323  //End of growth regulator
324  break;
325  // fungicide2 thread - main thread
326  case fi_ssbf_fungicide2:
327  if (a_ev->m_lock || a_farm->DoIt(60)) { //60% do fungicide2
328  if (!a_farm->FungicideTreat(a_field, 0.0,
329  g_date->DayInYear(10, 7) - g_date->DayInYear())) {
330  SimpleEvent(g_date->Date() + 1, fi_ssbf_fungicide2, true);
331  break;
332  }
333  }
335  break;
336  case fi_ssbf_harvest:
337  // We don't move harvest days
338  if (!a_farm->Harvest(a_field, 0.0,
339  g_date->DayInYear(30, 9) - g_date->DayInYear())) {
340  SimpleEvent(g_date->Date() + 1, fi_ssbf_harvest, true);
341  break;
342  }
343  // 50% of farmers will do herbicide after harvest
345  break;
346  case fi_ssbf_herbicide2:
347  if (a_ev->m_lock || a_farm->DoIt(50)) {
348  if (!a_farm->HerbicideTreat(a_field, 0.0,
349  g_date->DayInYear(30, 9) - g_date->DayInYear())) {
350  SimpleEvent(g_date->Date() + 1, fi_ssbf_herbicide2, true);
351  break;
352  }
353  }
354  // 75% of farmers will do straw chopping
356  break;
358  if (a_ev->m_lock || a_farm->DoIt(75)) {
359  if (!a_farm->StrawChopping(a_field, 0.0,
360  g_date->DayInYear(30, 9) - g_date->DayInYear())) {
362  break;
363  } // next event - stubble cultivator2
365  break;
366  } // the 5% left will do hay bailing
367  else if (a_ev->m_lock || a_farm->DoIt(25/25)) {
369  break;
370  }
371  case fi_ssbf_hay_bailing:
372  if (!a_farm->HayBailing(a_field, 0.0,
373  g_date->DayInYear(30, 9) - g_date->DayInYear())) {
375  break;
376  }// next event - stubble cultivator2
378  break;
379  case fi_ssbf_stubble_cultivator2: // 50% do this
380  if (a_ev->m_lock || a_farm->DoIt(50)) {
381  if (!a_farm->StubbleCultivatorHeavy(a_field, 0.0,
382  g_date->DayInYear(15, 10) - g_date->DayInYear())) {
384  break;
385  }
386  }
387  done = true;
388  // So we are done, and somewhere else the farmer will queue up the start event of the next crop
389  // END OF MAIN THREAD
390  break;
391  default:
392  g_msg->Warn(WARN_BUG, "FI_SprSpringBarley_Fodder::Do(): "
393  "Unknown event type! ", "");
394  exit(1);
395  }
396  return done;
397 }

References cfg_FI_SpringBarley_Fodder_SkScrapes, cfg_pest_product_amounts, cfg_pest_springbarley_on, LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), Farm::DoIt(), Farm::FA_Slurry(), FI_SSBF_AUTUMN_PLOUGH, FI_SSBF_DECIDE_TO_FI, FI_SSBF_DECIDE_TO_HERB, fi_ssbf_fertilizer, fi_ssbf_fungicide1, fi_ssbf_fungicide2, fi_ssbf_growth_reg, fi_ssbf_harrow, fi_ssbf_harvest, fi_ssbf_hay_bailing, fi_ssbf_herbicide1, fi_ssbf_herbicide2, fi_ssbf_insecticide, fi_ssbf_preseeding_cultivation, fi_ssbf_preseeding_sow, fi_ssbf_slurry, fi_ssbf_sow, fi_ssbf_spring_plough, fi_ssbf_start, fi_ssbf_straw_chopping, fi_ssbf_stubble_cultivator2, Farm::FP_NPKS(), Farm::FungicideTreat(), g_date, g_msg, LE::GetMDates(), Farm::GetType(), Calendar::GetYearNumber(), Farm::GrowthRegulator(), Farm::Harvest(), Farm::HayBailing(), Farm::HerbicideTreat(), Farm::InsecticideTreat(), Farm::IsStockFarmer(), Crop::m_date_modifier, 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(), ppp_1, Farm::PreseedingCultivator(), Farm::PreseedingCultivatorSow(), Farm::ProductApplication(), LE::SetMConstants(), LE::SetMDates(), Crop::SimpleEvent(), Crop::SimpleEvent_(), Farm::SpringHarrow(), Farm::SpringPlough(), Farm::SpringSowWithFerti(), Farm::StrawChopping(), Farm::StubbleCultivatorHeavy(), tof_OptimisingFarm, CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), and WARN_BUG.

◆ SetUpFarmCategoryInformation()

void FI_SprSpringBarley_Fodder::SetUpFarmCategoryInformation ( )
inline
111  {
112  const int elements = 2 + (fi_ssbf_foobar - FI_SSBF_BASE);
114 
115  FarmManagementCategory catlist[elements] =
116  {
117  fmc_Others, // zero element unused but must be here
118  fmc_Others, // fi_sbf_start = 1, // Compulsory, must always be 1 (one).
119  fmc_Others, // fi_sbf_sleep_all_day = FI_SBF_BASE,
120  fmc_Cultivation, // fi_sbf_spring_plough,
121  fmc_Fungicide, // fi_sbf_fungicide1,
122  fmc_Fertilizer, // fi_sbf_slurry,
123  fmc_Cultivation, // fi_sbf_preseeding_cultivation,
124  fmc_Cultivation, // fi_sbf_preseeding_sow,
125  fmc_Others, // fi_sbf_sow,
126  fmc_Fertilizer, // fi_sbf_fertilizer,
127  fmc_Cultivation, // fi_sbf_harrow,
128  fmc_Herbicide, // fi_sbf_herbicide1,
129  fmc_Insecticide, // fi_sbf_insecticide,
130  fmc_Others, // fi_sbf_growth_reg,
131  fmc_Fungicide, // fi_sbf_fungicide2,
132  fmc_Harvest, // fi_sbf_harvest,
133  fmc_Herbicide, // fi_sbf_herbicide2,
134  fmc_Others, // fi_sbf_straw_chopping,
135  fmc_Others, // fi_sbf_hay_bailing,
136  fmc_Cultivation // fi_sbf_stubble_cultivator2,
137 
138 
139  // no foobar entry
140 
141  };
142  // Iterate over the catlist elements and copy them to vector
143  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
144 
145  }

References FI_SSBF_BASE, fi_ssbf_foobar, fmc_Cultivation, fmc_Fertilizer, fmc_Fungicide, fmc_Harvest, fmc_Herbicide, fmc_Insecticide, fmc_Others, Crop::m_base_elements_no, and Crop::m_ManagementCategories.

Referenced by FI_SprSpringBarley_Fodder().


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
Farm::PreseedingCultivator
virtual bool PreseedingCultivator(LE *a_field, double a_user, int a_days)
Carry out preseeding cultivation on a_field (tilling set including cultivator and string roller to co...
Definition: FarmFuncs.cpp:312
LE::SetMDates
void SetMDates(int a, int b, int c)
Definition: Elements.h:406
fi_ssbf_straw_chopping
Definition: FI_SprSpringBarley_Fodder.h:84
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::ProductApplication
virtual bool ProductApplication(LE *a_field, double a_user, int a_days, double a_applicationrate, PlantProtectionProducts a_ppp, bool a_isgranularpesticide=false, int a_orcharddrifttype=0)
Apply test pesticide to a_field.
Definition: FarmFuncs.cpp:2267
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
LE::ClearManagementActionSum
void ClearManagementActionSum()
clears the management action counters
Definition: Elements.h:247
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
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
fi_ssbf_stubble_cultivator2
Definition: FI_SprSpringBarley_Fodder.h:86
cfg_pest_product_amounts
CfgArray_Double cfg_pest_product_amounts
Amount of pesticide applied in grams of active substance per hectare for each of the 10 pesticides.
cfg_FI_SpringBarley_Fodder_SkScrapes
CfgBool cfg_FI_SpringBarley_Fodder_SkScrapes("DK_CROP_SBF_SK_SCRAPES", CFG_CUSTOM, false)
fi_ssbf_start
Definition: FI_SprSpringBarley_Fodder.h:68
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
FI_SSBF_BASE
#define FI_SSBF_BASE
Definition: FI_SprSpringBarley_Fodder.h:53
FI_SSBF_AUTUMN_PLOUGH
#define FI_SSBF_AUTUMN_PLOUGH
A flag used to indicate autumn ploughing status.
Definition: FI_SprSpringBarley_Fodder.h:57
fi_ssbf_insecticide
Definition: FI_SprSpringBarley_Fodder.h:79
Farm::GetType
TTypesOfFarm GetType(void)
Definition: Farm.h:956
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
fi_ssbf_herbicide2
Definition: FI_SprSpringBarley_Fodder.h:83
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
FarmEvent::m_startday
int m_startday
Definition: Farm.h:385
fi_ssbf_slurry
Definition: FI_SprSpringBarley_Fodder.h:72
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
fi_ssbf_fungicide1
Definition: FI_SprSpringBarley_Fodder.h:71
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
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
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
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
FI_SprSpringBarley_Fodder::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: FI_SprSpringBarley_Fodder.h:111
Farm::HayBailing
virtual bool HayBailing(LE *a_field, double a_user, int a_days)
Carry out hay bailing on a_field.
Definition: FarmFuncs.cpp:1507
fi_ssbf_sow
Definition: FI_SprSpringBarley_Fodder.h:75
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
fi_ssbf_harrow
Definition: FI_SprSpringBarley_Fodder.h:77
Farm::StrawChopping
virtual bool StrawChopping(LE *a_field, double a_user, int a_days)
Carry out straw chopping on a_field.
Definition: FarmFuncs.cpp:1475
fi_ssbf_growth_reg
Definition: FI_SprSpringBarley_Fodder.h:80
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
fi_ssbf_herbicide1
Definition: FI_SprSpringBarley_Fodder.h:78
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
fi_ssbf_fertilizer
Definition: FI_SprSpringBarley_Fodder.h:76
fi_ssbf_hay_bailing
Definition: FI_SprSpringBarley_Fodder.h:85
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
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
fi_ssbf_fungicide2
Definition: FI_SprSpringBarley_Fodder.h:81
CfgArray_Double::value
std::vector< double > value() const
Definition: Configurator.h:219
fi_ssbf_spring_plough
Definition: FI_SprSpringBarley_Fodder.h:70
Farm::PreseedingCultivatorSow
virtual bool PreseedingCultivatorSow(LE *a_field, double a_user, int a_days, double a_seed_coating_amount=-1, PlantProtectionProducts a_ppp=ppp_foobar)
Carry out preseeding cultivation together with sow on a_field (tilling and sowing set including culti...
Definition: FarmFuncs.cpp:325
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
Farm::InsecticideTreat
virtual bool InsecticideTreat(LE *a_field, double a_user, int a_days)
Apply insecticide to a_field.
Definition: FarmFuncs.cpp:2135
tof_OptimisingFarm
Definition: LandscapeFarmingEnums.h:696
FI_SSBF_DECIDE_TO_FI
#define FI_SSBF_DECIDE_TO_FI
Definition: FI_SprSpringBarley_Fodder.h:59
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
FI_SSBF_DECIDE_TO_HERB
#define FI_SSBF_DECIDE_TO_HERB
Definition: FI_SprSpringBarley_Fodder.h:58
Crop::m_date_modifier
static int m_date_modifier
Holds a value that shifts test pesticide use by this many days in crops modified to use it.
Definition: Farm.h:514
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
fi_ssbf_harvest
Definition: FI_SprSpringBarley_Fodder.h:82
Farm::GrowthRegulator
virtual bool GrowthRegulator(LE *a_field, double a_user, int a_days)
Apply growth regulator to a_field.
Definition: FarmFuncs.cpp:2070
fi_ssbf_preseeding_sow
Definition: FI_SprSpringBarley_Fodder.h:74
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
fi_ssbf_foobar
Definition: FI_SprSpringBarley_Fodder.h:87
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
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
cfg_pest_springbarley_on
CfgBool cfg_pest_springbarley_on
Turn on pesticides for spring barley.
Farm::FP_NPKS
virtual bool FP_NPKS(LE *a_field, double a_user, int a_days)
Apply NPKS fertilizer, on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:630
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
fi_ssbf_preseeding_cultivation
Definition: FI_SprSpringBarley_Fodder.h:73