ALMaSS Rabbit ODdox  1.1
The rabbit model description following ODdox protocol
plants.cpp
Go to the documentation of this file.
1 //
2 // plants.cpp
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 #define _CRT_SECURE_NO_DEPRECATE
29 
30 #include <cstdio>
31 #include <iostream>
32 #include <fstream>
33 #include <math.h>
34 #include <stdlib.h>
35 #include "configurator.h"
36 #include "maperrormsg.h"
37 #include "ls.h"
38 
40 extern void FloatToDouble(double&, float);
42 
43 double PlantGrowthData::FindDiff( double a_ddegs, double a_yddegs, int a_plant,
44  int a_phase, int a_type )
45 {
46  // Check for valid plant number at runtime?
47  // This is broken for growth curves where one can risk passing
48  // more than a single inflection point in the growth curve in a
49  // single day...
50 
51  int index = m_numbers[ a_plant ];
52  unsigned int oldindex=0, newindex=0;
53 
54  if ( m_growth[ index ]->m_dds[ a_phase ][ 0 ] == 99999 ) {
55  return 0.0;
56  }
57 
58  for ( unsigned int i=0; i<MaxNoInflections; i++ ) {
59  // In other words: If the current value for summed day degrees
60  // is smaller than the X position of the *next* inflection
61  // point, then we are in the correct interval.
62  if ( m_growth[ index ]->m_dds[ a_phase ][ i+1 ] > a_ddegs ) {
63  newindex = i;
64  break;
65  // return m_growth[ index ]->m_slopes[ a_phase ][ a_type ][i];
66  }
67  }
68 
69  for ( unsigned int i=0; i<MaxNoInflections; i++ ) {
70  if ( m_growth[ index ]->m_dds[ a_phase ][ i+1 ] > a_yddegs ) {
71  oldindex = i;
72  break;
73  // return m_growth[ index ]->m_slopes[ a_phase ][ a_type ][i];
74  }
75  }
76 
77  double diff;
78 
79  if ( newindex > oldindex ) {
80  // We have passed an inflection point between today and yesterday.
81  // First add the increment from yesterdays day degree sum up to
82  // the inflection point.
83  double dddif =
84  m_growth[ index ]->m_dds[ a_phase ][ newindex ] - a_yddegs;
85  diff =
86  m_growth[ index ]->m_slopes[ a_phase ][ a_type ][oldindex]*
87  dddif;
88 
89  // Then from the inflection point up to today.
90  dddif = a_ddegs -
91  m_growth[ index ]->m_dds[ a_phase ][ newindex ];
92  diff +=
93  m_growth[ index ]->m_slopes[ a_phase ][ a_type ][ newindex ]*
94  dddif;
95  } else {
96  // No inflection point passed.
97  diff = m_growth[ index ]->m_slopes[ a_phase ][ a_type ][ newindex ] *
98  (a_ddegs - a_yddegs);
99  }
100  return diff;
101 }
102 
103 unsigned int PlantGrowthData::FindCropNum( ifstream& ist )
104 {
105  int NoPlants;
106 
107  m_numbers.resize(201);
108  for ( unsigned int i=0; i<201; i++) {
109  m_numbers[ i ] = -1;
110  }
111 
112  //m_ifile = fopen(a_cropcurvefile, "r" );
113  //ifstream m_ifile(a_cropcurvefile);
114  /*
115  if (!m_ifile){
116  g_msg->Warn(WARN_FILE, "PlantGrowthData::PlantGrowthData: Unable to open file",
117  a_cropcurvefile );
118  exit(1);
119  }
120  */
121  //fscanf( m_ifile , "%d", &NoPlants ); // How many tables to read in
122  ist >> NoPlants;
123  m_growth.resize( NoPlants );
124  m_num_crops = NoPlants;
125 
126  return NoPlants;
127 }
128 
129 
130 
131 void PlantGrowthData::SetVegNum( unsigned int a_i, ifstream& ist, const char * a_cropcurvefile )
132 {
133  int ThisPlant;
134 
135  // Find out what crop and what nutrient status
136  //fscanf( m_ifile, "%d", &ThisPlant);
137 
138  ist >> ThisPlant;
139  // Check if valid plant number (from the file).
140  if ( ThisPlant < 0 || ThisPlant > 200 ) {
141  g_msg->Warn(WARN_FILE, "PlantGrowthData::FindCropNum(): Illegal plant number"
142  " specified in", a_cropcurvefile );
143  exit(1);
144  }
145 
146  m_numbers[ ThisPlant ] = a_i;
147 
148  // if greater than 100 then it is low nutrient
149  if ( ThisPlant > 100 ) {
150  m_growth[ a_i ]->m_lownut = true;
151  } else {
152  m_growth[ a_i ]->m_lownut = false;
153  }
154 }
155 
156 
157 PlantGrowthData::PlantGrowthData( const char* a_vegcurvefile )
158 {
159  // Just finds out how many veg curves there are.
160  ifstream ist(a_vegcurvefile, ios::in);
161  unsigned int NoPlants = FindCropNum(ist);
162 
163  for ( unsigned int i=0; i<NoPlants; i++) {
164  CropGrowth* temp;
165  temp = new CropGrowth;
166  m_growth[ i ] = temp;
167  SetVegNum( i, ist, a_vegcurvefile );
168 
169 /*
170  for (int mmm=0; mmm < 10; ++mmm) {
171  int myin;
172  ist >> myin;
173  cout <<
174  }
175 */
176 
177  for (unsigned int j=0; j<5; j++) { // for each growth phase
178  // 'Local' index into crop growth curves.
179  int lk = 0;
180  for (unsigned int k=0; k<MaxNoInflections; k++) {
181  // for each inflection point
182  int entry;
183  //fscanf( m_ifile, "%d", &entry );
184  ist >> entry;
185  float f1=0,f2=0,f0=0;
186  if ( entry == -1 ) {
187  // Crop start data.
188  m_growth[ i ]->m_start_valid[j] = true;
189  //fscanf( m_ifile, "%g %g %g",&f1,&f0,&f2);
190  ist >> f1 >> f0 >> f2;
191  FloatToDouble(m_growth[ i ]->m_start[j][1],f1);
192  FloatToDouble(m_growth[ i ]->m_start[j][0],f0);
193  FloatToDouble(m_growth[ i ]->m_start[j][2],f2);
194  } else {
195  // Add inflection point to normal growth curves.
196  m_growth[ i ]->m_dds[j][lk] = (double)entry;
197  //fscanf( m_ifile, "%g %g %g",&f1,&f0,&f2);
198  ist >> f1 >> f0 >> f2;
199  FloatToDouble(m_growth[ i ]->m_slopes[j][1][lk],f1);
200  FloatToDouble(m_growth[ i ]->m_slopes[j][0][lk],f0);
201  FloatToDouble(m_growth[ i ]->m_slopes[j][2][lk],f2);
202  lk++;
203  }
204  } // MaxNoInflections
205  } // Growth Phases
206  } // NoPlants
207  //fclose( m_ifile );
208 }
209 
211 {
212  for ( unsigned int i=0; i<m_growth.size(); i++ )
213  delete m_growth[i];
214 }
215 
217 {
218  for (unsigned int j=0; j<5; j++) {
219  m_start_valid[j] = false;
220  for ( unsigned int k=0; k<3; k++) {
221  m_start[j][k] = 0.0;
222  }
223  }
224 }
225 
227 {
228  char error_num[20];
229 
230  switch (VegReference)
231  {
233  case tov_OSpringBarley:
235  return 101;
237  case tov_SpringBarley:
238  case tov_SpringBarleySpr:
245  case tov_PLSpringBarley: //Needs to be changed later
246  case tov_PLSpringWheat:
248  case tov_NLSpringBarley:
250  return 1;
251  case tov_WinterBarley:
253  case tov_PLWinterBarley: //Needs to be changed later
254  return 2;
255  case tov_OWinterBarley:
257  return 102;
258  case tov_WinterWheat:
264  case tov_WWheatPControl:
267  case tov_PLWinterWheat: // Needs to be changed later
269  case tov_DummyCropPestTesting: // just for testing of spraying distribution
270  case tov_NLWinterWheat:
271  return 4;
272  case tov_OWinterWheat:
274  return 104;
275  case tov_WinterRye:
277  case tov_PLWinterRye: //Needs to be changed later
278  return 5;
279  case tov_OWinterRye:
280  return 105;
281  case tov_Oats:
282  case tov_NorwegianOats:
283  return 6;
284  case tov_OOats:
285  return 106;
286  case tov_Maize:
287  case tov_MaizeSilage:
288  case tov_MaizeStrigling:
289  case tov_PLMaize: //Needs to be changed later
290  case tov_PLMaizeSilage: //Needs to be changed later
291  case tov_NLMaize:
292  case tov_NLMaizeSpring:
293  return 8;
294  case tov_OMaizeSilage:
295  return 108;
300  return 13;
302  case tov_OSBarleySilage:
305  return 113;
306  case tov_WinterRape:
308  case tov_PLWinterRape: // Needs to be changed later
309  return 22;
310  case tov_OWinterRape:
311  return 22;
314  return 25;
317  return 26;
318  case tov_SeedGrass1:
319  case tov_SeedGrass2:
320  case tov_OSeedGrass1:
321  case tov_OSeedGrass2:
322  return 27;
323  case tov_FodderGrass:
329  case tov_OGrazingPigs:
330  case tov_PLFodderLucerne2: //Needs to be changed later
331  case tov_NLGrassGrazed2:
334  return 29;
335  case tov_PLFodderLucerne1: //Needs to be changed later
336  case tov_NLGrassGrazed1:
338  return 70;
339  case tov_OFieldPeas:
341  case tov_FieldPeas:
343  case tov_FieldPeasSilage:
344  case tov_BroadBeans:
345  case tov_PLBeans:
346  case tov_NLCatchPeaCrop:
347  return 30;
348  case tov_Carrots:
349  case tov_PLCarrots: //Needs to be changed later
350  case tov_NLCarrots:
351  case tov_NLCabbage: //Needs to be changed later
352  case tov_NLCarrotsSpring:
353  case tov_NLCabbageSpring: //Needs to be changed later
354  return 41;
355  case tov_OCarrots:
356  return 141;
357  case tov_Potatoes:
359  case tov_PLPotatoes: //Needs to be changed later
361  case tov_NLPotatoes:
363  return 50;
364  case tov_OPotatoes:
365  return 150;
366  case tov_SugarBeet:
367  case tov_FodderBeet:
368  case tov_OFodderBeet:
369  case tov_PLBeet: //Needs to be changed later
370  case tov_PLBeetSpr:
371  case tov_NLBeet:
372  case tov_NLBeetSpring:
373  return 60;
374  // Special growth mode for green but unused elements.
375  // tov_PermanentSetaside Does not change growth phase no matter
376  // how hard one tries to do just that.
377  case tov_PermanentSetaside: return 92;
378  case tov_Heath:
379  case tov_Setaside:
380  case tov_OSetaside: return 112;
381  case tov_OrchardCrop:
382  case tov_YoungForest:
383  case tov_NaturalGrass:
384  case tov_Wasteland:
385  case tov_WaterBufferZone:
386  return 90;
387  case tov_NoGrowth:
388  case tov_PlantNursery:
389  return 91;
390  case tov_Lawn: return 94;
391  case tov_OTriticale:
392  case tov_Triticale:
393  case tov_PLWinterTriticale: //Needs to be changed later
394  return 7;
395  case tov_SpringRape: return 21;
396  case tov_NLTulips: return 80;
397 
398 
399  default: // No matching code so we need an error message of some kind
400  sprintf( error_num, "%d", VegReference );
401  g_msg->Warn( WARN_FILE,
402  "PlantGrowthData::VegTypeToCurveNum(): Unknown vegetation type:",
403  error_num );
404  exit( 1 );
405  }
406 }
407 
408 
409 bool PlantGrowthData::StartValid( int a_veg_type, int a_phase )
410 {
411  int a=m_numbers[ a_veg_type ];
412  CropGrowth* p=m_growth[a];
413  return p-> m_start_valid[ a_phase ];
414 }
415 
416 PollenNectarDevelopmentData::PollenNectarDevelopmentData(string a_toleinputfile, string a_tovinputfile, Landscape* a_land)
417 {
423  // This forms an empty entry for no pollen or nectar tov types
424  vector<double> empty;
425  vector<int> index;
426  for (int i = 0; i < 366; i++) {
427  empty.push_back(0.0);
428  index.push_back(i);
429  }
430  // make space in the lookup table for all tov types
432  for (int i = 0; i < int(tov_Undefined); i++) m_tov_pollencurvetable[i] = 0;
433  // make space in the lookup table for all tole types
435  for (int i = 0; i < int(tole_Foobar); i++) m_tole_pollencurvetable[i] = 0;
436 
438  {
449  ifstream infile(a_tovinputfile.c_str(), ios::in);
450  //check if there is an input file
451  if (!infile.is_open()) {
452  g_msg->Warn("PollenNectarDevelopmentData::PollenNectarDevelopmentData Cannot open the file", a_toleinputfile.c_str());
453  exit(1);
454  }
455  int no_curves;
456  int tov, curvenum;
457  infile >> no_curves;
458  for (int i = 0; i < no_curves-1; i++)
459  {
460  infile >> tov >> curvenum;
461  // convert from the reference number to tov type
462  tov = a_land->TranslateVegTypes(tov);
463  // store the reference in the pollen nectar lookup table
464  m_tov_pollencurvetable[tov] = curvenum;
465  }
466  // Now read the curve themselves
467  m_tovPollenCurves.resize(no_curves);
468  m_tovNectarCurves.resize(no_curves);
469  // each curve is composed to two sets of 365 numbers. The first being the index set - always 1-365 so there is no need to read this in, so it is filled in here
470  vector<double> slopes(366, 0);
472  p_curve = new PollenNectarDevelopmentCurve(&index, &empty);
473  m_tovPollenCurves[0] = p_curve;
474  m_tovNectarCurves[0] = p_curve;
475  for (int i = 0; i < no_curves; i++)
476  {
477  // Read the curve number
478  infile >> curvenum;
479  infile >> slopes[365];
480  // Read in the pollen data and save
481  for (int d = 0; d < 365; d++) infile >> slopes[d];
482  p_curve = new PollenNectarDevelopmentCurve(&index, &slopes);
483  m_tovPollenCurves[curvenum] = p_curve;
484  // Read in the nectar data and save
485  infile >> slopes[365];
486  for (int d = 0; d < 365; d++) infile >> slopes[d];
487  p_curve = new PollenNectarDevelopmentCurve(&index, &slopes);
488  m_tovNectarCurves[curvenum] = p_curve;
489  }
490  infile.close();
500  infile.open(a_tovinputfile.c_str(), ios::in);
501  //check if there is an input file
502  if (!infile.is_open()) {
503  g_msg->Warn("PollenNectarDevelopmentData::PollenNectarDevelopmentData Cannot open the file", a_toleinputfile.c_str());
504  exit(1);
505  }
506  infile >> no_curves;
507  int tole, tolecurvenum;
508  for (int i = 0; i < no_curves-1; i++)
509  {
510  infile >> tole >> tolecurvenum;
511  // convert from the reference number to tov type
512  tole = a_land->TranslateVegTypes(tole);
513  // store the reference in the pollen nectar lookup table
514  m_tole_pollencurvetable[tole] = tolecurvenum;
515  }
516  // Now read the curve themselves
517  m_tolePollenCurves.resize(no_curves);
518  m_toleNectarCurves.resize(no_curves);
519  p_curve = new PollenNectarDevelopmentCurve(&index, &empty);
520  m_tolePollenCurves[0] = p_curve;
521  m_toleNectarCurves[0] = p_curve;
522  for (int i = 1; i <= no_curves; i++)
523  {
524  // Read the curve number
525  infile >> tolecurvenum;
526  // Read in the pollen data and save
527  infile >> slopes[366];
528  for (int d = 0; d < 365; d++) infile >> slopes[d];
529  p_curve = new PollenNectarDevelopmentCurve(&index, &slopes);
530  m_tolePollenCurves[tolecurvenum] = p_curve;
531  // Read in the nectar data and save
532  infile >> slopes[365];
533  for (int d = 0; d < 365; d++) infile >> slopes[d];
534  p_curve = new PollenNectarDevelopmentCurve(&index, &slopes);
535  m_toleNectarCurves[tolecurvenum] = p_curve;
536  }
537  infile.close();
538  }
539  else
540  {
542  // Set all to zero curve
543  m_tovPollenCurves.push_back(pnc);
544  m_tovNectarCurves.push_back(pnc);
545  m_tolePollenCurves.push_back(pnc);
546  m_toleNectarCurves.push_back(pnc);
547  for (int tov = 0; tov<int(tov_Undefined); tov++)
548  {
549  m_tov_pollencurvetable[tov] = 0;
550  }
551  for (int tole = 0; tole<int(tole_Foobar); tole++)
552  {
553  m_tole_pollencurvetable[tole] = 0;
554  }
555  }
556 }
557 
559 {
560  for (int i = 0; i < m_tovPollenCurves.max_size(); i++) delete m_tovPollenCurves[i];
561  for (int i = 0; i < m_tovNectarCurves.max_size(); i++) delete m_tovNectarCurves[i];
562  for (int i = 0; i < m_tolePollenCurves.max_size(); i++) delete m_tolePollenCurves[i];
563  for (int i = 0; i < m_toleNectarCurves.max_size(); i++) delete m_toleNectarCurves[i];
564 }
565 
567 {
576  if ((a_almassLEref == 0) || (g_letype->TranslateEleTypes(a_almassLEref) == tole_Field) || (g_letype->TranslateEleTypes(a_almassLEref) == tole_UnsprayedFieldMargin)) return set;
579  return set;
580 }
581 
583 {
592  return set;
593 }
594 
596 {
597  m_quantity = 0;
598  m_quality = 0;
599 
600 }
601 
602 PollenNectarQuality::PollenNectarQuality(double a_quantity, double a_quality)
603 {
604  m_quantity = a_quantity;
605  m_quality = a_quality;
606 }
tov_AgroChemIndustryCereal
Definition: tov_declaration.h:55
tov_OSpringBarleyClover
Definition: tov_declaration.h:46
tov_SpringBarleyStrigling
Definition: tov_declaration.h:58
PollenNectarDevelopmentData::m_tov_pollencurvetable
vector< int > m_tov_pollencurvetable
Definition: plants.h:242
tov_PLWinterWheatLate
Definition: tov_declaration.h:85
tov_PLSpringWheat
Definition: tov_declaration.h:75
tov_NLSpringBarley
Definition: tov_declaration.h:93
tov_NLMaizeSpring
Definition: tov_declaration.h:102
tov_Oats
Definition: tov_declaration.h:40
tole_UnsprayedFieldMargin
Definition: tole_declaration.h:72
tov_OWinterBarley
Definition: tov_declaration.h:47
tov_NLPotatoes
Definition: tov_declaration.h:92
Landscape::TranslateVegTypes
TTypesOfVegetation TranslateVegTypes(int VegReference)
Definition: landscape.h:1655
tov_OPermanentGrassGrazed
Definition: tov_declaration.h:44
PollenNectarDevelopmentData::PollenNectarDevelopmentData
PollenNectarDevelopmentData(string a_tovinputfile, string a_toleinputfile, Landscape *a_land)
Definition: plants.cpp:416
tov_PLSpringBarleySpr
Definition: tov_declaration.h:84
tov_OOats
Definition: tov_declaration.h:44
PlantGrowthData::FindCropNum
unsigned int FindCropNum(ifstream &ist)
Definition: plants.cpp:103
PlantGrowthData::PlantGrowthData
PlantGrowthData(const char *a_cropcurvefile)
Definition: plants.cpp:157
tov_OSetaside
Definition: tov_declaration.h:46
tov_PLMaizeSilage
Definition: tov_declaration.h:78
tov_OTriticale
Definition: tov_declaration.h:47
tov_MaizeStrigling
Definition: tov_declaration.h:58
g_letype
class LE_TypeClass * g_letype
Definition: elements.cpp:277
tov_OWinterWheatUndersown
Definition: tov_declaration.h:49
tov_Undefined
Definition: tov_declaration.h:114
tov_FieldPeasStrigling
Definition: tov_declaration.h:56
tov_WinterBarleyStrigling
Definition: tov_declaration.h:59
tov_NLBeetSpring
Definition: tov_declaration.h:100
tov_PLFodderLucerne1
Definition: tov_declaration.h:81
tov_WinterWheat
Definition: tov_declaration.h:55
PollenNectarDevelopmentCurveSet
Definition: plants.h:209
tov_OCloverGrassSilage1
Definition: tov_declaration.h:43
tov_PermanentGrassTussocky
Definition: tov_declaration.h:49
tov_PLWinterTriticale
Definition: tov_declaration.h:73
PollenNectarDevelopmentData::m_tolePollenCurves
vector< PollenNectarDevelopmentCurve * > m_tolePollenCurves
Definition: plants.h:240
tov_Heath
Definition: tov_declaration.h:66
ls.h
tov_OCloverGrassGrazed2
Definition: tov_declaration.h:43
tov_PLPotatoes
Definition: tov_declaration.h:79
tov_NLCabbage
Definition: tov_declaration.h:95
PollenNectarDevelopmentCurveSet::m_pollencurveptr
PollenNectarDevelopmentCurve * m_pollencurveptr
Definition: plants.h:211
tov_PLBeet
Definition: tov_declaration.h:80
tov_PermanentSetaside
Definition: tov_declaration.h:49
tov_Lawn
Definition: tov_declaration.h:63
tov_NLSpringBarleySpring
Definition: tov_declaration.h:104
tov_PLWinterRye
Definition: tov_declaration.h:74
tov_OSpringBarley
Definition: tov_declaration.h:46
tov_Setaside
Definition: tov_declaration.h:50
PollenNectarDevelopmentData::m_toleNectarCurves
vector< PollenNectarDevelopmentCurve * > m_toleNectarCurves
Definition: plants.h:241
tov_OrchardCrop
Definition: tov_declaration.h:65
tov_SpringBarleySeed
Definition: tov_declaration.h:52
tov_SpringBarleySKManagement
Definition: tov_declaration.h:65
tov_WWheatPToxicControl
Definition: tov_declaration.h:55
tov_NLMaize
Definition: tov_declaration.h:91
tov_OWinterWheat
Definition: tov_declaration.h:66
tov_SpringBarleyStriglingCulm
Definition: tov_declaration.h:62
tov_FieldPeasSilage
Definition: tov_declaration.h:65
tov_OCarrots
Definition: tov_declaration.h:43
tov_NLGrassGrazedLast
Definition: tov_declaration.h:108
PollenNectarDevelopmentData::GetPollenNectarCurvePtr
PollenNectarDevelopmentCurveSet GetPollenNectarCurvePtr(int a_almassLEref)
Definition: plants.cpp:566
tole_Foobar
Definition: tole_declaration.h:111
tov_OBarleyPeaCloverGrass
Definition: tov_declaration.h:41
CropGrowth
Definition: plants.h:67
tov_WinterWheatShort
Definition: tov_declaration.h:56
g_msg
class MapErrorMsg * g_msg
Definition: maperrormsg.cpp:41
tov_NorwegianOats
Definition: tov_declaration.h:68
PlantGrowthData::m_num_crops
int m_num_crops
Definition: plants.h:84
LE_TypeClass::TranslateEleTypes
TTypesOfLandscapeElement TranslateEleTypes(int EleReference)
Definition: elements.cpp:2995
Landscape
The landscape class containing all environmental and topographical data.
Definition: landscape.h:112
tov_YoungForest
Definition: tov_declaration.h:60
tov_OWinterBarleyExt
Definition: tov_declaration.h:65
PlantGrowthData::FindDiff
double FindDiff(double a_ddegs, double a_yddegs, int a_plant, int a_phase, int a_type)
Definition: plants.cpp:43
tov_NorwegianSpringBarley
Definition: tov_declaration.h:68
tov_SpringBarleySilage
Definition: tov_declaration.h:52
tov_NLGrassGrazed1Spring
Definition: tov_declaration.h:107
PollenNectarDevelopmentData::tovGetPollenNectarCurvePtr
PollenNectarDevelopmentCurveSet tovGetPollenNectarCurvePtr(int a_tov_ref)
Definition: plants.cpp:582
tov_DummyCropPestTesting
Definition: tov_declaration.h:112
TTypesOfVegetation
TTypesOfVegetation
Definition: tov_declaration.h:30
CropGrowth::m_start
double m_start[5][3]
Definition: plants.h:72
tov_SpringRape
Definition: tov_declaration.h:53
PollenNectarQuality::m_quantity
double m_quantity
Definition: plants.h:219
PlantGrowthData::m_growth
vector< CropGrowth * > m_growth
Definition: plants.h:82
tov_PotatoesIndustry
Definition: tov_declaration.h:50
tov_SpringBarleyPTreatment
Definition: tov_declaration.h:63
tov_FodderGrass
Definition: tov_declaration.h:62
PlantGrowthData::m_numbers
vector< int > m_numbers
Definition: plants.h:83
tov_PLBeetSpr
Definition: tov_declaration.h:86
tov_PlantNursery
Definition: tov_declaration.h:66
tov_NLCatchPeaCrop
Definition: tov_declaration.h:106
tov_Carrots
Definition: tov_declaration.h:31
tov_NLCarrotsSpring
Definition: tov_declaration.h:101
CfgBool
Bool configurator entry class.
Definition: configurator.h:127
PollenNectarDevelopmentData::m_tovNectarCurves
vector< PollenNectarDevelopmentCurve * > m_tovNectarCurves
Definition: plants.h:239
tov_NLPotatoesSpring
Definition: tov_declaration.h:103
tov_SpringBarleyCloverGrass
Definition: tov_declaration.h:52
tov_WinterRape
Definition: tov_declaration.h:53
tov_OGrazingPigs
Definition: tov_declaration.h:44
tov_SugarBeet
Definition: tov_declaration.h:66
tov_NLBeet
Definition: tov_declaration.h:89
tov_NorwegianPotatoes
Definition: tov_declaration.h:68
tov_OSBarleySilage
Definition: tov_declaration.h:56
CropGrowth::CropGrowth
CropGrowth(void)
Definition: plants.cpp:216
tov_SpringBarleyPeaCloverGrassStrigling
Definition: tov_declaration.h:60
tov_PermanentGrassGrazed
Definition: tov_declaration.h:49
CropGrowth::m_start_valid
bool m_start_valid[5]
Definition: plants.h:73
tov_CloverGrassGrazed2
Definition: tov_declaration.h:33
maperrormsg.h
tov_WWheatPControl
Definition: tov_declaration.h:55
tov_PLWinterRape
Definition: tov_declaration.h:71
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: maperrormsg.cpp:59
tov_PLBeans
Definition: tov_declaration.h:87
tov_SpringBarleyCloverGrassStrigling
Definition: tov_declaration.h:58
PollenNectarDevelopmentCurve
A standard class to contain a pollen or nectar curve based on indexed rates.
Definition: plants.h:183
tov_Potatoes
Definition: tov_declaration.h:50
tov_WinterRyeStrigling
Definition: tov_declaration.h:59
tov_PLWinterBarley
Definition: tov_declaration.h:72
tov_WinterWheatStriglingCulm
Definition: tov_declaration.h:62
tov_NLTulips
Definition: tov_declaration.h:96
tov_WinterRapeStrigling
Definition: tov_declaration.h:59
tov_OMaizeSilage
Definition: tov_declaration.h:65
tov_Maize
Definition: tov_declaration.h:36
tov_OWinterRape
Definition: tov_declaration.h:47
tov_WWheatPTreatment
Definition: tov_declaration.h:55
g_crops
class PlantGrowthData * g_crops
Definition: plants.cpp:41
tov_FieldPeas
Definition: tov_declaration.h:34
tov_SpringBarleyStriglingSingle
Definition: tov_declaration.h:60
tov_BroadBeans
Definition: tov_declaration.h:66
PlantGrowthData
Definition: plants.h:81
tov_Wasteland
Definition: tov_declaration.h:66
PollenNectarDevelopmentCurveSet::m_nectarcurveptr
PollenNectarDevelopmentCurve * m_nectarcurveptr
Definition: plants.h:212
tov_NLGrassGrazed1
Definition: tov_declaration.h:97
PlantGrowthData::~PlantGrowthData
~PlantGrowthData()
Definition: plants.cpp:210
tov_OSeedGrass1
Definition: tov_declaration.h:46
tov_OFodderBeet
Definition: tov_declaration.h:65
tov_NLWinterWheat
Definition: tov_declaration.h:94
tov_PLMaize
Definition: tov_declaration.h:77
tov_OCloverGrassGrazed1
Definition: tov_declaration.h:43
tov_OSpringBarleyPigs
Definition: tov_declaration.h:47
tov_SpringBarleySpr
Definition: tov_declaration.h:66
PollenNectarQuality::PollenNectarQuality
PollenNectarQuality()
Definition: plants.cpp:595
tov_PLSpringBarley
Definition: tov_declaration.h:76
PollenNectarDevelopmentData::m_tovPollenCurves
vector< PollenNectarDevelopmentCurve * > m_tovPollenCurves
Definition: plants.h:238
tov_PermanentGrassLowYield
Definition: tov_declaration.h:63
tov_WinterWheatStrigling
Definition: tov_declaration.h:59
tole_Field
Definition: tole_declaration.h:43
tov_WinterWheatStriglingSingle
Definition: tov_declaration.h:62
WARN_FILE
Definition: maperrormsg.h:37
tov_PLCarrots
Definition: tov_declaration.h:83
tov_WinterBarley
Definition: tov_declaration.h:53
tov_NaturalGrass
Definition: tov_declaration.h:37
FloatToDouble
void FloatToDouble(double &, float)
tov_SeedGrass2
Definition: tov_declaration.h:50
tov_WaterBufferZone
Definition: tov_declaration.h:110
tov_MaizeSilage
Definition: tov_declaration.h:62
PlantGrowthData::SetVegNum
void SetVegNum(unsigned int a_i, ifstream &ist, const char *a_cropcurvefile)
Definition: plants.cpp:131
tov_NoGrowth
Definition: tov_declaration.h:38
tov_OPotatoes
Definition: tov_declaration.h:44
tov_OSeedGrass2
Definition: tov_declaration.h:46
configurator.h
PlantGrowthData::VegTypeToCurveNum
int VegTypeToCurveNum(TTypesOfVegetation VegReference)
Definition: plants.cpp:226
tov_NLGrassGrazed2
Definition: tov_declaration.h:98
tov_OFieldPeasSilage
Definition: tov_declaration.h:56
tov_SpringBarley
Definition: tov_declaration.h:52
tov_OWinterRye
Definition: tov_declaration.h:49
tov_NLCarrots
Definition: tov_declaration.h:90
tov_CloverGrassGrazed1
Definition: tov_declaration.h:32
PlantGrowthData::StartValid
bool StartValid(int a_veg_type, int a_phase)
Definition: plants.cpp:409
tov_OFieldPeas
Definition: tov_declaration.h:43
PollenNectarDevelopmentData::m_tole_pollencurvetable
vector< int > m_tole_pollencurvetable
Definition: plants.h:243
tov_FodderBeet
Definition: tov_declaration.h:35
tov_WinterRye
Definition: tov_declaration.h:55
tov_PLFodderLucerne2
Definition: tov_declaration.h:82
tov_Triticale
Definition: tov_declaration.h:53
cfg_pollen_nectar_on
CfgBool cfg_pollen_nectar_on
Flag to determine whether nectar and pollen models are used - should be set to true for pollinator mo...
tov_PLWinterWheat
Definition: tov_declaration.h:70
CfgBool::value
bool value(void)
Definition: configurator.h:135
tov_NLPermanentGrassGrazed
Definition: tov_declaration.h:99
MaxNoInflections
const unsigned int MaxNoInflections
Definition: plants.h:41
tov_SeedGrass1
Definition: tov_declaration.h:50
tov_OSpringBarleyGrass
Definition: tov_declaration.h:46
PollenNectarDevelopmentData::~PollenNectarDevelopmentData
~PollenNectarDevelopmentData()
Definition: plants.cpp:558
tov_OSpringBarleyExt
Definition: tov_declaration.h:63
PollenNectarQuality::m_quality
double m_quality
Definition: plants.h:220
tov_NLCabbageSpring
Definition: tov_declaration.h:105