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

#include <FI_StarchPotato_North.h>

Inheritance diagram for FI_StarchPotato_North:
Crop

Public Member Functions

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

◆ FI_StarchPotato_North()

FI_StarchPotato_North::FI_StarchPotato_North ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
68  : Crop(a_tov, a_toc, a_L)
69  {
70  m_first_date=g_date->DayInYear(1,12); //
72  }

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

Member Function Documentation

◆ Do()

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

Reimplemented from Crop.

40 {
41  m_farm = a_farm;
42  m_field = a_field;
43  m_ev = a_ev;
44  bool flag = false;
45  int d1;
46 
47  bool done = false;
48 
49  switch (m_ev->m_todo)
50  {
51  case fi_spn_start:
52  {
55 
56  a_field->ClearManagementActionSum();
57 
58  m_field->SetVegPatchy(true); // Root crop so is open until tall
59  // Set up the date management stuff
60  // Could save the start day in case it is needed later
61  // m_field->m_startday = m_ev->m_startday;
62  m_last_date = g_date->DayInYear(15, 11);
63  // Start and stop dates for all events after harvest
64  int noDates = 1;
65  m_field->SetMDates(0, 0, g_date->DayInYear(1, 10));
66  // 0,0 determined by harvest date - used to see if at all possible
67  m_field->SetMDates(1, 0, g_date->DayInYear(10, 11));
68  // Check the next crop for early start, unless it is a spring crop
69  // in which case we ASSUME that no checking is necessary!!!!
70  // So DO NOT implement a crop that runs over the year boundary
71 
72  //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)
73  int d1;
74  if (!(m_farm->GetType() == tof_OptimisingFarm && g_date->GetYearNumber() > 0)) {
75 
76  if (m_ev->m_startday > g_date->DayInYear(1, 7))
77  {
78  if (m_field->GetMDates(0, 0) >= m_ev->m_startday)
79  {
80  g_msg->Warn(WARN_BUG, "FI_StarchPotato_North::Do(): "
81  "Harvest too late for the next crop to start!!!", "");
82  exit(1);
83  }
84  // Now fix any late finishing problems
85  for (int i = 0; i < noDates; i++) {
86  if (m_field->GetMDates(0, i) >= m_ev->m_startday) {
87  m_field->SetMDates(0, i, m_ev->m_startday - 1); //move the starting date
88  }
89  if (m_field->GetMDates(1, i) >= m_ev->m_startday) {
90  m_field->SetMConstants(i, 0);
91  m_field->SetMDates(1, i, m_ev->m_startday - 1); //move the finishing date
92  }
93  }
94  }
95  // Now no operations can be timed after the start of the next crop.
96 
97  // CJT note:
98  // Start single block date checking code to be cut-'n-pasted...
99 
100  if (!m_ev->m_first_year)
101  {
102  // Are we before July 1st?
103  d1 = g_date->OldDays() + g_date->DayInYear(1, 7);
104  if (g_date->Date() < d1)
105  {
106  // Yes, too early. We assumme this is because the last crop was late
107  g_msg->Warn(WARN_BUG, "FI_StarchPotato_North::Do(): "
108  "Crop start attempt between 1st Jan & 1st July", "");
109  exit(1);
110  }
111  else
112  {
113  d1 = g_date->OldDays() + m_first_date + 365; // Add 365 for spring crop
114  if (g_date->Date() > d1)
115  {
116  // Yes too late - should not happen - raise an error
117  g_msg->Warn(WARN_BUG, "FI_StarchPotato_North::Do(): "
118  "Crop start attempt after last possible start date", "");
119  exit(1);
120  }
121  }
122  }
123  else
124  {
125  // If this is the first year of running then it is possible to start
126  // on day 0, so need this to tell us what to do:
128  break;
129  }
130  }//if
131 
132  // End single block date checking code. Please see next line
133  // comment as well.
134  // Reinit d1 to first possible starting date.
135  d1 = g_date->OldDays() + g_date->DayInYear(1, 9);
136  // This is the first real farm operation
138  }
139  break;
140  // OK, Let's go - LKM: first treatment, stubble cultivator, do it before the 10 of October - if not done, try again +1 day until the the 10 of October when we succeed - 2% of farmers do this
142  if (m_ev->m_lock || m_farm->DoIt_prob(0.02))
143  {
146  break;
147  }
148  //Here comes a fork of parallel events:
149  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5) + 365, fi_spn_slurry, false); //Slurry thread
150  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5) + 365, fi_spn_n_minerals1, false); //N minerals thread
151  SimpleEvent(g_date->OldDays() + g_date->DayInYear(15, 5) + 365, fi_spn_fertilizer, false); //Sowing thread - main thread
152  break;
153  }
154  else if (m_ev->m_lock || m_farm->DoIt_prob(0.24 / 0.98)) { // autumn plough, done after 15th of October - before the 1st of December - 24% do this
156  break;
157  }
158  else if (m_ev->m_lock || m_farm->DoIt_prob(0.74 / 0.74)) { //Here comes a fork of parallel events:
159  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5) + 365, fi_spn_slurry, false); //Slurry thread
160  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5) + 365, fi_spn_n_minerals1, false); //N minerals thread
161  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5) + 365, fi_spn_spring_plough, false); //Spring plough thread
162  SimpleEvent(g_date->OldDays() + g_date->DayInYear(15, 5) + 365, fi_spn_fertilizer, false); //Sowing thread - main thread
163  break;
164  }
165 
167  if (!m_farm->AutumnPlough(m_field, 0.0, g_date->DayInYear(1, 12) - g_date->DayInYear())) {
169  break;
170  }
171  //Here comes a fork of parallel events:
172  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5) + 365, fi_spn_slurry, false); //Slurry thread
173  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5) + 365, fi_spn_n_minerals1, false); //N minerals thread
174  SimpleEvent(g_date->OldDays() + g_date->DayInYear(15, 5) + 365, fi_spn_fertilizer, false); //Sowing thread - main thread
175  break;
176  // Slurry thread
177  case fi_spn_slurry: //rarely applied on conventional farms (mostly organic) 5% do this, done before 25th of May
178  if (m_ev->m_lock || m_farm->DoIt_prob(0.05)) {
179  if (!m_farm->FP_Slurry(m_field, 0.0, g_date->DayInYear(25, 5) - g_date->DayInYear())) {
180  SimpleEvent(g_date->Date() + 1, fi_spn_slurry, true);
181  break;
182  }
183  }
184  break; //end of Slurry thread
185  // N minerals thread
186  case fi_spn_n_minerals1: //sometimes applied - 10% do this, done before 10th of May
187  if (m_ev->m_lock || m_farm->DoIt_prob(0.10)) {
188  if (!m_farm->FP_NPKS(m_field, 0.0, g_date->DayInYear(10, 5) - g_date->DayInYear())) {
189  SimpleEvent(g_date->Date() + 1, fi_spn_n_minerals1, true);
190  break;
191  }
192  }
193  break; //end of N minerals thread
194  // Spring plough thread (the 74% from before)
195  case fi_spn_spring_plough: // done before 25th of May
196  if (!m_farm->SpringPlough(m_field, 0.0, g_date->DayInYear(25, 5) - g_date->DayInYear())) {
198  break;
199  }
200  break; //end of Spring plough thread
201  // Sowing thread - starts with fertilizer, 95% do this, before 30th of May
202  case fi_spn_fertilizer:
203  if (m_ev->m_lock || m_farm->DoIt_prob(0.95)) {
204  if (!m_farm->FP_NPKS(m_field, 0.0, g_date->DayInYear(30, 5) - g_date->DayInYear())) {
205  SimpleEvent(g_date->Date() + 1, fi_spn_fertilizer, true);
206  break;
207  }
208  }
209  // LKM: Queue up next event preseeding cultivation right after - done before the 30th of May
211  break;
213  if (m_ev->m_lock || m_farm->DoIt_prob(0.95)) {
214  if (!m_farm->PreseedingCultivator(m_field, 0.0, g_date->DayInYear(30, 5) - g_date->DayInYear())) {
216  break;
217  }
218  // LKM: Queue up next event planting right after - done before the 30th of May
219  SimpleEvent(g_date->Date(), fi_spn_plant, false);
220  break;
221  }
222  else if (m_ev->m_lock || m_farm->DoIt_prob(0.05 / 0.05)) { // 5% plant with the preseeding cultivation
223  // LKM: Queue up next event planting right after - done before the 30th of May
225  break;
226  }
230  break;
231  }
232  // LKM: Queue up next event harrow, done 7 days after
233  SimpleEvent(g_date->Date() + 7, fi_spn_harrow, false);
234  break;
235  case fi_spn_plant:
236  if (!m_farm->SpringSow(m_field, 0.0, g_date->DayInYear(30, 5) - g_date->DayInYear())) {
237  SimpleEvent(g_date->Date() + 1, fi_spn_plant, true);
238  break;
239  }
240  // LKM: Queue up next event harrow, done 7 days after
241  SimpleEvent(g_date->Date() + 7, fi_spn_harrow, false);
242  break;
243  case fi_spn_harrow: // 98% do this, done before 7th of June
244  if (m_ev->m_lock || m_farm->DoIt_prob(0.98)) {
245  if (!m_farm->SpringHarrow(m_field, 0.0, g_date->DayInYear(7, 6) - g_date->DayInYear())) {
246  SimpleEvent(g_date->Date() + 1, fi_spn_harrow, true);
247  break;
248  }
249  }
250  // LKM: Here comes a fork with parallel events:
251  SimpleEvent(g_date->Date() + 2, fi_spn_herbicide1, false); // herbicide thread
252  SimpleEvent(g_date->OldDays() + g_date->DayInYear(20, 6), fi_spn_n_minerals2, false); // N minerals2 thread
253  SimpleEvent(g_date->OldDays() + g_date->DayInYear(10, 7), fi_spn_fungicide1, false); // Fungicide thread - main thread
254  break;
255  // herbicide1 thread - done before the 12th of June, 90% do this
256  case fi_spn_herbicide1:
257  if (m_ev->m_lock || m_farm->DoIt_prob(0.90)) {
258  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(12, 6) - g_date->DayInYear())) {
259  SimpleEvent(g_date->Date() + 1, fi_spn_herbicide1, true);
260  break;
261  }
262  }
263  SimpleEvent(g_date->Date()+10, fi_spn_herbicide2, false); // herbicide2 thread
264  break;
265 
266  case fi_spn_herbicide2:
267  if (m_ev->m_lock || m_farm->DoIt_prob(0.20)) {
268  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(26, 6) - g_date->DayInYear())) {
269  SimpleEvent(g_date->Date() + 1, fi_spn_herbicide2, true);
270  break;
271  }
272  }
273  SimpleEvent(g_date->Date()+10, fi_spn_herbicide3, false);
274  break;
275  case fi_spn_herbicide3:
276  if (m_ev->m_lock || m_farm->DoIt_prob(0.20)) {
277  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(10, 7) - g_date->DayInYear())) {
278  SimpleEvent(g_date->Date() + 1, fi_spn_herbicide3, true);
279  break;
280  }
281  }
282  break; // End of herbicide thread
283  // N minerals2 thread - done before the 15th of July, 20% do this
284  case fi_spn_n_minerals2:
285  if (m_ev->m_lock || m_farm->DoIt_prob(0.20)) {
286  if (!m_farm->FP_NPKS(m_field, 0.0, g_date->DayInYear(15, 7) - g_date->DayInYear())) {
287  SimpleEvent(g_date->Date() + 1, fi_spn_n_minerals2, true);
288  break;
289  }
290  }
291  break; // End of N mineerals2 thread
292  // Fungicide thread - done before the 20th of July (suggestion, not stated), 98% do this
293  case fi_spn_fungicide1:
294  if (m_ev->m_lock || m_farm->DoIt_prob(0.98)) {
295  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(10, 7) - g_date->DayInYear())) {
296  SimpleEvent(g_date->Date() + 1, fi_spn_fungicide1, true);
297  break;
298  }
299  }
300  // LKM: Queue up next event - fungicide2 done 7-14 days later - 98% do this
301  SimpleEvent(g_date->Date() + 7, fi_spn_fungicide2, false);
302  break;
303  case fi_spn_fungicide2: // no later than 3rd of August
304  if (m_ev->m_lock || m_farm->DoIt_prob(0.98)) {
305  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(3, 8) - g_date->DayInYear())) {
306  SimpleEvent(g_date->Date() + 1, fi_spn_fungicide2, true);
307  break;
308  }
309  }
310  // LKM: Queue up next event - fungicide3 done 7 days later - 60% do this
311  SimpleEvent(g_date->Date() + 7, fi_spn_fungicide3, false);
312  break;
313  case fi_spn_fungicide3: // no later than 10 of August
314  if (m_ev->m_lock || m_farm->DoIt_prob(0.60)) {
315  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(10, 8) - g_date->DayInYear())) {
316  SimpleEvent(g_date->Date() + 1, fi_spn_fungicide3, true);
317  break;
318  }
319  }
320  // LKM: Queue up next event - fungicide4 done 7 days later - 50% do this
321  SimpleEvent(g_date->Date() + 7, fi_spn_fungicide4, false);
322  break;
323  case fi_spn_fungicide4: // no later than 17th of August
324  if (m_ev->m_lock || m_farm->DoIt_prob(0.50)) {
325  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(17, 8) - g_date->DayInYear())) {
326  SimpleEvent(g_date->Date() + 1, fi_spn_fungicide4, true);
327  break;
328  }
329  }
330  // LKM: Queue up next event - fungicide5 done 7 days later - 20% do this
331  SimpleEvent(g_date->Date() + 7, fi_spn_fungicide5, false);
332  break;
333  case fi_spn_fungicide5: // no later than 24th of August
334  if (m_ev->m_lock || m_farm->DoIt_prob(0.20)) {
335  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(24, 8) - g_date->DayInYear())) {
336  SimpleEvent(g_date->Date() + 1, fi_spn_fungicide5, true);
337  break;
338  }
339  }
340  // LKM: Queue up next event - insecticide (no dates) - 3% do this
342  break;
343  case fi_spn_insecticide: // no later than 31st of August (suggestion)
344 #ifdef ECOSTACK_BIOPESTICIDE
345  if (m_ev->m_lock || m_farm->DoIt_prob(0.06)) {
346 #else
347  if (m_ev->m_lock || m_farm->DoIt_prob(0.03)) {
348 #endif
349  // here we check whether we are using ERA pesticide or not
350  d1 = g_date->DayInYear(20, 9) - g_date->DayInYear();
351  if (!cfg_pest_potatoes_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
352  {
353 #ifdef ECOSTACK_BIOPESTICIDE
354  flag = m_farm->BiocideTreat(m_field, 0.0, d1);
355 #else
356  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
357 #endif
358  }
359  else {
360  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 3);
361  }
362  if (!flag) {
364  break;
365  }
366  }
367  // LKM: Queue up the next event - harvest done after the 20th of August
369  break;
370  // LKM: do harvest before 7th of October
371  case fi_spn_harvest:
372  if (!m_farm->HarvestLong(m_field, 0.0, g_date->DayInYear(7, 10) - g_date->DayInYear())) {
373  SimpleEvent(g_date->Date() + 1, fi_spn_harvest, true);
374  break;
375  }
376  m_field->SetVegPatchy(false);
377  done = true;
378  break;
379 
380  default:
381  g_msg->Warn(WARN_BUG, "FI_StarchPotato_North::Do(): "
382  "Unknown event type! ", "");
383  exit(1);
384  }
385  return done;
386 }

