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
WinterWheatStriglingSingle.h
Go to the documentation of this file.
1 //
2 // WinterWheatStriglingSingle.h
3 //
4 /*
5 
6 Copyright (c) 2005, National Environmental Research Institute, Denmark (NERI)
7 
8 All rights reserved.
9 
10 
11 Redistribution and use in source and binary forms, with or without
12 modification, are permitted provided that the following conditions are met:
13 
14 *) Redistributions of source code must retain the above copyright notice, this
15 list of conditions and the following disclaimer.
16 *) Redistributions in binary form must reproduce the above copyright notice,
17 this list of conditions and the following disclaimer in the documentation
18 and/or other materials provided with the distribution.
19 *) Neither the name of the NERI nor the names of its contributors
20 may be used to endorse or promote products derived from this software without
21 specific prior written permission.
22 
23 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 POSSIBILITY OF SUCH DAMAGE.
34 
35 */
36 
37 #ifndef WINTERWHEATStriglingSingle_H
38 #define WINTERWHEATStriglingSingle_H
39 
40 #define WINTERWHEATStriglingSingle_BASE 8500
41 #define WWStriglingSingle_WAIT_FOR_PLOUGH m_field->m_user[0]
42 #define WWStriglingSingle_AUTUMN_PLOUGH m_field->m_user[1]
43 
44 typedef enum {
45  wwss_start = 1, // Compulsory, must always be 1 (one).
83 
84 
86 {
87  public:
88  virtual bool Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev );
90  {
91  m_first_date=g_date->DayInYear( 1,10 );
93  }
95  const int elements = 2 + (wwss_foobar - WINTERWHEATStriglingSingle_BASE);
97 
98  FarmManagementCategory catlist[elements] =
99  {
100  fmc_Others, // zero element unused but must be here
101  fmc_Others,//wwss_start = 1, // Compulsory, must always be 1 (one).
102  fmc_Others,//wwss_sleep_all_day = WINTERWHEATStriglingSingle_BASE,
103  fmc_Fertilizer,//wwss_ferti_p1,
104  fmc_Fertilizer,//wwss_ferti_s1,
105  fmc_Fertilizer,//wwss_ferti_s2,
106  fmc_Cultivation,//wwss_autumn_plough,
107  fmc_Cultivation,//wwss_autumn_harrow,
108  fmc_Cultivation,//wwss_stubble_harrow1,
109  fmc_Others,//wwss_autumn_sow,
110  fmc_Others,//wwss_autumn_roll,
111  fmc_Fertilizer,//wwss_ferti_p2,
112  fmc_Cultivation,//wwss_strigling0a,
113  fmc_Others,//wwss_spring_roll,
114  fmc_Cultivation,//wwss_strigling0b,
115  fmc_Others,//wwss_GR,
116  fmc_Fungicide,//wwss_fungicide,
117  fmc_Fungicide,//wwss_fungicide2,
118  fmc_Insecticide,//wwss_insecticide1,
119  fmc_Insecticide,//wwss_insecticide2,
120  fmc_Insecticide,//wwss_insecticide3,
121  fmc_Cultivation,//wwss_strigling1,
122  fmc_Cultivation,//wwss_strigling2,
123  fmc_Harvest,//wwss_water1,
124  fmc_Harvest,//wwss_water2,
125  fmc_Fertilizer,//wwss_ferti_p3,
126  fmc_Fertilizer,//wwss_ferti_p4,
127  fmc_Fertilizer,//wwss_ferti_p5,
128  fmc_Fertilizer,//wwss_ferti_s3,
129  fmc_Fertilizer,//wwss_ferti_s4,
130  fmc_Fertilizer,//wwss_ferti_s5,
131  fmc_Harvest,//wwss_harvest,
132  fmc_Others,//wwss_straw_chopping,
133  fmc_Others,//wwss_hay_turning,
134  fmc_Others,//wwss_hay_baling,
135  fmc_Cultivation,//wwss_stubble_harrow2,
136  fmc_Cultivation//wwss_grubning,
137 
138  // no foobar entry
139 
140  };
141  // Iterate over the catlist elements and copy them to vector
142  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
143 
144  }
145 };
146 
147 #endif // WINTERWHEATStriglingSingle_H
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
cfg_greg_app_prop
CfgFloat cfg_greg_app_prop
Farm::SpringRoll
virtual bool SpringRoll(LE *a_field, double a_user, int a_days)
Carry out a roll event in the spring on a_field.
Definition: FarmFuncs.cpp:487
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
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
WINTERWHEATStriglingSingle_BASE
#define WINTERWHEATStriglingSingle_BASE
Definition: WinterWheatStriglingSingle.h:40
wwss_autumn_roll
Definition: WinterWheatStriglingSingle.h:54
LE::SetMDates
void SetMDates(int a, int b, int c)
Definition: Elements.h:406
wwss_grubning
Definition: WinterWheatStriglingSingle.h:80
wwss_fungicide
Definition: WinterWheatStriglingSingle.h:60
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
wwss_straw_chopping
Definition: WinterWheatStriglingSingle.h:76
Farm::Strigling
virtual bool Strigling(LE *a_field, double a_user, int a_days)
Carry out a mechanical weeding on a_field.
Definition: FarmFuncs.cpp:1206
Farm::Harvest
virtual bool Harvest(LE *a_field, double a_user, int a_days)
Carry out a harvest on a_field.
Definition: FarmFuncs.cpp:1364
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
Farm::FP_ManganeseSulphate
virtual bool FP_ManganeseSulphate(LE *a_field, double a_user, int a_days)
Apply Manganse Sulphate to a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:840
FarmEvent
A struct to hold the information required to trigger a farm event.
Definition: Farm.h:372
LE::GetMConstants
int GetMConstants(int a)
Definition: Elements.h:407
WinterWheatStriglingSingleToDo
WinterWheatStriglingSingleToDo
Definition: WinterWheatStriglingSingle.h:44
wwss_insecticide2
Definition: WinterWheatStriglingSingle.h:63
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::DoIt
bool DoIt(double a_probability)
Return chance out of 0 to 100.
Definition: Farm.cpp:856
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
wwss_insecticide3
Definition: WinterWheatStriglingSingle.h:64
LE::GetPoly
int GetPoly(void)
Returns the polyref number for this polygon.
Definition: Elements.h:238
wwss_strigling0b
Definition: WinterWheatStriglingSingle.h:58
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
wwss_ferti_s3
Definition: WinterWheatStriglingSingle.h:72
wwss_ferti_s4
Definition: WinterWheatStriglingSingle.h:73
wwss_ferti_s2
Definition: WinterWheatStriglingSingle.h:49
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
wwss_ferti_p3
Definition: WinterWheatStriglingSingle.h:69
CfgFloat::value
double value() const
Definition: Configurator.h:142
cfg_SingleStriglingTime
CfgInt cfg_SingleStriglingTime
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
wwss_insecticide1
Definition: WinterWheatStriglingSingle.h:62
WinterWheatStriglingSingle::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: WinterWheatStriglingSingle.cpp:39
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
FarmEvent::m_startday
int m_startday
Definition: Farm.h:385
WinterWheatStriglingSingle
Definition: WinterWheatStriglingSingle.h:85
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
wwss_strigling1
Definition: WinterWheatStriglingSingle.h:65
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
wwss_GR
Definition: WinterWheatStriglingSingle.h:59
LE::GetVegBiomass
virtual double GetVegBiomass(void)
Definition: Elements.h:164
wwss_spring_roll
Definition: WinterWheatStriglingSingle.h:57
cfg_strigling_prop
CfgFloat cfg_strigling_prop
Crop
The base class for all crops.
Definition: Farm.h:495
Crop::SimpleEvent
void SimpleEvent(long a_date, int a_todo, bool a_lock)
Adds an event to this crop management.
Definition: Farm.cpp:747
wwss_fungicide2
Definition: WinterWheatStriglingSingle.h:61
WinterWheatStriglingSingle::WinterWheatStriglingSingle
WinterWheatStriglingSingle(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: WinterWheatStriglingSingle.h:89
wwss_ferti_p5
Definition: WinterWheatStriglingSingle.h:71
wwss_water2
Definition: WinterWheatStriglingSingle.h:68
cfg_ins_app_prop1
CfgFloat cfg_ins_app_prop1
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
wwss_foobar
Definition: WinterWheatStriglingSingle.h:81
wwss_strigling0a
Definition: WinterWheatStriglingSingle.h:56
wwss_autumn_harrow
Definition: WinterWheatStriglingSingle.h:51
Calendar::Date
long Date(void)
Definition: Calendar.h:57
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
Farm::HayBailing
virtual bool HayBailing(LE *a_field, double a_user, int a_days)
Carry out hay bailing on a_field.
Definition: FarmFuncs.cpp:1507
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
wwss_ferti_p2
Definition: WinterWheatStriglingSingle.h:55
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
wwss_ferti_p4
Definition: WinterWheatStriglingSingle.h:70
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
wwss_ferti_s1
Definition: WinterWheatStriglingSingle.h:48
wwss_ferti_s5
Definition: WinterWheatStriglingSingle.h:74
wwss_hay_baling
Definition: WinterWheatStriglingSingle.h:78
wwss_stubble_harrow1
Definition: WinterWheatStriglingSingle.h:52
wwss_water1
Definition: WinterWheatStriglingSingle.h:67
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
wwss_autumn_sow
Definition: WinterWheatStriglingSingle.h:53
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
WWStriglingSingle_WAIT_FOR_PLOUGH
#define WWStriglingSingle_WAIT_FOR_PLOUGH
Definition: WinterWheatStriglingSingle.h:41
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
Farm::AutumnRoll
virtual bool AutumnRoll(LE *a_field, double a_user, int a_days)
Carry out a roll event in the autumn on a_field.
Definition: FarmFuncs.cpp:299
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
cfg_fungi_app_prop1
CfgFloat cfg_fungi_app_prop1
Farm::AutumnPlough
virtual bool AutumnPlough(LE *a_field, double a_user, int a_days)
Carry out a ploughing event in the autumn on a_field.
Definition: FarmFuncs.cpp:212
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
Farm::AutumnHarrow
virtual bool AutumnHarrow(LE *a_field, double a_user, int a_days)
Carry out a harrow event in the autumn on a_field.
Definition: FarmFuncs.cpp:285
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
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
CfgFloat
Double configurator entry class.
Definition: Configurator.h:126
Farm::AutumnSow
virtual bool AutumnSow(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 autumn on a_field.
Definition: FarmFuncs.cpp:360
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
wwss_ferti_p1
Definition: WinterWheatStriglingSingle.h:47
wwss_sleep_all_day
Definition: WinterWheatStriglingSingle.h:46
Farm::GrowthRegulator
virtual bool GrowthRegulator(LE *a_field, double a_user, int a_days)
Apply growth regulator to a_field.
Definition: FarmFuncs.cpp:2070
WinterWheatStriglingSingle::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: WinterWheatStriglingSingle.h:94
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
wwss_start
Definition: WinterWheatStriglingSingle.h:45
wwss_stubble_harrow2
Definition: WinterWheatStriglingSingle.h:79
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
wwss_hay_turning
Definition: WinterWheatStriglingSingle.h:77
Farm::HayTurning
virtual bool HayTurning(LE *a_field, double a_user, int a_days)
Carry out hay turning on a_field.
Definition: FarmFuncs.cpp:1491
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
WWStriglingSingle_AUTUMN_PLOUGH
#define WWStriglingSingle_AUTUMN_PLOUGH
Definition: WinterWheatStriglingSingle.h:42
WARN_BUG
Definition: MapErrorMsg.h:34
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
wwss_strigling2
Definition: WinterWheatStriglingSingle.h:66
wwss_autumn_plough
Definition: WinterWheatStriglingSingle.h:50
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
wwss_harvest
Definition: WinterWheatStriglingSingle.h:75
Farm::StubbleHarrowing
virtual bool StubbleHarrowing(LE *a_field, double a_user, int a_days)
Carry out stubble harrowing on a_field.
Definition: FarmFuncs.cpp:1523
cfg_herbi_app_prop
CfgFloat cfg_herbi_app_prop