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

UKWinterBarley class
. More...

#include <UKWinterBarley.h>

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

UKWinterBarley class
.

See UKWinterBarley.h::UKWinterBarleyToDo for a complete list of all possible events triggered codes by the winter barley 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

◆ UKWinterBarley()

UKWinterBarley::UKWinterBarley ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
72  : Crop(a_tov, a_toc, a_L)
73  {
74  // When we start it off, the first possible date for a farm operation 1/9
75  // This information is used by other crops when they decide how much post processing of
76  // the management is allowed after harvest before the next crop starts.
77  m_first_date = g_date->DayInYear(20, 9);
79  }

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

Member Function Documentation

◆ Do()

bool UKWinterBarley::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 barley.

Reimplemented from Crop.

66 {
67  /******************** This block can be added to the top of all Crop::Do methods ***********************************************/
68  m_farm = a_farm; // These assignments are necessary, not for this method but for related event calls
69  m_field = a_field;
70  m_ev = a_ev;
71  bool done = false; // The boolean value done indicates when we are totally finished with this plan (i.e. it is set to true).
72  int d1 = 0;
73  int noDates = 1;
74  TTypesOfVegetation l_tov = tov_UKWinterBarley; // The current type - change to match the crop you have
75 /**********************************************To Here *************************************************************************/
76 
77  // Depending what event has occured jump to the correct bit of code
78  switch (m_ev->m_todo)
79  {
80  case uk_wb_start:
81  {
82  // uk_wb_start just sets up all the starting conditions and reference dates that are needed to start a uk_wb
83  UK_WB_FUNGII = false;
85 
86  // Set up the date management stuff
87  // The next bit of code just allows for altering dates after harvest if it is necessary
88  // to allow for a crop which starts its management early.
89 
90  // 5 start and stop dates for all 'movable' events for this crop
91  int noDates = 2;
92  m_field->SetMDates(0, 0, g_date->DayInYear(25, 8)); // last possible day of harvest
93  m_field->SetMDates(1, 0, g_date->DayInYear(30, 8)); // last possible day of straw chopping
94  m_field->SetMDates(0, 1, 0); // start day of hay bailing (not used as it depend on previous treatment)
95  m_field->SetMDates(1, 1, g_date->DayInYear(30, 8)); // end day of hay bailing
96  // Can be up to 10 of these. If the shortening code is triggered
97  // then these will be reduced in value to 0
98 
99  m_field->SetMConstants(0, 1);
100 
101  // Check the next crop for early start, unless it is a winter crop
102  // in which case we ASSUME that no checking is necessary!!!!
103  // So DO NOT implement a crop that runs over the year boundary (i.e. from winter to winter!), at least not without fixing this.
104 
105  //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)
106  //optimising farms not used for now so most of related code is removed (but not in 'start' case)
107  if (!(m_farm->GetType() == tof_OptimisingFarm && g_date->GetYearNumber() > 0)) {
108 
109  if (m_ev->m_startday > g_date->DayInYear(1, 7)) {
110  if (m_field->GetMDates(0, 0) >= m_ev->m_startday)
111  {
112  g_msg->Warn(WARN_BUG, "UKWinterBarley::Do(): ", "Harvest too late for the next crop to start!!!");
113  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
114  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
115  }
116  // Now fix any late finishing problems
117  for (int i = 0; i < noDates; i++) {
118  if (m_field->GetMDates(0, i) >= m_ev->m_startday) {
119  m_field->SetMDates(0, i, m_ev->m_startday - 1); //move the starting date
120  }
121  if (m_field->GetMDates(1, i) >= m_ev->m_startday) {
122  m_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)
123  m_field->SetMDates(1, i, m_ev->m_startday - 1); //move the finishing date
124  }
125  }
126  }
127  // Now no operations can be timed after the start of the next crop.
128 
129  if (!m_ev->m_first_year) {
130  // Are we before July 1st?
131  d1 = g_date->OldDays() + g_date->DayInYear(1, 7);
132  if (g_date->Date() < d1) {
133  // Yes, too early. We assumme this is because the last crop was late
134  printf("Poly: %d\n", m_field->GetPoly());
135  g_msg->Warn(WARN_BUG, "UKWinterBarley::Do(): ", "Crop start attempt between 1st Jan & 1st July");
136  int prev = m_field->GetLandscape()->BackTranslateVegTypes(m_field->GetOwner()->GetPreviousTov(m_field->GetRotIndex()));
137  g_msg->Warn(WARN_BUG, "Previous Crop ", prev);
138  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
139  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
140  exit(1);
141  }
142  else {
143  d1 = g_date->OldDays() + m_first_date; // Add 365 for spring crop
144  if (g_date->Date() > d1) {
145  // Yes too late - should not happen - raise an error
146  g_msg->Warn(WARN_BUG, "UKWinterBarley::Do(): ", "Crop start attempt after last possible start date");
147  int prev = m_field->GetLandscape()->BackTranslateVegTypes(m_field->GetOwner()->GetPreviousTov(m_field->GetRotIndex()));
148  g_msg->Warn(WARN_BUG, "Previous Crop ", prev);
149  int almassnum = m_field->GetLandscape()->BackTranslateVegTypes(m_ev->m_next_tov);
150  g_msg->Warn("Next Crop ", (double)almassnum); // this causes exit
151  exit(1);
152  }
153  }
154  }
155  else {
156  // Is the first year
157  // Some special code to cope with that first start-up year in ALMaSS - ignore for all practical purposes
158  // Code for first spring treatment used
159  if (m_farm->IsStockFarmer()) //Stock Farmer // slurry application
160  {
162  }
164  break;
165  }
166  }//if
167 
168  // End single block date checking code. Please see next line comment as well.
169  // Reinit d1 to first possible starting date.
170  d1 = g_date->OldDays() + g_date->DayInYear(1, 9);
172  }
173  break;
174  // This is the first real farm operation
175 
176  // Stubble cultivator 60% September-October
177  // If stubble cultivate (autumn harrow) then slurry is sometimes applied after which is sometimes ploughed in.
178  // If no stubble cultivate then winter plough instead
179  case uk_wb_autumn_harrow:
180  if (m_ev->m_lock || m_farm->DoIt_prob(0.5))
181  {
182  if (!m_farm->AutumnHarrow(m_field, 0.0, g_date->DayInYear(20, 9) - g_date->DayInYear())) {
184  break;
185  }
186  else
187  {
189  break;
190  }
191  }
193  break;
194 
195  // Autumn plough October-December (all farmers which do not stubble cultivate)
196  case uk_wb_winter_plough:
197  if (!m_farm->AutumnPlough(m_field, 0.0, g_date->DayInYear(5, 10) - g_date->DayInYear())) {
199  break;
200  }
202  break;
203  // Herbicide 1 30% October
204  case uk_wb_herbicide1: // The first of the managements.
205  if (m_ev->m_lock || m_farm->DoIt_prob(0.3))
206  {
207  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(11, 10) - g_date->DayInYear())) {
209  break;
210  }
211  }
213  break;
214  // Preseeding cultivation 100% October
218  break;
219  }
220 
221  // Here is a fork leading to parallel events. Harrowing. Herbicide. Fungicide. Insecticide. Growth Regulator.
222  SimpleEvent_(g_date->Date() + 2, uk_wb_herbicide2, false, m_farm, m_field); // Herbidide thread
223  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 5) + 365, uk_wb_fungicide1, false, m_farm, m_field); // Fungicide thread
224  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(15, 5) + 365, uk_wb_insecticide1, false, m_farm, m_field); // Insecticide thread
225  SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 4) + 365, uk_wb_growth_regulator1, false, m_farm, m_field); // GR thread
226  if (m_farm->IsStockFarmer()) //Stock Farmer // N thread = Main thread
227  {
229  }
230  else SimpleEvent_(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, uk_wb_ferti_p1, false, m_farm, m_field);
231  break;
232 
233  // Fertilser thread
234  // Slurry applications 20%
235  case uk_wb_ferti_p1:
236  if (m_ev->m_lock || m_farm->DoIt_prob(0.20))
237  {
238  if (!m_farm->FP_Slurry(m_field, 0.0, g_date->DayInYear(25, 3) - g_date->DayInYear())) {
240  break;
241  }
242  }
244  break;
245  case uk_wb_ferti_s1:
246  if (m_ev->m_lock || m_farm->DoIt_prob(0.20))
247  {
248  if (!m_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(25, 3) - g_date->DayInYear())) {
250  break;
251  }
252  }
254  break;
255  // N I 100% March
256  case uk_wb_ferti_p2:
257  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(30, 3) - g_date->DayInYear())) {
259  break;
260  }
262  break;
263  case uk_wb_ferti_s2:
266  break;
267  }
269  break;
270  // N II 70%
271  case uk_wb_ferti_p3:
272  if (m_ev->m_lock || m_farm->DoIt_prob(0.7))
273  {
274  if (!m_farm->FP_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
276  break;
277  }
278  }
280  break;
281  case uk_wb_ferti_s3:
282  if (m_ev->m_lock || m_farm->DoIt_prob(0.7))
283  {
284  if (!m_farm->FA_AmmoniumSulphate(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
286  break;
287  }
288  }
290  break;
291  // Herbicide thread
292  case uk_wb_herbicide2:
293  if (m_ev->m_lock || m_farm->DoIt_prob(0.9))
294  {
295  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(10, 11) - g_date->DayInYear())) {
297  break;
298  }
299  }
301  break;
302  case uk_wb_herbicide3:
303  if (m_ev->m_lock || m_farm->DoIt_prob(0.9))
304  {
305  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(24, 11) - g_date->DayInYear())) {
307  break;
308  }
309  }
310  break;
311  // End of thread
312  // Fungicide thread
313  // Fungicide 1
314  case uk_wb_fungicide1:
315  if (m_ev->m_lock || m_farm->DoIt_prob(0.7))
316  {
317  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(30, 5) - g_date->DayInYear())) {
319  break;
320  }
321  }
323  break;
324  // Fungicide 2
325  case uk_wb_fungicide2:
326  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(15, 6) - g_date->DayInYear())) {
328  break;
329  }
330  // End of thread
331  break;
332  // Here comes the insecticide thread
333  case uk_wb_insecticide1:
334  if (m_ev->m_lock || m_farm->DoIt_prob(0.9))
335  {
336  // here we check wheter we are using ERA pesticide or not
338  !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
339  {
340  if (!m_farm->InsecticideTreat(m_field, 0.0, g_date->DayInYear(30, 6) - g_date->DayInYear())) {
342  break;
343  }
344  }
345  else {
347  }
348  }
349  break;
350  // Here comes the GR thread
352  if (!m_farm->GrowthRegulator(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
354  break;
355  }
357  break;
358  // GR II
360  if (m_ev->m_lock || m_farm->DoIt_prob(0.5))
361  {
362  if (!m_farm->GrowthRegulator(m_field, 0.0, g_date->DayInYear(31, 5) - g_date->DayInYear())) {
364  break;
365  }
366  }
367  // End of thread
368  break;
369  // Harvest 100% 20 July-August
370  case uk_wb_harvest:
371  // Here the MAIN thread continues
372  // We don't move harvest days
373  if (!m_farm->Harvest(m_field, 0.0, m_field->GetMDates(0, 0) - g_date->DayInYear())) {
375  break;
376  }
378  break;
379  // Straw chopping 50% after harvest
381  if (m_ev->m_lock || m_farm->DoIt_prob(0.50))
382  {
383  if (m_field->GetMConstants(0) == 0) {
384  if (!m_farm->StrawChopping(m_field, 0.0, -1)) { // raise an error
385  g_msg->Warn(WARN_BUG, "UKWinterBarley::Do(): failure in 'StrawChopping' execution", "");
386  exit(1);
387  }
388  }
389  else {
390  if (!m_farm->StrawChopping(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
392  break;
393  }
394  }
395  done = true;
396  break;
397  }
399  break;
400  // Hay bailing 50% after harvest
401  case uk_wb_hay_bailing:
402  if (m_field->GetMConstants(1) == 0) {
403  if (!m_farm->HayBailing(m_field, 0.0, -1)) { // raise an error
404  g_msg->Warn(WARN_BUG, "UKWinterBarley::Do(): failure in 'HayBailing' execution", "");
405  exit(1);
406  }
407  }
408  else {
409  if (!m_farm->HayBailing(m_field, 0.0, m_field->GetMDates(1, 1) - g_date->DayInYear())) {
411  break;
412  }
413  }
414  done = true;
415  break;
416  default:
417  g_msg->Warn(WARN_BUG, "UKWinterBarley::Do(): "
418  "Unknown event type! ", "");
419  exit(1);
420  }
421  return done;
422 }

