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

#include <FI_StarchPotato_South.h>

Inheritance diagram for FI_StarchPotato_South:
Crop

Public Member Functions

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

FI_StarchPotato_South::FI_StarchPotato_South ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline

Member Function Documentation

◆ Do()

bool FI_StarchPotato_South::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;
49  int l_nextcropstartdate;
50 
51  switch (m_ev->m_todo)
52  {
53  case fi_sps_start:
54  {
55  a_field->ClearManagementActionSum();
56 
57  m_last_date = g_date->DayInYear(15, 10); // Should match the last flexdate below
58  //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
59  std::vector<std::vector<int>> flexdates(1 + 1, std::vector<int>(2, 0));
60  // Set up the date management stuff
61  // Start and stop dates for all events after harvest
62  flexdates[0][1] = g_date->DayInYear(15, 10); // last possible day of harvest - this is in effect day before the earliest date that a following crop can use
63 
64  // 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
65  int isSpring = 0;
66  if (StartUpCrop(isSpring, flexdates, int(fi_sps_fertilizer))) break;
67 
68  // End single block date checking code. Please see next line comment as well.
69  // Reinit d1 to first possible starting date.
70  d1 = g_date->OldDays() + g_date->DayInYear(1, 9);
71  // OK, let's go.
72  // Here we queue up the first event which changes dependent on whether it is a forced spring sow or not
73  if (m_ev->m_forcespring) {
74  int day_num_shift = 365;
75  if (g_date->DayInYear() < 70) day_num_shift = 0;
76  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5) + day_num_shift, fi_sps_slurry, false); //Slurry thread
77  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5) + day_num_shift, fi_sps_n_minerals1, false); //N minerals thread
78  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5) + day_num_shift, fi_sps_spring_plough, false); //Spring plough thread
79  SimpleEvent(g_date->OldDays() + g_date->DayInYear(15, 5) + day_num_shift, fi_sps_fertilizer, false); //Sowing thread - main thread
80  break;
81  }
82  else SimpleEvent(d1, fi_sps_stubble_cultivator, false);
83  break;
84  }
85  break;
86 
87  // 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
89  if (m_ev->m_lock || m_farm->DoIt_prob(0.02))
90  {
93  break;
94  }
95  //Here comes a fork of parallel events:
96  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5) + 365, fi_sps_slurry, false); //Slurry thread
97  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5) + 365, fi_sps_n_minerals1, false); //N minerals thread
98  SimpleEvent(g_date->OldDays() + g_date->DayInYear(15, 5) + 365, fi_sps_fertilizer, false); //Sowing thread - main thread
99  break;
100  }
101  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
103  break;
104  }
105  else if (m_ev->m_lock || m_farm->DoIt_prob(0.74 / 0.74)) { //Here comes a fork of parallel events:
106  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5) + 365, fi_sps_slurry, false); //Slurry thread
107  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5) + 365, fi_sps_n_minerals1, false); //N minerals thread
108  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5) + 365, fi_sps_spring_plough, false); //Spring plough thread
109  SimpleEvent(g_date->OldDays() + g_date->DayInYear(15, 5) + 365, fi_sps_fertilizer, false); //Sowing thread - main thread
110  break;
111  }
112 
114  if (!m_farm->AutumnPlough(m_field, 0.0, g_date->DayInYear(1, 12) - g_date->DayInYear())) {
116  break;
117  }
118  //Here comes a fork of parallel events:
119  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5) + 365, fi_sps_slurry, false); //Slurry thread
120  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 5) + 365, fi_sps_n_minerals1, false); //N minerals thread
121  SimpleEvent(g_date->OldDays() + g_date->DayInYear(15, 5) + 365, fi_sps_fertilizer, false); //Sowing thread - main thread
122  break;
123  // Slurry thread
124  case fi_sps_slurry: //rarely applied on conventional farms (mostly organic) 5% do this, done before 25th of May
125  if (m_ev->m_lock || m_farm->DoIt_prob(0.05)) {
126  if (!m_farm->FP_Slurry(m_field, 0.0, g_date->DayInYear(25, 5) - g_date->DayInYear())) {
127  SimpleEvent(g_date->Date() + 1, fi_sps_slurry, true);
128  break;
129  }
130  }
131  break; //end of Slurry thread
132  // N minerals thread
133  case fi_sps_n_minerals1: //sometimes applied - 10% do this, done before 10th of May
134  if (m_ev->m_lock || m_farm->DoIt_prob(0.10)) {
135  if (!m_farm->FP_NPKS(m_field, 0.0, g_date->DayInYear(10, 5) - g_date->DayInYear())) {
136  SimpleEvent(g_date->Date() + 1, fi_sps_n_minerals1, true);
137  break;
138  }
139  }
140  break; //end of N minerals thread
141  // Spring plough thread (the 74% from before)
142  case fi_sps_spring_plough: // done before 25th of May
143  if (!m_farm->SpringPlough(m_field, 0.0, g_date->DayInYear(25, 5) - g_date->DayInYear())) {
145  break;
146  }
147  break; //end of Spring plough thread
148  // Sowing thread - starts with fertilizer, 95% do this, before 30th of May
149  case fi_sps_fertilizer:
150  if (m_ev->m_lock || m_farm->DoIt_prob(0.95)) {
151  if (!m_farm->FP_NPKS(m_field, 0.0, g_date->DayInYear(30, 5) - g_date->DayInYear())) {
152  SimpleEvent(g_date->Date() + 1, fi_sps_fertilizer, true);
153  break;
154  }
155  }
156  // LKM: Queue up next event preseeding cultivation right after - done before the 30th of May
158  break;
160  if (m_ev->m_lock || m_farm->DoIt_prob(0.95)) {
161  if (!m_farm->PreseedingCultivator(m_field, 0.0, g_date->DayInYear(30, 5) - g_date->DayInYear())) {
163  break;
164  }
165  // LKM: Queue up next event planting right after - done before the 30th of May
166  SimpleEvent(g_date->Date(), fi_sps_plant, false);
167  break;
168  }
169  else if (m_ev->m_lock || m_farm->DoIt_prob(0.05 / 0.05)) { // 5% plant with the preseeding cultivation
170  // LKM: Queue up next event planting right after - done before the 30th of May
172  break;
173  }
177  break;
178  }
179  // LKM: Queue up next event harrow, done 7 days after
180  SimpleEvent(g_date->Date() + 7, fi_sps_harrow, false);
181  break;
182  case fi_sps_plant:
183  if (!m_farm->SpringSow(m_field, 0.0, g_date->DayInYear(30, 5) - g_date->DayInYear())) {
184  SimpleEvent(g_date->Date() + 1, fi_sps_plant, true);
185  break;
186  }
187  // LKM: Queue up next event harrow, done 7 days after
188  SimpleEvent(g_date->Date() + 7, fi_sps_harrow, false);
189  break;
190  case fi_sps_harrow: // 98% do this, done before 7th of June
191  if (m_ev->m_lock || m_farm->DoIt_prob(0.98)) {
192  if (!m_farm->SpringHarrow(m_field, 0.0, g_date->DayInYear(7, 6) - g_date->DayInYear())) {
193  SimpleEvent(g_date->Date() + 1, fi_sps_harrow, true);
194  break;
195  }
196  }
197  // LKM: Here comes a fork with parallel events:
198  SimpleEvent(g_date->Date() + 2, fi_sps_herbicide1, false); // herbicide thread
199  SimpleEvent(g_date->OldDays() + g_date->DayInYear(20, 6), fi_sps_n_minerals2, false); // N minerals2 thread
200  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 7), fi_sps_fungicide1, false); // Fungicide thread - main thread
201  break;
202  // herbicide1 thread - done before the 12th of June, 90% do this
203  case fi_sps_herbicide1:
204  if (m_ev->m_lock || m_farm->DoIt_prob(0.90)) {
205  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(12, 6) - g_date->DayInYear())) {
206  SimpleEvent(g_date->Date() + 1, fi_sps_herbicide1, true);
207  break;
208  }
209  }
210  SimpleEvent(g_date->Date()+10, fi_sps_herbicide2, false); // herbicide2 thread
211  break;
212  case fi_sps_herbicide2:
213  if (m_ev->m_lock || m_farm->DoIt_prob(0.20)) {
214  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(26, 6) - g_date->DayInYear())) {
215  SimpleEvent(g_date->Date() + 1, fi_sps_herbicide2, true);
216  break;
217  }
218  }
219  SimpleEvent(g_date->Date()+10, fi_sps_herbicide3, false);
220  break;
221  case fi_sps_herbicide3:
222  if (m_ev->m_lock || m_farm->DoIt_prob(0.20)) {
223  if (!m_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(10, 7) - g_date->DayInYear())) {
224  SimpleEvent(g_date->Date() + 1, fi_sps_herbicide3, true);
225  break;
226  }
227  }
228  break; // End of herbicide thread
229  // N minerals2 thread - done before the 15th of July, 20% do this
230  case fi_sps_n_minerals2:
231  if (m_ev->m_lock || m_farm->DoIt_prob(0.20)) {
232  if (!m_farm->FP_NPKS(m_field, 0.0, g_date->DayInYear(15, 7) - g_date->DayInYear())) {
233  SimpleEvent(g_date->Date() + 1, fi_sps_n_minerals2, true);
234  break;
235  }
236  }
237  break; // End of N mineerals2 thread
238  // Fungicide thread - done before the 10th of July (suggestion, is not stated), 98% do this
239  case fi_sps_fungicide1:
240  if (m_ev->m_lock || m_farm->DoIt_prob(0.98)) {
241  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(10, 7) - g_date->DayInYear())) {
242  SimpleEvent(g_date->Date() + 1, fi_sps_fungicide1, true);
243  break;
244  }
245  }
246  // LKM: Queue up next event - fungicide2 done 7-14 days later - 98% do this
247  SimpleEvent(g_date->Date() + 7, fi_sps_fungicide2, false);
248  break;
249  case fi_sps_fungicide2:
250  if (m_ev->m_lock || m_farm->DoIt_prob(0.98)) {
251  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(24, 7) - g_date->DayInYear())) {
252  SimpleEvent(g_date->Date() + 1, fi_sps_fungicide2, true);
253  break;
254  }
255  }
256  // LKM: Queue up next event - fungicide3 done 7-14 days later - 98% do this
257  SimpleEvent(g_date->Date() + 7, fi_sps_fungicide3, false);
258  break;
259  case fi_sps_fungicide3:
260  if (m_ev->m_lock || m_farm->DoIt_prob(0.98)) {
261  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(7, 8) - g_date->DayInYear())) {
262  SimpleEvent(g_date->Date() + 1, fi_sps_fungicide3, true);
263  break;
264  }
265  }
266  // LKM: Queue up next event - fungicide4 done 7-14 days later - 70% do this
267  SimpleEvent(g_date->Date() + 7, fi_sps_fungicide4, false);
268  break;
269  case fi_sps_fungicide4:
270  if (m_ev->m_lock || m_farm->DoIt_prob(0.70)) {
271  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(21, 8) - g_date->DayInYear())) {
272  SimpleEvent(g_date->Date() + 1, fi_sps_fungicide4, true);
273  break;
274  }
275  }
276  // LKM: Queue up next event - fungicide5 done 7 days later - 45% do this
277  SimpleEvent(g_date->Date() + 7, fi_sps_fungicide5, false);
278  break;
279  case fi_sps_fungicide5:
280  if (m_ev->m_lock || m_farm->DoIt_prob(0.45)) {
281  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(28, 8) - g_date->DayInYear())) {
282  SimpleEvent(g_date->Date() + 1, fi_sps_fungicide5, true);
283  break;
284  }
285  }
286  // LKM: Queue up next event - fungicide6 done 7 days later - 15% do this
287  SimpleEvent(g_date->Date() + 7, fi_sps_fungicide6, false);
288  break;
289  case fi_sps_fungicide6:
290  if (m_ev->m_lock || m_farm->DoIt_prob(0.15)) {
291  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(4, 9) - g_date->DayInYear())) {
292  SimpleEvent(g_date->Date() + 1, fi_sps_fungicide6, true);
293  break;
294  }
295  }
296  // LKM: Queue up next event - fungicide7 done 7 days later - 2% do this
297  SimpleEvent(g_date->Date() + 7, fi_sps_fungicide7, false);
298  break;
299  case fi_sps_fungicide7:
300  if (m_ev->m_lock || m_farm->DoIt_prob(0.02)) {
301  if (!m_farm->FungicideTreat(m_field, 0.0, g_date->DayInYear(11, 9) - g_date->DayInYear())) {
302  SimpleEvent(g_date->Date() + 1, fi_sps_fungicide7, true);
303  break;
304  }
305  }
306  // LKM: Queue up next event - insecticide (no dates) - 3% do this
308  break;
309  case fi_sps_insecticide: // no later than 31st of August (suggestion)
310 #ifdef ECOSTACK_BIOPESTICIDE
311  if (m_ev->m_lock || m_farm->DoIt_prob(0.06)) {
312 #else
313  if (m_ev->m_lock || m_farm->DoIt_prob(0.03)) {
314 #endif
315  // here we check whether we are using ERA pesticide or not
316  d1 = g_date->DayInYear(30, 9) - g_date->DayInYear();
317  if (!cfg_pest_potatoes_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
318  {
319 #ifdef ECOSTACK_BIOPESTICIDE
320  flag = m_farm->BiocideTreat(m_field, 0.0, d1);
321 #else
322  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
323 #endif
324  }
325  else {
326  flag = m_farm->ProductApplication(m_field, 0.0, d1, cfg_pest_product_amounts.value(0), ppp_1, false, 3);
327  }
328  if (!flag) {
330  break;
331  }
332  }
333  // LKM: Queue up the next event - harvest done after the 20th of August
335  break;
336  // LKM: do harvest before 7th of October
337  case fi_sps_harvest:
338  if (!m_farm->HarvestLong(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
339  SimpleEvent(g_date->Date() + 1, fi_sps_harvest, true);
340  break;
341  }
342  m_field->SetVegPatchy(false);
343  done = true;
344  break;
345 
346  default:
347  g_msg->Warn(WARN_BUG, "FI_StarchPotato_South::Do(): "
348  "Unknown event type! ", "");
349  exit(1);
350  }
351  if (done) m_ev->m_forcespring = true; // Here we need to force the next crop to spring operation, so set the ev->forcespring to true
352  return done;
353 }

References Farm::AutumnPlough(), Farm::BiocideTreat(), cfg_pest_potatoes_on, cfg_pest_product_amounts, LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), Farm::DoIt_prob(), fi_sps_autumn_plough, fi_sps_fertilizer, fi_sps_fungicide1, fi_sps_fungicide2, fi_sps_fungicide3, fi_sps_fungicide4, fi_sps_fungicide5, fi_sps_fungicide6, fi_sps_fungicide7, fi_sps_harrow, fi_sps_harvest, fi_sps_herbicide1, fi_sps_herbicide2, fi_sps_herbicide3, fi_sps_insecticide, fi_sps_n_minerals1, fi_sps_n_minerals2, fi_sps_plant, fi_sps_preseeding_cultivation, fi_sps_preseeding_plant, fi_sps_slurry, fi_sps_spring_plough, fi_sps_start, fi_sps_stubble_cultivator, Farm::FP_NPKS(), Farm::FP_Slurry(), Farm::FungicideTreat(), g_date, g_msg, LE::GetMDates(), Farm::HarvestLong(), Farm::HerbicideTreat(), Farm::InsecticideTreat(), 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::PreseedingCultivator(), Farm::PreseedingCultivatorSow(), Farm::ProductApplication(), LE::SetVegPatchy(), Crop::SimpleEvent(), Crop::SimpleEvent_(), Farm::SpringHarrow(), Farm::SpringPlough(), Farm::SpringSow(), Crop::StartUpCrop(), Farm::StubbleCultivatorHeavy(), tov_FIStarchPotato_South, CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), and WARN_BUG.

