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

DK_EnergyCrop_Perm class
. More...

#include <DK_EnergyCrop_Perm.h>

Inheritance diagram for DK_EnergyCrop_Perm:
Crop

Public Member Functions

virtual bool Do (Farm *a_farm, LE *a_field, FarmEvent *a_ev)
 The one and only method for a crop management plan. All farm actions go through here. More...
 
 DK_EnergyCrop_Perm (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...
 

Detailed Description

DK_EnergyCrop_Perm class
.

See DK_EnergyCrop.h::DK_EnergyCropToDo for a complete list of all possible events triggered codes by the management plan. When triggered these events are handled by Farm and are available as information for other objects such as animal and bird models.

Constructor & Destructor Documentation

◆ DK_EnergyCrop_Perm()

DK_EnergyCrop_Perm::DK_EnergyCrop_Perm ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
78  : Crop(a_tov, a_toc, a_L)
79  {
80  // When we start it off, the first possible date for a farm operation is ...
81  // This information is used by other crops when they decide how much post processing of
82  // the management is allowed after harvest before the next crop starts.
83  m_first_date=g_date->DayInYear( 1,12 );
85  }

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

Member Function Documentation

◆ Do()

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

The one and only method for a crop management plan. All farm actions go through here.

Called every time something is done to the crop by the farmer in the first instance it is always called with a_ev->todo set to start, but susequently will be called whenever the farmer wants to carry out a new operation.
This method details all the management and relationships between operations necessary to grow and ALMaSS crop.

Reimplemented from Crop.

65 {
66  m_farm = a_farm;
67  m_field = a_field;
68  m_ev = a_ev;
69  bool done = false; // The boolean value done indicates when we are totally finished with this plan (i.e. it is set to true).
70  int d1 = 0;
72  // Depending what event has occured jump to the correct bit of code
73  switch (m_ev->m_todo)
74  {
75  case dk_ec_start:
76  {
77  DK_EC_YEARS_AFTER_EST = false;
78  // dk_ec_start just sets up all the starting conditions and reference dates that are needed to start a dk_bfp1
79 
80  a_field->ClearManagementActionSum();
81  m_last_date = g_date->DayInYear(15, 10); // Should match the last flexdate below
82  //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
83  std::vector<std::vector<int>> flexdates(3 + 1, std::vector<int>(2, 0));
84  // Set up the date management stuff
85  // Start and stop dates for all events after harvest
86  flexdates[0][1] = g_date->DayInYear(30, 9); // last possible day of harvest
87  // Now these are done in pairs, start & end for each operation. If its not used then -1
88  flexdates[1][0] = -1; // This date will be moved back as far as necessary and potentially to flexdates 1 (start op 1)
89  flexdates[1][1] = g_date->DayInYear(15, 10); // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 1) herbi
90  flexdates[2][0] = -1; // This date will be moved back as far as necessary and potentially to flexdates 2 (start op 2)
91  flexdates[2][1] = g_date->DayInYear(15, 10); // This date will be moved back as far as necessary and potentially to flexdates 2 (end op 2) ferti
92  flexdates[3][0] = -1; // This date will be moved back as far as necessary and potentially to flexdates 3 (start op 3)
93  flexdates[3][1] = g_date->DayInYear(15, 10); // This date will be moved back as far as necessary and potentially to flexdates 3 (end op 3) ferti
94 
95  // 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
96  int isSpring = 365;
97  if (StartUpCrop(isSpring, flexdates, int(dk_ec_deep_plough_sand))) break;
98 
99  // End single block date checking code. Please see next line comment as well.
100  // Reinit d1 to first possible starting date.
101  // Here we queue up the first event
102  if ((DK_EC_YEARS_AFTER_EST + g_date->GetYearNumber()) % 1 == 1)
103  {
104  d1 = g_date->OldDays() + g_date->DayInYear(25, 2) + isSpring;
106  }
107  else if ((DK_EC_YEARS_AFTER_EST + g_date->GetYearNumber()) % 1 == 0)
108  {
109  d1 = g_date->OldDays() + g_date->DayInYear(1, 3) + isSpring;
110  SimpleEvent(d1, dk_ec_cut_trees, false);
111  }
112  break;
113  }
114  break;
115 
116  // LKM: This is the first real farm operation - done if much seed weed or setaside field
118  if (m_field->GetSoilType() == tos_Sand || m_field->GetSoilType() == tos_LoamySand || m_field->GetSoilType() == tos_SandyLoam || m_field->GetSoilType() == tos_SandyClayLoam) // on sandy soils (NL ZAND & LOSS)
119  {
120  if (a_field->GetVegBiomass() > 0)
121  {
122  if (m_ev->m_lock || m_farm->DoIt_prob(1.0)) {
123  if (!m_farm->DeepPlough(m_field, 0.0, g_date->DayInYear(10, 3) - g_date->DayInYear())) {
125  break;
126  }
127  }
128  }
130  break;
131  }
133  break;
134 
135  case dk_ec_roll1_sand:
136  if (m_ev->m_lock || m_farm->DoIt_prob(1.00))
137  {
138  if (!a_farm->SpringRoll(m_field, 0.0, g_date->DayInYear(12, 3) - g_date->DayInYear())) {
139  SimpleEvent(g_date->Date() + 1, dk_ec_roll1_sand, true);
140  break;
141  }
142  }
144  break;
145 
147  if (m_farm->IsStockFarmer()) { //Stock Farmer
148  if (m_ev->m_lock || m_farm->DoIt_prob(1.00))
149  {
150  if (!a_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(14, 3) - g_date->DayInYear())) {
152  break;
153  }
154  }
155  SimpleEvent(g_date->Date() + 1, dk_ec_planting_sand, false);
156  break;
157  }
158  else
160  break;
161 
162  case dk_ec_npk1_p_sand:
163  if (m_ev->m_lock || m_farm->DoIt_prob(1.00))
164  {
165  if (!a_farm->FP_NPK(m_field, 0.0, g_date->DayInYear(14, 3) - g_date->DayInYear())) {
166  SimpleEvent(g_date->Date() + 1, dk_ec_npk1_p_sand, true);
167  break;
168  }
169  }
171  break;
172 
173  case dk_ec_planting_sand:
174  if (m_ev->m_lock || m_farm->DoIt_prob(1.00))
175  {
176  if (!a_farm->SpringSow(m_field, 0.0, g_date->DayInYear(15, 3) - g_date->DayInYear())) {
178  break;
179  }
180  }
181  SimpleEvent(g_date->Date() + 1, dk_ec_roll2, false);
182  break;
183 
185  if (m_ev->m_lock || m_farm->DoIt_prob(1.00))
186  {
187  if (!a_farm->DeepPlough(m_field, 0.0, g_date->DayInYear(25, 4) - g_date->DayInYear())) {
189  break;
190  }
191  }
193  break;
194 
195  case dk_ec_roll1_clay:
196  if (m_ev->m_lock || m_farm->DoIt_prob(1.00))
197  {
198  if (!a_farm->SpringRoll(m_field, 0.0, g_date->DayInYear(27, 4) - g_date->DayInYear())) {
199  SimpleEvent(g_date->Date() + 1, dk_ec_roll1_clay, true);
200  break;
201  }
202  }
204  break;
205 
207  if (m_farm->IsStockFarmer()) { //Stock Farmer
208  if (m_ev->m_lock || m_farm->DoIt_prob(1.00))
209  {
210  if (!a_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(29, 4) - g_date->DayInYear())) {
212  break;
213  }
214  }
215  SimpleEvent(g_date->Date() + 1, dk_ec_planting_clay, false);
216  break;
217  }
218  else
220  break;
221 
222  case dk_ec_npk1_p_clay:
223  if (m_ev->m_lock || m_farm->DoIt_prob(1.00))
224  {
225  if (!a_farm->FP_NPK(m_field, 0.0, g_date->DayInYear(29, 4) - g_date->DayInYear())) {
226  SimpleEvent(g_date->Date() + 1, dk_ec_npk1_p_clay, true);
227  break;
228  }
229  }
230  SimpleEvent(g_date->Date() + 1, dk_ec_planting_clay, false);
231  break;
232 
233  case dk_ec_planting_clay:
234  if (m_ev->m_lock || m_farm->DoIt_prob(1.00))
235  {
236  if (!a_farm->SpringSow(m_field, 0.0, g_date->DayInYear(31, 4) - g_date->DayInYear())) {
238  break;
239  }
240  }
241  SimpleEvent(g_date->Date() + 1, dk_ec_roll2, false);
242  break;
243 
244  case dk_ec_roll2:
245  if (!a_farm->SpringRoll(m_field, 0.0, g_date->DayInYear(1, 5) - g_date->DayInYear())) {
246  SimpleEvent(g_date->Date() + 1, dk_ec_roll2, true);
247  break;
248  }
249 
250  // if time then herbicide before May, otherwise after May (not when budding in ~May)
251  d1 = g_date->Date();
252  if (d1 < g_date->OldDays() + g_date->DayInYear(30, 4)) {
253  SimpleEvent(g_date->Date()+1, dk_ec_herbicide1, false);
254  break;
255  }
256  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6), dk_ec_herbicide1, false);
257  break;
258 
259  case dk_ec_herbicide1:
260  if (!a_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(30, 6) - g_date->DayInYear())) {
261  SimpleEvent(g_date->Date() + 1, dk_ec_herbicide1, true);
262  break;
263  }
264 
266  break;
267  case dk_ec_shallowharrow1:
268  if (!a_farm->ShallowHarrow(m_field, 0.0, g_date->DayInYear(1, 8) - g_date->DayInYear())) {
270  break;
271  }
273  break;
274  case dk_ec_shallowharrow2:
275  if (!a_farm->ShallowHarrow(m_field, 0.0, g_date->DayInYear(2, 8) - g_date->DayInYear())) {
277  break;
278  }
279 
280  // After first growth season
281  SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 3)+365, dk_ec_cut_trees, false);
282  break;
283 
284  case dk_ec_cut_trees:
285  if (!a_farm->Pruning(m_field, 0.0, g_date->DayInYear(15, 3) - g_date->DayInYear())) {
286  SimpleEvent(g_date->Date() + 1, dk_ec_cut_trees, true);
287  break;
288  }
289 
290  // here comes a fork of parallel events:
291  SimpleEvent(g_date->Date()+1, dk_ec_herbicide2, false); // herbi thread
292  SimpleEvent(g_date->Date() + 1, dk_ec_slurry2_s, false); // fertilizer thread
293  SimpleEvent(g_date->Date() + 1, dk_ec_shallowharrow3, false); // cultivation thread - main thread
294  break;
295 
296  case dk_ec_herbicide2:
297  if (!a_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(31, 3) - g_date->DayInYear())) {
298  SimpleEvent(g_date->Date() + 1, dk_ec_herbicide2, true);
299  break;
300  }
301  // if time then herbicide before May, otherwise after May (not when budding in ~May)
302  d1 = g_date->Date();
303  if (d1 < g_date->OldDays() + g_date->DayInYear(30, 4)) {
304  SimpleEvent(g_date->Date() + 1, dk_ec_herbicide3, false);
305  break;
306  }
307  else SimpleEvent(g_date->OldDays() + g_date->DayInYear(1, 6), dk_ec_herbicide3, false);
308  break;
309 
310  case dk_ec_herbicide3:
311  if (!a_farm->HerbicideTreat(m_field, 0.0, g_date->DayInYear(30, 6) - g_date->DayInYear())) {
312  SimpleEvent(g_date->Date() + 1, dk_ec_herbicide3, true);
313  break;
314  }
315  break; // end of thread
316 
317  case dk_ec_slurry2_s:
318  if (m_farm->IsStockFarmer()) { //Stock Farmer
319  if (m_ev->m_lock || m_farm->DoIt_prob(1.00))
320  {
321  if (!a_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(31, 3) - g_date->DayInYear())) {
322  SimpleEvent(g_date->Date() + 1, dk_ec_slurry2_s, true);
323  break;
324  }
325  }
326  break; //end of thread
327  }
328  else
329  SimpleEvent(g_date->Date(), dk_ec_npk2_p, false);
330  break;
331 
332  case dk_ec_npk2_p:
333  if (m_ev->m_lock || m_farm->DoIt_prob(1.00))
334  {
335  if (!a_farm->FP_NPK(m_field, 0.0, g_date->DayInYear(31, 3) - g_date->DayInYear())) {
336  SimpleEvent(g_date->Date() + 1, dk_ec_npk2_p, true);
337  break;
338  }
339  }
340  break; //end of thread
341 
343  if (!a_farm->ShallowHarrow(m_field, 0.0, g_date->DayInYear(1, 8) - g_date->DayInYear())) {
345  break;
346  }
348  break;
349 
351  if (!a_farm->ShallowHarrow(m_field, 0.0, g_date->DayInYear(2, 8) - g_date->DayInYear())) {
353  break;
354  }
356  break;
357 
358  case dk_ec_harvest:
359  if (!a_farm->Harvest(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) {
360  SimpleEvent(g_date->Date() + 1, dk_ec_harvest, true);
361  break;
362  }
363 
364  //fork with parallel events:
365  SimpleEvent(g_date->Date() + 1, dk_ec_herbicide4, false); // herbi thread
366  SimpleEvent(g_date->Date() + 1, dk_ec_slurry3_s, false); // fertilizer thread - main thread
367  break;
368 
369  case dk_ec_herbicide4:
370  if (!a_farm->HerbicideTreat(m_field, 0.0, m_field->GetMDates(1, 1) - g_date->DayInYear())) {
371  SimpleEvent(g_date->Date() + 1, dk_ec_herbicide4, true);
372  break;
373  }
374  break; // end of thread
375 
376  case dk_ec_slurry3_s:
377  if (m_farm->IsStockFarmer()) { //Stock Farmer
378  if (m_ev->m_lock || m_farm->DoIt_prob(1.00))
379  {
380  if (!a_farm->FA_Slurry(m_field, 0.0, m_field->GetMDates(1, 2) - g_date->DayInYear())) {
381  SimpleEvent(g_date->Date() + 1, dk_ec_slurry3_s, true);
382  break;
383  }
384  }
385  done = true;
386  break;
387  }
388  else
389  SimpleEvent(g_date->Date(), dk_ec_npk3_p, false);
390  break;
391 
392  case dk_ec_npk3_p:
393  if (m_ev->m_lock || m_farm->DoIt_prob(1.00))
394  {
395  if (!a_farm->FP_NPK(m_field, 0.0, m_field->GetMDates(1, 3) - g_date->DayInYear())) {
396  SimpleEvent(g_date->Date() + 1, dk_ec_npk3_p, true);
397  break;
398  }
399  }
400  done = true;
401  break;
402  // So we are done, and somewhere else the farmer will queue up the start event of the next crop
403  // END of MAIN THREAD
404  break;
405  default:
406  g_msg->Warn(WARN_BUG, "DK_EnergyCrop_Perm::Do(): "
407  "Unknown event type! ", "");
408  exit(1);
409  }
410  return done;
411 }

References LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), Farm::DeepPlough(), dk_ec_cut_trees, dk_ec_deep_plough_clay, dk_ec_deep_plough_sand, dk_ec_harvest, dk_ec_herbicide1, dk_ec_herbicide2, dk_ec_herbicide3, dk_ec_herbicide4, dk_ec_npk1_p_clay, dk_ec_npk1_p_sand, dk_ec_npk2_p, dk_ec_npk3_p, dk_ec_planting_clay, dk_ec_planting_sand, dk_ec_roll1_clay, dk_ec_roll1_sand, dk_ec_roll2, dk_ec_shallowharrow1, dk_ec_shallowharrow2, dk_ec_shallowharrow3, dk_ec_shallowharrow4, dk_ec_slurry1_s_clay, dk_ec_slurry1_s_sand, dk_ec_slurry2_s, dk_ec_slurry3_s, dk_ec_start, DK_EC_YEARS_AFTER_EST, Farm::DoIt_prob(), Farm::FA_Slurry(), Farm::FP_NPK(), g_date, g_msg, LE::GetMDates(), LE::GetSoilType(), LE::GetVegBiomass(), Calendar::GetYearNumber(), Farm::Harvest(), Farm::HerbicideTreat(), Farm::IsStockFarmer(), Crop::m_ev, Crop::m_farm, Crop::m_field, Crop::m_last_date, FarmEvent::m_lock, FarmEvent::m_todo, Calendar::OldDays(), Farm::Pruning(), Farm::ShallowHarrow(), Crop::SimpleEvent(), Farm::SpringRoll(), Farm::SpringSow(), Crop::StartUpCrop(), tos_LoamySand, tos_Sand, tos_SandyClayLoam, tos_SandyLoam, tov_DKEnergyCrop_Perm, MapErrorMsg::Warn(), and WARN_BUG.

