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

#include <DK_SpringBarley.h>

Inheritance diagram for DK_SpringBarley:
Crop

Public Member Functions

bool Do (Farm *a_farm, LE *a_field, FarmEvent *a_ev)
 
 DK_SpringBarley (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...
 

Constructor & Destructor Documentation

◆ DK_SpringBarley()

DK_SpringBarley::DK_SpringBarley ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
73  : Crop(a_tov, a_toc, a_L)
74  {
75  m_first_date = g_date->DayInYear(1, 12);
77  }

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

Member Function Documentation

◆ Do()

bool DK_SpringBarley::Do ( Farm a_farm,
LE a_field,
FarmEvent a_ev 
)
virtual

Reimplemented from Crop.

42 {
43  m_farm = a_farm;
44  m_field = a_field;
45  m_ev = a_ev;
46  bool done = false; // The boolean value done indicates when we are totally finished with this plan (i.e. it is set to true, m_farm, m_field).
47  bool flag = false;
48  int d1 = 0;
49  int noDates = 1;
51  int l_nextcropstartdate;
52 
53  switch (m_ev->m_todo)
54  {
55  case dk_sb_start:
56  {
57  a_field->ClearManagementActionSum();
58  DK_SB_FORCESPRING = false;
59  DK_SB_TILL_C = false; // 85% of all on clay soil do till
60  DK_SB_TILL_S = false; // 85% of all on sandy soil do till
61  m_last_date = g_date->DayInYear(25, 8); // Should match the last flexdate below
62  //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
63  std::vector<std::vector<int>> flexdates(3 + 1, std::vector<int>(2, 0));
64  // Set up the date management stuff
65  // Start and stop dates for all events after harvest
66  flexdates[0][1] = g_date->DayInYear(1, 8); // last possible day of harvest - this is in effect day before the earliest date that a following crop can use
67  // Now these are done in pairs, start & end for each operation. If its not used then -1
68  flexdates[1][0] = -1; // This date will be moved back as far as necessary and potentially to flexdates 1 (start op 1)
69  flexdates[1][1] = g_date->DayInYear(24, 8); // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 1)
70  flexdates[2][0] = -1; // This date will be moved back as far as necessary and potentially to flexdates 1 (start op 2)
71  flexdates[2][1] = g_date->DayInYear(25, 8); // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 2)
72  flexdates[3][0] = g_date->DayInYear(2, 8); // This date will be moved back as far as necessary and potentially to flexdates 1 (start op 3)
73  flexdates[3][1] = g_date->DayInYear(25, 8); // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 3) // tweaked to fit rot (prev. 1/9)
74 
75  // 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
76  int isSpring = 0;
77  if (StartUpCrop(isSpring, flexdates, int(dk_sb_spring_plough))) break;
78 
79  // End single block date checking code. Please see next line comment as well.
80  // Reinit d1 to first possible starting date.
81  d1 = g_date->OldDays() + g_date->DayInYear(1, 9);
82  // OK, let's go.
83  // Here we queue up the first event which changes dependent on whether it is a forced spring sow or not
84  if (m_ev->m_forcespring) {
85  int day_num_shift = 365;
86  if (g_date->DayInYear() < 70) day_num_shift = 0;
87  if (a_farm->IsStockFarmer()) //Stock Farmer
88  {
89  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3) + day_num_shift, dk_sb_ferti_s1, false);
90  break;
91  }
92  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3) + day_num_shift, dk_sb_ferti_p1, false);
93  DK_SB_FORCESPRING = true;
94  break;
95  }
96  else SimpleEvent(d1, dk_sb_wait, false);
97  break;
98  }
99  break;
100  case dk_sb_wait:
101  if (!m_farm->SleepAllDay(m_field, 0.0, g_date->DayInYear(1, 11) - g_date->DayInYear())) {
102  SimpleEvent(g_date->Date() + 1, dk_sb_wait, true);
103  break;
104  }
106  break;
107 
108  // done if many weeds, or waste plants from earlier catch crops
109  case dk_sb_autumn_plough:
110  if (m_field->GetSoilType() != tos_Sand && m_field->GetSoilType() != tos_LoamySand && m_field->GetSoilType() != tos_SandyLoam && m_field->GetSoilType() != tos_SandyClayLoam) // on clay soils (NL KLEI & VEEN)
111  {
112  if (m_ev->m_lock || m_farm->DoIt_prob(0.85)) {
113  if (!m_farm->AutumnPlough(m_field, 0.0, g_date->DayInYear(1, 11) - g_date->DayInYear())) {
115  break;
116  }
117  DK_SB_TILL_C = true; // need to remember who did till
118  }
119  }
120  if (a_farm->IsStockFarmer()) //Stock Farmer
121  {
122  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, dk_sb_ferti_s1, false);
123  break;
124  }
125  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, dk_sb_ferti_p1, false);
126  break;
127 
128  case dk_sb_ferti_s1:
129  if (m_ev->m_lock || m_farm->DoIt_prob(0.50)) {
130  if (!m_farm->FA_Slurry(m_field, 0.0,
131  g_date->DayInYear(15, 4) - g_date->DayInYear())) {
132  SimpleEvent(g_date->Date() + 1, dk_sb_ferti_s1, true);
133  break;
134  }
135  }
136  SimpleEvent(g_date->Date() + 1, dk_sb_ferti_s2, false);
137  break;
138 
139  case dk_sb_ferti_p1:
140  if (m_ev->m_lock || m_farm->DoIt_prob(0.50)) {
141  if (!m_farm->FP_Slurry(m_field, 0.0,
142  g_date->DayInYear(15, 4) - g_date->DayInYear())) {
143  SimpleEvent(g_date->Date() + 1, dk_sb_ferti_p1, true);
144  break;
145  }
146  }
147  SimpleEvent(g_date->Date() + 1, dk_sb_ferti_p2, false);
148  break;
149 
150  case dk_sb_ferti_s2:
151  if (!m_farm->FA_NPKS(m_field, 0.0,
152  g_date->DayInYear(16, 4) - g_date->DayInYear())) {
153  SimpleEvent(g_date->Date() + 1, dk_sb_ferti_s2, true);
154  break;
155  }
156  SimpleEvent(g_date->Date() + 1, dk_sb_spring_plough, false);
157  break;
158 
159  case dk_sb_ferti_p2:
160  if (!m_farm->FP_NPKS(m_field, 0.0,
161  g_date->DayInYear(16, 4) - g_date->DayInYear())) {
162  SimpleEvent(g_date->Date() + 1, dk_sb_ferti_p2, true);
163  break;
164  }
165  SimpleEvent(g_date->Date() + 1, dk_sb_spring_plough, false);
166  break;
167 
168  case dk_sb_spring_plough:
169  if (m_field->GetSoilType() == tos_Sand || m_field->GetSoilType() == tos_LoamySand || m_field->GetSoilType() == tos_SandyLoam || m_field->GetSoilType() == tos_SandyClayLoam) // on sandy soils (NL ZAND & LOSS)
170  {
171  if (m_ev->m_lock || m_farm->DoIt_prob(0.85)) {
172  if (!m_farm->SpringPlough(m_field, 0.0,
173  g_date->DayInYear(20, 4) - g_date->DayInYear())) {
175  break;
176  }
177  DK_SB_TILL_S = true; // need to remember who did till
179  break;
180  }
182  break;
183  }
184  else if (DK_SB_TILL_C == false) {
186  break;
187  }
188  else SimpleEvent(g_date->Date(), dk_sb_spring_sow, false);
189  break;
190 
191 
192  case dk_sb_spring_harrow_nt: // 80% of the 15% of clay and 15% of sandy soils that do no till (nt) harrows before sowing
193  if (m_ev->m_lock || m_farm->DoIt_prob(0.80)) {
194  if (!m_farm->SpringHarrow(m_field, 0.0,
195  g_date->DayInYear(20, 4) - g_date->DayInYear())) {
197  break;
198  }
199  }
201  break;
202 
203  case dk_sb_spring_sow:
204  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
206  g_date->DayInYear(30, 4) - g_date->DayInYear())) {
207  SimpleEvent(g_date->Date() + 1, dk_sb_spring_sow, true);
208  break;
209  }
210  }
211  SimpleEvent(g_date->Date() + 1, dk_sb_herbicide1, false); // herbi thread
212  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5), dk_sb_fungicide1, false); // fungi thread
213  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5), dk_sb_gr1, false); // growth regulator thread
214  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6) + m_date_modifier, dk_sb_insecticide, false); // insecti thread
215  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 7), dk_sb_water1, false); // water thread
216  SimpleEvent(g_date->OldDays() + g_date->DayInYear(7, 7), dk_sb_herbicide4, false); // main thread
217  break;
218 
219  case dk_sb_herbicide1: // if sown layout of grass together with the barley
220  if (m_ev->m_lock || m_farm->DoIt_prob(0.10)) {
221  if (!m_farm->HerbicideTreat(m_field, 0.0,
222  g_date->DayInYear(5, 5) - g_date->DayInYear())) {
223  SimpleEvent(g_date->Date() + 1, dk_sb_herbicide1, true);
224  break;
225  }
226  }
227  SimpleEvent(g_date->Date() + 14, dk_sb_herbicide2, false);
228  break;
229 
230  case dk_sb_herbicide2:
231  if (m_ev->m_lock || m_farm->DoIt_prob(1.0)) {
232  if (!m_farm->HerbicideTreat(m_field, 0.0,
233  g_date->DayInYear(20, 5) - g_date->DayInYear())) {
234  SimpleEvent(g_date->Date() + 1, dk_sb_herbicide2, true);
235  break;
236  }
237  }
238  SimpleEvent(g_date->Date() + 14, dk_sb_herbicide3, false);
239  break;
240 
241  case dk_sb_herbicide3:
242  if (m_ev->m_lock || m_farm->DoIt_prob(0.15)) {
243  if (!m_farm->HerbicideTreat(m_field, 0.0,
244  g_date->DayInYear(5, 6) - g_date->DayInYear())) {
245  SimpleEvent(g_date->Date() + 1, dk_sb_herbicide3, true);
246  break;
247  }
248  }
249  break; // end of thread
250 
251  case dk_sb_fungicide1:
252  if (m_ev->m_lock || m_farm->DoIt_prob(0.95)) {
253  if (!m_farm->FungicideTreat(m_field, 0.0,
254  g_date->DayInYear(31, 5) - g_date->DayInYear())) {
255  SimpleEvent(g_date->Date() + 1, dk_sb_fungicide1, true);
256  break;
257  }
258  }
259  SimpleEvent(g_date->Date()+14, dk_sb_fungicide2, false);
260  break;
261 
262  case dk_sb_fungicide2:
263  if (m_ev->m_lock || m_farm->DoIt_prob(0.20)) {
264  if (!m_farm->FungicideTreat(m_field, 0.0,
265  g_date->DayInYear(15, 6) - g_date->DayInYear())) {
266  SimpleEvent(g_date->Date() + 1, dk_sb_fungicide2, true);
267  break;
268  }
269  }
270  break; // end of thread
271 
272  case dk_sb_gr1:
273  if (m_ev->m_lock || m_farm->DoIt_prob(0.25)) {
274  if (!m_farm->GrowthRegulator(m_field, 0.0,
275  g_date->DayInYear(31, 5) - g_date->DayInYear())) {
276  SimpleEvent(g_date->Date() + 1, dk_sb_gr1, true);
277  break;
278  }
279  break; // end of thread
280  }
281  SimpleEvent(g_date->Date() + 30, dk_sb_gr2, false);
282  break;
283 
284  case dk_sb_gr2:
285  if (m_ev->m_lock || m_farm->DoIt_prob(0.30/0.75)) {
286  if (!m_farm->GrowthRegulator(m_field, 0.0,
287  g_date->DayInYear(30, 6) - g_date->DayInYear())) {
288  SimpleEvent(g_date->Date() + 1, dk_sb_gr2, true);
289  break;
290  }
291  }
292  break; // end of thread
293 
294  case dk_sb_insecticide:
295  if (m_ev->m_lock || m_farm->DoIt_prob(0.40) || AphidDamage(m_field)) {
296  // here we check whether we are using ERA pesticide or not
297  d1 = g_date->DayInYear(31, 7) - g_date->DayInYear();
298  if (!cfg_pest_springbarley_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
299  {
300  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
301  }
302  else {
304  }
305  if (!flag) {
306  SimpleEvent(g_date->Date() + 1, dk_sb_insecticide, true);
307  break;
308  }
309  }
310  break; // end of thread
311 
312  case dk_sb_water1:
313  if (m_field->GetSoilType() == tos_Sand || m_field->GetSoilType() == tos_LoamySand || m_field->GetSoilType() == tos_SandyLoam || m_field->GetSoilType() == tos_SandyClayLoam) // on sandy soils (NL ZAND & LOSS)
314  {
315  if (m_ev->m_lock || m_farm->DoIt_prob(0.80)) {
316  if (!m_farm->Water(m_field, 0.0,
317  g_date->DayInYear(10, 7) - g_date->DayInYear())) {
318  SimpleEvent(g_date->Date() + 1, dk_sb_water1, true);
319  break;
320  }
321  SimpleEvent(g_date->Date()+14, dk_sb_water2, false);
322  break;
323  }
324  }
325  break; // end of thread
326 
327  case dk_sb_water2:
328  if (!m_farm->Water(m_field, 0.0,
329  g_date->DayInYear(31, 7) - g_date->DayInYear())) {
330  SimpleEvent(g_date->Date() + 1, dk_sb_water2, true);
331  break;
332  }
333  break; // end of thread
334 
335  case dk_sb_herbicide4:
336  if (m_ev->m_lock || m_farm->DoIt_prob(0.30)) {
337  if (!m_farm->HerbicideTreat(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
338  SimpleEvent(g_date->Date() + 1, dk_sb_herbicide4, true);
339  break;
340  }
341  d1 = g_date->Date() + 14;
342  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 8)) d1 = g_date->OldDays() + g_date->DayInYear(1, 8);
343  SimpleEvent(d1, dk_sb_harvest, false);
344  break;
345  }
346  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 8), dk_sb_harvest, false);
347  break;
348 
349  case dk_sb_harvest:
350  if (!m_farm->Harvest(m_field, 0.0, m_field->GetMDates(1, 1) - g_date->DayInYear())) {
351  SimpleEvent(g_date->Date() + 1, dk_sb_harvest, true);
352  break;
353  }
355  break;
356 
358  if (m_ev->m_lock || m_farm->DoIt_prob(0.25)) {
359  if (!m_farm->StrawChopping(m_field, 0.0, m_field->GetMDates(1, 2) - g_date->DayInYear())) {
361  break;
362  }
363  done = true;
364  break;
365  }
366  else if (m_ev->m_lock || m_farm->DoIt_prob(0.75 / 0.75)) {
367  SimpleEvent(g_date->Date() + 1, dk_sb_hay_bailing, false);
368  break;
369  }
370 
371  case dk_sb_hay_bailing:
372  if (!m_farm->HayBailing(m_field, 0.0, m_field->GetMDates(1, 3) - g_date->DayInYear())) {
373  SimpleEvent(g_date->Date() + 1, dk_sb_hay_bailing, true);
374  break;
375  }
376  done = true;
377  break;
378 
379  default:
380  g_msg->Warn(WARN_BUG, "DK_SpringBarley::Do(): "
381  "Unknown event type! ", "");
382  exit(1);
383  }
384  return done;
385 }

