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

#include <DK_SpringBarley_CC.h>

Inheritance diagram for DK_SpringBarley_CC:
Crop

Public Member Functions

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

DK_SpringBarley_CC::DK_SpringBarley_CC ( 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, 11);
77  }

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

Member Function Documentation

◆ Do()

bool DK_SpringBarley_CC::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_sbcc_start:
56  {
57  a_field->ClearManagementActionSum();
58  DK_SBCC_FORCESPRING = false;
59  DK_SBCC_TILL_C = false; // 85% of all on clay soil do till
60  DK_SBCC_TILL_S = false; // 85% of all on sandy soil do till
61  m_last_date = g_date->DayInYear(1, 9); // 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(2 + 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(31, 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(1, 9); // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 1)
70  flexdates[2][0] = g_date->DayInYear(2, 8); // 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(1, 9); // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 2)
72 
73  // 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
74  int isSpring = 0;
75  if (StartUpCrop(isSpring, flexdates, int(dk_sbcc_spring_plough))) break;
76 
77  // End single block date checking code. Please see next line comment as well.
78  // Reinit d1 to first possible starting date.
79  d1 = g_date->OldDays() + g_date->DayInYear(1, 9);
80  // OK, let's go.
81  // Here we queue up the first event which changes dependent on whether it is a forced spring sow or not
82  if (m_ev->m_forcespring) {
83  int day_num_shift = 365;
84  if (g_date->DayInYear() < 70) day_num_shift = 0;
85 
86  if (a_farm->IsStockFarmer()) //Stock Farmer
87  {
88  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3) + day_num_shift, dk_sbcc_ferti_s1, false);
89  break;
90  }
91  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3) + day_num_shift, dk_sbcc_ferti_p1, false);
92  DK_SBCC_FORCESPRING = true;
93  break;
94  }
95  else SimpleEvent(d1, dk_sbcc_autumn_plough, false);
96  break;
97  }
98  break;
99  // done if many weeds, or waste plants from earlier catch crops
101  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)
102  {
103  if (m_ev->m_lock || m_farm->DoIt_prob(0.85)) {
104  if (!m_farm->AutumnPlough(m_field, 0.0, g_date->DayInYear(1, 11) - g_date->DayInYear())) {
106  break;
107  }
108  DK_SBCC_TILL_C = true; // need to remember who did till
109  }
110  }
111  if (a_farm->IsStockFarmer()) //Stock Farmer
112  {
113  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, dk_sbcc_ferti_s1, false);
114  break;
115  }
116  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3) + 365, dk_sbcc_ferti_p1, false);
117  break;
118 
119  case dk_sbcc_ferti_s1:
120  if (m_ev->m_lock || m_farm->DoIt_prob(0.50)) {
121  if (!m_farm->FA_Slurry(m_field, 0.0,
122  g_date->DayInYear(15, 4) - g_date->DayInYear())) {
123  SimpleEvent(g_date->Date() + 1, dk_sbcc_ferti_s1, true);
124  break;
125  }
126  }
127  SimpleEvent(g_date->Date() + 1, dk_sbcc_ferti_s2, false);
128  break;
129 
130  case dk_sbcc_ferti_p1:
131  if (m_ev->m_lock || m_farm->DoIt_prob(0.50)) {
132  if (!m_farm->FP_Slurry(m_field, 0.0,
133  g_date->DayInYear(15, 4) - g_date->DayInYear())) {
134  SimpleEvent(g_date->Date() + 1, dk_sbcc_ferti_p1, true);
135  break;
136  }
137  }
138  SimpleEvent(g_date->Date() + 1, dk_sbcc_ferti_p2, false);
139  break;
140 
141  case dk_sbcc_ferti_s2:
142  if (!m_farm->FA_NPKS(m_field, 0.0,
143  g_date->DayInYear(16, 4) - g_date->DayInYear())) {
144  SimpleEvent(g_date->Date() + 1, dk_sbcc_ferti_s2, true);
145  break;
146  }
148  break;
149 
150  case dk_sbcc_ferti_p2:
151  if (!m_farm->FP_NPKS(m_field, 0.0,
152  g_date->DayInYear(16, 4) - g_date->DayInYear())) {
153  SimpleEvent(g_date->Date() + 1, dk_sbcc_ferti_p2, true);
154  break;
155  }
157  break;
158 
160  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)
161  {
162  if (m_ev->m_lock || m_farm->DoIt_prob(0.85)) {
163  if (!m_farm->SpringPlough(m_field, 0.0,
164  g_date->DayInYear(20, 4) - g_date->DayInYear())) {
166  break;
167  }
168  DK_SBCC_TILL_S = true; // need to remember who did till
170  break;
171  }
173  break;
174  }
175  else if (DK_SBCC_TILL_C == false) {
177  break;
178  }
179  else SimpleEvent(g_date->Date(), dk_sbcc_spring_sow, false);
180  break;
181 
182  case dk_sbcc_spring_harrow_nt: // 80% of the 15% of clay and 15% of sandy soils that do no till (nt) harrows before sowing
183  if (m_ev->m_lock || m_farm->DoIt_prob(0.80)) {
184  if (!m_farm->SpringHarrow(m_field, 0.0,
185  g_date->DayInYear(20, 4) - g_date->DayInYear())) {
187  break;
188  }
189  }
191  break;
192 
193  case dk_sbcc_spring_sow:
194  if (m_ev->m_lock || m_farm->DoIt_prob(1.00)) {
196  g_date->DayInYear(30, 4) - g_date->DayInYear())) {
197  SimpleEvent(g_date->Date() + 1, dk_sbcc_spring_sow, true);
198  break;
199  }
200  }
201  SimpleEvent(g_date->Date() + 1, dk_sbcc_herbicide1, false); // herbi thread
202  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5), dk_sbcc_fungicide1, false); // fungi thread
203  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5), dk_sbcc_gr1, false); // growth regulator thread
204  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6) + m_date_modifier, dk_sbcc_insecticide, false); // insecti thread
205  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 7), dk_sbcc_water1, false); // water thread
206  SimpleEvent(g_date->OldDays() + g_date->DayInYear(7, 7), dk_sbcc_herbicide4, false); // main thread
207  break;
208 
209  case dk_sbcc_herbicide1: // if sown layout of grass together with the barley
210  if (m_ev->m_lock || m_farm->DoIt_prob(0.10)) {
211  if (!m_farm->HerbicideTreat(m_field, 0.0,
212  g_date->DayInYear(5, 5) - g_date->DayInYear())) {
213  SimpleEvent(g_date->Date() + 1, dk_sbcc_herbicide1, true);
214  break;
215  }
216  }
217  SimpleEvent(g_date->Date() + 14, dk_sbcc_herbicide2, false);
218  break;
219 
220  case dk_sbcc_herbicide2:
221  if (m_ev->m_lock || m_farm->DoIt_prob(1.0)) {
222  if (!m_farm->HerbicideTreat(m_field, 0.0,
223  g_date->DayInYear(20, 5) - g_date->DayInYear())) {
224  SimpleEvent(g_date->Date() + 1, dk_sbcc_herbicide2, true);
225  break;
226  }
227  }
228  SimpleEvent(g_date->Date() + 14, dk_sbcc_herbicide3, false);
229  break;
230 
231  case dk_sbcc_herbicide3:
232  if (m_ev->m_lock || m_farm->DoIt_prob(0.15)) {
233  if (!m_farm->HerbicideTreat(m_field, 0.0,
234  g_date->DayInYear(5, 6) - g_date->DayInYear())) {
235  SimpleEvent(g_date->Date() + 1, dk_sbcc_herbicide3, true);
236  break;
237  }
238  }
239  break; // end of thread
240 
241  case dk_sbcc_fungicide1:
242  if (m_ev->m_lock || m_farm->DoIt_prob(0.95)) {
243  if (!m_farm->FungicideTreat(m_field, 0.0,
244  g_date->DayInYear(31, 5) - g_date->DayInYear())) {
245  SimpleEvent(g_date->Date() + 1, dk_sbcc_fungicide1, true);
246  break;
247  }
248  }
249  SimpleEvent(g_date->Date()+14, dk_sbcc_fungicide2, false);
250  break;
251 
252  case dk_sbcc_fungicide2:
253  if (m_ev->m_lock || m_farm->DoIt_prob(0.20)) {
254  if (!m_farm->FungicideTreat(m_field, 0.0,
255  g_date->DayInYear(15, 6) - g_date->DayInYear())) {
256  SimpleEvent(g_date->Date() + 1, dk_sbcc_fungicide2, true);
257  break;
258  }
259  }
260  break; // end of thread
261 
262  case dk_sbcc_gr1:
263  if (m_ev->m_lock || m_farm->DoIt_prob(0.25)) {
264  if (!m_farm->GrowthRegulator(m_field, 0.0,
265  g_date->DayInYear(31, 5) - g_date->DayInYear())) {
266  SimpleEvent(g_date->Date() + 1, dk_sbcc_gr1, true);
267  break;
268  }
269  break; // end of thread
270  }
271  SimpleEvent(g_date->Date() + 30, dk_sbcc_gr2, false);
272  break;
273 
274  case dk_sbcc_gr2:
275  if (m_ev->m_lock || m_farm->DoIt_prob(0.30/0.75)) {
276  if (!m_farm->GrowthRegulator(m_field, 0.0,
277  g_date->DayInYear(30, 6) - g_date->DayInYear())) {
278  SimpleEvent(g_date->Date() + 1, dk_sbcc_gr2, true);
279  break;
280  }
281  }
282  break; // end of thread
283 
284  case dk_sbcc_insecticide:
285  if (m_ev->m_lock || m_farm->DoIt_prob(0.40) || AphidDamage(m_field)) {
286  // here we check whether we are using ERA pesticide or not
287  d1 = g_date->DayInYear(31, 7) - g_date->DayInYear();
288  if (!cfg_pest_springbarley_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
289  {
290  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
291  }
292  else {
294  }
295  if (!flag) {
297  break;
298  }
299  }
300  break; // end of thread
301 
302  case dk_sbcc_water1:
303  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)
304  {
305  if (m_ev->m_lock || m_farm->DoIt_prob(0.80)) {
306  if (!m_farm->Water(m_field, 0.0,
307  g_date->DayInYear(10, 7) - g_date->DayInYear())) {
308  SimpleEvent(g_date->Date() + 1, dk_sbcc_water1, true);
309  break;
310  }
311  SimpleEvent(g_date->Date()+14, dk_sbcc_water2, false);
312  break;
313  }
314  }
315  break; // end of thread
316 
317  case dk_sbcc_water2:
318  if (!m_farm->Water(m_field, 0.0,
319  g_date->DayInYear(31, 7) - g_date->DayInYear())) {
320  SimpleEvent(g_date->Date() + 1, dk_sbcc_water2, true);
321  break;
322  }
323  break; // end of thread
324 
325  case dk_sbcc_herbicide4:
326  if (m_ev->m_lock || m_farm->DoIt_prob(0.30)) {
327  if (!m_farm->HerbicideTreat(m_field, 0.0,
328  g_date->DayInYear(15, 8) - g_date->DayInYear())) {
329  SimpleEvent(g_date->Date() + 1, dk_sbcc_herbicide4, true);
330  break;
331  }
332  d1 = g_date->Date() + 14;
333  if (d1 < g_date->OldDays() + g_date->DayInYear(1, 8)) d1 = g_date->OldDays() + g_date->DayInYear(1, 8);
334  SimpleEvent(d1, dk_sbcc_harvest, false);
335  break;
336  }
338  break;
339 
340  case dk_sbcc_harvest:
341  if (!m_farm->Harvest(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
342  SimpleEvent(g_date->Date() + 1, dk_sbcc_harvest, true);
343  break;
344  }
346  break;
347 
349  if (m_ev->m_lock || m_farm->DoIt_prob(0.25)) {
350  if (!m_farm->StrawChopping(m_field, 0.0, m_field->GetMDates(1, 1) - g_date->DayInYear())) {
352  break;
353  }
355  SimpleEvent(g_date->Date(), dk_sbcc_wait, false);
356  break;
357  }
358  else
359  done = true;
360  break;
361  }
362  else if (m_ev->m_lock || m_farm->DoIt_prob(0.75 / 0.75)) {
363  SimpleEvent(g_date->Date() + 1, dk_sbcc_hay_bailing, false);
364  break;
365  }
366 
367  case dk_sbcc_hay_bailing:
368  if (!m_farm->HayBailing(m_field, 0.0, m_field->GetMDates(1, 2) - g_date->DayInYear())) {
370  break;
371  }
373  SimpleEvent(g_date->Date(), dk_sbcc_wait, false);
374  break;
375  }
376  else
377  done = true;
378  break;
379 
380  case dk_sbcc_wait:
381  //set to 100% from this code - in reality ~ 42% of all spring barley
382  // So we are done,but this crop uses a catch crop
383  l_nextcropstartdate = m_farm->GetNextCropStartDate(m_ev->m_field, l_tov);
384  m_field->BumpRunNum();
385  m_field->SetVegPatchy(false); // reverse the patchy before the next crop
386  m_farm->AddNewEvent(tov_DKCatchCrop, g_date->Date(), m_ev->m_field, PROG_START, m_ev->m_field->GetRunNum(), false, l_nextcropstartdate, false, l_tov, fmc_Others, false, false);
387  m_field->SetVegType(tov_DKCatchCrop, tov_Undefined); // Two vegetation curves are specified
388  // NB no "done = true" because this crop effectively continues into the catch crop.
389  if (m_field->GetUnsprayedMarginPolyRef() != -1)
390  {
393  }
394  break;
395 
396 
397  default:
398  g_msg->Warn(WARN_BUG, "DK_SpringBarley_CC::Do(): "
399  "Unknown event type! ", "");
400  exit(1);
401  }
402  return done;
403 }