References Farm::AutumnPlough(), Farm::BiocideTreat(), cfg_pest_potatoes_on, cfg_pest_product_amounts, LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), Farm::DoIt_prob(), fi_spn_autumn_plough, FI_SPN_DECIDE_TO_FI, FI_SPN_DECIDE_TO_HERB, fi_spn_fertilizer, fi_spn_fungicide1, fi_spn_fungicide2, fi_spn_fungicide3, fi_spn_fungicide4, fi_spn_fungicide5, fi_spn_harrow, fi_spn_harvest, fi_spn_herbicide1, fi_spn_herbicide2, fi_spn_herbicide3, fi_spn_insecticide, fi_spn_n_minerals1, fi_spn_n_minerals2, fi_spn_plant, fi_spn_preseeding_cultivation, fi_spn_preseeding_plant, fi_spn_slurry, fi_spn_spring_plough, fi_spn_start, fi_spn_stubble_cultivator, Farm::FP_NPKS(), Farm::FP_Slurry(), Farm::FungicideTreat(), g_date, g_msg, LE::GetMDates(), Farm::GetType(), Calendar::GetYearNumber(), Farm::HarvestLong(), Farm::HerbicideTreat(), Farm::InsecticideTreat(), Crop::m_date_modifier, Crop::m_ev, Crop::m_farm, Crop::m_field, Crop::m_first_date, FarmEvent::m_first_year, Crop::m_last_date, FarmEvent::m_lock, FarmEvent::m_startday, FarmEvent::m_todo, Calendar::OldDays(), ppp_1, Farm::PreseedingCultivator(), Farm::PreseedingCultivatorSow(), Farm::ProductApplication(), LE::SetMConstants(), LE::SetMDates(), LE::SetVegPatchy(), Crop::SimpleEvent(), Crop::SimpleEvent_(), Farm::SpringHarrow(), Farm::SpringPlough(), Farm::SpringSow(), Farm::StubbleCultivatorHeavy(), tof_OptimisingFarm, CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), and WARN_BUG.

