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

#include <DK_SpringFodderGrass.h>

Inheritance diagram for DK_SpringFodderGrass:
Crop

Public Member Functions

bool Do (Farm *a_farm, LE *a_field, FarmEvent *a_ev)
 
 DK_SpringFodderGrass (TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
 
void SetUpFarmCategoryInformation ()
 
- Public Member Functions inherited from Crop
virtual ~Crop ()
 
 Crop (TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
 
int GetFirstDate (void)
 
void ChooseNextCrop (int a_no_dates)
 Chooses the next crop to grow in a field. More...
 
int GetCropClassification ()
 
void SetCropClassification (int a_classification)
 
void GetCropType (TTypesOfCrops a_toc)
 
TTypesOfCrops GetCropType ()
 
FarmManagementCategory LookUpManagementCategory (int a_todo)
 
bool GetForceSpringOK ()
 

Additional Inherited Members

- Public Attributes inherited from Crop
TTypesOfVegetation m_tov
 
- Protected Member Functions inherited from Crop
void SimpleEvent (long a_date, int a_todo, bool a_lock)
 Adds an event to this crop management. More...
 
void SimpleEvent_ (long a_date, int a_todo, bool a_lock, Farm *a_farm, LE *a_field)
 Adds an event to this crop management without relying on member variables. More...
 
bool StartUpCrop (int a_spring, std::vector< std::vector< int >> a_flexdates, int a_todo)
 
Holds the translation between the farm operation enum for each cropand the farm management category associated with it More...
 
bool AphidDamage (LE *a_field)
 Compares aphid numbers per m2 with a threshold to return true if threshold is exceeded. More...
 
- Protected Attributes inherited from Crop
Farmm_farm
 
LEm_field
 
FarmEventm_ev
 
int m_first_date
 
int m_count
 
int m_last_date
 
int m_ddegstoharvest
 
int m_base_elements_no
 
Landscapem_OurLandscape
 
bool m_forcespringpossible = false
 Used to signal that the crop can be forced to start in spring. More...
 
TTypesOfCrops m_toc
 The Crop type in terms of the TTypesOfCrops list (smaller list than tov, no country designation) More...
 
int m_CropClassification
 Contains information on whether this is a winter crop, spring crop, or catch crop that straddles the year boundary (0,1,2) More...
 
vector< FarmManagementCategorym_ManagementCategories
 Holds the translation between the farm operation enum for each crop and the farm management category associated with it. More...
 
- Static Protected Attributes inherited from Crop
static int m_date_modifier = 0
 Holds a value that shifts test pesticide use by this many days in crops modified to use it. More...
 

Constructor & Destructor Documentation

◆ DK_SpringFodderGrass()

DK_SpringFodderGrass::DK_SpringFodderGrass ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
74  : Crop(a_tov, a_toc, a_L)
75  {
78  }

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

Member Function Documentation

◆ Do()

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

Reimplemented from Crop.

42 {
43  m_farm = a_farm;
44  m_field = a_field;
45  m_ev = a_ev;
46  bool done = false; // The boolean value done indicates when we are totally finished with this plan (i.e. it is set to true, m_farm, m_field).
47  bool flag = false;
48  int d1 = 0;
49  int noDates = 1;
50  TTypesOfVegetation l_tov = tov_DKSpringFodderGrass; // The current type - change to match the crop you have
51 
52  switch (m_ev->m_todo)
53  {
54  case dk_sfg_start:
55  {
56 
57  DK_SFG_CC = false;
58  a_field->ClearManagementActionSum();
59 
60  m_last_date = g_date->DayInYear(30, 9); // Should match the last flexdate below
61  //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
62  std::vector<std::vector<int>> flexdates(2 + 1, std::vector<int>(2, 0));
63  // Set up the date management stuff
64  // Start and stop dates for all events after harvest
65  flexdates[0][1] = g_date->DayInYear(28, 9); // last possible day of swathing in this case
66  // Now these are done in pairs, start & end for each operation. If its not used then -1
67  flexdates[1][0] = -1; // This date will be moved back as far as necessary and potentially to flexdates 1 (start op 1)
68  flexdates[1][1] = g_date->DayInYear(30, 9); // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 1) - harvest
69  flexdates[2][0] = -1; // This date will be moved back as far as necessary and potentially to flexdates 2 (start op 2)
70  flexdates[2][1] = g_date->DayInYear(30, 9); // This date will be moved back as far as necessary and potentially to flexdates 2 (end op 2) - cattleout
71 
72  // 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
73  int isSpring = 365;
74  if (StartUpCrop(isSpring, flexdates, int(dk_sfg_spring_plough))) break;
75 
76  // End single block date checking code. Please see next line comment as well.
77  // Reinit d1 to first possible starting date.
78  d1 = g_date->OldDays() + g_date->DayInYear(1, 2) + isSpring;
79  // OK, let's go.
80  // Here we queue up the first event which changes dependent on whether it is a forced spring sow or not
81  if (m_field->GetSoilType() != tos_Sand && m_field->GetSoilType() != tos_LoamySand && m_field->GetSoilType() != tos_SandyLoam && m_field->GetSoilType() != tos_SandyClayLoam) // on clay soils (NL KLEI & VEEN)
82  {
83  SimpleEvent(d1, dk_sfg_spring_roll1, false);
84  break;
85  }
86  else SimpleEvent(d1, dk_sfg_spring_plough, false); // only done on sandy soils
87  break;
88  }
89  break;
90 
92  if (m_ev->m_lock || m_farm->DoIt_prob(.85)) {
93  if (!m_farm->SpringPlough(m_field, 0.0,
94  g_date->DayInYear(15, 3) - g_date->DayInYear())) {
96  break;
97  }
98  }
100  break;
101 
102  case dk_sfg_spring_roll1:
103  if (!m_farm->SpringRoll(m_field, 0.0,
104  g_date->DayInYear(15, 3) - g_date->DayInYear())) {
106  break;
107  }
109  break;
110 
112  if (!m_farm->ShallowHarrow(m_field, 0.0,
113  g_date->DayInYear(16, 3) - g_date->DayInYear())) {
115  break;
116  }
117  SimpleEvent(g_date->Date() + 1, dk_sfg_spring_roll2, false);
118  break;
119 
120  case dk_sfg_spring_roll2:
121  if (m_ev->m_lock || m_farm->DoIt_prob(.90)) {
122  if (!m_farm->SpringRoll(m_field, 0.0,
123  g_date->DayInYear(17, 3) - g_date->DayInYear())) {
125  break;
126  }
127  }
128  if (a_farm->IsStockFarmer()) {
129  SimpleEvent(g_date->Date() + 1, dk_sfg_manure_pig_s, false);
130  break;
131  }
132  else SimpleEvent(g_date->Date() + 1, dk_sfg_manure_pig_p, false);
133  break;
134 
135  case dk_sfg_manure_pig_s:
136  if (!m_farm->FA_Slurry(m_field, 0.0,
137  g_date->DayInYear(18, 3) - g_date->DayInYear())) {
139  break;
140  }
141  SimpleEvent(g_date->Date() + 7, dk_sfg_npk_s, false);
142  break;
143 
144  case dk_sfg_npk_s:
145  if (!m_farm->FA_NPK(m_field, 0.0,
146  g_date->DayInYear(26, 3) - g_date->DayInYear())) {
147  SimpleEvent(g_date->Date() + 1, dk_sfg_npk_s, true);
148  break;
149  }
151  break;
152 
153  case dk_sfg_manure_pig_p:
154  if (!m_farm->FP_Slurry(m_field, 0.0,
155  g_date->DayInYear(18, 3) - g_date->DayInYear())) {
157  break;
158  }
159  SimpleEvent(g_date->Date() + 7, dk_sfg_npk_p, false);
160  break;
161 
162  case dk_sfg_npk_p:
163  if (!m_farm->FP_NPK(m_field, 0.0,
164  g_date->DayInYear(26, 3) - g_date->DayInYear())) {
165  SimpleEvent(g_date->Date() + 1, dk_sfg_npk_p, true);
166  break;
167  }
169  break;
170 
172  if (m_ev->m_lock || m_farm->DoIt_prob(1.0)) {
173  if (!m_farm->SpringSow(m_field, 0.0,
174  g_date->DayInYear(27, 3) - g_date->DayInYear())) {
176  break;
177  }
178  }
179  SimpleEvent(g_date->Date() + 1, dk_sfg_spring_sow, false);
180  break;
181 
182  case dk_sfg_spring_sow: // sow clover grass
183  if (!m_farm->SpringSow(m_field, 0.0,
184  g_date->DayInYear(28, 3) - g_date->DayInYear())) {
185  SimpleEvent(g_date->Date() + 1, dk_sfg_spring_sow, true);
186  break;
187  }
188  SimpleEvent(g_date->Date() + 1, dk_sfg_spring_roll3, false);
189  break;
190 
191  case dk_sfg_spring_roll3:
192  if (!m_farm->SpringRoll(m_field, 0.0,
193  g_date->DayInYear(29, 3) - g_date->DayInYear())) {
195  break;
196  }
197  SimpleEvent(g_date->OldDays() + g_date->DayInYear(15, 4), dk_sfg_water, false); // water thread
198  SimpleEvent(g_date->OldDays() + g_date->DayInYear(15, 4), dk_sfg_herbicide1, false); // main thread
199  break;
200 
201  case dk_sfg_water:
202  if (m_ev->m_lock || m_farm->DoIt_prob(.50)) { // 50% water
203  if (!m_farm->Water(m_field, 0.0,
204  g_date->DayInYear(31, 5) - g_date->DayInYear())) {
205  SimpleEvent(g_date->Date() + 1, dk_sfg_water, true);
206  break;
207  }
208  }
209  break; // end of thread
210 
211  case dk_sfg_herbicide1:
212  if (m_ev->m_lock || m_farm->DoIt_prob(0.8)) {
213  if (!m_farm->HerbicideTreat(m_field, 0.0,
214  g_date->DayInYear(15, 5) - g_date->DayInYear())) {
215  SimpleEvent(g_date->Date() + 1, dk_sfg_herbicide1, true);
216  break;
217  }
218  }
220  break;
221 
222  case dk_sfg_cutting1:
223  if (m_ev->m_lock || m_farm->DoIt_prob(.90)) { // 90% cut to silage, 10% graze
224  if (!m_farm->CutToSilage(m_field, 0.0,
225  g_date->DayInYear(15, 6) - g_date->DayInYear())) {
226  SimpleEvent(g_date->Date() + 1, dk_sfg_cutting1, true);
227  break;
228  }
229  DK_SFG_CUT = true; //we need to remember who did cutting
230  SimpleEvent(g_date->Date() + 35, dk_sfg_cutting2, false);
231  break;
232  }
233  else if (m_ev->m_lock || m_farm->DoIt_prob(.10 / .10)) {
235  break;
236  }
237 
239  if (m_ev->m_lock || m_farm->DoIt_prob(.50)) { // 50% cut to silage of the 10% that will do grazing
240  if (!m_farm->CutToSilage(m_field, 0.0,
241  g_date->DayInYear(1, 6) - g_date->DayInYear())) {
243  break;
244  }
245  SimpleEvent(g_date->Date() + 14, dk_sfg_grazing, false);
246  break;
247  }
249  break;
250 
251  case dk_sfg_cutting2:
252  if (DK_SFG_CUT == true) {
253  if (!m_farm->CutToSilage(m_field, 0.0,
254  g_date->DayInYear(20, 7) - g_date->DayInYear())) {
255  SimpleEvent(g_date->Date() + 1, dk_sfg_cutting2, true);
256  break;
257  }
258  }
259  SimpleEvent(g_date->Date() + 35, dk_sfg_cutting3, false);
260  break;
261 
262  case dk_sfg_cutting3:
263  if (DK_SFG_CUT == true) {
264  if (!m_farm->CutToSilage(m_field, 0.0,
265  g_date->DayInYear(25, 8) - g_date->DayInYear())) {
266  SimpleEvent(g_date->Date() + 1, dk_sfg_cutting3, true);
267  break;
268  }
269  }
270  d1 = g_date->Date();
271  if (d1 < g_date->OldDays() + g_date->DayInYear(25, 7)) {
272  SimpleEvent(g_date->Date() + 35, dk_sfg_cutting4, false);
273  break;
274  }
275  else SimpleEvent(g_date->Date() + 20, dk_sfg_insecticide, false);
276  break;
277 
278  case dk_sfg_cutting4:
279  if (DK_SFG_CUT == true) {
280  if (!m_farm->CutToSilage(m_field, 0.0,
281  g_date->DayInYear(31, 8) - g_date->DayInYear())) {
282  SimpleEvent(g_date->Date() + 1, dk_sfg_cutting4, true);
283  break;
284  }
285  }
286  SimpleEvent(g_date->Date() + 20, dk_sfg_insecticide, false);
287  break;
288 
289  case dk_sfg_grazing:
293  SimpleEvent(g_date->Date() + 1, dk_sfg_grazing, true);
294  break;
295  }
296  SimpleEvent(g_date->Date() + 1, dk_sfg_cattle_out, false);
297  break;
298 
299  case dk_sfg_cattle_out: // Keep the cattle out there
300  // CattleIsOut() returns false if it is not time to stop grazing
304  SimpleEvent(g_date->Date() + 1, dk_sfg_cattle_out, false);
305  break;
306  }
307  SimpleEvent(g_date->Date() + 10, dk_sfg_herbicide2, false);
308  break;
309 
310  case dk_sfg_herbicide2:
311  if (!m_farm->HerbicideTreat(m_field, 0.0,
312  g_date->DayInYear(30, 8) - g_date->DayInYear())) {
313  SimpleEvent(g_date->Date() + 1, dk_sfg_herbicide2, true);
314  break;
315  }
316  SimpleEvent(g_date->Date() + 20, dk_sfg_insecticide, false);
317  break;
318 
319  case dk_sfg_insecticide:
320  d1 = g_date->Date();
321  if (d1 > g_date->OldDays() + g_date->DayInYear(1, 9)) {
322  if (m_ev->m_lock || m_farm->DoIt_prob(.02) || AphidDamage(m_field)) {
323  // here we check whether we are using ERA pesticide or not
324  d1 = g_date->DayInYear(28, 9) - g_date->DayInYear();
325  if (!cfg_pest_grass_on.value() || !m_field->GetLandscape()->SupplyShouldSpray()) // Not using pesticide spray
326  {
327  flag = m_farm->InsecticideTreat(m_field, 0.0, d1);
328  }
329  else {
331  }
332  if (!flag) {
333  SimpleEvent(g_date->Date() + 1, dk_sfg_insecticide, true);
334  break;
335  }
336  }
337  SimpleEvent(g_date->Date()+1, dk_sfg_swathing, false);
338  break;
339  }
341  break;
342 
343  case dk_sfg_swathing:
344  if (m_ev->m_lock || m_farm->DoIt_prob(.10)) { // 10% do swathing
345  if (!m_farm->Swathing(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
346  SimpleEvent(g_date->Date() + 1, dk_sfg_swathing, true);
347  break;
348  }
349  }
350  SimpleEvent(g_date->Date()+2, dk_sfg_harvest, false);
351  break;
352 
353  case dk_sfg_harvest:
354  if (!m_farm->Harvest(m_field, 0.0, m_field->GetMDates(1, 1) - g_date->DayInYear())) {
355  SimpleEvent(g_date->Date() + 1, dk_sfg_harvest, true);
356  break;
357  }
359  break;
360 
362  if (!m_farm->StrawRemoval(m_field, 0.0, m_field->GetMDates(1, 2) - g_date->DayInYear())) {
364  break;
365  }
366  done = true;
367  break;
368 
369 
370  default:
371  g_msg->Warn(WARN_BUG, "DK_SpringFodderGrass::Do(): "
372  "Unknown event type! ", "");
373  exit(1);
374  }
375 
376  return done;
377 }

References Crop::AphidDamage(), Farm::CattleIsOut(), Farm::CattleOut(), cfg_farm_cattle_grass_high, cfg_farm_cattle_grass_low, cfg_pest_grass_on, cfg_pest_product_amounts, LE::ClearManagementActionSum(), Farm::CutToSilage(), Calendar::Date(), Calendar::DayInYear(), dk_sfg_cattle_out, DK_SFG_CC, DK_SFG_CUT, dk_sfg_cutting1, dk_sfg_cutting2, dk_sfg_cutting3, dk_sfg_cutting4, dk_sfg_cutting_graze, dk_sfg_grass_collected, DK_SFG_GRASS_READY, dk_sfg_grazing, dk_sfg_harvest, dk_sfg_herbicide1, dk_sfg_herbicide2, dk_sfg_insecticide, dk_sfg_manure_pig_p, dk_sfg_manure_pig_s, dk_sfg_npk_p, dk_sfg_npk_s, dk_sfg_spring_harrow, dk_sfg_spring_plough, dk_sfg_spring_roll1, dk_sfg_spring_roll2, dk_sfg_spring_roll3, dk_sfg_spring_sow, dk_sfg_spring_sow_cc, dk_sfg_start, dk_sfg_swathing, dk_sfg_water, Farm::DoIt_prob(), Farm::FA_NPK(), Farm::FA_Slurry(), Farm::FP_NPK(), Farm::FP_Slurry(), g_date, g_msg, LE::GetMDates(), LE::GetSoilType(), LE::GetVegHeight(), Farm::Harvest(), Farm::HerbicideTreat(), Farm::InsecticideTreat(), Farm::IsStockFarmer(), Crop::m_ev, Crop::m_farm, Crop::m_field, Crop::m_last_date, FarmEvent::m_lock, FarmEvent::m_todo, Calendar::OldDays(), ppp_1, Farm::ProductApplication(), Farm::ShallowHarrow(), Crop::SimpleEvent(), Farm::SpringPlough(), Farm::SpringRoll(), Farm::SpringSow(), Crop::StartUpCrop(), Farm::StrawRemoval(), Farm::Swathing(), tos_LoamySand, tos_Sand, tos_SandyClayLoam, tos_SandyLoam, tov_DKSpringFodderGrass, CfgInt::value(), CfgBool::value(), CfgArray_Double::value(), MapErrorMsg::Warn(), WARN_BUG, and Farm::Water().

◆ SetUpFarmCategoryInformation()

void DK_SpringFodderGrass::SetUpFarmCategoryInformation ( )
inline
79  {
80  const int elements = 2 + (dk_sfg_foobar - DK_SFG_BASE);
82 
83  FarmManagementCategory catlist[elements] =
84  {
85  fmc_Others, // zero element unused but must be here
86  fmc_Others, // dk_sfg_start = 1, // Compulsory, start event must always be 1 (one).
87  fmc_Harvest, // dk_sfg_harvest = DK_LW_BASE,
88  fmc_Cultivation, // dk_sfg_spring_plough,
89  fmc_Cultivation, // dk_sfg_spring_roll1,
90  fmc_Cultivation, // dk_sfg_spring_roll2,
91  fmc_Cultivation, // dk_sfg_spring_harrow,
92  fmc_Cultivation, // dk_sfg_spring_roll3,
93  fmc_Fertilizer, // dk_sfg_manure_pig_s,
94  fmc_Fertilizer, // dk_sfg_npk_s,
95  fmc_Fertilizer, // dk_sfg_manure_pig_p,
96  fmc_Fertilizer, // dk_sfg_npk_p,
97  fmc_Others, // dk_sfg_spring_sow_cc,
98  fmc_Others, // dk_sfg_spring_sow,
99  fmc_Herbicide, // dk_sfg_herbicide1,
100  fmc_Cutting, // dk_sfg_cutting1,
101  fmc_Cutting, // dk_sfg_cutting_graze,
102  fmc_Cutting, // dk_sfg_cutting2,
103  fmc_Cutting, // dk_sfg_cutting3,
104  fmc_Cutting, // dk_sfg_cutting4,
105  fmc_Grazing, // dk_sfg_grazing,
106  fmc_Grazing, // dk_sfg_cattle_out,
107  fmc_Herbicide, // dk_sfg_herbicide2,
108  fmc_Watering, // dk_sfg_water,
109  fmc_Insecticide, // dk_sfg_insecticide,
110  fmc_Cutting, // dk_sfg_swathing,
111  fmc_Others, // dk_sfg_grass_collected.,
112  fmc_Others, // dk_sfg_wait,
113 
114  // no foobar entry
115 
116  };
117  // Iterate over the catlist elements and copy them to vector
118  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
119 
120  }

References DK_SFG_BASE, dk_sfg_foobar, fmc_Cultivation, fmc_Cutting, fmc_Fertilizer, fmc_Grazing, fmc_Harvest, fmc_Herbicide, fmc_Insecticide, fmc_Others, fmc_Watering, Crop::m_base_elements_no, and Crop::m_ManagementCategories.

Referenced by DK_SpringFodderGrass().


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
dk_sfg_harvest
Definition: DK_SpringFodderGrass.h:39
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
Farm::SpringPlough
virtual bool SpringPlough(LE *a_field, double a_user, int a_days)
Carry out a ploughing event in the spring on a_field.
Definition: FarmFuncs.cpp:421
Farm::HerbicideTreat
virtual bool HerbicideTreat(LE *a_field, double a_user, int a_days)
Apply herbicide to a_field.
Definition: FarmFuncs.cpp:2025
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
dk_sfg_cutting_graze
Definition: DK_SpringFodderGrass.h:53
dk_sfg_cattle_out
Definition: DK_SpringFodderGrass.h:58
dk_sfg_spring_plough
Definition: DK_SpringFodderGrass.h:40
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
dk_sfg_start
Definition: DK_SpringFodderGrass.h:38
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
dk_sfg_manure_pig_s
Definition: DK_SpringFodderGrass.h:45
dk_sfg_cutting3
Definition: DK_SpringFodderGrass.h:55
cfg_farm_cattle_grass_high
CfgInt cfg_farm_cattle_grass_high
dk_sfg_spring_sow
Definition: DK_SpringFodderGrass.h:50
dk_sfg_manure_pig_p
Definition: DK_SpringFodderGrass.h:47
dk_sfg_swathing
Definition: DK_SpringFodderGrass.h:62
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::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::CutToSilage
virtual bool CutToSilage(LE *a_field, double a_user, int a_days)
Cut vegetation for silage on a_field.
Definition: FarmFuncs.cpp:1644
DK_SFG_BASE
#define DK_SFG_BASE
Definition: DK_SpringFodderGrass.h:31
Farm::StrawRemoval
virtual bool StrawRemoval(LE *a_field, double a_user, int a_days)
Straw covering applied on a_field.
Definition: FarmFuncs.cpp:1752
tos_SandyClayLoam
Definition: LandscapeFarmingEnums.h:722
DK_SFG_CC
#define DK_SFG_CC
Definition: DK_SpringFodderGrass.h:33
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
tos_SandyLoam
Definition: LandscapeFarmingEnums.h:721
tov_DKSpringFodderGrass
Definition: LandscapeFarmingEnums.h:377
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
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
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
cfg_pest_grass_on
CfgBool cfg_pest_grass_on
Turn on pesticides for grass.
Crop::SimpleEvent
void SimpleEvent(long a_date, int a_todo, bool a_lock)
Adds an event to this crop management.
Definition: Farm.cpp:747
dk_sfg_spring_roll3
Definition: DK_SpringFodderGrass.h:44
DK_SpringFodderGrass::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: DK_SpringFodderGrass.h:79
dk_sfg_cutting4
Definition: DK_SpringFodderGrass.h:56
CfgBool::value
bool value() const
Definition: Configurator.h:164
cfg_farm_cattle_grass_low
CfgInt cfg_farm_cattle_grass_low
dk_sfg_insecticide
Definition: DK_SpringFodderGrass.h:61
fmc_Cutting
Definition: LandscapeFarmingEnums.h:1009
dk_sfg_cutting1
Definition: DK_SpringFodderGrass.h:52
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
Calendar::Date
long Date(void)
Definition: Calendar.h:57
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
LE::GetSoilType
int GetSoilType()
Definition: Elements.h:302
dk_sfg_spring_roll1
Definition: DK_SpringFodderGrass.h:41
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
LE::GetVegHeight
virtual double GetVegHeight(void)
Definition: Elements.h:148
fmc_Watering
Definition: LandscapeFarmingEnums.h:1011
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
dk_sfg_grass_collected
Definition: DK_SpringFodderGrass.h:63
dk_sfg_spring_roll2
Definition: DK_SpringFodderGrass.h:42
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
dk_sfg_cutting2
Definition: DK_SpringFodderGrass.h:54
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
dk_sfg_grazing
Definition: DK_SpringFodderGrass.h:57
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
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
Farm::InsecticideTreat
virtual bool InsecticideTreat(LE *a_field, double a_user, int a_days)
Apply insecticide to a_field.
Definition: FarmFuncs.cpp:2135
tos_Sand
Definition: LandscapeFarmingEnums.h:719
Farm::ShallowHarrow
virtual bool ShallowHarrow(LE *a_field, double a_user, int a_days)
Carry out a shallow harrow event on a_field, e.g., after grass cutting event.
Definition: FarmFuncs.cpp:473
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
DK_SFG_CUT
#define DK_SFG_CUT
Definition: DK_SpringFodderGrass.h:34
dk_sfg_spring_harrow
Definition: DK_SpringFodderGrass.h:43
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
dk_sfg_npk_s
Definition: DK_SpringFodderGrass.h:46
Crop::m_last_date
int m_last_date
Definition: Farm.h:503
dk_sfg_npk_p
Definition: DK_SpringFodderGrass.h:48
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
dk_sfg_spring_sow_cc
Definition: DK_SpringFodderGrass.h:49
fmc_Grazing
Definition: LandscapeFarmingEnums.h:1010
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
dk_sfg_herbicide2
Definition: DK_SpringFodderGrass.h:59
dk_sfg_herbicide1
Definition: DK_SpringFodderGrass.h:51
dk_sfg_water
Definition: DK_SpringFodderGrass.h:60
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
DK_SFG_GRASS_READY
#define DK_SFG_GRASS_READY
Definition: DK_SpringFodderGrass.h:35
Farm::Swathing
virtual bool Swathing(LE *a_field, double a_user, int a_days)
Cut the crop on a_field and leave it lying (probably rape)
Definition: FarmFuncs.cpp:1350
Crop::AphidDamage
bool AphidDamage(LE *a_field)
Compares aphid numbers per m2 with a threshold to return true if threshold is exceeded.
Definition: Farm.cpp:726
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_ev
FarmEvent * m_ev
Definition: Farm.h:500
tos_LoamySand
Definition: LandscapeFarmingEnums.h:720
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
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
dk_sfg_foobar
Definition: DK_SpringFodderGrass.h:65