◆ SetUpFarmCategoryInformation()

void FI_StarchPotato_South::SetUpFarmCategoryInformation ( )
inline
76  {
77  const int elements = 2 + (fi_sps_foobar - FI_SPS_BASE);
79 
80  FarmManagementCategory catlist[elements] =
81  {
82  fmc_Others, // zero element unused but must be here
83  fmc_Others, // fi_sps_start = 1, // Compulsory, start event must always be 1 (one).
84  fmc_Harvest, // fi_sps_harvest = FI_SPS_BASE,
85  fmc_Cultivation, // fi_sps_stubble_cultivator,
86  fmc_Cultivation, // fi_sps_autumn_plough,
87  fmc_Fertilizer, // fi_sps_slurry,
88  fmc_Cultivation, // fi_sps_spring_plough,
89  fmc_Fertilizer, // fi_sps_n_minerals1,
90  fmc_Fertilizer, // fi_sps_n_minerals2,
91  fmc_Cultivation, // fi_sps_preseeding_cultivation,
92  fmc_Fertilizer, // fi_sps_fertilizer,
93  fmc_Cultivation, // fi_sps_preseeding_plant,
94  fmc_Others, // fi_sps_plant,
95  fmc_Cultivation, // fi_sps_harrow,
96  fmc_Herbicide, // fi_sps_herbicide1,
97  fmc_Herbicide, // fi_sps_herbicide2,
98  fmc_Herbicide, // fi_sps_herbicide3,
99  fmc_Fungicide, // fi_sps_fungicide1,
100  fmc_Fungicide, // fi_sps_fungicide2,
101  fmc_Fungicide, // fi_sps_fungicide3,
102  fmc_Fungicide, // fi_sps_fungicide4,
103  fmc_Fungicide, // fi_sps_fungicide5,
104  fmc_Fungicide, // fi_sps_fungicide6,
105  fmc_Fungicide, // fi_sps_fungicide7,
106  fmc_Insecticide // fi_sps_insecticide,
107 
108 
109  // no foobar entry
110 
111  };
112  // Iterate over the catlist elements and copy them to vector
113  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
114 
115  }

