ALMaSS Hare ODDox  1.1
The hare model description following ODdox protocol
SpringRape.h
Go to the documentation of this file.
1 //
2 // springrape.h
3 //
4 /*
5 *******************************************************************************************************
6 Copyright (c) 2011, Christopher John Topping, University of Aarhus
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 SPRINGRAPE_H
29 #define SPRINGRAPE_H
30 
31 // <cropname>_BASE is the first event number to be dumped into the
32 // debugging log from this crop. *Must* be unique among all crops.
33 // I suggest steps of 100 between crops.
34 
35 #define SPRINGRAPE_BASE 330
36 #define SR_DID_RC_CLEAN m_field->m_user[0]
37 #define SR_DID_HERBI_ZERO m_field->m_user[1]
38 #define SR_INSECT_DATE m_field->m_user[2]
39 #define SR_FUNGI_DATE m_field->m_user[3]
40 #define SR_SWARTH_DATE m_field->m_user[4]
41 #define SR_HARVEST_DATE m_field->m_user[5]
42 //#define SR_DECIDE_TO_HERB m_field->m_user[6]
43 //#define SR_DECIDE_TO_FI m_field->m_user[7]
44 
45 
46 
47 typedef enum {
48  sr_start = 1, // Compulsory, start event must always be 1 (one).
74 
75 
76 
77 class SpringRape: public Crop
78 {
79  // Private methods corresponding to the different management steps
80  // (when needed).
81  void HerbiZero( void );
82  void RowcolOne( void );
83 
84 public:
85  bool Do( Farm *a_farm, LE *a_field, FarmEvent *a_ev );
87  {
88  m_first_date=g_date->DayInYear(1,3);
89  }
90 };
91 
92 #endif // WINTERRAPE_H
sr_ferti_zero
Definition: SpringRape.h:49
sr_harvest
Definition: SpringRape.h:67
FarmEvent
A struct to hold the information required to trigger a farm event.
Definition: farm.h:463
SpringRape::SpringRape
SpringRape()
Definition: SpringRape.h:86
sr_spring_plough
Definition: SpringRape.h:50
Crop::m_first_date
int m_first_date
Definition: farm.h:540
sr_herbi_one
Definition: SpringRape.h:59
sr_ferti_s1
Definition: SpringRape.h:57
Crop
The base class for all crops.
Definition: farm.h:534
SpringRape::HerbiZero
void HerbiZero(void)
sr_spring_harrow
Definition: SpringRape.h:51
sr_stub_harrow
Definition: SpringRape.h:70
sr_herbi_zero
Definition: SpringRape.h:54
SpringRapeToDo
SpringRapeToDo
Definition: SpringRape.h:47
SpringRape
Definition: SpringRape.h:77
SpringRape::RowcolOne
void RowcolOne(void)
Definition: SpringRape.cpp:539
sr_ferti_p1
Definition: SpringRape.h:55
sr_cuttostraw
Definition: SpringRape.h:68
sr_rowcol_clean
Definition: SpringRape.h:53
sr_grubbing
Definition: SpringRape.h:71
sr_insect_one_c
Definition: SpringRape.h:65
SpringRape::Do
bool Do(Farm *a_farm, LE *a_field, FarmEvent *a_ev)
Definition: SpringRape.cpp:45
sr_compress
Definition: SpringRape.h:69
sr_ferti_p2
Definition: SpringRape.h:56
Farm
The base class for all farm types.
Definition: farm.h:767
sr_insect_one
Definition: SpringRape.h:63
sr_start
Definition: SpringRape.h:48
sr_rowcol_one
Definition: SpringRape.h:61
sr_fungi_one
Definition: SpringRape.h:60
sr_swarth
Definition: SpringRape.h:66
sr_insect_one_b
Definition: SpringRape.h:64
sr_spring_sow
Definition: SpringRape.h:52
sr_productapplic_one
Definition: SpringRape.h:72
sr_ferti_s2
Definition: SpringRape.h:58
sr_rowcol_one_b
Definition: SpringRape.h:62
SPRINGRAPE_BASE
#define SPRINGRAPE_BASE
Definition: SpringRape.h:35