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
NLCatchCropPea.h
Go to the documentation of this file.
1 
13 //
14 // NLCatchCropPea.h
15 //
16 
17 
18 #ifndef NLCatchCropPea_H
19 #define NLCatchCropPea_H
20 
21 #define NLCatchCropPea_BASE 20800
22 
28 typedef enum {
29  nl_ccp_start = 1, // Compulsory, must always be 1 (one).
42 
43 
52 class NLCatchCropPea: public Crop
53 {
54  public:
55  virtual bool Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev );
56  NLCatchCropPea(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape* a_L) : Crop(a_tov, a_toc, a_L)
57  {
61  m_first_date=g_date->DayInYear( 15,10 );
64  }
66  const int elements = 2 + (nl_ccp_foobar - NLCatchCropPea_BASE);
68 
69  FarmManagementCategory catlist[elements] =
70  {
71  fmc_Others, // zero element unused but must be here
72  fmc_Others,//nl_ccp_start = 1, // Compulsory, must always be 1 (one).
73  fmc_Others,//nl_ccp_sleep_all_day = NLCatchCropPea_BASE,
74  fmc_Cultivation,//nl_ccp_stubble_cultivator,
75  fmc_Fertilizer,//nl_ccp_ferti_p1,
76  fmc_Fertilizer,//nl_ccp_ferti_s1,
77  fmc_Cultivation,//nl_ccp_preseeding_cultivator_with_sow,
78  fmc_Fertilizer,//nl_ccp_ferti_p2_clay,
79  fmc_Fertilizer,//nl_ccp_ferti_s2_clay,
80  fmc_Cultivation,//nl_ccp_winter_plough_clay,
81  fmc_Fertilizer,//nl_ccp_ferti_p2_sandy,
82  fmc_Fertilizer//nl_ccp_ferti_s2_sandy,
83 
84  };
85  // Iterate over the catlist elements and copy them to vector
86  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
87 
88  }
89 };
90 
91 #endif // NLCatchCropPea_H
92 
FarmEvent::m_forcespring
bool m_forcespring
Definition: Farm.h:392
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
NLCatchCropPea::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: NLCatchCropPea.cpp:54
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
NLCatchCropPea
NLCatchCropPea class .
Definition: NLCatchCropPea.h:52
g_farm_fixed_crop_enable
CfgBool g_farm_fixed_crop_enable
FarmEvent
A struct to hold the information required to trigger a farm event.
Definition: Farm.h:372
nl_ccp_preseeding_cultivator_with_sow
Definition: NLCatchCropPea.h:34
LE::ClearManagementActionSum
void ClearManagementActionSum()
clears the management action counters
Definition: Elements.h:247
nl_ccp_foobar
Definition: NLCatchCropPea.h:40
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
Farm::FA_Manure
virtual bool FA_Manure(LE *a_field, double a_user, int a_days)
Spread manure on a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:1110
nl_ccp_ferti_s2_clay
Definition: NLCatchCropPea.h:36
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
nl_ccp_ferti_s1
Definition: NLCatchCropPea.h:33
nl_ccp_start
Definition: NLCatchCropPea.h:29
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
Crop
The base class for all crops.
Definition: Farm.h:495
Farm::FP_Manure
virtual bool FP_Manure(LE *a_field, double a_user, int a_days)
Spread manure on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:896
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
nl_ccp_sleep_all_day
Definition: NLCatchCropPea.h:30
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
nl_ccp_ferti_p2_clay
Definition: NLCatchCropPea.h:35
NLCatchCropPea::NLCatchCropPea
NLCatchCropPea(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: NLCatchCropPea.h:56
Calendar::Date
long Date(void)
Definition: Calendar.h:57
nl_ccp_ferti_s2_sandy
Definition: NLCatchCropPea.h:39
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
LE::GetSoilType
int GetSoilType()
Definition: Elements.h:302
CfgBool
Bool configurator entry class.
Definition: Configurator.h:155
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
tocc_Catch
Definition: LandscapeFarmingEnums.h:627
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
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
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
Farm::SleepAllDay
virtual bool SleepAllDay(LE *a_field, double a_user, int a_days)
Nothing to to today on a_field.
Definition: FarmFuncs.cpp:272
TTypesOfCrops
TTypesOfCrops
Definition: LandscapeFarmingEnums.h:781
NLCatchCropPea_BASE
#define NLCatchCropPea_BASE
Definition: NLCatchCropPea.h:21
LE
Definition: Elements.h:86
NLCatchCropPea::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: NLCatchCropPea.h:65
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
nl_ccp_ferti_p2_sandy
Definition: NLCatchCropPea.h:38
NLCatchCropPeaToDo
NLCatchCropPeaToDo
Definition: NLCatchCropPea.h:28
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
nl_ccp_stubble_cultivator
Definition: NLCatchCropPea.h:31
nl_ccp_ferti_p1
Definition: NLCatchCropPea.h:32
Farm
The base class for all farm types.
Definition: Farm.h:755
nl_ccp_winter_plough_clay
Definition: NLCatchCropPea.h:37
Farm::WinterPlough
virtual bool WinterPlough(LE *a_field, double a_user, int a_days)
Carry out a ploughing event in the winter on a_field.
Definition: FarmFuncs.cpp:395
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
Crop::SetCropClassification
void SetCropClassification(int a_classification)
Definition: Farm.h:549
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
tov_NLCatchCropPea
Definition: LandscapeFarmingEnums.h:268
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
Crop::SimpleEvent_
void SimpleEvent_(long a_date, int a_todo, bool a_lock, Farm *a_farm, LE *a_field)
Adds an event to this crop management without relying on member variables.
Definition: Farm.cpp:751