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
NLGrassGrazedExtensive1.h
Go to the documentation of this file.
1 
16 //
17 // NLGrassGrazedExtensive1.h
18 //
19 
20 
21 #ifndef NLGRASSGRAZEDEXTENSIVE1_H
22 #define NLGRASSGRAZEDEXTENSIVE1_H
23 
24 #define NLGRASSGRAZEDEXTENSIVE1_BASE 20000
25 
28 #define NL_GGE1_CUT_DATE a_field->m_user[1]
29 #define NL_GGE1_WATER_DATE a_field->m_user[2]
30 
31 
37 typedef enum {
38  nl_gge1_start = 1, // Compulsory, must always be 1 (one).
65 
66 
76 {
77  public:
78  virtual bool Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev );
79  NLGrassGrazedExtensive1(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape* a_L) : Crop(a_tov, a_toc, a_L)
80  {
81  // When we start it off, the first possible date for a farm operation is 5th November
82  // This information is used by other crops when they decide how much post processing of
83  // the management is allowed after harvest before the next crop starts.
84  m_first_date=g_date->DayInYear( 30,11 );
85  m_forcespringpossible = true;
87  }
89  const int elements = 2 + (nl_gge1_foobar - NLGRASSGRAZEDEXTENSIVE1_BASE);
91 
92  FarmManagementCategory catlist[elements] =
93  {
94  fmc_Others, // zero element unused but must be here
95  fmc_Others,//nl_gge1_start = 1, // Compulsory, must always be 1 (one).
96  fmc_Others,//nl_gge1_sleep_all_day = NLGRASSGRAZEDEXTENSIVE1_BASE,
97  fmc_Cultivation,//nl_gge1_winter_plough,
98  fmc_Herbicide,//nl_gge1_herbicide,
99  fmc_Fertilizer,//nl_gge1_ferti_p1,
100  fmc_Fertilizer,//nl_gge1_ferti_s1,
101  fmc_Cultivation,//nl_gge1_preseeding_cultivator,
102  fmc_Others,//nl_gge1_spring_sow,
103  fmc_Fertilizer,//nl_gge1_ferti_p2,
104  fmc_Fertilizer,//nl_gge1_ferti_s2,
105  fmc_Cutting,//nl_gge1_cut_to_silage1,
106  fmc_Cutting,//nl_gge1_cut_to_silage2,
107  fmc_Fertilizer,//nl_gge1_ferti_p3,
108  fmc_Fertilizer,//nl_gge1_ferti_s3,
109  fmc_Fertilizer,//nl_gge1_ferti_p4,
110  fmc_Fertilizer,//nl_gge1_ferti_s4,
111  fmc_Fertilizer,//nl_gge1_ferti_p5,
112  fmc_Fertilizer,//nl_gge1_ferti_s5,
113  fmc_Fertilizer,//nl_gge1_ferti_p6,
114  fmc_Fertilizer,//nl_gge1_ferti_s6,
115  fmc_Fertilizer,//nl_gge1_ferti_p7,
116  fmc_Fertilizer,//nl_gge1_ferti_s7,
117  fmc_Watering,//nl_gge1_watering,
118  fmc_Grazing,//nl_gge1_cattle_out,
119  fmc_Grazing//nl_gge1_cattle_is_out,
120 
121  // no foobar entry
122 
123  };
124  // Iterate over the catlist elements and copy them to vector
125  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
126 
127  }
128 };
129 
130 #endif // NLGRASSGRAZEDEXTENSIVE1_H
131 
nl_gge1_start
Definition: NLGrassGrazedExtensive1.h:38
FarmEvent::m_forcespring
bool m_forcespring
Definition: Farm.h:392
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
NL_GGE1_CUT_DATE
#define NL_GGE1_CUT_DATE
A flag used to indicate autumn ploughing status.
Definition: NLGrassGrazedExtensive1.h:28
Farm::PreseedingCultivator
virtual bool PreseedingCultivator(LE *a_field, double a_user, int a_days)
Carry out preseeding cultivation on a_field (tilling set including cultivator and string roller to co...
Definition: FarmFuncs.cpp:312
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
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
nl_gge1_watering
Definition: NLGrassGrazedExtensive1.h:60
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_gge1_herbicide
Definition: NLGrassGrazedExtensive1.h:41
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
nl_gge1_foobar
Definition: NLGrassGrazedExtensive1.h:63
NLGrassGrazedExtensive1
NLGrassGrazedExtensive1 class .
Definition: NLGrassGrazedExtensive1.h:75
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
nl_gge1_ferti_p1
Definition: NLGrassGrazedExtensive1.h:42
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
nl_gge1_ferti_p3
Definition: NLGrassGrazedExtensive1.h:50
NLGrassGrazedExtensive1::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: NLGrassGrazedExtensive1.cpp:54
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_gge1_ferti_s4
Definition: NLGrassGrazedExtensive1.h:53
Crop
The base class for all crops.
Definition: Farm.h:495
nl_gge1_cattle_out
Definition: NLGrassGrazedExtensive1.h:61
fmc_Cutting
Definition: LandscapeFarmingEnums.h:1009
nl_gge1_cut_to_silage1
Definition: NLGrassGrazedExtensive1.h:48
nl_gge1_ferti_s7
Definition: NLGrassGrazedExtensive1.h:59
nl_gge1_ferti_p6
Definition: NLGrassGrazedExtensive1.h:56
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
NLGrassGrazedExtensive1::NLGrassGrazedExtensive1
NLGrassGrazedExtensive1(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: NLGrassGrazedExtensive1.h:79
Calendar::Date
long Date(void)
Definition: Calendar.h:57
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
nl_gge1_ferti_p2
Definition: NLGrassGrazedExtensive1.h:46
nl_gge1_ferti_s1
Definition: NLGrassGrazedExtensive1.h:43
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
tov_NLGrassGrazedExtensive1
Definition: LandscapeFarmingEnums.h:273
fmc_Watering
Definition: LandscapeFarmingEnums.h:1011
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
nl_gge1_ferti_s6
Definition: NLGrassGrazedExtensive1.h:57
nl_gge1_ferti_p4
Definition: NLGrassGrazedExtensive1.h:52
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
nl_gge1_spring_sow
Definition: NLGrassGrazedExtensive1.h:45
nl_gge1_cut_to_silage2
Definition: NLGrassGrazedExtensive1.h:49
nl_gge1_sleep_all_day
Definition: NLGrassGrazedExtensive1.h:39
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
nl_gge1_preseeding_cultivator
Definition: NLGrassGrazedExtensive1.h:44
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
nl_gge1_ferti_s3
Definition: NLGrassGrazedExtensive1.h:51
NL_GGE1_WATER_DATE
#define NL_GGE1_WATER_DATE
Definition: NLGrassGrazedExtensive1.h:29
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
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
nl_gge1_cattle_is_out
Definition: NLGrassGrazedExtensive1.h:62
NLGRASSGRAZEDEXTENSIVE1_BASE
#define NLGRASSGRAZEDEXTENSIVE1_BASE
Definition: NLGrassGrazedExtensive1.h:24
nl_gge1_ferti_s2
Definition: NLGrassGrazedExtensive1.h:47
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
nl_gge1_ferti_s5
Definition: NLGrassGrazedExtensive1.h:55
Farm::WinterPlough
virtual bool WinterPlough(LE *a_field, double a_user, int a_days)
Carry out a ploughing event in the winter on a_field.
Definition: FarmFuncs.cpp:395
nl_gge1_ferti_p5
Definition: NLGrassGrazedExtensive1.h:54
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
nl_gge1_ferti_p7
Definition: NLGrassGrazedExtensive1.h:58
NLGrassGrazedExtensive1ToDo
NLGrassGrazedExtensive1ToDo
Definition: NLGrassGrazedExtensive1.h:37
Crop::m_forcespringpossible
bool m_forcespringpossible
Used to signal that the crop can be forced to start in spring.
Definition: Farm.h:508
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
nl_gge1_winter_plough
Definition: NLGrassGrazedExtensive1.h:40
NLGrassGrazedExtensive1::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: NLGrassGrazedExtensive1.h:88
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