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

FI_WinterWheat class
. More...

#include <FI_WinterWheat.h>

Inheritance diagram for FI_WinterWheat:
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_WinterWheat (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_WinterWheat class
.

See FI_WinterWheat.h::FI_WinterWheatToDo for a complete list of all possible events triggered codes by the winter wheat 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_WinterWheat()

FI_WinterWheat::FI_WinterWheat ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
110  : Crop(a_tov, a_toc, a_L)
111  {
112  // When we start it off, the first possible date for a farm operation is 1st October
113  // This information is used by other crops when they decide how much post processing of
114  // the management is allowed after harvest before the next crop starts.
115  m_first_date=g_date->DayInYear( 16,10 );
117  }

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

Member Function Documentation

◆ Do()

bool FI_WinterWheat::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  bool flag = false;
106  int d1 = 0;
107  m_ev = a_ev;
109  int l_nextcropstartdate;
110 
111  switch (m_ev->m_todo)
112  {
113  case fi_ww_start:
114  {
115  a_field->ClearManagementActionSum();
116 
117  m_last_date = g_date->DayInYear(29, 8); // Should match the last flexdate below
118  //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
119  std::vector<std::vector<int>> flexdates(2 + 1, std::vector<int>(2, 0));
120  // Set up the date management stuff
121  // Start and stop dates for all events after harvest
122  flexdates[0][1] = g_date->DayInYear(25, 8); // last possible day of harvest
123  // Now these are done in pairs, start & end for each operation. If its not used then -1
124  flexdates[1][0] = -1; // This date will be moved back as far as necessary and potentially to flexdates 1 (start op 1)
125  flexdates[1][1] = g_date->DayInYear(29, 8); // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 1)
126  flexdates[2][0] = -1;
127  flexdates[2][1] = g_date->DayInYear(29, 8);
128 
129  // Below if this is a spring crop use 365, otherwise first parameter is always 0, second parameter is fixed, and the third is the start up operation in the first year
130  if (StartUpCrop(0, flexdates, int(fi_ww_ammonium_sulphate))) break;
131 
132  // End single block date checking code. Please see next line comment as well.
133  // Reinit d1 to first possible starting date.
134  d1 = g_date->OldDays() + g_date->DayInYear(1, 8);
135  // OK, let's go.
136  SimpleEvent(d1, fi_ww_slurry, false);
137  }
138  break;
139 
140  // This is the first real farm operation - LKM: done if there is time between 1-20th of August - if after 20th of August, go straight to fertilizer
141  case fi_ww_slurry:
142  if (a_ev->m_lock || a_farm->DoIt(20)) {
143  if (!a_farm->FP_Slurry(a_field, 0.0, g_date->DayInYear(20, 8) - g_date->DayInYear())) {
144  SimpleEvent(g_date->Date() + 1, fi_ww_slurry, true);
145  break;
146  }
147  }
149  break;
150  case fi_ww_shallow_plough: // shallow plough is coded as autumn plough - may need new function?
151  d1 = g_date->Date();
152  if (d1 > g_date->OldDays() + g_date->DayInYear(20, 8)) {
154  break;
155  } // 5% do the shallow plough followed by harrowing
156  else if (a_ev->m_lock || a_farm->DoIt(5)) {
157  if (!a_farm->AutumnPlough(a_field, 0.0, g_date->DayInYear(19, 8) - g_date->DayInYear())) {
158  // If we don't succeed on the first try, then try and try again (until 19/8 when we will succeed)
160  break;
161  }
162  // Queue up the next event - in this case harrowing
163  SimpleEvent(g_date->Date() + 1, fi_ww_harrow1, false);
164  break;
165  } // 20% do the stubble cultivator
166  else if (a_ev->m_lock || a_farm->DoIt(20)) {
168  break;
169  }
170  // otherwise do fertilizer
172  break;
173  case fi_ww_harrow1:
174  if (!a_farm->AutumnHarrow(a_field, 0.0, g_date->DayInYear(20, 8) - g_date->DayInYear())) {
175  // If we don't succeed on the first try, then try and try again (until 20/8 when we will succeed)
176  SimpleEvent(g_date->Date() + 1, fi_ww_harrow1, true);
177  break;
178  }
179  // Queue up the next event - in this case harrowing again 1-2 days after
180  SimpleEvent(g_date->Date() + 1, fi_ww_harrow2, false);
181  break;
182  case fi_ww_harrow2:
183  if (!a_farm->AutumnHarrow(a_field, 0.0, g_date->DayInYear(22, 8) - g_date->DayInYear())) {
184  // If we don't succeed on the first try, then try and try again (until 22/8 when we will succeed)
185  SimpleEvent(g_date->Date() + 1, fi_ww_harrow2, true);
186  break;
187  }
188  // Queue up the next event - in this case slurry
190  break;
192  if (!a_farm->StubbleCultivatorHeavy(a_field, 0.0, g_date->DayInYear(20, 8) - g_date->DayInYear())) {
193  // If we don't succeed on the first try, then try and try again (until 20/8 when we will succeed)
195  break;
196  }
197  // Queue up the next event - in this case stubble cultivator again a week after
199  break;
201  if (!a_farm->StubbleCultivatorHeavy(a_field, 0.0, g_date->DayInYear(28, 8) - g_date->DayInYear())) {
202  // If we don't succeed on the first try, then try and try again (until 28/8 when we will succeed)
204  break;
205  }
206  // Queue up the next event - in this case fertilizer
208  break;
209  case fi_ww_fertilizer1:
210  if (a_ev->m_lock || a_farm->DoIt(80)) {
211  if (!a_farm->FP_NPKS(a_field, 0.0, g_date->DayInYear(11, 9) - g_date->DayInYear())) {
212  SimpleEvent(g_date->Date() + 1, fi_ww_fertilizer1, true);
213  break;
214  }
215  }
216  // Queue up the next event - in this case stubble cultivator again
218  break;
220  if (a_ev->m_lock || a_farm->DoIt_prob(.20)) { // 20% do stubble cultivator3
221  if (!a_farm->StubbleCultivatorHeavy(a_field, 0.0, g_date->DayInYear(15, 9) - g_date->DayInYear())) {
223  break;
224  }
225  SimpleEvent(g_date->Date(), fi_ww_sow, false);
226  break;
227  }
228  else if (a_ev->m_lock || a_farm->DoIt_prob(.30 / .80)) {
230  break;
231  }
232  else if (a_ev->m_lock || a_farm->DoIt_prob(.30 / .50)) {
234  break;
235  }
236  else SimpleEvent(g_date->Date(), fi_ww_sow, false);
237  break;
238 
240  if (!a_farm->PreseedingCultivator(a_field, 0.0,
241  g_date->DayInYear(13, 9) - g_date->DayInYear())) {
243  break;
244  }
245  // Queue up the next event - in this case sow
246  SimpleEvent(g_date->Date(), fi_ww_sow, false);
247  break;
249  if (!a_farm->PreseedingCultivatorSow(a_field, 0.0,
250  g_date->DayInYear(15, 9) - g_date->DayInYear())) {
252  break;
253  }
254  // LKM: Here is a fork leading to parallel events
255  SimpleEvent(g_date->Date(), fi_ww_herbicide1, false); // Herbicide thread
256  SimpleEvent(g_date->Date() + m_date_modifier, fi_ww_insecticide, false); // insecticide thread - main thread
257  break;
258  case fi_ww_sow:
259  if (!a_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(15, 9) - g_date->DayInYear())) {
260  SimpleEvent(g_date->Date() + 1, fi_ww_sow, true);
261  break;
262  }
263  // LKM: Here is a fork leading to parallel events
264  SimpleEvent(g_date->Date(), fi_ww_herbicide1, false); // Herbicide thread
265  SimpleEvent(g_date->Date() + m_date_modifier, fi_ww_insecticide, false); // insecticide thread - main thread
266  break;
267  case fi_ww_herbicide1:
268  if (a_ev->m_lock || a_farm->DoIt(30)) { //30% do herbicide2
269  if (!a_farm->HerbicideTreat(a_field, 0.0,
270  g_date->DayInYear(30, 9) - g_date->DayInYear())) {
271  SimpleEvent(g_date->Date() + 1, fi_ww_herbicide1, true);
272  break;
273  }
274  }
275  //LKM: end of herbicide thread
276  break;
277  case fi_ww_insecticide:
278 #ifdef ECOSTACK_BIOPESTICIDE
279  if (a_ev->m_lock || a_farm->DoIt(10)) { //5% do insecticide
280 #else
281  if (a_ev->m_lock || a_farm->DoIt(5)) { //5% do insecticide
282 #endif
283  // here we check whether we are using ERA pesticide or not
284  d1 = g_date->DayInYear(30, 9) - g_date->DayInYear();
285  if (!cfg_pest_winterwheat_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
286  {
287 #ifdef ECOSTACK_BIOPESTICIDE
288  flag = m_farm->BiocideTreat(m_field, 0.0, d1);
289 #else
290  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
291 #endif
292  }
293  else {
295  }
296  if (!flag) {
298  break;
299  }
300  }
302  break;
303  case fi_ww_fungicide1:
304  if (a_ev->m_lock || a_farm->DoIt(80)) { //80% do fungicide1
305  if (!a_farm->FungicideTreat(a_field, 0.0,
306  g_date->DayInYear(30, 11) - g_date->DayInYear())) {
307  SimpleEvent(g_date->Date() + 1, fi_ww_fungicide1, true);
308  break;
309  }
310  }
311  //Winter time!
312  //Queue up next event (next year) - in this case ammonium sulphate:
314  break;
316  if (a_ev->m_lock || a_farm->DoIt(98)) { //98% do ammonium sulphate
317  if (!a_farm->FP_AmmoniumSulphate(a_field, 0.0,
318  g_date->DayInYear(5, 5) - g_date->DayInYear())) {
320  break;
321  }
322  }
323  // LKM: Here is a fork leading to parallel events
324  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5), fi_ww_herbicide2, false); // Herbicide thread
325  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5), fi_ww_growth_reg1, false); // growth reg1 thread - main thread
326  break;
327  case fi_ww_herbicide2:
328  if (a_ev->m_lock || a_farm->DoIt(98)) { //98% do herbicide3
329  if (!a_farm->HerbicideTreat(a_field, 0.0,
330  g_date->DayInYear(20, 5) - g_date->DayInYear())) {
331  SimpleEvent(g_date->Date() + 1, fi_ww_herbicide2, true);
332  break;
333  }
334  }
335  break;
336  //End of herbicide thread
337  case fi_ww_growth_reg1:
338  if (a_ev->m_lock || a_farm->DoIt(50)) { //50% do growth reg1
339  if (!a_farm->GrowthRegulator(a_field, 0.0,
340  g_date->DayInYear(20, 5) - g_date->DayInYear())) {
341  SimpleEvent(g_date->Date() + 1, fi_ww_growth_reg1, true);
342  break;
343  }
345  break;
346  }
347  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(20, 5), fi_ww_fertilizer2_1, false);
348  break;
349  case fi_ww_fertilizer2_1:
350  if (a_ev->m_lock || a_farm->DoIt(60)) { //60% do a foliar fertilizer with microelements
351  if (!a_farm->FP_NPKS(a_field, 0.0,
352  g_date->DayInYear(25, 5) - g_date->DayInYear())) {
354  break;
355  }
356  }
358  break;
359  case fi_ww_fertilizer2_2:
360  if (a_ev->m_lock || a_farm->DoIt(60)) { //60% do a foliar fertilizer with microelements
361  if (!a_farm->FP_NPKS(a_field, 0.0,
362  g_date->DayInYear(25, 5) - g_date->DayInYear())) {
364  break;
365  }
366  }
368  break;
369  case fi_ww_growth_reg2:
370  if (a_ev->m_lock || a_farm->DoIt(60)) { //30% of all - 60% of the 50% going to this event do growth reg 2
371  if (!a_farm->GrowthRegulator(a_field, 0.0,
372  g_date->DayInYear(20, 6) - g_date->DayInYear())) {
373  SimpleEvent(g_date->Date() + 1, fi_ww_growth_reg2, true);
374  break;
375  }
376  }
378  break;
379  case fi_ww_fungicide2:
380  if (a_ev->m_lock || a_farm->DoIt(40)) { //40% do fungicide2
381  if (!a_farm->FungicideTreat(a_field, 0.0,
382  g_date->DayInYear(20, 6) - g_date->DayInYear())) {
383  SimpleEvent(g_date->Date() + 1, fi_ww_fungicide2, true);
384  break;
385  }
386  }
387  SimpleEvent(g_date->OldDays() + g_date->DayInYear(15, 8), fi_ww_harvest, false);
388  break;
389  case fi_ww_harvest:
390  // We don't move harvest days
391  if (!a_farm->Harvest(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
392  SimpleEvent(g_date->Date() + 1, fi_ww_harvest, true);
393  break;
394  }
395  // 100% of farmers will do straw chopping
397  break;
399  if (!m_farm->StrawChopping(m_field, 0.0, m_field->GetMDates(1, 1) - g_date->DayInYear())) {
401  break;
402  }
404  break;
405  case fi_ww_hay_bailing:
406  if (a_ev->m_lock || a_farm->DoIt(5)) { //5% do hay bailing
407  if (!m_farm->HayBailing(m_field, 0.0, m_field->GetMDates(1, 2) - g_date->DayInYear())) {
408  SimpleEvent(g_date->Date() + 1, fi_ww_hay_bailing, true);
409  break;
410  }
411  }
412  else {
413  done = true;
414  }
415  done = true;
416  // So we are done, and somewhere else the farmer will queue up the start event of the next crop
417  // END OF MAIN THREAD
418  break;
419  default:
420  g_msg->Warn(WARN_BUG, "FI_WinterWheat::Do(): "
421  "Unknown event type! ", "");
422  exit(1);
423  }
424  if (done) m_ev->m_forcespring = true; // Here we need to force the next crop to spring operation, so set the ev->forcespring to true
425  return done;
426 }

