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

#include <SpringBarleyStrigling.h>

Inheritance diagram for SpringBarleyStrigling:
Crop

Public Member Functions

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

◆ SpringBarleyStrigling()

SpringBarleyStrigling::SpringBarleyStrigling ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
81  : Crop(a_tov, a_toc, a_L)
82  {
85  }

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

Member Function Documentation

◆ Do()

bool SpringBarleyStrigling::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 
45  bool done = false;
46 
47  switch ( m_ev->m_todo ) {
48  case sbst_start: {
49  a_field->ClearManagementActionSum();
50 
51  // Set up the date management stuff
52  // Could save the start day in case it is needed later
53  // m_field->m_startday = m_ev->m_startday;
54  m_last_date = g_date->DayInYear( 30, 8 );
55  // Start and stop dates for all events after harvest
56  int noDates = 2;
57  m_field->SetMDates( 0, 0, g_date->DayInYear( 20, 8 ) );
58  // Determined by harvest date - used to see if at all possible
59  m_field->SetMDates( 1, 0, g_date->DayInYear( 10, 8 ) );
60  m_field->SetMDates( 0, 1, g_date->DayInYear( 10, 8 ) );
61  m_field->SetMDates( 1, 1, g_date->DayInYear( 30, 8 ) );
62  // Check the next crop for early start, unless it is a spring crop
63  // in which case we ASSUME that no checking is necessary!!!!
64  // So DO NOT implement a crop that runs over the year boundary
65  if ( m_ev->m_startday > g_date->DayInYear( 1, 7 ) ) {
66  if ( m_field->GetMDates( 0, 0 ) >= m_ev->m_startday ) {
67  g_msg->Warn( WARN_BUG, "SpringBarley::Do(): ""Harvest too late for the next crop to start!!!", "" );
68  exit( 1 );
69  }
70  // Now fix any late finishing problems
71  for ( int i = 0; i < noDates; i++ ) {
72  if ( m_field->GetMDates( 0, i ) >= m_ev->m_startday )
73  m_field->SetMDates( 0, i, m_ev->m_startday - 1 );
74  if ( m_field->GetMDates( 1, i ) >= m_ev->m_startday )
75  m_field->SetMDates( 1, i, m_ev->m_startday - 1 );
76  }
77  }
78  // Now no operations can be timed after the start of the next crop.
79 
80  int d1;
81  if ( !m_ev->m_first_year ) {
82  int today = g_date->Date();
83  // Are we before July 1st?
84  d1 = g_date->OldDays() + g_date->DayInYear( 1, 7 );
85  if ( today < d1 ) {
86  // Yes, too early. We assumme this is because the last crop was late
87  g_msg->Warn( WARN_BUG, "SpringBarley::Do(): ""Crop start attempt between 1st Jan & 1st July", "" );
88  exit( 1 );
89  } else {
90  d1 = g_date->OldDays() + m_first_date; // Add 365 for spring crop
91  if ( today > d1 ) {
92  // Yes too late - should not happen - raise an error
93  g_msg->Warn( WARN_BUG, "SpringBarley::Do(): ""Crop start attempt after last possible start date", "" );
94  exit( 1 );
95  }
96  }
97  } else {
99  break;
100  }
101  // End single block date checking code. Please see next line
102  // comment as well.
103  // Reinit d1 to first possible starting date.
104  d1 = g_date->OldDays() + g_date->DayInYear( 1, 11 );
105  if ( g_date->Date() > d1 ) {
106  d1 = g_date->Date();
107  }
108 
109  // OK, let's go.
110  SimpleEvent( d1, sbst_autumn_plough, false );
111  SBST_SLURRY_DONE = false;
112  SBST_MANURE_DONE = false;
113  SBST_SLURRY_EXEC = false;
114  SBST_MANURE_EXEC = false;
115  SBST_DID_AUTUMN_PLOUGH = false;
116  }
117  break;
118 
119  case sbst_autumn_plough:
120  if ( m_ev->m_lock || m_farm->DoIt( 70 ) ) {
121  if ( !m_farm->AutumnPlough( m_field, 0.0, g_date->DayInYear( 30, 11 ) - g_date->DayInYear() ) ) {
122  SimpleEvent( g_date->Date() + 1, sbst_autumn_plough, true );
123  break;
124  }
125  SBST_DID_AUTUMN_PLOUGH = true;
126  }
127  // +365 for next year
128  if ( m_farm->IsStockFarmer() ) // StockFarmer
129  {
130  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15, 3 ) + 365, sbst_fertslurry_stock, false );
131  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15, 3 ) + 365, sbst_fertmanure_stock_one, false );
132  } else { // PlantFarmer
133  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 20, 3 ) + 365, sbst_spring_plough, false );
134  }
135  break;
136 
137  //*** The stock farmers thread
139  if ( m_ev->m_lock || m_farm->DoIt( 90 ) ) {
140  if ( !m_farm->FA_Slurry( m_field, 0.0, g_date->DayInYear( 10, 4 ) - g_date->DayInYear() ) ) {
141  SimpleEvent( g_date->Date() + 1, sbst_fertslurry_stock, true );
142  break;
143  }
144  SBST_SLURRY_EXEC = true;
145  }
146  SBST_SLURRY_DONE = true;
147  if ( SBST_MANURE_DONE ) {
148  // We are the last thread, so queue up spring plough.
150  }
151  break;
152 
154  if ( m_ev->m_lock || m_farm->DoIt( 67 ) ) {
155  if ( !m_farm->FA_Manure( m_field, 0.0, g_date->DayInYear( 15, 4 ) - g_date->DayInYear() ) ) {
157  break;
158  }
159  SBST_MANURE_EXEC = true;
160  }
161  SBST_MANURE_DONE = true;
162  if ( SBST_SLURRY_DONE ) {
164  }
165  break;
166 
167  case sbst_spring_plough:
168  if ( !SBST_DID_AUTUMN_PLOUGH ) {
169  if ( !m_farm->SpringPlough( m_field, 0.0, g_date->DayInYear( 10, 4 ) - g_date->DayInYear() ) ) {
170  SimpleEvent( g_date->Date() + 1, sbst_spring_plough, true );
171  break;
172  }
173  }
174  {
175  int d1 = g_date->Date();
176  if ( d1 < g_date->OldDays() + g_date->DayInYear( 20, 3 ) ) {
177  d1 = g_date->OldDays() + g_date->DayInYear( 20, 3 );
178  }
179  SimpleEvent( d1, sbst_spring_harrow, false );
180  }
181  break;
182 
183  case sbst_spring_harrow:
184  if ( !m_farm->SpringHarrow( m_field, 0.0, g_date->DayInYear( 10, 4 ) - g_date->DayInYear() ) ) {
185  SimpleEvent( g_date->Date() + 1, sbst_spring_harrow, true );
186  break;
187  }
188  if ( m_farm->IsStockFarmer() ) {
190  } else {
192  }
193  break;
194 
196  if ( m_ev->m_lock || m_farm->DoIt( 65 ) || ( !SBST_SLURRY_EXEC && !SBST_MANURE_EXEC ) ) {
197  if ( !m_farm->FA_NPK( m_field, 0.0, g_date->DayInYear( 10, 4 ) - g_date->DayInYear() ) ) {
199  break;
200  }
201  }
202  {
203  int d1 = g_date->Date();
204  if ( d1 < g_date->OldDays() + g_date->DayInYear( 25, 3 ) ) {
205  d1 = g_date->OldDays() + g_date->DayInYear( 25, 3 );
206  }
207  SimpleEvent( d1, sbst_spring_sow, false );
208  }
209  break;
210 
212  if ( m_ev->m_lock || m_farm->DoIt( 75 ) ) {
213  if ( !m_farm->FP_NPK( m_field, 0.0, g_date->DayInYear( 10, 4 ) - g_date->DayInYear() ) ) {
214  SimpleEvent( g_date->Date() + 1, sbst_fertmanure_plant, true );
215  break;
216  }
217  // Did FP_NPK so go directly to spring sow.
218  {
219  int d1 = g_date->Date();
220  if ( d1 < g_date->OldDays() + g_date->DayInYear( 25, 3 ) ) {
221  d1 = g_date->OldDays() + g_date->DayInYear( 25, 3 );
222  }
223  SimpleEvent( d1, sbst_spring_sow, false );
224  }
225  break;
226  }
228  break;
229 
230  case sbst_fertlnh3_plant:
231  if ( !m_farm->FP_LiquidNH3( m_field, 0.0, g_date->DayInYear( 10, 4 ) - g_date->DayInYear() ) ) {
232  SimpleEvent( g_date->Date() + 1, sbst_fertlnh3_plant, true );
233  break;
234  }
236  break;
237 
238  case sbst_fertpk_plant:
239  if ( !m_farm->FP_PK( m_field, 0.0, g_date->DayInYear( 10, 4 ) - g_date->DayInYear() ) ) {
240  SimpleEvent( g_date->Date() + 1, sbst_fertpk_plant, true );
241  break;
242  }
243  {
244  int d1 = g_date->Date();
245  if ( d1 < g_date->OldDays() + g_date->DayInYear( 25, 3 ) ) {
246  d1 = g_date->OldDays() + g_date->DayInYear( 25, 3 );
247  }
248  SimpleEvent( d1, sbst_spring_sow, false );
249  }
250  break;
251 
252  case sbst_spring_sow:
253  if ( !m_farm->SpringSow( m_field, 0.0, g_date->DayInYear( 10, 4 ) - g_date->DayInYear() ) ) {
254  SimpleEvent( g_date->Date() + 1, sbst_spring_sow, true );
255  break;
256  }
257  {
258  int d1 = g_date->Date();
259  if ( d1 < g_date->OldDays() + g_date->DayInYear( 5, 4 ) ) {
260  d1 = g_date->OldDays() + g_date->DayInYear( 5, 4 );
261  }
262  SimpleEvent( d1, sbst_spring_roll, false );
263  }
264  break;
265 
266  case sbst_spring_roll:
267  if ( m_ev->m_lock || m_farm->DoIt( 30 ) ) {
268  if ( !m_farm->SpringRoll( m_field, 0.0, g_date->DayInYear( 20, 4 ) - g_date->DayInYear() ) ) {
269  SimpleEvent( g_date->Date() + 1, sbst_spring_roll, true );
270  break;
271  }
272  }
273  SBST_HERBI_DATE = 0;
274  SBST_GR_DATE = 0;
275  SBST_FUNGI_DATE = 0;
276  SBST_WATER_DATE = 0;
277  SBST_INSECT_DATE = 0;
279  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 10, 5 ), sbst_fungicide_one, false ); // Main.
280  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 10, 5 ), sbst_GR, false );
281  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15, 5 ), sbst_water_one, false );
282  break;
283  break;
284 
285  case sbst_strigling_one:
286  if ( m_ev->m_lock || ( cfg_strigling_prop.value() * m_farm->DoIt( 90 ) ) ) {
287  if ( !m_farm->Strigling( m_field, 0.0, g_date->DayInYear( 20, 4 ) - g_date->DayInYear() ) ) {
288  SimpleEvent( g_date->Date() + 1, sbst_strigling_one, true );
289  break;
290  } else {
291  if ( g_date->Date() + 5 < g_date->DayInYear( 10, 4 ) )
292  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 10, 4 ), sbst_strigling_two, false ); else
293  SimpleEvent( g_date->Date() + 5, sbst_strigling_two, false );
294  }
295  break;
296  }
297  // end the thread
298  break;
299 
300  case sbst_strigling_two:
301  if ( !m_farm->Strigling( m_field, 0.0, g_date->DayInYear( 25, 4 ) - g_date->DayInYear() ) ) {
302  SimpleEvent( g_date->Date() + 1, sbst_strigling_two, true );
303  break;
304  } else {
305  if ( g_date->Date() + 5 < g_date->DayInYear( 21, 4 ) )
306  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 21, 4 ), sbst_strigling_three, false ); else
307  SimpleEvent( g_date->Date() + 5, sbst_strigling_three, false );
308  }
309  break;
310 
312  if ( m_ev->m_lock || ( cfg_strigling_prop.value() * m_farm->DoIt( 89 ) ) ) {
313  if ( !m_farm->Strigling( m_field, 0.0, g_date->DayInYear( 5, 5 ) - g_date->DayInYear() ) ) {
314  SimpleEvent( g_date->Date() + 1, sbst_strigling_three, true );
315  break;
316  } else {
317  if ( g_date->Date() + 5 < g_date->DayInYear( 10, 5 ) )
318  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 10, 5 ), sbst_strigling_four, false ); else
319  SimpleEvent( g_date->Date() + 5, sbst_strigling_four, false );
320  }
321  }
322  break;
323 
324  case sbst_strigling_four:
325  if ( m_ev->m_lock || ( cfg_strigling_prop.value() * m_farm->DoIt( 5 ) ) ) {
326  if ( !m_farm->Strigling( m_field, 0.0, g_date->DayInYear( 11, 5 ) - g_date->DayInYear() ) ) {
327  SimpleEvent( g_date->Date() + 1, sbst_strigling_three, true );
328  break;
329  }
330  }
331  // end the thread
332  break;
333 
334 
335  // GReg thread
336  case sbst_GR:
337  if ( g_date->Date() < SBST_HERBI_DATE + 1 || g_date->Date() < SBST_FUNGI_DATE + 1 ) {
338  SimpleEvent( g_date->Date() + 1, sbst_GR, m_ev->m_lock );
339  break;
340  }
341  if ( m_ev->m_lock || m_farm->DoIt( ( int )floor( 0.5 + 5 * cfg_greg_app_prop.value() ) ) ) {
342  if ( !m_farm->GrowthRegulator( m_field, 0.0, g_date->DayInYear( 25, 5 ) - g_date->DayInYear() ) ) {
343  SimpleEvent( g_date->Date() + 1, sbst_GR, true );
344  break;
345  }
346  SBST_GR_DATE = g_date->Date();
347  }
348  break;
349 
350  // Fungicide thread & MAIN THREAD
351  case sbst_fungicide_one:
352  if ( g_date->Date() < SBST_HERBI_DATE + 1 || g_date->Date() < SBST_GR_DATE + 1 ) {
354  break;
355  }
356  if ( m_ev->m_lock || m_farm->DoIt( ( int )floor( 0.5 + 30 * cfg_fungi_app_prop1.value() ) ) ) {
357  if ( !m_farm->FungicideTreat( m_field, 0.0, g_date->DayInYear( 25, 5 ) - g_date->DayInYear() ) ) {
358  SimpleEvent( g_date->Date() + 1, sbst_fungicide_one, true );
359  break;
360  }
362  {
363  int d1 = g_date->Date() + 10;
364  if ( d1 < g_date->OldDays() + g_date->DayInYear( 25, 5 ) ) {
365  d1 = g_date->OldDays() + g_date->DayInYear( 25, 5 );
366  }
367  SimpleEvent( d1, sbst_fungicide_two, false );
368  }
369  }
370  {
371  int d1 = g_date->Date();
372  if ( d1 < g_date->OldDays() + g_date->DayInYear( 15, 5 ) ) {
373  d1 = g_date->OldDays() + g_date->DayInYear( 15, 5 );
374  }
375  SimpleEvent( d1, sbst_insecticide, false );
376  }
377  break;
378 
379  case sbst_fungicide_two:
380  if ( g_date->Date() < SBST_HERBI_DATE + 1 || g_date->Date() < SBST_GR_DATE + 1 ) {
382  break;
383  }
384  if ( m_ev->m_lock || m_farm->DoIt( ( int )floor( 0.5 + 33 * cfg_fungi_app_prop1.value() ) ) ) {
385  if ( !m_farm->FungicideTreat( m_field, 0.0, g_date->DayInYear( 10, 6 ) - g_date->DayInYear() ) ) {
386  SimpleEvent( g_date->Date() + 1, sbst_fungicide_two, true );
387  break;
388  }
390  }
391  break;
392 
393  // Water thread
394  case sbst_water_one:
395  if ( g_date->Date() < SBST_HERBI_DATE + 1 || g_date->Date() < SBST_FUNGI_DATE + 1 ) {
397  break;
398  }
399  if ( m_ev->m_lock || m_farm->DoIt( 20 ) ) {
400  if ( !m_farm->Water( m_field, 0.0, g_date->DayInYear( 30, 5 ) - g_date->DayInYear() ) ) {
401  SimpleEvent( g_date->Date() + 1, sbst_water_one, true );
402  break;
403  }
405  }
406  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1, 6 ), sbst_water_two, false );
407  break;
408 
409  case sbst_water_two:
410  if ( g_date->Date() < SBST_INSECT_DATE + 1 ) {
412  break;
413  }
414  if ( m_ev->m_lock || m_farm->DoIt( 10 ) ) {
415  if ( !m_farm->Water( m_field, 0.0, g_date->DayInYear( 1, 7 ) - g_date->DayInYear() ) ) {
416  SimpleEvent( g_date->Date() + 1, sbst_water_two, true );
417  break;
418  }
420  }
421  break;
422 
423  // Insecticide thread & MAIN THREAD
424  case sbst_insecticide:
425  if ( g_date->Date() < SBST_WATER_DATE + 1 ) {
427  break;
428  }
429  if ( m_ev->m_lock || m_farm->DoIt( ( int )floor( 0.5 + 35 * cfg_ins_app_prop1.value() ) ) ) {
430  if ( !m_farm->InsecticideTreat( m_field, 0.0, g_date->DayInYear( 10, 6 ) - g_date->DayInYear() ) ) {
431  SimpleEvent( g_date->Date() + 1, sbst_insecticide, true );
432  break;
433  }
435  }
436  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1, 8 ), sbst_harvest, false );
437  break;
438 
439  case sbst_harvest:
440  if ( !m_farm->Harvest( m_field, 0.0, g_date->DayInYear( 20, 8 ) - g_date->DayInYear() ) ) {
441  SimpleEvent( g_date->Date() + 1, sbst_harvest, true );
442  break;
443  }
445  break;
446 
447  case sbst_straw_chopping:
448  if ( m_ev->m_lock || m_farm->DoIt( 50 ) ) {
449  // Force straw chopping to happen on the same day as harvest.
450  if ( !m_farm->StrawChopping( m_field, 0.0, 0 ) ) {
451  // Shouldn't happen.
453  break;
454  }
455  // Did chop, so go directly to stubble harrowing.
457  break;
458  }
459  // Do hay baling first.
460  SimpleEvent( g_date->Date(), sbst_hay_baling, false );
461  break;
462 
463  case sbst_hay_baling:
464  if ( !m_farm->HayBailing( m_field, 0.0, m_field->GetMDates( 1, 0 ) - g_date->DayInYear() ) ) {
465  SimpleEvent( g_date->Date() + 1, sbst_hay_baling, true );
466  break;
467  }
469  break;
470 
471  case sbst_stubble_harrow:
472  if ( m_ev->m_lock || m_farm->DoIt( 60 ) ) {
473  if ( !m_farm->StubbleHarrowing( m_field, 0.0, m_field->GetMDates( 1, 1 ) - g_date->DayInYear() ) ) {
474  SimpleEvent( g_date->Date() + 1, sbst_stubble_harrow, true );
475  break;
476  }
477  }
478  // END MAIN THREAD
479  done = true;
480  break;
481 
482  default:
483  g_msg->Warn( WARN_BUG, "SpringBarley::Do(): ""Unknown event type! ", "" );
484  exit( 1 );
485  }
486  return done;
487 }

