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
NLGrassGrazedExtensive2.h
Go to the documentation of this file.
1 
16 //
17 // NLGrassGrazedExtensive2.h
18 //
19 
20 
21 #ifndef NLGRASSGRAZEDEXTENSIVE2_H
22 #define NLGRASSGRAZEDEXTENSIVE2_H
23 
24 #define NLGRASSGRAZEDEXTENSIVE2_BASE 21200
25 
28 #define NL_GGE2_FERTI_DATE a_field->m_user[1]
29 #define NL_GGE2_CUT_DATE a_field->m_user[2]
30 #define NL_GGE2_WATER_DATE a_field->m_user[3]
31 
32 
38 typedef enum {
39  nl_gge2_start = 1, // Compulsory, must always be 1 (one).
60 
61 
71 {
72  public:
73  virtual bool Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev );
74  NLGrassGrazedExtensive2(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape* a_L) : Crop(a_tov, a_toc, a_L)
75  {
76  // When we start it off, the first possible date for a farm operation is 5th November
77  // This information is used by other crops when they decide how much post processing of
78  // the management is allowed after harvest before the next crop starts.
79  m_first_date=g_date->DayInYear( 30,3 );
81  }
83  const int elements = 2 + (nl_gge2_foobar - NLGRASSGRAZEDEXTENSIVE2_BASE);
85 
86  FarmManagementCategory catlist[elements] =
87  {
88  fmc_Others, // zero element unused but must be here
89  fmc_Others,//nl_gge2_start = 1, // Compulsory, must always be 1 (one).
90  fmc_Others,//nl_gge2_sleep_all_day = NLGRASSGRAZEDEXTENSIVE2_BASE,
91  fmc_Fertilizer,//nl_gge2_ferti_p1,
92  fmc_Fertilizer,//nl_gge2_ferti_s1,
93  fmc_Cutting,//nl_gge2_cut_to_silage1,
94  fmc_Cutting,//nl_gge2_cut_to_silage2,
95  fmc_Fertilizer,//nl_gge2_ferti_p2,
96  fmc_Fertilizer,//nl_gge2_ferti_s2,
97  fmc_Fertilizer,//nl_gge2_ferti_p3,
98  fmc_Fertilizer,//nl_gge2_ferti_s3,
99  fmc_Fertilizer,//nl_gge2_ferti_p4,
100  fmc_Fertilizer,//nl_gge2_ferti_s4,
101  fmc_Fertilizer,//nl_gge2_ferti_p5,
102  fmc_Fertilizer,//nl_gge2_ferti_s5,
103  fmc_Fertilizer,//nl_gge2_ferti_p6,
104  fmc_Fertilizer,//nl_gge2_ferti_s6,
105  fmc_Fertilizer,//nl_gge2_watering,
106  fmc_Grazing,//nl_gge2_cattle_out,
107  fmc_Grazing//nl_gge2_cattle_is_out,
108 
109  // no foobar entry
110 
111  };
112  // Iterate over the catlist elements and copy them to vector
113  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
114 
115  }
116 };
117 
118 #endif // NLGRASSGRAZEDEXTENSIVE2_H
119 
NLGrassGrazedExtensive2
NLGrassGrazedExtensive2 class .
Definition: NLGrassGrazedExtensive2.h:70
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::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
FarmEvent
A struct to hold the information required to trigger a farm event.
Definition: Farm.h:372
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
nl_gge2_ferti_s2
Definition: NLGrassGrazedExtensive2.h:46
nl_gge2_cut_to_silage1
Definition: NLGrassGrazedExtensive2.h:43
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
nl_gge2_ferti_s1
Definition: NLGrassGrazedExtensive2.h:42
NL_GGE2_WATER_DATE
#define NL_GGE2_WATER_DATE
Definition: NLGrassGrazedExtensive2.h:30
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
NLGrassGrazedExtensive2::NLGrassGrazedExtensive2
NLGrassGrazedExtensive2(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: NLGrassGrazedExtensive2.h:74
nl_gge2_ferti_p6
Definition: NLGrassGrazedExtensive2.h:53
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
NL_GGE2_CUT_DATE
#define NL_GGE2_CUT_DATE
Definition: NLGrassGrazedExtensive2.h:29
nl_gge2_ferti_p4
Definition: NLGrassGrazedExtensive2.h:49
nl_gge2_ferti_p3
Definition: NLGrassGrazedExtensive2.h:47
nl_gge2_cut_to_silage2
Definition: NLGrassGrazedExtensive2.h:44
Crop
The base class for all crops.
Definition: Farm.h:495
nl_gge2_foobar
Definition: NLGrassGrazedExtensive2.h:58
NLGrassGrazedExtensive2::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: NLGrassGrazedExtensive2.h:82
fmc_Cutting
Definition: LandscapeFarmingEnums.h:1009
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
nl_gge2_watering
Definition: NLGrassGrazedExtensive2.h:55
nl_gge2_ferti_p2
Definition: NLGrassGrazedExtensive2.h:45
NL_GGE2_FERTI_DATE
#define NL_GGE2_FERTI_DATE
A flag used to indicate autumn ploughing status.
Definition: NLGrassGrazedExtensive2.h:28
nl_gge2_cattle_is_out
Definition: NLGrassGrazedExtensive2.h:57
nl_gge2_ferti_s3
Definition: NLGrassGrazedExtensive2.h:48
Calendar::Date
long Date(void)
Definition: Calendar.h:57
NLGrassGrazedExtensive2ToDo
NLGrassGrazedExtensive2ToDo
Definition: NLGrassGrazedExtensive2.h:38
nl_gge2_ferti_p1
Definition: NLGrassGrazedExtensive2.h:41
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
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
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
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
tov_NLGrassGrazedExtensive2
Definition: LandscapeFarmingEnums.h:274
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
NLGRASSGRAZEDEXTENSIVE2_BASE
#define NLGRASSGRAZEDEXTENSIVE2_BASE
Definition: NLGrassGrazedExtensive2.h:24
nl_gge2_cattle_out
Definition: NLGrassGrazedExtensive2.h:56
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
TTypesOfCrops
TTypesOfCrops
Definition: LandscapeFarmingEnums.h:781
nl_gge2_ferti_s6
Definition: NLGrassGrazedExtensive2.h:54
LE
Definition: Elements.h:86
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
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
fmc_Grazing
Definition: LandscapeFarmingEnums.h:1010
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
Farm
The base class for all farm types.
Definition: Farm.h:755
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
nl_gge2_sleep_all_day
Definition: NLGrassGrazedExtensive2.h:40
NLGrassGrazedExtensive2::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: NLGrassGrazedExtensive2.cpp:54
nl_gge2_ferti_s4
Definition: NLGrassGrazedExtensive2.h:50
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
WARN_BUG
Definition: MapErrorMsg.h:34
nl_gge2_start
Definition: NLGrassGrazedExtensive2.h:39
nl_gge2_ferti_p5
Definition: NLGrassGrazedExtensive2.h:51
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
nl_gge2_ferti_s5
Definition: NLGrassGrazedExtensive2.h:52
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