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
GenericCatchCrop.h
Go to the documentation of this file.
1 
13 //
14 // GenericCatchCrop.h
15 //
16 
17 
18 #ifndef GENERIC_CATCH_CROP_BASE_H
19 #define GENERIC_CATCH_CROP_BASE_H
20 
21 #define GENERIC_CATCH_CROP_BASE 100000
22 
23 #define GCCR_ENDDATE a_field->m_user[0]
24 
30 typedef enum {
31  gccr_start = 1, // Compulsory, must always be 1 (one).
37 
38 
48 class GenericCatchCrop : public Crop
49 {
50  public:
51  virtual bool Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev );
52  GenericCatchCrop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape* a_L) : Crop(a_tov, a_toc, a_L)
53  {
57  }
59  const int elements = 2 + (gccr_foobar - GENERIC_CATCH_CROP_BASE);
61 
62  FarmManagementCategory catlist[elements] =
63  {
64  fmc_Others, // zero element unused but must be here
65  fmc_Others, // gccr_start = 1, // Compulsory, must always be 1 (one).
66  fmc_Others, // gccr_sleep_all_day = GENERIC_CATCH_CROP_BASE,
67  fmc_Others, // gccr_sow,
68  fmc_Harvest // gccr_harvest,
69 
70 
71  // no foobar entry
72 
73  };
74  // Iterate over the catlist elements and copy them to vector
75  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
76 
77  }
78 };
79 
80 #endif //GENERIC_CATCH_CROP_BASE_H
81 
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
GENERIC_CATCH_CROP_BASE
#define GENERIC_CATCH_CROP_BASE
Definition: GenericCatchCrop.h:21
GenericCatchCrop::GenericCatchCrop
GenericCatchCrop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: GenericCatchCrop.h:52
LE::SetMDates
void SetMDates(int a, int b, int c)
Definition: Elements.h:406
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
GenericCatchCrop::Do
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.
Definition: GenericCatchCrop.cpp:52
gccr_sleep_all_day
Definition: GenericCatchCrop.h:32
FarmEvent
A struct to hold the information required to trigger a farm event.
Definition: Farm.h:372
LE::ClearManagementActionSum
void ClearManagementActionSum()
clears the management action counters
Definition: Elements.h:247
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
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
FarmEvent::m_startday
int m_startday
Definition: Farm.h:385
Crop
The base class for all crops.
Definition: Farm.h:495
Crop::SimpleEvent
void SimpleEvent(long a_date, int a_todo, bool a_lock)
Adds an event to this crop management.
Definition: Farm.cpp:747
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
gccr_start
Definition: GenericCatchCrop.h:31
Calendar::Date
long Date(void)
Definition: Calendar.h:57
gccr_sow
Definition: GenericCatchCrop.h:33
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
tocc_Catch
Definition: LandscapeFarmingEnums.h:627
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
GenericCatchCrop
GenericCatchCrop class .
Definition: GenericCatchCrop.h:48
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
TTypesOfCrops
TTypesOfCrops
Definition: LandscapeFarmingEnums.h:781
LE
Definition: Elements.h:86
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
GCCR_ENDDATE
#define GCCR_ENDDATE
Definition: GenericCatchCrop.h:23
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
GenericCatchCrop::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: GenericCatchCrop.h:58
Farm
The base class for all farm types.
Definition: Farm.h:755
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
gccr_harvest
Definition: GenericCatchCrop.h:34
tov_GenericCatchCrop
Definition: LandscapeFarmingEnums.h:339
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
Crop::SetCropClassification
void SetCropClassification(int a_classification)
Definition: Farm.h:549
gccr_foobar
Definition: GenericCatchCrop.h:35
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
GenericCatchCropToDo
GenericCatchCropToDo
Definition: GenericCatchCrop.h:30
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
WARN_BUG
Definition: MapErrorMsg.h:34
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
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