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_OSpringBarley_Fodder.h
Go to the documentation of this file.
1 
46 #ifndef FI_OSPRINGBARLEY_FODDER_H
47 #define FI_OSPRINGBARLEY_FODDER_H
48 
49 #define FI_OSBF_BASE 73000
50 
53 #define FI_OSBF_AUTUMN_PLOUGH a_field->m_user[1]
54 #define FI_OSBF_DECIDE_TO_HERB a_field->m_user[2]
55 #define FI_OSBF_DECIDE_TO_FI a_field->m_user[3]
56 
57 
63 typedef enum {
64  fi_osbf_start = 1, // Compulsory, must always be 1 (one).
81 
82 
92 {
93  public:
94  virtual bool Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev );
95  FI_OSpringBarley_Fodder(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 1st October
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( 15,10 );
102  }
104  const int elements = 2 + (fi_osbf_foobar - FI_OSBF_BASE);
106 
107  FarmManagementCategory catlist[elements] =
108  {
109  fmc_Others, // zero element unused but must be here
110  fmc_Others, // fi_osbf_start = 1, // Compulsory, must always be 1 (one).
111  fmc_Others, // fi_osbf_sleep_all_day = FI_OSBF_BASE,
112  fmc_Cultivation, // fi_osbf_stubble_cultivator1,
113  fmc_Cultivation, // fi_osbf_autumn_plough,
114  fmc_Cultivation, // fi_osbf_spring_plough,
115  fmc_Fertilizer, // fi_osbf_slurry,
116  fmc_Cultivation, // fi_osbf_preseeding_cultivation,
117  fmc_Cultivation, // fi_osbf_preseeding_sow,
118  fmc_Others, // fi_osbf_sow,
119  fmc_Fertilizer, // fi_osbf_fertilizer,
120  fmc_Cultivation, // fi_osbf_harrow,
121  fmc_Harvest, // fi_osbf_harvest,
122  fmc_Others, // fi_osbf_straw_chopping,
123  fmc_Others, // fi_osbf_hay_bailing,
124  fmc_Cultivation // fi_osbf_stubble_cultivator2,
125 
126 
127  // no foobar entry
128 
129  };
130  // Iterate over the catlist elements and copy them to vector
131  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
132 
133  }
134 };
135 
136 #endif // FI_OSPRINGBARLEY_FODDER_H
137 
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
Farm::FA_Slurry
virtual bool FA_Slurry(LE *a_field, double a_user, int a_days)
Spready slurry on a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1067
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::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::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_osbf_preseeding_sow
Definition: FI_OSpringBarley_Fodder.h:71
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
LE::GetPoly
int GetPoly(void)
Returns the polyref number for this polygon.
Definition: Elements.h:238
FI_OSpringBarley_Fodder::FI_OSpringBarley_Fodder
FI_OSpringBarley_Fodder(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: FI_OSpringBarley_Fodder.h:95
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
FI_OSBF_DECIDE_TO_FI
#define FI_OSBF_DECIDE_TO_FI
Definition: FI_OSpringBarley_Fodder.h:55
Farm::GetPreviousTov
TTypesOfVegetation GetPreviousTov(int a_index)
Definition: Farm.h:966
fi_osbf_sow
Definition: FI_OSpringBarley_Fodder.h:72
Farm::GetType
TTypesOfFarm GetType(void)
Definition: Farm.h:956
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
fi_osbf_sleep_all_day
Definition: FI_OSpringBarley_Fodder.h:65
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
FI_OSBF_AUTUMN_PLOUGH
#define FI_OSBF_AUTUMN_PLOUGH
A flag used to indicate autumn ploughing status.
Definition: FI_OSpringBarley_Fodder.h:53
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
FI_OSBF_DECIDE_TO_HERB
#define FI_OSBF_DECIDE_TO_HERB
Definition: FI_OSpringBarley_Fodder.h:54
fi_osbf_stubble_cultivator1
Definition: FI_OSpringBarley_Fodder.h:66
FI_OSpringBarley_Fodder
FI_OSpringBarley_Fodder class .
Definition: FI_OSpringBarley_Fodder.h:91
FI_OSBF_BASE
#define FI_OSBF_BASE
Definition: FI_OSpringBarley_Fodder.h:49
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_osbf_slurry
Definition: FI_OSpringBarley_Fodder.h:69
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
CfgBool
Bool configurator entry class.
Definition: Configurator.h:155
Farm::HayBailing
virtual bool HayBailing(LE *a_field, double a_user, int a_days)
Carry out hay bailing on a_field.
Definition: FarmFuncs.cpp:1507
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
Farm::StrawChopping
virtual bool StrawChopping(LE *a_field, double a_user, int a_days)
Carry out straw chopping on a_field.
Definition: FarmFuncs.cpp:1475
fi_osbf_spring_plough
Definition: FI_OSpringBarley_Fodder.h:68
fi_osbf_preseeding_cultivation
Definition: FI_OSpringBarley_Fodder.h:70
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
LE::GetRotIndex
int GetRotIndex(void)
Definition: Elements.h:373
cfg_FI_OSpringBarley_Fodder_SkScrapes
CfgBool cfg_FI_OSpringBarley_Fodder_SkScrapes("DK_CROP_OSBF_SK_SCRAPES", CFG_CUSTOM, false)
FarmEvent::m_next_tov
TTypesOfVegetation m_next_tov
Definition: Farm.h:390
fi_osbf_stubble_cultivator2
Definition: FI_OSpringBarley_Fodder.h:78
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
fi_osbf_fertilizer
Definition: FI_OSpringBarley_Fodder.h:73
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_osbf_straw_chopping
Definition: FI_OSpringBarley_Fodder.h:76
fi_osbf_foobar
Definition: FI_OSpringBarley_Fodder.h:79
fi_osbf_harrow
Definition: FI_OSpringBarley_Fodder.h:74
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
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
FI_OSpringBarley_FodderToDo
FI_OSpringBarley_FodderToDo
Definition: FI_OSpringBarley_Fodder.h:63
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_osbf_start
Definition: FI_OSpringBarley_Fodder.h:64
FI_OSpringBarley_Fodder::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_OSpringBarley_Fodder.cpp:87
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
fi_osbf_hay_bailing
Definition: FI_OSpringBarley_Fodder.h:77
fi_osbf_harvest
Definition: FI_OSpringBarley_Fodder.h:75
FI_OSpringBarley_Fodder::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: FI_OSpringBarley_Fodder.h:103
WARN_BUG
Definition: MapErrorMsg.h:34
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
fi_osbf_autumn_plough
Definition: FI_OSpringBarley_Fodder.h:67
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