References Farm::AutumnHarrow(), Farm::AutumnPlough(), cfg_pest_product_amounts, cfg_pest_winterbarley_on, LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), Farm::DoIt_prob(), Farm::FA_AmmoniumSulphate(), Farm::FA_Slurry(), Farm::FP_AmmoniumSulphate(), Farm::FP_Slurry(), Farm::FungicideTreat(), g_date, g_msg, LE::GetMConstants(), LE::GetMDates(), LE::GetOwner(), LE::GetPoly(), Farm::GetPreviousTov(), LE::GetRotIndex(), Farm::GetType(), Calendar::GetYearNumber(), Farm::GrowthRegulator(), Farm::Harvest(), Farm::HayBailing(), Farm::HerbicideTreat(), Farm::InsecticideTreat(), Farm::IsStockFarmer(), Crop::m_ev, Crop::m_farm, Crop::m_field, Crop::m_first_date, FarmEvent::m_first_year, FarmEvent::m_lock, FarmEvent::m_next_tov, FarmEvent::m_startday, FarmEvent::m_todo, Calendar::OldDays(), ppp_1, Farm::PreseedingCultivatorSow(), Farm::ProductApplication(), LE::SetMConstants(), LE::SetMDates(), Crop::SimpleEvent_(), Farm::StrawChopping(), tof_OptimisingFarm, tov_UKWinterBarley, uk_wb_autumn_harrow, uk_wb_ferti_p1, uk_wb_ferti_p2, uk_wb_ferti_p3, uk_wb_ferti_s1, uk_wb_ferti_s2, uk_wb_ferti_s3, uk_wb_fungicide1, uk_wb_fungicide2, UK_WB_FUNGII, uk_wb_growth_regulator1, uk_wb_growth_regulator2, uk_wb_harvest, uk_wb_hay_bailing, uk_wb_herbicide1, uk_wb_herbicide2, uk_wb_herbicide3, uk_wb_insecticide1, uk_wb_preseeding_cultivator_sow, uk_wb_start, uk_wb_straw_chopping, uk_wb_winter_plough, CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), and WARN_BUG.

