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
WinterRapeStrigling.h
Go to the documentation of this file.
1 //
2 // WinterRapeStrigling.h
3 //
4 
5 #ifndef WINTERRAPESTRIGLING_H
6 #define WINTERRAPESTRIGLING_H
7 
8 // <cropname>_BASE is the first event number to be dumped into the
9 // debugging log from this crop. *Must* be unique among all crops.
10 // I suggest steps of 100 between crops.
11 
12 #define WINTERRAPESTRIGLING_BASE 7900
13 #define WR_DID_RC_CLEAN m_field->m_user[0]
14 #define WR_DID_HERBI_ZERO m_field->m_user[1]
15 #define WR_INSECT_DATE m_field->m_user[2]
16 #define WR_FUNGI_DATE m_field->m_user[3]
17 #define WR_SWARTH_DATE m_field->m_user[4]
18 
19 typedef enum {
20  wrs_start = 1, // Compulsory, start event must always be 1 (one).
45 
46 
47 
49 {
50 public:
51  bool Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev );
52  WinterRapeStrigling(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape* a_L) : Crop(a_tov, a_toc, a_L)
53  {
56  }
58  const int elements = 2 + (wrs_foobar - WINTERRAPESTRIGLING_BASE);
60 
61  FarmManagementCategory catlist[elements] =
62  {
63  fmc_Others, // zero element unused but must be here
64  fmc_Others,//wrs_start = 1, // Compulsory, start event must always be 1 (one).
65  fmc_Fertilizer,//wrs_ferti_zero = WINTERRAPESTRIGLING_BASE,
66  fmc_Cultivation,//wrs_autumn_plough,
67  fmc_Cultivation,//wrs_autumn_harrow,
68  fmc_Others,//wrs_autumn_sow,
69  fmc_Cultivation,//wrs_strigling_one,
70  fmc_Cultivation,//wrs_strigling_two,
71  fmc_Cultivation,//wrs_strigling_three,
72  fmc_Cultivation,//wrs_strigling_threeb,
73  fmc_Fertilizer,//wrs_ferti_p1,
74  fmc_Fertilizer,//wrs_ferti_p2,
75  fmc_Fertilizer,//wrs_ferti_s1,
76  fmc_Fertilizer,//wrs_ferti_s2,
77  fmc_Fungicide,//wrs_fungi_one,
78  fmc_Insecticide,//wrs_insect_one,
79  fmc_Insecticide,//wrs_insect_one_b,
80  fmc_Insecticide,//wrs_insect_one_c,
81  fmc_Cutting,//wrs_swarth,
82  fmc_Harvest,//wrs_harvest,
83  fmc_Others,//wrs_cuttostraw,
84  fmc_Others,//wrs_compress,
85  fmc_Cultivation,//wrs_stub_harrow,
86  fmc_Cultivation//wrs_grubbing
87 
88  // no foobar entry
89 
90  };
91  // Iterate over the catlist elements and copy them to vector
92  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
93 
94  }
95 };
96 
97 #endif // WINTERRAPE_H
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
wrs_autumn_plough
Definition: WinterRapeStrigling.h:22
wrs_insect_one
Definition: WinterRapeStrigling.h:34
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
WinterRapeStrigling::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: WinterRapeStrigling.h:57
LE::SetMDates
void SetMDates(int a, int b, int c)
Definition: Elements.h:406
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
WinterRapeStrigling::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: WinterRapeStrigling.cpp:35
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
WinterRapeStrigling::WinterRapeStrigling
WinterRapeStrigling(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: WinterRapeStrigling.h:52
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
wrs_autumn_harrow
Definition: WinterRapeStrigling.h:23
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
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::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
wrs_grubbing
Definition: WinterRapeStrigling.h:42
wrs_insect_one_b
Definition: WinterRapeStrigling.h:35
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
wrs_cuttostraw
Definition: WinterRapeStrigling.h:39
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
WinterRapeStrigling
Definition: WinterRapeStrigling.h:48
CfgFloat::value
double value() const
Definition: Configurator.h:142
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
wrs_insect_one_c
Definition: WinterRapeStrigling.h:36
wrs_ferti_s2
Definition: WinterRapeStrigling.h:32
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
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
wrs_harvest
Definition: WinterRapeStrigling.h:38
wrs_strigling_two
Definition: WinterRapeStrigling.h:26
cfg_ins_app_prop1
CfgFloat cfg_ins_app_prop1
fmc_Cutting
Definition: LandscapeFarmingEnums.h:1009
wrs_swarth
Definition: WinterRapeStrigling.h:37
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
wrs_autumn_sow
Definition: WinterRapeStrigling.h:24
cfg_herbi_app_prop
CfgFloat cfg_herbi_app_prop
Calendar::Date
long Date(void)
Definition: Calendar.h:57
wrs_strigling_one
Definition: WinterRapeStrigling.h:25
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
WR_FUNGI_DATE
#define WR_FUNGI_DATE
Definition: WinterRape.h:48
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
wrs_ferti_p2
Definition: WinterRapeStrigling.h:30
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
WR_INSECT_DATE
#define WR_INSECT_DATE
Definition: WinterRape.h:47
WR_SWARTH_DATE
#define WR_SWARTH_DATE
Definition: WinterRape.h:49
wrs_ferti_s1
Definition: WinterRapeStrigling.h:31
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
WR_DID_HERBI_ZERO
#define WR_DID_HERBI_ZERO
Definition: WinterRape.h:46
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
wrs_start
Definition: WinterRapeStrigling.h:20
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::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
wrs_foobar
Definition: WinterRapeStrigling.h:43
TTypesOfCrops
TTypesOfCrops
Definition: LandscapeFarmingEnums.h:781
wrs_ferti_p1
Definition: WinterRapeStrigling.h:29
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
wrs_strigling_three
Definition: WinterRapeStrigling.h:27
LE
Definition: Elements.h:86
Crop::m_last_date
int m_last_date
Definition: Farm.h:503
WR_DID_RC_CLEAN
#define WR_DID_RC_CLEAN
Definition: WinterRape.h:45
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
cfg_greg_app_prop
CfgFloat cfg_greg_app_prop
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
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
wrs_strigling_threeb
Definition: WinterRapeStrigling.h:28
wrs_ferti_zero
Definition: WinterRapeStrigling.h:21
wrs_fungi_one
Definition: WinterRapeStrigling.h:33
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
WinterRapeStriglingToDo
WinterRapeStriglingToDo
Definition: WinterRapeStrigling.h:19
wrs_compress
Definition: WinterRapeStrigling.h:40
wrs_stub_harrow
Definition: WinterRapeStrigling.h:41
Farm::Swathing
virtual bool Swathing(LE *a_field, double a_user, int a_days)
Cut the crop on a_field and leave it lying (probably rape)
Definition: FarmFuncs.cpp:1350
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
WARN_BUG
Definition: MapErrorMsg.h:34
cfg_fungi_app_prop1
CfgFloat cfg_fungi_app_prop1
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
WINTERRAPESTRIGLING_BASE
#define WINTERRAPESTRIGLING_BASE
Definition: WinterRapeStrigling.h:12
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
Farm::FP_NPKS
virtual bool FP_NPKS(LE *a_field, double a_user, int a_days)
Apply NPKS fertilizer, on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:630