References Farm::AutumnHarrow(), Farm::AutumnPlough(), Farm::AutumnSow(), Farm::BiocideTreat(), cfg_pest_product_amounts, cfg_pest_winterwheat_on, LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), Farm::DoIt(), Farm::DoIt_prob(), fi_ww_ammonium_sulphate, fi_ww_cultivation_seeding, fi_ww_fertilizer1, fi_ww_fertilizer2_1, fi_ww_fertilizer2_2, fi_ww_fungicide1, fi_ww_fungicide2, fi_ww_growth_reg1, fi_ww_growth_reg2, fi_ww_harrow1, fi_ww_harrow2, fi_ww_harvest, fi_ww_hay_bailing, fi_ww_herbicide1, fi_ww_herbicide2, fi_ww_insecticide, fi_ww_preseeding_cultivator, fi_ww_shallow_plough, fi_ww_slurry, fi_ww_sow, fi_ww_start, fi_ww_straw_chopping, fi_ww_stubble_cultivator1, fi_ww_stubble_cultivator2, fi_ww_stubble_cultivator3, Farm::FP_AmmoniumSulphate(), Farm::FP_NPKS(), Farm::FP_Slurry(), Farm::FungicideTreat(), g_date, g_msg, LE::GetMDates(), Farm::GrowthRegulator(), Farm::Harvest(), Farm::HayBailing(), Farm::HerbicideTreat(), Farm::InsecticideTreat(), Crop::m_date_modifier, Crop::m_ev, Crop::m_farm, Crop::m_field, FarmEvent::m_forcespring, Crop::m_last_date, FarmEvent::m_lock, FarmEvent::m_todo, Calendar::OldDays(), ppp_1, Farm::PreseedingCultivator(), Farm::PreseedingCultivatorSow(), Farm::ProductApplication(), Crop::SimpleEvent(), Crop::SimpleEvent_(), Crop::StartUpCrop(), Farm::StrawChopping(), Farm::StubbleCultivatorHeavy(), tov_FIWinterWheat, CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), and WARN_BUG.

