ALMaSS  1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
WinterRyeStrigling.h
Go to the documentation of this file.
1 //
2 // WinterRyeStrigling.h
3 //
4 /*
5 
6 Copyright (c) 2003, 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 WinterRyeStrigling_H
38 #define WinterRyeStrigling_H
39 
40 #define WRYES_BASE 8100
41 #define WRYS_DID_MANURE m_field->m_user[0]
42 #define WRYS_DID_SLUDGE m_field->m_user[1]
43 
44 typedef enum {
45  wrys_start = 1, // Compulsory, start event must always be 1 (one).
73 
74 
75 
76 class WinterRyeStrigling: public Crop
77 {
78 public:
79  bool Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev );
80  WinterRyeStrigling(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape* a_L) : Crop(a_tov, a_toc, a_L)
81  {
84  }
86  const int elements = 2 + (wrys_foobar - WRYES_BASE);
88 
89  FarmManagementCategory catlist[elements] =
90  {
91  fmc_Others, // zero element unused but must be here
92  fmc_Others,//wrys_start = 1, // Compulsory, start event must always be 1 (one).
93  fmc_Fertilizer,//wrys_fertmanure_stock = WRYES_BASE,
94  fmc_Fertilizer,//wrys_fertsludge_stock,
95  fmc_Cultivation,//wrys_autumn_plough,
96  fmc_Cultivation,//wrys_autumn_harrow,
97  fmc_Others,//wrys_autumn_sow,
98  fmc_Others,//wrys_autumn_roll,
99  fmc_Fertilizer,//wrys_fertmanganese_plant_one,
100  fmc_Fertilizer,//wrys_fertnpk_plant,
101  fmc_Fertilizer,//wrys_fertmanganese_plant_two,
102  fmc_Fertilizer,//wrys_fertslurry_stock,
103  fmc_Fertilizer,//wrys_fert_ammonium_stock,
104  fmc_Others,//wrys_spring_roll,
105  fmc_Others,//wrys_growth_reg_one,
106  fmc_Cultivation,//wrys_strigling_one,
107  fmc_Cultivation,//wrys_strigling_two,
108  fmc_Cultivation,//wrys_strigling_three,
109  fmc_Others,//wrys_growth_reg_two,
110  fmc_Fungicide,//wrys_fungicide,
111  fmc_Insecticide,//wrys_insecticide,
112  fmc_Watering,//wrys_water,
113  fmc_Harvest,//wrys_harvest,
114  fmc_Others,//wrys_straw_chopping,
115  fmc_Others,//wrys_hay_turning,
116  fmc_Others,//wrys_hay_bailing,
117  fmc_Cultivation//wrys_stubble_harrowing
118 
119  // no foobar entry
120 
121  };
122  // Iterate over the catlist elements and copy them to vector
123  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
124 
125  }
126 };
127 
128 #endif // WinterRye_H
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
wrys_growth_reg_one
Definition: WinterRyeStrigling.h:58
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
cfg_herbi_app_prop
CfgFloat cfg_herbi_app_prop
LE::SetMDates
void SetMDates(int a, int b, int c)
Definition: Elements.h:406
wrys_stubble_harrowing
Definition: WinterRyeStrigling.h:70
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
wrys_autumn_sow
Definition: WinterRyeStrigling.h:50
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::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
wrys_fertsludge_stock
Definition: WinterRyeStrigling.h:47
wrys_fertnpk_plant
Definition: WinterRyeStrigling.h:53
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
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
Farm::FA_Sludge
virtual bool FA_Sludge(LE *a_field, double a_user, int a_days)
Spread sewege sludge on a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1140
CfgFloat::value
double value() const
Definition: Configurator.h:142
wrys_fertmanganese_plant_one
Definition: WinterRyeStrigling.h:52
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
cfg_strigling_prop
CfgFloat cfg_strigling_prop
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
FarmEvent::m_startday
int m_startday
Definition: Farm.h:385
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
wrys_strigling_two
Definition: WinterRyeStrigling.h:60
WinterRyeStrigling::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: WinterRyeStrigling.cpp:38
Crop
The base class for all crops.
Definition: Farm.h:495
wrys_harvest
Definition: WinterRyeStrigling.h:66
wrys_fertslurry_stock
Definition: WinterRyeStrigling.h:55
Crop::SimpleEvent
void SimpleEvent(long a_date, int a_todo, bool a_lock)
Adds an event to this crop management.
Definition: Farm.cpp:747
WinterRyeSToDo
WinterRyeSToDo
Definition: WinterRyeStrigling.h:44
wrys_autumn_roll
Definition: WinterRyeStrigling.h:51
wrys_autumn_plough
Definition: WinterRyeStrigling.h:48
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
wrys_water
Definition: WinterRyeStrigling.h:65
Calendar::Date
long Date(void)
Definition: Calendar.h:57
wrys_hay_bailing
Definition: WinterRyeStrigling.h:69
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
WRYS_DID_MANURE
#define WRYS_DID_MANURE
Definition: WinterRyeStrigling.h:41
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
wrys_insecticide
Definition: WinterRyeStrigling.h:64
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
wrys_fertmanure_stock
Definition: WinterRyeStrigling.h:46
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
wrys_autumn_harrow
Definition: WinterRyeStrigling.h:49
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
cfg_fungi_app_prop1
CfgFloat cfg_fungi_app_prop1
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
wrys_hay_turning
Definition: WinterRyeStrigling.h:68
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
wrys_fungicide
Definition: WinterRyeStrigling.h:63
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
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
Crop::m_last_date
int m_last_date
Definition: Farm.h:503
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
Farm::FA_AmmoniumSulphate
virtual bool FA_AmmoniumSulphate(LE *a_field, double a_user, int a_days)
Apply ammonium sulphate to a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1081
WRYES_BASE
#define WRYES_BASE
Definition: WinterRyeStrigling.h:40
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
Farm
The base class for all farm types.
Definition: Farm.h:755
WinterRyeStrigling::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: WinterRyeStrigling.h:85
CfgFloat
Double configurator entry class.
Definition: Configurator.h:126
wrys_strigling_one
Definition: WinterRyeStrigling.h:59
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
wrys_strigling_three
Definition: WinterRyeStrigling.h:61
cfg_ins_app_prop1
CfgFloat cfg_ins_app_prop1
wrys_growth_reg_two
Definition: WinterRyeStrigling.h:62
Farm::GrowthRegulator
virtual bool GrowthRegulator(LE *a_field, double a_user, int a_days)
Apply growth regulator to a_field.
Definition: FarmFuncs.cpp:2070
WinterRyeStrigling
Definition: WinterRyeStrigling.h:76
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
wrys_fertmanganese_plant_two
Definition: WinterRyeStrigling.h:54
wrys_spring_roll
Definition: WinterRyeStrigling.h:57
WinterRyeStrigling::WinterRyeStrigling
WinterRyeStrigling(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: WinterRyeStrigling.h:80
cfg_greg_app_prop
CfgFloat cfg_greg_app_prop
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
wrys_straw_chopping
Definition: WinterRyeStrigling.h:67
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
WRYS_DID_SLUDGE
#define WRYS_DID_SLUDGE
Definition: WinterRyeStrigling.h:42
WARN_BUG
Definition: MapErrorMsg.h:34
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
wrys_start
Definition: WinterRyeStrigling.h:45
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
wrys_foobar
Definition: WinterRyeStrigling.h:71
wrys_fert_ammonium_stock
Definition: WinterRyeStrigling.h:56