References Farm::AutumnPlough(), cfg_fungi_app_prop1, cfg_greg_app_prop, cfg_ins_app_prop1, cfg_strigling_prop, LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), Farm::DoIt(), Farm::FA_Manure(), Farm::FA_NPK(), Farm::FA_Slurry(), Farm::FP_LiquidNH3(), Farm::FP_NPK(), Farm::FP_PK(), Farm::FungicideTreat(), g_date, g_msg, LE::GetMDates(), Farm::GrowthRegulator(), Farm::Harvest(), Farm::HayBailing(), Farm::InsecticideTreat(), Farm::IsStockFarmer(), 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(), sbst_autumn_plough, SBST_DID_AUTUMN_PLOUGH, sbst_fertlnh3_plant, sbst_fertmanure_plant, sbst_fertmanure_stock_one, sbst_fertmanure_stock_two, sbst_fertpk_plant, sbst_fertslurry_stock, SBST_FUNGI_DATE, sbst_fungicide_one, sbst_fungicide_two, sbst_GR, SBST_GR_DATE, sbst_harvest, sbst_hay_baling, SBST_HERBI_DATE, SBST_INSECT_DATE, sbst_insecticide, SBST_MANURE_DONE, SBST_MANURE_EXEC, SBST_SLURRY_DONE, SBST_SLURRY_EXEC, sbst_spring_harrow, sbst_spring_plough, sbst_spring_roll, sbst_spring_sow, sbst_start, sbst_straw_chopping, sbst_strigling_four, sbst_strigling_one, sbst_strigling_three, sbst_strigling_two, sbst_stubble_harrow, SBST_WATER_DATE, sbst_water_one, sbst_water_two, LE::SetMDates(), Crop::SimpleEvent(), Farm::SpringHarrow(), Farm::SpringPlough(), Farm::SpringRoll(), Farm::SpringSow(), Farm::StrawChopping(), Farm::Strigling(), Farm::StubbleHarrowing(), CfgFloat::value(), MapErrorMsg::Warn(), WARN_BUG, and Farm::Water().