◆ SetUpFarmCategoryInformation()

void FI_StarchPotato_North::SetUpFarmCategoryInformation ( )
inline
73  {
74  const int elements = 2 + (fi_spn_foobar - FI_SPN_BASE);
76 
77  FarmManagementCategory catlist[elements] =
78  {
79  fmc_Others, // zero element unused but must be here
80  fmc_Others, // fi_spn_start = 1, // Compulsory, start event must always be 1 (one).
81  fmc_Harvest, // fi_spn_harvest = FI_SPN_BASE,
82  fmc_Cultivation, // fi_spn_stubble_cultivator,
83  fmc_Cultivation, // fi_spn_autumn_plough,
84  fmc_Fertilizer, // fi_spn_slurry,
85  fmc_Cultivation, // fi_spn_spring_plough,
86  fmc_Fertilizer, // fi_spn_n_minerals1,
87  fmc_Fertilizer, // fi_spn_n_minerals2,
88  fmc_Cultivation, // fi_spn_preseeding_cultivation,
89  fmc_Fertilizer, // fi_spn_fertilizer,
90  fmc_Cultivation, // fi_spn_preseeding_plant,
91  fmc_Others, // fi_spn_plant,
92  fmc_Cultivation, // fi_spn_harrow,
93  fmc_Herbicide, // fi_spn_herbicide1,
94  fmc_Herbicide, // fi_spn_herbicide2,
95  fmc_Herbicide, // fi_spn_herbicide3,
96  fmc_Fungicide, // fi_spn_fungicide1,
97  fmc_Fungicide, // fi_spn_fungicide2,
98  fmc_Fungicide, // fi_spn_fungicide3,
99  fmc_Fungicide, // fi_spn_fungicide4,
100  fmc_Fungicide, // fi_spn_fungicide5,
101  fmc_Insecticide // fi_spn_insecticide,
102 
103 
104  // no foobar entry
105 
106  };
107  // Iterate over the catlist elements and copy them to vector
108  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
109 
110  }

