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
DK_OrchPear.h
Go to the documentation of this file.
1 
15 //
16 // DK_OrchPear.h
17 //
18 
19 
20 #ifndef DK_ORCHPEAR_H
21 #define DK_ORCHPEAR_H
22 
23 #define DK_OPE_YEARS_AFTER_PLANT a_field->m_user[1]
24 
25 #define DK_OPE_BASE 68100
26 
35 typedef enum {
36  dk_ope_start = 1, // Compulsory, must always be 1 (one).
114 
117 
118 
127 class DK_OrchPear : public Crop{
128  public:
129  virtual bool Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev );
130  DK_OrchPear(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape* a_L) : Crop(a_tov, a_toc, a_L)
131  {
132  // When we start it off, the first possible date for a farm operation is ...
133  // This information is used by other crops when they decide how much post processing of
134  // the management is allowed after harvest before the next crop starts.
135  m_first_date=g_date->DayInYear( 30,4 );
137  }
139  const int elements = 2 + (dk_ope_foobar - DK_OPE_BASE);
141 
142  FarmManagementCategory catlist[elements] =
143  {
144  fmc_Others, // zero element unused but must be here
145  fmc_Others, // dk_ope_start = 1, // Compulsory, must always be 1 (one).
146  fmc_Others, // dk_ope_sleep_all_day = DK_OPE_BASE,
147  fmc_Cultivation, //dk_ope_spring_plough,
148  fmc_Fertilizer, //dk_ope_manure_s1,
149  fmc_Fertilizer, //dk_ope_manure_p1,
150  fmc_Watering, //dk_ope_water1,
151  fmc_Cultivation, //dk_ope_subsoiler,
152  fmc_Others, //dk_ope_planting,
153  fmc_Others, //dk_ope_sow_grass,
154  fmc_Insecticide, //dk_ope_insecticide1,
155  fmc_Insecticide, //dk_ope_insecticide2,
156  fmc_Insecticide, //dk_ope_insecticide3,
157  fmc_Insecticide, //dk_ope_insecticide4,
158  fmc_Insecticide, //dk_ope_insecticide5,
159  fmc_Insecticide, //dk_ope_insecticide6,
160  fmc_Insecticide, //dk_ope_insecticide7,
161  fmc_Insecticide, //dk_ope_insecticide8,
162  fmc_Insecticide, //dk_ope_insecticide9,
163  fmc_Insecticide, //dk_ope_insecticide10,
164  fmc_Herbicide, //dk_ope_herbicide1
165  fmc_Herbicide, //dk_ope_herbicide2
166  fmc_Cutting, //dk_ope_manual_cutting1,
167  fmc_Cutting, //dk_ope_manual_cutting2,
168  fmc_Cutting, //dk_ope_manual_cutting3,
169  fmc_Cutting, //dk_ope_manual_cutting4,
170  fmc_Cutting, //dk_ope_manual_cutting5,
171  fmc_Cutting, //dk_ope_manual_cutting6,
172  fmc_Cutting, //dk_ope_manual_cutting7,
173  fmc_Cutting, //dk_ope_manual_cutting8,
174  fmc_Cutting, //dk_ope_manual_cutting9,
175  fmc_Cutting, //dk_ope_manual_cutting10,
176  fmc_Cutting, //dk_ope_manual_cutting11,
177  fmc_Cutting, //dk_ope_manual_cutting12,
178  fmc_Cutting, //dk_ope_manure_s2,
179  fmc_Cutting, //dk_ope_manure_p2,
180  fmc_Cultivation, //dk_ope_row_cultivation1,
181  fmc_Watering, //dk_ope_water2,
182  fmc_Watering, //dk_ope_water3,
183  fmc_Watering, //dk_ope_water4,
184  fmc_Watering, //dk_ope_water5,
185  fmc_Watering, //dk_ope_water6,
186  fmc_Watering, //dk_ope_water7,
187  fmc_Cutting, //dk_ope_cutting1,
188  fmc_Cutting, //dk_ope_cutting2,
189  fmc_Cutting, //dk_ope_cutting3,
190  fmc_Cutting, //dk_ope_cutting4,
191  fmc_Cutting, //dk_ope_cutting5,
192  fmc_Cutting, //dk_ope_cutting6,
193  fmc_Cultivation, //dk_ope_row_cultivation2,
194  fmc_Fungicide, //dk_ope_fungicide1,
195  fmc_Fertilizer, //dk_ope_boron_s,
196  fmc_Fertilizer, //dk_ope_boron_p,
197  fmc_Fungicide, //dk_ope_fungicide2,
198  fmc_Herbicide, //dk_ope_herbicide3
199  fmc_Herbicide, //dk_ope_herbicide4
200  fmc_Herbicide, //dk_ope_herbicide5
201  fmc_Herbicide, //dk_ope_herbicide6
202  fmc_Herbicide, //dk_ope_herbicide7
203  fmc_Herbicide, //dk_ope_herbicide8
204  fmc_Herbicide, //dk_ope_herbicide9
205  fmc_Cutting, //dk_ope_remove_fruits,
206  fmc_Fungicide, //dk_ope_fungicide3,
207  fmc_Harvest, //dk_ope_harvest,
208  fmc_Fungicide, //dk_ope_fungicide4,
209  fmc_Fungicide, //dk_ope_fungicide5,
210  fmc_Fungicide, //dk_ope_fungicide6,
211  fmc_Fungicide, //dk_ope_fungicide7,
212  fmc_Fungicide, //dk_ope_fungicide8,
213  fmc_Fungicide, //dk_ope_fungicide9,
214  fmc_Fungicide, //dk_ope_fungicide10,
215  fmc_Fungicide, //dk_ope_fungicide11,
216  fmc_Fungicide, //dk_ope_fungicide12,
217  fmc_Fungicide, //dk_ope_fungicide13,
218  fmc_Fungicide, //dk_ope_fungicide14
219  fmc_Others, // dk_ope_gr1
220  fmc_Others, // dk_ope_gr2
221  fmc_Others, // dk_ope_gr3
222  fmc_Others, // dk_ope_gr4
223  // no foobar entry
224 
225  };
226  // Iterate over the catlist elements and copy them to vector
227  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
228 
229  }
230 };
231 
232 #endif // DK_OrchPear_H
233 
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
dk_ope_water3
Definition: DK_OrchPear.h:73
FarmEvent::m_forcespring
bool m_forcespring
Definition: Farm.h:392
dk_ope_insecticide6
Definition: DK_OrchPear.h:50
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
dk_ope_row_cultivation2
Definition: DK_OrchPear.h:84
Farm::SpringPlough
virtual bool SpringPlough(LE *a_field, double a_user, int a_days)
Carry out a ploughing event in the spring on a_field.
Definition: FarmFuncs.cpp:421
dk_ope_cutting4
Definition: DK_OrchPear.h:81
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
dk_ope_manual_cutting4
Definition: DK_OrchPear.h:60
dk_ope_spring_plough
Definition: DK_OrchPear.h:38
dk_ope_fungicide5
Definition: DK_OrchPear.h:100
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
Farm::ProductApplication
virtual bool ProductApplication(LE *a_field, double a_user, int a_days, double a_applicationrate, PlantProtectionProducts a_ppp, bool a_isgranularpesticide=false, int a_orcharddrifttype=0)
Apply test pesticide to a_field.
Definition: FarmFuncs.cpp:2267
FarmEvent
A struct to hold the information required to trigger a farm event.
Definition: Farm.h:372
cfg_pest_orchard_on
CfgBool cfg_pest_orchard_on
Turn on pesticides for orchard.
LE::ClearManagementActionSum
void ClearManagementActionSum()
clears the management action counters
Definition: Elements.h:247
dk_ope_insecticide8
Definition: DK_OrchPear.h:52
Calendar::GetYearNumber
int GetYearNumber(void)
Definition: Calendar.h:72
dk_ope_herbicide5
Definition: DK_OrchPear.h:91
dk_ope_planting
Definition: DK_OrchPear.h:43
DK_OrchPear
DK_OrchPear class .
Definition: DK_OrchPear.h:127
dk_ope_water4
Definition: DK_OrchPear.h:74
dk_ope_foobar
Definition: DK_OrchPear.h:115
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_ope_sleep_all_day
Definition: DK_OrchPear.h:37
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
dk_ope_water6
Definition: DK_OrchPear.h:76
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_ope_InsecticideDay
CfgInt cfg_ope_InsecticideDay
dk_ope_manual_cutting1
Definition: DK_OrchPear.h:57
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
dk_ope_insecticide3
Definition: DK_OrchPear.h:47
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
tov_DKOrchPear
Definition: LandscapeFarmingEnums.h:463
dk_ope_manual_cutting2
Definition: DK_OrchPear.h:58
dk_ope_manual_cutting11
Definition: DK_OrchPear.h:67
cfg_ope_InsecticideMonth
CfgInt cfg_ope_InsecticideMonth
DK_OPE_BASE
#define DK_OPE_BASE
Definition: DK_OrchPear.h:25
dk_ope_fungicide12
Definition: DK_OrchPear.h:107
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
dk_ope_manual_cutting12
Definition: DK_OrchPear.h:68
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
dk_ope_herbicide2
Definition: DK_OrchPear.h:56
dk_ope_fungicide2
Definition: DK_OrchPear.h:88
dk_ope_manual_cutting7
Definition: DK_OrchPear.h:63
dk_ope_herbicide7
Definition: DK_OrchPear.h:93
dk_ope_insecticide10
Definition: DK_OrchPear.h:54
Crop
The base class for all crops.
Definition: Farm.h:495
dk_ope_row_cultivation1
Definition: DK_OrchPear.h:71
Crop::SimpleEvent
void SimpleEvent(long a_date, int a_todo, bool a_lock)
Adds an event to this crop management.
Definition: Farm.cpp:747
DK_OPE_YEARS_AFTER_PLANT
#define DK_OPE_YEARS_AFTER_PLANT
Definition: DK_OrchPear.h:23
CfgBool::value
bool value() const
Definition: Configurator.h:164
dk_ope_insecticide4
Definition: DK_OrchPear.h:48
dk_ope_remove_fruits
Definition: DK_OrchPear.h:96
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
dk_ope_fungicide10
Definition: DK_OrchPear.h:105
fmc_Cutting
Definition: LandscapeFarmingEnums.h:1009
dk_ope_manual_cutting3
Definition: DK_OrchPear.h:59
dk_ope_herbicide9
Definition: DK_OrchPear.h:95
dk_ope_fungicide13
Definition: DK_OrchPear.h:108
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
dk_ope_insecticide2
Definition: DK_OrchPear.h:46
dk_ope_water7
Definition: DK_OrchPear.h:77
dk_ope_gr2
Definition: DK_OrchPear.h:111
dk_ope_sow_grass
Definition: DK_OrchPear.h:44
dk_ope_fungicide1
Definition: DK_OrchPear.h:85
dk_ope_boron_s
Definition: DK_OrchPear.h:86
Calendar::Date
long Date(void)
Definition: Calendar.h:57
dk_ope_fungicide14
Definition: DK_OrchPear.h:109
dk_ope_manual_cutting10
Definition: DK_OrchPear.h:66
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
dk_ope_herbicide3
Definition: DK_OrchPear.h:89
CfgBool
Bool configurator entry class.
Definition: Configurator.h:155
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
fmc_Watering
Definition: LandscapeFarmingEnums.h:1011
dk_ope_subsoiler
Definition: DK_OrchPear.h:42
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
dk_ope_fungicide9
Definition: DK_OrchPear.h:104
dk_ope_manure_p2
Definition: DK_OrchPear.h:70
dk_ope_water5
Definition: DK_OrchPear.h:75
dk_ope_manure_s1
Definition: DK_OrchPear.h:39
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
Farm::FA_Boron
virtual bool FA_Boron(LE *a_field, double a_user, int a_days)
Apply soluble Boron to a_field owned by a stock farmer.
Definition: FarmFuncs.cpp:868
CfgArray_Double
Definition: Configurator.h:208
Farm::CutOrch
virtual bool CutOrch(LE *a_field, double a_user, int a_days)
Cut vegetation on orchard crop. //based on cut to silage - values from cutting function of orchard.
Definition: FarmFuncs.cpp:1666
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
Farm::FP_Boron
virtual bool FP_Boron(LE *a_field, double a_user, int a_days)
Apply soluble Boron to a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:854
dk_ope_herbicide1
Definition: DK_OrchPear.h:55
dk_ope_boron_p
Definition: DK_OrchPear.h:87
dk_ope_cutting3
Definition: DK_OrchPear.h:80
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
dk_ope_fungicide8
Definition: DK_OrchPear.h:103
CfgArray_Double::value
std::vector< double > value() const
Definition: Configurator.h:219
l_pest_insecticide_amount
CfgFloat l_pest_insecticide_amount
dk_ope_manual_cutting9
Definition: DK_OrchPear.h:65
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
Farm::InsecticideTreat
virtual bool InsecticideTreat(LE *a_field, double a_user, int a_days)
Apply insecticide to a_field.
Definition: FarmFuncs.cpp:2135
dk_ope_water1
Definition: DK_OrchPear.h:41
dk_ope_insecticide1
Definition: DK_OrchPear.h:45
dk_ope_herbicide4
Definition: DK_OrchPear.h:90
dk_ope_gr1
Definition: DK_OrchPear.h:110
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_ope_fungicide6
Definition: DK_OrchPear.h:101
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::RowCultivation
virtual bool RowCultivation(LE *a_field, double a_user, int a_days)
Carry out a harrowing between crop rows on a_field.
Definition: FarmFuncs.cpp:1183
dk_ope_insecticide5
Definition: DK_OrchPear.h:49
LE
Definition: Elements.h:86
dk_ope_cutting6
Definition: DK_OrchPear.h:83
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
dk_ope_fungicide3
Definition: DK_OrchPear.h:97
Crop::m_last_date
int m_last_date
Definition: Farm.h:503
DK_OrchPearToDo
DK_OrchPearToDo
Definition: DK_OrchPear.h:35
dk_ope_insecticide9
Definition: DK_OrchPear.h:53
dk_ope_herbicide6
Definition: DK_OrchPear.h:92
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
dk_ope_gr4
Definition: DK_OrchPear.h:113
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
Farm
The base class for all farm types.
Definition: Farm.h:755
dk_ope_manual_cutting8
Definition: DK_OrchPear.h:64
Farm::DeepPlough
virtual bool DeepPlough(LE *a_field, double a_user, int a_days)
Carry out a deep ploughing event on a_field.
Definition: FarmFuncs.cpp:408
Crop::m_date_modifier
static int m_date_modifier
Holds a value that shifts test pesticide use by this many days in crops modified to use it.
Definition: Farm.h:514
CfgFloat
Double configurator entry class.
Definition: Configurator.h:126
dk_ope_manure_s2
Definition: DK_OrchPear.h:69
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
Farm::FruitHarvest
virtual bool FruitHarvest(LE *a_field, double a_user, int a_days)
FruitHarvest (harvest of the mature fruits, e.g., grapes) applied on a_field.
Definition: FarmFuncs.cpp:1959
Farm::Pruning
virtual bool Pruning(LE *a_field, double a_user, int a_days)
Pruning applied on a_field - details needs to be added (e.g., impact on biomass, influence/impacts in...
Definition: FarmFuncs.cpp:1897
dk_ope_fungicide11
Definition: DK_OrchPear.h:106
dk_ope_manure_p1
Definition: DK_OrchPear.h:40
DK_OrchPear::DK_OrchPear
DK_OrchPear(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: DK_OrchPear.h:130
Farm::GrowthRegulator
virtual bool GrowthRegulator(LE *a_field, double a_user, int a_days)
Apply growth regulator to a_field.
Definition: FarmFuncs.cpp:2070
dk_ope_cutting5
Definition: DK_OrchPear.h:82
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
dk_ope_fungicide4
Definition: DK_OrchPear.h:99
dk_ope_harvest
Definition: DK_OrchPear.h:98
dk_ope_gr3
Definition: DK_OrchPear.h:112
DK_OrchPear::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: DK_OrchPear.h:138
dk_ope_insecticide7
Definition: DK_OrchPear.h:51
dk_ope_herbicide8
Definition: DK_OrchPear.h:94
dk_ope_manual_cutting5
Definition: DK_OrchPear.h:61
dk_ope_manual_cutting6
Definition: DK_OrchPear.h:62
DK_OrchPear::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_OrchPear.cpp:64
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
dk_ope_water2
Definition: DK_OrchPear.h:72
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
dk_ope_fungicide7
Definition: DK_OrchPear.h:102
dk_ope_cutting1
Definition: DK_OrchPear.h:78
dk_ope_cutting2
Definition: DK_OrchPear.h:79
dk_ope_start
Definition: DK_OrchPear.h:36