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

DE_WinterWheat class
. More...

#include <DE_WinterWheat.h>

Inheritance diagram for DE_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...
 
 DE_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

DE_WinterWheat class
.

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

◆ DE_WinterWheat()

DE_WinterWheat::DE_WinterWheat ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline

When we start it off, the first possible date for a farm operation is 15th September This information is used by other crops when they decide how much post processing of the management is allowed after harvest before the next crop starts.

112  : Crop(a_tov, a_toc, a_L)
113  {
119  m_first_date=g_date->DayInYear( 1,10 );
121  }

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

Member Function Documentation

◆ Do()

bool DE_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 m_ev->todo set to start, but susequently will be called whenever the farmer wants to carry out a new operation.
This method details all the management and relationships between operations necessary to grow and ALMaSS crop - in this case conventional winter wheat.

Reimplemented from Crop.

91 {
92 /******************** This block can be added to the top of all Crop::Do methods ***********************************************/
93  m_farm = a_farm; // These assignments are necessary, not for this method but for related event calls
94  m_field = a_field;
95  m_ev = a_ev;
96  bool done = false; // The boolean value done indicates when we are totally finished with this plan (i.e. it is set to true).
97  bool flag = false;
98  int d1 = 0;
99  int noDates = 1;
100  TTypesOfVegetation l_tov = tov_DEWinterWheat; // The current type - change to match the crop you have
101 /**********************************************To Here *************************************************************************/
102 
103  // Depending what event has occured jump to the correct bit of code
104  switch (m_ev->m_todo)
105  {
106  case de_ww_start:
107  {
108  DE_WW_AUTUMN_PLOUGH = false;
109  DE_WW_DECIDE_TO_GR = false;
110 
112 
113  m_last_date = g_date->DayInYear(31, 8); // Should match the last flexdate below
114  //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
115  std::vector<std::vector<int>> flexdates(2 + 1, std::vector<int>(2, 0));
116  // Set up the date management stuff
117  // Start and stop dates for all events after harvest
118  flexdates[0][1] = g_date->DayInYear(25, 8); // last possible day of harvest - this is in effect day before the earliest date that a following crop can use
119  // Now these are done in pairs, start & end for each operation. If its not used then -1
120  flexdates[1][0] = -1; // This date will be moved back as far as necessary and potentially to flexdates 1 (start op 1)
121  flexdates[1][1] = g_date->DayInYear(31, 8); // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 1)
122  flexdates[2][0] = -1; // This date will be moved back as far as necessary and potentially to flexdates 1 (start op 1)
123  flexdates[2][1] = g_date->DayInYear(31, 8); // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 2)
124 
125  // Below if this is a spring crop use 365, otherwise set this to 0, second parameter is fixed, and the third is the start up operation in the first year
126  int isSpring = 0;
127  if (StartUpCrop(isSpring, flexdates, int(de_ww_ferti_s2))) break;
128 
129  // End single block date checking code. Please see next line comment as well.
130  // Reinit d1 to first possible starting date.
131  d1 = g_date->OldDays() + g_date->DayInYear(1, 9) + isSpring;
132  // OK, let's go.
133  SimpleEvent(d1, de_ww_autumn_plough, false);
134  break;
135  }
136  break;
137 
138  // This is the first real farm operation
139  case de_ww_autumn_plough:
140  if (m_ev->m_lock || m_farm->DoIt(50))
141  {
142  if (!m_farm->AutumnPlough(m_field, 0.0, g_date->DayInYear(1, 10) - g_date->DayInYear())) {
144  break;
145  }
147  break;
148  }
150  break;
151 
153  // some will do stubble plough, but rest will get away with non-inversion cultivation or non-tillage
154  if (!m_farm->ShallowHarrow(m_field, 0.0, g_date->DayInYear(1, 10) - g_date->DayInYear())) {
156  break;
157  }
159  break;
160  //LKM: no-till and till branches meet here
161  case de_ww_autumn_sow:
162  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(30, 11) - g_date->DayInYear())) {
164  break;
165  }
166  // Here is a fork leading to four parallel events
167  SimpleEvent_(g_date->Date() + 14, de_ww_herbicide1, false, m_farm, m_field); // Herbidide thread
168  SimpleEvent_(g_date->Date() + 14 + m_date_modifier, de_ww_insecticide1, false, m_farm, m_field); // Insecticide thread
169  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 4) + 365, de_ww_fungicide1, false, m_farm, m_field);; // Fungicide thread
170  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 4) + 365, de_ww_growth_regulator1, false, m_farm, m_field); // GR thread
171  if (m_farm->IsStockFarmer()) //Stock Farmer // P thread
172  {
174  }
175  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, de_ww_ferti_p1, false, m_farm, m_field);
176  if (m_farm->IsStockFarmer()) //Stock Farmer // Main (N) thread
177  {
179  }
180  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, de_ww_ferti_p2, false, m_farm, m_field);
181  break;
182 
183  case de_ww_herbicide1: // The first of the pesticide managements.
184  // Here comes the herbicide thread
185  if (m_ev->m_lock || m_farm->DoIt_prob(0.80))
186  {
187  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(15, 12) - g_date->DayInYear())) {
189  break;
190  }
191  }
193  break;
194  case de_ww_herbicide2:
195  if (m_ev->m_lock || m_farm->DoIt_prob(0.70))
196  {
197  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
199  break;
200  }
201  }
202  // End of thread
203  break;
204  case de_ww_fungicide1:
205  // Here comes the fungicide thread
206  if (m_ev->m_lock || m_farm->DoIt_prob(0.80))
207  {
208  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
210  break;
211  }
212  }
213  d1 = g_date->Date() + 14;
214  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 5)) {
215  d1 = g_date->OldDays() + g_date->DayInYear(1, 5);
216  }
218  break;
219  case de_ww_fungicide2:
220  if (m_ev->m_lock || m_farm->DoIt_prob(0.65))
221  {
222  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(30, 5) - g_date->DayInYear())) {
224  break;
225  }
226  }
227  // End of thread
228  break;
229  case de_ww_insecticide1:
230  // Here comes the insecticide thread
231 #ifdef ECOSTACK_BIOPESTICIDE
233 #else
235 #endif
236  {
237  if (m_field->GetGreenBiomass() <= 0) {
239  }
240  else
241  {
242  // here we check wheter we are using ERA pesticide or not
243  d1 = g_date->DayInYear(15, 12) - g_date->DayInYear();
244  if (!cfg_pest_winterwheat_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
245  {
246 #ifdef ECOSTACK_BIOPESTICIDE
247  flag = m_farm->BiocideTreat(m_field, 0.0, d1);
248 #else
249  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
250 #endif
251  }
252  else {
254  }
255  if (!flag) {
257  break;
258  }
259  }
260  }
262  break;
263  case de_ww_insecticide2:
264 #ifdef ECOSTACK_BIOPESTICIDE
266 #else
268 #endif
269  {
270  // here we check wheter we are using ERA pesticide or not
271  d1 = g_date->DayInYear(30, 5) - g_date->DayInYear();
272  if (!cfg_pest_winterwheat_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
273  {
274 #ifdef ECOSTACK_BIOPESTICIDE
275  flag = m_farm->BiocideTreat(m_field, 0.0, d1);
276 #else
277  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
278 #endif
279  }
280  else {
282  }
283  if (!flag) {
285  break;
286  }
287  }
288 #ifdef ECOSTACK_BIOPESTICIDE
289  d1 = g_date->Date() + 7;
290 #else
291  d1 = g_date->Date() + 14;
292 #endif
293  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 6) + m_date_modifier) {
294  d1 = g_date->OldDays() + g_date->DayInYear(1, 6) + m_date_modifier;
295  }
297  break;
298  case de_ww_insecticide3:
299 #ifdef ECOSTACK_BIOPESTICIDE
301 #else
303 #endif
304  {
305  // here we check wheter we are using ERA pesticide or not
306  d1 = g_date->DayInYear(30, 6) - g_date->DayInYear();
307  if (!cfg_pest_winterwheat_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
308  {
309 #ifdef ECOSTACK_BIOPESTICIDE
310  flag = m_farm->BiocideTreat(m_field, 0.0, d1);
311 #else
312  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
313 #endif
314  }
315  else {
317  }
318  if (!flag) {
320  break;
321  }
322  }
323  // End of thread
324  break;
326  // Here comes the GR thread
327  if (m_ev->m_lock || m_farm->DoIt_prob(0.65))
328  {
329  if (!m_farm->GrowthRegulator(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
331  break;
332  }
333  else
334  {
335  //We need to remeber who did GR I
336  DE_WW_DECIDE_TO_GR = true;
337  }
338  }
340  break;
342  if (m_ev->m_lock || m_farm->DoIt_prob(0.38 * DE_WW_DECIDE_TO_GR)) // 25% of all
343  {
344  if (!m_farm->GrowthRegulator(m_field, 0.0, g_date->Date() + 21 - g_date->DayInYear())) {
346  break;
347  }
348  }
349  // End of thread
350  break;
351  case de_ww_ferti_p1:
352  // Here comes the P thread
353  if (m_ev->m_lock || m_farm->DoIt_prob(0.50))
354  {
355  if (!m_farm->FP_PK(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
357  break;
358  }
359  }
360  // End of thread
361  break;
362  case de_ww_ferti_s1:
363  // Here comes the P thread
364  if (m_ev->m_lock || m_farm->DoIt_prob(0.50))
365  {
366  if (!m_farm->FA_PK(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
368  break;
369  }
370  }
371  // End of thread
372  break;
373  case de_ww_ferti_p2:
374  // Here comes the MAIN thread
375  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(30, 3) - g_date->DayInYear())) {
377  break;
378  }
379  d1 = g_date->Date() + 7;
380  if (d1 < g_date->OldDays() + g_date->DayInYear(20, 3)) {
381  d1 = g_date->OldDays() + g_date->DayInYear(20, 3);
382  }
384  break;
385  case de_ww_ferti_s2:
386  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(30, 3) - g_date->DayInYear())) {
388  break;
389  }
390  d1 = g_date->Date() + 7;
391  if (d1 < g_date->OldDays() + g_date->DayInYear(20, 3)) {
392  d1 = g_date->OldDays() + g_date->DayInYear(20, 3);
393  }
395  break;
396  case de_ww_ferti_p3:
397  if (m_ev->m_lock || m_farm->DoIt_prob(0.95))
398  {
399  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
401  break;
402  }
403  }
404  d1 = g_date->Date() + 7;
405  if (d1 < g_date->OldDays() + g_date->DayInYear(15, 4)) {
406  d1 = g_date->OldDays() + g_date->DayInYear(15, 4);
407  }
409  break;
410  case de_ww_ferti_s3:
411  if (m_ev->m_lock || m_farm->DoIt_prob(0.95))
412  {
413  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
415  break;
416  }
417  }
418  d1 = g_date->Date() + 7;
419  if (d1 < g_date->OldDays() + g_date->DayInYear(15, 4)) {
420  d1 = g_date->OldDays() + g_date->DayInYear(15, 4);
421  }
423  break;
424  case de_ww_ferti_p4:
425  if (m_ev->m_lock || m_farm->DoIt_prob(0.50))
426  {
427  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear())) {
429  break;
430  }
431  }
433  break;
434  case de_ww_ferti_s4:
435  if (m_ev->m_lock || m_farm->DoIt_prob(0.50))
436  {
437  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear())) {
439  break;
440  }
441  }
443  break;
444 
445  case de_ww_harvest:
446  // We don't move harvest days
447  if (!m_farm->Harvest(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
449  break;
450  }
451  // 90% of farmers will leave straw on field and rest will do hay bailing
452  if (m_farm->DoIt_prob(0.90))
453  {
455  }
456  else
457  {
459  }
460  break;
462  if (!m_farm->StrawChopping(m_field, 0.0, m_field->GetMDates(1, 1) - g_date->DayInYear())) {
464  break;
465  }
466  done = true;
467  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
468  // END of MAIN THREAD
469  break;
470  case de_ww_hay_bailing:
471  if (!m_farm->HayBailing(m_field, 0.0, m_field->GetMDates(1, 2) - g_date->DayInYear())) {
473  break;
474  }
475  done = true;
476  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
477  // END of MAIN THREAD
478  break;
479  default:
480  g_msg->Warn(WARN_BUG, "DE_WinterWheat::Do(): "
481  "Unknown event type! ", "");
482  exit(1);
483  }
484  return done;
485 }

