27 #define _CRTDBG_MAP_ALLOC 56 class RodenticidePredators_Population_Manager;
112 char m_versioninfo[30];
153 void FillVegAreaData();
154 inline double GetVegArea(
int v) {
return l_vegtype_areas[v]; }
155 void DumpVegAreaData(
int a_day);
156 void SkylarkEvaluation(SkTerritories* a_skt);
157 void RodenticidePredatorsEvaluation(RodenticidePredators_Population_Manager* a_rppm);
163 int SupplyFarmAnimalCensus(
int a_farm_ref,
int a_LifeStage);
169 void GISASCII_Output(
string outpfile,
int UTMX,
int UTMY);
173 void AddGreenElement(
LE *a_green );
181 void ReadPolys(
const char *a_polyfile);
183 void ReadPolys2(
const char *a_polyfile);
184 void PolysValidate(
bool a_exit_on_invalid);
185 void PolysRemoveInvalid(
void );
186 void PolysDump(
const char *a_filename );
187 void DumpMap(
const char *a_filename );
188 void ConsolidatePolys(
void );
189 void CountMapSquares(
void);
190 void PolysRenumber(
void);
193 unsigned int sz = (int)m_elems.size();
194 for (
unsigned int i = 0; i < sz; i++)
199 void ForceArea(
void);
200 void ChangeMapMapping(
void );
203 void RemoveMissingValues();
204 void TestCropManagement(
void );
205 void VegDump(
int x,
int y);
206 void EventDump(
int x,
int y,
int x2,
int y2);
207 void EventDumpPesticides(
int x1,
int y1 );
212 void BorderRemoval(
void );
214 int RemoveSmallPolygons(
void );
216 void CreatePondList();
218 void UnsprayedMarginAdd (
LE* a_field );
219 void UnsprayedMarginScan(
LE* a_field,
int a_width );
220 void BorderScan(
LE* a_field,
int a_width );
221 bool BorderTest(
int a_fieldpoly,
int a_borderpoly,
int a_x,
int a_y );
222 bool StepOneValid(
int a_polyindex,
int a_x,
int a_y,
int step );
223 bool UMarginTest(
int a_fieldpoly,
int a_borderpoly,
int a_x,
int a_y,
int a_width );
224 bool FindValidXY(
int a_field,
int &a_x,
int &a_y);
225 bool BorderStep(
int a_fieldpoly,
int a_borderpoly,
int* a_x,
int* a_y);
226 bool BorderStep(
int a_fieldpoly,
int a_borderpoly, APoint* a_coord);
232 bool FindFieldCenter(
LE* a_field,
int* x,
int* y);
233 int FindLongestAxis(
int* x,
int* y,
int* a_length);
234 void AxisLoop(
int a_poly,
int* a_x,
int* a_y,
int a_axis);
235 void AxisLoop(
int a_poly, APoint* a_cor,
int a_axis);
236 void AxisLoopLtd(
int a_poly, APoint* a_cor,
int a_axis,
int a_limit);
259 void hb_AddNewHedgebanks(
int a_orig_poly_num );
260 int hb_StripingDist(
void );
261 void hb_GenerateHBPolys(
void );
262 void hb_FindHedges(
void );
263 bool hb_FindBoundingBox(
int a_poly_num );
264 void hb_UpPolyNumbers(
void );
265 void hb_ClearPolygon(
int a_poly_num );
266 void hb_PaintBorder(
int a_color );
267 bool hb_MapBorder(
int a_x,
int a_y );
268 bool hb_HasOtherNeighbour(
int a_x,
int a_y );
269 bool hb_PaintWhoHasNeighbourColor(
int a_neighbour_color,
271 bool hb_HasNeighbourColor(
int a_x,
int a_y,
272 int a_neighbour_color );
273 void hb_MarkTopFromLocalMax(
int a_color );
274 void hb_MarkTheBresenhamWay(
void );
275 int hb_MaxUnpaintedNegNeighbour(
int a_x,
int a_y );
276 void hb_ResetColorBits(
void );
277 void hb_RestoreHedgeCore(
int a_orig_poly_number );
278 void hb_DownPolyNumbers(
void );
279 void hb_Cleanup(
void );
283 void DumpMapGraphics(
const char *a_filename );
286 void hb_dump_map(
int a_beginx,
int a_width,
287 int a_beginy,
int a_height,
289 bool a_high_numbers );
290 int hb_dump_color(
int a_x,
int a_y,
291 bool a_high_numbers );
299 void DumpTreatCounters(
const char* a_filename );
301 bool CIPELandscapeMaker();
306 const char *a_errorfile );
308 void SimulationClosingActions();
312 void TurnTheWorld(
void );
317 int SupplyRandomPondIndex();
319 int SupplyRandomPondRef();
322 for (
int i = 0; i < m_PondIndexList.size(); i++) {
323 if (m_PondRefsList[i] == a_pondref)
return m_PondIndexList[i];
338 double SupplyVegDigestabilityVector(
unsigned int a_index );
339 double SupplyVegDigestability(
int a_polyref );
340 double SupplyVegDigestability(
int a_x,
int a_y );
342 double SupplyVegHeightVector(
unsigned int a_index );
343 double SupplyVegHeight(
int a_polyref );
344 double SupplyVegHeight(
int a_x,
int a_y );
346 double SupplyVegBiomassVector(
unsigned int a_index );
347 double SupplyVegBiomass(
int a_polyref );
348 double SupplyVegBiomass(
int a_x,
int a_y );
350 int SupplyVegDensity(
int a_polyref );
351 int SupplyVegDensity(
int a_x,
int a_y );
353 double SupplyWeedBiomass(
int a_polyref );
354 double SupplyWeedBiomass(
int a_x,
int a_y );
356 bool SupplySkScrapes(
int a_polyref);
358 bool SupplyVegPatchy(
int a_polyref );
359 bool SupplyVegPatchy(
int a_x,
int a_y );
361 double SupplyGreenBiomass(
int a_polyref );
362 double SupplyGreenBiomass(
int a_x,
int a_y );
364 double SupplyDeadBiomass(
int a_polyref );
365 double SupplyDeadBiomass(
int a_x,
int a_y );
367 double SupplyLAGreen(
int a_polyref );
368 double SupplyLAGreen(
int a_x,
int a_y );
369 double SupplyLATotal(
int a_x,
int a_y );
371 double SupplyVegCover(
int a_polyref );
372 double SupplyVegCoverVector(
unsigned int a_index );
373 double SupplyVegCover(
int a_x,
int a_y );
378 double SupplyInsects(
int a_polyref );
379 double SupplyInsects(
int a_x,
int a_y );
381 bool SubtractPondLarvalFood(
double a_food,
int a_polyrefindex);
383 double SupplyRodenticide(
int a_x,
int a_y);
385 bool SupplyPesticideDecay();
387 double SupplyPesticide(
int a_x,
int a_y);
389 bool SupplyOverspray(
int a_x,
int a_y);
391 double SupplyPesticideP(
int a_x,
int a_y);
393 double SupplyPesticideS(
int a_x,
int a_y);
395 double SupplyPesticide(
int a_polyref);
397 double SupplyPesticideP(
int a_polyref);
399 double SupplyPesticideS(
int a_polyref);
405 void CalculateOpenness(
bool a_realcalc);
407 void WriteOpenness(
void );
409 void ReadOpenness(
void );
411 int CalulateFieldOpennessCentroid(
int a_pref);
413 int CalulateFieldOpennessAllCells(
int a_pref);
415 int LineHighTest(
int a_cx,
int a_cy,
double a_offsetx,
double a_offsety);
419 int SupplyOpenness(
int a_x,
int a_y) {
return m_elems[ m_land->
Get( a_x, a_y )]->GetOpenness(); }
421 bool SupplyLEHigh(
int a_x,
int a_y) {
return m_elems[ m_land->
Get( a_x, a_y ) ]->GetHigh(); }
423 polylist* SupplyLargeOpenFieldsNearXY(
int x,
int y,
int range,
int a_openness );
427 return m_elems[ m_land->
Get( a_x, a_y ) ]->GetSoilType( );
431 return m_elems[ m_land->
Get( a_x, a_y ) ]->GetSoilTypeR( );
434 APoint SupplyCentroid(
int a_polyref );
435 APoint SupplyCentroidIndex(
int a_polyrefindex );
437 return m_elems[
m_polymapping[ a_polyref ] ]->GetCentroidX();
440 int SupplyCentroidX(
int a_x,
int a_y ) {
return m_elems[ m_land->
Get( a_x, a_y )]->GetCentroidX(); }
441 int SupplyCentroidY(
int a_x,
int a_y ) {
return m_elems[ m_land->
Get( a_x, a_y )]->GetCentroidY(); }
443 int SupplyFarmIntensity(
int a_x,
int a_y );
444 int SupplyFarmIntensity(
int a_polyref );
445 int SupplyFarmIntensityI(
int a_polyindex );
451 int SupplyCountryDesig(
int a_x,
int a_y );
453 int SupplyElementSubType(
int a_polyref );
454 int SupplyElementSubType(
int a_x,
int a_y );
459 int SupplyGrazingPressureVector(
unsigned int a_index);
460 int SupplyGrazingPressure(
int a_polyref);
461 int SupplyGrazingPressure(
int a_x,
int a_y);
462 bool SupplyIsCereal(
int a_polyref);
463 bool SupplyIsMatureCereal(
int a_polyref);
464 bool SupplyIsGrass(
int a_polyref);
465 bool SupplyHasTramlines(
int a_x,
int a_y );
466 bool SupplyHasTramlines(
int a_polyref );
467 bool SupplyJustMownVector(
unsigned int a_index );
468 bool SupplyJustMown(
int a_polyref );
469 int SupplyJustSprayedVector(
unsigned int a_index );
470 int SupplyJustSprayed(
int a_polyref );
471 int SupplyJustSprayed(
int a_x,
int a_y );
472 int SupplyTreeAge(
int a_Polyref);
474 int SupplyVegAge(
int a_Polyref);
475 int SupplyVegAge(
int a_x,
int a_y);
476 int SupplyNumberOfFarms();
477 int SupplyFarmOwner(
int a_x,
int a_y );
478 int SupplyFarmOwner(
int a_polyref );
479 int SupplyFarmOwnerIndex(
int a_x,
int a_y );
480 int SupplyFarmOwnerIndex(
int a_polyref );
485 int SupplyFarmArea(
int a_polyref );
486 double SupplyPolygonAreaVector(
int a_polyref );
494 m_elems[
m_polymapping[a_polyref]]->SetBirdSeed(a_fooddensity);
500 m_elems[
m_polymapping[ a_polyref ] ]->SetBirdMaize( a_fooddensity );
512 if (a_goose == gs_Pinkfoot)
514 return m_GooseIntakeRateVSVegetationHeight_PF->GetY( a_height );
516 if (a_goose == gs_Barnacle)
518 return m_GooseIntakeRateVSVegetationHeight_BG->GetY(a_height);
520 if (a_goose == gs_Greylag)
522 return m_GooseIntakeRateVSVegetationHeight_GL->GetY(a_height);
524 Warn(
"Landscape::SupplyGooseGrazingForage",
"Unknown Goose Type");
537 if (a_goose == gs_Pinkfoot)
539 return m_GooseIntakeRateVSVegetationHeight_PF->GetY(m_elems[
m_polymapping[a_polygon]]->GetVegHeight());
541 if (a_goose == gs_Barnacle)
543 return m_GooseIntakeRateVSVegetationHeight_BG->GetY(m_elems[
m_polymapping[a_polygon]]->GetVegHeight());
545 if (a_goose == gs_Greylag)
547 return m_GooseIntakeRateVSVegetationHeight_GL->GetY(m_elems[
m_polymapping[a_polygon]]->GetVegHeight());
549 Warn(
"Landscape::SupplyGooseGrazingForage",
"Unknown Goose Type");
561 return m_elems[m_land->
Get(a_x, a_y)]->GetGooseGrazingForage(a_goose);
572 return m_elems[
m_polymapping[a_polygon]]->GetGooseGrazingForage(a_goose);
586 return m_elems[m_land->
Get(a_x, a_y)]->GetBirdSeed();
592 return m_elems[
m_polymapping[ a_polyref ] ]->GetBirdMaize();
598 return m_elems[ m_land->
Get( a_x, a_y ) ]->GetBirdMaize();
604 void RecordGooseNumbers(
int a_poly,
int a_number);
609 void RecordGooseSpNumbers(
int a_poly,
int a_number, GooseSpecies a_goose);
614 void RecordGooseNumbersTimed(
int a_poly,
int a_number);
619 void RecordGooseSpNumbersTimed(
int a_poly,
int a_number, GooseSpecies a_goose);
624 m_elems[
m_polymapping[ a_poly ] ]->GrazeVegetation( a_forage,
true );
630 m_elems[
m_polymapping[ a_poly ] ]->GrazeVegetationTotal( a_forage );
635 int GetGooseNumbers(
int a_poly);
639 int GetGooseNumbers(
int a_x,
int a_y);
641 int SupplyLastTreatment(
int a_polyref,
int *a_index );
642 int SupplyLastTreatment(
int a_x,
int a_y,
int *a_index );
643 double GetHareFoodQuality(
int a_polygon);
649 double SupplyGlobalRadiation( );
650 double SupplyGlobalRadiation(
long a_date );
651 double SupplyRain(
void );
652 double SupplyTemp(
void );
653 double SupplyHumidity(
void);
654 double SupplyMeanTemp(
long a_date,
unsigned int a_period);
655 double SupplyWind(
void );
656 int SupplyWindDirection(
void );
657 double SupplySnowDepth(
void );
658 bool SupplySnowcover(
void );
659 int SupplyDaylength(
void );
663 double SupplyRain(
long a_date );
664 double SupplyTemp(
long a_date );
665 double SupplyWind(
long a_date );
666 double SupplyDayDegrees(
int a_polyref);
667 double SupplyRainPeriod(
long a_date,
int a_period );
668 double SupplyWindPeriod(
long a_date,
int a_period );
669 double SupplyTempPeriod(
long a_date,
int a_period);
673 bool SupplySnowcover(
long a_date );
690 int SupplyPolyRef(
int a_x,
int a_y );
691 int SupplyPolyRefIndex(
int a_x,
int a_y );
692 int SupplyPolyRefCC(
int a_x,
int a_y );
693 int SupplySimAreaWidth(
void );
694 int SupplySimAreaHeight(
void );
695 int SupplySimAreaMaxExtent(
void );
696 int SupplySimAreaMinExtent(
void );
697 int SupplyDaylength(
long a_date );
698 int SupplyDayInYear(
void );
699 int SupplyHour(
void );
700 int SupplyMinute(
void );
701 unsigned int SupplyNumberOfPolygons(
void );
703 SupplyElementTypeFromVector(
unsigned int a_index );
704 int SupplyPolyRefVector(
unsigned int a_index );
705 int SupplyPesticideCell(
int a_polyref);
706 int SupplyValidX(
int a_polyref);
707 int SupplyValidY(
int a_polyref);
713 void CorrectCoords(
int &x,
int &y);
715 APoint CorrectCoordsPt(
int x,
int y);
717 void CorrectCoordsPointNoWrap( APoint &a_pt );
718 int CorrectWidth(
int x );
719 int CorrectHeight(
int y );
720 void SetPolyMaxMinExtents(
void );
721 void CalculateCentroids(
void );
722 void DumpCentroids(
void );
724 void BuildingDesignationCalc();
725 void CentroidSpiralOut(
int a_polyref,
int &a_x,
int &a_y);
726 void CentroidSpiralOutBlocks(
int a_polyref,
int &a_x,
int &a_y);
740 void DumpMapInfoByArea(
const char *a_filename,
742 bool a_dump_zero_areas,
743 bool a_write_veg_names
746 void Warn( std::string a_msg1, std::string a_msg2 );
756 int* SupplyMagicMapP(
int a_x,
int a_y );
757 int MagicMapP2PolyRef(
int a_magic );
761 double SupplyTrafficLoad(
int a_x,
int a_y );
762 double SupplyTrafficLoad(
int a_polyref );
769 long SupplyGlobalDate(
void );
770 int SupplyYear(
void );
771 int SupplyYearNumber(
void );
772 int SupplyMonth(
void );
773 int SupplyDayInMonth(
void );
779 void SupplyLEReset(
void );
781 int SupplyLENext(
void );
782 int SupplyLECount(
void );
783 LE_Signal SupplyLESignal(
int a_polyref );
784 void SetLESignal(
int a_polyref,
LE_Signal a_signal );
786 void IncTreatCounter(
int a_treat );
790 LE* SupplyLEPointer(
int a_polyref );
795 std::string EventtypeToString(
int a_event );
815 void MakeCluster(
void);
816 void ReadInput(
int* ,
int* ,
int* , APoint*);
817 APoint RandomLocation(
void);
818 APoint GetNextSeed(
int);
819 int AddToClusterList(
int* ,
int* ,
int*,
int*,
int*);
820 void ModifyPolyRef(
int* );
837 return m_elems[ a_index ]->GetDigestability();
842 return m_elems[
m_polymapping[ a_polyref ]]->GetDigestability();
848 return m_elems[ m_land->Get( a_x, a_y ) ]->GetDigestability();
854 return m_elems[ a_index ]->GetVegHeight();
864 return m_elems[ m_land->Get( a_x, a_y ) ]->GetVegHeight();
871 return m_elems[ a_index ]->GetVegBiomass();
876 return m_elems[
m_polymapping[ a_polyref ]]->GetVegBiomass();
881 return m_elems[ m_land->Get( a_x, a_y ) ]->GetVegBiomass();
887 return m_elems[
m_polymapping[ a_polyref ]]->GetWeedBiomass();
893 return m_elems[ m_land->Get( a_x, a_y ) ]->GetWeedBiomass();
898 return m_elems[
m_polymapping[ a_polyref ]]->GetVegDensity();
915 return m_elems[ m_land->Get( a_x, a_y ) ]->GetVegPatchy();
921 return m_elems[ m_land->Get( a_x, a_y ) ]->GetVegDensity();
927 return m_elems[ m_land->Get( a_x, a_y ) ]->GetLATotal();
933 return m_elems[ m_land->Get( a_x, a_y ) ]->GetLAGreen();
940 return m_elems[
m_polymapping[ a_polyref ]]->GetGreenBiomass();
945 return m_elems[ m_land->Get( a_x, a_y ) ]->GetGreenBiomass();
952 return m_elems[
m_polymapping[ a_polyref ]]->GetDeadBiomass();
957 return m_elems[ m_land->Get( a_x, a_y ) ]->GetDeadBiomass();
976 return m_elems[ a_index ]->GetVegCover();
981 return m_elems[ m_land->Get( a_x, a_y ) ]->GetVegCover();
986 return m_elems[a_index]->GetLastSownVeg();
996 return m_elems[m_land->Get(a_x, a_y)]->GetLastSownVeg();
1006 return m_elems[m_land->Get(a_x, a_y)]->GetVegAge();
1011 return m_elems[
m_polymapping[ a_polyref ]]->GetInsectPop();
1016 return m_elems[ m_land->Get( a_x, a_y ) ]->GetInsectPop();
1027 return m_elems[ a_index ]->GetElementType();
1033 return m_elems[
m_polymapping[ a_polyref ]]->GetElementType();
1038 return m_elems[ m_land->Get( a_x, a_y ) ]->GetElementType();
1049 return m_elems[ m_land->Get( a_x, a_y ) ]->GetSubType();
1055 return m_elems[ m_land->Get( a_x, a_y ) ]->GetCountryDesignation();
1062 a_x = (a_x + m_width10) % m_width;
1063 a_y = (a_y + m_height10) % m_height;
1064 return m_elems[ m_land->Get( a_x, a_y ) ]->GetElementType();
1070 return m_FarmManager->GetNoFarms();
1074 return m_elems[ m_land->Get( a_x, a_y ) ]->GetOwnerFile();
1081 return m_elems[
m_polymapping[ a_polyref ]]->GetOwnerFile();
1088 return m_elems[ m_land->Get( a_x, a_y ) ]->GetOwnerIndex();
1095 return m_elems[
m_polymapping[ a_polyref ]]->GetOwnerIndex();
1102 return m_elems[
m_polymapping[ a_polyref ]]->GetOwner()->GetType();
1109 return m_elems[ m_land->Get( a_x, a_y ) ]->GetOwner()->GetType();
1115 opf =
dynamic_cast<OptimisingFarm*
>(m_elems[ m_land->Get( a_x, a_y ) ]->GetOwner());
1116 return opf-> Get_farmType();
1123 return m_elems[ a_polyref ]->GetArea();
1129 return m_elems[
m_polymapping[ a_polyref ]]->GetOwner()->GetArea();
1143 return m_elems[ a_index ]->GetVegType();
1150 return m_elems[
m_polymapping[ a_polyref ] ]->GetCattleGrazing();
1155 return m_elems[ a_index ]->GetCattleGrazing();
1162 return m_elems[ m_land->Get( a_x, a_y ) ]->GetCattleGrazing();
1169 return m_elems[
m_polymapping[ a_polyref ] ]->HasTramlines();
1175 return m_elems[ m_land->Get( a_x, a_y ) ]->HasTramlines();
1181 return m_elems[ a_index ]->IsRecentlyMown();
1186 return m_elems[
m_polymapping[ a_polyref ] ]->IsRecentlyMown();
1193 return m_elems[ a_index ]->IsRecentlySprayed();
1198 return m_elems[
m_polymapping[ a_polyref ] ]->IsRecentlySprayed();
1203 return m_elems[ m_land->Get( a_x, a_y ) ]->IsRecentlySprayed();
1210 return m_elems[
m_polymapping[ a_polyref ] ]->GetTrafficLoad();
1216 return m_elems[ m_land->Get( a_x, a_y ) ]->GetTrafficLoad();
1245 return m_elems[ m_land->Get( a_x, a_y ) ]->GetVegType();
1252 return m_elems[
m_polymapping[ a_polyref ]]->GetDayDegrees();
1257 return m_elems[
m_polymapping[ a_polyref ]]->GetLastTreatment( a_index );
1264 return m_elems[ m_land->Get( a_x, a_y ) ]->GetLastTreatment( a_index );
1379 return m_elems[ a_index ]->GetPoly();
1389 return (
unsigned int) m_elems.size();
1396 return m_elems[
m_polymapping[ a_polyref ] ]->GetPesticideCell();
1416 return m_elems[ m_land->Get( a_x, a_y )]->GetPoly();
1421 return m_land->Get( a_x, a_y );
1428 a_x = (a_x + m_width10) % m_width;
1429 a_y = (a_y + m_height10) % m_height;
1430 return m_elems[ m_land->Get( a_x, a_y )]->GetPoly();
1437 return m_land->GetMagicP( a_x, a_y );
1444 return m_elems[ a_magic ]->GetPoly();
1466 x = (m_width10 + x) % m_width;
1467 y = (m_height10 + y) % m_height;
1476 pt.m_x = (m_width10 + x) % m_width;
1477 pt.m_y = (m_height10 + y) % m_height;
1486 if (a_pt.m_x >= m_width) a_pt.m_x = m_width - 1;
1487 if (a_pt.m_y >= m_height) a_pt.m_y = m_height - 1;
1488 if (a_pt.m_x < 0) a_pt.m_x = 0;
1489 if (a_pt.m_y < 0) a_pt.m_y = 0;
1495 return (m_width10+x)%m_width;
1501 return (m_height10+y)%m_height;
1599 #endif // LANDSCAPE_H
Farm * SupplyFarmPtr(int a_owner)
int SupplyDaylength(void)
double SupplyLATotal(int a_x, int a_y)
bool GetSnow(long a_date)
bool SupplyJustMown(int a_polyref)
double SupplyBirdMaizeForage(int a_x, int a_y)
Returns the maize forage resource as seen from a goose standpoint at an x,y location.
TTypesOfVegetation SupplyVegType(int a_x, int a_y)
int SupplyPolyRef(int a_x, int a_y)
int SupplyTreeHeight(int, int)
int SupplyPolyRefCC(int a_x, int a_y)
The landscape class containing all environmental and topographical data.
bool SupplyJustMownVector(unsigned int a_index)
int SupplyElementSubType(int a_polyref)
int SupplyCentroidY(int a_x, int a_y)
int BackTranslateEleTypes(TTypesOfLandscapeElement EleReference)
TTypesOfOptFarms SupplyOptFarmType(int a_x, int a_y)
int SupplyLargestPolyNumUsed()
double SupplyVegCoverVector(unsigned int a_index)
LE * SupplyLEPointer(int a_polyref)
int SupplyFarmArea(int a_polyref)
void CorrectCoords(int &x, int &y)
Function to prevent wrap around errors with co-ordinates using x/y pair.
TTypesOfFarm SupplyFarmType(int a_polyref)
double GetRain(long a_date)
vector< LE * > m_elems
List of all landscape elements. The index is a sequential number, to get the polynum look this number...
int SupplyJustSprayed(int a_polyref)
TTypesOfVegetation TranslateVegTypes(int VegReference)
bool SupplyIsGrass(int a_polyref)
int SupplyCountryDesig(int a_x, int a_y)
vector< LE * > hb_new_hbs
int SupplyJustSprayedVector(unsigned int a_index)
int SupplyVegDensity(int a_polyref)
TTypesOfVegetation SupplyLastSownVeg(int a_polyref)
double SupplyVegBiomassVector(unsigned int a_index)
int SupplySimAreaMaxExtent(void)
double GetWind(long a_date)
int SupplyTreeAge(int a_Polyref)
void SetBirdMaizeForage(int a_polyref, double a_fooddensity)
Sets the maize forage resource as seen from a goose standpoint at a polygon.
int SupplyWindDirection(void)
int SupplyTreeHeight(int)
int SupplyCentroidY(int a_polyref)
void RebuildPolyMapping()
int SupplyHour(void)
Get the hour of the day.
double SupplyGreenBiomass(int a_polyref)
int SupplyNumberOfFarms()
int SupplyGrazingPressure(int a_polyref)
double SupplyHumidity(void)
double SupplyDaylightProp()
TTypesOfLandscapeElement SupplyElementType(int a_polyref)
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...
double SupplyBirdMaizeForage(int a_polyref)
Returns the maize forage resource.
int HowManyPonds()
Returns the number of ponds in the landscape.
double GetSnowDepth(void)
Get the current snow depth.
RodenticideManager * m_RodenticideManager
TTypeOfDirections
ALMaSS 8 standard directions.
int BackTranslateVegTypes(TTypesOfVegetation VegReference)
void DumpPublicSymbols(const char *a_dumpfile, CfgSecureLevel a_level)
TTypesOfLandscapeElement TranslateEleTypes(int EleReference)
double SupplyLAGreen(int a_polyref)
TTypesOfVegetation vegtype
int SupplySimAreaWidth(void)
int Get(int a_x, int a_y)
int SupplyOpenness(int a_x, int a_y)
Get openness for a location.
double SupplySnowDepth(void)
bool ReadSymbols(const char *a_cfgfile)
double SupplyVegHeightVector(unsigned int a_index)
Polynomial2CurveClass * m_GooseIntakeRateVSVegetationHeight_GL
void DumpAllSymbolsAndExit(const char *a_dumpfile)
bool SupplySnowcover(void)
int SupplySoilTypeR(int a_x, int a_y)
Returns the soil type in rabbit warren reference numbers.
A farm that carries out crop, pesticide and fertilizer planning using simplified optimisation or othe...
Base class for all population managers.
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...
int SupplyOpenness(int a_poly)
Get openness for a polygon.
int SupplyGrazingPressureVector(unsigned int a_index)
TTypesOfLandscapeElement TranslateEleTypes(int EleReference)
A list item entry of field polygon reference numbers with associated openness and goose food scores...
int SupplyUnderGrowthWidth(int)
class Weather * g_weather
int SupplySoilType(int a_x, int a_y)
Returns the soil type in ALMaSS types reference numbers.
bool SupplyIsCereal(int a_polyref)
double SupplyTrafficLoad(int a_x, int a_y)
int SupplyValidY(int a_polyref)
bool m_DoMissingPolygonsManipulations
void DumpAllSymbolsAndExit(const char *a_dumpfile)
double SupplyWeedBiomass(int a_polyref)
double GetTemp(long a_date)
Get the temperature on a particular date.
class LE_TypeClass * g_letype
APoint CorrectCoordsPt(int x, int y)
Function to prevent wrap around errors with co-ordinates using x/y pair.
bool ReadSymbols(const char *a_cfgfile)
class MapErrorMsg * g_msg
void CorrectCoordsPointNoWrap(APoint &a_pt)
Function to prevent wrap around errors with co-ordinates using a APoint.
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...
The base class for all farm types.
int SupplyYearNumber(void)
Population_Manager * SupplyThePopManager()
Get the pointer to the current main population manager.
TTypesOfVegetation SupplyVegTypeVector(unsigned int a_index)
int SupplyMinute(void)
Get the minute of the hour.
int SupplyUnderGrowthWidth(int, int)
double GetMeanTemp(long a_date, unsigned int a_period)
bool SupplyIsMatureCereal(int a_polyref)
int SupplyDayInMonth(void)
double SupplyDeadBiomass(int a_polyref)
bool SupplyHasTramlines(int a_x, int a_y)
FarmManager * m_FarmManager
List of all the farms.
double SupplyGlobalRadiation()
Polynomial2CurveClass * m_GooseIntakeRateVSVegetationHeight_BG
double GetGlobalRadiation(long a_date)
double SupplyInsects(int a_polyref)
vector< int > m_PondIndexList
List of pond indexes.
bool IsFieldType(TTypesOfLandscapeElement a_tole)
double SupplyBirdSeedForage(int a_x, int a_y)
Returns the grain forage resource as seen from a goose standpoint at an x,y location.
int hb_first_free_poly_num
class Configurator * g_cfg
double SupplyPondPesticide(int a_poly_index)
Get the pesticide concentration per liter from a pond (must be a pond index on calling) ...
RasterMap * m_land
The big map.
int SupplyCentroidX(int a_polyref)
int SupplyPesticideCell(int a_polyref)
FarmManager * SupplyFarmManagerPtr()
int SupplyFarmOwner(int a_x, int a_y)
TTypesOfVegetation TranslateVegTypes(int VegReference)
int SupplyValidX(int a_polyref)
int SupplyPondIndex(int a_pondref)
Returns the index of a pond based on pondref or -1 if not found.
void SetThePopManager(Population_Manager *a_ptr)
Set the pointer to the current main population manager.
int SupplySimAreaHeight(void)
double GetTempPeriod(long a_date, unsigned int a_period)
double GetWindPeriod(long a_date, unsigned int a_period)
int SupplyCentroidX(int a_x, int a_y)
int SupplyRoadWidth(int, int)
double SupplyPolygonArea(int a_polyref)
int SupplyDayInYear(void)
int GetWindDirection(void)
vector< unsigned > polylist
int SupplyVegAge(int a_Polyref)
double SupplyVegBiomass(int a_polyref)
double SupplyDayDegrees(int a_polyref)
Ponds are defined as freshwater bodies between 25m2 and 5000m2. For newts the effective size is limit...
bool SupplyVegPatchy(int a_polyref)
double GetHumidity(void)
Get the humidity score today.
void GrazeVegetationTotal(int a_poly, double a_forage)
Removes grazing forage from a poly and divides this out per m2.
int SupplyVegPhase(int a_poly)
double SupplyWindPeriod(long a_date, int a_period)
double SupplyVegCover(int a_polyref)
TTypesOfPesticide m_PesticideType
An attribute to hold the pesticide type being tested, if there is one, if not default is -1...
double SupplyTempPeriod(long a_date, int a_period)
std::vector< GooseFieldListItem > GooseFieldList
A list of GooseFieldListItem s.
TTypesOfLandscapeElement SupplyElementTypeFromVector(unsigned int a_index)
TTypesOfVegetation SupplyLastSownVegVector(unsigned int a_index)
const char * SupplyVersion(void)
void Warn(std::string a_msg1, std::string a_msg2)
int SupplyTreeAge(int, int)
int geesespTimed[gs_foobar]
double SupplyBirdSeedForage(int a_polyref)
Returns the grain forage resource.
TTypesOfPesticide SupplyPesticideType(void)
int * SupplyMagicMapP(int a_x, int a_y)
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
double SupplyVegHeight(int a_polyref)
double SupplyRainPeriod(long a_date, int a_period)
void SetBirdSeedForage(int a_polyref, double a_fooddensity)
Sets the grain forage resource as seen from a goose standpoint at a polygon.
int SupplyPolyRefVector(unsigned int a_index)
bool SupplyLEHigh(int a_x, int a_y)
Tests whether the polygon at a_x,a_y is designated as high.
TTypesOfLandscapeElement SupplyElementTypeCC(int a_x, int a_y)
void GrazeVegetation(int a_poly, double a_forage)
Removes grazing forage from a poly per m2.
bool SupplyMaleNewtPresent(int a_InPondIndex)
Determines if a male is present in a pond.
int SupplyPolyRefIndex(int a_x, int a_y)
long SupplyGlobalDate(void)
Population_Manager * m_ThePopManager
a pointer to the current main population manager
double GetRainPeriod(long a_date, unsigned int a_period)
bool m_NeedCentroidCalculation
a flag to ensure centroid calculation on object construction
Polynomial2CurveClass * m_GooseIntakeRateVSVegetationHeight_PF
Curve relatning goose intake rates in KJ/min to vegetation height.
bool m_NeedOpennessCalculation
a flag to ensure openness calculation on object construction
double GetDaylightProportion(void)
RodenticidePredators_Population_Manager * SupplyRodenticidePredatoryManager()
int * m_polymapping
m_polymapping is a mapping from polygon numbers into the list of landscape elements, m_elems. When using this it is important that it is the poly num and not the map index that is used in calling.
unsigned int SupplyNumberOfPolygons(void)
double SupplyVegDigestabilityVector(unsigned int a_index)
RodenticidePredators_Population_Manager * m_RodenticidePreds
void DumpPublicSymbols(const char *a_dumpfile, CfgSecureLevel a_level)
int BackTranslateVegTypes(TTypesOfVegetation VegReference)
double SupplyMeanTemp(long a_date, unsigned int a_period)
Farm * GetFarmPtr(int a_owner)
Returns the pointer to a farm with a specific number.
int BackTranslateEleTypes(TTypesOfLandscapeElement EleReference)
double SupplyPolygonAreaVector(int a_polyref)
Returns the area of a polygon using the vector index as a reference.
vector< int > m_PondRefsList
List of pond polyrefs.
int SupplyLastTreatment(int a_polyref, int *a_index)
double SupplyVegDigestability(int a_polyref)
bool SupplySkScrapes(int a_polyref)
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...
int SupplyFarmOwnerIndex(int a_x, int a_y)
void SetMaleNewtPresent(int a_InPondIndex)
Sets a male as being present in a pond.
int MagicMapP2PolyRef(int a_magic)