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
FI_OFabaBean.h
Go to the documentation of this file.
1 
46 #ifndef FI_OFABABEAN_MALT_H
47 #define FI_OFABABEAN_MALT_H
48 
49 #define FI_OFB_BASE 72800
50 
53 #define FI_OFB_AUTUMN_PLOUGH a_field->m_user[1]
54 #define FI_OFB_DECIDE_TO_HERB a_field->m_user[2]
55 #define FI_OFB_DECIDE_TO_FI a_field->m_user[3]
56 
57 
63 typedef enum {
64  fi_ofb_start = 1, // Compulsory, must always be 1 (one).
79 
80 
89 class FI_OFabaBean : public Crop
90 {
91  public:
92  virtual bool Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev );
93  FI_OFabaBean(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape* a_L) : Crop(a_tov, a_toc, a_L)
94  {
95  // When we start it off, the first possible date for a farm operation is 1st October
96  // This information is used by other crops when they decide how much post processing of
97  // the management is allowed after harvest before the next crop starts.
98  m_first_date=g_date->DayInYear( 1,12 );
100  }
102  const int elements = 2 + (fi_ofb_foobar - FI_OFB_BASE);
104 
105  FarmManagementCategory catlist[elements] =
106  {
107  fmc_Others, // zero element unused but must be here
108  fmc_Others, // fi_ofb_start = 1, // Compulsory, must always be 1 (one).
109  fmc_Others, // fi_ofb_sleep_all_day = FI_OFB_BASE,
110  fmc_Cultivation, // fi_ofb_stubble_cultivator1,
111  fmc_Cultivation, // fi_ofb_autumn_plough1,
112  fmc_Cultivation, // fi_ofb_spring_plough,
113  fmc_Cultivation, // fi_ofb_preseeding_cultivation,
114  fmc_Cultivation, // fi_ofb_preseeding_sow,
115  fmc_Others, // fi_ofb_sow,
116  fmc_Fertilizer, // fi_ofb_fertilizer,
117  fmc_Cultivation, // fi_ofb_harrow,
118  fmc_Harvest, // fi_ofb_harvest,
119  fmc_Cultivation, // fi_ofb_stubble_cultivator2,
120  fmc_Cultivation // fi_ofb_autumn_plough2,
121 
122 
123  // no foobar entry
124 
125  };
126  // Iterate over the catlist elements and copy them to vector
127  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
128 
129  }
130 };
131 
132 #endif // FI_OFABABEAN_H
133 
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
fi_ofb_autumn_plough2
Definition: FI_OFabaBean.h:76
fi_ofb_fertilizer
Definition: FI_OFabaBean.h:72
FI_OFB_DECIDE_TO_FI
#define FI_OFB_DECIDE_TO_FI
Definition: FI_OFabaBean.h:55
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
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_OFabaBean
FI_OFabaBean class .
Definition: FI_OFabaBean.h:89
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
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
FI_OFB_BASE
#define FI_OFB_BASE
Definition: FI_OFabaBean.h:49
FI_OFabaBean::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: FI_OFabaBean.h:101
fi_ofb_preseeding_cultivation
Definition: FI_OFabaBean.h:69
LE::GetPoly
int GetPoly(void)
Returns the polyref number for this polygon.
Definition: Elements.h:238
cfg_FI_OFabaBean_SkScrapes
CfgBool cfg_FI_OFabaBean_SkScrapes("DK_CROP_OFB_SK_SCRAPES", CFG_CUSTOM, false)
FI_OFabaBeanToDo
FI_OFabaBeanToDo
Definition: FI_OFabaBean.h:63
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
fi_ofb_spring_plough
Definition: FI_OFabaBean.h:68
FI_OFabaBean::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_OFabaBean.cpp:87
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_ofb_harvest
Definition: FI_OFabaBean.h:74
fi_ofb_stubble_cultivator2
Definition: FI_OFabaBean.h:75
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
FarmEvent::m_startday
int m_startday
Definition: Farm.h:385
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
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
FI_OFB_AUTUMN_PLOUGH
#define FI_OFB_AUTUMN_PLOUGH
A flag used to indicate autumn ploughing status.
Definition: FI_OFabaBean.h:53
fi_ofb_foobar
Definition: FI_OFabaBean.h:77
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
fi_ofb_preseeding_sow
Definition: FI_OFabaBean.h:70
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
CfgBool
Bool configurator entry class.
Definition: Configurator.h:155
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
fi_ofb_stubble_cultivator1
Definition: FI_OFabaBean.h:66
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
fi_ofb_sleep_all_day
Definition: FI_OFabaBean.h:65
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
FarmEvent::m_next_tov
TTypesOfVegetation m_next_tov
Definition: Farm.h:390
fi_ofb_autumn_plough1
Definition: FI_OFabaBean.h:67
Crop::m_farm
Farm * m_farm
Definition: Farm.h:498
Crop::m_field
LE * m_field
Definition: Farm.h:499
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
FI_OFabaBean::FI_OFabaBean
FI_OFabaBean(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: FI_OFabaBean.h:93
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_OFB_DECIDE_TO_HERB
#define FI_OFB_DECIDE_TO_HERB
Definition: FI_OFabaBean.h:54
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
fi_ofb_harrow
Definition: FI_OFabaBean.h:73
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_ofb_start
Definition: FI_OFabaBean.h:64
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
WARN_BUG
Definition: MapErrorMsg.h:34
fi_ofb_sow
Definition: FI_OFabaBean.h:71
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