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

DE_WinterBarley class
. More...

#include <DE_WinterBarley.h>

Inheritance diagram for DE_WinterBarley:
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_WinterBarley (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_WinterBarley class
.

See DE_WinterBarley.h::DE_WinterBarleyToDo for a complete list of all possible events triggered codes by the WinterBarley 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_WinterBarley()

DE_WinterBarley::DE_WinterBarley ( 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.

106  : Crop(a_tov, a_toc, a_L)
107  {
113  m_first_date=g_date->DayInYear( 1,10 );
115  }

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

Member Function Documentation

◆ Do()

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

90 {
91 /******************** This block can be added to the top of all Crop::Do methods ***********************************************/
92  m_farm = a_farm; // These assignments are necessary, not for this method but for related event calls
93  m_field = a_field;
94  m_ev = a_ev;
95  bool done = false; // The boolean value done indicates when we are totally finished with this plan (i.e. it is set to true).
96  bool flag = false;
97  int d1 = 0;
98  int noDates = 1;
99  TTypesOfVegetation l_tov = tov_DEWinterBarley; // The current type - change to match the crop you have
100 /**********************************************To Here *************************************************************************/
101 
102  // Depending what event has occured jump to the correct bit of code
103  switch (m_ev->m_todo)
104  {
105  case de_wb_start:
106  {
107  DE_WB_NOTILL = false;
108  DE_WB_DECIDE_TO_GR = false;
110 
111  m_last_date = g_date->DayInYear(31, 7); // Should match the last flexdate below
112  //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
113  std::vector<std::vector<int>> flexdates(2 + 1, std::vector<int>(2, 0));
114  // Set up the date management stuff
115  // Start and stop dates for all events after harvest
116  flexdates[0][1] = g_date->DayInYear(25, 7); // last possible day of harvest - this is in effect day before the earliest date that a following crop can use
117  // Now these are done in pairs, start & end for each operation. If its not used then -1
118  flexdates[1][0] = -1; // This date will be moved back as far as necessary and potentially to flexdates 1 (start op 1)
119  flexdates[1][1] = g_date->DayInYear(31, 7); // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 1)
120  flexdates[2][0] = -1; // This date will be moved back as far as necessary and potentially to flexdates 1 (start op 1)
121  flexdates[2][1] = g_date->DayInYear(31, 7); // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 2)
122 
123  // 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
124  int isSpring = 0;
125  if (StartUpCrop(isSpring, flexdates, int(de_wb_ferti_s2))) break;
126 
127  // End single block date checking code. Please see next line comment as well.
128  // Reinit d1 to first possible starting date.
129  d1 = g_date->OldDays() + g_date->DayInYear(1, 9) + isSpring;
130  // OK, let's go.
132  break;
133  }
134  break;
135 
136  // This is the first real farm operation
137  case de_wb_autumn_plough:
138  if (m_ev->m_lock || m_farm->DoIt(50))
139  {
140  if (!m_farm->AutumnPlough(m_field, 0.0, g_date->DayInYear(1, 10) - g_date->DayInYear())) {
142  break;
143  }
144  // Queue up the next event - in this case autumn roll
146  break;
147  }
149  break;
150  case de_wb_autumn_roll:
151  if (!m_farm->AutumnRoll(m_field, 0.0, g_date->DayInYear(1, 10) - g_date->DayInYear())) {
153  break;
154  }
155  // Queue up the next event - in this case autumn sow
157  break;
159  // some will do stubble plough, but rest will get away with non-inversion cultivation or non-tillage
160  if (!m_farm->ShallowHarrow(m_field, 0.0, g_date->DayInYear(1, 10) - g_date->DayInYear())) {
162  break;
163  }
165  break;
166  //LKM: no-till and till branches meet here
167  case de_wb_autumn_sow:
168  // all farmers do preseeding cultivation together with sowing, included are here the 25% non-tillage farmers
169  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(15, 10) - g_date->DayInYear())) {
171  break;
172  }
173  // Here is a fork leading to four parallel events
174  SimpleEvent_(g_date->Date() + 1, de_wb_herbicide1, false, m_farm, m_field); // Herbicide thread
175  SimpleEvent_(g_date->Date() + 14 + m_date_modifier, de_wb_insecticide1, false, m_farm, m_field); // Insecticide thread
176  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 4) + 365, de_wb_fungicide1, false, m_farm, m_field); // Fungicide thread
177  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 4) + 365, de_wb_growth_regulator1, false, m_farm, m_field); // GR thread
178  if (m_farm->IsStockFarmer()) //Stock Farmer // P thread (K is applied before harvest)
179  {
181  }
182  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, de_wb_ferti_p1, false, m_farm, m_field);
183  if (m_farm->IsStockFarmer()) //Stock Farmer // Main thread
184  {
186  }
187  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, de_wb_ferti_p2, false, m_farm, m_field);
188  break;
189  case de_wb_herbicide1: // The first of the pesticide managements.
190  // Here comes the herbicide thread
191  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
192  {
193  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(22, 10) - g_date->DayInYear())) {
195  break;
196  }
197  }
199  break;
200  case de_wb_herbicide2:
201  if (m_ev->m_lock || m_farm->DoIt_prob(0.60))
202  {
203  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
205  break;
206  }
207  }
208  // End of thread
209  break;
210  case de_wb_insecticide1:
211  // Here comes the insecticide thread
212  if (m_ev->m_lock || m_farm->DoIt_prob(0.10*g_landscape_ptr->SupplyPestIncidenceFactor())) // only 10% use insecticides
213  {
214  if (m_field->GetGreenBiomass() <= 0) {
216  }
217  else
218  {
219  // here we check wheter we are using ERA pesticide or not
220  d1 = g_date->DayInYear(30, 11) - g_date->DayInYear();
221  if (!cfg_pest_winterbarley_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
222  {
223  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
224  }
225  else {
227  }
228  if (!flag) {
230  break;
231  }
233  break;
234  }
235  }
237  break;
238  case de_wb_insecticide2:
240  {
241  // here we check wheter we are using ERA pesticide or not
242  d1 = g_date->DayInYear(5, 6) - g_date->DayInYear();
243  if (!cfg_pest_winterbarley_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
244  {
245  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
246  }
247  else {
249  }
250  if (!flag) {
252  break;
253  }
254  }
255  // End of thread
256  break;
257  case de_wb_fungicide1:
258  // Here comes the fungicide thread
259  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
260  {
261  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
263  break;
264  }
265  }
267  break;
268  case de_wb_fungicide2:
269  if (m_ev->m_lock || m_farm->DoIt_prob(0.70))
270  {
271  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(30, 5) - g_date->DayInYear())) {
273  break;
274  }
275  }
277  break;
278  case de_wb_fungicide3:
279  if (m_ev->m_lock || m_farm->DoIt_prob(0.05))
280  {
281  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(30, 6) - g_date->DayInYear())) {
283  break;
284  }
285  }
286  // End of thread
287  break;
289  // Here comes the GR thread
290  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
291  {
292  if (!m_farm->GrowthRegulator(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
294  break;
295  }
296  else
297  {
298  //We need to remember who did GR I
299  DE_WB_DECIDE_TO_GR = true;
300  }
301  }
303  break;
305  if (m_ev->m_lock || m_farm->DoIt_prob(0.50 * DE_WB_DECIDE_TO_GR))
306  {
307  if (!m_farm->GrowthRegulator(m_field, 0.0, g_date->DayInYear(30, 5) - g_date->DayInYear())) {
309  break;
310  }
311  }
312  // End of thread
313  break;
314  case de_wb_ferti_s1:
315  // Here comes the PK thread
316  if (m_ev->m_lock || m_farm->DoIt_prob(0.30))
317  {
318  if (!m_farm->FA_PK(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
320  break;
321  }
322  }
323  // End of thread
324  break;
325  case de_wb_ferti_p1:
326  if (m_ev->m_lock || m_farm->DoIt_prob(0.30))
327  {
328  if (!m_farm->FP_PK(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
330  break;
331  }
332  }
333  // End of thread
334  break;
335  case de_wb_ferti_p2:
336  // Here comes the MAIN thread
337  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(31, 3) - g_date->DayInYear())) {
339  break;
340  }
341  d1 = g_date->Date() + 10;
342  if (d1 < g_date->OldDays() + g_date->DayInYear(20, 3)) {
343  d1 = g_date->OldDays() + g_date->DayInYear(20, 3);
344  }
346  break;
347  case de_wb_ferti_s2:
348  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(31, 3) - g_date->DayInYear())) {
350  break;
351  }
352  d1 = g_date->Date() + 10;
353  if (d1 < g_date->OldDays() + g_date->DayInYear(20, 3)) {
354  d1 = g_date->OldDays() + g_date->DayInYear(20, 3);
355  }
357  break;
358  case de_wb_ferti_p3:
359  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
360  {
361  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
363  break;
364  }
365  }
366  d1 = g_date->Date() + 10;
367  if (d1 < g_date->OldDays() + g_date->DayInYear(15, 4)) {
368  d1 = g_date->OldDays() + g_date->DayInYear(15, 4);
369  }
371  break;
372  case de_wb_ferti_s3:
373  if (m_ev->m_lock || m_farm->DoIt_prob(0.90))
374  {
375  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(20, 4) - g_date->DayInYear())) {
377  break;
378  }
379  }
380  d1 = g_date->Date() + 10;
381  if (d1 < g_date->OldDays() + g_date->DayInYear(15, 4)) {
382  d1 = g_date->OldDays() + g_date->DayInYear(15, 4);
383  }
385  break;
386  case de_wb_ferti_p4:
387  if (m_ev->m_lock || m_farm->DoIt_prob(0.60))
388  {
389  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear())) {
391  break;
392  }
393  }
395  break;
396  case de_wb_ferti_s4:
397  if (m_ev->m_lock || m_farm->DoIt_prob(0.60))
398  {
399  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(20, 5) - g_date->DayInYear())) {
401  break;
402  }
403  }
405  break;
406  case de_wb_harvest:
407  // We don't move harvest days
408  if (!m_farm->Harvest(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
410  break;
411  }
412  // 90% of farmers will leave straw on field and rest will do hay bailing
413  if (m_farm->DoIt_prob(0.90))
414  {
416  }
417  else
418  {
420  }
421  break;
423  if (!m_farm->StrawChopping(m_field, 0.0, m_field->GetMDates(1, 1) - g_date->DayInYear())) {
425  break;
426  }
427  d1 = g_date->Date();
428  if (d1 < g_date->OldDays() + g_date->DayInYear(2, 7)) {
429  d1 = g_date->OldDays() + g_date->DayInYear(2, 7);
430  }
431  SimpleEvent_(d1, de_wb_wait, false, m_farm, m_field);
432  break;
433  case de_wb_hay_bailing:
434  if (!m_farm->HayBailing(m_field, 0.0, m_field->GetMDates(1, 2) - g_date->DayInYear())) {
436  break;
437  }
438  d1 = g_date->Date();
439  if (d1 < g_date->OldDays() + g_date->DayInYear(2, 7)) {
440  d1 = g_date->OldDays() + g_date->DayInYear(2, 7);
441  }
442  SimpleEvent_(d1, de_wb_wait, false, m_farm, m_field);
443  break;
444  case de_wb_wait:
445  done = true;
446  break;
447  // So we are done, and somwhere else the farmer will queue up the start event of the next crop
448  // END of MAIN THREAD
449  break;
450  default:
451  g_msg->Warn(WARN_BUG, "DE_WinterBarley::Do(): "
452  "Unknown event type! ", "");
453  exit(1);
454  }
455  return done;
456 }