References Crop::AphidDamage(), Farm::AutumnPlough(), cfg_pest_product_amounts, cfg_pest_springbarley_on, LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), dk_sb_autumn_plough, dk_sb_ferti_p1, dk_sb_ferti_p2, dk_sb_ferti_s1, dk_sb_ferti_s2, DK_SB_FORCESPRING, dk_sb_fungicide1, dk_sb_fungicide2, dk_sb_gr1, dk_sb_gr2, dk_sb_harvest, dk_sb_hay_bailing, dk_sb_herbicide1, dk_sb_herbicide2, dk_sb_herbicide3, dk_sb_herbicide4, dk_sb_insecticide, dk_sb_spring_harrow_nt, dk_sb_spring_plough, dk_sb_spring_sow, dk_sb_start, dk_sb_straw_chopping, DK_SB_TILL_C, DK_SB_TILL_S, dk_sb_wait, dk_sb_water1, dk_sb_water2, Farm::DoIt_prob(), Farm::FA_NPKS(), Farm::FA_Slurry(), Farm::FP_NPKS(), Farm::FP_Slurry(), Farm::FungicideTreat(), g_date, g_msg, LE::GetMDates(), LE::GetSoilType(), 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, FarmEvent::m_forcespring, Crop::m_last_date, FarmEvent::m_lock, FarmEvent::m_todo, Calendar::OldDays(), ppp_1, Farm::PreseedingCultivatorSow(), Farm::ProductApplication(), Crop::SimpleEvent(), Farm::SleepAllDay(), Farm::SpringHarrow(), Farm::SpringPlough(), Crop::StartUpCrop(), Farm::StrawChopping(), tos_LoamySand, tos_Sand, tos_SandyClayLoam, tos_SandyLoam, tov_DKSpringBarley, CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), WARN_BUG, and Farm::Water().