◆ SetUpFarmCategoryInformation()

void SpringBarleyStrigling::SetUpFarmCategoryInformation ( )
inline
86  {
87  const int elements = 2 + (sbst_foobar - SBST_BASE);
89 
90  FarmManagementCategory catlist[elements] =
91  {
92  fmc_Others, // zero element unused but must be here
93  fmc_Others,//sbst_start = 1, // Compulsory, start event must always be 1 (one).
94  fmc_Cultivation,//sbst_autumn_plough = SBST_BASE,
95  fmc_Fertilizer,//sbst_fertslurry_stock,
96  fmc_Fertilizer,//sbst_fertmanure_stock_one,
97  fmc_Fertilizer,//sbst_spring_plough,
98  fmc_Fertilizer,//sbst_spring_harrow,
99  fmc_Fertilizer,//sbst_fertmanure_plant,
100  fmc_Fertilizer,//sbst_fertlnh3_plant,
101  fmc_Fertilizer,//sbst_fertpk_plant,
102  fmc_Fertilizer,//sbst_fertmanure_stock_two,
103  fmc_Fertilizer,//sbst_fertnpk_stock,
104  fmc_Others,//sbst_spring_sow,
105  fmc_Others,//sbst_spring_roll,
106  fmc_Cultivation,//sbst_strigling_one,
107  fmc_Cultivation,//sbst_strigling_two,
108  fmc_Cultivation,//sbst_strigling_three,
109  fmc_Cultivation,//sbst_strigling_four,
110  fmc_Others,//sbst_GR,
111  fmc_Fungicide,//sbst_fungicide_one,
112  fmc_Insecticide,//sbst_insecticide,
113  fmc_Fungicide,//sbst_fungicide_two,
114  fmc_Watering,//sbst_water_one,
115  fmc_Watering,//sbst_water_two,
116  fmc_Harvest,//sbst_harvest,
117  fmc_Others,//sbst_straw_chopping,
118  fmc_Others,//sbst_hay_baling,
119  fmc_Cultivation//sbst_stubble_harrow
120 
121  // no foobar entry
122 
123  };
124  // Iterate over the catlist elements and copy them to vector
125  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
126 
127  }