References Farm::AddNewEvent(), Crop::AphidDamage(), Farm::AutumnPlough(), cfg_DKCatchCropPct, cfg_pest_product_amounts, cfg_pest_springbarley_on, LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), dk_sbcc_autumn_plough, dk_sbcc_ferti_p1, dk_sbcc_ferti_p2, dk_sbcc_ferti_s1, dk_sbcc_ferti_s2, DK_SBCC_FORCESPRING, dk_sbcc_fungicide1, dk_sbcc_fungicide2, dk_sbcc_gr1, dk_sbcc_gr2, dk_sbcc_harvest, dk_sbcc_hay_bailing, dk_sbcc_herbicide1, dk_sbcc_herbicide2, dk_sbcc_herbicide3, dk_sbcc_herbicide4, dk_sbcc_insecticide, dk_sbcc_spring_harrow_nt, dk_sbcc_spring_plough, dk_sbcc_spring_sow, dk_sbcc_start, dk_sbcc_straw_chopping, DK_SBCC_TILL_C, DK_SBCC_TILL_S, dk_sbcc_wait, dk_sbcc_water1, dk_sbcc_water2, Farm::DoIt_prob(), Farm::FA_NPKS(), Farm::FA_Slurry(), fmc_Others, Farm::FP_NPKS(), Farm::FP_Slurry(), Farm::FungicideTreat(), g_date, g_msg, LE::GetMDates(), Farm::GetNextCropStartDate(), LE::GetSoilType(), LE::GetUnsprayedMarginPolyRef(), Farm::GrowthRegulator(), Farm::Harvest(), Farm::HayBailing(), Farm::HerbicideTreat(), Farm::InsecticideTreat(), Farm::IsStockFarmer(), Crop::m_date_modifier, Crop::m_ev, Crop::m_farm, FarmEvent::m_field, Crop::m_field, FarmEvent::m_forcespring, Crop::m_last_date, FarmEvent::m_lock, Crop::m_OurLandscape, FarmEvent::m_todo, Calendar::OldDays(), ppp_1, Farm::PreseedingCultivatorSow(), Farm::ProductApplication(), PROG_START, LE::SetVegPatchy(), LE::SetVegType(), Crop::SimpleEvent(), Farm::SpringHarrow(), Farm::SpringPlough(), Crop::StartUpCrop(), Farm::StrawChopping(), Landscape::SupplyLEPointer(), tos_LoamySand, tos_Sand, tos_SandyClayLoam, tos_SandyLoam, tov_DKCatchCrop, tov_DKOCatchCrop, tov_DKSpringBarley_CC, tov_Undefined, CfgFloat::value(), CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), WARN_BUG, and Farm::Water().