References FI_SPS_BASE, fi_sps_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_South().


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
fi_sps_foobar
Definition: FI_StarchPotato_South.h:61
fi_sps_harvest
Definition: FI_StarchPotato_South.h:38
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
fi_sps_preseeding_cultivation
Definition: FI_StarchPotato_South.h:45
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
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_sps_herbicide3
Definition: FI_StarchPotato_South.h:52
fi_sps_plant
Definition: FI_StarchPotato_South.h:48
fi_sps_fungicide4
Definition: FI_StarchPotato_South.h:56
fi_sps_spring_plough
Definition: FI_StarchPotato_South.h:42
fi_sps_preseeding_plant
Definition: FI_StarchPotato_South.h:47
fi_sps_n_minerals2
Definition: FI_StarchPotato_South.h:44
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
LE::ClearManagementActionSum
void ClearManagementActionSum()
clears the management action counters
Definition: Elements.h:247
fi_sps_insecticide
Definition: FI_StarchPotato_South.h:60
fi_sps_herbicide2
Definition: FI_StarchPotato_South.h:51
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
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.
fi_sps_fungicide7
Definition: FI_StarchPotato_South.h:59
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
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
fi_sps_fungicide1
Definition: FI_StarchPotato_South.h:53
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
FI_StarchPotato_South::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: FI_StarchPotato_South.h:76
cfg_pest_potatoes_on
CfgBool cfg_pest_potatoes_on
Turn on pesticides for potatoes.
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_sps_autumn_plough
Definition: FI_StarchPotato_South.h:40
fi_sps_fungicide2
Definition: FI_StarchPotato_South.h:54
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
fi_sps_harrow
Definition: FI_StarchPotato_South.h:49
Calendar::Date
long Date(void)
Definition: Calendar.h:57
tov_FIStarchPotato_South
Definition: LandscapeFarmingEnums.h:528
fi_sps_slurry
Definition: FI_StarchPotato_South.h:41
FI_SPS_BASE
#define FI_SPS_BASE
Definition: FI_StarchPotato_South.h:31
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
LE::SetVegPatchy
void SetVegPatchy(bool p)
Definition: Elements.h:229
fi_sps_fertilizer
Definition: FI_StarchPotato_South.h:46
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
fi_sps_fungicide5
Definition: FI_StarchPotato_South.h:57
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
fi_sps_fungicide3
Definition: FI_StarchPotato_South.h:55
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
fi_sps_fungicide6
Definition: FI_StarchPotato_South.h:58
fi_sps_start
Definition: FI_StarchPotato_South.h:37
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
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
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
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
fi_sps_stubble_cultivator
Definition: FI_StarchPotato_South.h:39
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
fi_sps_herbicide1
Definition: FI_StarchPotato_South.h:50
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
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
fi_sps_n_minerals1
Definition: FI_StarchPotato_South.h:43
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
Crop::m_forcespringpossible
bool m_forcespringpossible
Used to signal that the crop can be forced to start in spring.
Definition: Farm.h:508
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
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