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

#include <SpringBarleyCloverGrass.h>

Inheritance diagram for SpringBarleyCloverGrass:
Crop

Public Member Functions

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

◆ SpringBarleyCloverGrass()

SpringBarleyCloverGrass::SpringBarleyCloverGrass ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
69  : Crop(a_tov, a_toc, a_L)
70  {
73  }

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

Member Function Documentation

◆ Do()

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

Reimplemented from Crop.

45  {
46  m_farm = a_farm;
47  m_field = a_field;
48  m_ev = a_ev;
49  int d1 = 0;
50  int noDates = 3;
51  bool done = false;
52 
53  switch (m_ev->m_todo) {
54  case sbcg_start:
55  {
56  SBCG_ISAUTUMNPLOUGH = false;
57  SBCG_FERTI_DONE = false;
58  SBCG_SPRAY = 0;
59  a_field->ClearManagementActionSum();
60 
61  // Set up the date management stuff
62  // Could save the start day in case it is needed later
63  // m_field->m_startday = m_ev->m_startday;
64  m_last_date = g_date->DayInYear( 15, 10 );
65  // Start and stop dates for all events after harvest
66  m_field->SetMDates( 0, 0, g_date->DayInYear( 1, 8 ) );
67  // Determined by harvest date - used to see if at all possible
68  m_field->SetMDates( 1, 0, g_date->DayInYear( 25, 8 ) );
69  m_field->SetMDates( 0, 1, g_date->DayInYear( 5, 8 ) );
70  m_field->SetMDates( 1, 1, g_date->DayInYear( 30, 8 ) );
71  m_field->SetMDates( 0, 2, g_date->DayInYear( 1, 9 ) );
72  m_field->SetMDates( 1, 2, g_date->DayInYear( 15, 10 ) );
73  // Check the next crop for early start, unless it is a spring crop
74  // in which case we ASSUME that no checking is necessary!!!!
75  // SO DO NOT implement a crop that runs over the year boundary
76  if (m_ev->m_startday > g_date->DayInYear( 1, 7 )) {
77  if (m_field->GetMDates( 0, 0 ) >= m_ev->m_startday) {
78  g_msg->Warn( WARN_BUG, "SpringBarleyCloverGrass::Do(): "
79  "Harvest too late for the next crop to start!!!", "" );
80  exit( 1 );
81  }
82  // Now fix any late finishing problems
83  for (int i = 0; i < noDates; i++) {
84  if (m_field->GetMDates( 0, i ) >= m_ev->m_startday)
85  m_field->SetMDates( 0, i, m_ev->m_startday - 1 );
86  if (m_field->GetMDates( 1, i ) >= m_ev->m_startday)
87  m_field->SetMDates( 1, i, m_ev->m_startday - 1 );
88  }
89  }
90  // Now no operations can be timed after the start of the next crop.
91  if (!m_ev->m_first_year) {
92  // Are we before July 1st?
93  d1 = g_date->OldDays() + g_date->DayInYear( 1, 7 );
94  if (g_date->Date() < d1) {
95  // Yes, too early. We assumme this is because the last crop was late
96  g_msg->Warn( WARN_BUG, "SpringBarleyCloverGrass::Do(): "
97  "Crop start attempt between 1st Jan & 1st July", "" );
98  exit( 1 );
99  }
100  else {
101  d1 = g_date->OldDays() + m_first_date; // start day
102  if (g_date->Date() > d1) {
103  // Yes too late - should not happen - raise an error
104  g_msg->Warn( WARN_BUG, "SpringBarleyCloverGrass::Do(): "
105  "Crop start attempt after last possible start date", "" );
106  exit( 1 );
107  }
108  }
109  }
110  else {
111  m_field->SetLastSownVeg( tov_SpringBarleyCloverGrass ); //Force last sown, needed for goose habitat classification
112  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15, 3 ),sbcg_spring_plough, false );
113  break;
114  }
115  // End single block date checking code. Please see next line
116  // comment as well.
117  // Reinit d1 to first possible starting date.
118  d1 = g_date->OldDays() + g_date->DayInYear( 1, 11 );
119  if (g_date->Date() >= d1) d1 = g_date->Date();
120  SimpleEvent( d1, sbcg_autumn_plough, false );
121  }
122  break;
123 
124  case sbcg_autumn_plough:
125  if (m_ev->m_lock || m_farm->DoIt( 70 )) {
126  if (!m_farm->AutumnPlough( m_field, 0.0,
127  g_date->DayInYear( 30, 11 ) - g_date->DayInYear() )) { // 30,11 is m_first_date
128  SimpleEvent( g_date->Date() + 1, sbcg_autumn_plough, true );
129  break;
130  }
131  SBCG_ISAUTUMNPLOUGH = true;
132  }
133  // +365 for next year
134  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15, 3 ) + 365,sbcg_ferti_s1, false );
135  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15, 3 ) + 365,sbcg_ferti_s2, false );
136  break;
137 
138  case sbcg_ferti_s1:
139  if (m_ev->m_lock || m_farm->DoIt( 90 )) {
140  if (!m_farm->FA_Slurry( m_field, 0.0,
141  g_date->DayInYear( 15, 4 ) - g_date->DayInYear() )) {
142  SimpleEvent( g_date->Date() + 1, sbcg_ferti_s1, true );
143  break;
144  }
145  // Done fertilizer so remember
146  SBCG_FERTI_DONE = true;
147  }
148  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15, 3 ),
149  sbcg_spring_plough, false );
150  break;
151 
152  case sbcg_ferti_s2:
153  if ((m_ev->m_lock || m_farm->DoIt( 67 )) && (!SBCG_ISAUTUMNPLOUGH)) {
154  if (!m_farm->FA_Manure( m_field, 0.0,
155  g_date->DayInYear( 15, 4 ) - g_date->DayInYear() )) {
156  SimpleEvent( g_date->Date() + 1, sbcg_ferti_s2, true );
157  break;
158  }
159  else {
160  // Done fertilizer so remember
161  SBCG_FERTI_DONE = true;
162  }
163  }
164  break;
165 
166  case sbcg_spring_plough:
167  if (!SBCG_ISAUTUMNPLOUGH) // Don't plough if you have already
168  {
169  if (!m_farm->SpringPlough( m_field, 0.0,
170  g_date->DayInYear( 10, 4 ) - g_date->DayInYear() )) {
171  SimpleEvent( g_date->Date() + 1, sbcg_spring_plough, true );
172  break;
173  }
174  }
175  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 25, 3 ),
176  sbcg_spring_harrow, false );
177  break;
178 
179  case sbcg_spring_harrow:
180  if (!m_farm->SpringHarrow( m_field, 0.0,
181  g_date->DayInYear( 10, 4 ) - g_date->DayInYear() )) {
182  SimpleEvent( g_date->Date() + 1, sbcg_spring_harrow, true );
183  break;
184  }
185  SimpleEvent( g_date->Date(), sbcg_ferti_s3, false );
186  break;
187 
188  case sbcg_ferti_s3: // The catch all
189  if ((!SBCG_FERTI_DONE) || (m_ev->m_lock || m_farm->DoIt( 70 ))) {
190  if (!m_farm->FA_NPK( m_field, 0.0,
191  g_date->DayInYear( 10, 4 ) - g_date->DayInYear() )) {
192  SimpleEvent( g_date->Date() + 1, sbcg_ferti_s3, true );
193  break;
194  }
195  }
196  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 25, 3 ),
197  sbcg_spring_sow, false );
198  break;
199 
200  case sbcg_spring_sow:
201  if (!m_farm->SpringSow( m_field, 0.0,
202  g_date->DayInYear( 20, 4 ) - g_date->DayInYear() )) {
203  SimpleEvent( g_date->Date() + 1, sbcg_spring_sow, true );
204  break;
205  }
206  SimpleEvent( g_date->Date() + 1, sbcg_spring_roll, false );
207  break;
208 
209  case sbcg_spring_roll:
210  if (m_ev->m_lock || m_farm->DoIt( 90 )) {
211  if (!m_farm->SpringRoll( m_field, 0.0,
212  g_date->DayInYear( 21, 4 ) - g_date->DayInYear() )) {
213  SimpleEvent( g_date->Date() + 1, sbcg_spring_roll, true );
214  break;
215  }
216  }
217  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1, 5 ),
218  sbcg_herbicide, false );
219  break;
220 
221  case sbcg_herbicide:
222  if (m_ev->m_lock || m_farm->DoIt( (int)(80 * cfg_herbi_app_prop.value()) )) // was 60
223  {
224  if (!m_farm->HerbicideTreat( m_field, 0.0,
225  g_date->DayInYear( 10, 5 ) - g_date->DayInYear() )) {
226  SimpleEvent( g_date->Date() + 1, sbcg_herbicide, true );
227  break;
228  }
229  // Did first spray so see if should do another, 7 days later (min)
230  else if (g_date->DayInYear() + 7 < g_date->DayInYear( 15, 5 ))
231  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 15, 5 ),
232  sbcg_herbicide2, false );
233  else SimpleEvent( g_date->Date() + 7, sbcg_herbicide2, false );
234  }
235  // Carry on with the next after first treatment or no treatment
236  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 10, 5 ),
237  sbcg_GR, false );
238  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 10, 5 ),
239  sbcg_fungicide, false );
240  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 1, 6 ),
241  sbcg_water1, false );
242  break;
243 
244  case sbcg_herbicide2:
245  if (m_ev->m_lock || m_farm->DoIt( (int)(50 * cfg_herbi_app_prop.value()) )) // was 67
246  {
247  if (!m_farm->HerbicideTreat( m_field, 0.0,
248  g_date->DayInYear( 30, 5 ) - g_date->DayInYear() )) {
249  SimpleEvent( g_date->Date() + 1, sbcg_herbicide2, true );
250  break;
251  }
252  }
253  break;
254 
255  // GR Thread
256  case sbcg_GR:
257  if (m_ev->m_lock || m_farm->DoIt( (int)(5 * cfg_greg_app_prop.value()) )) // was 60
258  {
259  if (!m_farm->GrowthRegulator( m_field, 0.0,
260  g_date->DayInYear( 25, 5 ) - g_date->DayInYear() )) {
261  SimpleEvent( g_date->Date() + 1, sbcg_GR, true );
262  break;
263  }
264  }
265  break;
266 
267  // Water thread
268  case sbcg_water1:
269  if (m_ev->m_lock || m_farm->DoIt( 20 )) {
270  if ((!m_farm->Water( m_field, 0.0,
271  g_date->DayInYear( 15, 6 ) - g_date->DayInYear() ))
272  || (SBCG_SPRAY == g_date->DayInYear())) {
273  SimpleEvent( g_date->Date() + 1, sbcg_water1, true );
274  break;
275  }
276  if (g_date->DayInYear() + 5 < g_date->DayInYear( 16, 6 ))
277  SimpleEvent( g_date->OldDays() + g_date->DayInYear( 16, 6 ),
278  sbcg_water2, false );
279  else
280  SimpleEvent( g_date->Date() + 5, sbcg_water2, false );
281  }
282  break;
283 
284  case sbcg_water2:
285  if (m_ev->m_lock || m_farm->DoIt( 50 )) {
286  if ((!m_farm->Water( m_field, 0.0,
287  g_date->DayInYear( 1, 7 ) - g_date->DayInYear() ))
288  || (SBCG_SPRAY == g_date->DayInYear())) {
289  SimpleEvent( g_date->Date() + 1, sbcg_water2, true );
290  break;
291  }
292  }
293  break;
294 
295  // Fungicide thread & MAIN THREAD
296  case sbcg_fungicide:
297  if (m_ev->m_lock || m_farm->DoIt( (int)(40 * cfg_herbi_app_prop.value()) )) // was 60
298  {
299  if (!m_farm->FungicideTreat( m_field, 0.0,
300  g_date->DayInYear( 25, 5 ) - g_date->DayInYear() )) {
301  SimpleEvent( g_date->Date() + 1, sbcg_fungicide, true );
302  break;
303  }
304  else {
306  }
307  }
308  // can also try insecticide
310  sbcg_insecticide1, false );
311  break;
312 
313  // Insecticide & MAIN THREAD
314  case sbcg_insecticide1:
315  if (m_ev->m_lock || m_farm->DoIt( (int)(35 * cfg_ins_app_prop1.value()) )) // was 50
316  {
317  // Here we check wheter we are using ERA pesticde or not
318  if (!cfg_pest_springbarley_on.value() || !a_field->GetLandscape()->SupplyShouldSpray()) {
319  if (!m_farm->InsecticideTreat( m_field, 0.0, g_date->DayInYear( 10, 6 ) - g_date->DayInYear() )) {
320  SimpleEvent( g_date->Date() + 1, sbcg_insecticide1, true );
321  break;
322  }
323  else SBCG_SPRAY = g_date->DayInYear();
324  }
325  else {
326  // Using test pesticide
329  }
330  }
331  ChooseNextCrop(2);
332  SimpleEvent(g_date->Date() + 14, sbcg_insecticide2, false);
333  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 8), sbcg_harvest, false);
334  break;
335 
336  case sbcg_insecticide2:
337  if (m_ev->m_lock || m_farm->DoIt((int)floor(0.5 + 35 * cfg_ins_app_prop2.value()*m_farm->Prob_multiplier()))) //modified probability
338  {
339  if (cfg_pest_springbarley_on.value() && a_field->GetLandscape()->SupplyShouldSpray())
340  {
342  }
343  else
344  {
345  if (!m_farm->InsecticideTreat(m_field, 0.0, SBCG_SPRAY + 28 - g_date->DayInYear())) {
346  SimpleEvent(g_date->Date() + 1, sbcg_insecticide2, true);
347  }
348  }
349  }
350  SimpleEvent(g_date->Date() + 14, sbcg_insecticide3, false);
351  break;
352 
353  case sbcg_insecticide3:
354  if (m_ev->m_lock || m_farm->DoIt((int)floor(0.5 + 35 * cfg_ins_app_prop3.value()*m_farm->Prob_multiplier()))) //modified probability
355  {
356  if (cfg_pest_springbarley_on.value() && a_field->GetLandscape()->SupplyShouldSpray())
357  {
359  }
360  else
361  {
362  if (!m_farm->InsecticideTreat(m_field, 0.0, SBCG_SPRAY + 28 - g_date->DayInYear())) {
363  SimpleEvent(g_date->Date() + 1, sbcg_insecticide3, true);
364  }
365  }
366  }
367  break;
368 
369  case sbcg_harvest:
370  if (!m_farm->Harvest( m_field, 0.0,
371  m_field->GetMDates( 1, 0 ) - g_date->DayInYear() )) {
372  SimpleEvent( g_date->Date() + 1, sbcg_harvest, true );
373  break;
374  }
375  SimpleEvent( g_date->OldDays() + m_field->GetMDates( 0, 1 ),
376  sbcg_hay_baling, false );
377  break;
378 
379  case sbcg_hay_baling:
380  if (!m_farm->HayBailing( m_field, 0.0,
381  m_field->GetMDates( 1, 1 ) - g_date->DayInYear() )) {
382  SimpleEvent( g_date->Date() + 1, sbcg_hay_baling, true );
383  break;
384  }
385  // Something special here.
386  // If the cattle out period is very short then we don't want to do it at all
387  if (m_field->GetMDates( 1, 2 ) - m_field->GetMDates( 0, 2 ) < 14) done = true;
388  else SimpleEvent( g_date->OldDays() + m_field->GetMDates( 0, 2 ),
389  sbcg_cattle_out, false );
390  break;
391 
392  case sbcg_cattle_out:
393  if (!m_farm->CattleOut( m_field, 0.0,
394  m_field->GetMDates( 1, 2 ) - g_date->DayInYear() )) {
395  SimpleEvent( g_date->Date() + 1, sbcg_cattle_out, true );
396  break;
397  }
398  SimpleEvent( g_date->Date() + 1, sbcg_cattle_is_out, false );
399  break;
400 
401  case sbcg_cattle_is_out:
402  if (!m_farm->CattleIsOut( m_field, 0.0,
403  m_field->GetMDates( 1, 2 ) - g_date->DayInYear(), m_field->GetMDates( 1, 2 ) )) {
404  SimpleEvent( g_date->Date() + 1, sbcg_cattle_is_out, false );
405  break;
406  }
407  // END OF MAIN THREAD
408  done = true;
409  break;
410 
411  default:
412  g_msg->Warn( WARN_BUG, "SpringBarleyCloverGrass::Do(): "
413  "Unknown event type! ", "" );
414  exit( 1 );
415  }
416  return done;
417 }