◆ SetUpFarmCategoryInformation()

void DK_SpringBarley_CC::SetUpFarmCategoryInformation ( )
inline
78  {
79  const int elements = 2 + (dk_sbcc_foobar - DK_SBMCC_BASE);
81 
82  FarmManagementCategory catlist[elements] =
83  {
84  fmc_Others, // zero element unused but must be here
85  fmc_Others, // dk_sbcc_start = 1, // Compulsory, start event must always be 1 (one).
86  fmc_Harvest, // dk_sbcc_harvest = DK_SBMCC_BASE,
87  fmc_Cultivation, // dk_sbcc_autumn_plough,
88  fmc_Fertilizer, // dk_sbcc_ferti_s1,
89  fmc_Fertilizer, // dk_sbcc_ferti_p1,
90  fmc_Fertilizer, // dk_sbcc_ferti_s2,
91  fmc_Fertilizer, // dk_sbcc_ferti_p2,
92  fmc_Cultivation, // dk_sbcc_spring_plough,
93  fmc_Cultivation, // dk_sbcc_spring_harrow_nt,
94  fmc_Cultivation, // dk_sbcc_spring_sow,
95  fmc_Herbicide, // dk_sbcc_herbicide1,
96  fmc_Herbicide, // dk_sbcc_herbicide2,
97  fmc_Herbicide, // dk_sbcc_herbicide3,
98  fmc_Herbicide, // dk_sbcc_herbicide4,
99  fmc_Insecticide, // dk_sbcc_insecticide,
100  fmc_Watering, // dk_sbcc_water1,
101  fmc_Watering, // dk_sbcc_water2,
102  fmc_Fungicide, // dk_sbcc_fungicide1,
103  fmc_Fungicide, // dk_sbcc_fungicide2,
104  fmc_Others, // dk_sbcc_gr1,
105  fmc_Others, // dk_sbcc_gr2,
106  fmc_Others, // dk_sbcc_straw_chopping,
107  fmc_Others, // dk_sbcc_hay_bailing,
108  fmc_Cultivation, // dk_sbcc_stubble_harrow,
109  fmc_Cultivation, // dk_sbcc_plough,
110  fmc_Others, // dk_sbcc_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_sbcc_foobar, DK_SBMCC_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_CC().


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
Landscape::SupplyLEPointer
LE * SupplyLEPointer(int a_polyref)
Returns a pointer to the object referred to by the polygon number.
Definition: Landscape.h:1722
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
DK_SBCC_TILL_C
#define DK_SBCC_TILL_C
Definition: DK_SpringBarley_CC.h:34
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
DK_SBCC_FORCESPRING
#define DK_SBCC_FORCESPRING
Definition: DK_SpringBarley_CC.h:33
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_sbcc_spring_sow
Definition: DK_SpringBarley_CC.h:47
dk_sbcc_ferti_p1
Definition: DK_SpringBarley_CC.h:42
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
tov_DKSpringBarley_CC
Definition: LandscapeFarmingEnums.h:431
dk_sbcc_spring_plough
Definition: DK_SpringBarley_CC.h:45
LE::ClearManagementActionSum
void ClearManagementActionSum()
clears the management action counters
Definition: Elements.h:247
dk_sbcc_harvest
Definition: DK_SpringBarley_CC.h:39
dk_sbcc_gr2
Definition: DK_SpringBarley_CC.h:58
tos_SandyClayLoam
Definition: LandscapeFarmingEnums.h:722
DK_SBCC_TILL_S
#define DK_SBCC_TILL_S
Definition: DK_SpringBarley_CC.h:35
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
dk_sbcc_foobar
Definition: DK_SpringBarley_CC.h:64
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
dk_sbcc_insecticide
Definition: DK_SpringBarley_CC.h:52
tos_SandyLoam
Definition: LandscapeFarmingEnums.h:721
Farm::GetNextCropStartDate
int GetNextCropStartDate(LE *a_field, TTypesOfVegetation &a_curr_veg)
Returns the start date of the next crop in the rotation.
Definition: Farm.cpp:920
Farm::AddNewEvent
void AddNewEvent(TTypesOfVegetation a_event, long a_date, LE *a_field, int a_todo, long a_num, bool a_lock, int a_start, bool a_first_year, TTypesOfVegetation a_crop, FarmManagementCategory a_fmc, bool a_forcespring, bool a_forcespringOK)
Adds an event to the event queue for a farm.
Definition: Farm.cpp:845
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
CfgFloat::value
double value() const
Definition: Configurator.h:142
dk_sbcc_herbicide2
Definition: DK_SpringBarley_CC.h:49
dk_sbcc_start
Definition: DK_SpringBarley_CC.h:38
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
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
dk_sbcc_wait
Definition: DK_SpringBarley_CC.h:63
DK_SBMCC_BASE
#define DK_SBMCC_BASE
Definition: DK_SpringBarley_CC.h:31
dk_sbcc_fungicide1
Definition: DK_SpringBarley_CC.h:55
DK_SpringBarley_CC::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: DK_SpringBarley_CC.h:78
Crop::SimpleEvent
void SimpleEvent(long a_date, int a_todo, bool a_lock)
Adds an event to this crop management.
Definition: Farm.cpp:747
dk_sbcc_ferti_p2
Definition: DK_SpringBarley_CC.h:44
dk_sbcc_straw_chopping
Definition: DK_SpringBarley_CC.h:59
dk_sbcc_fungicide2
Definition: DK_SpringBarley_CC.h:56
CfgBool::value
bool value() const
Definition: Configurator.h:164
dk_sbcc_herbicide3
Definition: DK_SpringBarley_CC.h:50
tov_DKOCatchCrop
Definition: LandscapeFarmingEnums.h:421
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
dk_sbcc_gr1
Definition: DK_SpringBarley_CC.h:57
Calendar::Date
long Date(void)
Definition: Calendar.h:57
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
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
LE::SetVegPatchy
void SetVegPatchy(bool p)
Definition: Elements.h:229
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
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
FarmEvent::m_field
LE * m_field
Definition: Farm.h:391
dk_sbcc_ferti_s2
Definition: DK_SpringBarley_CC.h:43
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
dk_sbcc_hay_bailing
Definition: DK_SpringBarley_CC.h:60
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
dk_sbcc_water2
Definition: DK_SpringBarley_CC.h:54
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
tov_Undefined
Definition: LandscapeFarmingEnums.h:610
LE::SetVegType
virtual void SetVegType(TTypesOfVegetation)
Definition: Elements.h:175
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
LE
Definition: Elements.h:86
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
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
dk_sbcc_spring_harrow_nt
Definition: DK_SpringBarley_CC.h:46
cfg_DKCatchCropPct
CfgFloat cfg_DKCatchCropPct
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
dk_sbcc_autumn_plough
Definition: DK_SpringBarley_CC.h:40
dk_sbcc_ferti_s1
Definition: DK_SpringBarley_CC.h:41
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
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
LE::GetUnsprayedMarginPolyRef
int GetUnsprayedMarginPolyRef(void)
Definition: Elements.h:383
tov_DKCatchCrop
Definition: LandscapeFarmingEnums.h:420
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
cfg_pest_springbarley_on
CfgBool cfg_pest_springbarley_on
Turn on pesticides for spring barley.
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
PROG_START
#define PROG_START
Definition: Farm.h:69
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
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
tos_LoamySand
Definition: LandscapeFarmingEnums.h:720
Crop::m_OurLandscape
Landscape * m_OurLandscape
Definition: Farm.h:506
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
dk_sbcc_water1
Definition: DK_SpringBarley_CC.h:53
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
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
dk_sbcc_herbicide4
Definition: DK_SpringBarley_CC.h:51
dk_sbcc_herbicide1
Definition: DK_SpringBarley_CC.h:48