◆ SetUpFarmCategoryInformation()

void DK_EnergyCrop_Perm::SetUpFarmCategoryInformation ( )
inline
86  {
87  const int elements = 2 + (dk_ec_foobar - DK_EC_BASE);
89 
90  FarmManagementCategory catlist[elements] =
91  {
92  fmc_Others, // zero element unused but must be here
93  fmc_Others, // dk_ec_start = 1, // Compulsory, must always be 1 (one).
94  fmc_Others, // dk_ec_sleep_all_day = // DK_EC_BASE,
95  fmc_Cultivation, // dk_ec_deep_plough_sand,
96  fmc_Cultivation, //dk_ec_roll1_sand,
97  fmc_Fertilizer, // dk_ec_slurry1_s_sand,
98  fmc_Fertilizer, // dk_ec_npk1_p_sand,
99  fmc_Cultivation, // dk_ec_deep_plough_clay,
100  fmc_Cultivation, //dk_ec_roll1_clay,
101  fmc_Fertilizer, // dk_ec_slurry1_s_clay,
102  fmc_Fertilizer, // dk_ec_npk1_p_clay,
103  fmc_Others, //dk_ec_planting_sand,
104  fmc_Others, //dk_ec_planting_clay,
105  fmc_Cultivation, //dk_ec_roll2,
106  fmc_Herbicide, // dk_ec_herbicide1,
107  fmc_Cultivation, // dk_ec_shallow_harrow1,
108  fmc_Cultivation, // dk_ec_shallow_harrow2,
109  fmc_Cutting, // dk_ec_cut_trees,
110  fmc_Herbicide, // dk_ec_herbicide2,
111  fmc_Fertilizer, // dk_ec_slurry2_s,
112  fmc_Fertilizer, // dk_ec_npk2_p,
113  fmc_Herbicide, // dk_ec_herbicide3,
114  fmc_Cultivation, // dk_ec_shallow_harrow3,
115  fmc_Cultivation, // dk_ec_shallow_harrow4,
116  fmc_Harvest, // dk_ec_harvest,
117  fmc_Herbicide, // dk_ec_herbicide4,
118  fmc_Fertilizer, // dk_ec_slurry3_s,
119  fmc_Fertilizer, // dk_ec_npk3_p,
120  // no foobar entry
121 
122  };
123  // Iterate over the catlist elements and copy them to vector
124  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
125  }