References Farm::AutumnPlough(), Farm::CattleIsOut(), Farm::CattleOut(), cfg_greg_app_prop, cfg_herbi_app_prop, cfg_ins_app_prop1, cfg_ins_app_prop2, cfg_ins_app_prop3, cfg_pest_product_amounts, cfg_pest_springbarley_on, cfg_SB_InsecticideDay, cfg_SB_InsecticideMonth, Crop::ChooseNextCrop(), LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), Farm::DoIt(), Farm::FA_Manure(), Farm::FA_NPK(), Farm::FA_Slurry(), Farm::FungicideTreat(), g_date, g_msg, LE::GetMDates(), Farm::GrowthRegulator(), Farm::Harvest(), Farm::HayBailing(), Farm::HerbicideTreat(), Farm::InsecticideTreat(), 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::Prob_multiplier(), Farm::ProductApplication_DateLimited(), sbcg_autumn_plough, sbcg_cattle_is_out, sbcg_cattle_out, SBCG_FERTI_DONE, sbcg_ferti_s1, sbcg_ferti_s2, sbcg_ferti_s3, sbcg_fungicide, sbcg_GR, sbcg_harvest, sbcg_hay_baling, sbcg_herbicide, sbcg_herbicide2, sbcg_insecticide1, sbcg_insecticide2, sbcg_insecticide3, SBCG_ISAUTUMNPLOUGH, SBCG_SPRAY, sbcg_spring_harrow, sbcg_spring_plough, sbcg_spring_roll, sbcg_spring_sow, sbcg_start, sbcg_water1, sbcg_water2, LE::SetLastSownVeg(), LE::SetMDates(), Crop::SimpleEvent(), Farm::SpringHarrow(), Farm::SpringPlough(), Farm::SpringRoll(), Farm::SpringSow(), tov_SpringBarleyCloverGrass, CfgInt::value(), CfgFloat::value(), CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), WARN_BUG, and Farm::Water().