◆ SetUpFarmCategoryInformation()

void DK_SpringBarley::SetUpFarmCategoryInformation ( )
inline
78  {
79  const int elements = 2 + (dk_sb_foobar - DK_SBM_BASE);
81 
82  FarmManagementCategory catlist[elements] =
83  {
84  fmc_Others, // zero element unused but must be here
85  fmc_Others, // dk_sb_start = 1, // Compulsory, start event must always be 1 (one).
86  fmc_Harvest, // dk_sb_harvest = DK_SBM_BASE,
87  fmc_Cultivation, // dk_sb_autumn_plough,
88  fmc_Fertilizer, // dk_sb_ferti_s1,
89  fmc_Fertilizer, // dk_sb_ferti_p1,
90  fmc_Fertilizer, // dk_sb_ferti_s2,
91  fmc_Fertilizer, // dk_sb_ferti_p2,
92  fmc_Cultivation, // dk_sb_spring_plough,
93  fmc_Cultivation, // dk_sb_spring_harrow_nt,
94  fmc_Cultivation, // dk_sb_spring_sow,
95  fmc_Herbicide, // dk_sb_herbicide1,
96  fmc_Herbicide, // dk_sb_herbicide2,
97  fmc_Herbicide, // dk_sb_herbicide3,
98  fmc_Herbicide, // dk_sb_herbicide4,
99  fmc_Insecticide, // dk_sb_insecticide,
100  fmc_Watering, // dk_sb_water1,
101  fmc_Watering, // dk_sb_water2,
102  fmc_Fungicide, // dk_sb_fungicide1,
103  fmc_Fungicide, // dk_sb_fungicide2,
104  fmc_Others, // dk_sb_gr1,
105  fmc_Others, // dk_sb_gr2,
106  fmc_Others, // dk_sb_straw_chopping,
107  fmc_Others, // dk_sb_hay_bailing,
108  fmc_Cultivation, // dk_sb_stubble_harrow,
109  fmc_Cultivation, // dk_sb_plough,
110  fmc_Others, // dk_sb_wait
111 
112  // no foobar entry
113 
114  };
115  // Iterate over the catlist elements and copy them to vector
116  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
117  }