References Farm::AutumnPlough(), Farm::AutumnSow(), Farm::BiocideTreat(), cfg_pest_product_amounts, cfg_pest_winterwheat_on, LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), de_ww_autumn_harrow_notill, DE_WW_AUTUMN_PLOUGH, de_ww_autumn_plough, de_ww_autumn_sow, DE_WW_DECIDE_TO_GR, de_ww_ferti_p1, de_ww_ferti_p2, de_ww_ferti_p3, de_ww_ferti_p4, de_ww_ferti_s1, de_ww_ferti_s2, de_ww_ferti_s3, de_ww_ferti_s4, de_ww_fungicide1, de_ww_fungicide2, de_ww_growth_regulator1, de_ww_growth_regulator2, de_ww_harvest, de_ww_hay_bailing, de_ww_herbicide1, de_ww_herbicide2, de_ww_insecticide1, de_ww_insecticide2, de_ww_insecticide3, de_ww_start, de_ww_straw_chopping, Farm::DoIt(), Farm::DoIt_prob(), Farm::FA_AmmoniumSulphate(), Farm::FA_PK(), Farm::FP_AmmoniumSulphate(), Farm::FP_PK(), Farm::FungicideTreat(), g_date, g_landscape_ptr, g_msg, LE::GetGreenBiomass(), LE::GetMDates(), Farm::GrowthRegulator(), Farm::Harvest(), Farm::HayBailing(), Farm::HerbicideTreat(), Farm::InsecticideTreat(), Farm::IsStockFarmer(), Crop::m_date_modifier, Crop::m_ev, Crop::m_farm, Crop::m_field, Crop::m_last_date, FarmEvent::m_lock, FarmEvent::m_todo, Calendar::OldDays(), ppp_1, Farm::ProductApplication(), Farm::ShallowHarrow(), Crop::SimpleEvent(), Crop::SimpleEvent_(), Crop::StartUpCrop(), Farm::StrawChopping(), Landscape::SupplyPestIncidenceFactor(), tov_DEWinterWheat, CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), and WARN_BUG.

