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
DK_GrassGrazed_Perm.h
Go to the documentation of this file.
1 
15 //
16 // DK_GrassGrazed_Perm.h
17 //
18 
19 
20 #ifndef DK_GRASSGRAZED_P_H
21 #define DK_GRASSGRAZED_P_H
22 
23 #define DK_GGP_MANURE_S a_field->m_user[0]
24 #define DK_GGP_MANURE_P a_field->m_user[1]
25 #define DK_GGP_GRASS_READY m_field->m_user[2]
26 
27 #define DK_GGP_BASE 64700
28 
37 typedef enum {
38  dk_ggp_start = 1, // Compulsory, must always be 1 (one).
68 
69 
78 class DK_GrassGrazed_Perm : public Crop{
79  public:
80  virtual bool Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev );
81  DK_GrassGrazed_Perm(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape* a_L) : Crop(a_tov, a_toc, a_L)
82  {
83  // When we start it off, the first possible date for a farm operation is ...
84  // This information is used by other crops when they decide how much post processing of
85  // the management is allowed after harvest before the next crop starts.
88  }
90  const int elements = 2 + (dk_ggp_foobar - DK_GGP_BASE);
92 
93  FarmManagementCategory catlist[elements] =
94  {
95  fmc_Others, // zero element unused but must be here
96  fmc_Others, // dk_ggp_start = 1, // Compulsory, must always be 1 (one).
97  fmc_Others, // dk_ggp_sleep_all_day = DK_GGP_BASE,
98  fmc_Fertilizer, //dk_ggp_manure_s1,
99  fmc_Fertilizer, //dk_ggp_manure_p1,
100  fmc_Fertilizer, //dk_ggp_manure_s2,
101  fmc_Fertilizer, //dk_ggp_manure_p2,
102  fmc_Cutting, //dk_ggp_cutting1,
103  fmc_Cutting, //dk_ggp_cutting2,
104  fmc_Cutting, //dk_ggp_cutting3,
105  fmc_Cutting, //dk_ggp_cutting4,
106  fmc_Cutting, //dk_ggp_cutting5,
107  fmc_Cutting, //dk_ggp_cutting6,
108  fmc_Cutting, //dk_ggp_cutting_graze,
109  fmc_Cutting, //dk_ggp_straw_chopping1,
110  fmc_Cutting, //dk_ggp_straw_chopping2,
111  fmc_Cutting, //dk_ggp_straw_chopping3,
112  fmc_Cutting, //dk_ggp_straw_chopping4,
113  fmc_Cutting, //dk_ggp_straw_chopping5,
114  fmc_Cutting, //dk_ggp_straw_chopping6,
115  fmc_Cutting, //dk_ggp_straw_chopping_graze,
116  fmc_Grazing, //dk_ggp_grazing1,
117  fmc_Grazing, //dk_ggp_grazing2,
118  fmc_Grazing, //dk_ggp_cattle_out1,
119  fmc_Grazing, //dk_ggp_cattle_out2,
120  fmc_Watering, // dk_ggp_water1,
121  fmc_Watering, // dk_ggp_water2,
122  fmc_Herbicide, // dk_ggp_herbicide,
123  fmc_Others, //dk_ggp_wait
124  // no foobar entry
125 
126  };
127  // Iterate over the catlist elements and copy them to vector
128  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
129 
130  }
131 };
132 
133 #endif // DK_GrassGrazed_Perm_H
134 
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
dk_ggp_cattle_out1
Definition: DK_GrassGrazed_Perm.h:60
DK_GrassGrazed_Perm::DK_GrassGrazed_Perm
DK_GrassGrazed_Perm(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: DK_GrassGrazed_Perm.h:81
dk_ggp_manure_p1
Definition: DK_GrassGrazed_Perm.h:41
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
cfg_farm_cattle_grass_low
CfgInt cfg_farm_cattle_grass_low
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
dk_ggp_cutting3
Definition: DK_GrassGrazed_Perm.h:46
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
dk_ggp_cutting_graze
Definition: DK_GrassGrazed_Perm.h:50
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
dk_ggp_manure_p2
Definition: DK_GrassGrazed_Perm.h:43
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
cfg_pest_product_amounts
CfgArray_Double cfg_pest_product_amounts
Amount of pesticide applied in grams of active substance per hectare for each of the 10 pesticides.
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
cfg_pest_grassgrazed_on
CfgBool cfg_pest_grassgrazed_on
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
Farm::CutToHay
virtual bool CutToHay(LE *a_field, double a_user, int a_days)
Carry out hay cutting on a_field.
Definition: FarmFuncs.cpp:1607
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
dk_ggp_water2
Definition: DK_GrassGrazed_Perm.h:63
dk_ggp_cutting4
Definition: DK_GrassGrazed_Perm.h:47
l_pest_insecticide_amount
CfgFloat l_pest_insecticide_amount
Crop
The base class for all crops.
Definition: Farm.h:495
DK_GrassGrazed_PermToDo
DK_GrassGrazed_PermToDo
Definition: DK_GrassGrazed_Perm.h:37
Crop::SimpleEvent
void SimpleEvent(long a_date, int a_todo, bool a_lock)
Adds an event to this crop management.
Definition: Farm.cpp:747
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
dk_ggp_manure_s1
Definition: DK_GrassGrazed_Perm.h:40
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
dk_ggp_manure_s2
Definition: DK_GrassGrazed_Perm.h:42
dk_ggp_straw_chopping3
Definition: DK_GrassGrazed_Perm.h:53
cfg_farm_cattle_grass_high
CfgInt cfg_farm_cattle_grass_high
dk_ggp_straw_chopping5
Definition: DK_GrassGrazed_Perm.h:55
cfg_GGP_InsecticideMonth
CfgInt cfg_GGP_InsecticideMonth
DK_GrassGrazed_Perm::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: DK_GrassGrazed_Perm.h:89
Calendar::Date
long Date(void)
Definition: Calendar.h:57
DK_GGP_MANURE_P
#define DK_GGP_MANURE_P
Definition: DK_GrassGrazed_Perm.h:24
CfgBool
Bool configurator entry class.
Definition: Configurator.h:155
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
dk_ggp_straw_chopping_graze
Definition: DK_GrassGrazed_Perm.h:57
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
dk_ggp_foobar
Definition: DK_GrassGrazed_Perm.h:66
dk_ggp_wait
Definition: DK_GrassGrazed_Perm.h:65
LE::GetVegHeight
virtual double GetVegHeight(void)
Definition: Elements.h:148
fmc_Watering
Definition: LandscapeFarmingEnums.h:1011
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
dk_ggp_straw_chopping4
Definition: DK_GrassGrazed_Perm.h:54
DK_GGP_GRASS_READY
#define DK_GGP_GRASS_READY
Definition: DK_GrassGrazed_Perm.h:25
dk_ggp_cutting6
Definition: DK_GrassGrazed_Perm.h:49
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
CfgArray_Double
Definition: Configurator.h:208
tov_DKGrassGrazed_Perm
Definition: LandscapeFarmingEnums.h:460
dk_ggp_grazing1
Definition: DK_GrassGrazed_Perm.h:58
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
cfg_GGP_InsecticideDay
CfgInt cfg_GGP_InsecticideDay
dk_ggp_cutting5
Definition: DK_GrassGrazed_Perm.h:48
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
CfgInt::value
int value() const
Definition: Configurator.h:116
dk_ggp_cutting1
Definition: DK_GrassGrazed_Perm.h:44
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
dk_ggp_herbicide
Definition: DK_GrassGrazed_Perm.h:64
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
dk_ggp_straw_chopping1
Definition: DK_GrassGrazed_Perm.h:51
DK_GrassGrazed_Perm::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: DK_GrassGrazed_Perm.cpp:65
Farm::SleepAllDay
virtual bool SleepAllDay(LE *a_field, double a_user, int a_days)
Nothing to to today on a_field.
Definition: FarmFuncs.cpp:272
TTypesOfCrops
TTypesOfCrops
Definition: LandscapeFarmingEnums.h:781
dk_ggp_cutting2
Definition: DK_GrassGrazed_Perm.h:45
DK_GGP_BASE
#define DK_GGP_BASE
Definition: DK_GrassGrazed_Perm.h:27
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
dk_ggp_start
Definition: DK_GrassGrazed_Perm.h:38
fmc_Grazing
Definition: LandscapeFarmingEnums.h:1010
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
CfgInt
Integer configurator entry class.
Definition: Configurator.h:102
DK_GrassGrazed_Perm
DK_GrassGrazed_Perm class .
Definition: DK_GrassGrazed_Perm.h:78
Farm
The base class for all farm types.
Definition: Farm.h:755
CfgFloat
Double configurator entry class.
Definition: Configurator.h:126
dk_ggp_grazing2
Definition: DK_GrassGrazed_Perm.h:59
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
dk_ggp_cattle_out2
Definition: DK_GrassGrazed_Perm.h:61
dk_ggp_straw_chopping2
Definition: DK_GrassGrazed_Perm.h:52
dk_ggp_sleep_all_day
Definition: DK_GrassGrazed_Perm.h:39
dk_ggp_water1
Definition: DK_GrassGrazed_Perm.h:62
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
dk_ggp_straw_chopping6
Definition: DK_GrassGrazed_Perm.h:56
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
DK_GGP_MANURE_S
#define DK_GGP_MANURE_S
Definition: DK_GrassGrazed_Perm.h:23