References dk_sb_foobar, DK_SBM_BASE, fmc_Cultivation, fmc_Fertilizer, fmc_Fungicide, fmc_Harvest, fmc_Herbicide, fmc_Insecticide, fmc_Others, fmc_Watering, Crop::m_base_elements_no, and Crop::m_ManagementCategories.

Referenced by DK_SpringBarley().


The documentation for this class was generated from the following files:
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
FarmEvent::m_forcespring
bool m_forcespring
Definition: Farm.h:392
Farm::FA_Slurry
virtual bool FA_Slurry(LE *a_field, double a_user, int a_days)
Spready slurry on a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1067
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
Farm::SpringPlough
virtual bool SpringPlough(LE *a_field, double a_user, int a_days)
Carry out a ploughing event in the spring on a_field.
Definition: FarmFuncs.cpp:421
Farm::HerbicideTreat
virtual bool HerbicideTreat(LE *a_field, double a_user, int a_days)
Apply herbicide to a_field.
Definition: FarmFuncs.cpp:2025
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
DK_SB_FORCESPRING
#define DK_SB_FORCESPRING
Definition: DK_SpringBarley.h:33
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
dk_sb_hay_bailing
Definition: DK_SpringBarley.h:60
LE::ClearManagementActionSum
void ClearManagementActionSum()
clears the management action counters
Definition: Elements.h:247
dk_sb_ferti_s1
Definition: DK_SpringBarley.h:41
tos_SandyClayLoam
Definition: LandscapeFarmingEnums.h:722
Farm::DoIt_prob
bool DoIt_prob(double a_probability)
Return chance out of 0 to 1.
Definition: Farm.cpp:864
dk_sb_insecticide
Definition: DK_SpringBarley.h:52
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.
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
dk_sb_herbicide4
Definition: DK_SpringBarley.h:51
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
tos_SandyLoam
Definition: LandscapeFarmingEnums.h:721
Farm::FA_NPKS
virtual bool FA_NPKS(LE *a_field, double a_user, int a_days)
Apply NPKS fertilizer, on a_field owned by a stock farmer.
Definition: FarmFuncs.cpp:968
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
dk_sb_gr2
Definition: DK_SpringBarley.h:58
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
dk_sb_spring_plough
Definition: DK_SpringBarley.h:45
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
dk_sb_fungicide1
Definition: DK_SpringBarley.h:55
DK_SBM_BASE
#define DK_SBM_BASE
Definition: DK_SpringBarley.h:31
dk_sb_water1
Definition: DK_SpringBarley.h:53
tov_DKSpringBarley
Definition: LandscapeFarmingEnums.h:361
dk_sb_gr1
Definition: DK_SpringBarley.h:57
dk_sb_wait
Definition: DK_SpringBarley.h:63
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
dk_sb_fungicide2
Definition: DK_SpringBarley.h:56
dk_sb_water2
Definition: DK_SpringBarley.h:54
Calendar::Date
long Date(void)
Definition: Calendar.h:57
dk_sb_spring_harrow_nt
Definition: DK_SpringBarley.h:46
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
LE::GetSoilType
int GetSoilType()
Definition: Elements.h:302
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
dk_sb_foobar
Definition: DK_SpringBarley.h:64
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
fmc_Watering
Definition: LandscapeFarmingEnums.h:1011
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
cfg_pest_springbarley_on
CfgBool cfg_pest_springbarley_on
Turn on pesticides for spring barley.
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
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
tos_Sand
Definition: LandscapeFarmingEnums.h:719
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
dk_sb_harvest
Definition: DK_SpringBarley.h:39
Farm::SleepAllDay
virtual bool SleepAllDay(LE *a_field, double a_user, int a_days)
Nothing to to today on a_field.
Definition: FarmFuncs.cpp:272
dk_sb_start
Definition: DK_SpringBarley.h:38
dk_sb_herbicide2
Definition: DK_SpringBarley.h:49
dk_sb_straw_chopping
Definition: DK_SpringBarley.h:59
Farm::Water
virtual bool Water(LE *a_field, double a_user, int a_days)
Carry out a watering on a_field.
Definition: FarmFuncs.cpp:1330
dk_sb_ferti_p2
Definition: DK_SpringBarley.h:44
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
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
dk_sb_spring_sow
Definition: DK_SpringBarley.h:47
DK_SB_TILL_S
#define DK_SB_TILL_S
Definition: DK_SpringBarley.h:35
dk_sb_herbicide3
Definition: DK_SpringBarley.h:50
Crop::m_date_modifier
static int m_date_modifier
Holds a value that shifts test pesticide use by this many days in crops modified to use it.
Definition: Farm.h:514
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
DK_SpringBarley::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: DK_SpringBarley.h:78
DK_SB_TILL_C
#define DK_SB_TILL_C
Definition: DK_SpringBarley.h:34
Farm::GrowthRegulator
virtual bool GrowthRegulator(LE *a_field, double a_user, int a_days)
Apply growth regulator to a_field.
Definition: FarmFuncs.cpp:2070
dk_sb_autumn_plough
Definition: DK_SpringBarley.h:40
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
Crop::AphidDamage
bool AphidDamage(LE *a_field)
Compares aphid numbers per m2 with a threshold to return true if threshold is exceeded.
Definition: Farm.cpp:726
dk_sb_ferti_p1
Definition: DK_SpringBarley.h:42
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
tos_LoamySand
Definition: LandscapeFarmingEnums.h:720
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
dk_sb_herbicide1
Definition: DK_SpringBarley.h:48
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
Farm::SpringHarrow
virtual bool SpringHarrow(LE *a_field, double a_user, int a_days)
Carry out a harrow event in the spring on a_field.
Definition: FarmFuncs.cpp:459
dk_sb_ferti_s2
Definition: DK_SpringBarley.h:43
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