◆ SetUpFarmCategoryInformation()

void DE_WinterWheat::SetUpFarmCategoryInformation ( )
inline
122  {
123  const int elements = 2 + (de_ww_foobar - DE_WINTERWHEAT_BASE);
125 
126  FarmManagementCategory catlist[elements] =
127  {
128  fmc_Others, // zero element unused but must be here
129  // ALL THE NECESSARY ENTRIES HERE
130  fmc_Others, // de_car_start = 1, // Compulsory, must always be 1 (one).
131  fmc_Others, // de_car_sleep_all_day
132  fmc_Cultivation, // de_ww_autumn_harrow_notill,
133  fmc_Cultivation, // de_ww_stubble_cultivator,
134  fmc_Cultivation, // de_ww_autumn_plough,
135  fmc_Cultivation, // de_ww_autumn_roll,
136  fmc_Cultivation, // de_ww_autumn_sow,
137  fmc_Fertilizer, // de_ww_ferti_s1,
138  fmc_Fertilizer, // de_ww_ferti_p1,
139  fmc_Fertilizer, // de_ww_ferti_s2,
140  fmc_Fertilizer, // de_ww_ferti_p2,
141  fmc_Fertilizer, // de_ww_ferti_s3,
142  fmc_Fertilizer, // de_ww_ferti_p3,
143  fmc_Fertilizer, // de_ww_ferti_s4,
144  fmc_Fertilizer, // de_ww_ferti_p4,
145  fmc_Fertilizer, // de_ww_ferti_p5,
146  fmc_Fertilizer, // de_ww_ferti_s5,
147  fmc_Herbicide, // de_ww_herbicide1,
148  fmc_Herbicide, // de_ww_herbicide2,
149  fmc_Insecticide, // de_ww_insecticide1,
150  fmc_Insecticide, // de_ww_insecticide2,
151  fmc_Insecticide, // de_ww_insecticide3,
152  fmc_Fungicide, // de_ww_fungicide1,
153  fmc_Fungicide, // de_ww_fungicide2,
154  fmc_Fungicide, // de_ww_fungicide3,
155  fmc_Others, // de_ww_growth_regulator1,
156  fmc_Others, // de_ww_growth_regulator2,
157  fmc_Harvest, // de_ww_harvest,
158  fmc_Others, // de_ww_straw_chopping,
159  fmc_Others, // de_ww_hay_bailing,
160  // no foobar entry
161 
162  };
163  // Iterate over the catlist elements and copy them to vector
164  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
165 
166  }