References Farm::AutumnPlough(), Farm::AutumnRoll(), Farm::AutumnSow(), cfg_pest_product_amounts, cfg_pest_winterbarley_on, LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), de_wb_autumn_harrow_notill, de_wb_autumn_plough, de_wb_autumn_roll, de_wb_autumn_sow, DE_WB_DECIDE_TO_GR, de_wb_ferti_p1, de_wb_ferti_p2, de_wb_ferti_p3, de_wb_ferti_p4, de_wb_ferti_s1, de_wb_ferti_s2, de_wb_ferti_s3, de_wb_ferti_s4, de_wb_fungicide1, de_wb_fungicide2, de_wb_fungicide3, de_wb_growth_regulator1, de_wb_growth_regulator2, de_wb_harvest, de_wb_hay_bailing, de_wb_herbicide1, de_wb_herbicide2, de_wb_insecticide1, de_wb_insecticide2, DE_WB_NOTILL, de_wb_start, de_wb_straw_chopping, de_wb_wait, 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::StartUpCrop(), Farm::StrawChopping(), Landscape::SupplyPestIncidenceFactor(), tov_DEWinterBarley, CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), and WARN_BUG.

◆ SetUpFarmCategoryInformation()

void DE_WinterBarley::SetUpFarmCategoryInformation ( )
inline
116  {
117  const int elements = 2 + (de_wb_foobar - DE_WINTERBARLEY_BASE);
119 
120  FarmManagementCategory catlist[elements] =
121  {
122  fmc_Others, // zero element unused but must be here
123  // ALL THE NECESSARY ENTRIES HERE
124  fmc_Others, // de_wb_start = 1, // Compulsory, must always be 1 (one).
125  fmc_Others, // de_wb_sleep_all_day,
126  fmc_Cultivation, // de_wb_autumn_plough,
127  fmc_Cultivation, // de_wb_autumn_roll,
128  fmc_Cultivation, // de_wb_autumn_harrow_notill,
129  fmc_Cultivation, // de_wb_autumn_sow,
130  fmc_Fertilizer, // de_wb_ferti_s1, // PK
131  fmc_Fertilizer, // de_wb_ferti_p1, // PK
132  fmc_Fertilizer, // de_wb_ferti_s2,
133  fmc_Fertilizer, // de_wb_ferti_p2,
134  fmc_Fertilizer, // de_wb_ferti_s3,
135  fmc_Fertilizer, // de_wb_ferti_p3,
136  fmc_Fertilizer, // de_wb_ferti_s4,
137  fmc_Fertilizer, // de_wb_ferti_p4,
138  fmc_Herbicide, // de_wb_herbicide1,
139  fmc_Herbicide, // de_wb_herbicide2,
140  fmc_Insecticide, // de_wb_insecticide1,
141  fmc_Insecticide, // de_wb_insecticide2,
142  fmc_Fungicide, // de_wb_fungicide1,
143  fmc_Fungicide, // de_wb_fungicide2,
144  fmc_Fungicide, // de_wb_fungicide3,
145  fmc_Others, // de_wb_growth_regulator1,
146  fmc_Others, // de_wb_growth_regulator2,
147  fmc_Harvest, // de_wb_harvest,
148  fmc_Others, // de_wb_straw_chopping,
149  fmc_Others, // de_wb_hay_bailing,
150  fmc_Others, // de_wb_wait,
151  // no foobar entry
152 
153  };
154  // Iterate over the catlist elements and copy them to vector
155  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
156 
157  }

