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
WinterWheatStriglingCulm.h
Go to the documentation of this file.
1 //
2 // WinterWheatStriglingCulm.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 WINTERWHEATStriglingCulm_H
38 #define WINTERWHEATStriglingCulm_H
39 
40 #define WINTERWHEATStriglingCulm_BASE 8400
41 #define WWStriglingCulm_WAIT_FOR_PLOUGH m_field->m_user[0]
42 #define WWStriglingCulm_AUTUMN_PLOUGH m_field->m_user[1]
43 
44 typedef enum {
45  wwsc_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 );
89  WinterWheatStriglingCulm(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape* a_L) : Crop(a_tov, a_toc, a_L)
90  {
91  m_first_date=g_date->DayInYear( 1,10 );
93  }
95  const int elements = 2 + (wwsc_foobar - WINTERWHEATStriglingCulm_BASE);
97 
98  FarmManagementCategory catlist[elements] =
99  {
100  fmc_Others, // zero element unused but must be here
101  fmc_Others,//wwsc_start = 1, // Compulsory, must always be 1 (one).
102  fmc_Others,//wwsc_sleep_all_day = WINTERWHEATStriglingCulm_BASE,
103  fmc_Fertilizer,//wwsc_ferti_p1,
104  fmc_Fertilizer,//wwsc_ferti_s1,
105  fmc_Fertilizer,//wwsc_ferti_s2,
106  fmc_Cultivation,//wwsc_autumn_plough,
107  fmc_Cultivation,//wwsc_autumn_harrow,
108  fmc_Cultivation,//wwsc_stubble_harrow1,
109  fmc_Others,//wwsc_autumn_sow,
110  fmc_Others,//wwsc_autumn_roll,
111  fmc_Fertilizer,//wwsc_ferti_p2,
112  fmc_Cultivation,//wwsc_strigling0a,
113  fmc_Others,//wwsc_spring_roll,
114  fmc_Cultivation,//wwsc_strigling0b,
115  fmc_Others,//wwsc_GR,
116  fmc_Fungicide,//wwsc_fungicide,
117  fmc_Fungicide,//wwsc_fungicide2,
118  fmc_Insecticide,//wwsc_insecticide1,
119  fmc_Insecticide,//wwsc_insecticide2,
120  fmc_Insecticide,//wwsc_insecticide3,
121  fmc_Cultivation,//wwsc_strigling1,
122  fmc_Cultivation,//wwsc_strigling2,
123  fmc_Watering,//wwsc_water1,
124  fmc_Watering,//wwsc_water2,
125  fmc_Fertilizer,//wwsc_ferti_p3,
126  fmc_Fertilizer,//wwsc_ferti_p4,
127  fmc_Fertilizer,//wwsc_ferti_p5,
128  fmc_Fertilizer,//wwsc_ferti_s3,
129  fmc_Fertilizer,//wwsc_ferti_s4,
130  fmc_Fertilizer,//wwsc_ferti_s5,
131  fmc_Harvest,//wwsc_harvest,
132  fmc_Others,//wwsc_straw_chopping,
133  fmc_Others,//wwsc_hay_turning,
134  fmc_Others,//wwsc_hay_baling,
135  fmc_Cultivation,//wwsc_stubble_harrow2,
136  fmc_Cultivation//wwsc_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 // WINTERWHEATStriglingCulm_H
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
WINTERWHEATStriglingCulm_BASE
#define WINTERWHEATStriglingCulm_BASE
Definition: WinterWheatStriglingCulm.h:40
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
wwsc_stubble_harrow2
Definition: WinterWheatStriglingCulm.h:79
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
cfg_greg_app_prop
CfgFloat cfg_greg_app_prop
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
wwsc_autumn_sow
Definition: WinterWheatStriglingCulm.h:53
LE::SetMDates
void SetMDates(int a, int b, int c)
Definition: Elements.h:406
wwsc_fungicide
Definition: WinterWheatStriglingCulm.h:60
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
wwsc_water2
Definition: WinterWheatStriglingCulm.h:68
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
wwsc_strigling0b
Definition: WinterWheatStriglingCulm.h:58
LE::GetMConstants
int GetMConstants(int a)
Definition: Elements.h:407
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
wwsc_ferti_s1
Definition: WinterWheatStriglingCulm.h:48
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
wwsc_strigling1
Definition: WinterWheatStriglingCulm.h:65
LE::GetPoly
int GetPoly(void)
Returns the polyref number for this polygon.
Definition: Elements.h:238
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
wwsc_ferti_p5
Definition: WinterWheatStriglingCulm.h:71
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
CfgFloat::value
double value() const
Definition: Configurator.h:142
wwsc_spring_roll
Definition: WinterWheatStriglingCulm.h:57
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
wwsc_insecticide3
Definition: WinterWheatStriglingCulm.h:64
wwsc_sleep_all_day
Definition: WinterWheatStriglingCulm.h:46
wwsc_strigling0a
Definition: WinterWheatStriglingCulm.h:56
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
FarmEvent::m_startday
int m_startday
Definition: Farm.h:385
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
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
WinterWheatStriglingCulmToDo
WinterWheatStriglingCulmToDo
Definition: WinterWheatStriglingCulm.h:44
LE::GetVegBiomass
virtual double GetVegBiomass(void)
Definition: Elements.h:164
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
cfg_CulmLastStriglingTime
CfgInt cfg_CulmLastStriglingTime
wwsc_insecticide1
Definition: WinterWheatStriglingCulm.h:62
cfg_herbi_app_prop
CfgFloat cfg_herbi_app_prop
wwsc_start
Definition: WinterWheatStriglingCulm.h:45
wwsc_ferti_p3
Definition: WinterWheatStriglingCulm.h:69
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
wwsc_ferti_s5
Definition: WinterWheatStriglingCulm.h:74
wwsc_autumn_harrow
Definition: WinterWheatStriglingCulm.h:51
WinterWheatStriglingCulm
Definition: WinterWheatStriglingCulm.h:85
wwsc_hay_baling
Definition: WinterWheatStriglingCulm.h:78
Calendar::Date
long Date(void)
Definition: Calendar.h:57
WinterWheatStriglingCulm::Do
virtual bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: WinterWheatStriglingCulm.cpp:39
WinterWheatStriglingCulm::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: WinterWheatStriglingCulm.h:94
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
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
fmc_Watering
Definition: LandscapeFarmingEnums.h:1011
wwsc_harvest
Definition: WinterWheatStriglingCulm.h:75
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
wwsc_hay_turning
Definition: WinterWheatStriglingCulm.h:77
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
wwsc_ferti_p2
Definition: WinterWheatStriglingCulm.h:55
wwsc_grubning
Definition: WinterWheatStriglingCulm.h:80
wwsc_insecticide2
Definition: WinterWheatStriglingCulm.h:63
wwsc_autumn_plough
Definition: WinterWheatStriglingCulm.h:50
WWStriglingCulm_WAIT_FOR_PLOUGH
#define WWStriglingCulm_WAIT_FOR_PLOUGH
Definition: WinterWheatStriglingCulm.h:41
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
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
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
wwsc_foobar
Definition: WinterWheatStriglingCulm.h:81
wwsc_water1
Definition: WinterWheatStriglingCulm.h:67
LE
Definition: Elements.h:86
wwsc_ferti_p1
Definition: WinterWheatStriglingCulm.h:47
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_strigling_prop
CfgFloat cfg_strigling_prop
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
wwsc_GR
Definition: WinterWheatStriglingCulm.h:59
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
wwsc_strigling2
Definition: WinterWheatStriglingCulm.h:66
wwsc_stubble_harrow1
Definition: WinterWheatStriglingCulm.h:52
Farm::GrowthRegulator
virtual bool GrowthRegulator(LE *a_field, double a_user, int a_days)
Apply growth regulator to a_field.
Definition: FarmFuncs.cpp:2070
WinterWheatStriglingCulm::WinterWheatStriglingCulm
WinterWheatStriglingCulm(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: WinterWheatStriglingCulm.h:89
wwsc_ferti_s4
Definition: WinterWheatStriglingCulm.h:73
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
wwsc_straw_chopping
Definition: WinterWheatStriglingCulm.h:76
cfg_fungi_app_prop1
CfgFloat cfg_fungi_app_prop1
wwsc_ferti_p4
Definition: WinterWheatStriglingCulm.h:70
wwsc_fungicide2
Definition: WinterWheatStriglingCulm.h:61
cfg_ins_app_prop1
CfgFloat cfg_ins_app_prop1
WWStriglingCulm_AUTUMN_PLOUGH
#define WWStriglingCulm_AUTUMN_PLOUGH
Definition: WinterWheatStriglingCulm.h:42
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
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
wwsc_autumn_roll
Definition: WinterWheatStriglingCulm.h:54
wwsc_ferti_s2
Definition: WinterWheatStriglingCulm.h:49
wwsc_ferti_s3
Definition: WinterWheatStriglingCulm.h:72
WARN_BUG
Definition: MapErrorMsg.h:34
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
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