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
CloverGrassGrazed1.h
Go to the documentation of this file.
1 /*
2 *******************************************************************************************************
3 Copyright (c) 2011, Christopher John Topping, Aarhus University
4 All rights reserved.
5 
6 Redistribution and use in source and binary forms, with or without modification, are permitted provided
7 that the following conditions are met:
8 
9 Redistributions of source code must retain the above copyright notice, this list of conditions and the
10 following disclaimer.
11 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
12 the following disclaimer in the documentation and/or other materials provided with the distribution.
13 
14 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
15 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
16 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
17 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
18 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
19 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
20 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
21 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
22 ********************************************************************************************************
23 */
24 
25 #ifndef CloverGrassGrazed1H
26 #define CloverGrassGrazed1H
27 
28 #define CGG1_CUT_DATE m_field->m_user[0]
29 #define CGG1_WATER_DATE m_field->m_user[1]
30 #define CGG1_FERTI_DATE m_field->m_user[2]
31 #define CGG1_FORCE_SECOND_CUT m_field->m_user[3]
32 #define CGG1_HALT_SECOND_WATER m_field->m_user[4]
33 #define CGG1_BASE 1400
34 
35 typedef enum {
36  cgg1_start = 1, // Compulsory, start event must always be 1 (one).
52 //} CloverGrassGrazed2ToDo;
53 
54 
55 
56 class CloverGrassGrazed1: public Crop
57 {
58 public:
59  bool Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev );
60  CloverGrassGrazed1(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape* a_L) : Crop(a_tov, a_toc, a_L)
61  {
64  }
66  const int elements = 2 + (cgg1_foobar - CGG1_BASE);
68 
69  FarmManagementCategory catlist[elements] =
70  {
71  fmc_Others, // zero element unused but must be here
72  fmc_Others, // cgg1_start = 1, // Compulsory, start event must always be 1 (one).
73  fmc_Fertilizer, // cgg1_ferti_zero = CGG1_BASE,
74  fmc_Fertilizer, // cgg1_ferti_one,
75  fmc_Fertilizer, // cgg1_ferti_two,
76  fmc_Fertilizer, // cgg1_ferti_three,
77  fmc_Fertilizer, // cgg1_ferti_four,
78  fmc_Cutting, // cgg1_cut_to_silage,
79  fmc_Cutting, // cgg1_cut_to_silage2,
80  fmc_Cutting, // cgg1_cut_to_silage3,
81  fmc_Watering, // cgg1_water_zero,
82  fmc_Watering, // cgg1_water_one,
83  fmc_Grazing, // cgg1_cattle_out,
84  fmc_Grazing, // cgg1_cattle_is_out,
85  fmc_Herbicide // cgg1_productapplic_one,
86 
87 
88  // no foobar entry
89 
90  };
91  // Iterate over the catlist elements and copy them to vector
92  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
93 
94  }
95 };
96 
97 #endif
98 // CloverGrassGrazed1.H
99 
cgg1_ferti_three
Definition: CloverGrassGrazed1.h:40
cgg1_water_zero
Definition: CloverGrassGrazed1.h:45
cfg_pest_productapplic_startdate
CfgInt cfg_pest_productapplic_startdate
Start date for applying pesticide the first time.
Definition: Elements.cpp:166
CGG1_FORCE_SECOND_CUT
#define CGG1_FORCE_SECOND_CUT
Definition: CloverGrassGrazed1.h:31
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
cgg1_cattle_out
Definition: CloverGrassGrazed1.h:47
Calendar::GetYearNumber
int GetYearNumber(void)
Definition: Calendar.h:72
cgg1_ferti_two
Definition: CloverGrassGrazed1.h:39
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
cgg1_start
Definition: CloverGrassGrazed1.h:36
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
CfgFloat::value
double value() const
Definition: Configurator.h:142
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
CloverGrassGrazed1::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: CloverGrassGrazed1.h:65
cgg1_foobar
Definition: CloverGrassGrazed1.h:50
CGG1_HALT_SECOND_WATER
#define CGG1_HALT_SECOND_WATER
Definition: CloverGrassGrazed1.h:32
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
cgg1_ferti_one
Definition: CloverGrassGrazed1.h:38
CloverGrassGrazed1ToDo
CloverGrassGrazed1ToDo
Definition: CloverGrassGrazed1.h:35
Crop
The base class for all crops.
Definition: Farm.h:495
CloverGrassGrazed1
Definition: CloverGrassGrazed1.h:56
fmc_Cutting
Definition: LandscapeFarmingEnums.h:1009
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.
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
CloverGrassGrazed1::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: CloverGrassGrazed1.cpp:40
Calendar::Date
long Date(void)
Definition: Calendar.h:57
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
fmc_Watering
Definition: LandscapeFarmingEnums.h:1011
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
cgg1_ferti_four
Definition: CloverGrassGrazed1.h:41
CfgArray_Double
Definition: Configurator.h:208
cgg1_cut_to_silage
Definition: CloverGrassGrazed1.h:42
cgg1_cattle_is_out
Definition: CloverGrassGrazed1.h:48
CfgInt::value
int value() const
Definition: Configurator.h:116
CGG1_CUT_DATE
#define CGG1_CUT_DATE
Definition: CloverGrassGrazed1.h:28
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
tov_CloverGrassGrazed1
Definition: LandscapeFarmingEnums.h:203
TTypesOfCrops
TTypesOfCrops
Definition: LandscapeFarmingEnums.h:781
tof_OptimisingFarm
Definition: LandscapeFarmingEnums.h:696
cgg1_water_one
Definition: CloverGrassGrazed1.h:46
LE
Definition: Elements.h:86
cgg1_cut_to_silage2
Definition: CloverGrassGrazed1.h:43
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
cfg_pest_productapplic_period
CfgInt cfg_pest_productapplic_period
Period for applying pesticide.
Definition: Elements.cpp:169
cgg1_productapplic_one
Definition: CloverGrassGrazed1.h:49
fmc_Grazing
Definition: LandscapeFarmingEnums.h:1010
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
CfgInt
Integer configurator entry class.
Definition: Configurator.h:102
CGG1_WATER_DATE
#define CGG1_WATER_DATE
Definition: CloverGrassGrazed1.h:29
Farm
The base class for all farm types.
Definition: Farm.h:755
CfgFloat
Double configurator entry class.
Definition: Configurator.h:126
CloverGrassGrazed1::CloverGrassGrazed1
CloverGrassGrazed1(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: CloverGrassGrazed1.h:60
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
CGG1_FERTI_DATE
#define CGG1_FERTI_DATE
Definition: CloverGrassGrazed1.h:30
cgg1_cut_to_silage3
Definition: CloverGrassGrazed1.h:44
CGG1_BASE
#define CGG1_BASE
Definition: CloverGrassGrazed1.h:33
WARN_BUG
Definition: MapErrorMsg.h:34
ppp_1
Definition: LandscapeFarmingEnums.h:1079
cfg_silage_prop
CfgFloat cfg_silage_prop
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
cgg1_ferti_zero
Definition: CloverGrassGrazed1.h:37