References de_wb_foobar, DE_WINTERBARLEY_BASE, 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_WinterBarley().


The documentation for this class was generated from the following files:
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
de_wb_hay_bailing
Definition: DE_WinterBarley.h:88
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
de_wb_herbicide1
Definition: DE_WinterBarley.h:77
Farm::HerbicideTreat
virtual bool HerbicideTreat(LE *a_field, double a_user, int a_days)
Apply herbicide to a_field.
Definition: FarmFuncs.cpp:2025
DE_WB_DECIDE_TO_GR
#define DE_WB_DECIDE_TO_GR
Definition: DE_WinterBarley.h:56
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
de_wb_fungicide3
Definition: DE_WinterBarley.h:83
DE_WinterBarley::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: DE_WinterBarley.h:116
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_wb_autumn_sow
Definition: DE_WinterBarley.h:68
de_wb_autumn_harrow_notill
Definition: DE_WinterBarley.h:67
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
tov_DEWinterBarley
Definition: LandscapeFarmingEnums.h:507
DE_WB_NOTILL
#define DE_WB_NOTILL
A flag used to indicate autumn ploughing status.
Definition: DE_WinterBarley.h:55
de_wb_straw_chopping
Definition: DE_WinterBarley.h:87
g_landscape_ptr
Landscape * g_landscape_ptr
Definition: Landscape.cpp:352
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
cfg_pest_winterbarley_on
CfgBool cfg_pest_winterbarley_on
Turn on pesticides for winter barley.
de_wb_ferti_p4
Definition: DE_WinterBarley.h:76
de_wb_growth_regulator1
Definition: DE_WinterBarley.h:84
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
de_wb_ferti_p1
Definition: DE_WinterBarley.h:70
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
de_wb_growth_regulator2
Definition: DE_WinterBarley.h:85
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
CfgBool::value
bool value() const
Definition: Configurator.h:164
de_wb_ferti_s3
Definition: DE_WinterBarley.h:73
de_wb_start
Definition: DE_WinterBarley.h:63
de_wb_insecticide2
Definition: DE_WinterBarley.h:80
de_wb_fungicide1
Definition: DE_WinterBarley.h:81
de_wb_foobar
Definition: DE_WinterBarley.h:90
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
de_wb_harvest
Definition: DE_WinterBarley.h:86
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
de_wb_autumn_plough
Definition: DE_WinterBarley.h:65
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
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
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_wb_wait
Definition: DE_WinterBarley.h:89
Landscape::SupplyPestIncidenceFactor
double SupplyPestIncidenceFactor()
Returns Landscape::m_pestincidencefactor.
Definition: Landscape.h:325
de_wb_fungicide2
Definition: DE_WinterBarley.h:82
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
de_wb_ferti_s4
Definition: DE_WinterBarley.h:75
CfgArray_Double::value
std::vector< double > value() const
Definition: Configurator.h:219
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::AutumnRoll
virtual bool AutumnRoll(LE *a_field, double a_user, int a_days)
Carry out a roll event in the autumn on a_field.
Definition: FarmFuncs.cpp:299
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_wb_ferti_s2
Definition: DE_WinterBarley.h:71
de_wb_herbicide2
Definition: DE_WinterBarley.h:78
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
de_wb_ferti_s1
Definition: DE_WinterBarley.h:69
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
de_wb_ferti_p3
Definition: DE_WinterBarley.h:74
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
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.
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
de_wb_ferti_p2
Definition: DE_WinterBarley.h:72
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
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
de_wb_insecticide1
Definition: DE_WinterBarley.h:79
de_wb_autumn_roll
Definition: DE_WinterBarley.h:66
DE_WINTERBARLEY_BASE
#define DE_WINTERBARLEY_BASE
Definition: DE_WinterBarley.h:51
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
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