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
NLPotatoesSpring.h
Go to the documentation of this file.
1 
16 //
17 // NLPotatoesSpring.h
18 //
19 
20 
21 #ifndef NLPOTATOESSPRING_H
22 #define NLPOTATOESSPRING_H
23 
24 #define NLPOTATOESSPRING_BASE 22100
25 
28 #define NL_POTS_HERBI a_field->m_user[1]
29 #define NL_POTS_FUNGI1 a_field->m_user[2]
30 #define NL_POTS_FUNGI2 a_field->m_user[3]
31 #define NL_POTS_FUNGI3 a_field->m_user[4]
32 #define NL_POTS_FUNGI4 a_field->m_user[5]
33 #define NL_POTS_FUNGI5 a_field->m_user[6]
34 
40 typedef enum {
41  nl_pots_start = 1, // Compulsory, must always be 1 (one).
81 
82 
91 class NLPotatoesSpring: public Crop
92 {
93  public:
94  virtual bool Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev );
95  NLPotatoesSpring(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape* a_L) : Crop(a_tov, a_toc, a_L)
96  {
97  // When we start it off, the first possible date for a farm operation is 5th November
98  // This information is used by other crops when they decide how much post processing of
99  // the management is allowed after harvest before the next crop starts.
100  m_first_date=g_date->DayInYear( 30,4 );
102  }
104  const int elements = 2 + (nl_pots_foobar - NLPOTATOESSPRING_BASE);
106 
107  FarmManagementCategory catlist[elements] =
108  {
109  fmc_Others, // zero element unused but must be here
110  fmc_Others,//nl_pots_start = 1, // Compulsory, must always be 1 (one).
111  fmc_Others,//nl_pots_sleep_all_day = NLPOTATOESSPRING_BASE,
112  fmc_Fertilizer,//nl_pots_ferti_p2_clay,
113  fmc_Fertilizer,//nl_pots_ferti_s2_clay,
114  fmc_Cultivation,//nl_pots_spring_plough_sandy,
115  fmc_Fertilizer,//nl_pots_ferti_p2_sandy,
116  fmc_Fertilizer,//nl_pots_ferti_s2_sandy,
117  fmc_Others,//nl_pots_bed_forming,
118  fmc_Others,//nl_pots_spring_planting,
119  fmc_Others,//nl_pots_hilling1,
120  fmc_Fertilizer,//nl_pots_ferti_p3_clay,
121  fmc_Fertilizer,//nl_pots_ferti_s3_clay,
122  fmc_Fertilizer,//nl_pots_ferti_p3_sandy,
123  fmc_Fertilizer,//nl_pots_ferti_s3_sandy,
124  fmc_Fertilizer,//nl_pots_ferti_p4,
125  fmc_Fertilizer,//nl_pots_ferti_s4,
126  fmc_Herbicide,//nl_pots_herbicide1,
127  fmc_Herbicide,//nl_pots_herbicide2,
128  fmc_Fungicide,//nl_pots_fungicide1,
129  fmc_Fungicide,//nl_pots_fungicide2,
130  fmc_Fungicide,//nl_pots_fungicide3,
131  fmc_Fungicide,//nl_pots_fungicide4,
132  fmc_Fungicide,//nl_pots_fungicide5,
133  fmc_Fungicide,//nl_pots_fungicide6,
134  fmc_Fungicide,//nl_pots_fungicide7,
135  fmc_Fungicide,//nl_pots_fungicide8,
136  fmc_Fungicide,//nl_pots_fungicide9,
137  fmc_Fungicide,//nl_pots_fungicide10,
138  fmc_Fungicide,//nl_pots_fungicide11,
139  fmc_Fungicide,//nl_pots_fungicide12,
140  fmc_Fungicide,//nl_pots_fungicide13,
141  fmc_Fungicide,//nl_pots_fungicide14,
142  fmc_Fungicide,//nl_pots_fungicide15,
143  fmc_Insecticide,//nl_pots_insecticide,
144  fmc_Others,//nl_pots_dessication1,
145  fmc_Others,//nl_pots_dessication2,
146  fmc_Harvest//nl_pots_harvest,
147 
148  // no foobar entry
149 
150  };
151  // Iterate over the catlist elements and copy them to vector
152  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
153 
154  }
155 };
156 
157 #endif // NLPOTATOESSPRING_H
158 
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
nl_pots_dessication2
Definition: NLPotatoesSpring.h:77
nl_pots_fungicide2
Definition: NLPotatoesSpring.h:60
FarmEvent::m_forcespring
bool m_forcespring
Definition: Farm.h:392
NLPotatoesSpring::NLPotatoesSpring
NLPotatoesSpring(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: NLPotatoesSpring.h:95
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
nl_pots_hilling1
Definition: NLPotatoesSpring.h:50
nl_pots_foobar
Definition: NLPotatoesSpring.h:79
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
nl_pots_herbicide1
Definition: NLPotatoesSpring.h:57
nl_pots_herbicide2
Definition: NLPotatoesSpring.h:58
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
nl_pots_ferti_s4
Definition: NLPotatoesSpring.h:56
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
nl_pots_dessication1
Definition: NLPotatoesSpring.h:76
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
nl_pots_ferti_p3_clay
Definition: NLPotatoesSpring.h:51
nl_pots_fungicide12
Definition: NLPotatoesSpring.h:70
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
nl_pots_ferti_s3_clay
Definition: NLPotatoesSpring.h:52
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
nl_pots_start
Definition: NLPotatoesSpring.h:41
nl_pots_fungicide8
Definition: NLPotatoesSpring.h:66
NL_POTS_FUNGI2
#define NL_POTS_FUNGI2
Definition: NLPotatoesSpring.h:30
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
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
NLPotatoesSpring::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: NLPotatoesSpring.cpp:64
NLPotatoesSpringToDo
NLPotatoesSpringToDo
Definition: NLPotatoesSpring.h:40
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
nl_pots_ferti_s2_sandy
Definition: NLPotatoesSpring.h:47
nl_pots_ferti_p2_sandy
Definition: NLPotatoesSpring.h:46
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
nl_pots_spring_plough_sandy
Definition: NLPotatoesSpring.h:45
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
nl_pots_fungicide9
Definition: NLPotatoesSpring.h:67
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
nl_pots_ferti_p3_sandy
Definition: NLPotatoesSpring.h:53
NLPotatoesSpring
NLPotatoesSpring class .
Definition: NLPotatoesSpring.h:91
CfgBool::value
bool value() const
Definition: Configurator.h:164
cfg_POT_InsecticideMonth
CfgInt cfg_POT_InsecticideMonth
Provided to allow configuration control of the first insecticide spray in potatoes crops - this chang...
cfg_POT_InsecticideDay
CfgInt cfg_POT_InsecticideDay
Provided to allow configuration control of the first insecticide spray in potatoes crops - this chang...
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
tov_NLPotatoesSpring
Definition: LandscapeFarmingEnums.h:265
nl_pots_insecticideb
Definition: NLPotatoesSpring.h:75
NL_POTS_FUNGI1
#define NL_POTS_FUNGI1
Definition: NLPotatoesSpring.h:29
nl_pots_fungicide3
Definition: NLPotatoesSpring.h:61
nl_pots_fungicide4
Definition: NLPotatoesSpring.h:62
Calendar::Date
long Date(void)
Definition: Calendar.h:57
nl_pots_fungicide14
Definition: NLPotatoesSpring.h:72
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
LE::GetSoilType
int GetSoilType()
Definition: Elements.h:302
CfgBool
Bool configurator entry class.
Definition: Configurator.h:155
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.
nl_pots_fungicide13
Definition: NLPotatoesSpring.h:71
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
NL_POTS_FUNGI4
#define NL_POTS_FUNGI4
Definition: NLPotatoesSpring.h:32
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
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
nl_pots_ferti_p2_clay
Definition: NLPotatoesSpring.h:43
CfgArray_Double
Definition: Configurator.h:208
nl_pots_ferti_s2_clay
Definition: NLPotatoesSpring.h:44
nl_pots_spring_planting
Definition: NLPotatoesSpring.h:49
Crop::StartUpCrop
bool StartUpCrop(int a_spring, std::vector< std::vector< int >> a_flexdates, int a_todo)
Holds the translation between the farm operation enum for each cropand the farm management category a...
Definition: Farm.cpp:652
nl_pots_harvest
Definition: NLPotatoesSpring.h:78
nl_pots_ferti_s3_sandy
Definition: NLPotatoesSpring.h:54
NL_POTS_HERBI
#define NL_POTS_HERBI
A flag used to indicate autumn ploughing status.
Definition: NLPotatoesSpring.h:28
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
nl_pots_fungicide7
Definition: NLPotatoesSpring.h:65
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
cfg_pest_potatoes_on
CfgBool cfg_pest_potatoes_on
Turn on pesticides for potatoes.
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::BiocideTreat
virtual bool BiocideTreat(LE *a_field, double a_user, int a_days)
Apply Biocide to a_field.
Definition: FarmFuncs.cpp:2175
nl_pots_fungicide11
Definition: NLPotatoesSpring.h:69
TTypesOfCrops
TTypesOfCrops
Definition: LandscapeFarmingEnums.h:781
l_pest_insecticide_amount
CfgFloat l_pest_insecticide_amount
LE
Definition: Elements.h:86
Crop::m_last_date
int m_last_date
Definition: Farm.h:503
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
NLPOTATOESSPRING_BASE
#define NLPOTATOESSPRING_BASE
Definition: NLPotatoesSpring.h:24
nl_pots_fungicide15
Definition: NLPotatoesSpring.h:73
nl_pots_ferti_p4
Definition: NLPotatoesSpring.h:55
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
Crop::m_date_modifier
static int m_date_modifier
Holds a value that shifts test pesticide use by this many days in crops modified to use it.
Definition: Farm.h:514
CfgFloat
Double configurator entry class.
Definition: Configurator.h:126
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
nl_pots_fungicide5
Definition: NLPotatoesSpring.h:63
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
nl_pots_fungicide6
Definition: NLPotatoesSpring.h:64
nl_pots_fungicide1
Definition: NLPotatoesSpring.h:59
nl_pots_sleep_all_day
Definition: NLPotatoesSpring.h:42
NL_POTS_FUNGI5
#define NL_POTS_FUNGI5
Definition: NLPotatoesSpring.h:33
NL_POTS_FUNGI3
#define NL_POTS_FUNGI3
Definition: NLPotatoesSpring.h:31
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
nl_pots_bed_forming
Definition: NLPotatoesSpring.h:48
nl_pots_fungicide10
Definition: NLPotatoesSpring.h:68
NLPotatoesSpring::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: NLPotatoesSpring.h:103
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
nl_pots_insecticide
Definition: NLPotatoesSpring.h:74
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
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