◆ SetUpFarmCategoryInformation()

void FI_WinterWheat::SetUpFarmCategoryInformation ( )
inline
118  {
119  const int elements = 2 + (fi_ww_foobar - FI_WW_BASE);
121 
122  FarmManagementCategory catlist[elements] =
123  {
124  fmc_Others, // zero element unused but must be here
125  fmc_Others, // fi_ww_start = 1, // Compulsory, must always be 1 (one).
126  fmc_Others, // fi_ww_sleep_all_day = FI_WW_BASE,
127  fmc_Cultivation, // fi_ww_shallow_plough,
128  fmc_Cultivation, // fi_ww_stubble_cultivator1,
129  fmc_Cultivation, // fi_ww_stubble_cultivator2,
130  fmc_Cultivation, // fi_ww_harrow1,
131  fmc_Cultivation, // fi_ww_harrow2,
132  fmc_Fertilizer, // fi_ww_slurry,
133  fmc_Fertilizer, // fi_ww_fertilizer1,
134  fmc_Herbicide, // fi_ww_herbicide1,
135  fmc_Cultivation, // fi_ww_stubble_cultivator3,
136  fmc_Cultivation, // fi_ww_preseeding_cultivator,
137  fmc_Cultivation, // fi_ww_cultivation_seeding,
138  fmc_Others, // fi_ww_sow,
139  fmc_Herbicide, // fi_ww_herbicide2,
140  fmc_Fungicide, // fi_ww_fungicide1,
141  fmc_Insecticide, // fi_ww_insecticide,
142  fmc_Fertilizer, // fi_ww_ammonium_sulphate,
143  fmc_Others, // fi_ww_growth_reg1,
144  fmc_Fertilizer, // fi_ww_fertilizer2_1,
145  fmc_Fertilizer, // fi_ww_fertilizer2_2,
146  fmc_Others, // fi_ww_growth_reg2,
147  fmc_Fungicide, // fi_ww_fungicide2,
148  fmc_Harvest, // fi_ww_harvest,
149  fmc_Others, // fi_ww_straw_chopping,
150  fmc_Others // fi_ww_hay_bailing,
151 
152 
153  // no foobar entry
154 
155  };
156  // Iterate over the catlist elements and copy them to vector
157  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
158 
159  }

