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
UKPotatoes.h
Go to the documentation of this file.
1 
13 //
14 // UKPotatoes.h
15 //
16 
17 
18 #ifndef UKPOTATOES_H
19 #define UKPOTATOES_H
20 
21 #define UKPOTATOES_BASE 45400
22 
25 #define UK_POT_STUBBLE_HARROW a_field->m_user[1]
26 
32 typedef enum {
33  uk_pot_start = 1, // Compulsory, must always be 1 (one).
35  uk_pot_stubble_harrow, // Stubble cultivation 100% September-October
36  uk_pot_winter_plough, // Winter plough 50% October-December
37  uk_pot_ferti_p1, // Slurry 100% March-April (if winter plough)
39  uk_pot_spring_plough, // Spring plough 50% March-April (if no winter plough)
40  uk_pot_ferti_p2, // NPK with sow 75% April
42  uk_pot_bed_forming, // Bed forming / Preseeding cultivation 100% April-May
43  uk_pot_spring_planting, // Planting 100% April-May
44  uk_pot_ferti_p3, // N 75% June
46  uk_pot_ferti_p4, // MG+S 25% June
48  uk_pot_hilling1, // Hilling 100% 2 weeks after planting
49  uk_pot_herbicide1, // Herbicide1 80% after Hilling
50  uk_pot_herbicide2, // Herbicide2 50% 2-4 weeks after Herbicide1
51  uk_pot_fungicide1, // Fungicide1 100% June 1-7
52  uk_pot_fungicide2, // Fungicide2 100% June 8-14
53  uk_pot_fungicide3, // Fungicide3 100% June 15-21
54  uk_pot_fungicide4, // Fungicide4 100% June 22-29
55  uk_pot_fungicide5, // Fungicide5 100% July 1-7
56  uk_pot_fungicide6, // Fungicide6 100% July 8-14
57  uk_pot_fungicide7, // Fungicide7 100% July 15-21
58  uk_pot_fungicide8, // Fungicide8 80% July 22-28
59  uk_pot_fungicide9, // Fungicide9 80% August 1-7
60  uk_pot_fungicide10, // Fungicide10 70% August 8-14
61  uk_pot_fungicide11, // Fungicide11 70% August 15-21
62  uk_pot_fungicide12, // Fungicide12 60% August 22-29
63  uk_pot_fungicide13, // Fungicide13 60% September 1-7
64  uk_pot_fungicide14, // Fungicide14 60% September 8-14
65  uk_pot_insecticide1, // Insecticide1 60% June
66  uk_pot_dessication1, // Dessication1 100% 14 days before Harvest
67  uk_pot_dessication2, // Dessication2 75% 4-6 days after Dessication 1
68  uk_pot_harvest, // Harvest 100% October
71 
72 
81 class UKPotatoes: public Crop
82 {
83  public:
84  virtual bool Do(Farm* a_farm, LE* a_field, FarmEvent* a_ev);
85  UKPotatoes(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape* a_L) : Crop(a_tov, a_toc, a_L)
86  {
87  // When we start it off, the first possible date for a farm operation is 1st November
88  // This information is used by other crops when they decide how much post processing of
89  // the management is allowed after harvest before the next crop starts.
90  m_first_date=g_date->DayInYear( 2,11 );
92  }
94  const int elements = 2 + (uk_pot_foobar - UKPOTATOES_BASE);
96  FarmManagementCategory catlist[elements] =
97  {
98  fmc_Others, // this needs to be at the zero line
99  fmc_Others,//uk_pot_start = 1, // Compulsory, must always be 1 (one).
100  fmc_Others,//uk_pot_sleep_all_day = UKPOTATOES_BASE,
101  fmc_Cultivation,//uk_pot_stubble_harrow, // Stubble cultivation 100% September-October
102  fmc_Cultivation,//uk_pot_winter_plough, // Winter plough 50% October-December
103  fmc_Fertilizer,//uk_pot_ferti_p1, // Slurry 100% March-April (if winter plough)
104  fmc_Fertilizer,//uk_pot_ferti_s1,
105  fmc_Cultivation,//uk_pot_spring_plough, // Spring plough 50% March-April (if no winter plough)
106  fmc_Fertilizer,//uk_pot_ferti_p2, // NPK with sow 75% April
107  fmc_Fertilizer,//uk_pot_ferti_s2,
108  fmc_Cultivation,//uk_pot_bed_forming, // Bed forming / Preseeding cultivation 100% April-May
109  fmc_Others,//uk_pot_spring_planting, // Planting 100% April-May
110  fmc_Fertilizer,//uk_pot_ferti_p3, // N 75% June
111  fmc_Fertilizer,//uk_pot_ferti_s3,
112  fmc_Fertilizer,//uk_pot_ferti_p4, // MG+S 25% June
113  fmc_Fertilizer,//uk_pot_ferti_s4,
114  fmc_Cultivation,//uk_pot_hilling1, // Hilling 100% 2 weeks after planting
115  fmc_Herbicide,//uk_pot_herbicide1, // Herbicide1 80% after Hilling
116  fmc_Herbicide,//uk_pot_herbicide2, // Herbicide2 50% 2-4 weeks after Herbicide1
117  fmc_Fungicide,//uk_pot_fungicide1, // Fungicide1 100% June 1-7
118  fmc_Fungicide,//uk_pot_fungicide2, // Fungicide2 100% June 8-14
119  fmc_Fungicide,//uk_pot_fungicide3, // Fungicide3 100% June 15-21
120  fmc_Fungicide,//uk_pot_fungicide4, // Fungicide4 100% June 22-29
121  fmc_Fungicide,//uk_pot_fungicide5, // Fungicide5 100% July 1-7
122  fmc_Fungicide,//uk_pot_fungicide6, // Fungicide6 100% July 8-14
123  fmc_Fungicide,//uk_pot_fungicide7, // Fungicide7 100% July 15-21
124  fmc_Fungicide,//uk_pot_fungicide8, // Fungicide8 80% July 22-28
125  fmc_Fungicide,//uk_pot_fungicide9, // Fungicide9 80% August 1-7
126  fmc_Fungicide,//uk_pot_fungicide10, // Fungicide10 70% August 8-14
127  fmc_Fungicide,//uk_pot_fungicide11, // Fungicide11 70% August 15-21
128  fmc_Fungicide,//uk_pot_fungicide12, // Fungicide12 60% August 22-29
129  fmc_Fungicide,//uk_pot_fungicide13, // Fungicide13 60% September 1-7
130  fmc_Fungicide,//uk_pot_fungicide14, // Fungicide14 60% September 8-14
131  fmc_Insecticide,//uk_pot_insecticide1, // Insecticide1 60% June
132  fmc_Herbicide,//uk_pot_dessication1, // Dessication1 100% 14 days before Harvest
133  fmc_Herbicide,//uk_pot_dessication2, // Dessication2 75% 4-6 days after Dessication 1
134  fmc_Harvest,//uk_pot_harvest, // Harvest 100% October
135  };
136  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
137  }
138 };
139 
140 #endif // UKPOTATOES_H
141 
uk_pot_ferti_s2
Definition: UKPotatoes.h:41
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
uk_pot_fungicide8
Definition: UKPotatoes.h:58
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
LE::SetMDates
void SetMDates(int a, int b, int c)
Definition: Elements.h:406
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
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
UKPotatoes
UKPotatoes class .
Definition: UKPotatoes.h:81
uk_pot_fungicide2
Definition: UKPotatoes.h:52
uk_pot_ferti_s3
Definition: UKPotatoes.h:45
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
uk_pot_herbicide2
Definition: UKPotatoes.h:50
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
uk_pot_fungicide3
Definition: UKPotatoes.h:53
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
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
uk_pot_fungicide7
Definition: UKPotatoes.h:57
Calendar::GetYearNumber
int GetYearNumber(void)
Definition: Calendar.h:72
uk_pot_fungicide6
Definition: UKPotatoes.h:56
UKPotatoes::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: UKPotatoes.h:93
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
uk_pot_harvest
Definition: UKPotatoes.h:68
LE::GetPoly
int GetPoly(void)
Returns the polyref number for this polygon.
Definition: Elements.h:238
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.
uk_pot_insecticide1
Definition: UKPotatoes.h:65
UKPotatoes::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: UKPotatoes.cpp:65
UKPotatoes::UKPotatoes
UKPotatoes(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: UKPotatoes.h:85
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
uk_pot_ferti_s4
Definition: UKPotatoes.h:47
Farm::BedForming
virtual bool BedForming(LE *a_field, double a_user, int a_days)
Do bed forming up on a_field, probably of carrots.
Definition: FarmFuncs.cpp:1316
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
Farm::GetPreviousTov
TTypesOfVegetation GetPreviousTov(int a_index)
Definition: Farm.h:966
uk_pot_fungicide10
Definition: UKPotatoes.h:60
uk_pot_ferti_p1
Definition: UKPotatoes.h:37
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
uk_pot_ferti_s1
Definition: UKPotatoes.h:38
Farm::GetType
TTypesOfFarm GetType(void)
Definition: Farm.h:956
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
cfg_POT_InsecticideDay
CfgInt cfg_POT_InsecticideDay
Provided to allow configuration control of the first insecticide spray in potatoes crops - this chang...
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
Farm::HillingUp
virtual bool HillingUp(LE *a_field, double a_user, int a_days)
Do hilling up on a_field, probably of potatoes.
Definition: FarmFuncs.cpp:1302
uk_pot_ferti_p3
Definition: UKPotatoes.h:44
Crop
The base class for all crops.
Definition: Farm.h:495
uk_pot_start
Definition: UKPotatoes.h:33
UKPOTATOES_BASE
#define UKPOTATOES_BASE
Definition: UKPotatoes.h:21
CfgBool::value
bool value() const
Definition: Configurator.h:164
uk_pot_ferti_p2
Definition: UKPotatoes.h:40
UKPotatoesToDo
UKPotatoesToDo
Definition: UKPotatoes.h:32
cfg_POT_InsecticideMonth
CfgInt cfg_POT_InsecticideMonth
Provided to allow configuration control of the first insecticide spray in potatoes crops - this chang...
l_pest_insecticide_amount
CfgFloat l_pest_insecticide_amount
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
uk_pot_dessication1
Definition: UKPotatoes.h:66
tov_UKPotatoes
Definition: LandscapeFarmingEnums.h:282
Calendar::Date
long Date(void)
Definition: Calendar.h:57
uk_pot_fungicide4
Definition: UKPotatoes.h:54
Farm::FP_AmmoniumSulphate
virtual bool FP_AmmoniumSulphate(LE *a_field, double a_user, int a_days)
Apply Ammonium Sulphate to a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:882
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
CfgBool
Bool configurator entry class.
Definition: Configurator.h:155
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
uk_pot_hilling1
Definition: UKPotatoes.h:48
uk_pot_fungicide1
Definition: UKPotatoes.h:51
uk_pot_dessication2
Definition: UKPotatoes.h:67
Farm::FA_ManganeseSulphate
virtual bool FA_ManganeseSulphate(LE *a_field, double a_user, int a_days)
Apply manganese sulphate to a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1095
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
uk_pot_foobar
Definition: UKPotatoes.h:69
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
uk_pot_stubble_harrow
Definition: UKPotatoes.h:35
CfgArray_Double
Definition: Configurator.h:208
LE::GetRotIndex
int GetRotIndex(void)
Definition: Elements.h:373
uk_pot_fungicide9
Definition: UKPotatoes.h:59
UK_POT_STUBBLE_HARROW
#define UK_POT_STUBBLE_HARROW
A flag used to indicate autumn ploughing status.
Definition: UKPotatoes.h:25
FarmEvent::m_next_tov
TTypesOfVegetation m_next_tov
Definition: Farm.h:390
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
uk_pot_ferti_p4
Definition: UKPotatoes.h:46
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
CfgArray_Double::value
std::vector< double > value() const
Definition: Configurator.h:219
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
TTypesOfCrops
TTypesOfCrops
Definition: LandscapeFarmingEnums.h:781
uk_pot_fungicide5
Definition: UKPotatoes.h:55
tof_OptimisingFarm
Definition: LandscapeFarmingEnums.h:696
LE
Definition: Elements.h:86
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
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
uk_pot_spring_planting
Definition: UKPotatoes.h:43
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
uk_pot_winter_plough
Definition: UKPotatoes.h:36
CfgFloat
Double configurator entry class.
Definition: Configurator.h:126
uk_pot_bed_forming
Definition: UKPotatoes.h:42
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
Farm::WinterPlough
virtual bool WinterPlough(LE *a_field, double a_user, int a_days)
Carry out a ploughing event in the winter on a_field.
Definition: FarmFuncs.cpp:395
uk_pot_fungicide14
Definition: UKPotatoes.h:64
uk_pot_fungicide11
Definition: UKPotatoes.h:61
LE::GetOwner
Farm * GetOwner(void)
Definition: Elements.h:256
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
uk_pot_sleep_all_day
Definition: UKPotatoes.h:34
uk_pot_fungicide13
Definition: UKPotatoes.h:63
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
uk_pot_fungicide12
Definition: UKPotatoes.h:62
WARN_BUG
Definition: MapErrorMsg.h:34
cfg_pest_potatoes_on
CfgBool cfg_pest_potatoes_on
Turn on pesticides for potatoes.
ppp_1
Definition: LandscapeFarmingEnums.h:1079
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
Crop::SimpleEvent_
void SimpleEvent_(long a_date, int a_todo, bool a_lock, Farm *a_farm, LE *a_field)
Adds an event to this crop management without relying on member variables.
Definition: Farm.cpp:751
uk_pot_spring_plough
Definition: UKPotatoes.h:39
uk_pot_herbicide1
Definition: UKPotatoes.h:49