References DK_EC_BASE, dk_ec_foobar, fmc_Cultivation, fmc_Cutting, fmc_Fertilizer, fmc_Harvest, fmc_Herbicide, fmc_Others, Crop::m_base_elements_no, and Crop::m_ManagementCategories.

Referenced by DK_EnergyCrop_Perm().


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
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_ec_start
Definition: DK_EnergyCrop_Perm.h:36
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
dk_ec_planting_clay
Definition: DK_EnergyCrop_Perm.h:47
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
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
Calendar::GetYearNumber
int GetYearNumber(void)
Definition: Calendar.h:72
DK_EnergyCrop_Perm::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: DK_EnergyCrop_Perm.h:86
dk_ec_npk3_p
Definition: DK_EnergyCrop_Perm.h:62
tos_SandyClayLoam
Definition: LandscapeFarmingEnums.h:722
dk_ec_roll1_sand
Definition: DK_EnergyCrop_Perm.h:39
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
dk_ec_cut_trees
Definition: DK_EnergyCrop_Perm.h:52
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
tos_SandyLoam
Definition: LandscapeFarmingEnums.h:721
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
dk_ec_deep_plough_clay
Definition: DK_EnergyCrop_Perm.h:42
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
LE::GetVegBiomass
virtual double GetVegBiomass(void)
Definition: Elements.h:164
dk_ec_roll1_clay
Definition: DK_EnergyCrop_Perm.h:43
DK_EC_BASE
#define DK_EC_BASE
Definition: DK_EnergyCrop_Perm.h:25
dk_ec_shallowharrow3
Definition: DK_EnergyCrop_Perm.h:57
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_ec_herbicide1
Definition: DK_EnergyCrop_Perm.h:49
fmc_Cutting
Definition: LandscapeFarmingEnums.h:1009
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
dk_ec_harvest
Definition: DK_EnergyCrop_Perm.h:59
dk_ec_planting_sand
Definition: DK_EnergyCrop_Perm.h:46
Calendar::Date
long Date(void)
Definition: Calendar.h:57
dk_ec_foobar
Definition: DK_EnergyCrop_Perm.h:63
dk_ec_deep_plough_sand
Definition: DK_EnergyCrop_Perm.h:38
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
LE::GetSoilType
int GetSoilType()
Definition: Elements.h:302
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
dk_ec_npk2_p
Definition: DK_EnergyCrop_Perm.h:55
dk_ec_slurry2_s
Definition: DK_EnergyCrop_Perm.h:54
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
dk_ec_shallowharrow4
Definition: DK_EnergyCrop_Perm.h:58
dk_ec_slurry3_s
Definition: DK_EnergyCrop_Perm.h:61
dk_ec_shallowharrow1
Definition: DK_EnergyCrop_Perm.h:50
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_ec_npk1_p_sand
Definition: DK_EnergyCrop_Perm.h:41
dk_ec_herbicide4
Definition: DK_EnergyCrop_Perm.h:60
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
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
tos_Sand
Definition: LandscapeFarmingEnums.h:719
dk_ec_npk1_p_clay
Definition: DK_EnergyCrop_Perm.h:45
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
dk_ec_herbicide3
Definition: DK_EnergyCrop_Perm.h:56
Crop::m_last_date
int m_last_date
Definition: Farm.h:503
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
DK_EC_YEARS_AFTER_EST
#define DK_EC_YEARS_AFTER_EST
Definition: DK_EnergyCrop_Perm.h:23
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
dk_ec_slurry1_s_sand
Definition: DK_EnergyCrop_Perm.h:40
dk_ec_slurry1_s_clay
Definition: DK_EnergyCrop_Perm.h:44
tov_DKEnergyCrop_Perm
Definition: LandscapeFarmingEnums.h:448
Farm::DeepPlough
virtual bool DeepPlough(LE *a_field, double a_user, int a_days)
Carry out a deep ploughing event on a_field.
Definition: FarmFuncs.cpp:408
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
Farm::Pruning
virtual bool Pruning(LE *a_field, double a_user, int a_days)
Pruning applied on a_field - details needs to be added (e.g., impact on biomass, influence/impacts in...
Definition: FarmFuncs.cpp:1897
dk_ec_roll2
Definition: DK_EnergyCrop_Perm.h:48
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_ec_shallowharrow2
Definition: DK_EnergyCrop_Perm.h:51
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
tos_LoamySand
Definition: LandscapeFarmingEnums.h:720
dk_ec_herbicide2
Definition: DK_EnergyCrop_Perm.h:53
WARN_BUG
Definition: MapErrorMsg.h:34
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001