References FI_WW_BASE, fi_ww_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_WinterWheat().


The documentation for this class was generated from the following files:
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
fi_ww_cultivation_seeding
Definition: FI_WinterWheat.h:80
tov_FIWinterWheat
Definition: LandscapeFarmingEnums.h:524
FarmEvent::m_forcespring
bool m_forcespring
Definition: Farm.h:392
fi_ww_start
Definition: FI_WinterWheat.h:68
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
Farm::HerbicideTreat
virtual bool HerbicideTreat(LE *a_field, double a_user, int a_days)
Apply herbicide to a_field.
Definition: FarmFuncs.cpp:2025
fi_ww_straw_chopping
Definition: FI_WinterWheat.h:92
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
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
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
fi_ww_herbicide1
Definition: FI_WinterWheat.h:77
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
fi_ww_harrow2
Definition: FI_WinterWheat.h:74
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
fi_ww_preseeding_cultivator
Definition: FI_WinterWheat.h:79
fi_ww_ammonium_sulphate
Definition: FI_WinterWheat.h:85
fi_ww_fertilizer2_2
Definition: FI_WinterWheat.h:88
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
fi_ww_stubble_cultivator2
Definition: FI_WinterWheat.h:72
fi_ww_growth_reg1
Definition: FI_WinterWheat.h:86
fi_ww_harrow1
Definition: FI_WinterWheat.h:73
Calendar::Date
long Date(void)
Definition: Calendar.h:57
Farm::FP_AmmoniumSulphate
virtual bool FP_AmmoniumSulphate(LE *a_field, double a_user, int a_days)
Apply Ammonium Sulphate to a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:882
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
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
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
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_ww_foobar
Definition: FI_WinterWheat.h:94
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
fi_ww_hay_bailing
Definition: FI_WinterWheat.h:93
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
fi_ww_growth_reg2
Definition: FI_WinterWheat.h:89
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
CfgArray_Double::value
std::vector< double > value() const
Definition: Configurator.h:219
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
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
fi_ww_shallow_plough
Definition: FI_WinterWheat.h:70
Farm::BiocideTreat
virtual bool BiocideTreat(LE *a_field, double a_user, int a_days)
Apply Biocide to a_field.
Definition: FarmFuncs.cpp:2175
fi_ww_slurry
Definition: FI_WinterWheat.h:75
fi_ww_insecticide
Definition: FI_WinterWheat.h:84
Crop::m_last_date
int m_last_date
Definition: Farm.h:503
FI_WinterWheat::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: FI_WinterWheat.h:118
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::AutumnHarrow
virtual bool AutumnHarrow(LE *a_field, double a_user, int a_days)
Carry out a harrow event in the autumn on a_field.
Definition: FarmFuncs.cpp:285
FI_WW_BASE
#define FI_WW_BASE
Definition: FI_WinterWheat.h:53
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
fi_ww_stubble_cultivator3
Definition: FI_WinterWheat.h:78
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
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
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
fi_ww_harvest
Definition: FI_WinterWheat.h:91
cfg_pest_winterwheat_on
CfgBool cfg_pest_winterwheat_on
Turn on pesticides for winter wheat.
Farm::GrowthRegulator
virtual bool GrowthRegulator(LE *a_field, double a_user, int a_days)
Apply growth regulator to a_field.
Definition: FarmFuncs.cpp:2070
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
fi_ww_fungicide1
Definition: FI_WinterWheat.h:83
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
fi_ww_fungicide2
Definition: FI_WinterWheat.h:90
fi_ww_stubble_cultivator1
Definition: FI_WinterWheat.h:71
fi_ww_fertilizer1
Definition: FI_WinterWheat.h:76
fi_ww_sow
Definition: FI_WinterWheat.h:81
fi_ww_herbicide2
Definition: FI_WinterWheat.h:82
fi_ww_fertilizer2_1
Definition: FI_WinterWheat.h:87
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
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.
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::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