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
PLBeetSpr.h
Go to the documentation of this file.
1 
16 //
17 // PLBeetSpr.h
18 //
19 
20 
21 #ifndef PLBEETSPR_H
22 #define PLBEETSPR_H
23 
24 #define PLBEETSPR_BASE 25200
25 
28 #define PL_BES_SPRING_FERTI a_field->m_user[1]
29 #define PL_BES_WATER_DATE a_field->m_user[2]
30 #define PL_BES_HERBI_DATE a_field->m_user[3]
31 #define PL_BES_HERBI1 a_field->m_user[4]
32 #define PL_BES_HERBI3 a_field->m_user[5]
33 
34 
40 typedef enum {
41  pl_bes_start = 1, // Compulsory, must always be 1 (one).
74 
75 
84 class PLBeetSpr: public Crop
85 {
86  public:
87  virtual bool Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev );
88  PLBeetSpr(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape* a_L) : Crop(a_tov, a_toc, a_L)
89  {
90  m_first_date=g_date->DayInYear( 31,3 );
92  }
94  const int elements = 2 + (pl_bes_foobar - PLBEETSPR_BASE);
96 
97  FarmManagementCategory catlist[elements] =
98  {
99  fmc_Others, // zero element unused but must be here
100  fmc_Others,//pl_bes_start = 1, // Compulsory, must always be 1 (one).
101  fmc_Others,//pl_bes_sleep_all_day = PLBEETSPR_BASE,
102  fmc_Cultivation,//pl_bes_spring_plough,
103  fmc_Cultivation,//pl_bes_spring_harrow,
104  fmc_Fertilizer,//pl_bes_ferti_p4,
105  fmc_Fertilizer,//pl_bes_ferti_s4,
106  fmc_Fertilizer,//pl_bes_ferti_p5,
107  fmc_Fertilizer,//pl_bes_ferti_s5,
108  fmc_Cultivation,//pl_bes_heavy_cultivator,
109  fmc_Cultivation,//pl_bes_preseeding_cultivator,
110  fmc_Cultivation,//pl_bes_preseeding_cultivator_sow,
111  fmc_Others,//pl_bes_spring_sow,
112  fmc_Cultivation,//pl_bes_harrow_before_emergence,
113  fmc_Others,//pl_bes_thinning,
114  fmc_Watering,//pl_bes_watering1,
115  fmc_Watering,//pl_bes_watering2,
116  fmc_Watering,//pl_bes_watering3,
117  fmc_Herbicide,//pl_bes_herbicide1,
118  fmc_Herbicide,//pl_bes_herbicide2,
119  fmc_Herbicide,//pl_bes_herbicide3,
120  fmc_Herbicide,//pl_bes_herbicide4,
121  fmc_Fungicide,//pl_bes_fungicide1,
122  fmc_Fungicide,//pl_bes_fungicide2,
123  fmc_Insecticide,//pl_bes_insecticide,
124  fmc_Fertilizer,//pl_bes_ferti_p6,
125  fmc_Fertilizer,//pl_bes_ferti_s6,
126  fmc_Fertilizer,//pl_bes_ferti_p7,
127  fmc_Fertilizer,//pl_bes_ferti_s7,
128  fmc_Harvest,//pl_bes_harvest,
129  fmc_Fertilizer,//pl_bes_ferti_p8,
130  fmc_Fertilizer//pl_bes_ferti_s8,
131 
132  };
133  // Iterate over the catlist elements and copy them to vector
134  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
135 
136  }
137 };
138 
139 #endif // PLBEETSPR_H
140 
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
PLBeetSpr::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: PLBeetSpr.h:93
pl_bes_herbicide4
Definition: PLBeetSpr.h:61
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
Farm::PreseedingCultivator
virtual bool PreseedingCultivator(LE *a_field, double a_user, int a_days)
Carry out preseeding cultivation on a_field (tilling set including cultivator and string roller to co...
Definition: FarmFuncs.cpp:312
LE::SetMDates
void SetMDates(int a, int b, int c)
Definition: Elements.h:406
PL_BES_HERBI1
#define PL_BES_HERBI1
Definition: PLBeetSpr.h:31
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
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
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::GetMConstants
int GetMConstants(int a)
Definition: Elements.h:407
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
Calendar::GetYearNumber
int GetYearNumber(void)
Definition: Calendar.h:72
pl_bes_spring_plough
Definition: PLBeetSpr.h:43
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
LE::GetPoly
int GetPoly(void)
Returns the polyref number for this polygon.
Definition: Elements.h:238
cfg_pest_beet_on
CfgBool cfg_pest_beet_on
Turn on pesticides for beet.
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
PL_BES_WATER_DATE
#define PL_BES_WATER_DATE
Definition: PLBeetSpr.h:29
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
Farm::GetPreviousTov
TTypesOfVegetation GetPreviousTov(int a_index)
Definition: Farm.h:966
pl_bes_watering2
Definition: PLBeetSpr.h:56
PLBeetSpr
PLBeetSpr class .
Definition: PLBeetSpr.h:84
PL_BES_HERBI3
#define PL_BES_HERBI3
Definition: PLBeetSpr.h:32
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
pl_bes_heavy_cultivator
Definition: PLBeetSpr.h:49
cfg_BES_InsecticideMonth
CfgInt cfg_BES_InsecticideMonth
pl_bes_ferti_s5
Definition: PLBeetSpr.h:48
Farm::GetType
TTypesOfFarm GetType(void)
Definition: Farm.h:956
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
pl_bes_watering1
Definition: PLBeetSpr.h:55
l_pest_insecticide_amount
CfgFloat l_pest_insecticide_amount
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
pl_bes_ferti_s6
Definition: PLBeetSpr.h:66
Crop
The base class for all crops.
Definition: Farm.h:495
Farm::FP_PK
virtual bool FP_PK(LE *a_field, double a_user, int a_days)
Apply PK fertilizer, on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:673
CfgBool::value
bool value() const
Definition: Configurator.h:164
PLBEETSPR_BASE
#define PLBEETSPR_BASE
Definition: PLBeetSpr.h:24
PL_BES_HERBI_DATE
#define PL_BES_HERBI_DATE
Definition: PLBeetSpr.h:30
pl_bes_ferti_p6
Definition: PLBeetSpr.h:65
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
pl_bes_insecticide
Definition: PLBeetSpr.h:64
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
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.
pl_bes_herbicide1
Definition: PLBeetSpr.h:58
pl_bes_start
Definition: PLBeetSpr.h:41
pl_bes_spring_sow
Definition: PLBeetSpr.h:52
Calendar::Date
long Date(void)
Definition: Calendar.h:57
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
pl_bes_watering3
Definition: PLBeetSpr.h:57
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
Farm::FA_Calcium
virtual bool FA_Calcium(LE *a_field, double a_user, int a_days)
Calcium applied on a_field owned by a stock farmer.
Definition: FarmFuncs.cpp:1168
pl_bes_ferti_p7
Definition: PLBeetSpr.h:67
fmc_Watering
Definition: LandscapeFarmingEnums.h:1011
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
pl_bes_ferti_p5
Definition: PLBeetSpr.h:47
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
CfgArray_Double
Definition: Configurator.h:208
Farm::FP_Calcium
virtual bool FP_Calcium(LE *a_field, double a_user, int a_days)
Calcium applied on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:954
LE::GetRotIndex
int GetRotIndex(void)
Definition: Elements.h:373
PLBeetSprToDo
PLBeetSprToDo
Definition: PLBeetSpr.h:40
pl_bes_preseeding_cultivator_sow
Definition: PLBeetSpr.h:51
pl_bes_sleep_all_day
Definition: PLBeetSpr.h:42
cfg_seedcoating_product_amounts
CfgArray_Double cfg_seedcoating_product_amounts
Amount of seed coating pesticide applied in grams of active substance per hectare for each of the 10 ...
pl_bes_ferti_p4
Definition: PLBeetSpr.h:45
pl_bes_herbicide2
Definition: PLBeetSpr.h:59
pl_bes_fungicide1
Definition: PLBeetSpr.h:62
pl_bes_thinning
Definition: PLBeetSpr.h:54
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
pl_bes_ferti_s7
Definition: PLBeetSpr.h:68
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
Farm::PreseedingCultivatorSow
virtual bool PreseedingCultivatorSow(LE *a_field, double a_user, int a_days, double a_seed_coating_amount=-1, PlantProtectionProducts a_ppp=ppp_foobar)
Carry out preseeding cultivation together with sow on a_field (tilling and sowing set including culti...
Definition: FarmFuncs.cpp:325
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
LE::GetGreenBiomass
virtual double GetGreenBiomass(void)
Definition: Elements.h:160
pl_bes_ferti_p8
Definition: PLBeetSpr.h:70
TTypesOfCrops
TTypesOfCrops
Definition: LandscapeFarmingEnums.h:781
pl_bes_harvest
Definition: PLBeetSpr.h:69
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
tof_OptimisingFarm
Definition: LandscapeFarmingEnums.h:696
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
pl_bes_spring_harrow
Definition: PLBeetSpr.h:44
cfg_seedcoating_beet_on
CfgBool cfg_seedcoating_beet_on
Turn on seed coating for beet.
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
pl_bes_foobar
Definition: PLBeetSpr.h:72
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
PLBeetSpr::PLBeetSpr
PLBeetSpr(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: PLBeetSpr.h:88
pl_bes_ferti_s8
Definition: PLBeetSpr.h:71
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
pl_bes_harrow_before_emergence
Definition: PLBeetSpr.h:53
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
pl_bes_ferti_s4
Definition: PLBeetSpr.h:46
LE::GetOwner
Farm * GetOwner(void)
Definition: Elements.h:256
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
pl_bes_herbicide3
Definition: PLBeetSpr.h:60
pl_bes_preseeding_cultivator
Definition: PLBeetSpr.h:50
Farm::FA_PK
virtual bool FA_PK(LE *a_field, double a_user, int a_days)
Apply PK fertilizer to a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1010
PL_BES_SPRING_FERTI
#define PL_BES_SPRING_FERTI
A flag used to indicate autumn ploughing status.
Definition: PLBeetSpr.h:28
PLBeetSpr::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: PLBeetSpr.cpp:65
cfg_BES_InsecticideDay
CfgInt cfg_BES_InsecticideDay
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
tov_PLBeetSpr
Definition: LandscapeFarmingEnums.h:248
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
Farm::HeavyCultivatorAggregate
virtual bool HeavyCultivatorAggregate(LE *a_field, double a_user, int a_days)
Carry out a heavy cultivation event on a_field. This is non-inversion type of cultivation which can b...
Definition: FarmFuncs.cpp:259
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
pl_bes_fungicide2
Definition: PLBeetSpr.h:63
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
Farm::SpringHarrow
virtual bool SpringHarrow(LE *a_field, double a_user, int a_days)
Carry out a harrow event in the spring on a_field.
Definition: FarmFuncs.cpp:459
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