References DE_WINTERWHEAT_BASE, de_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 DE_WinterWheat().


The documentation for this class was generated from the following files:
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
Farm::HerbicideTreat
virtual bool HerbicideTreat(LE *a_field, double a_user, int a_days)
Apply herbicide to a_field.
Definition: FarmFuncs.cpp:2025
de_ww_ferti_s2
Definition: DE_WinterWheat.h:75
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
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.
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
de_ww_start
Definition: DE_WinterWheat.h:66
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
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
de_ww_ferti_p1
Definition: DE_WinterWheat.h:74
de_ww_ferti_s3
Definition: DE_WinterWheat.h:77
de_ww_growth_regulator2
Definition: DE_WinterWheat.h:92
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
DE_WW_DECIDE_TO_GR
#define DE_WW_DECIDE_TO_GR
Definition: DE_WinterWheat.h:58
de_ww_herbicide1
Definition: DE_WinterWheat.h:83
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
de_ww_autumn_sow
Definition: DE_WinterWheat.h:71
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
de_ww_ferti_s1
Definition: DE_WinterWheat.h:73
Farm::FP_PK
virtual bool FP_PK(LE *a_field, double a_user, int a_days)
Apply PK fertilizer, on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:673
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
de_ww_harvest
Definition: DE_WinterWheat.h:93
DE_WINTERWHEAT_BASE
#define DE_WINTERWHEAT_BASE
Definition: DE_WinterWheat.h:51
de_ww_autumn_harrow_notill
Definition: DE_WinterWheat.h:68
DE_WW_AUTUMN_PLOUGH
#define DE_WW_AUTUMN_PLOUGH
A flag used to indicate autumn ploughing status.
Definition: DE_WinterWheat.h:55
de_ww_straw_chopping
Definition: DE_WinterWheat.h:94
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
de_ww_insecticide3
Definition: DE_WinterWheat.h:87
de_ww_foobar
Definition: DE_WinterWheat.h:96
de_ww_ferti_p3
Definition: DE_WinterWheat.h:78
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
de_ww_ferti_p4
Definition: DE_WinterWheat.h:80
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
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
de_ww_fungicide2
Definition: DE_WinterWheat.h:89
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
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
de_ww_growth_regulator1
Definition: DE_WinterWheat.h:91
Landscape::SupplyPestIncidenceFactor
double SupplyPestIncidenceFactor()
Returns Landscape::m_pestincidencefactor.
Definition: Landscape.h:325
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
de_ww_autumn_plough
Definition: DE_WinterWheat.h:69
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
LE::GetGreenBiomass
virtual double GetGreenBiomass(void)
Definition: Elements.h:160
Farm::ShallowHarrow
virtual bool ShallowHarrow(LE *a_field, double a_user, int a_days)
Carry out a shallow harrow event on a_field, e.g., after grass cutting event.
Definition: FarmFuncs.cpp:473
de_ww_fungicide1
Definition: DE_WinterWheat.h:88
Farm::BiocideTreat
virtual bool BiocideTreat(LE *a_field, double a_user, int a_days)
Apply Biocide to a_field.
Definition: FarmFuncs.cpp:2175
DE_WinterWheat::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: DE_WinterWheat.h:122
de_ww_insecticide2
Definition: DE_WinterWheat.h:86
Crop::m_last_date
int m_last_date
Definition: Farm.h:503
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::FA_AmmoniumSulphate
virtual bool FA_AmmoniumSulphate(LE *a_field, double a_user, int a_days)
Apply ammonium sulphate to a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1081
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
tov_DEWinterWheat
Definition: LandscapeFarmingEnums.h:509
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
de_ww_herbicide2
Definition: DE_WinterWheat.h:84
de_ww_insecticide1
Definition: DE_WinterWheat.h:85
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
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
de_ww_ferti_p2
Definition: DE_WinterWheat.h:76
Farm::FA_PK
virtual bool FA_PK(LE *a_field, double a_user, int a_days)
Apply PK fertilizer to a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1010
g_landscape_ptr
Landscape * g_landscape_ptr
Definition: Landscape.cpp:352
de_ww_hay_bailing
Definition: DE_WinterWheat.h:95
de_ww_ferti_s4
Definition: DE_WinterWheat.h:79
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
cfg_pest_winterwheat_on
CfgBool cfg_pest_winterwheat_on
Turn on pesticides for winter wheat.
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
Crop::SimpleEvent_
void SimpleEvent_(long a_date, int a_todo, bool a_lock, Farm *a_farm, LE *a_field)
Adds an event to this crop management without relying on member variables.
Definition: Farm.cpp:751