◆ SetUpFarmCategoryInformation()

void UKWinterBarley::SetUpFarmCategoryInformation ( )
inline
80  {
81  const int elements = 2 + (uk_wb_foobar - UKWINTERBARLEY_BASE);
83  FarmManagementCategory catlist[elements] =
84  {
85  fmc_Others, // this needs to be at the zero line
86  fmc_Others,//uk_wb_start = 1, // Compulsory, must always be 1 (one).
87  fmc_Others,//uk_wb_sleep_all_day = UKWINTERBARLEY_BASE,
88  fmc_Cultivation,//uk_wb_autumn_harrow,
89  fmc_Cultivation,//uk_wb_winter_plough,
90  fmc_Herbicide,//uk_wb_herbicide1,
91  fmc_Cultivation,//uk_wb_preseeding_cultivator_sow,
92  fmc_Fertilizer,//uk_wb_ferti_s1, // Slurry
93  fmc_Fertilizer,//uk_wb_ferti_p1,
94  fmc_Fertilizer,//uk_wb_ferti_s2, // NI
95  fmc_Fertilizer,//uk_wb_ferti_p2,
96  fmc_Fertilizer,//uk_wb_ferti_s3, // NII
97  fmc_Fertilizer,//uk_wb_ferti_p3,
98  fmc_Herbicide,//uk_wb_herbicide2,
99  fmc_Herbicide,//uk_wb_herbicide3,
100  fmc_Others,//uk_wb_growth_regulator1,
101  fmc_Others,//uk_wb_growth_regulator2,
102  fmc_Fungicide,//uk_wb_fungicide1,
103  fmc_Fungicide,//uk_wb_fungicide2,
104  fmc_Insecticide,//uk_wb_insecticide1,
105  fmc_Harvest,//uk_wb_harvest,
106  fmc_Others,//uk_wb_straw_chopping,
107  fmc_Others,//uk_wb_hay_bailing,
108  };
109  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
110  }

