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
DK_Cabbages.h
Go to the documentation of this file.
1 
15 //
16 // DK_Cabbages.h
17 //
18 
19 
20 #ifndef DK_CABBAGES_H
21 #define DK_CABBAGES_H
22 
23 #define DK_CA_BASE 60500
24 
27 #define DK_CA_WINTER_PLOUGH m_field->m_user[1]
28 #define DK_CA_FORCESPRING a_field->m_user[2]
29 
35 typedef enum {
36  dk_ca_start = 1, // Compulsory, must always be 1 (one).
66 
68 
69 
78 class DK_Cabbages: public Crop{
79  public:
80  virtual bool Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev );
81  DK_Cabbages(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape* a_L) : Crop(a_tov, a_toc, a_L)
82  {
83  // When we start it off, the first possible date for a farm operation is ...
84  // This information is used by other crops when they decide how much post processing of
85  // the management is allowed after harvest before the next crop starts.
86  m_first_date=g_date->DayInYear( 1, 12 );
88  }
90  const int elements = 2 + (dk_ca_foobar - DK_CA_BASE);
92 
93  FarmManagementCategory catlist[elements] =
94  {
95  fmc_Others, // zero element unused but must be here
96  fmc_Others, // dk_ca_start = 1, // Compulsory, must always be 1 (one).
97  fmc_Harvest, // dk_ca_harvest = DK_CA_BASE,
98  fmc_Insecticide, // dk_ca_molluscicide1,
99  fmc_Cultivation, // dk_ca_autumn_harrow_clay,
100  fmc_Cultivation, // dk_ca_sharrow1,
101  fmc_Cultivation, // dk_ca_sharrow2,
102  fmc_Cultivation, // dk_ca_sharrow3,
103  fmc_Cultivation, // dk_ca_sharrow4,
104  fmc_Herbicide, // dk_ca_herbicide1,
105  fmc_Others, // dk_ca_plant,
106  fmc_Watering, // dk_ca_water,
107  fmc_Insecticide, // dk_ca_molluscicide2,
108  fmc_Herbicide, // dk_ca_herbicide2,
109  fmc_Cultivation, // dk_ca_strigling1,
110  fmc_Cultivation, // dk_ca_strigling2,
111  fmc_Cultivation, // dk_ca_strigling3,
112  fmc_Herbicide, // dk_ca_herbicide3,
113  fmc_Cultivation, // dk_ca_row_cultivation_clay,
114  fmc_Herbicide, // dk_ca_herbicide4,
115  fmc_Insecticide, // dk_ca_insecticide1,
116  fmc_Insecticide, // dk_ca_insecticide1_2a,
117  fmc_Insecticide, // dk_ca_insecticide1_2b,
118  fmc_Insecticide, // dk_ca_insecticide1_3b,
119  fmc_Cultivation, // dk_ca_manual_weeding,
120  fmc_Fertilizer, // dk_ca_ferti2,
121  fmc_Fungicide, // dk_ca_fungicide1,
122  fmc_Fungicide, // dk_ca_fungicide1_2,
123  fmc_Fungicide, // dk_ca_fungicide1_3,
124  fmc_Others // dk_ca_wait,
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 // DK_CABBAGES_H
135 
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
dk_ca_herbicide2
Definition: DK_Cabbages.h:48
dk_ca_molluscicide1
Definition: DK_Cabbages.h:38
FarmEvent::m_forcespring
bool m_forcespring
Definition: Farm.h:392
fmc_Insecticide
Definition: LandscapeFarmingEnums.h:1005
Farm::HerbicideTreat
virtual bool HerbicideTreat(LE *a_field, double a_user, int a_days)
Apply herbicide to a_field.
Definition: FarmFuncs.cpp:2025
Farm::Strigling
virtual bool Strigling(LE *a_field, double a_user, int a_days)
Carry out a mechanical weeding on a_field.
Definition: FarmFuncs.cpp:1206
dk_ca_water
Definition: DK_Cabbages.h:46
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
dk_ca_ferti2
Definition: DK_Cabbages.h:60
dk_ca_foobar
Definition: DK_Cabbages.h:65
Farm::ProductApplication
virtual bool ProductApplication(LE *a_field, double a_user, int a_days, double a_applicationrate, PlantProtectionProducts a_ppp, bool a_isgranularpesticide=false, int a_orcharddrifttype=0)
Apply test pesticide to a_field.
Definition: FarmFuncs.cpp:2267
dk_ca_fungicide1_3
Definition: DK_Cabbages.h:63
FarmEvent
A struct to hold the information required to trigger a farm event.
Definition: Farm.h:372
dk_ca_start
Definition: DK_Cabbages.h:36
Farm::Molluscicide
virtual bool Molluscicide(LE *a_field, double a_user, int a_days)
Apply molluscicide to a_field.
Definition: FarmFuncs.cpp:2310
tos_SandyClayLoam
Definition: LandscapeFarmingEnums.h:722
DK_CA_BASE
#define DK_CA_BASE
Definition: DK_Cabbages.h:23
dk_ca_row_cultivation_clay
Definition: DK_Cabbages.h:53
Farm::DoIt_prob
bool DoIt_prob(double a_probability)
Return chance out of 0 to 1.
Definition: Farm.cpp:864
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
dk_ca_sharrow3
Definition: DK_Cabbages.h:42
dk_ca_insecticide1_2b
Definition: DK_Cabbages.h:57
tos_SandyLoam
Definition: LandscapeFarmingEnums.h:721
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
dk_ca_plant
Definition: DK_Cabbages.h:45
DK_Cabbages::DK_Cabbages
DK_Cabbages(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: DK_Cabbages.h:81
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
DK_Cabbages
DK_Cabbages class .
Definition: DK_Cabbages.h:78
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
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
dk_ca_sharrow4
Definition: DK_Cabbages.h:43
dk_ca_herbicide4
Definition: DK_Cabbages.h:54
dk_ca_herbicide3
Definition: DK_Cabbages.h:52
cfg_ins_app_prop1
CfgFloat cfg_ins_app_prop1
DK_CA_WINTER_PLOUGH
#define DK_CA_WINTER_PLOUGH
A flag used to indicate autumn ploughing status.
Definition: DK_Cabbages.h:27
cfg_greg_app_prop
CfgFloat cfg_greg_app_prop
dk_ca_sharrow1
Definition: DK_Cabbages.h:40
Calendar::Date
long Date(void)
Definition: Calendar.h:57
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
dk_ca_wait
Definition: DK_Cabbages.h:64
LE::GetSoilType
int GetSoilType()
Definition: Elements.h:302
CfgBool
Bool configurator entry class.
Definition: Configurator.h:155
cfg_herbi_app_prop
CfgFloat cfg_herbi_app_prop
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
dk_ca_fungicide1
Definition: DK_Cabbages.h:61
fmc_Watering
Definition: LandscapeFarmingEnums.h:1011
dk_ca_strigling1
Definition: DK_Cabbages.h:49
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
dk_ca_insecticide1_2a
Definition: DK_Cabbages.h:56
dk_ca_herbicide1
Definition: DK_Cabbages.h:44
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
CfgArray_Double
Definition: Configurator.h:208
dk_ca_strigling3
Definition: DK_Cabbages.h:51
Crop::StartUpCrop
bool StartUpCrop(int a_spring, std::vector< std::vector< int >> a_flexdates, int a_todo)
Holds the translation between the farm operation enum for each cropand the farm management category a...
Definition: Farm.cpp:652
DK_CabbagesToDo
DK_CabbagesToDo
Definition: DK_Cabbages.h:35
Farm::ManualWeeding
virtual bool ManualWeeding(LE *a_field, double a_user, int a_days)
Manual weeding on a_field - no tramlines since weeding by hand, the bush stays on field with same veg...
Definition: FarmFuncs.cpp:2002
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
CfgArray_Double::value
std::vector< double > value() const
Definition: Configurator.h:219
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
Farm::InsecticideTreat
virtual bool InsecticideTreat(LE *a_field, double a_user, int a_days)
Apply insecticide to a_field.
Definition: FarmFuncs.cpp:2135
tos_Sand
Definition: LandscapeFarmingEnums.h:719
Farm::ShallowHarrow
virtual bool ShallowHarrow(LE *a_field, double a_user, int a_days)
Carry out a shallow harrow event on a_field, e.g., after grass cutting event.
Definition: FarmFuncs.cpp:473
dk_ca_insecticide1_3b
Definition: DK_Cabbages.h:58
TTypesOfCrops
TTypesOfCrops
Definition: LandscapeFarmingEnums.h:781
Farm::RowCultivation
virtual bool RowCultivation(LE *a_field, double a_user, int a_days)
Carry out a harrowing between crop rows on a_field.
Definition: FarmFuncs.cpp:1183
LE
Definition: Elements.h:86
Farm::Water
virtual bool Water(LE *a_field, double a_user, int a_days)
Carry out a watering on a_field.
Definition: FarmFuncs.cpp:1330
Crop::m_last_date
int m_last_date
Definition: Farm.h:503
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
DK_CA_FORCESPRING
#define DK_CA_FORCESPRING
Definition: DK_Cabbages.h:28
Farm::AutumnHarrow
virtual bool AutumnHarrow(LE *a_field, double a_user, int a_days)
Carry out a harrow event in the autumn on a_field.
Definition: FarmFuncs.cpp:285
cfg_fungi_app_prop1
CfgFloat cfg_fungi_app_prop1
tov_DKCabbages
Definition: LandscapeFarmingEnums.h:351
dk_ca_harvest
Definition: DK_Cabbages.h:37
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
dk_ca_sharrow2
Definition: DK_Cabbages.h:41
Farm
The base class for all farm types.
Definition: Farm.h:755
cfg_pest_product_amounts
CfgArray_Double cfg_pest_product_amounts
Amount of pesticide applied in grams of active substance per hectare for each of the 10 pesticides.
Crop::m_date_modifier
static int m_date_modifier
Holds a value that shifts test pesticide use by this many days in crops modified to use it.
Definition: Farm.h:514
CfgFloat
Double configurator entry class.
Definition: Configurator.h:126
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
dk_ca_insecticide1
Definition: DK_Cabbages.h:55
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
dk_ca_fungicide1_2
Definition: DK_Cabbages.h:62
dk_ca_manual_weeding
Definition: DK_Cabbages.h:59
dk_ca_strigling2
Definition: DK_Cabbages.h:50
DK_Cabbages::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: DK_Cabbages.h:89
Crop::AphidDamage
bool AphidDamage(LE *a_field)
Compares aphid numbers per m2 with a threshold to return true if threshold is exceeded.
Definition: Farm.cpp:726
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
tos_LoamySand
Definition: LandscapeFarmingEnums.h:720
dk_ca_autumn_harrow_clay
Definition: DK_Cabbages.h:39
DK_Cabbages::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: DK_Cabbages.cpp:64
cfg_pest_cabbage_on
CfgBool cfg_pest_cabbage_on
Turn on pesticides for cabbage.
dk_ca_molluscicide2
Definition: DK_Cabbages.h:47
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001