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_OSpringOats.h
Go to the documentation of this file.
1 
46 #ifndef FI_OSPRINGOATS_H
47 #define FI_OSPRINGOATS_H
48 
49 #define FI_OSO_BASE 72400
50 
53 #define FI_OSO_AUTUMN_PLOUGH a_field->m_user[1]
54 #define FI_OSO_DECIDE_TO_HERB a_field->m_user[2]
55 #define FI_OSO_DECIDE_TO_FI a_field->m_user[3]
56 
57 
63 typedef enum {
64  fi_oso_start = 1, // Compulsory, must always be 1 (one).
80 
81 
90 class FI_OSpringOats: public Crop
91 {
92  public:
93  virtual bool Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev );
94  FI_OSpringOats(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( 15,10 );
101  }
103  const int elements = 2 + (fi_oso_foobar - FI_OSO_BASE);
105 
106  FarmManagementCategory catlist[elements] =
107  {
108  fmc_Others, // zero element unused but must be here
109  fmc_Others, // fi_oso_start = 1, // Compulsory, must always be 1 (one).
110  fmc_Others, // fi_oso_sleep_all_day = FI_OSO_BASE,
111  fmc_Cultivation, // fi_oso_stubble_cultivator1,
112  fmc_Cultivation, // fi_oso_autumn_plough,
113  fmc_Cultivation, // fi_oso_spring_plough,
114  fmc_Cultivation, // fi_oso_preseeding_cultivation,
115  fmc_Cultivation, // fi_oso_preseeding_sow,
116  fmc_Others, // fi_oso_sow,
117  fmc_Fertilizer, // fi_oso_fertilizer,
118  fmc_Cultivation, // fi_oso_harrow,
119  fmc_Harvest, // fi_oso_harvest,
120  fmc_Others, // fi_oso_straw_chopping,
121  fmc_Others, // fi_oso_hay_bailing,
122  fmc_Cultivation // fi_oso_stubble_cultivator2,
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_OSPRINGOATS_H
135 
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
FI_OSO_BASE
#define FI_OSO_BASE
Definition: FI_OSpringOats.h:49
fi_oso_preseeding_sow
Definition: FI_OSpringOats.h:70
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_oso_harrow
Definition: FI_OSpringOats.h:73
fi_oso_harvest
Definition: FI_OSpringOats.h:74
LE::ClearManagementActionSum
void ClearManagementActionSum()
clears the management action counters
Definition: Elements.h:247
fi_oso_preseeding_cultivation
Definition: FI_OSpringOats.h:69
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
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
fi_oso_straw_chopping
Definition: FI_OSpringOats.h:75
Farm::GetPreviousTov
TTypesOfVegetation GetPreviousTov(int a_index)
Definition: Farm.h:966
FI_OSO_DECIDE_TO_FI
#define FI_OSO_DECIDE_TO_FI
Definition: FI_OSpringOats.h:55
Farm::GetType
TTypesOfFarm GetType(void)
Definition: Farm.h:956
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
fi_oso_autumn_plough
Definition: FI_OSpringOats.h:67
fi_oso_start
Definition: FI_OSpringOats.h:64
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
FarmEvent::m_startday
int m_startday
Definition: Farm.h:385
fi_oso_hay_bailing
Definition: FI_OSpringOats.h:76
fi_oso_fertilizer
Definition: FI_OSpringOats.h:72
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
fi_oso_sow
Definition: FI_OSpringOats.h:71
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_oso_stubble_cultivator1
Definition: FI_OSpringOats.h:66
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
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
fi_oso_stubble_cultivator2
Definition: FI_OSpringOats.h:77
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_OSpringOats::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: FI_OSpringOats.h:102
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
FI_OSpringOats::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_OSpringOats.cpp:87
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_OSO_DECIDE_TO_HERB
#define FI_OSO_DECIDE_TO_HERB
Definition: FI_OSpringOats.h:54
FI_OSpringOatsToDo
FI_OSpringOatsToDo
Definition: FI_OSpringOats.h:63
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
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_oso_spring_plough
Definition: FI_OSpringOats.h:68
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_OSO_AUTUMN_PLOUGH
#define FI_OSO_AUTUMN_PLOUGH
A flag used to indicate autumn ploughing status.
Definition: FI_OSpringOats.h:53
Farm
The base class for all farm types.
Definition: Farm.h:755
FI_OSpringOats
FI_OSpringOats class .
Definition: FI_OSpringOats.h:90
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
fi_oso_foobar
Definition: FI_OSpringOats.h:78
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_OSpringOats::FI_OSpringOats
FI_OSpringOats(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: FI_OSpringOats.h:94
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
cfg_FI_OSpringOats_SkScrapes
CfgBool cfg_FI_OSpringOats_SkScrapes("DK_CROP_OSO_SK_SCRAPES", CFG_CUSTOM, false)
fi_oso_sleep_all_day
Definition: FI_OSpringOats.h:65
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