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
FI_OTurnipRape.h
Go to the documentation of this file.
1 
46 #ifndef FI_OTURNIPRAPE_H
47 #define FI_OTURNIPRAPE_H
48 
49 #define FI_OTR_BASE 71000
50 
53 #define FI_OTR_AUTUMN_PLOUGH a_field->m_user[1]
54 #define FI_OTR_DECIDE_TO_HERB a_field->m_user[2]
55 #define FI_OTR_DECIDE_TO_FI a_field->m_user[3]
56 
57 
63 typedef enum {
64  fi_otr_start = 1, // Compulsory, must always be 1 (one).
80 
81 
90 class FI_OTurnipRape : public Crop
91 {
92 public:
93  virtual bool Do(Farm* a_farm, LE* a_field, FarmEvent* a_ev);
94  FI_OTurnipRape(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape* a_L) : Crop(a_tov, a_toc, a_L)
95  {
96  // When we start it off, the first possible date for a farm operation is 1st October
97  // This information is used by other crops when they decide how much post processing of
98  // the management is allowed after harvest before the next crop starts.
99  m_first_date = g_date->DayInYear(1, 12);
101  }
103  const int elements = 2 + (fi_otr_foobar - FI_OTR_BASE);
105 
106  FarmManagementCategory catlist[elements] =
107  {
108  fmc_Others, // zero element unused but must be here
109  fmc_Others, // fi_otr_start = 1, // Compulsory, must always be 1 (one).
110  fmc_Others, // fi_otr_sleep_all_day = FI_OTR_BASE,
111  fmc_Cultivation, // fi_otr_stubble_cultivator1,
112  fmc_Cultivation, // fi_otr_autumn_plough,
113  fmc_Fertilizer, // fi_otr_slurry,
114  fmc_Cultivation, // fi_otr_spring_plough,
115  fmc_Cultivation, // fi_otr_preseeding_cultivation,
116  fmc_Cultivation, // fi_otr_preseeding_sow,
117  fmc_Others, // fi_otr_sow,
118  fmc_Fertilizer, // fi_otr_fertilizer,
119  fmc_Cultivation, // fi_otr_harrow,
120  fmc_Harvest, // fi_otr_harvest,
121  fmc_Cultivation, // fi_otr_stubble_cultivator2,
122  fmc_Cultivation // fi_otr_autumn_plough2,
123 
124 
125  // no foobar entry
126 
127  };
128  // Iterate over the catlist elements and copy them to vector
129  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
130 
131  }
132 };
133 
134 #endif // FI_OTURNIPRAPE_H
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
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
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::Harvest
virtual bool Harvest(LE *a_field, double a_user, int a_days)
Carry out a harvest on a_field.
Definition: FarmFuncs.cpp:1364
FI_OTR_BASE
#define FI_OTR_BASE
Definition: FI_OTurnipRape.h:49
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
Farm::StubbleCultivatorHeavy
virtual bool StubbleCultivatorHeavy(LE *a_field, double a_user, int a_days)
Carry out a stubble cultivation event on a_field. This is non-inversion type of cultivation which can...
Definition: FarmFuncs.cpp:245
FarmEvent
A struct to hold the information required to trigger a farm event.
Definition: Farm.h:372
fi_otr_slurry
Definition: FI_OTurnipRape.h:68
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
FI_OTurnipRape
FI_OTurnipRape class .
Definition: FI_OTurnipRape.h:90
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
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
fi_otr_spring_plough
Definition: FI_OTurnipRape.h:69
fi_otr_harrow
Definition: FI_OTurnipRape.h:74
Farm::GetPreviousTov
TTypesOfVegetation GetPreviousTov(int a_index)
Definition: Farm.h:966
Farm::GetType
TTypesOfFarm GetType(void)
Definition: Farm.h:956
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
FI_OTurnipRape::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: FI_OTurnipRape.h:102
fi_otr_autumn_plough2
Definition: FI_OTurnipRape.h:77
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
FarmEvent::m_startday
int m_startday
Definition: Farm.h:385
fi_otr_sleep_all_day
Definition: FI_OTurnipRape.h:65
fi_otr_fertilizer
Definition: FI_OTurnipRape.h:73
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
CfgBool::value
bool value() const
Definition: Configurator.h:164
FI_OTR_AUTUMN_PLOUGH
#define FI_OTR_AUTUMN_PLOUGH
A flag used to indicate autumn ploughing status.
Definition: FI_OTurnipRape.h:53
fi_otr_sow
Definition: FI_OTurnipRape.h:72
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
fi_otr_autumn_plough
Definition: FI_OTurnipRape.h:67
fi_otr_harvest
Definition: FI_OTurnipRape.h:75
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
fi_otr_stubble_cultivator1
Definition: FI_OTurnipRape.h:66
fi_otr_preseeding_sow
Definition: FI_OTurnipRape.h:71
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
FI_OTR_DECIDE_TO_FI
#define FI_OTR_DECIDE_TO_FI
Definition: FI_OTurnipRape.h:55
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
LE::GetRotIndex
int GetRotIndex(void)
Definition: Elements.h:373
fi_otr_start
Definition: FI_OTurnipRape.h:64
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
FI_OTurnipRapeToDo
FI_OTurnipRapeToDo
Definition: FI_OTurnipRape.h:63
FI_OTurnipRape::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: FI_OTurnipRape.cpp:87
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
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
cfg_FI_OTurnipRape_SkScrapes
CfgBool cfg_FI_OTurnipRape_SkScrapes("DK_CROP_OTR_SK_SCRAPES", CFG_CUSTOM, false)
TTypesOfCrops
TTypesOfCrops
Definition: LandscapeFarmingEnums.h:781
tof_OptimisingFarm
Definition: LandscapeFarmingEnums.h:696
LE
Definition: Elements.h:86
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::SpringSowWithFerti
virtual bool SpringSowWithFerti(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 with start fertilizer in the spring on a_field.
Definition: FarmFuncs.cpp:537
fi_otr_preseeding_cultivation
Definition: FI_OTurnipRape.h:70
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
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
CFG_CUSTOM
Definition: Configurator.h:70
LE::GetOwner
Farm * GetOwner(void)
Definition: Elements.h:256
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
fi_otr_foobar
Definition: FI_OTurnipRape.h:78
FI_OTR_DECIDE_TO_HERB
#define FI_OTR_DECIDE_TO_HERB
Definition: FI_OTurnipRape.h:54
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
FI_OTurnipRape::FI_OTurnipRape
FI_OTurnipRape(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: FI_OTurnipRape.h:94
fi_otr_stubble_cultivator2
Definition: FI_OTurnipRape.h:76
WARN_BUG
Definition: MapErrorMsg.h:34
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
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