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

DE_OWinterRye class
. More...

#include <DE_OWinterRye.h>

Inheritance diagram for DE_OWinterRye:
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...
 
 DE_OWinterRye (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

DE_OWinterRye class
.

See DE_OWinterRye.h::DE_OWinterRyeToDo for a complete list of all possible events triggered codes by the winter rye 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

◆ DE_OWinterRye()

DE_OWinterRye::DE_OWinterRye ( TTypesOfVegetation  a_tov,
TTypesOfCrops  a_toc,
Landscape a_L 
)
inline
102  : Crop(a_tov, a_toc, a_L)
103  {
104  // When we start it off, the first possible date for a farm operation is 1st October
105  // This information is used by other crops when they decide how much post processing of
106  // the management is allowed after harvest before the next crop starts.
107  m_first_date=g_date->DayInYear( 30,9 );
109  }

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

Member Function Documentation

◆ Do()

bool DE_OWinterRye::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 - in this case conventional winter Rye.

Reimplemented from Crop.

84 {
85  /******************** This block can be added to the top of all Crop::Do methods ***********************************************/
86  m_farm = a_farm; // These assignments are necessary, not for this method but for related event calls
87  m_field = a_field;
88  m_ev = a_ev;
89  bool done = false; // The boolean value done indicates when we are totally finished with this plan (i.e. it is set to true).
90  bool flag = false;
91  int d1 = 0;
92  int d2 = 0;
93  int noDates = 1;
94  TTypesOfVegetation l_tov = tov_DEOWinterRye; // The current type - change to match the crop you have
95 /**********************************************To Here *************************************************************************/
96 
97  // Depending what event has occured jump to the correct bit of code
98  switch (m_ev->m_todo)
99  {
100  case de_owry_start:
101  {
103 
104  m_last_date = g_date->DayInYear(15, 9); // Should match the last flexdate below
105  //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
106  std::vector<std::vector<int>> flexdates(6 + 1, std::vector<int>(2, 0));
107  // Set up the date management stuff
108  // Start and stop dates for all events after harvest
109  flexdates[0][1] = g_date->DayInYear(20, 8); // last possible day of harvest - this is in effect day before the earliest date that a following crop can use
110  // Now these are done in pairs, start & end for each operation. If its not used then -1
111  flexdates[1][0] = -1;
112  flexdates[1][1] = g_date->DayInYear(22, 8); // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 1)
113  flexdates[2][0] = g_date->DayInYear(23, 8); // This date will be moved back as far as necessary and potentially to flexdates 1 (start op 2)
114  flexdates[2][1] = g_date->DayInYear(23, 8); // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 2)
115  flexdates[3][0] = g_date->DayInYear(25, 8); // This date will be moved back as far as necessary and potentially to flexdates 1 (start op 3)
116  flexdates[3][1] = g_date->DayInYear(30, 8); // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 3)
117  flexdates[4][0] = -1;
118  flexdates[4][1] = g_date->DayInYear(1, 9); // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 4)
119  flexdates[5][0] = -1;
120  flexdates[5][1] = g_date->DayInYear(5, 9); // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 5)
121  flexdates[6][0] = -1;
122  flexdates[6][1] = g_date->DayInYear(15, 9); // This date will be moved back as far as necessary and potentially to flexdates 1 (end op 6)
123 
124  // Below if this is a spring crop use 365, otherwise set this to 0, second parameter is fixed, and the third is the start up operation in the first year
125  int isSpring = 0;
126  if (StartUpCrop(isSpring, flexdates, int(de_owry_spring_roll1))) break;
127 
128  // End single block date checking code. Please see next line comment as well.
129  // Reinit d1 to first possible starting date.
130  d1 = g_date->OldDays() + g_date->DayInYear(15, 8) + isSpring;
131  // OK, let's go.
132  if (m_farm->IsStockFarmer()) // StockFarmer
133  {
135  }
136  else SimpleEvent_(d1, de_owry_ferti_p1, false, m_farm, m_field);
137  break;
138  }
139  break;
140 
141  case de_owry_ferti_p1:
142  if (m_ev->m_lock || m_farm->DoIt(10))
143  {
144  if (!m_farm->FP_Manure(m_field, 0.0, g_date->DayInYear(30, 9) - g_date->DayInYear())) {
146  break;
147  }
148  }
150  break;
151 
152  case de_owry_ferti_s1:
153  if (m_ev->m_lock || m_farm->DoIt(40))
154  {
155  if (!m_farm->FA_Manure(m_field, 0.0, g_date->DayInYear(30, 9) - g_date->DayInYear())) {
157  break;
158  }
159  }
161  break;
162 
164  if (m_ev->m_lock || m_farm->DoIt(80)) {
165  if (!m_farm->AutumnPlough(m_field, 0.0, g_date->DayInYear(30, 9) - g_date->DayInYear())) {
167  break;
168  }
171  break;
172  }
173  else
175  break;
176 
178  if (!m_farm->AutumnHarrow(m_field, 0.0, g_date->DayInYear(30, 9) - g_date->DayInYear())) {
180  break;
181  }
184  break;
185 
186  case de_owry_autumn_sow:
187  if (!m_farm->AutumnSow(m_field, 0.0, g_date->DayInYear(15, 10) - g_date->DayInYear())) {
189  break;
190  }
191  {
192  long newdate1 = g_date->OldDays() + g_date->DayInYear(20, 9);
193  long newdate2 = g_date->Date() + 10;
194  if (newdate2 > newdate1)
195  newdate1 = newdate2;
196  SimpleEvent_(newdate1, de_owry_strigling1, false, m_farm, m_field);
197  }
198  break;
199 
200  case de_owry_strigling1:
201  if (m_ev->m_lock || m_farm->DoIt(80)) {
202  if (!m_farm->Strigling(m_field, 0.0, g_date->DayInYear(20, 10) - g_date->DayInYear())) {
204  break;
205  }
206  }
207  // Next year
209  break;
210 
212  if (m_ev->m_lock || m_farm->DoIt(5))
213  {
214  if (!m_farm->SpringRoll(m_field, 0.0, g_date->DayInYear(5, 3) - g_date->DayInYear())) {
216  break;
217  }
218  }
220  break;
221  case de_owry_strigling2:
222  if (m_ev->m_lock || m_farm->DoIt(70)) {
223  if (!m_farm->Strigling(m_field, 0.0, g_date->DayInYear(20, 3) - g_date->DayInYear())) {
225  break;
226  }
227  }
229  break;
230 
231  case de_owry_strigling3:
232  if (m_ev->m_lock || m_farm->DoIt(30)) {
233  if (!m_farm->Strigling(m_field, 0.0, g_date->DayInYear(15, 4) - g_date->DayInYear())) {
235  break;
236  }
237  }
238  if (m_farm->IsStockFarmer()) // StockFarmer
239  {
241  }
242  else
244  break;
245 
246  case de_owry_ferti_s2:
247  if (m_ev->m_lock || m_farm->DoIt(30)) {
248  if (!m_farm->FA_Slurry(m_field, 0.0, g_date->DayInYear(30, 4) - g_date->DayInYear())) {
250  break;
251  }
252  }
254  break;
255 
256  case de_owry_harvest:
257  if (!m_farm->Harvest(m_field, 0.0, m_field->GetMDates(1, 0) - g_date->DayInYear())) { // last date 20/8
259  break;
260  }
262  break;
263 
265  if (m_ev->m_lock || m_farm->DoIt_prob(.60))
266  {
267  if (!m_farm->StrawChopping(m_field, 0.0, m_field->GetMDates(1, 1) - g_date->DayInYear())) // last date 22/8
268  {
270  break;
271  }
273  break;
274  }
275  else if (m_ev->m_lock || m_farm->DoIt_prob(.40 / .40)) {
276  d1 = g_date->Date() + 3;
277  if (d1 < m_field->GetMDates(0, 2)) d1 = m_field->GetMDates(0, 2); // start date 23/8
279  break;
280  }
281 
282  case de_owry_hay_turning:
283  if (m_ev->m_lock || m_farm->DoIt_prob(.20 / .40))
284  {
285  if (!m_farm->HayTurning(m_field, 0.0, m_field->GetMDates(1, 2) - g_date->DayInYear())) { // end date 23/8
287  break;
288  }
289  }
290  d1 = g_date->OldDays() + g_date->DayInYear(7, 8);
291  d2 = g_date->Date() + 3;
292  if (d2 > d1) d1 = d2;
293  if (d1 > m_field->GetMDates(0, 3)) d1 = m_field->GetMDates(0, 3); // start date 25/8
295  break;
296 
297  case de_owry_hay_bailing:
298  if (!m_farm->HayBailing(m_field, 0.0, m_field->GetMDates(1, 3) - g_date->DayInYear())) { // end date 30/8
300  break;
301  }
303  break;
304 
305  case de_owry_deep_plough:
306  if (m_ev->m_lock || m_farm->DoIt_prob(.60))
307  {
308  if (!m_farm->DeepPlough(m_field, 0.0,
309  m_field->GetMDates(1, 4) - g_date->DayInYear())) // end date 1/9
310  {
312  break;
313  }
314  done = true;
315  break;
316  }
317  else if (m_ev->m_lock || m_farm->DoIt_prob(.20 / .40)) {
319  break;
320  }
321  else done = true;
322 
324  if (!m_farm->StubbleHarrowing(m_field, 0.0, m_field->GetMDates(1, 5) - g_date->DayInYear())) { // last date 5/9
326  break;
327  }
328  SimpleEvent_(g_date->Date() + 10, de_owry_stubble_harrow2, false, m_farm, m_field); // main thread
329  break;
330 
332  if (!m_farm->StubbleHarrowing(m_field, 0.0, m_field->GetMDates(1, 6) - g_date->DayInYear())) // end date 15/9
333  {
335  break;
336  }
337  done = true;
338  // END OF MAIN THREAD
339  break;
340 
341  default:
342  g_msg->Warn(WARN_BUG, "DE_OWinterRye::Do(): "
343  "Unknown event type! ", "");
344  exit(1);
345  }
346  return done;
347 }

References Farm::AutumnHarrow(), Farm::AutumnPlough(), Farm::AutumnSow(), LE::ClearManagementActionSum(), Calendar::Date(), Calendar::DayInYear(), de_owry_autumn_harrow, de_owry_autumn_plough, de_owry_autumn_sow, de_owry_deep_plough, de_owry_ferti_p1, de_owry_ferti_s1, de_owry_ferti_s2, de_owry_harvest, de_owry_hay_bailing, de_owry_hay_turning, de_owry_spring_roll1, de_owry_start, de_owry_straw_chopping, de_owry_strigling1, de_owry_strigling2, de_owry_strigling3, de_owry_stubble_harrow1, de_owry_stubble_harrow2, Farm::DeepPlough(), Farm::DoIt(), Farm::DoIt_prob(), Farm::FA_Manure(), Farm::FA_Slurry(), Farm::FP_Manure(), g_date, g_msg, LE::GetMDates(), Farm::Harvest(), Farm::HayBailing(), Farm::HayTurning(), Farm::IsStockFarmer(), Crop::m_ev, Crop::m_farm, Crop::m_field, Crop::m_last_date, FarmEvent::m_lock, FarmEvent::m_todo, Calendar::OldDays(), Crop::SimpleEvent_(), Farm::SpringRoll(), Crop::StartUpCrop(), Farm::StrawChopping(), Farm::Strigling(), Farm::StubbleHarrowing(), tov_DEOWinterRye, MapErrorMsg::Warn(), and WARN_BUG.

◆ SetUpFarmCategoryInformation()

void DE_OWinterRye::SetUpFarmCategoryInformation ( )
inline
110  {
111  const int elements = 2 + (de_owry_foobar - DE_OWINTERRYE_BASE);
113 
114  FarmManagementCategory catlist[elements] =
115  {
116  fmc_Others, // zero element unused but must be here
117  fmc_Others, // de_owry_start = 1, // Compulsory, must always be 1 (one).
118  fmc_Others, // de_owry_sleep_all_day = DE_OWRY_BASE,
119  fmc_Fertilizer, // de_owry_ferti_s1,
120  fmc_Fertilizer, // de_owry_ferti_s2,
121  fmc_Fertilizer, // de_owry_ferti_p1,
122  fmc_Cultivation, // de_owry_autumn_plough,
123  fmc_Cultivation, // de_owry_autumn_harrow,
124  fmc_Others, // de_owry_autumn_sow,
125  fmc_Cultivation, // de_owry_strigling1,
126  fmc_Cultivation, // de_owry_strigling2,
127  fmc_Cultivation, // de_owry_strigling3,
128  fmc_Cultivation, // de_owry_spring_roll1,
129  fmc_Harvest, // de_owry_harvest,
130  fmc_Others, // de_owry_hay_turning,
131  fmc_Cutting, // de_owry_straw_chopping,
132  fmc_Others, // de_owry_hay_bailing,
133  fmc_Cultivation, // de_owry_stubble_harrow1,
134  fmc_Cultivation, // de_owry_stubble_harrow2,
135  fmc_Cultivation, // de_owry_deep_plough,
136  // no foobar entry
137 
138  };
139  // Iterate over the catlist elements and copy them to vector
140  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
141 
142  }

References DE_OWINTERRYE_BASE, de_owry_foobar, fmc_Cultivation, fmc_Cutting, fmc_Fertilizer, fmc_Harvest, fmc_Others, Crop::m_base_elements_no, and Crop::m_ManagementCategories.

Referenced by DE_OWinterRye().


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
de_owry_ferti_s1
Definition: DE_OWinterRye.h:69
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
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
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
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
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
de_owry_spring_roll1
Definition: DE_OWinterRye.h:78
de_owry_hay_turning
Definition: DE_OWinterRye.h:80
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
de_owry_straw_chopping
Definition: DE_OWinterRye.h:81
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
de_owry_autumn_harrow
Definition: DE_OWinterRye.h:73
de_owry_ferti_p1
Definition: DE_OWinterRye.h:71
Farm::FP_Manure
virtual bool FP_Manure(LE *a_field, double a_user, int a_days)
Spread manure on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:896
fmc_Cutting
Definition: LandscapeFarmingEnums.h:1009
de_owry_strigling2
Definition: DE_OWinterRye.h:76
de_owry_ferti_s2
Definition: DE_OWinterRye.h:70
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
de_owry_stubble_harrow1
Definition: DE_OWinterRye.h:83
Calendar::Date
long Date(void)
Definition: Calendar.h:57
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
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
de_owry_hay_bailing
Definition: DE_OWinterRye.h:82
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
de_owry_autumn_sow
Definition: DE_OWinterRye.h:74
de_owry_strigling1
Definition: DE_OWinterRye.h:75
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
de_owry_autumn_plough
Definition: DE_OWinterRye.h:72
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
de_owry_harvest
Definition: DE_OWinterRye.h:79
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
de_owry_strigling3
Definition: DE_OWinterRye.h:77
DE_OWINTERRYE_BASE
#define DE_OWINTERRYE_BASE
Definition: DE_OWinterRye.h:53
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
Farm::AutumnHarrow
virtual bool AutumnHarrow(LE *a_field, double a_user, int a_days)
Carry out a harrow event in the autumn on a_field.
Definition: FarmFuncs.cpp:285
de_owry_stubble_harrow2
Definition: DE_OWinterRye.h:84
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
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
Farm::AutumnSow
virtual bool AutumnSow(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 autumn on a_field.
Definition: FarmFuncs.cpp:360
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
de_owry_deep_plough
Definition: DE_OWinterRye.h:85
DE_OWinterRye::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: DE_OWinterRye.h:110
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
tov_DEOWinterRye
Definition: LandscapeFarmingEnums.h:496
Crop::Crop
Crop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Farm.cpp:733
de_owry_foobar
Definition: DE_OWinterRye.h:86
Farm::HayTurning
virtual bool HayTurning(LE *a_field, double a_user, int a_days)
Carry out hay turning on a_field.
Definition: FarmFuncs.cpp:1491
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
WARN_BUG
Definition: MapErrorMsg.h:34
de_owry_start
Definition: DE_OWinterRye.h:67
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
Crop::SimpleEvent_
void SimpleEvent_(long a_date, int a_todo, bool a_lock, Farm *a_farm, LE *a_field)
Adds an event to this crop management without relying on member variables.
Definition: Farm.cpp:751