References FI_SPN_BASE, fi_spn_foobar, fmc_Cultivation, fmc_Fertilizer, fmc_Fungicide, fmc_Harvest, fmc_Herbicide, fmc_Insecticide, fmc_Others, Crop::m_base_elements_no, and Crop::m_ManagementCategories.

Referenced by FI_StarchPotato_North().


The documentation for this class was generated from the following files:
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
FI_SPN_DECIDE_TO_HERB
#define FI_SPN_DECIDE_TO_HERB
Definition: FI_StarchPotato_North.h:33
Farm::PreseedingCultivator
virtual bool PreseedingCultivator(LE *a_field, double a_user, int a_days)
Carry out preseeding cultivation on a_field (tilling set including cultivator and string roller to co...
Definition: FarmFuncs.cpp:312
LE::SetMDates
void SetMDates(int a, int b, int c)
Definition: Elements.h:406
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
fi_spn_insecticide
Definition: FI_StarchPotato_North.h:58
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
Farm::StubbleCultivatorHeavy
virtual bool StubbleCultivatorHeavy(LE *a_field, double a_user, int a_days)
Carry out a stubble cultivation event on a_field. This is non-inversion type of cultivation which can...
Definition: FarmFuncs.cpp:245
fi_spn_fungicide1
Definition: FI_StarchPotato_North.h:53
fi_spn_slurry
Definition: FI_StarchPotato_North.h:41
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.
Farm::DoIt_prob
bool DoIt_prob(double a_probability)
Return chance out of 0 to 1.
Definition: Farm.cpp:864
fi_spn_herbicide3
Definition: FI_StarchPotato_North.h:52
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
fi_spn_plant
Definition: FI_StarchPotato_North.h:48
Farm::SpringSow
virtual bool SpringSow(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 spring on a_field.
Definition: FarmFuncs.cpp:501
Farm::GetType
TTypesOfFarm GetType(void)
Definition: Farm.h:956
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
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
fi_spn_spring_plough
Definition: FI_StarchPotato_North.h:42
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
fi_spn_harvest
Definition: FI_StarchPotato_North.h:38
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
fi_spn_preseeding_plant
Definition: FI_StarchPotato_North.h:47
FI_SPN_DECIDE_TO_FI
#define FI_SPN_DECIDE_TO_FI
Definition: FI_StarchPotato_North.h:34
Calendar::Date
long Date(void)
Definition: Calendar.h:57
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
FI_SPN_BASE
#define FI_SPN_BASE
Definition: FI_StarchPotato_North.h:31
cfg_pest_potatoes_on
CfgBool cfg_pest_potatoes_on
Turn on pesticides for potatoes.
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
LE::SetVegPatchy
void SetVegPatchy(bool p)
Definition: Elements.h:229
fi_spn_fungicide5
Definition: FI_StarchPotato_North.h:57
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
fi_spn_foobar
Definition: FI_StarchPotato_North.h:59
fi_spn_fungicide4
Definition: FI_StarchPotato_North.h:56
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
fi_spn_preseeding_cultivation
Definition: FI_StarchPotato_North.h:45
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
fi_spn_fungicide3
Definition: FI_StarchPotato_North.h:55
Farm::InsecticideTreat
virtual bool InsecticideTreat(LE *a_field, double a_user, int a_days)
Apply insecticide to a_field.
Definition: FarmFuncs.cpp:2135
fi_spn_herbicide1
Definition: FI_StarchPotato_North.h:50
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
FI_StarchPotato_North::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: FI_StarchPotato_North.h:73
Farm::HarvestLong
virtual bool HarvestLong(LE *a_field, double a_user, int a_days)
Carry out a harvest on a_field (only differs in the DoIt chance cf harvest)
Definition: FarmFuncs.cpp:1421
Farm::BiocideTreat
virtual bool BiocideTreat(LE *a_field, double a_user, int a_days)
Apply Biocide to a_field.
Definition: FarmFuncs.cpp:2175
fi_spn_herbicide2
Definition: FI_StarchPotato_North.h:51
tof_OptimisingFarm
Definition: LandscapeFarmingEnums.h:696
fi_spn_n_minerals1
Definition: FI_StarchPotato_North.h:43
fi_spn_fungicide2
Definition: FI_StarchPotato_North.h:54
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
fi_spn_autumn_plough
Definition: FI_StarchPotato_North.h:40
fi_spn_start
Definition: FI_StarchPotato_North.h:37
fi_spn_fertilizer
Definition: FI_StarchPotato_North.h:46
fi_spn_harrow
Definition: FI_StarchPotato_North.h:49
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
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
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
fi_spn_stubble_cultivator
Definition: FI_StarchPotato_North.h:39
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
fi_spn_n_minerals2
Definition: FI_StarchPotato_North.h:44
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
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