References fmc_Cultivation, fmc_Fertilizer, fmc_Fungicide, fmc_Harvest, fmc_Herbicide, fmc_Insecticide, fmc_Others, Crop::m_base_elements_no, Crop::m_ManagementCategories, uk_wb_foobar, and UKWINTERBARLEY_BASE.

Referenced by UKWinterBarley().


The documentation for this class was generated from the following files:
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
Farm::FA_Slurry
virtual bool FA_Slurry(LE *a_field, double a_user, int a_days)
Spready slurry on a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1067
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
LE::SetMDates
void SetMDates(int a, int b, int c)
Definition: Elements.h:406
Farm::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
uk_wb_ferti_s3
Definition: UKWinterBarley.h:44
uk_wb_harvest
Definition: UKWinterBarley.h:53
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
uk_wb_ferti_s1
Definition: UKWinterBarley.h:40
LE::GetMConstants
int GetMConstants(int a)
Definition: Elements.h:407
LE::ClearManagementActionSum
void ClearManagementActionSum()
clears the management action counters
Definition: Elements.h:247
Calendar::GetYearNumber
int GetYearNumber(void)
Definition: Calendar.h:72
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
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.
uk_wb_foobar
Definition: UKWinterBarley.h:56
LE::GetPoly
int GetPoly(void)
Returns the polyref number for this polygon.
Definition: Elements.h:238
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
Farm::GetPreviousTov
TTypesOfVegetation GetPreviousTov(int a_index)
Definition: Farm.h:966
Farm::GetType
TTypesOfFarm GetType(void)
Definition: Farm.h:956
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
uk_wb_ferti_s2
Definition: UKWinterBarley.h:42
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
FarmEvent::m_startday
int m_startday
Definition: Farm.h:385
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
uk_wb_growth_regulator2
Definition: UKWinterBarley.h:49
CfgBool::value
bool value() const
Definition: Configurator.h:164
uk_wb_winter_plough
Definition: UKWinterBarley.h:37
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
uk_wb_insecticide1
Definition: UKWinterBarley.h:52
uk_wb_preseeding_cultivator_sow
Definition: UKWinterBarley.h:39
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
UKWinterBarley::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: UKWinterBarley.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
cfg_pest_winterbarley_on
CfgBool cfg_pest_winterbarley_on
Turn on pesticides for winter barley.
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
LE::GetRotIndex
int GetRotIndex(void)
Definition: Elements.h:373
FarmEvent::m_next_tov
TTypesOfVegetation m_next_tov
Definition: Farm.h:390
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
uk_wb_hay_bailing
Definition: UKWinterBarley.h:55
Crop::m_field
LE * m_field
Definition: Farm.h:499
uk_wb_ferti_p2
Definition: UKWinterBarley.h:43
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
uk_wb_autumn_harrow
Definition: UKWinterBarley.h:36
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
uk_wb_herbicide1
Definition: UKWinterBarley.h:38
tof_OptimisingFarm
Definition: LandscapeFarmingEnums.h:696
uk_wb_start
Definition: UKWinterBarley.h:34
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
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
UK_WB_FUNGII
#define UK_WB_FUNGII
A flag used to indicate autumn ploughing status.
Definition: UKWinterBarley.h:25
uk_wb_growth_regulator1
Definition: UKWinterBarley.h:48
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
uk_wb_straw_chopping
Definition: UKWinterBarley.h:54
uk_wb_herbicide2
Definition: UKWinterBarley.h:46
uk_wb_fungicide1
Definition: UKWinterBarley.h:50
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
uk_wb_ferti_p3
Definition: UKWinterBarley.h:45
Farm::GrowthRegulator
virtual bool GrowthRegulator(LE *a_field, double a_user, int a_days)
Apply growth regulator to a_field.
Definition: FarmFuncs.cpp:2070
LE::GetOwner
Farm * GetOwner(void)
Definition: Elements.h:256
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
UKWINTERBARLEY_BASE
#define UKWINTERBARLEY_BASE
Definition: UKWinterBarley.h:21
uk_wb_ferti_p1
Definition: UKWinterBarley.h:41
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
uk_wb_herbicide3
Definition: UKWinterBarley.h:47
tov_UKWinterBarley
Definition: LandscapeFarmingEnums.h:285
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
uk_wb_fungicide2
Definition: UKWinterBarley.h:51
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