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
DK_Carrots.h
Go to the documentation of this file.
1 //
2 // DK_Carrots.h
3 //
4 /*
5 *******************************************************************************************************
6 Copyright (c) 2021, Christopher John Topping, Aarhus University - modified by Luna Kondrup Marcussen, Aarhus University
7 All rights reserved.
8 
9 Redistribution and use in source and binary forms, with or without modification, are permitted provided
10 that the following conditions are met:
11 
12 Redistributions of source code must retain the above copyright notice, this list of conditions and the
13 following disclaimer.
14 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
15 the following disclaimer in the documentation and/or other materials provided with the distribution.
16 
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
18 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
19 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
20 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
22 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
24 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25 ********************************************************************************************************
26 */
27 
28 #ifndef DK_CARROTS_H
29 #define DK_CARROTS_H
30 
31 #define DK_CAR_BASE 60600
32 #define DK_CAR_FORCESPRING a_field->m_user[1]
33 
34 typedef enum {
35  dk_car_start = 1, // Compulsory, start event must always be 1 (one).
75 
76 class DK_Carrots: public Crop
77 {
78 public:
79  bool Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev );
80  DK_Carrots(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape* a_L) : Crop(a_tov, a_toc, a_L) {
83  }
85  const int elements = 2 + (dk_car_foobar - DK_CAR_BASE);
87 
88  FarmManagementCategory catlist[elements] =
89  {
90  fmc_Others, // zero element unused but must be here
91  fmc_Others, // dk_car_start = 1, // Compulsory, start event must always be 1 (one).
92  fmc_Cultivation, // dk_car_stoneburier = DK_CAR_BASE,
93  fmc_Herbicide, // dk_car_herbicide1,
94  fmc_Cultivation, // dk_car_deep_harrow,
95  fmc_Cultivation, // dk_car_bedformer,
96  fmc_Cultivation, // dk_car_sharrow1,
97  fmc_Cultivation, // dk_car_sharrow2,
98  fmc_Cultivation, // dk_car_sharrow3,
99  fmc_Cultivation, // dk_car_sharrow4,
100  fmc_Watering, // dk_car_water1,
101  fmc_Fungicide, // dk_car_fungicide1,
102  fmc_Others, // dk_car_sow,
103  fmc_Herbicide, // dk_car_herbicide2,
104  fmc_Herbicide, // dk_car_herbicide3,
105  fmc_Fertilizer, // dk_car_ferti_s1,
106  fmc_Fertilizer, // dk_car_ferti_p1,
107  fmc_Herbicide, // dk_car_herbicide4,
108  fmc_Cultivation, // dk_car_row_cultivation1,
109  fmc_Herbicide, // dk_car_herbicide5,
110  fmc_Cultivation, // dk_car_row_cultivation2,
111  fmc_Watering, // dk_car_water2,
112  fmc_Cultivation, // dk_car_hilling_up1,
113  fmc_Herbicide, // dk_car_herbicide6,
114  fmc_Fertilizer, // dk_car_boron_s1,
115  fmc_Fertilizer, // dk_car_boron_p1,
116  fmc_Watering, // dk_car_water3,
117  fmc_Cultivation, // dk_car_hilling_up2,
118  fmc_Fertilizer, // dk_car_boron_s2,
119  fmc_Fertilizer, // dk_car_boron_p2,
120  fmc_Cultivation, // dk_car_hilling_up3,
121  fmc_Fertilizer, // dk_car_ferti_s2,
122  fmc_Fertilizer, // dk_car_ferti_p2,
123  fmc_Insecticide, // dk_car_insecticide1,
124  fmc_Insecticide, // dk_car_insecticide2,
125  fmc_Fungicide, // dk_car_fungicide2,
126  fmc_Fungicide, // dk_car_fungicide3,
127  fmc_Harvest, // dk_car_harvest,
128  fmc_Others // dk_car_wait,
129 
130  // no foobar entry
131 
132  };
133  // Iterate over the catlist elements and copy them to vector
134  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
135  }
136 };
137 
138 
139 #endif // DK_CARROTS_H
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
dk_car_water1
Definition: DK_Carrots.h:44
dk_car_ferti_s2
Definition: DK_Carrots.h:65
FarmEvent::m_forcespring
bool m_forcespring
Definition: Farm.h:392
dk_car_fungicide2
Definition: DK_Carrots.h:69
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
dk_car_deep_harrow
Definition: DK_Carrots.h:38
Farm::IsStockFarmer
bool IsStockFarmer(void)
Definition: Farm.h:961
dk_car_boron_s2
Definition: DK_Carrots.h:62
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
dk_car_boron_p1
Definition: DK_Carrots.h:59
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
dk_car_herbicide5
Definition: DK_Carrots.h:53
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_Carrots::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: DK_Carrots.h:84
FarmEvent
A struct to hold the information required to trigger a farm event.
Definition: Farm.h:372
LE::ClearManagementActionSum
void ClearManagementActionSum()
clears the management action counters
Definition: Elements.h:247
Farm::FP_NPK
virtual bool FP_NPK(LE *a_field, double a_user, int a_days)
Apply NPK fertilizer, on a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:645
dk_car_sharrow3
Definition: DK_Carrots.h:42
dk_car_ferti_p1
Definition: DK_Carrots.h:50
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
Farm::BedForming
virtual bool BedForming(LE *a_field, double a_user, int a_days)
Do bed forming up on a_field, probably of carrots.
Definition: FarmFuncs.cpp:1316
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
cfg_ins_app_prop1
CfgFloat cfg_ins_app_prop1
dk_car_sharrow4
Definition: DK_Carrots.h:43
Farm::SpringSow
virtual bool SpringSow(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 in the spring on a_field.
Definition: FarmFuncs.cpp:501
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
DK_Carrots
Definition: DK_Carrots.h:76
dk_car_stoneburier
Definition: DK_Carrots.h:36
DK_CAR_FORCESPRING
#define DK_CAR_FORCESPRING
Definition: DK_Carrots.h:32
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
DK_Carrots::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: DK_Carrots.cpp:38
Farm::FA_NPK
virtual bool FA_NPK(LE *a_field, double a_user, int a_days)
Apply NPK fertilizer to a_field owned by an stock farmer.
Definition: FarmFuncs.cpp:982
Farm::FungicideTreat
virtual bool FungicideTreat(LE *a_field, double a_user, int a_days)
Apply fungicide to a_field.
Definition: FarmFuncs.cpp:2101
Farm::HillingUp
virtual bool HillingUp(LE *a_field, double a_user, int a_days)
Do hilling up on a_field, probably of potatoes.
Definition: FarmFuncs.cpp:1302
dk_car_sharrow2
Definition: DK_Carrots.h:41
dk_car_hilling_up2
Definition: DK_Carrots.h:61
Crop
The base class for all crops.
Definition: Farm.h:495
cfg_fungi_app_prop1
CfgFloat cfg_fungi_app_prop1
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_car_fungicide1
Definition: DK_Carrots.h:45
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
dk_car_bedformer
Definition: DK_Carrots.h:39
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
cfg_greg_app_prop
CfgFloat cfg_greg_app_prop
tov_DKCarrots
Definition: LandscapeFarmingEnums.h:353
dk_car_fungicide3
Definition: DK_Carrots.h:70
Calendar::Date
long Date(void)
Definition: Calendar.h:57
dk_car_ferti_p2
Definition: DK_Carrots.h:66
fmc_Cultivation
Definition: LandscapeFarmingEnums.h:1008
CfgBool
Bool configurator entry class.
Definition: Configurator.h:155
DK_CarrotsToDo
DK_CarrotsToDo
Definition: DK_Carrots.h:34
dk_car_row_cultivation1
Definition: DK_Carrots.h:52
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
dk_car_hilling_up3
Definition: DK_Carrots.h:64
dk_car_insecticide1
Definition: DK_Carrots.h:67
fmc_Watering
Definition: LandscapeFarmingEnums.h:1011
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
dk_car_sharrow1
Definition: DK_Carrots.h:40
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
Farm::FA_Boron
virtual bool FA_Boron(LE *a_field, double a_user, int a_days)
Apply soluble Boron to a_field owned by a stock farmer.
Definition: FarmFuncs.cpp:868
CfgArray_Double
Definition: Configurator.h:208
dk_car_herbicide2
Definition: DK_Carrots.h:47
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
Farm::FP_Boron
virtual bool FP_Boron(LE *a_field, double a_user, int a_days)
Apply soluble Boron to a_field owned by an arable farmer.
Definition: FarmFuncs.cpp:854
dk_car_wait
Definition: DK_Carrots.h:72
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
dk_car_herbicide3
Definition: DK_Carrots.h:48
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
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_car_ferti_s1
Definition: DK_Carrots.h:49
dk_car_herbicide4
Definition: DK_Carrots.h:51
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
dk_car_insecticide2
Definition: DK_Carrots.h:68
dk_car_harvest
Definition: DK_Carrots.h:71
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
dk_car_water3
Definition: DK_Carrots.h:60
dk_car_herbicide1
Definition: DK_Carrots.h:37
dk_car_start
Definition: DK_Carrots.h:35
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
dk_car_row_cultivation2
Definition: DK_Carrots.h:54
dk_car_boron_s1
Definition: DK_Carrots.h:58
Farm
The base class for all farm types.
Definition: Farm.h:755
Farm::DeepPlough
virtual bool DeepPlough(LE *a_field, double a_user, int a_days)
Carry out a deep ploughing event on a_field.
Definition: FarmFuncs.cpp:408
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
cfg_herbi_app_prop
CfgFloat cfg_herbi_app_prop
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
DK_Carrots::DK_Carrots
DK_Carrots(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: DK_Carrots.h:80
dk_car_hilling_up1
Definition: DK_Carrots.h:56
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
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.
cfg_pest_carrots_on
CfgBool cfg_pest_carrots_on
Turn on pesticides for carrots.
dk_car_water2
Definition: DK_Carrots.h:55
DK_CAR_BASE
#define DK_CAR_BASE
Definition: DK_Carrots.h:31
dk_car_sow
Definition: DK_Carrots.h:46
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
dk_car_herbicide6
Definition: DK_Carrots.h:57
dk_car_boron_p2
Definition: DK_Carrots.h:63
dk_car_foobar
Definition: DK_Carrots.h:73
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
fmc_Fungicide
Definition: LandscapeFarmingEnums.h:1007
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001