ALMaSS Partridge ODdox  1.1
The partridge model description following ODdox protocol
landscape.h
Go to the documentation of this file.
1 // Landscape.h
2 //
3 /*
4 *******************************************************************************************************
5 Copyright (c) 2011, Christopher John Topping, University of Aarhus
6 All rights reserved.
7 
8 Redistribution and use in source and binary forms, with or without modification, are permitted provided
9 that the following conditions are met:
10 
11 Redistributions of source code must retain the above copyright notice, this list of conditions and the
12 following disclaimer.
13 Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
14 the following disclaimer in the documentation and/or other materials provided with the distribution.
15 
16 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
17 IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
18 FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS
19 BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
20 BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
21 BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22 LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
23 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 ********************************************************************************************************
25 */
26 
27 #define _CRTDBG_MAP_ALLOC
28 
29 #ifndef TLANDSCAPE_H
30 #define TLANDSCAPE_H
31 
32 #include <vector>
33 #include <fstream>
34 
35 // General
36 const int January = 0;
37 const int February = 31;
38 const int March = 59;
39 const int April = 90;
40 const int May = 120;
41 const int June = 151;
42 const int July = 181;
43 const int August = 212;
44 const int September = 243;
45 const int October = 273;
46 const int November = 304;
47 const int December = 334;
48 
49 // m_polymapping is a mapping from polygon numbers into
50 // the list of landscape elements, m_elems.
51 
52 extern class Pesticide *g_pest;
53 
54 class RasterMap;
55 class SkTerritories;
56 class RodenticidePredators_Population_Manager;
57 class PesticideMap;
61 };
62 
64 
66 {
77 };
78 
81 {
82  int polyref;
83  int geese;
84  int geesesp[gs_foobar];
86  int geesespTimed[gs_foobar];
87  int roostdists[gs_foobar];
88  double openness;
89  double grain;
90  double maize;
91  double grass[gs_foobar]; // Available grass forage is species specific
93  std::string vegtypechr;
94  double vegheight;
95  double digestability;
96  int vegphase;
97  std::string previouscrop;
98  std::string lastsownveg;
99  std::string debugveg;
100 };
101 
103 typedef std::vector<GooseFieldListItem> GooseFieldList;
104 
105 
106 //------------------------------------------------------------------------------
107 
113 {
114  // Version info. Initialized by the constructor.
115  char m_versioninfo[30];
116 
118  //vector<Farm*> m_farms;
120 
122  vector<LE*> m_elems;
123 
126 
130  vector<int> m_polymapping;
131 
134 
135  // For correcting coordinates before modulus operations.
136  // Put here so we saves an indirection when doing inline
137  // function calls.
138  int m_width;
139  int m_height;
144 
151 
152  // For veg area dumps
156 
157  RodenticideManager *m_RodenticideManager;
158  RodenticidePredators_Population_Manager* m_RodenticidePreds;
163 
164 #ifdef __RECORDFARMEVENTS
165  ofstream *m_farmeventfile;
166 #endif
167 
168 public:
169  void FillVegAreaData();
170  inline double GetVegArea(int v) { return l_vegtype_areas[v]; }
171  void DumpVegAreaData(int a_day);
172  void SkylarkEvaluation(SkTerritories* a_skt);
173  void RodenticidePredatorsEvaluation(RodenticidePredators_Population_Manager* a_rppm);
178  int SupplyFarmAnimalCensus(int a_farm_ref, int a_LifeStage);
179  int SupplyVegPhase(int a_poly) {
180  return m_elems[m_polymapping[a_poly]]->GetVegPhase();
181  }
182  void SetPolymapping(int a_index, int a_val) { m_polymapping[a_index] = a_val; }
183  int GetPolymapping(int a_index) { return m_polymapping[a_index]; }
184 #ifdef __RECORDFARMEVENTS
185  void RecordEvent(int a_event, int a_day, int a_year) {
186  (*m_farmeventfile) << a_event << '\t' << a_day << '\t' << a_year << endl;
187  }
188 #endif
189 protected:
191  void GISASCII_Output(string outpfile, int UTMX, int UTMY);
192 // Array for containing the treatment counts.
195  void AddGreenElement( LE *a_green );
197  vector <int>m_PondIndexList;
199  vector <int>m_PondRefsList;
200  /*
201  void RenumberPolys(bool a_checkvalid);
202  */
203  void ReadPolys(const char *a_polyfile);
205  void ReadPolys2(const char *a_polyfile);
206  void PolysValidate(bool a_exit_on_invalid);
207  bool PolysRemoveInvalid( void );
208  void PolysDump( const char *a_filename );
209  void DumpMap( const char *a_filename );
210  void ConsolidatePolys( void );
211  void CountMapSquares(void);
212  void PolysRenumber(void);
214  { // Rebuild m_polymapping.
215  unsigned int sz = (int)m_elems.size();
216  for (unsigned int i = 0; i < sz; i++)
217  {
218  m_polymapping[m_elems[i]->GetMapIndex()] = i;
219  }
220  }
221  void ForceArea(void);
222  void ChangeMapMapping( void );
225  void RemoveMissingValues();
226  void TestCropManagement( void ); // Optional, configurable.
227  void VegDump(int x,int y);
228  void EventDump(int x,int y, int x2, int y2);
229  void EventDumpPesticides( int x1, int y1 );
231  void DegreesDump();
232  bool BorderNeed( TTypesOfLandscapeElement a_letype );
233  void BorderAdd(LE* a_field, TTypesOfLandscapeElement a_type);
234  void BorderRemoval( void );
236  int RemoveSmallPolygons( void );
238  void CreatePondList();
239  //void OrchardBorderAdd ( LE* a_field );
240  void UnsprayedMarginAdd ( LE* a_field );
241  void UnsprayedMarginScan( LE* a_field, int a_width );
242  void BorderScan( LE* a_field, int a_width );
243  bool BorderTest( int a_fieldpoly, int a_borderpoly, int a_x, int a_y );
244  bool StepOneValid( int a_polyindex, int a_x, int a_y, int step );
245  bool UMarginTest( int a_fieldpoly, int a_borderpoly,int a_x, int a_y, int a_width );
246  bool FindValidXY(int a_field, int &a_x, int &a_y);
247  bool BorderStep(int a_fieldpoly, int a_borderpoly, int* a_x, int* a_y);
248  bool BorderStep(int a_fieldpoly, int a_borderpoly, APoint* a_coord);
249  // int BorderJump( int a_add );
250 
252  bool BeetleBankPossible( LE * a_field, TTypesOfLandscapeElement a_tole );
253  void BeetleBankAdd(int x, int y, int angle, int length , LE* a_field, TTypesOfLandscapeElement a_tole);
254  bool FindFieldCenter(LE* a_field, int* x, int* y);
255  int FindLongestAxis(int* x, int* y, int* a_length);
256  void AxisLoop(int a_poly, int* a_x, int* a_y, int a_axis);
257  void AxisLoop(int a_poly, APoint* a_cor, int a_axis);
258  void AxisLoopLtd(int a_poly, APoint* a_cor, int a_axis, int a_limit);
259  // List of private methods and member elements, which are needed
260  // when adding artificial hedgebanks. Forget I did this. One should
261  // never store what is essentially local variables within the main
262  // class definition.
263  vector<int> hb_hedges;
264  vector<LE*> hb_new_hbs;
265 
266  int m_x_add[ 8 ];
267  int m_y_add[ 8 ];
268  int* hb_map;
269  int hb_width;
271  int hb_size;
279 
280  void hb_Add( void );
281  void hb_AddNewHedgebanks( int a_orig_poly_num );
282  int hb_StripingDist( void );
283  void hb_GenerateHBPolys( void );
284  void hb_FindHedges( void );
285  bool hb_FindBoundingBox( int a_poly_num );
286  void hb_UpPolyNumbers( void );
287  void hb_ClearPolygon( int a_poly_num );
288  void hb_PaintBorder( int a_color );
289  bool hb_MapBorder( int a_x, int a_y );
290  bool hb_HasOtherNeighbour( int a_x, int a_y );
291  bool hb_PaintWhoHasNeighbourColor( int a_neighbour_color,
292  int a_new_color );
293  bool hb_HasNeighbourColor( int a_x, int a_y,
294  int a_neighbour_color );
295  void hb_MarkTopFromLocalMax( int a_color );
296  void hb_MarkTheBresenhamWay( void );
297  int hb_MaxUnpaintedNegNeighbour( int a_x, int a_y );
298  void hb_ResetColorBits( void );
299  void hb_RestoreHedgeCore( int a_orig_poly_number );
300  void hb_DownPolyNumbers( void );
301  void hb_Cleanup( void );
302 
303  //#define HB_TESTING
304 
305  void DumpMapGraphics( const char *a_filename );
306 
307 #ifdef HB_TESTING
308  void hb_dump_map( int a_beginx, int a_width,
309  int a_beginy, int a_height,
310  char* a_filename,
311  bool a_high_numbers );
312  int hb_dump_color( int a_x, int a_y,
313  bool a_high_numbers );
314 #endif
315 
316  // The pesticide engine should I spray flag
318  // For the LE signal loop.
320 
321  void DumpTreatCounters( const char* a_filename );
322 
323  bool CIPELandscapeMaker();
324 
325 public:
326  ~Landscape( void );
327  Landscape( void );
328  //** \brief Things to do when closing the simulation */
330  // Tick() and TurnTheWorld() are identical, the last one is retained
331  // for historical reasons.
332  void Tick( void );
333  void TurnTheWorld( void );
334 
336  int HowManyPonds() { return int(m_PondIndexList.size()); }
338  int SupplyRandomPondIndex();
340  int SupplyRandomPondRef();
342  int SupplyPondIndex(int a_pondref) {
343  for (int i = 0; i < m_PondIndexList.size(); i++) {
344  if (m_PondRefsList[i] == a_pondref) return m_PondIndexList[i];
345  }
346  return -1;
347  }
349  void SetMaleNewtPresent(int a_InPondIndex) { m_elems[a_InPondIndex]->SetMaleNewtPresent(true); }
351  bool SupplyMaleNewtPresent(int a_InPondIndex) { return m_elems[a_InPondIndex]->IsMaleNewtPresent(); }
352  Farm* SupplyFarmPtr(int a_owner) { return m_FarmManager->GetFarmPtr(a_owner); }
354 
356 
358 
359  double SupplyVegDigestabilityVector( unsigned int a_index );
360  double SupplyVegDigestability( int a_polyref );
361  double SupplyVegDigestability( int a_x, int a_y );
362 
363  double SupplyVegHeightVector( unsigned int a_index );
364  double SupplyVegHeight( int a_polyref );
365  double SupplyVegHeight( int a_x, int a_y );
366 
367  double SupplyVegBiomassVector( unsigned int a_index );
368  double SupplyVegBiomass( int a_polyref );
369  double SupplyVegBiomass( int a_x, int a_y );
370 
371  int SupplyVegDensity( int a_polyref );
372  int SupplyVegDensity( int a_x, int a_y );
373 
374  double SupplyWeedBiomass( int a_polyref );
375  double SupplyWeedBiomass( int a_x, int a_y );
376 
377  PollenNectarQuality SupplyPollen(int a_polyref) { return m_elems[a_polyref]->GetPollen(); };
378  PollenNectarQuality SupplyPollen(int a_x, int a_y) { return m_elems[m_land->Get(a_x, a_y)]->GetPollen(); };
379  double SupplyTotalPollen(int a_polyref) { return m_elems[a_polyref]->GetTotalPollen(); };
380  double SupplyTotalPollen(int a_x, int a_y) { return m_elems[m_land->Get(a_x, a_y)]->GetTotalPollen(); };
381  PollenNectarQuality SupplyNectar(int a_polyref) { return m_elems[a_polyref]->GetNectar(); };
382  PollenNectarQuality SupplyNectar(int a_x, int a_y) { return m_elems[m_land->Get(a_x, a_y)]->GetNectar(); };
383  double SupplyTotalNectar(int a_polyref) { return m_elems[a_polyref]->GetTotalNectar(); };
384  double SupplyTotalNectar(int a_x, int a_y) { return m_elems[m_land->Get(a_x, a_y)]->GetTotalNectar(); };
385 
386  bool SupplySkScrapes(int a_polyref);
387 
388  bool SupplyVegPatchy( int a_polyref );
389  bool SupplyVegPatchy( int a_x, int a_y );
390 
391  double SupplyGreenBiomass( int a_polyref );
392  double SupplyGreenBiomass( int a_x, int a_y );
393 
394  double SupplyDeadBiomass( int a_polyref );
395  double SupplyDeadBiomass( int a_x, int a_y );
396 
397  double SupplyLAGreen( int a_polyref );
398  double SupplyLAGreen( int a_x, int a_y );
399  double SupplyLATotal( int a_x, int a_y );
400 
401  double SupplyVegCover( int a_polyref );
402  double SupplyVegCoverVector( unsigned int a_index );
403  double SupplyVegCover( int a_x, int a_y );
404  TTypesOfVegetation SupplyLastSownVeg(int a_polyref);
405  TTypesOfVegetation SupplyLastSownVeg(int a_x, int a_y);
406  TTypesOfVegetation SupplyLastSownVegVector(unsigned int a_index);
407 
408  double SupplyInsects( int a_polyref );
409  double SupplyInsects( int a_x, int a_y );
411  bool SubtractPondLarvalFood(double a_food, int a_polyrefindex);
413  void CheckForPesticideRecord(LE * a_field, TTypesOfPesticideCategory a_pcide);
415  double SupplyRodenticide(int a_x, int a_y);
419  double SupplyPesticide(int a_x, int a_y, PlantProtectionProducts a_ppp);
421  bool SupplyOverspray(int a_x, int a_y);
423  double SupplyPesticideP(int a_x, int a_y, PlantProtectionProducts a_ppp);
425  double SupplyPesticideS(int a_x, int a_y, PlantProtectionProducts a_ppp);
427  double SupplyPesticide(int a_polyref, PlantProtectionProducts a_ppp);
429  double SupplyPesticideP(int a_polyref, PlantProtectionProducts a_ppp);
431  double SupplyPesticideS(int a_polyref, PlantProtectionProducts a_ppp);
432  RodenticidePredators_Population_Manager* SupplyRodenticidePredatoryManager() { return m_RodenticidePreds; }
437  void ResetGrainAndMaize();
439  void CalculateOpenness(bool a_realcalc);
441  void WriteOpenness( void );
443  void ReadOpenness( void );
445  int CalulateFieldOpennessCentroid(int a_pref);
447  int CalulateFieldOpennessAllCells(int a_pref);
449  int LineHighTest(int a_cx, int a_cy, double a_offsetx, double a_offsety);
451  int SupplyOpenness(int a_poly) { return m_elems[m_polymapping[ a_poly ]]->GetOpenness(); }
453  int SupplyOpenness(int a_x, int a_y) { return m_elems[ m_land->Get( a_x, a_y )]->GetOpenness(); }
455  bool SupplyLEHigh(int a_x, int a_y) { return m_elems[ m_land->Get( a_x, a_y ) ]->GetHigh(); }
457  polylist* SupplyLargeOpenFieldsNearXY(int x, int y, int range, int a_openness );
458 
460  int SupplySoilType( int a_x, int a_y ) {
461  return m_elems[ m_land->Get( a_x, a_y ) ]->GetSoilType( );
462  }
464  int SupplySoilTypeR( int a_x, int a_y ) {
465  return m_elems[ m_land->Get( a_x, a_y ) ]->GetSoilTypeR( );
466  }
467 
468  APoint SupplyCentroid( int a_polyref );
469  APoint SupplyCentroidIndex( int a_polyrefindex );
470  int SupplyCentroidX( int a_polyref ) {
471  return m_elems[ m_polymapping[ a_polyref ] ]->GetCentroidX();
472  }
473  int SupplyCentroidY( int a_polyref ) { return m_elems[m_polymapping[ a_polyref ]]->GetCentroidY(); }
474  int SupplyCentroidX( int a_x, int a_y ) { return m_elems[ m_land->Get( a_x, a_y )]->GetCentroidX(); }
475  int SupplyCentroidY( int a_x, int a_y ) { return m_elems[ m_land->Get( a_x, a_y )]->GetCentroidY(); }
476 
477  int SupplyFarmIntensity( int a_x, int a_y );
478  int SupplyFarmIntensity( int a_polyref );
479  int SupplyFarmIntensityI( int a_polyindex );
480 
482  TTypesOfLandscapeElement SupplyElementType( int a_x, int a_y );
483  TTypesOfLandscapeElement SupplyElementTypeCC( int a_x, int a_y );
484 
485  int SupplyCountryDesig( int a_x, int a_y );
486 
487  int SupplyElementSubType( int a_polyref );
488  int SupplyElementSubType( int a_x, int a_y );
489 
490  TTypesOfVegetation SupplyVegType(int a_x, int a_y);
491  TTypesOfVegetation SupplyVegType(int polyref);
492  TTypesOfVegetation SupplyVegTypeVector( unsigned int a_index );
493  int SupplyGrazingPressureVector(unsigned int a_index);
494  int SupplyGrazingPressure(int a_polyref);
495  int SupplyGrazingPressure(int a_x, int a_y);
496  bool SupplyIsCereal(int a_polyref);
497  bool SupplyIsMatureCereal(int a_polyref);
498  bool SupplyIsGrass(int a_polyref);
499  bool SupplyIsGrass2(TTypesOfVegetation a_vege_type);
500  bool SupplyIsCereal2(TTypesOfVegetation a_vege_type);
501  bool SupplyHasTramlines( int a_x, int a_y );
502  bool SupplyHasTramlines( int a_polyref );
503  bool SupplyJustMownVector( unsigned int a_index );
504  bool SupplyJustMown( int a_polyref );
505  int SupplyJustSprayedVector( unsigned int a_index );
506  int SupplyJustSprayed( int a_polyref );
507  int SupplyJustSprayed( int a_x, int a_y );
508  int SupplyTreeAge(int a_Polyref);
509  int SupplyTreeAge(int /* a_x */, int /* a_y */) {return 0;}
510  int SupplyVegAge(int a_Polyref);
511  int SupplyVegAge(int a_x, int a_y);
512  int SupplyNumberOfFarms();
513  int SupplyFarmOwner( int a_x, int a_y );
514  int SupplyFarmOwner( int a_polyref );
515  int SupplyFarmOwnerIndex( int a_x, int a_y );
516  int SupplyFarmOwnerIndex( int a_polyref );
517 
518  TTypesOfFarm SupplyFarmType( int a_polyref );
519  TTypesOfFarm SupplyFarmType( int a_x, int a_y );
520  TTypesOfOptFarms SupplyOptFarmType (int a_x, int a_y); //AM, 270813
521  int SupplyFarmArea( int a_polyref );
522  double SupplyPolygonAreaVector( int a_polyref );
523  double SupplyPolygonArea( int a_polyref ) { return m_elems[ m_polymapping[ a_polyref ]]->GetArea(); }
524 
528  void SetBirdSeedForage(int a_polyref, double a_fooddensity)
529  {
530  m_elems[m_polymapping[a_polyref]]->SetBirdSeed(a_fooddensity);
531  }
535  void SetBirdMaizeForage( int a_polyref, double a_fooddensity ) {
536  m_elems[ m_polymapping[ a_polyref ] ]->SetBirdMaize( a_fooddensity );
537  }
541  double SupplyGooseGrazingForageH( double a_height, GooseSpecies a_goose)
542  {
548  if (a_goose == gs_Pinkfoot)
549  {
550  return m_GooseIntakeRateVSVegetationHeight_PF->GetY( a_height );
551  }
552  if (a_goose == gs_Barnacle)
553  {
554  if (a_height == 0.0) return 0.0;
555  else return m_GooseIntakeRateVSVegetationHeight_BG->GetY(a_height);
556  }
557  if (a_goose == gs_Greylag)
558  {
559  return m_GooseIntakeRateVSVegetationHeight_GL->GetY(a_height);
560  }
561  Warn("Landscape::SupplyGooseGrazingForage", "Unknown Goose Type");
562  exit(1);
563  }
564 
567  double SupplyGooseGrazingForageH(int a_polygon, GooseSpecies a_goose)
568  {
574  if (a_goose == gs_Pinkfoot)
575  {
576  return m_GooseIntakeRateVSVegetationHeight_PF->GetY(m_elems[m_polymapping[a_polygon]]->GetVegHeight());
577  }
578  if (a_goose == gs_Barnacle)
579  {
580  return m_GooseIntakeRateVSVegetationHeight_BG->GetY(m_elems[m_polymapping[a_polygon]]->GetVegHeight());
581  }
582  if (a_goose == gs_Greylag)
583  {
584  return m_GooseIntakeRateVSVegetationHeight_GL->GetY(m_elems[m_polymapping[a_polygon]]->GetVegHeight());
585  }
586  Warn("Landscape::SupplyGooseGrazingForage", "Unknown Goose Type");
587  exit(1);
588  }
596  double GetActualGooseGrazingForage(int a_x, int a_y, GooseSpecies a_goose)
597  {
598  return m_elems[m_land->Get(a_x, a_y)]->GetGooseGrazingForage(a_goose);
599  }
607  double GetActualGooseGrazingForage(int a_polygon, GooseSpecies a_goose)
608  {
609  return m_elems[m_polymapping[a_polygon]]->GetGooseGrazingForage(a_goose);
610  }
614  double SupplyBirdSeedForage(int a_polyref)
615  {
616  return m_elems[m_polymapping[a_polyref]]->GetBirdSeed();
617  }
621  double SupplyBirdSeedForage(int a_x, int a_y)
622  {
623  return m_elems[m_polymapping[m_land->Get(a_x, a_y)]]->GetBirdSeed();
624  }
628  double SupplyBirdMaizeForage(int a_polyref) {
629  return m_elems[m_polymapping[a_polyref]]->GetBirdMaize();
630  }
634  bool SupplyInStubble(int a_polyref) {
635  return m_elems[m_polymapping[a_polyref]]->GetStubble();
636  }
640  double SupplyBirdMaizeForage( int a_x, int a_y ) {
641  return m_elems[ m_land->Get( a_x, a_y ) ]->GetBirdMaize();
642  }
647  void RecordGooseNumbers(int a_poly, int a_number);
652  void RecordGooseSpNumbers(int a_poly, int a_number, GooseSpecies a_goose);
657  void RecordGooseNumbersTimed(int a_poly, int a_number);
662  void RecordGooseSpNumbersTimed(int a_poly, int a_number, GooseSpecies a_goose);
666  void RecordGooseRoostDist(int a_polyref, int a_dist, GooseSpecies a_goose);
670  void GrazeVegetation( int a_poly, double a_forage ) {
671  m_elems[ m_polymapping[ a_poly ] ]->GrazeVegetation( a_forage, true );
672  }
676  void GrazeVegetationTotal( int a_poly, double a_forage ) {
677  m_elems[ m_polymapping[ a_poly ] ]->GrazeVegetationTotal( a_forage );
678  }
682  int GetGooseNumbers(int a_poly);
686  int GetQuarryNumbers(int a_poly);
690  int GetGooseNumbers(int a_x, int a_y);
691 
692  int SupplyLastTreatment( int a_polyref, int *a_index );
693  int SupplyLastTreatment( int a_x, int a_y, int *a_index );
694  double GetHareFoodQuality(int a_polygon);
695 
696  // Weather data.
697 
698  // Energizer Bunny Edition. Use these if at all possible.
699  // Returns the requested data for *today* (whatever that is).
700  double SupplyGlobalRadiation( );
701  double SupplyGlobalRadiation( long a_date );
702  double SupplyRain( void );
703  double SupplyTemp( void );
704  double SupplyHumidity(void);
705  double SupplyMeanTemp(long a_date, unsigned int a_period);
706  double SupplyWind( void );
707  int SupplyWindDirection( void );
708  double SupplySnowDepth( void );
709  bool SupplySnowcover( void );
710  int SupplyDaylength( void );
711 
712  // *Yawn*! These work for all dates as expected, but
713  // they are slow, slow, slzzz....
714  double SupplyRain( long a_date );
715  double SupplyTemp( long a_date );
716  double SupplyWind( long a_date );
717  double SupplyDayDegrees(int a_polyref);
718  double SupplyRainPeriod( long a_date, int a_period );
719  double SupplyWindPeriod( long a_date, int a_period );
720  double SupplyTempPeriod(long a_date, int a_period);
721  // double SupplyGlobalRadiation( a_date );
722 
723  // Warning: Known spooky behaviour, but it works, sort of...
724  bool SupplySnowcover( long a_date );
725 
726  // Misc.
728  if ((a_tole == tole_Field)
729  || (a_tole == tole_Orchard)
730  || (a_tole == tole_PermanentSetaside)
731  || (a_tole == tole_PermPasture)
732  || (a_tole == tole_PermPastureLowYield)
733  || (a_tole == tole_PermPastureTussocky)
734  || (a_tole == tole_PermPastureTussockyWet)
735  || (a_tole == tole_Vildtager)
736  || (a_tole == tole_YoungForest)
737  || (a_tole == tole_WoodyEnergyCrop)
738  ) return true;
739  return false;
740  }
741  int SupplyPolyRef( int a_x, int a_y );
742  int SupplyPolyRefIndex( int a_x, int a_y );
743  int SupplyPolyRefCC( int a_x, int a_y );
744  int SupplySimAreaWidth( void );
745  int SupplySimAreaHeight( void );
746  int SupplySimAreaMaxExtent( void );
747  int SupplySimAreaMinExtent( void );
748  int SupplyDaylength( long a_date );
749  int SupplyDayInYear( void );
750  int SupplyHour( void );
751  int SupplyMinute( void );
752  unsigned int SupplyNumberOfPolygons( void );
754  SupplyElementTypeFromVector( unsigned int a_index );
755  int SupplyPolyRefVector( unsigned int a_index );
756  int SupplyPesticideCell(int a_polyref);
757  int SupplyValidX(int a_polyref);
758  int SupplyValidY(int a_polyref);
759 
761  double SupplyPondPesticide(int a_poly_index) { return dynamic_cast<Pond*>(m_elems[a_poly_index])->SupplyPondPesticide(); }
762 
764  void CorrectCoords(int &x, int &y);
766  APoint CorrectCoordsPt(int x, int y);
768  void CorrectCoordsPointNoWrap( APoint &a_pt );
769  int CorrectWidth( int x );
770  int CorrectHeight( int y );
771  void SetPolyMaxMinExtents( void );
772  void CalculateCentroids( void );
773  void DumpCentroids( void );
776  void CentroidSpiralOut(int a_polyref, int &a_x, int &a_y);
777  //void CentroidSpiralOutBlocks(int a_polyref, int &a_x, int &a_y);
778  const char* SupplyVersion(void) { return m_versioninfo; }
779 
780  // Debugging, warning and configuration methods.
781  void DumpPublicSymbols( const char *a_dumpfile,
782  CfgSecureLevel a_level ) {
783  g_cfg->DumpPublicSymbols( a_dumpfile, a_level );
784  }
785  void DumpAllSymbolsAndExit( const char *a_dumpfile ) {
786  g_cfg->DumpAllSymbolsAndExit( a_dumpfile );
787  }
788  bool ReadSymbols( const char *a_cfgfile ) {
789  return g_cfg->ReadSymbols( a_cfgfile );
790  }
791  void DumpMapInfoByArea( const char *a_filename,
792  bool a_append,
793  bool a_dump_zero_areas,
794  bool a_write_veg_names
795  );
796 
797  void Warn( std::string a_msg1, std::string a_msg2 );
798 
799  // This is really, really naughty, but for the sake of efficiency...
800  // SupplyMagicMapP( int a_x, int a_y ) returns a pointer to the map
801  // at position x, y. The value found through it is an internal magic
802  // number from the landscape simulator, that uniquely identifies a
803  // polygon. It is however not the polygon number. To find that one
804  // must convert the magic number via
805  // MagicMapP2PolyRef( int a_magic ).
806  //
807  int* SupplyMagicMapP( int a_x, int a_y );
808  int MagicMapP2PolyRef( int a_magic );
809 
810 // For the Roe Deer
811  int SupplyRoadWidth(int,int) {return 0;}
812  double SupplyTrafficLoad( int a_x, int a_y );
813  double SupplyTrafficLoad( int a_polyref );
814  int SupplyTreeHeight(int,int) {return 0;}
815  int SupplyUnderGrowthWidth(int,int) {return 0;}
816  int SupplyTreeHeight(int /* polyref */ ) {return 0;}
817  int SupplyUnderGrowthWidth(int /* polyref */ ) {return 0;}
818 
819 // For the debugging programmer.
820  long SupplyGlobalDate( void );
821  int SupplyYear( void );
822  int SupplyYearNumber( void );
823  int SupplyMonth( void );
824  int SupplyDayInMonth( void );
826  double SupplyNightProp() { return 1.0-g_date->GetDaylightProportion(); }
827 
828 // General use. Introduced 1/12-2003.
829 // Reset internal loop counter.
830  void SupplyLEReset( void );
831 // Returns -1 at end-of-loop, polygon ref otherwise.
832  int SupplyLENext( void );
833  int SupplyLECount( void );
834  LE_Signal SupplyLESignal( int a_polyref );
835  void SetLESignal( int a_polyref, LE_Signal a_signal );
836 
837  void IncTreatCounter( int a_treat );
838 
840  TTypesOfVegetation TranslateVegTypes(int VegReference);
841  LE* SupplyLEPointer( int a_polyref );
842 
844  int BackTranslateVegTypes(TTypesOfVegetation VegReference);
845 
846  std::string EventtypeToString( int a_event );
847  std::string PolytypeToString( TTypesOfLandscapeElement a_le_type );
848  std::string VegtypeToString( TTypesOfVegetation a_veg );
849 
850 
851  /* *********************** Bee Helper Methods *********************** */
853  void InitOsmiaBeeNesting();
854 
857  for (unsigned int s = 0; s < m_elems.size(); s++) m_elems[s]->UpdateOsmiaNesting();
858  }
859 
861  bool SupplyOsmiaNest(int a_x, int a_y) {
862  return m_elems[m_land->Get(a_x, a_y)]->GetOsmiaNest();
863  }
864 
866  void IncOsmiaNest(int a_x, int a_y) {
867  m_elems[m_land->Get(a_x, a_y)]->IncOsmiaNesting();
868  }
869 
871  void ReleaseOsmiaNest(int a_x, int a_y) {
872  m_elems[m_land->Get(a_x, a_y)]->ReleaseOsmiaNest();
873  }
874  /* ********************* End Bee Helper Methods ********************* */
875  // /** \brief Reset all polygons natural grazing level to zero */
876  // void ResetAllVoleGrazing( void )
877  // {
878  // for ( unsigned int i=0; i<m_elems.size(); i++ ) m_elems[i]->ResetVoleGrazing();
879  // }
880  // /** \brief Inc volegrazing at x,y */
881  // void IncVoleGrazing(int a_x, int a_y) { m_elems[ m_land->Get( a_x, a_y ) ]->AddVoleGrazing(1); }
882  // /** \brief Get volegrazing at x,y */
883  // double SupplyVoleGrazingDensityVector(unsigned int a_index) { return m_elems[ a_index ]->GetVoleGrazingDensity(); }
884  // /** \brief Calculate all vole grazing densities */
885  // void CalcAllVoleGrazingDensity()
886  // {
887  //for ( unsigned int i=0; i<m_elems.size(); i++ ) { m_elems[i]->CalcVoleGrazingDensity(); }
888  // }
889 
890 protected:
891 /*
892  **CJT** 19/07/2018 these appear not to be used
893  void MakeCluster(void);
894  void ReadInput(int* , int* , int* , APoint*);
895  APoint RandomLocation(void);
896  APoint GetNextSeed(int);
897  int AddToClusterList(int* , int* , int*, int*, int*);
898  void ModifyPolyRef(int* );
899 */
900 };
901 
902 
903 extern Landscape *g_map;
904 
905 inline void Landscape::TurnTheWorld( void )
906 {
907  Tick();
908 }
909 
910 // We are interested in *speed*. Inlining all the lookup functions
911 // here and in the associated classes will cost us very little
912 // but a few KB of memory.
913 
914 inline double Landscape::SupplyVegDigestabilityVector(unsigned int a_index )
915 {
916  return m_elems[ a_index ]->GetDigestability();
917 }
918 
919 inline double Landscape::SupplyVegDigestability( int a_polyref )
920 {
921  return m_elems[ m_polymapping[ a_polyref ]]->GetDigestability();
922 }
923 
924 
925 inline double Landscape::SupplyVegDigestability( int a_x, int a_y )
926 {
927  return m_elems[ m_land->Get( a_x, a_y ) ]->GetDigestability();
928 }
929 
930 
931 inline double Landscape::SupplyVegHeightVector( unsigned int a_index )
932 {
933  return m_elems[ a_index ]->GetVegHeight();
934 }
935 
936 inline double Landscape::SupplyVegHeight( int a_polyref )
937 {
938  return m_elems[ m_polymapping[ a_polyref ]]->GetVegHeight();
939 }
940 
941 inline double Landscape::SupplyVegHeight( int a_x, int a_y )
942 {
943  return m_elems[ m_land->Get( a_x, a_y ) ]->GetVegHeight();
944 }
945 
946 
947 
948 inline double Landscape::SupplyVegBiomassVector( unsigned int a_index )
949 {
950  return m_elems[ a_index ]->GetVegBiomass();
951 }
952 
953 inline double Landscape::SupplyVegBiomass( int a_polyref )
954 {
955  return m_elems[ m_polymapping[ a_polyref ]]->GetVegBiomass();
956 }
957 
958 inline double Landscape::SupplyVegBiomass( int a_x, int a_y )
959 {
960  return m_elems[ m_land->Get( a_x, a_y ) ]->GetVegBiomass();
961 }
962 
963 
964 inline double Landscape::SupplyWeedBiomass( int a_polyref )
965 {
966  return m_elems[ m_polymapping[ a_polyref ]]->GetWeedBiomass();
967 }
968 
969 
970 inline double Landscape::SupplyWeedBiomass( int a_x, int a_y )
971 {
972  return m_elems[ m_land->Get( a_x, a_y ) ]->GetWeedBiomass();
973 }
974 
975 inline int Landscape::SupplyVegDensity( int a_polyref )
976 {
977  return m_elems[ m_polymapping[ a_polyref ]]->GetVegDensity();
978 }
979 
980 
981 inline bool Landscape::SupplySkScrapes( int a_polyref )
982 {
983  return m_elems[ m_polymapping[ a_polyref ]]->GetSkScrapes();
984 }
985 
986 inline bool Landscape::SupplyVegPatchy( int a_polyref )
987 {
988  return m_elems[ m_polymapping[ a_polyref ]]->GetVegPatchy();
989 }
990 
991 
992 inline bool Landscape::SupplyVegPatchy( int a_x, int a_y )
993 {
994  return m_elems[ m_land->Get( a_x, a_y ) ]->GetVegPatchy();
995 }
996 
997 
998 inline int Landscape::SupplyVegDensity( int a_x, int a_y )
999 {
1000  return m_elems[ m_land->Get( a_x, a_y ) ]->GetVegDensity();
1001 }
1002 
1003 
1004 inline double Landscape::SupplyLATotal( int a_x, int a_y )
1005 {
1006  return m_elems[ m_land->Get( a_x, a_y ) ]->GetLATotal();
1007 }
1008 
1009 
1010 inline double Landscape::SupplyLAGreen( int a_x, int a_y )
1011 {
1012  return m_elems[ m_land->Get( a_x, a_y ) ]->GetLAGreen();
1013 }
1014 
1015 
1016 
1017 inline double Landscape::SupplyGreenBiomass( int a_polyref )
1018 {
1019  return m_elems[ m_polymapping[ a_polyref ]]->GetGreenBiomass();
1020 }
1021 
1022 inline double Landscape::SupplyGreenBiomass( int a_x, int a_y )
1023 {
1024  return m_elems[ m_land->Get( a_x, a_y ) ]->GetGreenBiomass();
1025 }
1026 
1027 
1028 
1029 inline double Landscape::SupplyDeadBiomass( int a_polyref )
1030 {
1031  return m_elems[ m_polymapping[ a_polyref ]]->GetDeadBiomass();
1032 }
1033 
1034 inline double Landscape::SupplyDeadBiomass( int a_x, int a_y )
1035 {
1036  return m_elems[ m_land->Get( a_x, a_y ) ]->GetDeadBiomass();
1037 }
1038 
1039 
1040 
1041 inline double Landscape::SupplyLAGreen( int a_polyref )
1042 {
1043  return m_elems[ m_polymapping[ a_polyref ]]->GetLAGreen();
1044 }
1045 
1046 
1047 
1048 inline double Landscape::SupplyVegCover( int a_polyref )
1049 {
1050  return m_elems[ m_polymapping[ a_polyref ]]->GetVegCover();
1051 }
1052 
1053 inline double Landscape::SupplyVegCoverVector( unsigned int a_index )
1054 {
1055  return m_elems[ a_index ]->GetVegCover();
1056 }
1057 
1058 inline double Landscape::SupplyVegCover( int a_x, int a_y )
1059 {
1060  return m_elems[ m_land->Get( a_x, a_y ) ]->GetVegCover();
1061 }
1062 
1064 {
1065  return m_elems[a_index]->GetLastSownVeg();
1066 }
1067 
1069 {
1070  return m_elems[m_polymapping[a_polyref]]->GetLastSownVeg();
1071 }
1072 
1074 {
1075  return m_elems[m_land->Get(a_x, a_y)]->GetLastSownVeg();
1076 }
1077 
1078 inline int Landscape::SupplyVegAge(int a_polyref)
1079 {
1080  return m_elems[ m_polymapping[ a_polyref ]]->GetVegAge();
1081 }
1082 
1083 inline int Landscape::SupplyVegAge( int a_x, int a_y )
1084 {
1085  return m_elems[m_land->Get(a_x, a_y)]->GetVegAge();
1086 }
1087 
1088 inline double Landscape::SupplyInsects( int a_polyref )
1089 {
1090  return m_elems[ m_polymapping[ a_polyref ]]->GetInsectPop();
1091 }
1092 
1093 inline double Landscape::SupplyInsects( int a_x, int a_y )
1094 {
1095  return m_elems[ m_land->Get( a_x, a_y ) ]->GetInsectPop();
1096 }
1097 
1098 
1099 inline LE* Landscape::SupplyLEPointer( int a_polyref )
1100 {
1101  return m_elems[ m_polymapping[ a_polyref ]];
1102 }
1103 
1105 {
1106  return m_elems[ a_index ]->GetElementType();
1107 }
1108 
1109 
1111 {
1112  return m_elems[ m_polymapping[ a_polyref ]]->GetElementType();
1113 }
1114 
1116 {
1117  return m_elems[ m_land->Get( a_x, a_y ) ]->GetElementType();
1118 }
1119 
1120 
1121 inline int Landscape::SupplyElementSubType( int a_polyref )
1122 {
1123  return m_elems[ m_polymapping[ a_polyref ]]->GetSubType();
1124 }
1125 
1126 inline int Landscape::SupplyElementSubType( int a_x, int a_y )
1127 {
1128  return m_elems[ m_land->Get( a_x, a_y ) ]->GetSubType();
1129 }
1130 
1131 
1132 inline int Landscape::SupplyCountryDesig( int a_x, int a_y )
1133 {
1134  return m_elems[ m_land->Get( a_x, a_y ) ]->GetCountryDesignation();
1135 }
1136 
1137 
1140 {
1141  a_x = (a_x + m_width10) % m_width;
1142  a_y = (a_y + m_height10) % m_height;
1143  return m_elems[ m_land->Get( a_x, a_y ) ]->GetElementType();
1144 }
1145 
1146 
1147 
1149  return m_FarmManager->GetNoFarms();
1150 }
1151 
1152 inline int Landscape::SupplyFarmOwner( int a_x, int a_y ) {
1153  return m_elems[ m_land->Get( a_x, a_y ) ]->GetOwnerFile();
1154 }
1155 
1156 
1157 
1158 inline int Landscape::SupplyFarmOwner( int a_polyref )
1159 {
1160  return m_elems[ m_polymapping[ a_polyref ]]->GetOwnerFile();
1161 }
1162 
1163 
1164 
1165 inline int Landscape::SupplyFarmOwnerIndex( int a_x, int a_y )
1166 {
1167  return m_elems[ m_land->Get( a_x, a_y ) ]->GetOwnerIndex();
1168 }
1169 
1170 
1171 
1172 inline int Landscape::SupplyFarmOwnerIndex( int a_polyref )
1173 {
1174  return m_elems[ m_polymapping[ a_polyref ]]->GetOwnerIndex();
1175 }
1176 
1177 
1178 
1180 {
1181  return m_elems[ m_polymapping[ a_polyref ]]->GetOwner()->GetType();
1182 }
1183 
1184 
1185 
1186 inline TTypesOfFarm Landscape::SupplyFarmType( int a_x, int a_y )
1187 {
1188  return m_elems[ m_land->Get( a_x, a_y ) ]->GetOwner()->GetType();
1189 }
1190 
1192 {
1193  OptimisingFarm * opf;
1194  opf = dynamic_cast<OptimisingFarm*>(m_elems[ m_land->Get( a_x, a_y ) ]->GetOwner());
1195  return opf-> Get_farmType();
1196 }
1197 
1198 
1200 inline double Landscape::SupplyPolygonAreaVector( int a_polyref )
1201 {
1202  return m_elems[ a_polyref ]->GetArea();
1203 }
1204 
1205 
1206 inline int Landscape::SupplyFarmArea( int a_polyref )
1207 {
1208  return m_elems[ m_polymapping[ a_polyref ]]->GetOwner()->GetArea();
1209 }
1210 
1211 
1212 
1213 inline TTypesOfVegetation
1214  Landscape::SupplyVegType( int a_polyref )
1215 {
1216  return m_elems[ m_polymapping[ a_polyref ] ]->GetVegType();
1217 }
1218 
1219 inline TTypesOfVegetation
1220  Landscape::SupplyVegTypeVector( unsigned int a_index )
1221 {
1222  return m_elems[ a_index ]->GetVegType();
1223 }
1224 
1225 
1226 
1227 inline int Landscape::SupplyGrazingPressure( int a_polyref )
1228 {
1229  return m_elems[ m_polymapping[ a_polyref ] ]->GetCattleGrazing();
1230 }
1231 
1232 inline int Landscape::SupplyGrazingPressureVector( unsigned int a_index )
1233 {
1234  return m_elems[ a_index ]->GetCattleGrazing();
1235 }
1236 
1237 
1238 
1239 inline int Landscape::SupplyGrazingPressure( int a_x, int a_y )
1240 {
1241  return m_elems[ m_land->Get( a_x, a_y ) ]->GetCattleGrazing();
1242 }
1243 
1244 
1245 
1246 inline bool Landscape::SupplyHasTramlines( int a_polyref )
1247 {
1248  return m_elems[ m_polymapping[ a_polyref ] ]->HasTramlines();
1249 }
1250 
1251 
1252 inline bool Landscape::SupplyHasTramlines( int a_x, int a_y )
1253 {
1254  return m_elems[ m_land->Get( a_x, a_y ) ]->HasTramlines();
1255 }
1256 
1257 
1258 inline bool Landscape::SupplyJustMownVector( unsigned int a_index )
1259 {
1260  return m_elems[ a_index ]->IsRecentlyMown();
1261 }
1262 
1263 inline bool Landscape::SupplyJustMown( int a_polyref )
1264 {
1265  return m_elems[ m_polymapping[ a_polyref ] ]->IsRecentlyMown();
1266 }
1267 
1268 
1269 
1270 inline int Landscape::SupplyJustSprayedVector( unsigned int a_index )
1271 {
1272  return m_elems[ a_index ]->IsRecentlySprayed();
1273 }
1274 
1275 inline int Landscape::SupplyJustSprayed( int a_polyref )
1276 {
1277  return m_elems[ m_polymapping[ a_polyref ] ]->IsRecentlySprayed();
1278 }
1279 
1280 inline int Landscape::SupplyJustSprayed( int a_x, int a_y )
1281 {
1282  return m_elems[ m_land->Get( a_x, a_y ) ]->IsRecentlySprayed();
1283 }
1284 
1285 
1286 
1287 inline double Landscape::SupplyTrafficLoad( int a_polyref )
1288 {
1289  return m_elems[ m_polymapping[ a_polyref ] ]->GetTrafficLoad();
1290 }
1291 
1292 
1293 inline double Landscape::SupplyTrafficLoad( int a_x, int a_y )
1294 {
1295  return m_elems[ m_land->Get( a_x, a_y ) ]->GetTrafficLoad();
1296 }
1297 
1298 
1299 
1300 inline bool Landscape::SupplyIsCereal(int a_polyref)
1301 {
1302  return m_elems[m_polymapping[a_polyref]]->IsCereal();
1303 }
1304 
1305 inline bool Landscape::SupplyIsMatureCereal(int a_polyref)
1306 {
1307  return m_elems[m_polymapping[a_polyref]]->IsMatureCereal();
1308 }
1309 
1310 inline bool Landscape::SupplyIsGrass(int a_polyref)
1311 {
1312  return m_elems[ m_polymapping[ a_polyref ] ]->IsGrass();
1313 }
1314 
1315 inline int Landscape::SupplyTreeAge( int /* a_polyref */ )
1316 {
1317  return 1;
1318 }
1319 
1320 inline TTypesOfVegetation
1321  Landscape::SupplyVegType( int a_x, int a_y )
1322 {
1323  return m_elems[ m_land->Get( a_x, a_y ) ]->GetVegType();
1324 }
1325 
1326 inline double Landscape::SupplyDayDegrees( int a_polyref )
1327 {
1328  return m_elems[ m_polymapping[ a_polyref ]]->GetDayDegrees();
1329 }
1330 
1331 inline int Landscape::SupplyLastTreatment( int a_polyref, int *a_index )
1332 {
1333  return m_elems[ m_polymapping[ a_polyref ]]->GetLastTreatment( a_index );
1334 }
1335 
1336 inline int Landscape::SupplyLastTreatment( int a_x, int a_y, int *a_index )
1337 {
1338  return m_elems[ m_land->Get( a_x, a_y ) ]->GetLastTreatment( a_index );
1339 }
1340 
1342 {
1343  return g_weather->GetGlobalRadiation( );
1344 }
1345 
1346 inline double Landscape::SupplyGlobalRadiation( long a_date )
1347 {
1348  return g_weather->GetGlobalRadiation( a_date );
1349 }
1350 
1351 inline double Landscape::SupplyRainPeriod( long a_date, int a_period )
1352 {
1353  return g_weather->GetRainPeriod( a_date, a_period );
1354 }
1355 
1356 
1357 
1358 inline double Landscape::SupplyRain( long a_date )
1359 {
1360  return g_weather->GetRain( a_date );
1361 }
1362 
1363 
1364 
1365 inline double Landscape::SupplyRain( void )
1366 {
1367  return g_weather->GetRain();
1368 }
1369 
1370 
1371 
1372 inline double Landscape::SupplyMeanTemp( long a_date, unsigned int a_period )
1373 {
1374  return g_weather->GetMeanTemp( a_date, a_period );
1375 }
1376 
1377 
1378 
1379 inline double Landscape::SupplyTemp( long a_date )
1380 {
1381  return g_weather->GetTemp( a_date );
1382 }
1383 
1384 
1385 
1386 inline double Landscape::SupplyTemp(void)
1387 {
1388  return g_weather->GetTemp();
1389 }
1390 
1391 
1392 
1393 inline double Landscape::SupplyHumidity(void)
1394 {
1395  return g_weather->GetHumidity();
1396 }
1397 
1398 
1399 
1400 inline double Landscape::SupplyWind( long a_date )
1401 {
1402  return g_weather->GetWind( a_date );
1403 }
1404 
1405 inline double Landscape::SupplyWindPeriod( long a_date, int a_period )
1406 {
1407  return g_weather->GetWindPeriod( a_date, a_period );
1408 }
1409 
1410 inline double Landscape::SupplyTempPeriod( long a_date, int a_period )
1411 {
1412  return g_weather->GetTempPeriod( a_date, a_period );
1413 }
1414 
1415 
1416 
1417 inline double Landscape::SupplyWind( void )
1418 {
1419  return g_weather->GetWind();
1420 }
1421 
1422 
1424 {
1425  return g_weather->GetWindDirection();
1426 }
1427 
1428 
1429 
1430 inline bool Landscape::SupplySnowcover( long a_date )
1431 {
1432  return g_weather->GetSnow( a_date );
1433 }
1434 
1435 
1436 
1437 inline bool Landscape::SupplySnowcover( void )
1438 {
1439  return g_weather->GetSnow();
1440 }
1441 
1442 
1443 
1444 inline double Landscape::SupplySnowDepth( void )
1445 {
1446  return g_weather->GetSnowDepth();
1447 }
1448 
1449 
1450 
1451 inline int Landscape::SupplyPolyRefVector( unsigned int a_index )
1452 {
1453  return m_elems[ a_index ]->GetPoly();
1454 }
1455 
1456 
1457 
1458 
1459 
1460 inline unsigned int
1462 {
1463  return (unsigned int) m_elems.size();
1464 }
1465 
1466 
1467 
1468 inline int Landscape::SupplyPesticideCell(int a_polyref)
1469 {
1470  return m_elems[ m_polymapping[ a_polyref ] ]->GetPesticideCell();
1471 }
1472 
1473 
1474 inline int Landscape::SupplyValidX(int a_polyref)
1475 {
1476  return m_elems[ m_polymapping[ a_polyref ] ]->GetValidX();
1477 }
1478 
1479 
1480 
1481 inline int Landscape::SupplyValidY(int a_polyref)
1482 {
1483  return m_elems[ m_polymapping[ a_polyref ] ]->GetValidY();
1484 }
1485 
1486 
1487 
1488 inline int Landscape::SupplyPolyRef( int a_x, int a_y )
1489 {
1490  return m_elems[ m_land->Get( a_x, a_y )]->GetPoly();
1491 }
1492 
1493 inline int Landscape::SupplyPolyRefIndex( int a_x, int a_y )
1494 {
1495  return m_land->Get( a_x, a_y );
1496 }
1497 
1498 
1499 
1500 inline int Landscape::SupplyPolyRefCC( int a_x, int a_y )
1501 {
1502  a_x = (a_x + m_width10) % m_width;
1503  a_y = (a_y + m_height10) % m_height;
1504  return m_elems[ m_land->Get( a_x, a_y )]->GetPoly();
1505 }
1506 
1507 
1508 
1509 inline int* Landscape::SupplyMagicMapP( int a_x, int a_y )
1510 {
1511  return m_land->GetMagicP( a_x, a_y );
1512 }
1513 
1514 
1515 
1516 inline int Landscape::MagicMapP2PolyRef( int a_magic )
1517 {
1518  return m_elems[ a_magic ]->GetPoly();
1519 }
1520 
1521 
1522 
1523 inline int Landscape::SupplyDaylength( long a_date )
1524 {
1525  return g_date->DayLength( a_date );
1526 }
1527 
1528 
1529 
1530 inline int Landscape::SupplyDaylength( void )
1531 {
1532  return g_date->DayLength();
1533 }
1534 
1535 inline void Landscape::CorrectCoords(int &x, int &y)
1536 {
1540  x = (m_width10 + x) % m_width;
1541  y = (m_height10 + y) % m_height;
1542 }
1543 
1544 inline APoint Landscape::CorrectCoordsPt(int x, int y)
1545 {
1549  APoint pt;
1550  pt.m_x = (m_width10 + x) % m_width;
1551  pt.m_y = (m_height10 + y) % m_height;
1552  return pt;
1553 }
1554 
1555 inline void Landscape::CorrectCoordsPointNoWrap(APoint & a_pt)
1556 {
1560  if (a_pt.m_x >= m_width) a_pt.m_x = m_width - 1;
1561  if (a_pt.m_y >= m_height) a_pt.m_y = m_height - 1;
1562  if (a_pt.m_x < 0) a_pt.m_x = 0;
1563  if (a_pt.m_y < 0) a_pt.m_y = 0;
1564 }
1565 
1566 
1567 inline int Landscape::CorrectWidth( int x )
1568 {
1569  return (m_width10+x)%m_width;
1570 }
1571 
1572 
1573 inline int Landscape::CorrectHeight( int y )
1574 {
1575  return (m_height10+y)%m_height;
1576 }
1577 
1578 
1579 inline void Landscape::Warn( std::string a_msg1, std::string a_msg2 )
1580 {
1581  g_msg->Warn( WARN_MSG, a_msg1, a_msg2 );
1582 }
1586 inline int Landscape::SupplyHour( void ) {
1587  return g_date->GetHour();
1588 }
1592 inline int Landscape::SupplyMinute( void ) {
1593  return g_date->GetMinute();
1594 }
1595 
1596 inline int Landscape::SupplyDayInYear( void )
1597 {
1598  return g_date->DayInYear();
1599 }
1600 
1601 inline int Landscape::SupplyMonth( void )
1602 {
1603  return g_date->GetMonth();
1604 }
1605 
1607 {
1608  return g_date->GetDayInMonth();
1609 }
1610 
1611 inline int Landscape::SupplyYear( void )
1612 {
1613  return g_date->GetYear();
1614 }
1615 
1617 {
1618  return g_date->GetYearNumber();
1619 }
1620 
1621 inline long Landscape::SupplyGlobalDate( void )
1622 {
1623  return g_date->Date();
1624 }
1625 
1626 // Outdated.
1627 //inline int Landscape::SupplyMapSize( void )
1628 //{
1629 // return m_land->Size();
1630 //}
1631 
1633 {
1634  return m_width;
1635 }
1636 
1638 {
1639  return m_height;
1640 }
1641 
1643 {
1644  return m_maxextent;
1645 }
1646 
1649 {
1650  return g_letype->TranslateEleTypes( EleReference );
1651 }
1652 
1653 
1654 inline TTypesOfVegetation
1656 {
1657  return g_letype->TranslateVegTypes( VegReference );
1658 }
1659 
1660 
1661 inline int
1663 {
1664  return g_letype->BackTranslateEleTypes( EleReference );
1665 }
1666 
1667 
1668 inline int
1670 {
1671  return g_letype->BackTranslateVegTypes( VegReference );
1672 }
1673 #endif // LANDSCAPE_H
1674 
Landscape::SupplyVegCoverVector
double SupplyVegCoverVector(unsigned int a_index)
Definition: landscape.h:1053
LE_TypeClass::BackTranslateEleTypes
int BackTranslateEleTypes(TTypesOfLandscapeElement EleReference)
Definition: elements.cpp:3610
Landscape::CalculateCentroids
void CalculateCentroids(void)
Definition: Landscape.cpp:3040
ttop_ReproductiveEffects
Definition: landscape.h:69
Landscape::m_PondRefsList
vector< int > m_PondRefsList
List of pond polyrefs.
Definition: landscape.h:199
Landscape::hb_max_x
int hb_max_x
Definition: landscape.h:272
Landscape::m_versioninfo
char m_versioninfo[30]
Definition: landscape.h:115
Landscape::hb_width
int hb_width
Definition: landscape.h:269
Landscape::hb_MarkTopFromLocalMax
void hb_MarkTopFromLocalMax(int a_color)
Definition: hedgebanks.cpp:679
Landscape::SupplyFarmType
TTypesOfFarm SupplyFarmType(int a_polyref)
Definition: landscape.h:1179
Landscape::SupplyVegDigestability
double SupplyVegDigestability(int a_polyref)
Definition: landscape.h:919
Landscape::ResetGrainAndMaize
void ResetGrainAndMaize()
Resets all grain.
Definition: Landscape.cpp:730
Landscape::SupplyLEPointer
LE * SupplyLEPointer(int a_polyref)
Definition: landscape.h:1099
Landscape::DumpMapInfoByArea
void DumpMapInfoByArea(const char *a_filename, bool a_append, bool a_dump_zero_areas, bool a_write_veg_names)
Definition: Landscape.cpp:3652
GooseFieldListItem::grass
double grass[gs_foobar]
Definition: landscape.h:91
May
const int May
Definition: landscape.h:40
Landscape::SupplyNumberOfPolygons
unsigned int SupplyNumberOfPolygons(void)
Definition: landscape.h:1461
Landscape::SubtractPondLarvalFood
bool SubtractPondLarvalFood(double a_food, int a_polyrefindex)
Removes larval food from a pond and returns true if it was possible, otherwise false.
Definition: Landscape.cpp:664
GooseFieldListItem::lastsownveg
std::string lastsownveg
Definition: landscape.h:98
Landscape::SupplyJustSprayed
int SupplyJustSprayed(int a_polyref)
Definition: landscape.h:1275
Landscape::SupplyGreenBiomass
double SupplyGreenBiomass(int a_polyref)
Definition: landscape.h:1017
PlantProtectionProducts
PlantProtectionProducts
A list PPP names for tracking by the Pesticide class.
Definition: farm.h:420
Landscape::SupplyNumberOfFarms
int SupplyNumberOfFarms()
Definition: landscape.h:1148
Calendar::GetYear
int GetYear(void)
Definition: calendar.h:67
Landscape::TranslateVegTypes
TTypesOfVegetation TranslateVegTypes(int VegReference)
Definition: landscape.h:1655
Landscape::SupplyHumidity
double SupplyHumidity(void)
Definition: landscape.h:1393
Landscape::m_RodenticidePreds
RodenticidePredators_Population_Manager * m_RodenticidePreds
Definition: landscape.h:158
Landscape::SupplyTemp
double SupplyTemp(void)
Definition: landscape.h:1386
Landscape::SupplyPesticideDecay
bool SupplyPesticideDecay(PlantProtectionProducts a_ppp)
Returns true if there is any pesticide in the system at all at this point.
Definition: Landscape.cpp:776
Landscape::SupplyLATotal
double SupplyLATotal(int a_x, int a_y)
Definition: landscape.h:1004
Landscape::SupplyMeanTemp
double SupplyMeanTemp(long a_date, unsigned int a_period)
Definition: landscape.h:1372
Landscape::MagicMapP2PolyRef
int MagicMapP2PolyRef(int a_magic)
Definition: landscape.h:1516
Landscape::DumpMap
void DumpMap(const char *a_filename)
Definition: Landscape.cpp:1386
Landscape::hb_new_hbs
vector< LE * > hb_new_hbs
Definition: landscape.h:264
direction_nw
Definition: landscape.h:60
GooseFieldListItem::vegheight
double vegheight
Definition: landscape.h:94
Landscape::SupplyCountryDesig
int SupplyCountryDesig(int a_x, int a_y)
Definition: landscape.h:1132
Landscape::SupplyRandomPondRef
int SupplyRandomPondRef()
Returns random pond polyref.
Definition: Landscape.cpp:2610
Landscape::hb_MapBorder
bool hb_MapBorder(int a_x, int a_y)
Definition: hedgebanks.cpp:325
Landscape::SupplyJustMown
bool SupplyJustMown(int a_polyref)
Definition: landscape.h:1263
Landscape::SupplyVegType
TTypesOfVegetation SupplyVegType(int a_x, int a_y)
Definition: landscape.h:1321
Landscape::hb_PaintBorder
void hb_PaintBorder(int a_color)
Definition: hedgebanks.cpp:429
g_pest
class Pesticide * g_pest
Definition: pesticide.cpp:92
Landscape::SupplyElementType
TTypesOfLandscapeElement SupplyElementType(int a_polyref)
Definition: landscape.h:1110
Landscape::SupplySimAreaMaxExtent
int SupplySimAreaMaxExtent(void)
Definition: landscape.h:1642
Landscape::PolysDump
void PolysDump(const char *a_filename)
Definition: Landscape.cpp:1803
ttop_AcuteDelayedEffects
Definition: landscape.h:76
Landscape::CalulateFieldOpennessCentroid
int CalulateFieldOpennessCentroid(int a_pref)
Provides a measure of the shortest distance in 360 degree, e-g- looking NE % SW before tall obstacles...
Definition: Landscape.cpp:359
Landscape::SupplyShouldSpray
bool SupplyShouldSpray()
Definition: landscape.h:357
December
const int December
Definition: landscape.h:47
GooseFieldListItem::geeseTimed
int geeseTimed
Definition: landscape.h:85
Landscape::VegtypeToString
std::string VegtypeToString(TTypesOfVegetation a_veg)
Definition: Landscape.cpp:4235
Landscape::RemoveSmallPolygons
int RemoveSmallPolygons(void)
Removes small polygons from the map.
Definition: Landscape.cpp:2184
February
const int February
Definition: landscape.h:37
Landscape::SupplyVegBiomassVector
double SupplyVegBiomassVector(unsigned int a_index)
Definition: landscape.h:948
Landscape::SupplyOpenness
int SupplyOpenness(int a_x, int a_y)
Get openness for a location.
Definition: landscape.h:453
Landscape::~Landscape
~Landscape(void)
Definition: Landscape.cpp:1424
Landscape::SupplyLECount
int SupplyLECount(void)
Definition: Landscape.cpp:3562
Landscape::UMarginTest
bool UMarginTest(int a_fieldpoly, int a_borderpoly, int a_x, int a_y, int a_width)
Definition: Landscape.cpp:2669
Landscape::SupplyVegHeightVector
double SupplyVegHeightVector(unsigned int a_index)
Definition: landscape.h:931
Landscape::SupplySnowDepth
double SupplySnowDepth(void)
Definition: landscape.h:1444
Calendar::GetYearNumber
int GetYearNumber(void)
Definition: calendar.h:68
PollenNectarQuality
Definition: plants.h:215
Landscape::BorderStep
bool BorderStep(int a_fieldpoly, int a_borderpoly, int *a_x, int *a_y)
Definition: Landscape.cpp:2479
Landscape::hb_FindBoundingBox
bool hb_FindBoundingBox(int a_poly_num)
Definition: hedgebanks.cpp:243
Landscape::m_height
int m_height
Definition: landscape.h:139
polylist
vector< unsigned > polylist
Definition: farm.h:207
Landscape::SupplyLAGreen
double SupplyLAGreen(int a_polyref)
Definition: landscape.h:1041
Landscape::SupplySkScrapes
bool SupplySkScrapes(int a_polyref)
Definition: landscape.h:981
Landscape::SupplyWind
double SupplyWind(void)
Definition: landscape.h:1417
Calendar::GetHour
int GetHour(void)
Definition: calendar.h:71
Landscape::GetActualGooseGrazingForage
double GetActualGooseGrazingForage(int a_polygon, GooseSpecies a_goose)
Returns the leaf forage resource as seen from a goose standpoint at a polygon referenced by x,...
Definition: landscape.h:607
Landscape::SupplyWindDirection
int SupplyWindDirection(void)
Definition: landscape.h:1423
Landscape::RecordGooseNumbersTimed
void RecordGooseNumbersTimed(int a_poly, int a_number)
This records the number of geese on the polygon the day before at a predefined time....
Definition: Landscape.cpp:3341
Landscape::hb_AddNewHedgebanks
void hb_AddNewHedgebanks(int a_orig_poly_num)
Definition: hedgebanks.cpp:198
Landscape::SupplyOsmiaNest
bool SupplyOsmiaNest(int a_x, int a_y)
Find out whether an osmia nest can be made here.
Definition: landscape.h:861
Landscape::DumpAllSymbolsAndExit
void DumpAllSymbolsAndExit(const char *a_dumpfile)
Definition: landscape.h:785
direction_sw
Definition: landscape.h:60
Landscape::hb_MaxUnpaintedNegNeighbour
int hb_MaxUnpaintedNegNeighbour(int a_x, int a_y)
Definition: hedgebanks.cpp:548
Landscape::RemoveMissingValues
void RemoveMissingValues()
A method for replacing missing values in the map with corrected ones - slow.
Definition: Landscape.cpp:2090
Landscape::SupplyCentroidY
int SupplyCentroidY(int a_polyref)
Definition: landscape.h:473
Landscape::SupplyFarmArea
int SupplyFarmArea(int a_polyref)
Definition: landscape.h:1206
GooseFieldListItem::previouscrop
std::string previouscrop
Definition: landscape.h:97
Landscape::SetMaleNewtPresent
void SetMaleNewtPresent(int a_InPondIndex)
Sets a male as being present in a pond.
Definition: landscape.h:349
Landscape::VegDump
void VegDump(int x, int y)
Definition: Landscape.cpp:1644
July
const int July
Definition: landscape.h:42
g_letype
class LE_TypeClass * g_letype
Definition: elements.cpp:277
Landscape::GISASCII_Output
void GISASCII_Output(string outpfile, int UTMX, int UTMY)
Write ASCII file of the ALMaSS map.
Definition: Landscape.cpp:3507
Landscape::SupplyFarmPtr
Farm * SupplyFarmPtr(int a_owner)
Definition: landscape.h:352
RasterMap::Get
int Get(int a_x, int a_y)
Definition: rastermap.h:81
Landscape::CorrectCoords
void CorrectCoords(int &x, int &y)
Function to prevent wrap around errors with co-ordinates using x/y pair.
Definition: landscape.h:1535
Landscape::SupplyOpenness
int SupplyOpenness(int a_poly)
Get openness for a polygon.
Definition: landscape.h:451
ttop_NoPesticide
Definition: landscape.h:67
Landscape::SupplyGrazingPressure
int SupplyGrazingPressure(int a_polyref)
Definition: landscape.h:1227
Landscape::SupplyDaylightProp
double SupplyDaylightProp()
Definition: landscape.h:825
Landscape::SupplyBirdMaizeForage
double SupplyBirdMaizeForage(int a_polyref)
Returns the maize forage resource.
Definition: landscape.h:628
Landscape::HowManyPonds
int HowManyPonds()
Returns the number of ponds in the landscape.
Definition: landscape.h:336
Landscape::SupplyPollen
PollenNectarQuality SupplyPollen(int a_polyref)
Definition: landscape.h:377
Landscape::m_width
int m_width
Definition: landscape.h:138
April
const int April
Definition: landscape.h:39
Landscape::hb_core_pixels
int hb_core_pixels
Definition: landscape.h:275
Landscape::DumpCentroids
void DumpCentroids(void)
Definition: Landscape.cpp:3275
Landscape::SupplyJustMownVector
bool SupplyJustMownVector(unsigned int a_index)
Definition: landscape.h:1258
Landscape::BackTranslateVegTypes
int BackTranslateVegTypes(TTypesOfVegetation VegReference)
Definition: landscape.h:1669
Landscape::SupplyPolyRefCC
int SupplyPolyRefCC(int a_x, int a_y)
Definition: landscape.h:1500
Landscape::hb_DownPolyNumbers
void hb_DownPolyNumbers(void)
Definition: hedgebanks.cpp:715
Landscape::SupplyOptFarmType
TTypesOfOptFarms SupplyOptFarmType(int a_x, int a_y)
Definition: landscape.h:1191
Pesticide
Definition: pesticide.h:106
Landscape::SupplyCentroidY
int SupplyCentroidY(int a_x, int a_y)
Definition: landscape.h:475
Landscape::SupplySnowcover
bool SupplySnowcover(void)
Definition: landscape.h:1437
GooseFieldListItem::polyref
int polyref
Definition: landscape.h:82
Landscape::SkylarkEvaluation
void SkylarkEvaluation(SkTerritories *a_skt)
Definition: Landscape.cpp:3025
fungicide
Definition: landscape.h:63
Landscape::SupplySoilTypeR
int SupplySoilTypeR(int a_x, int a_y)
Returns the soil type in rabbit warren reference numbers.
Definition: landscape.h:464
Calendar::GetMonth
int GetMonth(void)
Definition: calendar.h:69
Landscape::SupplyPollen
PollenNectarQuality SupplyPollen(int a_x, int a_y)
Definition: landscape.h:378
Landscape::SupplyMonth
int SupplyMonth(void)
Definition: landscape.h:1601
Landscape::BorderNeed
bool BorderNeed(TTypesOfLandscapeElement a_letype)
Definition: Landscape.cpp:4529
Landscape::SupplyNectar
PollenNectarQuality SupplyNectar(int a_polyref)
Definition: landscape.h:381
Landscape::SupplyOverspray
bool SupplyOverspray(int a_x, int a_y)
Gets the overspray flag.
Definition: Landscape.cpp:599
Landscape::SupplyTotalPollen
double SupplyTotalPollen(int a_polyref)
Definition: landscape.h:379
TTypesOfOptFarms
TTypesOfOptFarms
Definition: farm.h:278
Landscape::SupplyTreeHeight
int SupplyTreeHeight(int)
Definition: landscape.h:816
Calendar::GetDayInMonth
int GetDayInMonth(void)
Definition: calendar.h:72
Calendar::DayLength
int DayLength(void)
Definition: calendar.h:63
Landscape::GetPolymapping
int GetPolymapping(int a_index)
Definition: landscape.h:183
GooseFieldListItem::geesesp
int geesesp[gs_foobar]
Definition: landscape.h:84
insecticide
Definition: landscape.h:63
Landscape::FillVegAreaData
void FillVegAreaData()
Definition: Landscape.cpp:3641
ttop_ModelinkPesticide21TWA
Definition: landscape.h:72
Landscape::m_polymapping
vector< int > m_polymapping
Definition: landscape.h:130
Landscape::SupplyUnderGrowthWidth
int SupplyUnderGrowthWidth(int)
Definition: landscape.h:817
Landscape::SupplyTrafficLoad
double SupplyTrafficLoad(int a_x, int a_y)
Definition: landscape.h:1293
Landscape::SupplyIsGrass
bool SupplyIsGrass(int a_polyref)
Definition: landscape.h:1310
Landscape::hb_FindHedges
void hb_FindHedges(void)
Definition: hedgebanks.cpp:276
Landscape::WriteOpenness
void WriteOpenness(void)
Stores openness for all polygons to a standard file.
Landscape::PolytypeToString
std::string PolytypeToString(TTypesOfLandscapeElement a_le_type)
Definition: Landscape.cpp:4087
August
const int August
Definition: landscape.h:43
Landscape::ReleaseOsmiaNest
void ReleaseOsmiaNest(int a_x, int a_y)
Reopen the osmia nest here
Definition: landscape.h:871
Weather::GetWind
double GetWind(long a_date)
Definition: weather.h:425
Landscape::SupplyJustSprayedVector
int SupplyJustSprayedVector(unsigned int a_index)
Definition: landscape.h:1270
Landscape::m_PesticideMap
PesticideMap * m_PesticideMap
For specialised pesticide recording.
Definition: landscape.h:133
Landscape::SupplyVegDensity
int SupplyVegDensity(int a_polyref)
Definition: landscape.h:975
Landscape::SupplyWeedBiomass
double SupplyWeedBiomass(int a_polyref)
Definition: landscape.h:964
Landscape::AxisLoopLtd
void AxisLoopLtd(int a_poly, APoint *a_cor, int a_axis, int a_limit)
Definition: Landscape.cpp:2917
Landscape::SupplyLastSownVeg
TTypesOfVegetation SupplyLastSownVeg(int a_polyref)
Definition: landscape.h:1068
herbicide
Definition: landscape.h:63
Landscape::GetGooseNumbers
int GetGooseNumbers(int a_poly)
This returns the number of geese on the polygon the day before.
Definition: Landscape.cpp:3383
FarmManager::GetFarmPtr
Farm * GetFarmPtr(int a_owner)
Returns the pointer to a farm with a specific number.
Definition: farm.h:1766
Landscape::InitOsmiaBeeNesting
void InitOsmiaBeeNesting()
Read in the Osmia nest density files and allocate to each LE object.
Definition: Landscape.cpp:4697
tole_YoungForest
Definition: tole_declaration.h:55
Landscape::SupplyDeadBiomass
double SupplyDeadBiomass(int a_polyref)
Definition: landscape.h:1029
RasterMap::GetMagicP
int * GetMagicP(int a_x, int a_y)
Definition: rastermap.h:74
Landscape::SetBirdMaizeForage
void SetBirdMaizeForage(int a_polyref, double a_fooddensity)
Sets the maize forage resource as seen from a goose standpoint at a polygon.
Definition: landscape.h:535
g_msg
class MapErrorMsg * g_msg
Definition: maperrormsg.cpp:41
Landscape::TurnTheWorld
void TurnTheWorld(void)
Definition: landscape.h:905
direction_s
Definition: landscape.h:60
Landscape::m_FarmManager
FarmManager * m_FarmManager
List of all the farms.
Definition: landscape.h:119
Landscape::SetPolyMaxMinExtents
void SetPolyMaxMinExtents(void)
Definition: Landscape.cpp:1622
Landscape::SupplyTreeAge
int SupplyTreeAge(int a_Polyref)
Definition: landscape.h:1315
Calendar::GetDaylightProportion
double GetDaylightProportion(void)
Definition: calendar.h:73
ttop_Vinclozolin
Definition: landscape.h:70
Landscape::SupplyBirdSeedForage
double SupplyBirdSeedForage(int a_x, int a_y)
Returns the grain forage resource as seen from a goose standpoint at an x,y location.
Definition: landscape.h:621
GooseFieldListItem::vegtype
TTypesOfVegetation vegtype
Definition: landscape.h:92
Landscape::SupplyHour
int SupplyHour(void)
Get the hour of the day.
Definition: landscape.h:1586
Landscape::RebuildPolyMapping
void RebuildPolyMapping()
Definition: landscape.h:213
Landscape::SupplyVegTypeVector
TTypesOfVegetation SupplyVegTypeVector(unsigned int a_index)
Definition: landscape.h:1220
GooseFieldListItem::roostdists
int roostdists[gs_foobar]
Definition: landscape.h:87
LE_TypeClass::TranslateEleTypes
TTypesOfLandscapeElement TranslateEleTypes(int EleReference)
Definition: elements.cpp:2995
Landscape::BorderAdd
void BorderAdd(LE *a_field, TTypesOfLandscapeElement a_type)
Definition: Landscape.cpp:2347
Landscape::Tick
void Tick(void)
Definition: Landscape.cpp:1467
testpesticide
Definition: landscape.h:63
Landscape::TestCropManagement
void TestCropManagement(void)
Landscape
The landscape class containing all environmental and topographical data.
Definition: landscape.h:112
Weather::GetSnowDepth
double GetSnowDepth(void)
Get the current snow depth.
Definition: weather.h:431
Landscape::UnsprayedMarginAdd
void UnsprayedMarginAdd(LE *a_field)
Definition: Landscape.cpp:2617
g_map
Landscape * g_map
Landscape::m_maxextent
int m_maxextent
Definition: landscape.h:143
October
const int October
Definition: landscape.h:45
Landscape::SupplyGrazingPressureVector
int SupplyGrazingPressureVector(unsigned int a_index)
Definition: landscape.h:1232
Landscape::m_RodenticideManager
RodenticideManager * m_RodenticideManager
Definition: landscape.h:157
Landscape::GetActualGooseGrazingForage
double GetActualGooseGrazingForage(int a_x, int a_y, GooseSpecies a_goose)
Returns the leaf forage resource as seen from a goose standpoint at a polygon referenced by x,...
Definition: landscape.h:596
Weather::GetTemp
double GetTemp(long a_date)
Get the temperature on a particular date.
Definition: weather.h:417
Landscape::ReadPolys2
void ReadPolys2(const char *a_polyfile)
reads in polygon information. Version 2 including centroid and openness information
Definition: Landscape.cpp:1892
Landscape::SupplyIsCereal
bool SupplyIsCereal(int a_polyref)
Definition: landscape.h:1300
Landscape::SupplySoilType
int SupplySoilType(int a_x, int a_y)
Returns the soil type in ALMaSS types reference numbers.
Definition: landscape.h:460
ttop_ModelinkPesticide
Definition: landscape.h:71
Landscape::PolysRenumber
void PolysRenumber(void)
Definition: Landscape.cpp:2057
Landscape::SupplySimAreaMinExtent
int SupplySimAreaMinExtent(void)
Landscape::SupplyCentroid
APoint SupplyCentroid(int a_polyref)
Definition: Landscape.cpp:766
Landscape::SupplyFarmManagerPtr
FarmManager * SupplyFarmManagerPtr()
Definition: landscape.h:353
Landscape::UnsprayedMarginScan
void UnsprayedMarginScan(LE *a_field, int a_width)
Definition: Landscape.cpp:2638
g_cfg
class Configurator * g_cfg
Definition: configurator.cpp:49
Landscape::SupplyPesticide
double SupplyPesticide(int a_x, int a_y, PlantProtectionProducts a_ppp)
Gets total pesticide for a location.
Definition: Landscape.cpp:586
TTypesOfVegetation
TTypesOfVegetation
Definition: tov_declaration.h:30
Landscape::SupplyDayInMonth
int SupplyDayInMonth(void)
Definition: landscape.h:1606
Landscape::SupplyIsMatureCereal
bool SupplyIsMatureCereal(int a_polyref)
Definition: landscape.h:1305
Landscape::SupplySimAreaHeight
int SupplySimAreaHeight(void)
Definition: landscape.h:1637
Landscape::SupplyFarmOwner
int SupplyFarmOwner(int a_x, int a_y)
Definition: landscape.h:1152
Configurator::ReadSymbols
bool ReadSymbols(const char *a_cfgfile)
Definition: configurator.cpp:201
Calendar::Date
long Date(void)
Definition: calendar.h:57
Landscape::DumpPublicSymbols
void DumpPublicSymbols(const char *a_dumpfile, CfgSecureLevel a_level)
Definition: landscape.h:781
Landscape::SupplySimAreaWidth
int SupplySimAreaWidth(void)
Definition: landscape.h:1632
Landscape::m_GooseIntakeRateVSVegetationHeight_GL
Polynomial2CurveClass * m_GooseIntakeRateVSVegetationHeight_GL
Definition: landscape.h:162
Landscape::SupplyTotalNectar
double SupplyTotalNectar(int a_x, int a_y)
Definition: landscape.h:384
Landscape::IncOsmiaNest
void IncOsmiaNest(int a_x, int a_y)
Reopen the osmia nest here
Definition: landscape.h:866
Landscape::TranslateEleTypes
TTypesOfLandscapeElement TranslateEleTypes(int EleReference)
Definition: landscape.h:1648
Landscape::m_DoMissingPolygonsManipulations
bool m_DoMissingPolygonsManipulations
Definition: landscape.h:150
Landscape::SupplyCentroidX
int SupplyCentroidX(int a_x, int a_y)
Definition: landscape.h:474
September
const int September
Definition: landscape.h:44
direction_n
Definition: landscape.h:60
Landscape::CorrectCoordsPt
APoint CorrectCoordsPt(int x, int y)
Function to prevent wrap around errors with co-ordinates using x/y pair.
Definition: landscape.h:1544
Landscape::IsFieldType
bool IsFieldType(TTypesOfLandscapeElement a_tole)
Definition: landscape.h:727
Weather::GetHumidity
double GetHumidity(void)
Get the humidity score today.
Definition: weather.h:421
Landscape::ReadSymbols
bool ReadSymbols(const char *a_cfgfile)
Definition: landscape.h:788
Configurator::DumpPublicSymbols
void DumpPublicSymbols(const char *a_dumpfile, CfgSecureLevel a_level)
Definition: configurator.cpp:590
direction_e
Definition: landscape.h:60
tole_PermPasture
Definition: tole_declaration.h:47
Landscape::hb_first_free_poly_num
int hb_first_free_poly_num
Definition: landscape.h:274
Landscape::SupplyNightProp
double SupplyNightProp()
Definition: landscape.h:826
Landscape::m_PondIndexList
vector< int > m_PondIndexList
List of pond indexes.
Definition: landscape.h:197
Landscape::AddBeetleBanks
void AddBeetleBanks(TTypesOfLandscapeElement a_tole)
Definition: Landscape.cpp:2723
Weather::GetMeanTemp
double GetMeanTemp(long a_date, unsigned int a_period)
Definition: weather.cpp:120
Landscape::BorderScan
void BorderScan(LE *a_field, int a_width)
Definition: Landscape.cpp:2365
Landscape::SupplyTotalNectar
double SupplyTotalNectar(int a_polyref)
Definition: landscape.h:383
TTypeOfDirections
TTypeOfDirections
ALMaSS 8 standard directions
Definition: landscape.h:59
Landscape::SupplyGooseGrazingForageH
double SupplyGooseGrazingForageH(double a_height, GooseSpecies a_goose)
Returns the leaf forage resource as seen from a goose standpoint at a polygon based on the height onl...
Definition: landscape.h:541
Landscape::SupplyLESignal
LE_Signal SupplyLESignal(int a_polyref)
Definition: Landscape.cpp:3566
Landscape::SupplyVegPatchy
bool SupplyVegPatchy(int a_polyref)
Definition: landscape.h:986
Landscape::BeetleBankAdd
void BeetleBankAdd(int x, int y, int angle, int length, LE *a_field, TTypesOfLandscapeElement a_tole)
Definition: Landscape.cpp:2971
Landscape::GetQuarryNumbers
int GetQuarryNumbers(int a_poly)
This returns the number of geese which are legal quarry on the polygon the day before.
Definition: Landscape.cpp:3390
Landscape::ReadOpenness
void ReadOpenness(void)
Reads openness values from a standard input file for all polygons.
GooseFieldListItem::maize
double maize
Definition: landscape.h:90
Landscape::SupplyThePopManager
Population_Manager * SupplyThePopManager()
Get the pointer to the current main population manager.
Definition: landscape.h:175
tole_PermanentSetaside
Definition: tole_declaration.h:46
Landscape::CorrectWidth
int CorrectWidth(int x)
Definition: landscape.h:1567
Landscape::hb_StripingDist
int hb_StripingDist(void)
Definition: hedgebanks.cpp:225
Landscape::GetGooseFields
GooseFieldList * GetGooseFields(double)
Gets the list of suitable goose foraging fields today.
Definition: Landscape.cpp:685
Landscape::LineHighTest
int LineHighTest(int a_cx, int a_cy, double a_offsetx, double a_offsety)
Provides a measure of the shortest distance in using a vector from a_cx,a_cy unitl tall obstacles are...
Definition: Landscape.cpp:461
Landscape::m_treatment_counts
int m_treatment_counts[last_treatment]
Definition: landscape.h:193
Landscape::hb_RestoreHedgeCore
void hb_RestoreHedgeCore(int a_orig_poly_number)
Definition: hedgebanks.cpp:311
Landscape::m_PesticideType
TTypesOfPesticide m_PesticideType
An attribute to hold the pesticide type being tested, if there is one, if not default is -1.
Definition: landscape.h:278
Landscape::m_toxShouldSpray
bool m_toxShouldSpray
Definition: landscape.h:317
Landscape::hb_HasNeighbourColor
bool hb_HasNeighbourColor(int a_x, int a_y, int a_neighbour_color)
Definition: hedgebanks.cpp:452
Landscape::RodenticidePredatorsEvaluation
void RodenticidePredatorsEvaluation(RodenticidePredators_Population_Manager *a_rppm)
Definition: Landscape.cpp:3032
FarmManager::GetNoFarms
int GetNoFarms()
Definition: farm.h:1900
Landscape::SupplyMinute
int SupplyMinute(void)
Get the minute of the hour.
Definition: landscape.h:1592
Landscape::SupplyValidY
int SupplyValidY(int a_polyref)
Definition: landscape.h:1481
Landscape::CountMapSquares
void CountMapSquares(void)
Definition: Landscape.cpp:2040
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: maperrormsg.cpp:59
Landscape::hb_PaintWhoHasNeighbourColor
bool hb_PaintWhoHasNeighbourColor(int a_neighbour_color, int a_new_color)
Definition: hedgebanks.cpp:526
Landscape::SupplyPolygonArea
double SupplyPolygonArea(int a_polyref)
Definition: landscape.h:523
Landscape::hb_height
int hb_height
Definition: landscape.h:270
Landscape::SetThePopManager
void SetThePopManager(Population_Manager *a_ptr)
Set the pointer to the current main population manager.
Definition: landscape.h:177
Landscape::SupplyRodenticide
double SupplyRodenticide(int a_x, int a_y)
Gets total rodenticide for a location.
Definition: Landscape.cpp:492
Landscape::m_y_add
int m_y_add[8]
Definition: landscape.h:267
Population_Manager
Base class for all population managers.
Definition: populationmanager.h:424
Landscape::CIPELandscapeMaker
bool CIPELandscapeMaker()
Landscape::m_width10
int m_width10
Definition: landscape.h:140
Weather::GetWindPeriod
double GetWindPeriod(long a_date, unsigned int a_period)
Definition: weather.cpp:262
Landscape::SupplyDayInYear
int SupplyDayInYear(void)
Definition: landscape.h:1596
Landscape::hb_UpPolyNumbers
void hb_UpPolyNumbers(void)
Definition: hedgebanks.cpp:289
Landscape::hb_MarkTheBresenhamWay
void hb_MarkTheBresenhamWay(void)
Definition: hedgebanks.cpp:629
GooseFieldListItem::debugveg
std::string debugveg
Definition: landscape.h:99
Landscape::AddGreenElement
void AddGreenElement(LE *a_green)
Landscape::SupplyVegBiomass
double SupplyVegBiomass(int a_polyref)
Definition: landscape.h:953
Landscape::DumpTreatCounters
void DumpTreatCounters(const char *a_filename)
Definition: Landscape.cpp:3586
Landscape::GetVegArea
double GetVegArea(int v)
Definition: landscape.h:170
Landscape::SupplyHasTramlines
bool SupplyHasTramlines(int a_x, int a_y)
Definition: landscape.h:1252
WARN_MSG
Definition: maperrormsg.h:38
Landscape::hb_max_y
int hb_max_y
Definition: landscape.h:273
direction_ne
Definition: landscape.h:60
Landscape::SupplyPesticideType
TTypesOfPesticide SupplyPesticideType(void)
Definition: landscape.h:433
Landscape::SupplyBirdSeedForage
double SupplyBirdSeedForage(int a_polyref)
Returns the grain forage resource.
Definition: landscape.h:614
Landscape::FindLongestAxis
int FindLongestAxis(int *x, int *y, int *a_length)
Definition: Landscape.cpp:2851
ttop_eggshellthinning
Definition: landscape.h:75
Landscape::SupplyGooseGrazingForageH
double SupplyGooseGrazingForageH(int a_polygon, GooseSpecies a_goose)
Returns the leaf forage resource as seen from a goose standpoint at a polygon referenced by number ba...
Definition: landscape.h:567
Landscape::CheckForPesticideRecord
void CheckForPesticideRecord(LE *a_field, TTypesOfPesticideCategory a_pcide)
Check if needed and record pesticide application.
Definition: Landscape.cpp:669
TTypesOfPesticideCategory
TTypesOfPesticideCategory
Definition: landscape.h:63
Landscape::SupplyYearNumber
int SupplyYearNumber(void)
Definition: landscape.h:1616
Landscape::CorrectCoordsPointNoWrap
void CorrectCoordsPointNoWrap(APoint &a_pt)
Function to prevent wrap around errors with co-ordinates using a APoint.
Definition: landscape.h:1555
Landscape::hb_GenerateHBPolys
void hb_GenerateHBPolys(void)
Definition: hedgebanks.cpp:180
Landscape::RecordGooseNumbers
void RecordGooseNumbers(int a_poly, int a_number)
This records the number of geese on the polygon the day before. To prevent lots of unnecessary cleari...
Definition: Landscape.cpp:3328
Landscape::SupplyVegCover
double SupplyVegCover(int a_polyref)
Definition: landscape.h:1048
tole_Orchard
Definition: tole_declaration.h:71
January
const int January
Definition: landscape.h:36
Landscape::hb_hedges
vector< int > hb_hedges
Definition: landscape.h:263
LE_Signal
unsigned int LE_Signal
Definition: elements.h:35
Landscape::ChangeMapMapping
void ChangeMapMapping(void)
Definition: Landscape.cpp:2130
Landscape::SupplyPolyRefVector
int SupplyPolyRefVector(unsigned int a_index)
Definition: landscape.h:1451
tole_WoodyEnergyCrop
Definition: tole_declaration.h:94
Landscape::SupplyUnderGrowthWidth
int SupplyUnderGrowthWidth(int, int)
Definition: landscape.h:815
Landscape::hb_ClearPolygon
void hb_ClearPolygon(int a_poly_num)
Definition: hedgebanks.cpp:413
Landscape::SupplyVersion
const char * SupplyVersion(void)
Definition: landscape.h:778
Weather::GetSnow
bool GetSnow(long a_date)
Definition: weather.cpp:132
Landscape::m_land
RasterMap * m_land
The big map.
Definition: landscape.h:125
Landscape::FindFieldCenter
bool FindFieldCenter(LE *a_field, int *x, int *y)
Definition: Landscape.cpp:2799
Landscape::ReadPolys
void ReadPolys(const char *a_polyfile)
LE_TypeClass::TranslateVegTypes
TTypesOfVegetation TranslateVegTypes(int VegReference)
Definition: elements.cpp:3088
Landscape::SupplyElementTypeFromVector
TTypesOfLandscapeElement SupplyElementTypeFromVector(unsigned int a_index)
Definition: landscape.h:1104
Landscape::EventtypeToString
std::string EventtypeToString(int a_event)
Definition: Landscape.cpp:3918
GooseFieldListItem
A list item entry of field polygon reference numbers with associated openness and goose food scores.
Definition: landscape.h:80
Landscape::SupplyTreeAge
int SupplyTreeAge(int, int)
Definition: landscape.h:509
Landscape::m_NeedCentroidCalculation
bool m_NeedCentroidCalculation
a flag to ensure centroid calculation on object construction
Definition: landscape.h:146
Landscape::SupplyInStubble
bool SupplyInStubble(int a_polyref)
Returns whether its cereal.
Definition: landscape.h:634
Landscape::hb_min_x
int hb_min_x
Definition: landscape.h:272
Landscape::ForceArea
void ForceArea(void)
Definition: Landscape.cpp:2072
Landscape::CreatePondList
void CreatePondList()
Creates a list of pond polygon refs/indexes for easy look up.
Definition: Landscape.cpp:2594
tole_PermPastureTussocky
Definition: tole_declaration.h:45
Landscape::SupplyInsects
double SupplyInsects(int a_polyref)
Definition: landscape.h:1088
Landscape::SupplyRain
double SupplyRain(void)
Definition: landscape.h:1365
Landscape::m_GooseIntakeRateVSVegetationHeight_BG
Polynomial2CurveClass * m_GooseIntakeRateVSVegetationHeight_BG
Definition: landscape.h:161
Landscape::SupplyPondIndex
int SupplyPondIndex(int a_pondref)
Returns the index of a pond based on pondref or -1 if not found.
Definition: landscape.h:342
Landscape::BorderRemoval
void BorderRemoval(void)
Definition: Landscape.cpp:2271
Landscape::hb_size
int hb_size
Definition: landscape.h:271
Landscape::SupplyPesticideP
double SupplyPesticideP(int a_x, int a_y, PlantProtectionProducts a_ppp)
Gets plant pesticide for a location.
Definition: Landscape.cpp:605
Landscape::SupplyGlobalRadiation
double SupplyGlobalRadiation()
Definition: landscape.h:1341
CfgSecureLevel
CfgSecureLevel
Definition: configurator.h:59
Landscape::BeetleBankPossible
bool BeetleBankPossible(LE *a_field, TTypesOfLandscapeElement a_tole)
Definition: Landscape.cpp:2772
LE
Definition: elements.h:81
June
const int June
Definition: landscape.h:41
Landscape::CalculateOpenness
void CalculateOpenness(bool a_realcalc)
Causes openness to be calulated and stored for all polygons.
Definition: Landscape.cpp:322
Landscape::SupplyVegAge
int SupplyVegAge(int a_Polyref)
Definition: landscape.h:1078
Landscape::Landscape
Landscape(void)
Definition: Landscape.cpp:814
Landscape::DumpVegAreaData
void DumpVegAreaData(int a_day)
Definition: Landscape.cpp:4680
Landscape::SupplyVegHeight
double SupplyVegHeight(int a_polyref)
Definition: landscape.h:936
Landscape::SupplyVegDigestabilityVector
double SupplyVegDigestabilityVector(unsigned int a_index)
Definition: landscape.h:914
tole_Field
Definition: tole_declaration.h:43
ttop_AcuteEffects
Definition: landscape.h:68
tole_PermPastureTussockyWet
Definition: tole_declaration.h:100
Landscape::GrazeVegetation
void GrazeVegetation(int a_poly, double a_forage)
Removes grazing forage from a poly per m2.
Definition: landscape.h:670
Landscape::SupplyFarmIntensityI
int SupplyFarmIntensityI(int a_polyindex)
Definition: Landscape.cpp:751
Landscape::SupplyMaleNewtPresent
bool SupplyMaleNewtPresent(int a_InPondIndex)
Determines if a male is present in a pond.
Definition: landscape.h:351
tole_PermPastureLowYield
Definition: tole_declaration.h:44
last_treatment
Definition: treatment.h:113
Landscape::SupplyRandomPondIndex
int SupplyRandomPondIndex()
Returns random pond index.
Definition: Landscape.cpp:2606
Landscape::le_signal_index
int le_signal_index
Definition: landscape.h:319
GooseFieldListItem::geese
int geese
Definition: landscape.h:83
Landscape::SupplyLEHigh
bool SupplyLEHigh(int a_x, int a_y)
Tests whether the polygon at a_x,a_y is designated as high.
Definition: landscape.h:455
Weather::GetTempPeriod
double GetTempPeriod(long a_date, unsigned int a_period)
Definition: weather.cpp:272
GooseFieldListItem::vegtypechr
std::string vegtypechr
Definition: landscape.h:93
Landscape::SupplyCentroidX
int SupplyCentroidX(int a_polyref)
Definition: landscape.h:470
Landscape::SupplyIsCereal2
bool SupplyIsCereal2(TTypesOfVegetation a_vege_type)
Definition: Landscape.cpp:532
GooseFieldListItem::geesespTimed
int geesespTimed[gs_foobar]
Definition: landscape.h:86
Landscape::CalulateFieldOpennessAllCells
int CalulateFieldOpennessAllCells(int a_pref)
Provides a measure of the shortest distance in 360 degree, e-g- looking NE % SW before tall obstacles...
Definition: Landscape.cpp:401
Landscape::SupplyPondPesticide
double SupplyPondPesticide(int a_poly_index)
Get the pesticide concentration per liter from a pond (must be a pond index on calling)
Definition: landscape.h:761
Landscape::SupplyPesticideS
double SupplyPesticideS(int a_x, int a_y, PlantProtectionProducts a_ppp)
Gets soil pesticide for a location.
Definition: Landscape.cpp:616
Landscape::hb_ResetColorBits
void hb_ResetColorBits(void)
Definition: hedgebanks.cpp:298
Weather::GetGlobalRadiation
double GetGlobalRadiation(long a_date)
Definition: weather.h:414
Landscape::SupplyPesticideCell
int SupplyPesticideCell(int a_polyref)
Definition: landscape.h:1468
direction_w
Definition: landscape.h:60
Landscape::SetPolymapping
void SetPolymapping(int a_index, int a_val)
Definition: landscape.h:182
Farm
The base class for all farm types.
Definition: farm.h:767
Landscape::SupplyVegPhase
int SupplyVegPhase(int a_poly)
Definition: landscape.h:179
TTypesOfLandscapeElement
TTypesOfLandscapeElement
Definition: tole_declaration.h:36
Landscape::SupplyWindPeriod
double SupplyWindPeriod(long a_date, int a_period)
Definition: landscape.h:1405
Landscape::RecordGooseSpNumbersTimed
void RecordGooseSpNumbersTimed(int a_poly, int a_number, GooseSpecies a_goose)
This records the number of geese of each species on the polygon the day before at a predefined time....
Definition: Landscape.cpp:3363
Landscape::SupplyValidX
int SupplyValidX(int a_polyref)
Definition: landscape.h:1474
Landscape::SupplyFarmAnimalCensus
int SupplyFarmAnimalCensus(int a_farm_ref, int a_LifeStage)
Definition: Landscape.cpp:745
Landscape::BorderTest
bool BorderTest(int a_fieldpoly, int a_borderpoly, int a_x, int a_y)
Definition: Landscape.cpp:2452
Landscape::m_GooseIntakeRateVSVegetationHeight_PF
Polynomial2CurveClass * m_GooseIntakeRateVSVegetationHeight_PF
Curve relatning goose intake rates in KJ/min to vegetation height.
Definition: landscape.h:160
Landscape::hb_border_pixels
int hb_border_pixels
Definition: landscape.h:276
Landscape::SupplyRoadWidth
int SupplyRoadWidth(int, int)
Definition: landscape.h:811
Landscape::SupplyLastSownVegVector
TTypesOfVegetation SupplyLastSownVegVector(unsigned int a_index)
Definition: landscape.h:1063
Landscape::RecordGooseRoostDist
void RecordGooseRoostDist(int a_polyref, int a_dist, GooseSpecies a_goose)
Records the distance to the closest roost of goose species.
Definition: Landscape.cpp:3373
GooseFieldListItem::digestability
double digestability
Definition: landscape.h:95
Landscape::SupplyDayDegrees
double SupplyDayDegrees(int a_polyref)
Definition: landscape.h:1326
Landscape::DegreesDump
void DegreesDump()
Prints the sum of day degrees. See FarmManager::daydegrees.
Definition: Landscape.cpp:1687
Landscape::NewElement
LE * NewElement(TTypesOfLandscapeElement a_type)
Definition: Landscape.cpp:3688
Landscape::SupplyRodenticidePredatoryManager
RodenticidePredators_Population_Manager * SupplyRodenticidePredatoryManager()
Definition: landscape.h:432
Landscape::PolysRemoveInvalid
bool PolysRemoveInvalid(void)
Definition: Landscape.cpp:1772
GooseFieldListItem::openness
double openness
Definition: landscape.h:88
Landscape::SupplyIsGrass2
bool SupplyIsGrass2(TTypesOfVegetation a_vege_type)
Definition: Landscape.cpp:503
Landscape::m_LargestPolyNumUsed
int m_LargestPolyNumUsed
Definition: landscape.h:194
Landscape::SupplyLEReset
void SupplyLEReset(void)
Definition: Landscape.cpp:3551
Landscape::AxisLoop
void AxisLoop(int a_poly, int *a_x, int *a_y, int a_axis)
Definition: Landscape.cpp:2938
PesticideMap
Definition: pesticide.h:369
Landscape::DumpMapGraphics
void DumpMapGraphics(const char *a_filename)
Definition: Landscape.cpp:3599
Landscape::CentroidSpiralOut
void CentroidSpiralOut(int a_polyref, int &a_x, int &a_y)
Definition: Landscape.cpp:3073
Landscape::SupplyFarmOwnerIndex
int SupplyFarmOwnerIndex(int a_x, int a_y)
Definition: landscape.h:1165
ttop_MultipleEffects
Definition: landscape.h:74
Landscape::UpdateOsmiaNesting
void UpdateOsmiaNesting()
Tesll all LE objects to update their osmia nest status.
Definition: landscape.h:856
OptimisingFarm
A farm that carries out crop, pesticide and fertilizer planning using simplified optimisation or othe...
Definition: farm.h:2028
Landscape::SupplyBirdMaizeForage
double SupplyBirdMaizeForage(int a_x, int a_y)
Returns the maize forage resource as seen from a goose standpoint at an x,y location.
Definition: landscape.h:640
RasterMap
Definition: rastermap.h:40
Calendar::DayInYear
int DayInYear(void)
Definition: calendar.h:58
Landscape::SupplyRainPeriod
double SupplyRainPeriod(long a_date, int a_period)
Definition: landscape.h:1351
Landscape::GrazeVegetationTotal
void GrazeVegetationTotal(int a_poly, double a_forage)
Removes grazing forage from a poly and divides this out per m2.
Definition: landscape.h:676
Landscape::BuildingDesignationCalc
void BuildingDesignationCalc()
used to calculate whether a building is rural or town - for rodenticide use
Definition: Landscape.cpp:3287
LE_TypeClass::BackTranslateVegTypes
int BackTranslateVegTypes(TTypesOfVegetation VegReference)
Definition: elements.cpp:3345
Landscape::m_minmaxextent
int m_minmaxextent
Definition: landscape.h:142
Landscape::RecordGooseSpNumbers
void RecordGooseSpNumbers(int a_poly, int a_number, GooseSpecies a_goose)
This records the number of geese of each species on the polygon the day before. To prevent lots of un...
Definition: Landscape.cpp:3352
Landscape::SupplyYear
int SupplyYear(void)
Definition: landscape.h:1611
g_date
class Calendar * g_date
Definition: calendar.cpp:38
Landscape::SupplyTempPeriod
double SupplyTempPeriod(long a_date, int a_period)
Definition: landscape.h:1410
Landscape::hb_map
int * hb_map
Definition: landscape.h:268
GooseFieldList
std::vector< GooseFieldListItem > GooseFieldList
A list of GooseFieldListItem s.
Definition: landscape.h:103
Landscape::m_x_add
int m_x_add[8]
Definition: landscape.h:266
Landscape::SupplyElementTypeCC
TTypesOfLandscapeElement SupplyElementTypeCC(int a_x, int a_y)
Definition: landscape.h:1139
Landscape::CorrectHeight
int CorrectHeight(int y)
Definition: landscape.h:1573
Landscape::SupplyPolygonAreaVector
double SupplyPolygonAreaVector(int a_polyref)
Returns the area of a polygon using the vector index as a reference.
Definition: landscape.h:1200
Landscape::hb_Add
void hb_Add(void)
Definition: hedgebanks.cpp:56
Landscape::m_ThePopManager
Population_Manager * m_ThePopManager
a pointer to the current main population manager
Definition: landscape.h:155
Landscape::EventDumpPesticides
void EventDumpPesticides(int x1, int y1)
Definition: Landscape.cpp:1720
Weather::GetRain
double GetRain(long a_date)
Definition: weather.h:423
Landscape::SupplyLastTreatment
int SupplyLastTreatment(int a_polyref, int *a_index)
Definition: landscape.h:1331
Landscape::hb_min_y
int hb_min_y
Definition: landscape.h:273
Landscape::SupplyPolyRefIndex
int SupplyPolyRefIndex(int a_x, int a_y)
Definition: landscape.h:1493
Landscape::SupplyLargestPolyNumUsed
int SupplyLargestPolyNumUsed()
Definition: landscape.h:355
Landscape::hb_Cleanup
void hb_Cleanup(void)
Weather::GetWindDirection
int GetWindDirection(void)
Definition: weather.h:427
Landscape::PolysValidate
void PolysValidate(bool a_exit_on_invalid)
Definition: Landscape.cpp:1746
Landscape::SupplyLENext
int SupplyLENext(void)
Definition: Landscape.cpp:3555
TTypesOfFarm
TTypesOfFarm
Definition: farm.h:221
Landscape::SupplyTotalPollen
double SupplyTotalPollen(int a_x, int a_y)
Definition: landscape.h:380
tole_Vildtager
Definition: tole_declaration.h:99
GooseFieldListItem::grain
double grain
Definition: landscape.h:89
ttop_GeneticDemo
Definition: landscape.h:73
Landscape::FindValidXY
bool FindValidXY(int a_field, int &a_x, int &a_y)
Definition: Landscape.cpp:2688
Landscape::Warn
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1579
March
const int March
Definition: landscape.h:38
FarmManager
The Farm Manager class.
Definition: farm.h:1706
Landscape::m_elems
vector< LE * > m_elems
List of all landscape elements. The index is a sequential number, to get the polynum look this number...
Definition: landscape.h:122
GooseFieldListItem::vegphase
int vegphase
Definition: landscape.h:96
Landscape::SupplyMagicMapP
int * SupplyMagicMapP(int a_x, int a_y)
Definition: landscape.h:1509
Landscape::StepOneValid
bool StepOneValid(int a_polyindex, int a_x, int a_y, int step)
Definition: Landscape.cpp:2429
TTypesOfPesticide
TTypesOfPesticide
Definition: landscape.h:65
Landscape::m_height10
int m_height10
Definition: landscape.h:141
Landscape::SupplyDaylength
int SupplyDaylength(void)
Definition: landscape.h:1530
Landscape::m_NeedOpennessCalculation
bool m_NeedOpennessCalculation
a flag to ensure openness calculation on object construction
Definition: landscape.h:148
Landscape::SupplyPolyRef
int SupplyPolyRef(int a_x, int a_y)
Definition: landscape.h:1488
Landscape::EventDump
void EventDump(int x, int y, int x2, int y2)
Definition: Landscape.cpp:1697
Landscape::SupplyFarmIntensity
int SupplyFarmIntensity(int a_x, int a_y)
Definition: Landscape.cpp:756
Landscape::SupplyCentroidIndex
APoint SupplyCentroidIndex(int a_polyrefindex)
Definition: Landscape.cpp:771
g_weather
class Weather * g_weather
Definition: weather.cpp:41
Configurator::DumpAllSymbolsAndExit
void DumpAllSymbolsAndExit(const char *a_dumpfile)
Definition: configurator.cpp:601
Landscape::SetBirdSeedForage
void SetBirdSeedForage(int a_polyref, double a_fooddensity)
Sets the grain forage resource as seen from a goose standpoint at a polygon.
Definition: landscape.h:528
Landscape::SupplyNectar
PollenNectarQuality SupplyNectar(int a_x, int a_y)
Definition: landscape.h:382
Landscape::l_vegtype_areas
double * l_vegtype_areas
Definition: landscape.h:153
Landscape::SupplyGlobalDate
long SupplyGlobalDate(void)
Definition: landscape.h:1621
Landscape::SupplyTreeHeight
int SupplyTreeHeight(int, int)
Definition: landscape.h:814
Landscape::SupplyLargeOpenFieldsNearXY
polylist * SupplyLargeOpenFieldsNearXY(int x, int y, int range, int a_openness)
Returns a pointer to a list of polygonrefs to large open fields within a range of location x,...
Definition: Landscape.cpp:782
Landscape::SimulationClosingActions
void SimulationClosingActions()
Definition: Landscape.cpp:1455
Landscape::GetHareFoodQuality
double GetHareFoodQuality(int a_polygon)
Definition: Landscape.cpp:3403
Landscape::hb_HasOtherNeighbour
bool hb_HasOtherNeighbour(int a_x, int a_y)
Definition: hedgebanks.cpp:339
Landscape::SupplyElementSubType
int SupplyElementSubType(int a_polyref)
Definition: landscape.h:1121
Landscape::SetLESignal
void SetLESignal(int a_polyref, LE_Signal a_signal)
Definition: Landscape.cpp:3570
Weather::GetRainPeriod
double GetRainPeriod(long a_date, unsigned int a_period)
Definition: weather.cpp:253
direction_se
Definition: landscape.h:60
Landscape::ConsolidatePolys
void ConsolidatePolys(void)
Definition: Landscape.cpp:1329
Landscape::BackTranslateEleTypes
int BackTranslateEleTypes(TTypesOfLandscapeElement EleReference)
Definition: landscape.h:1662
Landscape::IncTreatCounter
void IncTreatCounter(int a_treat)
Definition: Landscape.cpp:3575
November
const int November
Definition: landscape.h:46
Calendar::GetMinute
int GetMinute(void)
Definition: calendar.h:70