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
Horticulture.h
Go to the documentation of this file.
1 //
2 // YoungForest.h
3 //
4 /*
5 
6 Copyright (c) 2003, National Environmental Research Institute, Denmark (NERI)
7 
8 All rights reserved.
9 
10 
11 Redistribution and use in source and binary forms, with or without
12 modification, are permitted provided that the following conditions are met:
13 
14 *) Redistributions of source code must retain the above copyright notice, this
15 list of conditions and the following disclaimer.
16 *) Redistributions in binary form must reproduce the above copyright notice,
17 this list of conditions and the following disclaimer in the documentation
18 and/or other materials provided with the distribution.
19 *) Neither the name of the NERI nor the names of its contributors
20 may be used to endorse or promote products derived from this software without
21 specific prior written permission.
22 
23 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
24 AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
27 LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
28 CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
29 SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
31 CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
32 ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
33 POSSIBILITY OF SUCH DAMAGE.
34 
35 */
36 
37 #ifndef HORTICULTURE_H
38 #define HORTICULTURE_H
39 
40 #define HORTICULTURE_BASE 910
41 
42 typedef enum {
43  h_start = 1, // Compulsory, start event must always be 1 (one).
48 
49 
50 
51 class HorticultureCrop : public Crop
52 {
53 public:
54  bool Do(Farm* a_farm, LE* a_field, FarmEvent* a_ev);
55  HorticultureCrop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape* a_L) : Crop(a_tov, a_toc, a_L)
56  {
57  m_first_date = g_date->DayInYear(1, 4);
59  }
61  const int elements = 2 + (h_do_foobar - HORTICULTURE_BASE);
63 
64  FarmManagementCategory catlist[elements] =
65  {
66  fmc_Others, // zero element unused but must be here
67  fmc_Others,//h_start = 1, // Compulsory, start event must always be 1 (one).
68  fmc_Others,//h_do_nothing_start = HORTICULTURE_BASE,
69  fmc_Others//h_do_nothing_stop,
70 
71  // no foobar entry
72 
73  };
74  // Iterate over the catlist elements and copy them to vector
75  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
76 
77  }
78 };
79 
80 #endif // HORTICULTURE_H
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
HorticultureCrop
Definition: Horticulture.h:51
LE::SetMDates
void SetMDates(int a, int b, int c)
Definition: Elements.h:406
FarmEvent
A struct to hold the information required to trigger a farm event.
Definition: Farm.h:372
h_start
Definition: Horticulture.h:43
LE::ClearManagementActionSum
void ClearManagementActionSum()
clears the management action counters
Definition: Elements.h:247
Calendar::GetYearNumber
int GetYearNumber(void)
Definition: Calendar.h:72
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
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
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
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
HorticultureCrop::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: Horticulture.cpp:32
Calendar::Date
long Date(void)
Definition: Calendar.h:57
HorticultureToDo
HorticultureToDo
Definition: Horticulture.h:42
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
HORTICULTURE_BASE
#define HORTICULTURE_BASE
Definition: Horticulture.h:40
h_do_nothing_start
Definition: Horticulture.h:44
HorticultureCrop::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: Horticulture.h:60
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
h_do_nothing_stop
Definition: Horticulture.h:45
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
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
h_do_foobar
Definition: Horticulture.h:46
TTypesOfCrops
TTypesOfCrops
Definition: LandscapeFarmingEnums.h:781
LE
Definition: Elements.h:86
Crop::m_last_date
int m_last_date
Definition: Farm.h:503
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
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
HorticultureCrop::HorticultureCrop
HorticultureCrop(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: Horticulture.h:55
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
LE::SetMConstants
void SetMConstants(int a, int c)
Definition: Elements.h:408
Crop::ChooseNextCrop
void ChooseNextCrop(int a_no_dates)
Chooses the next crop to grow in a field.
Definition: Farm.cpp:756
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
WARN_BUG
Definition: MapErrorMsg.h:34
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001