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
DummyCropPestTesting.h
Go to the documentation of this file.
1 //
2 // DummyCropPestTesting.h
3 //
4 /*
5 *******************************************************************************************************
6 Copyright (c) 2011, Christopher John Topping, 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 DummyCropPestTestingH
29 #define DummyCropPestTestingH
30 
31 #define DCPT_BASE 200
32 
33 #define DCPT_APRIL_PEST a_field->m_user[1]
34 #define DCPT_MAY_PEST a_field->m_user[2]
35 #define DCPT_JUNE_PEST a_field->m_user[3]
36 #define DCPT_JULY_PEST a_field->m_user[4]
37 #define DCPT_SEPT_PEST a_field->m_user[5]
38 #define DCPT_OCT_PEST a_field->m_user[6]
39 
40 typedef enum {
41  dcpt_start = 1, // Compulsory, start event must always be 1 (one).
59 
60 
61 
62 class DummyCropPestTesting : public Crop
63 {
64 public:
65  bool Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev );
66  DummyCropPestTesting(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape* a_L) : Crop(a_tov, a_toc, a_L)
67  {
70  }
72  const int elements = 2 + (dcpt_foobar - DCPT_BASE);
74 
75  FarmManagementCategory catlist[elements] =
76  {
77  fmc_Others, // zero element unused but must be here
78  fmc_Others, // dcpt_start = 1, // Compulsory, start event must always be 1 (one).
79  fmc_Herbicide, // dcpt_March_pest1=DCPT_BASE,
80  fmc_Herbicide, // dcpt_April_pest1,
81  fmc_Herbicide, // dcpt_April_pest2,
82  fmc_Herbicide, // dcpt_May_pest1,
83  fmc_Herbicide, // dcpt_May_pest2,
84  fmc_Herbicide, // dcpt_June_pest1,
85  fmc_Herbicide, // dcpt_June_pest2,
86  fmc_Herbicide, // dcpt_July_pest1,
87  fmc_Herbicide, // dcpt_July_pest2,
88  fmc_Herbicide, // dcpt_August_pest1,
89  fmc_Herbicide, // dcpt_September_pest1,
90  fmc_Herbicide, // dcpt_September_pest2,
91  fmc_Herbicide, // dcpt_October_pest1,
92  fmc_Herbicide, // dcpt_October_pest2,
93  fmc_Herbicide // dcpt_November_pest1,
94 
95 
96  // no foobar entry
97 
98  };
99  // Iterate over the catlist elements and copy them to vector
100  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
101 
102  }
103 };
104 
105 #endif
106 // DummyCropPestTesting.H
107 
108 
109 
110 
111 
112 
113 
114 
115 
116 
117 
118 
119 
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
LE::SetMDates
void SetMDates(int a, int b, int c)
Definition: Elements.h:406
DCPT_APRIL_PEST
#define DCPT_APRIL_PEST
Definition: DummyCropPestTesting.h:33
dcpt_September_pest1
Definition: DummyCropPestTesting.h:52
FarmEvent::m_lock
bool m_lock
Definition: Farm.h:384
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::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
DCPT_MAY_PEST
#define DCPT_MAY_PEST
Definition: DummyCropPestTesting.h:34
DCPT_SEPT_PEST
#define DCPT_SEPT_PEST
Definition: DummyCropPestTesting.h:37
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
dcpt_July_pest1
Definition: DummyCropPestTesting.h:49
fmc_Herbicide
Definition: LandscapeFarmingEnums.h:1006
DCPT_OCT_PEST
#define DCPT_OCT_PEST
Definition: DummyCropPestTesting.h:38
Farm::GetType
TTypesOfFarm GetType(void)
Definition: Farm.h:956
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
FarmEvent::m_startday
int m_startday
Definition: Farm.h:385
dcpt_October_pest2
Definition: DummyCropPestTesting.h:55
DummyCropPestTesting::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: DummyCropPestTesting.h:71
Crop
The base class for all crops.
Definition: Farm.h:495
dcpt_April_pest1
Definition: DummyCropPestTesting.h:43
DCPT_JULY_PEST
#define DCPT_JULY_PEST
Definition: DummyCropPestTesting.h:36
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
dcpt_October_pest1
Definition: DummyCropPestTesting.h:54
Calendar::Date
long Date(void)
Definition: Calendar.h:57
dcpt_June_pest2
Definition: DummyCropPestTesting.h:48
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
DummyCropPestTesting
Definition: DummyCropPestTesting.h:62
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
DummyCropPestTestingToDo
DummyCropPestTestingToDo
Definition: DummyCropPestTesting.h:40
DummyCropPestTesting::DummyCropPestTesting
DummyCropPestTesting(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: DummyCropPestTesting.h:66
FarmEvent::m_next_tov
TTypesOfVegetation m_next_tov
Definition: Farm.h:390
dcpt_September_pest2
Definition: DummyCropPestTesting.h:53
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
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
dcpt_July_pest2
Definition: DummyCropPestTesting.h:50
DCPT_JUNE_PEST
#define DCPT_JUNE_PEST
Definition: DummyCropPestTesting.h:35
TTypesOfCrops
TTypesOfCrops
Definition: LandscapeFarmingEnums.h:781
DummyCropPestTesting::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: DummyCropPestTesting.cpp:33
tof_OptimisingFarm
Definition: LandscapeFarmingEnums.h:696
dcpt_March_pest1
Definition: DummyCropPestTesting.h:42
DCPT_BASE
#define DCPT_BASE
Definition: DummyCropPestTesting.h:31
LE
Definition: Elements.h:86
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
dcpt_April_pest2
Definition: DummyCropPestTesting.h:44
dcpt_November_pest1
Definition: DummyCropPestTesting.h:56
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
Farm
The base class for all farm types.
Definition: Farm.h:755
dcpt_start
Definition: DummyCropPestTesting.h:41
dcpt_August_pest1
Definition: DummyCropPestTesting.h:51
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
dcpt_foobar
Definition: DummyCropPestTesting.h:57
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
dcpt_June_pest1
Definition: DummyCropPestTesting.h:47
WARN_BUG
Definition: MapErrorMsg.h:34
dcpt_May_pest2
Definition: DummyCropPestTesting.h:46
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001
dcpt_May_pest1
Definition: DummyCropPestTesting.h:45