References fmc_Cultivation, fmc_Fertilizer, fmc_Fungicide, fmc_Harvest, fmc_Insecticide, fmc_Others, fmc_Watering, Crop::m_base_elements_no, Crop::m_ManagementCategories, SBST_BASE, and sbst_foobar.

Referenced by SpringBarleyStrigling().


The documentation for this class was generated from the following files:
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
Farm::SpringRoll
virtual bool SpringRoll(LE *a_field, double a_user, int a_days)
Carry out a roll event in the spring on a_field.
Definition: FarmFuncs.cpp:487
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
sbst_fertlnh3_plant
Definition: SpringBarleyStrigling.h:52
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
SBST_GR_DATE
#define SBST_GR_DATE
Definition: SpringBarleyStrigling.h:39
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::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
Farm::Strigling
virtual bool Strigling(LE *a_field, double a_user, int a_days)
Carry out a mechanical weeding on a_field.
Definition: FarmFuncs.cpp:1206
SBST_MANURE_EXEC
#define SBST_MANURE_EXEC
Definition: SpringBarleyStrigling.h:35
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
SBST_HERBI_DATE
#define SBST_HERBI_DATE
Definition: SpringBarleyStrigling.h:38
sbst_start
Definition: SpringBarleyStrigling.h:45
cfg_fungi_app_prop1
CfgFloat cfg_fungi_app_prop1
LE::ClearManagementActionSum
void ClearManagementActionSum()
clears the management action counters
Definition: Elements.h:247
Farm::FP_NPK
virtual bool FP_NPK(LE *a_field, double a_user, int a_days)
Apply NPK fertilizer, on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:645
Farm::DoIt
bool DoIt(double a_probability)
Return chance out of 0 to 100.
Definition: Farm.cpp:856
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
Farm::FA_Manure
virtual bool FA_Manure(LE *a_field, double a_user, int a_days)
Spread manure on a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1110
SBST_MANURE_DONE
#define SBST_MANURE_DONE
Definition: SpringBarleyStrigling.h:33
sbst_harvest
Definition: SpringBarleyStrigling.h:68
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
sbst_spring_harrow
Definition: SpringBarleyStrigling.h:50
CfgFloat::value
double value() const
Definition: Configurator.h:142
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
SBST_SLURRY_DONE
#define SBST_SLURRY_DONE
Definition: SpringBarleyStrigling.h:32
sbst_fertpk_plant
Definition: SpringBarleyStrigling.h:53
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
FarmEvent::m_startday
int m_startday
Definition: Farm.h:385
Farm::FA_NPK
virtual bool FA_NPK(LE *a_field, double a_user, int a_days)
Apply NPK fertilizer to a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:982
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
sbst_fungicide_one
Definition: SpringBarleyStrigling.h:63
Farm::FP_PK
virtual bool FP_PK(LE *a_field, double a_user, int a_days)
Apply PK fertilizer, on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:673
Crop::SimpleEvent
void SimpleEvent(long a_date, int a_todo, bool a_lock)
Adds an event to this crop management.
Definition: Farm.cpp:747
sbst_strigling_two
Definition: SpringBarleyStrigling.h:59
sbst_fertmanure_stock_one
Definition: SpringBarleyStrigling.h:48
sbst_GR
Definition: SpringBarleyStrigling.h:62
SpringBarleyStrigling::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: SpringBarleyStrigling.h:86
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
sbst_insecticide
Definition: SpringBarleyStrigling.h:64
sbst_spring_sow
Definition: SpringBarleyStrigling.h:56
sbst_spring_plough
Definition: SpringBarleyStrigling.h:49
Calendar::Date
long Date(void)
Definition: Calendar.h:57
SBST_SLURRY_EXEC
#define SBST_SLURRY_EXEC
Definition: SpringBarleyStrigling.h:34
sbst_strigling_four
Definition: SpringBarleyStrigling.h:61
sbst_straw_chopping
Definition: SpringBarleyStrigling.h:69
SBST_FUNGI_DATE
#define SBST_FUNGI_DATE
Definition: SpringBarleyStrigling.h:40
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
Farm::HayBailing
virtual bool HayBailing(LE *a_field, double a_user, int a_days)
Carry out hay bailing on a_field.
Definition: FarmFuncs.cpp:1507
sbst_fertmanure_stock_two
Definition: SpringBarleyStrigling.h:54
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
sbst_strigling_one
Definition: SpringBarleyStrigling.h:58
sbst_water_one
Definition: SpringBarleyStrigling.h:66
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
sbst_foobar
Definition: SpringBarleyStrigling.h:72
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
SBST_INSECT_DATE
#define SBST_INSECT_DATE
Definition: SpringBarleyStrigling.h:42
cfg_strigling_prop
CfgFloat cfg_strigling_prop
sbst_hay_baling
Definition: SpringBarleyStrigling.h:70
sbst_strigling_three
Definition: SpringBarleyStrigling.h:60
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
sbst_fertmanure_plant
Definition: SpringBarleyStrigling.h:51
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
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
sbst_water_two
Definition: SpringBarleyStrigling.h:67
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
sbst_fertslurry_stock
Definition: SpringBarleyStrigling.h:47
Farm::FP_LiquidNH3
virtual bool FP_LiquidNH3(LE *a_field, double a_user, int a_days)
Apply liquid ammonia fertilizer to a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:808
sbst_stubble_harrow
Definition: SpringBarleyStrigling.h:71
SBST_WATER_DATE
#define SBST_WATER_DATE
Definition: SpringBarleyStrigling.h:41
SBST_BASE
#define SBST_BASE
Definition: SpringBarleyStrigling.h:31
sbst_fungicide_two
Definition: SpringBarleyStrigling.h:65
sbst_autumn_plough
Definition: SpringBarleyStrigling.h:46
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
Farm::GrowthRegulator
virtual bool GrowthRegulator(LE *a_field, double a_user, int a_days)
Apply growth regulator to a_field.
Definition: FarmFuncs.cpp:2070
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
sbst_spring_roll
Definition: SpringBarleyStrigling.h:57
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
cfg_ins_app_prop1
CfgFloat cfg_ins_app_prop1
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
WARN_BUG
Definition: MapErrorMsg.h:34
SBST_DID_AUTUMN_PLOUGH
#define SBST_DID_AUTUMN_PLOUGH
Definition: SpringBarleyStrigling.h:36
cfg_greg_app_prop
CfgFloat cfg_greg_app_prop
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
Farm::StubbleHarrowing
virtual bool StubbleHarrowing(LE *a_field, double a_user, int a_days)
Carry out stubble harrowing on a_field.
Definition: FarmFuncs.cpp:1523
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