◆ SetUpFarmCategoryInformation()

void SpringBarleyCloverGrass::SetUpFarmCategoryInformation ( )
inline
74  {
75  const int elements = 2 + (sbcg_foobar - SBARLEYCG_BASE);
77 
78  FarmManagementCategory catlist[elements] =
79  {
80  fmc_Others, // zero element unused but must be here
81  fmc_Others,//sbcg_start = 1, // Compulsory, start event must always be 1 (one).
82  fmc_Fertilizer,//sbcg_ferti_s1 = SBARLEYCG_BASE,
83  fmc_Fertilizer,//sbcg_ferti_s2,
84  fmc_Fertilizer,//sbcg_ferti_s3,
85  fmc_Harvest,//sbcg_harvest,
86  fmc_Cultivation,//sbcg_spring_plough,
87  fmc_Cultivation,//sbcg_autumn_plough,
88  fmc_Cultivation,//sbcg_spring_harrow,
89  fmc_Others,//sbcg_spring_roll,
90  fmc_Others,//sbcg_spring_sow,
91  fmc_Others,//sbcg_hay_baling,
92  fmc_Others,//sbcg_GR,
93  fmc_Watering,//sbcg_water1,
94  fmc_Watering,//sbcg_water2,
95  fmc_Herbicide,//sbcg_herbicide,
96  fmc_Herbicide,//sbcg_herbicide2,
97  fmc_Insecticide,//sbcg_insecticide1,
98  fmc_Insecticide,//sbcg_insecticide2,
99  fmc_Insecticide,//sbcg_insecticide3,
100  fmc_Fungicide,//sbcg_fungicide,
101  fmc_Grazing,//sbcg_cattle_out,
102  fmc_Grazing//sbcg_cattle_is_out
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 fmc_Cultivation, fmc_Fertilizer, fmc_Fungicide, fmc_Grazing, fmc_Harvest, fmc_Herbicide, fmc_Insecticide, fmc_Others, fmc_Watering, Crop::m_base_elements_no, Crop::m_ManagementCategories, SBARLEYCG_BASE, and sbcg_foobar.

Referenced by SpringBarleyCloverGrass().


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
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
SBARLEYCG_BASE
#define SBARLEYCG_BASE
Definition: SpringBarleyCloverGrass.h:32
LE::SetMDates
void SetMDates(int a, int b, int c)
Definition: Elements.h:406
sbcg_spring_roll
Definition: SpringBarleyCloverGrass.h:46
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
SBCG_ISAUTUMNPLOUGH
#define SBCG_ISAUTUMNPLOUGH
Definition: SpringBarleyCloverGrass.h:33
Farm::HerbicideTreat
virtual bool HerbicideTreat(LE *a_field, double a_user, int a_days)
Apply herbicide to a_field.
Definition: FarmFuncs.cpp:2025
LE::SetLastSownVeg
void SetLastSownVeg(TTypesOfVegetation a_tov)
Records the last vegetation type to be sown.
Definition: Elements.h:357
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::CattleIsOut
virtual bool CattleIsOut(LE *a_field, double a_user, int a_days, int a_max)
Generate a 'cattle_out' event for every day the cattle are on a_field.
Definition: FarmFuncs.cpp:2470
LE::ClearManagementActionSum
void ClearManagementActionSum()
clears the management action counters
Definition: Elements.h:247
Farm::DoIt
bool DoIt(double a_probability)
Return chance out of 0 to 100.
Definition: Farm.cpp:856
cfg_pest_springbarley_on
CfgBool cfg_pest_springbarley_on
Turn on pesticides for spring barley.
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
sbcg_foobar
Definition: SpringBarleyCloverGrass.h:60
cfg_SB_InsecticideDay
CfgInt cfg_SB_InsecticideDay
Provided to allow configuration control of the first insecticide spray in spring barley crops - this ...
Definition: SpringBarleySilage.cpp:42
sbcg_fungicide
Definition: SpringBarleyCloverGrass.h:57
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
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
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
CfgFloat::value
double value() const
Definition: Configurator.h:142
cfg_ins_app_prop2
CfgFloat cfg_ins_app_prop2
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
cfg_greg_app_prop
CfgFloat cfg_greg_app_prop
sbcg_water1
Definition: SpringBarleyCloverGrass.h:50
cfg_ins_app_prop1
CfgFloat cfg_ins_app_prop1
sbcg_hay_baling
Definition: SpringBarleyCloverGrass.h:48
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
Crop::SimpleEvent
void SimpleEvent(long a_date, int a_todo, bool a_lock)
Adds an event to this crop management.
Definition: Farm.cpp:747
sbcg_herbicide2
Definition: SpringBarleyCloverGrass.h:53
CfgBool::value
bool value() const
Definition: Configurator.h:164
sbcg_ferti_s1
Definition: SpringBarleyCloverGrass.h:39
cfg_SB_InsecticideMonth
CfgInt cfg_SB_InsecticideMonth
Provided to allow configuration control of the first insecticide spray in spring barley crops - this ...
Definition: SpringBarleySilage.cpp:43
Farm::Prob_multiplier
virtual double Prob_multiplier()
Definition: Farm.h:778
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
sbcg_ferti_s2
Definition: SpringBarleyCloverGrass.h:40
Farm::ProductApplication_DateLimited
virtual bool ProductApplication_DateLimited(LE *a_field, double, int, double a_applicationrate, PlantProtectionProducts a_ppp, bool a_isgranularpesticide=false)
Special pesticide trial functionality.
Definition: FarmFuncs.cpp:2342
Calendar::Date
long Date(void)
Definition: Calendar.h:57
sbcg_cattle_is_out
Definition: SpringBarleyCloverGrass.h:59
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
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
sbcg_spring_harrow
Definition: SpringBarleyCloverGrass.h:45
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
SpringBarleyCloverGrass::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: SpringBarleyCloverGrass.h:74
sbcg_cattle_out
Definition: SpringBarleyCloverGrass.h:58
sbcg_start
Definition: SpringBarleyCloverGrass.h:38
sbcg_herbicide
Definition: SpringBarleyCloverGrass.h:52
cfg_pest_product_amounts
CfgArray_Double cfg_pest_product_amounts
Amount of pesticide applied in grams of active substance per hectare for each of the 10 pesticides.
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
CfgInt::value
int value() const
Definition: Configurator.h:116
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
sbcg_ferti_s3
Definition: SpringBarleyCloverGrass.h:41
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
cfg_herbi_app_prop
CfgFloat cfg_herbi_app_prop
Farm::InsecticideTreat
virtual bool InsecticideTreat(LE *a_field, double a_user, int a_days)
Apply insecticide to a_field.
Definition: FarmFuncs.cpp:2135
sbcg_spring_sow
Definition: SpringBarleyCloverGrass.h:47
sbcg_water2
Definition: SpringBarleyCloverGrass.h:51
sbcg_harvest
Definition: SpringBarleyCloverGrass.h:42
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
tov_SpringBarleyCloverGrass
Definition: LandscapeFarmingEnums.h:214
fmc_Grazing
Definition: LandscapeFarmingEnums.h:1010
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
SBCG_FERTI_DONE
#define SBCG_FERTI_DONE
Definition: SpringBarleyCloverGrass.h:34
sbcg_GR
Definition: SpringBarleyCloverGrass.h:49
Farm::GrowthRegulator
virtual bool GrowthRegulator(LE *a_field, double a_user, int a_days)
Apply growth regulator to a_field.
Definition: FarmFuncs.cpp:2070
sbcg_spring_plough
Definition: SpringBarleyCloverGrass.h:43
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
SBCG_SPRAY
#define SBCG_SPRAY
Definition: SpringBarleyCloverGrass.h:35
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
cfg_ins_app_prop3
CfgFloat cfg_ins_app_prop3
sbcg_insecticide2
Definition: SpringBarleyCloverGrass.h:55
Crop::ChooseNextCrop
void ChooseNextCrop(int a_no_dates)
Chooses the next crop to grow in a field.
Definition: Farm.cpp:756
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
Farm::CattleOut
virtual bool CattleOut(LE *a_field, double a_user, int a_days)
Start a grazing event on a_field today.
Definition: FarmFuncs.cpp:2368
sbcg_insecticide3
Definition: SpringBarleyCloverGrass.h:56
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
sbcg_insecticide1
Definition: SpringBarleyCloverGrass.h:54
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
sbcg_autumn_plough
Definition: SpringBarleyCloverGrass.h:44