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
FR_Sorghum.h
Go to the documentation of this file.
1 
46 #ifndef FR_SORGHUM_H
47 #define FR_SORGHUM_H
48 
49 #define FR_S_EVERY_4_YEAR a_field->m_user[1]
50 
51 #define FR_S_BASE 191300
52 
61 typedef enum {
62  fr_s_start = 1, // Compulsory, must always be 1 (one).
83 
84 
93 class FR_Sorghum : public Crop
94 {
95  public:
96  virtual bool Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev );
97  FR_Sorghum(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape* a_L) : Crop(a_tov, a_toc, a_L)
98  {
99  // When we start it off, the first possible date for a farm operation is 1st October
100  // This information is used by other crops when they decide how much post processing of
101  // the management is allowed after harvest before the next crop starts.
102  m_first_date=g_date->DayInYear( 1,12 );
104  }
106  const int elements = 2 + (fr_s_foobar - FR_S_BASE);
108 
109  FarmManagementCategory catlist[elements] =
110  {
111  fmc_Others, // zero element unused but must be here
112  fmc_Others, //fr_s_start = 1, // Compulsory, must always be 1 (one).
113  fmc_Others, //fr_s_sleep_all_day = FR_S_BASE,
114  fmc_Cultivation, //fr_s_autumn_plough,
115  fmc_Fertilizer, //fr_s_fertilizer1,
116  fmc_Cultivation, // fr_s_stubble_harrow,
117  fmc_Cultivation, // fr_s_stubble_plough,
118  fmc_Cultivation, // fr_s_harrow1,
119  fmc_Cultivation, // fr_s_spring_plough,
120  fmc_Cultivation, // fr_s_false_seedbed1,
121  fmc_Cultivation, // fr_s_false_seedbed2,
122  fmc_Cultivation, // fr_s_false_seedbed3,
123  fmc_Cultivation, // fr_s_spring_harrow,
124  fmc_Cultivation, // fr_s_preseeding_sow,
125  fmc_Fertilizer, //fr_s_n,
126  fmc_Cultivation, // fr_s_harrow2,
127  fmc_Herbicide, //fr_s_herbicide1,
128  fmc_Herbicide, //fr_s_herbicide2,
129  fmc_Cultivation, // fr_s_row_cultivation,
130  fmc_Harvest, //fr_s_harvest,
131 
132 
133  // no foobar entry
134 
135  };
136  // Iterate over the catlist elements and copy them to vector
137  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
138 
139  }
140 };
141 
142 #endif // FR_SORGHUM_H
143 
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
l_pest_insecticide_amount
CfgFloat l_pest_insecticide_amount
fr_s_harrow2
Definition: FR_Sorghum.h:76
LE::SetMDates
void SetMDates(int a, int b, int c)
Definition: Elements.h:406
Farm::HerbicideTreat
virtual bool HerbicideTreat(LE *a_field, double a_user, int a_days)
Apply herbicide to a_field.
Definition: FarmFuncs.cpp:2025
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
cfg_fungi_app_prop1
CfgFloat cfg_fungi_app_prop1
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
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.
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
Calendar::GetYearNumber
int GetYearNumber(void)
Definition: Calendar.h:72
cfg_ins_app_prop3
CfgFloat cfg_ins_app_prop3
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
Farm::StubblePlough
virtual bool StubblePlough(LE *a_field, double a_user, int a_days)
Carry out a stubble ploughing event on a_field. This is similar to normal plough but shallow (normall...
Definition: FarmFuncs.cpp:232
LE::GetPoly
int GetPoly(void)
Returns the polyref number for this polygon.
Definition: Elements.h:238
fr_s_row_cultivation
Definition: FR_Sorghum.h:79
FR_Sorghum
FR_Sorghum class .
Definition: FR_Sorghum.h:93
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
FR_Sorghum::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: FR_Sorghum.cpp:98
cfg_FR_Sorghum_SkScrapes
CfgBool cfg_FR_Sorghum_SkScrapes("FR_CROP_S_SK_SCRAPES", CFG_CUSTOM, false)
cfg_herbi_app_prop
CfgFloat cfg_herbi_app_prop
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
fr_s_false_seedbed2
Definition: FR_Sorghum.h:71
fr_s_herbicide1
Definition: FR_Sorghum.h:77
Farm::GetPreviousTov
TTypesOfVegetation GetPreviousTov(int a_index)
Definition: Farm.h:966
cfg_ins_app_prop1
CfgFloat cfg_ins_app_prop1
Farm::GetType
TTypesOfFarm GetType(void)
Definition: Farm.h:956
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
fr_s_sleep_all_day
Definition: FR_Sorghum.h:63
cfg_fungi_app_prop2
CfgFloat cfg_fungi_app_prop2
fr_s_preseeding_sow
Definition: FR_Sorghum.h:74
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
FarmEvent::m_startday
int m_startday
Definition: Farm.h:385
FR_Sorghum::FR_Sorghum
FR_Sorghum(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: FR_Sorghum.h:97
fr_s_harrow1
Definition: FR_Sorghum.h:68
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
cfg_pest_Sorghum_on
CfgBool cfg_pest_Sorghum_on
CfgBool::value
bool value() const
Definition: Configurator.h:164
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
fr_s_n
Definition: FR_Sorghum.h:75
fr_s_fertilizer1
Definition: FR_Sorghum.h:65
fr_s_stubble_plough
Definition: FR_Sorghum.h:67
cfg_S_InsecticideMonth
CfgInt cfg_S_InsecticideMonth
LE::m_skylarkscrapes
bool m_skylarkscrapes
For management testing of skylark scrapes.
Definition: Elements.h:95
Calendar::Date
long Date(void)
Definition: Calendar.h:57
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
CfgBool
Bool configurator entry class.
Definition: Configurator.h:155
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
FR_S_EVERY_4_YEAR
#define FR_S_EVERY_4_YEAR
Definition: FR_Sorghum.h:49
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
fr_s_spring_plough
Definition: FR_Sorghum.h:69
cfg_S_InsecticideDay
CfgInt cfg_S_InsecticideDay
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
LE::GetRotIndex
int GetRotIndex(void)
Definition: Elements.h:373
fr_s_false_seedbed1
Definition: FR_Sorghum.h:70
fr_s_start
Definition: FR_Sorghum.h:62
fr_s_stubble_harrow
Definition: FR_Sorghum.h:66
FarmEvent::m_next_tov
TTypesOfVegetation m_next_tov
Definition: Farm.h:390
FR_S_BASE
#define FR_S_BASE
Definition: FR_Sorghum.h:51
cfg_greg_app_prop
CfgFloat cfg_greg_app_prop
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
fr_s_herbicide2
Definition: FR_Sorghum.h:78
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
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
TTypesOfCrops
TTypesOfCrops
Definition: LandscapeFarmingEnums.h:781
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
fr_s_foobar
Definition: FR_Sorghum.h:81
LE
Definition: Elements.h:86
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
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
fr_s_autumn_plough
Definition: FR_Sorghum.h:64
Farm
The base class for all farm types.
Definition: Farm.h:755
CfgFloat
Double configurator entry class.
Definition: Configurator.h:126
fr_s_harvest
Definition: FR_Sorghum.h:80
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
CFG_CUSTOM
Definition: Configurator.h:70
fr_s_spring_harrow
Definition: FR_Sorghum.h:73
LE::GetOwner
Farm * GetOwner(void)
Definition: Elements.h:256
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
FR_SorghumToDo
FR_SorghumToDo
A flag used to indicate autumn ploughing status.
Definition: FR_Sorghum.h:61
cfg_ins_app_prop2
CfgFloat cfg_ins_app_prop2
FR_Sorghum::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: FR_Sorghum.h:105
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
fr_s_false_seedbed3
Definition: FR_Sorghum.h:72
WARN_BUG
Definition: MapErrorMsg.h:34
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::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