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
NLPermanentGrassGrazedExtensive.h
Go to the documentation of this file.
1 
16 //
17 // NLPermanentGrassGrazedExtensive.h
18 //
19 
20 
21 #ifndef NLPERMANENTGRASSLANDGRAZEDEXTENSIVE_H
22 #define NLPERMANENTGRASSLANDGRAZEDEXTENSIVE_H
23 
24 #define NLPERMANENTGRASSLANDGRAZEDEXTENSIVE_BASE 21900
25 
28 #define NL_PGGE_FERTI_DATE a_field->m_user[1]
29 #define NL_PGGE_CUT_DATE a_field->m_user[2]
30 #define NL_PGGE_WATER_DATE a_field->m_user[3]
31 
32 
38 typedef enum {
39  nl_pgge_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 );
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_pgge_foobar - NLPERMANENTGRASSLANDGRAZEDEXTENSIVE_BASE);
85 
86  FarmManagementCategory catlist[elements] =
87  {
88  fmc_Others, // zero element unused but must be here
89  fmc_Others, // nl_pgge_start = 1, // Compulsory, must always be 1 (one).
90  fmc_Others, // nl_pgge_sleep_all_day = NLPERMANENTGRASSLANDGRAZEDEXTENSIVE_BASE,
91  fmc_Fertilizer, // nl_pgge_ferti_p1,
92  fmc_Fertilizer, // nl_pgge_ferti_s1,
93  fmc_Cutting, // nl_pgge_cut_to_silage1,
94  fmc_Cutting, // nl_pgge_cut_to_silage2,
95  fmc_Fertilizer, // nl_pgge_ferti_p2,
96  fmc_Fertilizer, // nl_pgge_ferti_s2,
97  fmc_Fertilizer, // nl_pgge_ferti_p3,
98  fmc_Fertilizer, // nl_pgge_ferti_s3,
99  fmc_Fertilizer, // nl_pgge_ferti_p4,
100  fmc_Fertilizer, // nl_pgge_ferti_s4,
101  fmc_Fertilizer, // nl_pgge_ferti_p5,
102  fmc_Fertilizer, // nl_pgge_ferti_s5,
103  fmc_Fertilizer, // nl_pgge_ferti_p6,
104  fmc_Fertilizer, // nl_pgge_ferti_s6,
105  fmc_Watering, // nl_pgge_watering,
106  fmc_Grazing, // nl_pgge_cattle_out,
107  fmc_Grazing // nl_pgge_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 // NLPERMANENTGRASSLANDGRAZEDEXTENSIVE_H
119 
nl_pgge_ferti_p3
Definition: NLPermanentGrassGrazedExtensive.h:47
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
tov_NLPermanentGrassGrazedExtensive
Definition: LandscapeFarmingEnums.h:272
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
nl_pgge_sleep_all_day
Definition: NLPermanentGrassGrazedExtensive.h:40
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_PGGE_CUT_DATE
#define NL_PGGE_CUT_DATE
Definition: NLPermanentGrassGrazedExtensive.h:29
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
NLPermanentGrassGrazedExtensive::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: NLPermanentGrassGrazedExtensive.h:82
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
nl_pgge_ferti_s3
Definition: NLPermanentGrassGrazedExtensive.h:48
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_pgge_ferti_s5
Definition: NLPermanentGrassGrazedExtensive.h:52
Crop
The base class for all crops.
Definition: Farm.h:495
fmc_Cutting
Definition: LandscapeFarmingEnums.h:1009
nl_pgge_ferti_p4
Definition: NLPermanentGrassGrazedExtensive.h:49
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
nl_pgge_cattle_out
Definition: NLPermanentGrassGrazedExtensive.h:56
nl_pgge_ferti_s2
Definition: NLPermanentGrassGrazedExtensive.h:46
Calendar::Date
long Date(void)
Definition: Calendar.h:57
NLPermanentGrassGrazedExtensive::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: NLPermanentGrassGrazedExtensive.cpp:54
nl_pgge_foobar
Definition: NLPermanentGrassGrazedExtensive.h:58
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
fmc_Watering
Definition: LandscapeFarmingEnums.h:1011
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
nl_pgge_ferti_p5
Definition: NLPermanentGrassGrazedExtensive.h:51
nl_pgge_ferti_p1
Definition: NLPermanentGrassGrazedExtensive.h:41
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
NLPermanentGrassGrazedExtensive
NLPermanentGrassGrazedExtensive class .
Definition: NLPermanentGrassGrazedExtensive.h:70
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
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
nl_pgge_cattle_is_out
Definition: NLPermanentGrassGrazedExtensive.h:57
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_pgge_start
Definition: NLPermanentGrassGrazedExtensive.h:39
NLPermanentGrassGrazedExtensiveToDo
NLPermanentGrassGrazedExtensiveToDo
Definition: NLPermanentGrassGrazedExtensive.h:38
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
NLPERMANENTGRASSLANDGRAZEDEXTENSIVE_BASE
#define NLPERMANENTGRASSLANDGRAZEDEXTENSIVE_BASE
Definition: NLPermanentGrassGrazedExtensive.h:24
fmc_Grazing
Definition: LandscapeFarmingEnums.h:1010
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
nl_pgge_ferti_s6
Definition: NLPermanentGrassGrazedExtensive.h:54
nl_pgge_ferti_s4
Definition: NLPermanentGrassGrazedExtensive.h:50
Farm
The base class for all farm types.
Definition: Farm.h:755
NL_PGGE_FERTI_DATE
#define NL_PGGE_FERTI_DATE
A flag used to indicate autumn ploughing status.
Definition: NLPermanentGrassGrazedExtensive.h:28
nl_pgge_ferti_p2
Definition: NLPermanentGrassGrazedExtensive.h:45
nl_pgge_ferti_s1
Definition: NLPermanentGrassGrazedExtensive.h:42
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
nl_pgge_cut_to_silage1
Definition: NLPermanentGrassGrazedExtensive.h:43
nl_pgge_ferti_p6
Definition: NLPermanentGrassGrazedExtensive.h:53
nl_pgge_watering
Definition: NLPermanentGrassGrazedExtensive.h:55
nl_pgge_cut_to_silage2
Definition: NLPermanentGrassGrazedExtensive.h:44
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
NLPermanentGrassGrazedExtensive::NLPermanentGrassGrazedExtensive
NLPermanentGrassGrazedExtensive(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: NLPermanentGrassGrazedExtensive.h:74
WARN_BUG
Definition: MapErrorMsg.h:34
NL_PGGE_WATER_DATE
#define NL_PGGE_WATER_DATE
Definition: NLPermanentGrassGrazedExtensive.h:30
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