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
OSeedGrass1.h
Go to the documentation of this file.
1 //
2 // OSeedGrass1.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 #ifndef OSEEDGRASS1_H
28 #define OSEEDGRASS1_H
29 
30 #define OSEEDGRASS1_BASE 3900
31 #define SG1_WATER_DATE m_field->m_user[0]
32 
33 typedef enum {
34  osg1_start = 1, // Compulsory, start event must always be 1 (one).
45 
46 
47 
48 class OSeedGrass1: public Crop
49 {
50 public:
51  bool Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev );
52  OSeedGrass1(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape* a_L) : Crop(a_tov, a_toc, a_L)
53  {
56  }
58  const int elements = 2 + (osg1_foobar - OSEEDGRASS1_BASE);
60 
61  FarmManagementCategory catlist[elements] =
62  {
63  fmc_Others, // zero element unused but must be here
64  fmc_Others, // osg1_start = 1, // Compulsory, start event must always be 1 (one).
65  fmc_Fertilizer, // osg1_ferti_zero = OSEEDGRASS1_BASE,
66  fmc_Watering, // osg1_water_zero,
67  fmc_Watering, // osg1_water_zero_b,
68  fmc_Cutting, // osg1_swarth,
69  fmc_Harvest, // osg1_harvest,
70  fmc_Others, // osg1_strawchopping,
71  fmc_Others, // osg1_compress,
72  fmc_Others // osg1_burn_straw,
73 
74 
75  // no foobar entry
76 
77  };
78  // Iterate over the catlist elements and copy them to vector
79  copy(begin(catlist), end(catlist), back_inserter(m_ManagementCategories));
80 
81  }
82 };
83 
84 #endif // OSEEDGRASS1_H
LE::GetMDates
int GetMDates(int a, int b)
Definition: Elements.h:405
osg1_foobar
Definition: OSeedGrass1.h:43
LE::SetMDates
void SetMDates(int a, int b, int c)
Definition: Elements.h:406
SG1_WATER_DATE
#define SG1_WATER_DATE
Definition: OSeedGrass1.h:31
LE::SetLastSownVeg
void SetLastSownVeg(TTypesOfVegetation a_tov)
Records the last vegetation type to be sown.
Definition: Elements.h:357
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
cfg_fungi_app_prop1
CfgFloat cfg_fungi_app_prop1
FarmEvent
A struct to hold the information required to trigger a farm event.
Definition: Farm.h:372
LE::GetMConstants
int GetMConstants(int a)
Definition: Elements.h:407
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
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
OSeedGrass1
Definition: OSeedGrass1.h:48
FarmEvent::m_first_year
bool m_first_year
Definition: Farm.h:386
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
Farm::GetType
TTypesOfFarm GetType(void)
Definition: Farm.h:956
Crop::m_base_elements_no
int m_base_elements_no
Definition: Farm.h:505
osg1_ferti_zero
Definition: OSeedGrass1.h:35
Crop::m_first_date
int m_first_date
Definition: Farm.h:501
FarmEvent::m_startday
int m_startday
Definition: Farm.h:385
osg1_swarth
Definition: OSeedGrass1.h:38
osg1_harvest
Definition: OSeedGrass1.h:39
cfg_herbi_app_prop
CfgFloat cfg_herbi_app_prop
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
OSEEDGRASS1_BASE
#define OSEEDGRASS1_BASE
Definition: OSeedGrass1.h:30
cfg_greg_app_prop
CfgFloat cfg_greg_app_prop
OSeedGrass1::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: OSeedGrass1.cpp:36
fmc_Cutting
Definition: LandscapeFarmingEnums.h:1009
osg1_compress
Definition: OSeedGrass1.h:41
cfg_ins_app_prop1
CfgFloat cfg_ins_app_prop1
Landscape
The landscape class containing all environmental and topographical data.
Definition: Landscape.h:142
fmc_Fertilizer
Definition: LandscapeFarmingEnums.h:1004
Calendar::Date
long Date(void)
Definition: Calendar.h:57
OSeedGrass1ToDo
OSeedGrass1ToDo
Definition: OSeedGrass1.h:33
fmc_Others
Definition: LandscapeFarmingEnums.h:1003
Farm::StrawChopping
virtual bool StrawChopping(LE *a_field, double a_user, int a_days)
Carry out straw chopping on a_field.
Definition: FarmFuncs.cpp:1475
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
osg1_start
Definition: OSeedGrass1.h:34
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
OSeedGrass1::SetUpFarmCategoryInformation
void SetUpFarmCategoryInformation()
Definition: OSeedGrass1.h:57
FarmEvent::m_todo
int m_todo
Definition: Farm.h:388
TTypesOfCrops
TTypesOfCrops
Definition: LandscapeFarmingEnums.h:781
tof_OptimisingFarm
Definition: LandscapeFarmingEnums.h:696
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
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
osg1_water_zero_b
Definition: OSeedGrass1.h:37
CfgFloat
Double configurator entry class.
Definition: Configurator.h:126
fmc_Harvest
Definition: LandscapeFarmingEnums.h:1012
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
osg1_burn_straw
Definition: OSeedGrass1.h:42
Farm::BurnStrawStubble
virtual bool BurnStrawStubble(LE *a_field, double a_user, int a_days)
Burn stubble on a_field.
Definition: FarmFuncs.cpp:1567
osg1_strawchopping
Definition: OSeedGrass1.h:40
Farm::Swathing
virtual bool Swathing(LE *a_field, double a_user, int a_days)
Cut the crop on a_field and leave it lying (probably rape)
Definition: FarmFuncs.cpp:1350
osg1_water_zero
Definition: OSeedGrass1.h:36
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
Farm::HayTurning
virtual bool HayTurning(LE *a_field, double a_user, int a_days)
Carry out hay turning on a_field.
Definition: FarmFuncs.cpp:1491
Crop::m_ev
FarmEvent * m_ev
Definition: Farm.h:500
OSeedGrass1::OSeedGrass1
OSeedGrass1(TTypesOfVegetation a_tov, TTypesOfCrops a_toc, Landscape *a_L)
Definition: OSeedGrass1.h:52
WARN_BUG
Definition: MapErrorMsg.h:34
FarmManagementCategory
FarmManagementCategory
Definition: LandscapeFarmingEnums.h:1001