ALMaSS Rodenticide ODdox
1.1
The rodenticide model description following ODdox protocol
|
The landscape class containing all environmental and topographical data.
More...
#include <landscape.h>
|
void | FillVegAreaData () |
|
double | GetVegArea (int v) |
|
void | DumpVegAreaData (int a_day) |
|
void | SkylarkEvaluation (SkTerritories *a_skt) |
|
void | RodenticidePredatorsEvaluation (RodenticidePredators_Population_Manager *a_rppm) |
|
Population_Manager * | SupplyThePopManager () |
| Get the pointer to the current main population manager. More...
|
|
void | SetThePopManager (Population_Manager *a_ptr) |
| Set the pointer to the current main population manager. More...
|
|
int | SupplyFarmAnimalCensus (int a_farm_ref, int a_LifeStage) |
|
int | SupplyVegPhase (int a_poly) |
|
void | SetPolymapping (int a_index, int a_val) |
|
int | GetPolymapping (int a_index) |
|
| ~Landscape (void) |
|
| Landscape (void) |
|
void | SimulationClosingActions () |
|
void | Tick (void) |
|
void | TurnTheWorld (void) |
|
int | HowManyPonds () |
| Returns the number of ponds in the landscape. More...
|
|
int | SupplyRandomPondIndex () |
| Returns random pond index. More...
|
|
int | SupplyRandomPondRef () |
| Returns random pond polyref. More...
|
|
int | SupplyPondIndex (int a_pondref) |
| Returns the index of a pond based on pondref or -1 if not found. More...
|
|
void | SetMaleNewtPresent (int a_InPondIndex) |
| Sets a male as being present in a pond. More...
|
|
bool | SupplyMaleNewtPresent (int a_InPondIndex) |
| Determines if a male is present in a pond. More...
|
|
Farm * | SupplyFarmPtr (int a_owner) |
|
FarmManager * | SupplyFarmManagerPtr () |
|
int | SupplyLargestPolyNumUsed () |
|
bool | SupplyShouldSpray () |
|
double | SupplyVegDigestabilityVector (unsigned int a_index) |
|
double | SupplyVegDigestability (int a_polyref) |
|
double | SupplyVegDigestability (int a_x, int a_y) |
|
double | SupplyVegHeightVector (unsigned int a_index) |
|
double | SupplyVegHeight (int a_polyref) |
|
double | SupplyVegHeight (int a_x, int a_y) |
|
double | SupplyVegBiomassVector (unsigned int a_index) |
|
double | SupplyVegBiomass (int a_polyref) |
|
double | SupplyVegBiomass (int a_x, int a_y) |
|
int | SupplyVegDensity (int a_polyref) |
|
int | SupplyVegDensity (int a_x, int a_y) |
|
double | SupplyWeedBiomass (int a_polyref) |
|
double | SupplyWeedBiomass (int a_x, int a_y) |
|
PollenNectarQuality | SupplyPollen (int a_polyref) |
|
PollenNectarQuality | SupplyPollen (int a_x, int a_y) |
|
double | SupplyTotalPollen (int a_polyref) |
|
double | SupplyTotalPollen (int a_x, int a_y) |
|
PollenNectarQuality | SupplyNectar (int a_polyref) |
|
PollenNectarQuality | SupplyNectar (int a_x, int a_y) |
|
double | SupplyTotalNectar (int a_polyref) |
|
double | SupplyTotalNectar (int a_x, int a_y) |
|
bool | SupplySkScrapes (int a_polyref) |
|
bool | SupplyVegPatchy (int a_polyref) |
|
bool | SupplyVegPatchy (int a_x, int a_y) |
|
double | SupplyGreenBiomass (int a_polyref) |
|
double | SupplyGreenBiomass (int a_x, int a_y) |
|
double | SupplyDeadBiomass (int a_polyref) |
|
double | SupplyDeadBiomass (int a_x, int a_y) |
|
double | SupplyLAGreen (int a_polyref) |
|
double | SupplyLAGreen (int a_x, int a_y) |
|
double | SupplyLATotal (int a_x, int a_y) |
|
double | SupplyVegCover (int a_polyref) |
|
double | SupplyVegCoverVector (unsigned int a_index) |
|
double | SupplyVegCover (int a_x, int a_y) |
|
TTypesOfVegetation | SupplyLastSownVeg (int a_polyref) |
|
TTypesOfVegetation | SupplyLastSownVeg (int a_x, int a_y) |
|
TTypesOfVegetation | SupplyLastSownVegVector (unsigned int a_index) |
|
double | SupplyInsects (int a_polyref) |
|
double | SupplyInsects (int a_x, int a_y) |
|
bool | SubtractPondLarvalFood (double a_food, int a_polyrefindex) |
| Removes larval food from a pond and returns true if it was possible, otherwise false. More...
|
|
void | CheckForPesticideRecord (LE *a_field, TTypesOfPesticideCategory a_pcide) |
| Check if needed and record pesticide application. More...
|
|
double | SupplyRodenticide (int a_x, int a_y) |
| Gets total rodenticide for a location. More...
|
|
bool | SupplyPesticideDecay (PlantProtectionProducts a_ppp) |
| Returns true if there is any pesticide in the system at all at this point. More...
|
|
double | SupplyPesticide (int a_x, int a_y, PlantProtectionProducts a_ppp) |
| Gets total pesticide for a location. More...
|
|
bool | SupplyOverspray (int a_x, int a_y) |
| Gets the overspray flag. More...
|
|
double | SupplyPesticideP (int a_x, int a_y, PlantProtectionProducts a_ppp) |
| Gets plant pesticide for a location. More...
|
|
double | SupplyPesticideS (int a_x, int a_y, PlantProtectionProducts a_ppp) |
| Gets soil pesticide for a location. More...
|
|
double | SupplyPesticide (int a_polyref, PlantProtectionProducts a_ppp) |
| Gets total pesticide for the centroid of a polygon. More...
|
|
double | SupplyPesticideP (int a_polyref, PlantProtectionProducts a_ppp) |
| Gets plant pesticide for the centroid of a polygon. More...
|
|
double | SupplyPesticideS (int a_polyref, PlantProtectionProducts a_ppp) |
| Gets soil pesticide for the centroid of a polygon. More...
|
|
RodenticidePredators_Population_Manager * | SupplyRodenticidePredatoryManager () |
|
TTypesOfPesticide | SupplyPesticideType (void) |
|
GooseFieldList * | GetGooseFields (double) |
| Gets the list of suitable goose foraging fields today. More...
|
|
void | ResetGrainAndMaize () |
| Resets all grain. More...
|
|
void | CalculateOpenness (bool a_realcalc) |
| Causes openness to be calulated and stored for all polygons. More...
|
|
void | WriteOpenness (void) |
| Stores openness for all polygons to a standard file. More...
|
|
void | ReadOpenness (void) |
| Reads openness values from a standard input file for all polygons. More...
|
|
int | CalulateFieldOpennessCentroid (int a_pref) |
| Provides a measure of the shortest distance in 360 degree, e-g- looking NE % SW before tall obstacles are encountered at both ends. Searches from centroid. More...
|
|
int | CalulateFieldOpennessAllCells (int a_pref) |
| Provides a measure of the shortest distance in 360 degree, e-g- looking NE % SW before tall obstacles are encountered at both ends. Checks all field 1m2. More...
|
|
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 encountered in both +ve & -ve directions. More...
|
|
int | SupplyOpenness (int a_poly) |
| Get openness for a polygon. More...
|
|
int | SupplyOpenness (int a_x, int a_y) |
| Get openness for a location. More...
|
|
bool | SupplyLEHigh (int a_x, int a_y) |
| Tests whether the polygon at a_x,a_y is designated as high. More...
|
|
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,y. More...
|
|
int | SupplySoilType (int a_x, int a_y) |
| Returns the soil type in ALMaSS types reference numbers. More...
|
|
int | SupplySoilTypeR (int a_x, int a_y) |
| Returns the soil type in rabbit warren reference numbers. More...
|
|
APoint | SupplyCentroid (int a_polyref) |
|
APoint | SupplyCentroidIndex (int a_polyrefindex) |
|
int | SupplyCentroidX (int a_polyref) |
|
int | SupplyCentroidY (int a_polyref) |
|
int | SupplyCentroidX (int a_x, int a_y) |
|
int | SupplyCentroidY (int a_x, int a_y) |
|
int | SupplyFarmIntensity (int a_x, int a_y) |
|
int | SupplyFarmIntensity (int a_polyref) |
|
int | SupplyFarmIntensityI (int a_polyindex) |
|
TTypesOfLandscapeElement | SupplyElementType (int a_polyref) |
|
TTypesOfLandscapeElement | SupplyElementType (int a_x, int a_y) |
|
TTypesOfLandscapeElement | SupplyElementTypeCC (int a_x, int a_y) |
|
int | SupplyCountryDesig (int a_x, int a_y) |
|
int | SupplyElementSubType (int a_polyref) |
|
int | SupplyElementSubType (int a_x, int a_y) |
|
TTypesOfVegetation | SupplyVegType (int a_x, int a_y) |
|
TTypesOfVegetation | SupplyVegType (int polyref) |
|
TTypesOfVegetation | SupplyVegTypeVector (unsigned int a_index) |
|
int | SupplyGrazingPressureVector (unsigned int a_index) |
|
int | SupplyGrazingPressure (int a_polyref) |
|
int | SupplyGrazingPressure (int a_x, int a_y) |
|
bool | SupplyIsCereal (int a_polyref) |
|
bool | SupplyIsMatureCereal (int a_polyref) |
|
bool | SupplyIsGrass (int a_polyref) |
|
bool | SupplyIsGrass2 (TTypesOfVegetation a_vege_type) |
|
bool | SupplyIsCereal2 (TTypesOfVegetation a_vege_type) |
|
bool | SupplyHasTramlines (int a_x, int a_y) |
|
bool | SupplyHasTramlines (int a_polyref) |
|
bool | SupplyJustMownVector (unsigned int a_index) |
|
bool | SupplyJustMown (int a_polyref) |
|
int | SupplyJustSprayedVector (unsigned int a_index) |
|
int | SupplyJustSprayed (int a_polyref) |
|
int | SupplyJustSprayed (int a_x, int a_y) |
|
int | SupplyTreeAge (int a_Polyref) |
|
int | SupplyTreeAge (int, int) |
|
int | SupplyVegAge (int a_Polyref) |
|
int | SupplyVegAge (int a_x, int a_y) |
|
int | SupplyNumberOfFarms () |
|
int | SupplyFarmOwner (int a_x, int a_y) |
|
int | SupplyFarmOwner (int a_polyref) |
|
int | SupplyFarmOwnerIndex (int a_x, int a_y) |
|
int | SupplyFarmOwnerIndex (int a_polyref) |
|
TTypesOfFarm | SupplyFarmType (int a_polyref) |
|
TTypesOfFarm | SupplyFarmType (int a_x, int a_y) |
|
TTypesOfOptFarms | SupplyOptFarmType (int a_x, int a_y) |
|
int | SupplyFarmArea (int a_polyref) |
|
double | SupplyPolygonAreaVector (int a_polyref) |
| Returns the area of a polygon using the vector index as a reference. More...
|
|
double | SupplyPolygonArea (int a_polyref) |
|
void | SetBirdSeedForage (int a_polyref, double a_fooddensity) |
| Sets the grain forage resource as seen from a goose standpoint at a polygon. More...
|
|
void | SetBirdMaizeForage (int a_polyref, double a_fooddensity) |
| Sets the maize forage resource as seen from a goose standpoint at a polygon. More...
|
|
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 only. More...
|
|
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 based on height only. More...
|
|
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,y location. More...
|
|
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,y location The amount of food avaiable as grazing resource based on the vegetation height is species specific. More...
|
|
double | SupplyBirdSeedForage (int a_polyref) |
| Returns the grain forage resource. More...
|
|
double | SupplyBirdSeedForage (int a_x, int a_y) |
| Returns the grain forage resource as seen from a goose standpoint at an x,y location. More...
|
|
double | SupplyBirdMaizeForage (int a_polyref) |
| Returns the maize forage resource. More...
|
|
bool | SupplyInStubble (int a_polyref) |
| Returns whether its cereal. More...
|
|
double | SupplyBirdMaizeForage (int a_x, int a_y) |
| Returns the maize forage resource as seen from a goose standpoint at an x,y location. More...
|
|
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 clearing of values two values are saved, the number and simulation day - on reading the simulation day number can be used to modify the return value - see GetGooseNumbers() More...
|
|
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 unnecessary clearing of values two values are saved, the number and simulation day - on reading the simulation day number can be used to modify the return value - see GetGooseNumbers() More...
|
|
void | RecordGooseNumbersTimed (int a_poly, int a_number) |
| This records the number of geese on the polygon the day before at a predefined time. To prevent lots of unnecessary clearing of values two values are saved, the number and simulation day - on reading the simulation day number can be used to modify the return value - see GetGooseNumbers() More...
|
|
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. To prevent lots of unnecessary clearing of values two values are saved, the number and simulation day - on reading the simulation day number can be used to modify the return value - see GetGooseNumbers() More...
|
|
void | RecordGooseRoostDist (int a_polyref, int a_dist, GooseSpecies a_goose) |
| Records the distance to the closest roost of goose species. More...
|
|
void | GrazeVegetation (int a_poly, double a_forage) |
| Removes grazing forage from a poly per m2. More...
|
|
void | GrazeVegetationTotal (int a_poly, double a_forage) |
| Removes grazing forage from a poly and divides this out per m2. More...
|
|
int | GetGooseNumbers (int a_poly) |
| This returns the number of geese on the polygon the day before. More...
|
|
int | GetQuarryNumbers (int a_poly) |
| This returns the number of geese which are legal quarry on the polygon the day before. More...
|
|
int | GetGooseNumbers (int a_x, int a_y) |
| This returns the number of geese on the polygon specifed by a_x, a_y the day before. More...
|
|
int | SupplyLastTreatment (int a_polyref, int *a_index) |
|
int | SupplyLastTreatment (int a_x, int a_y, int *a_index) |
|
double | GetHareFoodQuality (int a_polygon) |
|
double | SupplyGlobalRadiation () |
|
double | SupplyGlobalRadiation (long a_date) |
|
double | SupplyRain (void) |
|
double | SupplyTemp (void) |
|
double | SupplyHumidity (void) |
|
double | SupplyMeanTemp (long a_date, unsigned int a_period) |
|
double | SupplyWind (void) |
|
int | SupplyWindDirection (void) |
|
double | SupplySnowDepth (void) |
|
bool | SupplySnowcover (void) |
|
int | SupplyDaylength (void) |
|
double | SupplyRain (long a_date) |
|
double | SupplyTemp (long a_date) |
|
double | SupplyWind (long a_date) |
|
double | SupplyDayDegrees (int a_polyref) |
|
double | SupplyRainPeriod (long a_date, int a_period) |
|
double | SupplyWindPeriod (long a_date, int a_period) |
|
double | SupplyTempPeriod (long a_date, int a_period) |
|
bool | SupplySnowcover (long a_date) |
|
bool | IsFieldType (TTypesOfLandscapeElement a_tole) |
|
int | SupplyPolyRef (int a_x, int a_y) |
|
int | SupplyPolyRefIndex (int a_x, int a_y) |
|
int | SupplyPolyRefCC (int a_x, int a_y) |
|
int | SupplySimAreaWidth (void) |
|
int | SupplySimAreaHeight (void) |
|
int | SupplySimAreaMaxExtent (void) |
|
int | SupplySimAreaMinExtent (void) |
|
int | SupplyDaylength (long a_date) |
|
int | SupplyDayInYear (void) |
|
int | SupplyHour (void) |
| Get the hour of the day. More...
|
|
int | SupplyMinute (void) |
| Get the minute of the hour. More...
|
|
unsigned int | SupplyNumberOfPolygons (void) |
|
TTypesOfLandscapeElement | SupplyElementTypeFromVector (unsigned int a_index) |
|
int | SupplyPolyRefVector (unsigned int a_index) |
|
int | SupplyPesticideCell (int a_polyref) |
|
int | SupplyValidX (int a_polyref) |
|
int | SupplyValidY (int a_polyref) |
|
double | SupplyPondPesticide (int a_poly_index) |
| Get the pesticide concentration per liter from a pond (must be a pond index on calling) More...
|
|
void | CorrectCoords (int &x, int &y) |
| Function to prevent wrap around errors with co-ordinates using x/y pair. More...
|
|
APoint | CorrectCoordsPt (int x, int y) |
| Function to prevent wrap around errors with co-ordinates using x/y pair. More...
|
|
void | CorrectCoordsPointNoWrap (APoint &a_pt) |
| Function to prevent wrap around errors with co-ordinates using a APoint. More...
|
|
int | CorrectWidth (int x) |
|
int | CorrectHeight (int y) |
|
void | SetPolyMaxMinExtents (void) |
|
void | CalculateCentroids (void) |
|
void | DumpCentroids (void) |
|
void | BuildingDesignationCalc () |
| used to calculate whether a building is rural or town - for rodenticide use More...
|
|
void | CentroidSpiralOut (int a_polyref, int &a_x, int &a_y) |
|
const char * | SupplyVersion (void) |
|
void | DumpPublicSymbols (const char *a_dumpfile, CfgSecureLevel a_level) |
|
void | DumpAllSymbolsAndExit (const char *a_dumpfile) |
|
bool | ReadSymbols (const char *a_cfgfile) |
|
void | DumpMapInfoByArea (const char *a_filename, bool a_append, bool a_dump_zero_areas, bool a_write_veg_names) |
|
void | Warn (std::string a_msg1, std::string a_msg2) |
|
int * | SupplyMagicMapP (int a_x, int a_y) |
|
int | MagicMapP2PolyRef (int a_magic) |
|
int | SupplyRoadWidth (int, int) |
|
double | SupplyTrafficLoad (int a_x, int a_y) |
|
double | SupplyTrafficLoad (int a_polyref) |
|
int | SupplyTreeHeight (int, int) |
|
int | SupplyUnderGrowthWidth (int, int) |
|
int | SupplyTreeHeight (int) |
|
int | SupplyUnderGrowthWidth (int) |
|
long | SupplyGlobalDate (void) |
|
int | SupplyYear (void) |
|
int | SupplyYearNumber (void) |
|
int | SupplyMonth (void) |
|
int | SupplyDayInMonth (void) |
|
double | SupplyDaylightProp () |
|
double | SupplyNightProp () |
|
void | SupplyLEReset (void) |
|
int | SupplyLENext (void) |
|
int | SupplyLECount (void) |
|
LE_Signal | SupplyLESignal (int a_polyref) |
|
void | SetLESignal (int a_polyref, LE_Signal a_signal) |
|
void | IncTreatCounter (int a_treat) |
|
TTypesOfLandscapeElement | TranslateEleTypes (int EleReference) |
|
TTypesOfVegetation | TranslateVegTypes (int VegReference) |
|
LE * | SupplyLEPointer (int a_polyref) |
|
int | BackTranslateEleTypes (TTypesOfLandscapeElement EleReference) |
|
int | BackTranslateVegTypes (TTypesOfVegetation VegReference) |
|
std::string | EventtypeToString (int a_event) |
|
std::string | PolytypeToString (TTypesOfLandscapeElement a_le_type) |
|
std::string | VegtypeToString (TTypesOfVegetation a_veg) |
|
void | InitOsmiaBeeNesting () |
| Read in the Osmia nest density files and allocate to each LE object. More...
|
|
void | UpdateOsmiaNesting () |
| Tesll all LE objects to update their osmia nest status. More...
|
|
bool | SupplyOsmiaNest (int a_x, int a_y) |
| Find out whether an osmia nest can be made here. More...
|
|
void | IncOsmiaNest (int a_x, int a_y) |
| Reopen the osmia nest here
More...
|
|
void | ReleaseOsmiaNest (int a_x, int a_y) |
| Reopen the osmia nest here
More...
|
|
|
void | GISASCII_Output (string outpfile, int UTMX, int UTMY) |
| Write ASCII file of the ALMaSS map. More...
|
|
void | AddGreenElement (LE *a_green) |
|
void | ReadPolys (const char *a_polyfile) |
|
void | ReadPolys2 (const char *a_polyfile) |
| reads in polygon information. Version 2 including centroid and openness information More...
|
|
void | PolysValidate (bool a_exit_on_invalid) |
|
bool | PolysRemoveInvalid (void) |
|
void | PolysDump (const char *a_filename) |
|
void | DumpMap (const char *a_filename) |
|
void | ConsolidatePolys (void) |
|
void | CountMapSquares (void) |
|
void | PolysRenumber (void) |
|
void | RebuildPolyMapping () |
|
void | ForceArea (void) |
|
void | ChangeMapMapping (void) |
|
LE * | NewElement (TTypesOfLandscapeElement a_type) |
|
void | RemoveMissingValues () |
| A method for replacing missing values in the map with corrected ones - slow. More...
|
|
void | TestCropManagement (void) |
|
void | VegDump (int x, int y) |
|
void | EventDump (int x, int y, int x2, int y2) |
|
void | EventDumpPesticides (int x1, int y1) |
|
void | DegreesDump () |
| Prints the sum of day degrees. See #FarmManager::daydegrees. More...
|
|
bool | BorderNeed (TTypesOfLandscapeElement a_letype) |
|
void | BorderAdd (LE *a_field, TTypesOfLandscapeElement a_type) |
|
void | BorderRemoval (void) |
|
int | RemoveSmallPolygons (void) |
| Removes small polygons from the map. More...
|
|
void | CreatePondList () |
| Creates a list of pond polygon refs/indexes for easy look up. More...
|
|
void | UnsprayedMarginAdd (LE *a_field) |
|
void | UnsprayedMarginScan (LE *a_field, int a_width) |
|
void | BorderScan (LE *a_field, int a_width) |
|
bool | BorderTest (int a_fieldpoly, int a_borderpoly, int a_x, int a_y) |
|
bool | StepOneValid (int a_polyindex, int a_x, int a_y, int step) |
|
bool | UMarginTest (int a_fieldpoly, int a_borderpoly, int a_x, int a_y, int a_width) |
|
bool | FindValidXY (int a_field, int &a_x, int &a_y) |
|
bool | BorderStep (int a_fieldpoly, int a_borderpoly, int *a_x, int *a_y) |
|
bool | BorderStep (int a_fieldpoly, int a_borderpoly, APoint *a_coord) |
|
void | AddBeetleBanks (TTypesOfLandscapeElement a_tole) |
|
bool | BeetleBankPossible (LE *a_field, TTypesOfLandscapeElement a_tole) |
|
void | BeetleBankAdd (int x, int y, int angle, int length, LE *a_field, TTypesOfLandscapeElement a_tole) |
|
bool | FindFieldCenter (LE *a_field, int *x, int *y) |
|
int | FindLongestAxis (int *x, int *y, int *a_length) |
|
void | AxisLoop (int a_poly, int *a_x, int *a_y, int a_axis) |
|
void | AxisLoop (int a_poly, APoint *a_cor, int a_axis) |
|
void | AxisLoopLtd (int a_poly, APoint *a_cor, int a_axis, int a_limit) |
|
void | hb_Add (void) |
|
void | hb_AddNewHedgebanks (int a_orig_poly_num) |
|
int | hb_StripingDist (void) |
|
void | hb_GenerateHBPolys (void) |
|
void | hb_FindHedges (void) |
|
bool | hb_FindBoundingBox (int a_poly_num) |
|
void | hb_UpPolyNumbers (void) |
|
void | hb_ClearPolygon (int a_poly_num) |
|
void | hb_PaintBorder (int a_color) |
|
bool | hb_MapBorder (int a_x, int a_y) |
|
bool | hb_HasOtherNeighbour (int a_x, int a_y) |
|
bool | hb_PaintWhoHasNeighbourColor (int a_neighbour_color, int a_new_color) |
|
bool | hb_HasNeighbourColor (int a_x, int a_y, int a_neighbour_color) |
|
void | hb_MarkTopFromLocalMax (int a_color) |
|
void | hb_MarkTheBresenhamWay (void) |
|
int | hb_MaxUnpaintedNegNeighbour (int a_x, int a_y) |
|
void | hb_ResetColorBits (void) |
|
void | hb_RestoreHedgeCore (int a_orig_poly_number) |
|
void | hb_DownPolyNumbers (void) |
|
void | hb_Cleanup (void) |
|
void | DumpMapGraphics (const char *a_filename) |
|
void | DumpTreatCounters (const char *a_filename) |
|
bool | CIPELandscapeMaker () |
|
The landscape class containing all environmental and topographical data.
◆ ~Landscape()
Landscape::~Landscape |
( |
void |
| ) |
|
◆ Landscape()
Landscape::Landscape |
( |
void |
| ) |
|
If the farmer decision making model is on, the #FarmManager::InitFarms() is called here to initialise the farms. The #FarmManager::FindNeighbours() function is called.
Next job after checking the basic map validity is to deal with any missing polygon information This is done by identifying the polygons that are large contiguous areas and making them wasteland. The rest are left and nibbled away to join adjacent polygons. This is a time consuming operation so is only done if there have been any missing info polygons found.
To be sure we have enough space to do map manipulations if required, then the polygons need to be renumbered - unless they are done already.
Rodenticide handling code. If enabled then rodenticide mapping provides access to predicted relative density of poisoned rodents per unit area.
819 bool didRenumber =
false;
820 bool didCalcCentroids =
false;
821 bool didConsolidate =
false;
822 bool didCalcOpenness =
false;
823 bool didCalcOther =
false;
829 for (
int i = 1; i <= 2000; i++) {
832 int x_add[8] = { 1, 1, 0, -1, -1, -1, 0, 1 };
833 int y_add[8] = { 0, -1, -1, -1, 0, 1, 1, 1 };
834 for (
int i = 0; i < 8; i++) {
843 printf(
"This program uses the Landscape simulator V%s\n",
m_versioninfo);
848 std::cout <<
"hash=" << GIT_HASH <<
", time=" << COMPILE_TIME <<
", branch=" << GIT_BRANCH << std::endl;
869 cout <<
"Creating Calendar Object" << endl;
870 g_date =
new Calendar;
871 cout <<
"Creating Weather Object" << endl;
873 cout <<
"Creating LE_TypeClass Object" << endl;
875 cout <<
"Creating PlantGrowthData Object" << endl;
877 cout <<
"Creating PollenNectarDevelopmentData Object" << endl;
878 g_nectarpollen =
new PollenNectarDevelopmentData(
"toleALMaSSNectarPollenInput.txt",
"tovALMaSSNectarPollenInput.txt",
this);
882 for (
int i = 0; i < last_treatment; i++) {
885 cout <<
"Creating FarmManager Object" << endl;
888 cout <<
"Reading polygon reference file" << endl;
897 cout <<
"Creating RasterMap Object" << endl;
909 cout <<
"In PolysValidate" << endl;
911 cout <<
"In PolysRemoveInvalid" << endl;
913 cout <<
"Creating ponds" << endl;
916 for (
unsigned int i = 0; i <
m_elems.size(); i++) {
917 if (
m_elems[i]->GetElementType() == tole_Freshwater) {
922 pond->SetElementType(tole_Pond);
923 m_elems[i] = dynamic_cast<LE*>(pond);
928 cout <<
"In PolysValidate second time" << endl;
938 cout <<
"In DoMissingPolygonsManipulations" << endl;
940 for (
unsigned int i = 0; i <
m_elems.size(); i++)
942 if (
m_elems[i]->GetElementType() == tole_Missing)
944 double area =
m_elems[i]->GetArea();
946 if ((areaMinrect / area > 4) || (area < 1000))
956 wl->
SetArea(floor(0.5 + area));
959 wl->SetCentroid(-1, -1);
968 for (
unsigned int i = 0; i <
m_elems.size(); i++)
971 if (
m_elems[i]->GetElementType() == tole_Missing)
978 wl->SetCentroid(-1, -1);
984 cout <<
"In PolysValidate third time" << endl;
987 cout <<
"In PolysValidate fourth time" << endl;
990 g_msg->Warn(
"Landscape::Landscape(): Dump and normal exit to follow after resolving missing polygons. ",
"");
996 cout <<
"In ChangeMapMapping" << endl;
1004 cout <<
"In poly renumber" << endl;
1012 cout <<
"In Landscape::Landscape() Small polygon removal" << endl;
1014 g_msg->Warn(
"Landscape::Landscape(): Dump and normal exit to follow after removing small polygons and map dump. Polygons removed:", removed);
1015 didCalcOther =
true;
1020 cout <<
"In consolidate polys" << endl;
1021 didConsolidate =
true;
1024 else if (g_map_le_borderremoval.value())
1026 cout <<
"In map_le_borderremoval" << endl;
1031 g_msg->Warn(WARN_FILE,
"Landscape::Landscape() - BorderRemoval "" map dump to follow.",
"");
1032 didCalcOther =
true;
1045 didCalcCentroids =
true;
1051 didCalcOpenness =
true;
1059 g_msg->Warn(WARN_FILE,
"Landscape::Landscape() ""Normal exit after dump.",
"Remember to rename the new map and polyref file.");
1066 didCalcOther =
false;
1071 didCalcOther =
true;
1073 else if (g_map_le_borders.value())
1075 cout <<
"Generating LE Borders around fields" << endl;
1076 cout <<
"Border chance = " << g_map_le_border_chance.value() << endl;
1077 cout <<
"Border width = " << g_map_le_borderwidth.value() << endl;
1079 cout <<
"Setting MaxMin Extents" << endl;
1081 cout <<
"Adding Borders" << endl;
1082 unsigned sz = (unsigned)
m_elems.size();
1083 for (
unsigned i = 0; i < sz; i++)
1085 if (
m_elems[i]->GetBorder() != NULL)
1089 if (
m_elems[i]->GetArea() > g_map_le_borders_min_field_size.value())
1096 didCalcOther =
true;
1099 if (g_map_orchards_borders.value())
1102 for (
unsigned int i = 0; i <
m_elems.size(); i++) {
1103 if (
m_elems[i]->GetElementType() == tole_Orchard)
1109 didCalcOther =
true;
1113 if (g_map_le_unsprayedmargins.value())
1119 for (
unsigned int i = 0; i <
m_elems.size(); i++)
1121 if (
m_elems[i]->GetUnsprayedMarginPolyRef() != -1)
1124 if (
m_elems[i]->GetArea() > 10000)
1129 else m_elems[i]->SetUnsprayedMarginPolyRef(-1);
1132 didCalcOther =
true;
1136 cout <<
"Adding beetle banks now" << endl;
1138 didCalcOther =
true;
1157 cout <<
"Dumping map" << endl;
1159 cout <<
"Dumping polygon refs file" << endl;
1161 g_msg->Warn(WARN_FILE,
"Landscape::Landscape() ""Normal exit after dump.",
"Remember to rename the new map and polyref file.");
1177 for (
unsigned int i = 0; i <
m_elems.size(); i++) {
1178 if (
m_elems[i]->GetElementType() == tole_HedgeBank) {
1179 m_elems[i]->SetSubType(l_subtype);
1188 for (
unsigned int i = 0; i <
m_elems.size(); i++) {
1189 if (
m_elems[i]->GetElementType() == tole_Hedges) {
1190 m_elems[i]->SetSubType(l_subtype);
1191 if (++l_subtype >= 3)
1198 cout <<
"Initiating farm management" << endl;
1220 for (
int i = 0; i < l_count; i++) {
1244 l_vegtype_areas = (
double *)malloc(
sizeof(
double) * (tov_Undefined + 1));
1247 g_msg->Warn(WARN_BUG,
"Landscape::Landscape(): Out of memory!",
"");
1254 g_msg->Warn(WARN_FILE,
"Landscape::DumpMapInfoByArea(): ""Unable to create file",
cfg_dumpvegjanfile.value());
1264 g_msg->Warn(WARN_FILE,
"Landscape::DumpMapInfoByArea(): ""Unable to create file",
cfg_dumpvegjunefile.value());
1271 #ifdef __RECORDFARMEVENTS
1272 m_farmeventfile =
new ofstream(
"FarmEvents.txt", ofstream::out);
1279 f = fopen(
"VegDump.txt",
"w");
1281 g_msg->Warn(WARN_BUG,
"Landscape::Landscape(): VegDump.txt could not be created",
"");
1284 fprintf(f,
"Year\tDay\tHeight\tBiomass\tGrazed\tDensity\tCover\tWeedBiomass\ttovNum\tInsectBiomass\tLATotal\tLAGreen\tDigestability\tGreenBiomass\tDeadBiomass\tGooseGrazing\tSpilledGrain\nn");
1289 f = fopen(
"EventDump.txt",
"w");
1291 g_msg->Warn(WARN_BUG,
"Landscape::Landscape(): EventDump.txt could not be created",
"");
1316 cout <<
"Running initial start-up year" << endl;
1317 for (
unsigned int i = 0; i < 365; i++)
Tick();
References LE_TypeClass::BackTranslateEleTypes(), cfg_AddBeetleBanks(), cfg_B6A, cfg_B6B, cfg_B6C, cfg_B6D, cfg_B6E, cfg_B6F, cfg_B6G, cfg_B6H, cfg_BeetleBankType(), cfg_DumpFarmAreas, cfg_dumpvegjan(), cfg_dumpvegjanfile(), cfg_dumpvegjune(), cfg_dumpvegjunefile(), cfg_G6A, cfg_G6B, cfg_G6C, cfg_G6D, cfg_G6E, cfg_G6F, cfg_G6G, cfg_G6H, cfg_HedgeSubtypeMaximum(), cfg_HedgeSubtypeMinimum(), cfg_MaxPondSize(), cfg_OptimiseBedriftsmodelCrops, cfg_OptimisingFarms, cfg_P1A, cfg_P1B, cfg_P1C, cfg_P1D, cfg_P1E, cfg_P1F, cfg_P1G, cfg_P1H, cfg_pesticidemapcellsize(), cfg_pesticidemapnoyears(), cfg_pesticidemapon(), cfg_pesticidemapstartyear(), cfg_pesticidemaptype(), cfg_pesticidetesttype(), cfg_rodenticide_enable(), cfg_WriteCurve, LE::DoCopy(), g_landscape_p, g_letype, g_nectarpollen, g_pest, g_SpeedyDivides, l_map_art_hedgebanks(), l_map_ascii_utm_x(), l_map_ascii_utm_y(), l_map_calc_openness(), l_map_consolidatepolys(), l_map_cropcurves_file(), l_map_dump_enable(), l_map_dump_event_enable(), l_map_dump_gfx_enable(), l_map_dump_gfx_file(), l_map_dump_map_file(), l_map_dump_poly_file(), l_map_dump_veg_enable(), l_map_map_file(), l_map_no_pesticide_fields(), l_map_poly_file(), l_map_print_git_version_info(), l_map_print_version_info(), l_map_removesmallpolygons(), l_map_weather_file(), l_map_write_ascii(), random(), LE::SetArea(), LE::SetOpenness(), LE::SetPoly(), LE::SetSoilType(), LE::SetUnsprayedMarginPolyRef(), LE_TypeClass::TranslateEleTypes(), version_date, version_major, version_minor, and version_revision.
◆ AddBeetleBanks()
void Landscape::AddBeetleBanks |
( |
TTypesOfLandscapeElement |
a_tole | ) |
|
|
protected |
Beetle-bank addition - tests whether we can add a bank to this field, and then decides where to put it an adds it.
For each element, if it is a field then assess whether should have a beetle bank. This will depend on whether it is in the region defined for adding the bank, and a probability. This code requires polygon centroids to be active, either calculated or via l_map_read_openness == true.
To provide for more flexibilty, a tole_type is passed, and beetlebanks may be created of this tole_type instead of tole_BeetleBank
2737 unsigned sz=(unsigned)
m_elems.size();
2738 for (
unsigned i=0; i<sz; i++)
2740 if (
m_elems[ i ]->GetElementType() == tole_Field)
2743 int cx =
m_elems[ i ]->GetCentroidX();
2744 int cy =
m_elems[ i ]->GetCentroidY();
2747 if ((cx >= tx1) && (cy >= ty1) && (cx <= tx2) && (cy <= ty2))
2752 else if ((cx < tx1) || (cy < ty1) || (cx > tx2) || (cy > ty2))
2766 sprintf(str,
"%d",BBs);
2767 g_msg->Warn( WARN_MSG,
"Landscape::AddBeetleBanks(): BeetleBanks successfully added:", str );
References cfg_BeetleBankChance(), cfg_BeetleBankInvert(), cfg_BeetleBankMaxX(), cfg_BeetleBankMaxY(), cfg_BeetleBankMinX(), cfg_BeetleBankMinY(), and random().
◆ AddGreenElement()
void Landscape::AddGreenElement |
( |
LE * |
a_green | ) |
|
|
protected |
◆ AxisLoop() [1/2]
void Landscape::AxisLoop |
( |
int |
a_poly, |
|
|
APoint * |
a_cor, |
|
|
int |
a_axis |
|
) |
| |
|
protected |
Starting at a_x,a_y each location is tested along a vector given by m_x_add & m_y_add until we step outside the polygon. a_x & a_y are modified on return.
2903 int ap1 = a_polyindex;
2904 while (ap1 == a_polyindex)
2910 if (a_cor->
m_x <= 0) { a_cor->
m_x = 0;
return; }
2911 if (a_cor->
m_y <= 0) { a_cor->
m_y = 0;
return; }
References APoint::m_x, and APoint::m_y.
◆ AxisLoop() [2/2]
void Landscape::AxisLoop |
( |
int |
a_poly, |
|
|
int * |
a_x, |
|
|
int * |
a_y, |
|
|
int |
a_axis |
|
) |
| |
|
protected |
Starting at a_x,a_y each location is tested along a vector given by m_x_add & m_y_add until we step outside the polygon. a_x & a_y are modified on return.
2943 int ap1 = a_polyindex;
2944 while (ap1 == a_polyindex)
2966 ap1 =
m_land->Get((*a_x), (*a_y));
◆ AxisLoopLtd()
void Landscape::AxisLoopLtd |
( |
int |
a_poly, |
|
|
APoint * |
a_cor, |
|
|
int |
a_axis, |
|
|
int |
a_limit |
|
) |
| |
|
protected |
Starting at a_x,a_y each location is tested along a vector given by m_x_add & m_y_add until we step outside the polygon. a_x & a_y are modified on return.
2922 int ap1 = a_polyindex;
2924 while (ap1 == a_polyindex && count<a_limit)
2930 if (a_cor->
m_x <= 0) { a_cor->
m_x = 0;
return; }
2931 if (a_cor->
m_y <= 0) { a_cor->
m_y = 0;
return; }
References APoint::m_x, and APoint::m_y.
◆ BackTranslateEleTypes()
int Landscape::BackTranslateEleTypes |
( |
TTypesOfLandscapeElement |
EleReference | ) |
|
|
inline |
◆ BackTranslateVegTypes()
int Landscape::BackTranslateVegTypes |
( |
TTypesOfVegetation |
VegReference | ) |
|
|
inline |
◆ BeetleBankAdd()
void Landscape::BeetleBankAdd |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
angle, |
|
|
int |
length, |
|
|
LE * |
a_field, |
|
|
TTypesOfLandscapeElement |
a_tole |
|
) |
| |
|
protected |
◆ BeetleBankPossible()
bool Landscape::BeetleBankPossible |
( |
LE * |
a_field, |
|
|
TTypesOfLandscapeElement |
a_tole |
|
) |
| |
|
protected |
Beetle bank placement rules are:
No bank if the total bank area is going to be >=5% of the field area
No bank if the field is < 1Ha
No bank if the breadth of the field is < 100m
2780 if (farea<10000)
return false;
2781 int cx=a_field->GetCentroidX();
2782 int cy=a_field->GetCentroidY();
2790 length=
int(length*0.8);
References cfg_BeetleBankMaxArea(), cfg_BeetleBankWidth(), and LE::GetArea().
◆ BorderAdd()
void Landscape::BorderAdd |
( |
LE * |
a_field, |
|
|
TTypesOfLandscapeElement |
a_type |
|
) |
| |
|
protected |
◆ BorderNeed()
bool Landscape::BorderNeed |
( |
TTypesOfLandscapeElement |
a_letype | ) |
|
|
protected |
4530 static char error_num[20];
4531 bool AddBorder =
false;
4535 case tole_HedgeBank:
4536 case tole_BeetleBank:
4537 case tole_RoadsideVerge:
4539 case tole_RiversidePlants:
4540 case tole_UnsprayedFieldMargin:
4541 case tole_OrchardBand:
4542 case tole_MownGrass:
4543 case tole_WaterBufferZone:
4546 case tole_IndividualTree:
4547 case tole_PlantNursery:
4548 case tole_Vildtager:
4549 case tole_WindTurbine:
4550 case tole_WoodyEnergyCrop:
4551 case tole_WoodlandMargin:
4553 case tole_NaturalGrassDry:
4555 case tole_FieldBoundary:
4558 case tole_PermanentSetaside:
4559 case tole_PermPasture:
4560 case tole_PermPastureTussocky:
4561 case tole_PermPastureLowYield:
4562 case tole_PitDisused:
4563 case tole_RiversideTrees:
4564 case tole_DeciduousForest:
4565 case tole_MixedForest:
4566 case tole_YoungForest:
4567 case tole_ConiferousForest:
4568 case tole_StoneWall:
4572 case tole_SmallRoad:
4573 case tole_LargeRoad:
4575 case tole_ActivePit:
4578 case tole_Freshwater:
4580 case tole_Saltwater:
4585 case tole_AmenityGrass:
4587 case tole_UrbanNoVeg:
4589 case tole_UrbanPark:
4590 case tole_BuiltUpWithParkland:
4593 case tole_NaturalGrassWet:
4594 case tole_RoadsideSlope:
4595 case tole_MetalledPath:
4597 case tole_Churchyard:
4598 case tole_Saltmarsh:
4600 case tole_HeritageSite:
4605 sprintf(error_num,
"%d", a_letype);
4606 g_msg->Warn(WARN_BUG,
"Landscape::BorderNeed(): Unknown element type:", error_num);
◆ BorderRemoval()
void Landscape::BorderRemoval |
( |
void |
| ) |
|
|
protected |
2273 for (
int x=1; x<(
m_width-1); x++)
2277 if ((tole==tole_FieldBoundary) || (tole==tole_HedgeBank) || (tole==tole_Hedges))
2283 m_land->Put( x, y, fieldindex );
2291 m_land->Put( x, y, fieldindex );
2299 m_land->Put( x, y, fieldindex );
2307 m_land->Put( x, y, fieldindex );
2315 m_land->Put( x, y, fieldindex );
2323 m_land->Put( x, y, fieldindex );
2331 m_land->Put( x, y, fieldindex );
2339 m_land->Put( x, y, fieldindex );
◆ BorderScan()
void Landscape::BorderScan |
( |
LE * |
a_field, |
|
|
int |
a_width |
|
) |
| |
|
protected |
Requires centroid calculation before calling this method. Centroids must be inside the polygon and valid.
Loop through this procedure the width of the margin times. Each time a dummy margin is added using polyref=-99 and all locations this is done are remembered. Then later all positions covered by -99 are replaced with the real polygon index.
2371 int fieldpoly = a_field->
GetPoly();
2372 int borderpoly = border->
GetPoly();
2375 int test =
m_land->Get(a_field->GetCentroidX(), a_field->GetCentroidY());
2376 if (test != fieldindex)
2378 g_msg->Warn(
"Landscape::BorderScan - Border Scan centroid does not return correct polygon index. Index :", fieldindex);
2379 g_msg->Warn(
" Returned ", test);
2382 int notforever = 50000;
2383 vector<APoint> listoflocs;
2388 for (
int wid = 0; wid < a_width; wid++)
2392 APoint coord(a_field->GetCentroidX(), a_field->GetCentroidY());
2395 while (--notforever > 0)
2398 if (
BorderTest(fieldindex, -99, coord.m_x, coord.m_y))
2401 m_land->Put(coord.m_x, coord.m_y, -99);
2402 listoflocs.push_back(coord);
2407 sprintf(polynum,
"%d", a_field->
GetPoly());
2408 g_msg->Warn(WARN_FILE,
"Landscape::BorderScan(): Polygon reached zero area " "when adding border. Poly num: ", polynum);
2420 for (std::vector<APoint>::iterator it = listoflocs.begin(); it != listoflocs.end(); ++it)
2422 m_land->Put((*it).m_x, (*it).m_y, borderindex);
References LE::AddArea(), LE::GetArea(), LE::GetBorder(), LE::GetPoly(), l_map_exit_on_zero_area(), m_polymapping, random(), and LE::SetMapValid().
◆ BorderStep() [1/2]
bool Landscape::BorderStep |
( |
int |
a_fieldpoly, |
|
|
int |
a_borderpoly, |
|
|
APoint * |
a_coord |
|
) |
| |
|
protected |
2539 int x_add[8] = { 1, 1, 0, -1, -1, -1, 0, 1 };
2540 int y_add[8] = { 0, -1, -1, -1, 0, 1, 1, 1 };
2541 int width =
m_land->MapWidth();
2542 int height =
m_land->MapHeight();
2543 int i = 7, counter = 8;
2544 bool running =
true;
2548 if (!((a_coord->
m_x) + x_add[i] >= width) && !((a_coord->
m_x) + x_add[i] < 0) && !((a_coord->
m_y) + y_add[i] >= height) && !((a_coord->
m_y) + y_add[i] < 0))
2550 index =
m_land->Get((a_coord->
m_x) + x_add[i], (a_coord->
m_y) + y_add[i]);
2551 if (index == a_fieldindex)
2569 if (!((a_coord->
m_x) + x_add[i] >= width) && !((a_coord->
m_x) + x_add[i] < 0) && !((a_coord->
m_y) + y_add[i] >= height) && !((a_coord->
m_y) + y_add[i] < 0))
2571 index =
m_land->Get((a_coord->
m_x) + x_add[i], (a_coord->
m_y) + y_add[i]);
2572 if (index == a_fieldindex)
2583 if (!((a_coord->
m_x) + x_add[i] + 1 > width) && !((a_coord->
m_x) + x_add[i] < 0) && !((a_coord->
m_y) + y_add[i] + 1 > height) &&
2584 !((a_coord->
m_y) + y_add[i] < 0) && (
m_land->Get((a_coord->
m_x) + x_add[i], (a_coord->
m_y) + y_add[i]) == a_fieldindex))
2586 (a_coord->
m_x) += x_add[i];
2587 (a_coord->
m_y) += y_add[i];
References APoint::m_x, and APoint::m_y.
◆ BorderStep() [2/2]
bool Landscape::BorderStep |
( |
int |
a_fieldpoly, |
|
|
int |
a_borderpoly, |
|
|
int * |
a_x, |
|
|
int * |
a_y |
|
) |
| |
|
protected |
2481 int x_add[8] = { 1, 1, 0, -1, -1, -1, 0, 1 };
2482 int y_add[8] = { 0, -1, -1, -1, 0, 1, 1, 1 };
2483 int width =
m_land->MapWidth();
2484 int height =
m_land->MapHeight();
2485 int i = 7, counter = 8;
2486 bool running =
true;
2490 if (!((*a_x) + x_add[i] >= width) && !((*a_x) + x_add[i] < 0) && !((*a_y) + y_add[i] >= height) && !((*a_y) + y_add[i] < 0))
2492 index =
m_land->Get((*a_x) + x_add[i], (*a_y) + y_add[i]);
2493 if (index == a_fieldindex)
2511 if (!((*a_x) + x_add[i] >= width) && !((*a_x) + x_add[i] < 0) && !((*a_y) + y_add[i] >= height) && !((*a_y) + y_add[i] < 0))
2513 index =
m_land->Get((*a_x) + x_add[i], (*a_y) + y_add[i]);
2514 if (index == a_fieldindex)
2525 if (!((*a_x) + x_add[i] + 1 > width) && !((*a_x) + x_add[i] < 0) && !((*a_y) + y_add[i] + 1 > height) &&
2526 !((*a_y) + y_add[i] < 0) && (
m_land->Get((*a_x) + x_add[i], (*a_y) + y_add[i]) == a_fieldindex))
◆ BorderTest()
bool Landscape::BorderTest |
( |
int |
a_fieldpoly, |
|
|
int |
a_borderpoly, |
|
|
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
protected |
2455 int x_add[ 8 ] = { 1, 1, 0, -1, -1, -1, 0, 1 };
2456 int y_add[ 8 ] = { 0, -1, -1, -1, 0, 1, 1, 1 };
2457 int width =
m_land->MapWidth();
2458 int height =
m_land->MapHeight();
2460 for (
unsigned int i = 0; i < 8; i++ ) {
2461 if ( ( a_x + x_add[ i ] >= width ) || ( a_x + x_add[ i ] < 0 ) || ( a_y + y_add[ i ] >= height )
2462 || ( a_y + y_add[ i ] < 0 ) ) {
2466 index =
m_land->Get( a_x + x_add[ i ], a_y + y_add[ i ] );
2467 if ( ( index != a_fieldindex ) && ( index != a_borderindex ) )
◆ BuildingDesignationCalc()
void Landscape::BuildingDesignationCalc |
( |
| ) |
|
used to calculate whether a building is rural or town - for rodenticide use
Runs through all elements and identifies the ones where rodenticide bait may be placed. If it is a building then we count the number of buildings near to it and designate it town if there are more than cfg_mintownbuildingnumber.
3293 cout <<
"In BuildingDesignationCalc" << endl;
3296 TTypesOfLandscapeElement tole =
m_elems[p]->GetElementType();
3297 if ( tole == tole_Building)
3299 int cx =
m_elems[p]->GetCentroidX();
3300 int cy =
m_elems[p]->GetCentroidY();
3304 if (
m_elems[j]->GetElementType() == tole_Building)
3306 int nx =
m_elems[j]->GetCentroidX();
3307 int ny =
m_elems[j]->GetCentroidY();
3315 else m_elems[p]->SetCountryDesignation(0);
3317 else if (tole == tole_YoungForest)
3319 m_elems[p]->SetCountryDesignation(2);
3321 else if ((tole == tole_DeciduousForest) || ( tole == tole_MixedForest) || ( tole == tole_ConiferousForest ) )
m_elems[p]->SetCountryDesignation(3);
References cfg_mintownbuildingdistance(), and cfg_mintownbuildingnumber().
◆ CalculateCentroids()
void Landscape::CalculateCentroids |
( |
void |
| ) |
|
Finds a location inside each polygon as a roughly calculated centre point. The point will be within the polygon. This also uses the stored Max/Min coordinates for each polygon that form a rectangle around it.
3047 cout <<
"In Centroid Calculations" << endl;
3052 int x1 =
m_elems[p]->GetMinX();
3053 int y1 =
m_elems[p]->GetMinY();
3054 int x2 =
m_elems[p]->GetMaxX();
3055 int y2 =
m_elems[p]->GetMaxY();
3057 int midx = (x1 + x2) / 2;
3058 int midy = (y1 + y2) / 2;
3067 m_elems[p]->SetCentroid(midx, midy);
◆ CalculateOpenness()
void Landscape::CalculateOpenness |
( |
bool |
a_realcalc | ) |
|
Causes openness to be calulated and stored for all polygons.
First must calculate centroid. Runs through the list of elements and any that are marsh, field, or pasture will have an openness score calculated
327 cout <<
"In CalculateOpenness" << endl;
329 for (
unsigned int i = 0; i <
m_elems.size(); i++)
331 TTypesOfLandscapeElement tole =
m_elems[i]->GetElementType();
337 case tole_PermPastureLowYield:
338 case tole_PermPastureTussocky:
339 case tole_PermanentSetaside:
340 case tole_PermPasture:
341 case tole_NaturalGrassDry:
342 case tole_NaturalGrassWet:
348 else m_elems[i]->SetOpenness(0);
355 if (a_realcalc) cout << endl;
◆ CalulateFieldOpennessAllCells()
int Landscape::CalulateFieldOpennessAllCells |
( |
int |
a_pref | ) |
|
Provides a measure of the shortest distance in 360 degree, e-g- looking NE % SW before tall obstacles are encountered at both ends. Checks all field 1m2.
Starts with North West and moves round the points of the compass 180 degrees. For each point tested we want the minimum length found, but between points we are interested in the max
runs a line out and also in 180 degrees, two lines.
runs a line out and also in 180 degrees, two lines.
405 int minX =
m_elems[a_pref]->GetMinX();
406 int minY =
m_elems[a_pref]->GetMinY();
407 int maxX =
m_elems[a_pref]->GetMaxX();
408 int maxY =
m_elems[a_pref]->GetMaxY();
409 for (
int ax = minX; ax <= maxX; ax+=10)
411 for (
int ay = minY; ay <= maxY; ay+=10)
417 if (
m_land->Get(ax, ay) == a_pref)
425 double dx = 1.0 / 45.0;
427 for (
int deg = 0; deg<90; deg++)
431 int d2 =
LineHighTest(cx, cy, 0 - offsetx, 0 - offsety);
434 if (dline > d) dline = d;
435 offsetx = offsetx + dx;
436 offsety = offsety + dy;
442 for (
int deg = 0; deg<90; deg++)
446 int d2 =
LineHighTest(cx, cy, 0 - offsetx, 0 - offsety);
449 if (dline > d) dline = d;
450 offsetx = offsetx + dx;
451 offsety = offsety + dy;
453 if (dline > d0) d0 = dline;
◆ CalulateFieldOpennessCentroid()
int Landscape::CalulateFieldOpennessCentroid |
( |
int |
a_pref | ) |
|
Provides a measure of the shortest distance in 360 degree, e-g- looking NE % SW before tall obstacles are encountered at both ends. Searches from centroid.
Starts with North West and moves round the points of the compass 180 degrees.
runs a line out and also in 180 degrees, two lines.
runs a line out and also in 180 degrees, two lines.
363 int cx =
m_elems[a_pref]->GetCentroidX();
364 int cy =
m_elems[a_pref]->GetCentroidY();
369 double dx = 1.0 / 45.0;
371 for (
int deg = 0; deg<90; deg++)
375 int d2 =
LineHighTest(cx, cy, 0 - offsetx, 0 - offsety);
379 offsetx = offsetx + dx;
380 offsety = offsety + dy;
386 for (
int deg = 0; deg<90; deg++)
390 int d2 =
LineHighTest(cx, cy, 0 - offsetx, 0 - offsety);
394 offsetx = offsetx + dx;
395 offsety = offsety + dy;
◆ CentroidSpiralOut()
void Landscape::CentroidSpiralOut |
( |
int |
a_polyref, |
|
|
int & |
a_x, |
|
|
int & |
a_y |
|
) |
| |
3082 for (
int i = 0 - loop; i <= loop; i++)
3090 for (
int i = 0 - loop; i <= loop; i++)
3098 for (
int j = 0 - (loop - 1); j< loop; j++)
3106 for (
int j = 0 - (loop - 1); j< loop; j++)
3115 g_msg->Warn(
"Landscape::CentroidSpiralOut: Failure of centroid main loop. Looking for polygon index ",a_polyref);
3116 a_x =
m_elems[a_polyref]->GetMinX();
3117 a_y =
m_elems[a_polyref]->GetMinY();
◆ ChangeMapMapping()
void Landscape::ChangeMapMapping |
( |
void |
| ) |
|
|
protected |
Our map is an array of polygon indentifiers, where we really want to know the associated landscape element of a X-Y coordinate pair.
Changing this to m_elems[] indices will save us one redirection when inquiring information from the landscape, and only costs us the fixed translation step performed here at startup.
2136 cout <<
"In Change Map Mapping" << endl;
2137 int mapwidth =
m_land->MapWidth();
2138 int mapheight =
m_land->MapHeight();
2139 int pest_map_width = mapwidth >> PEST_GRIDSIZE_POW2;
2140 if ( mapwidth & ( PEST_GRIDSIZE - 1 ) ) pest_map_width++;
2142 for (
int x = 0; x < mapwidth; x++ )
2144 for (
int y = 0; y < mapheight; y++ )
2146 int polynum =
m_land->Get( x, y );
2154 if ( index != oldindex )
2156 m_elems[ index ]->SetValidXY( x, y );
2157 int l_x = x >> PEST_GRIDSIZE_POW2;
2158 int l_y = y >> PEST_GRIDSIZE_POW2;
2159 int pref = l_y * pest_map_width + l_x;
2160 m_elems[ index ]->SetPesticideCell( pref );
References m_polymapping.
◆ CheckForPesticideRecord()
◆ CIPELandscapeMaker()
bool Landscape::CIPELandscapeMaker |
( |
| ) |
|
|
protected |
◆ ConsolidatePolys()
void Landscape::ConsolidatePolys |
( |
void |
| ) |
|
|
protected |
Runs through the map checking each cell for polygon type. If it is in our replace list then it re-written as the first instance of that polygon type encountered. All subsequent instances of that type are then deleted.
replaceList contains the types of all tole types with no behaviour that can be consolidated. This list needs to be kept up-to-date.
1336 const int TypesToReplace = 16;
1337 TTypesOfLandscapeElement replaceList[TypesToReplace] = {
1339 tole_RiversidePlants,
1340 tole_RiversideTrees,
1343 tole_BuiltUpWithParkland,
1349 tole_IndividualTree,
1355 int foundList[TypesToReplace];
1356 cout <<
"Consolidating polygons with no special behaviour" << endl;
1357 for (
int i = 0; i < TypesToReplace; i++) foundList[i] = -1;
1358 int mapwidth =
m_land->MapWidth();
1359 int mapheight =
m_land->MapHeight();
1360 for (
int x = 0; x < mapwidth; x++)
1362 for (
int y = 0; y < mapheight; y++)
1364 int ele =
m_land->Get(x, y);
1366 for (
int t = 0; t < TypesToReplace; t++)
1368 if (tole == replaceList[t])
1371 if (foundList[t] == -1) foundList[t] = ele;
1375 m_land->Put(x, y, foundList[t]);
1382 g_msg->Warn(WARN_FILE,
"Landscape::ConsolidatePolys() - ""Consolidate map dump.",
"");
References m_polymapping.
◆ CorrectCoords()
void Landscape::CorrectCoords |
( |
int & |
x, |
|
|
int & |
y |
|
) |
| |
|
inline |
Function to prevent wrap around errors with co-ordinates using x/y pair.
m_width10 & m_height10 are used to avoid problems with co-ordinate values that are very large. Problems will only occur if coords passed are >10x the world width or height.
References m_height, m_height10, m_width, and m_width10.
◆ CorrectCoordsPointNoWrap()
void Landscape::CorrectCoordsPointNoWrap |
( |
APoint & |
a_pt | ) |
|
|
inline |
Function to prevent wrap around errors with co-ordinates using a APoint.
This just cuts off extremes of coordinate values so that the point stays in landscape. Can't use a modulus or we get wrap around, and in this case we don't want that
1562 if (a_pt.
m_x < 0) a_pt.
m_x = 0;
1563 if (a_pt.
m_y < 0) a_pt.
m_y = 0;
References m_height, m_width, APoint::m_x, and APoint::m_y.
◆ CorrectCoordsPt()
Function to prevent wrap around errors with co-ordinates using x/y pair.
m_width10 & m_height10 are used to avoid problems with co-ordinate values that are very large. Problems will only occur if coords passed are >10x the world width or height.
References m_height, m_height10, m_width, m_width10, APoint::m_x, and APoint::m_y.
◆ CorrectHeight()
int Landscape::CorrectHeight |
( |
int |
y | ) |
|
|
inline |
◆ CorrectWidth()
int Landscape::CorrectWidth |
( |
int |
x | ) |
|
|
inline |
◆ CountMapSquares()
void Landscape::CountMapSquares |
( |
void |
| ) |
|
|
protected |
2041 int mapwidth =
m_land->MapWidth();
2042 int mapheight =
m_land->MapHeight();
2043 for (
unsigned int i = 0; i <
m_elems.size(); i++ ) {
2045 m_elems[ i ]->m_squares_in_map=0;
2048 for (
int x = 0; x < mapwidth; x++ ) {
2049 for (
int y = 0; y < mapheight; y++ ) {
2050 int l_ele =
m_land->Get( x, y );
2051 m_elems[ l_ele ]->m_squares_in_map++;
◆ CreatePondList()
void Landscape::CreatePondList |
( |
| ) |
|
|
protected |
Creates a list of pond polygon refs/indexes for easy look up.
Just creates an unordered list of polyref numbers and m_elems indices for all ponds. This is for easy look-up by e.g. newts
2597 for (
unsigned int i = 0; i <
m_elems.size(); i++)
2599 if (
m_elems[i]->GetElementType() == tole_Pond) {
◆ DegreesDump()
void Landscape::DegreesDump |
( |
| ) |
|
|
protected |
Prints the sum of day degrees. See #FarmManager::daydegrees.
1689 ofstream ofile (
"Daydegrees.txt", ios::app);
◆ DumpAllSymbolsAndExit()
void Landscape::DumpAllSymbolsAndExit |
( |
const char * |
a_dumpfile | ) |
|
|
inline |
786 g_cfg->DumpAllSymbolsAndExit( a_dumpfile );
◆ DumpCentroids()
void Landscape::DumpCentroids |
( |
void |
| ) |
|
3277 ofstream centroidfile(
"PolygonCentroids.txt", ios::out);
3278 centroidfile<<
"Polyref"<<
'\t'<<
"CX"<<
'\t'<<
"CY"<<
'\t'<<
"Type"<<
'\t'<<
"Area"<<
'\t'<<
"Country Designation"<<endl;
3281 centroidfile<<
m_elems[p]->GetPoly()<<
'\t'<<
m_elems[p]->GetCentroidX()<<
'\t'<<
m_elems[p]->GetCentroidY()<<
'\t'<<
m_elems[p]->GetElementType()<<
'\t'<<
m_elems[p]->GetArea()<<
'\t'<<
m_elems[p]->GetCountryDesignation()<<endl;
3283 centroidfile.close();
◆ DumpMap()
void Landscape::DumpMap |
( |
const char * |
a_filename | ) |
|
|
protected |
1388 int * l_map =
m_land->GetMagicP(0, 0);
1413 ofstream OFile( a_filename, ios::binary);
1414 char id[12] = {
"LSB2_Format" };
1415 OFile.write(
id, 12);
1416 OFile.write((
char*)&
m_width,
sizeof (
int));
1417 OFile.write((
char*)&
m_height,
sizeof (
int));
◆ DumpMapGraphics()
void Landscape::DumpMapGraphics |
( |
const char * |
a_filename | ) |
|
|
protected |
3601 unsigned char * frame_buffer = (
unsigned char *)malloc(
sizeof(
unsigned char)* linesize);
3603 if (frame_buffer == NULL) {
3604 g_msg->Warn(WARN_FILE,
"Landscape::DumpMapGraphics(): Out of memory!",
"");
3608 FILE * l_file = fopen(a_filename,
"w");
3610 g_msg->Warn(WARN_FILE,
"Landscape::DumpMapGraphics(): ""Unable to open file for writing: %s\n", a_filename);
3616 for (
int y = 0; y <
m_height; y++) {
3618 for (
int x = 0; x <
m_width; x++) {
3620 int localcolor = 16777215 / eletype;
3622 if (eletype == (
int)tole_Field) {
3625 if (hei > 50.0) category = 0;
else category = (
int)(200.0 - (hei * 4.0));
3626 localcolor = ((category * 65536) + 65535);
3629 frame_buffer[i++] = (
unsigned char)(localcolor & 0xff);
3630 frame_buffer[i++] = (
unsigned char)((localcolor >> 8) & 0xff);
3631 frame_buffer[i++] = (
unsigned char)((localcolor >> 16) & 0xff);
3633 fwrite(frame_buffer,
sizeof(
unsigned char), linesize, l_file);
◆ DumpMapInfoByArea()
void Landscape::DumpMapInfoByArea |
( |
const char * |
a_filename, |
|
|
bool |
a_append, |
|
|
bool |
a_dump_zero_areas, |
|
|
bool |
a_write_veg_names |
|
) |
| |
3656 outf = fopen(a_filename,
"a");
3658 g_msg->Warn(WARN_FILE,
"Landscape::DumpMapInfoByArea(): ""Unable to open file for appending", a_filename);
3663 outf = fopen(a_filename,
"w");
3665 g_msg->Warn(WARN_FILE,
"Landscape::DumpMapInfoByArea(): ""Unable to open file for writing", a_filename);
3671 for (
unsigned int i = 0; i < tov_Undefined + 1; i++) {
3672 if (i == tov_OFirstYearDanger)
3677 fprintf(outf,
"%6ld\t%3d\t%10.0f", g_date->OldDays() + g_date->DayInYear() - 364, i,
l_vegtype_areas[i]);
3678 if (a_write_veg_names)
3679 fprintf(outf,
"\t%s\n",
VegtypeToString((TTypesOfVegetation)i).c_str());
else
3680 fprintf(outf,
"\n");
◆ DumpPublicSymbols()
void Landscape::DumpPublicSymbols |
( |
const char * |
a_dumpfile, |
|
|
CfgSecureLevel |
a_level |
|
) |
| |
|
inline |
783 g_cfg->DumpPublicSymbols( a_dumpfile, a_level );
◆ DumpTreatCounters()
void Landscape::DumpTreatCounters |
( |
const char * |
a_filename | ) |
|
|
protected |
3587 FILE * l_file = fopen(a_filename,
"w");
3589 g_msg->Warn(WARN_FILE,
"Landscape::DumpTreatCounters(): ""Unable to open file for writing: %s\n", a_filename);
3593 for (
int i = start; i < last_treatment; i++) {
◆ DumpVegAreaData()
void Landscape::DumpVegAreaData |
( |
int |
a_day | ) |
|
◆ EventDump()
1698 FILE * vfile=fopen(
"EventDump.txt",
"a" );
1700 g_msg->Warn( WARN_FILE,
"Landscape::EventDump(): Unable to open file",
"EventDump.txt" );
1706 fprintf( vfile,
"%d: ", day );
1708 fprintf( vfile,
"%d ", event );
1711 fprintf( vfile,
" - " );
1713 fprintf( vfile,
"%d ", event );
1715 fprintf( vfile,
"\n" );
◆ EventDumpPesticides()
void Landscape::EventDumpPesticides |
( |
int |
x1, |
|
|
int |
y1 |
|
) |
| |
|
protected |
1721 FILE * vfile=fopen(
"EventDump.txt",
"a" );
1723 g_msg->Warn( WARN_FILE,
"Landscape::EventDump(): Unable to open file",
"EventDump.txt" );
1733 if (a_event == herbicide_treat )
1737 else if (a_event == fungicide_treat ) fung++;
1738 else if (a_event == insecticide_treat) ins++;
1740 if (herb+fung+ins >0 ) fprintf( vfile,
"%d\t%d\t%d\t%d\n", day, herb, fung, ins );
◆ EventtypeToString()
std::string Landscape::EventtypeToString |
( |
int |
a_event | ) |
|
3925 return " sleep_all_day";
3927 return " autumn_plough";
3928 case stubble_plough:
3929 return " stubble_plough";
3930 case stubble_cultivator_heavy:
3931 return " stubble_cultivator_heavy";
3932 case heavy_cultivator_aggregate:
3933 return " heavy_cultivator_aggregate";
3935 return " autumn_harrow";
3936 case preseeding_cultivator:
3937 return " preseeding_cultivator";
3938 case preseeding_cultivator_sow:
3939 return " preseeding_cultivator_sow";
3941 return " autumn_roll";
3943 return " autumn_sow";
3945 return " winter_plough";
3946 case deep_ploughing:
3947 return " deep_ploughing";
3949 return " spring_plough";
3951 return " spring_harrow";
3953 return " spring_roll";
3955 return " spring_sow";
3956 case spring_sow_with_ferti:
3957 return " spring_sow_with_ferti";
3965 return " fp_liquidNH3";
3967 return " fp_slurry";
3968 case fp_ammoniumsulphate:
3969 return " fp_ammoniumsulphate";
3970 case fp_manganesesulphate:
3971 return " fp_manganesesulphate";
3973 return " fp_manure";
3974 case fp_greenmanure:
3975 return " fp_greenmanure";
3977 return " fp_sludge";
3981 return " fp_calcium";
3987 return " fa_slurry";
3988 case fa_ammoniumsulphate:
3989 return " fa_ammoniumsulphate";
3990 case fa_manganesesulphate:
3991 return " fa_manganesesulphate";
3993 return " fa_manure";
3994 case fa_greenmanure:
3995 return " fa_greenmanure";
3997 return " fa_sludge";
4001 return " fa_calcium";
4002 case herbicide_treat:
4003 return " herbicide_treat";
4004 case growth_regulator:
4005 return " growth_regulator";
4006 case fungicide_treat:
4007 return " fungicide_treat";
4008 case insecticide_treat:
4009 return " insecticide_treat";
4011 return "pesticide_product_treat";
4012 case syninsecticide_treat:
4013 return " syninsecticide_treat";
4015 return " molluscicide";
4016 case row_cultivation:
4017 return " row_cultivation";
4019 return " strigling";
4020 case flammebehandling:
4021 return " flammebehandling";
4023 return " hilling_up";
4031 return " cattle_out";
4035 return " cut_to_hay";
4037 return " cut_to_silage";
4038 case straw_chopping:
4039 return " straw_chopping";
4041 return " hay_turning";
4043 return " hay_bailing";
4044 case stubble_harrowing:
4045 return " stubble_harrowing";
4046 case autumn_or_spring_plough:
4047 return "autumn_or_spring_plough";
4048 case burn_straw_stubble:
4049 return " burn_straw_stubble";
4053 return " cut_weeds";
4055 return " strigling_sow";
4056 case trial_insecticidetreat:
4057 return "PesticideTrialTreatment";
4058 case trial_toxiccontrol:
4059 return " PesticideTrialToxic";
4061 return " PesticideTrialControl";
4063 return " Glyphosate on setaside";
4066 case strigling_hill:
4067 return " strigling_hill";
4069 return " bed_forming";
4070 case flower_cutting:
4071 return " flower_cutting";
4073 return " bulb_harvest";
4074 case straw_covering:
4075 return " straw_covering";
4077 return " straw_removal";
4079 sprintf(error_num,
"%d", a_event);
4080 g_msg->Warn(WARN_FILE,
"Landscape::EventtypeToString(): Unknown event type:", error_num);
◆ FillVegAreaData()
void Landscape::FillVegAreaData |
( |
| ) |
|
3642 for (
unsigned int i = 0; i < (tov_Undefined + 1); i++) {
3647 for (
unsigned int i = 0; i <
m_elems.size(); i++) {
◆ FindFieldCenter()
bool Landscape::FindFieldCenter |
( |
LE * |
a_field, |
|
|
int * |
x, |
|
|
int * |
y |
|
) |
| |
|
protected |
2804 if (ourpoly!=a_field->
GetPoly())
return false;
2813 while ((diff>1) & (tries++<100)) {
2814 for (
unsigned v=0; v<4; v++) {
2823 centers[0][v+4]=x1-
m_x_add[v+4];
2824 centers[1][v+4]=y1-
m_y_add[v+4];
2832 for (
int h=0; h<8; h++) {
2833 centreX+=centers[0][h];
2834 centreY+=centers[1][h];
2838 diff=abs(oldx-centreX)+abs(oldy-centreY);
2843 if (tourpoly!=ourpoly) {
References LE::GetPoly().
◆ FindLongestAxis()
int Landscape::FindLongestAxis |
( |
int * |
x, |
|
|
int * |
y, |
|
|
int * |
a_length |
|
) |
| |
|
protected |
2863 for (
unsigned v=0; v<8; v++)
2870 dx[v] = abs(*(a_x)-x1);
2871 dy[v] = abs(*(a_y)-y1);
2877 for (
int di = 0; di < 4; di++)
2879 int ddx = distx[di] + distx[di + 4];
2880 int ddy = disty[di] + disty[di + 4];
2881 if (ddx == 0) dist[di] = ddy;
else dist[di] = ddx;
2882 if (dist[di] > *(a_length))
2885 *(a_length) = dist[di];
2888 if (found == -1)
return 0;
2890 int l = (*(a_length) / 2);
2891 if (fx[found] > fx[found + 4]) *(a_x) = fx[found + 4] +
m_x_add[found] * l;
else *(a_x) = fx[found + 4] -
m_x_add[found + 4] * l;
2892 if (fy[found] > fy[found + 4]) *(a_y) = fy[found + 4] +
m_y_add[found] * l;
else *(a_y) = fy[found + 4] -
m_y_add[found + 4] * l;
◆ FindValidXY()
bool Landscape::FindValidXY |
( |
int |
a_field, |
|
|
int & |
a_x, |
|
|
int & |
a_y |
|
) |
| |
|
protected |
2691 int x_add[ 8 ] = { 1, 1, 0, -1, -1, -1, 0, 1 };
2692 int y_add[ 8 ] = { 0, -1, -1, -1, 0, 1, 1, 1 };
2695 int width =
m_land->MapWidth();
2696 int height =
m_land->MapHeight();
2698 for (
int i = 0; i < 100; i++ ) {
2699 for (
int l = 0; l < 8; l++ ) {
2700 nx = a_x + x_add[ l ] * i;
2701 ny = a_y + y_add[ l ] * i;
2702 if ( ( nx < width ) && ( nx >= 0 ) && ( ny < height ) && ( ny >= 0 ) ) {
2703 index =
m_land->Get( nx, ny );
2704 if ( index == a_field ) {
2705 a_x = a_x + x_add[ l ] * i;
2706 a_y = a_y + y_add[ l ] * i;
◆ ForceArea()
void Landscape::ForceArea |
( |
void |
| ) |
|
|
protected |
2075 for (
unsigned int i = 0; i <
m_elems.size(); i++ ) {
2076 m_elems[ i ]->SetArea( (
double )
m_elems[ i ]->m_squares_in_map );
2077 if (
m_elems[ i ]->m_squares_in_map > 0 ) {
2078 m_elems[ i ]->SetMapValid(
true );
2079 l_area_sum +=
m_elems[ i ]->m_squares_in_map;
2084 g_msg->Warn( WARN_BUG,
"Landscape::ForceArea(): Polygon areas doesn't"" sum up to map area!",
"" );
◆ GetActualGooseGrazingForage() [1/2]
double Landscape::GetActualGooseGrazingForage |
( |
int |
a_polygon, |
|
|
GooseSpecies |
a_goose |
|
) |
| |
|
inline |
Returns the leaf forage resource as seen from a goose standpoint at a polygon referenced by x,y location The amount of food avaiable as grazing resource based on the vegetation height is species specific.
- Parameters
-
a_polygon | [in] The polygon refence number for the polygon we are interested in (assumed grass or cereals). This needs to be checked before calling |
a_goose | [in] Is the type of goose calling which is needed to determine how to assess the value of the current forage availability (ie its different for different types of geese) |
- Returns
- KJ/min
References m_elems, and m_polymapping.
◆ GetActualGooseGrazingForage() [2/2]
double Landscape::GetActualGooseGrazingForage |
( |
int |
a_x, |
|
|
int |
a_y, |
|
|
GooseSpecies |
a_goose |
|
) |
| |
|
inline |
Returns the leaf forage resource as seen from a goose standpoint at a polygon referenced by x,y location.
- Parameters
-
a_x | [in] The x-coordinate in a polygon we are interested in (assumed grass or cereals). This needs to be checked before calling |
a_y | [in] The x-coordinate in a polygon we are interested in (assumed grass or cereals). This needs to be checked before calling |
a_goose | [in] Is the type of goose calling which is needed to determine how to assess the value of the current forage availability (ie its different for different types of geese) |
- Returns
- KJ/min
598 return m_elems[
m_land->Get(a_x, a_y)]->GetGooseGrazingForage(a_goose);
References m_elems, and m_land.
◆ GetGooseFields()
Gets the list of suitable goose foraging fields today.
Here we need to go through all possible goose feeding locations to find out if they have any forage in them, and then create a list of those to return.
To make this efficient we need to have a list of fields.
First must calculate centroid. Runs through the list of elements and any that have an openness score bigger than our target are saved.
698 for (
unsigned int i = 0; i <
m_elems.size(); i++)
700 if (
m_elems[i]->GetOpenness() > a_minopenness)
702 for (
int g = gs_Pinkfoot; g < gs_foobar; g++)
704 gfli.
grass[g] =
m_elems[i]->GetGooseGrazingForage((GooseSpecies)g);
705 gfli.
geesesp[g] =
m_elems[i]->GetGooseSpNosToday((GooseSpecies)g);
712 int pref =
m_elems[ i ]->GetPoly();
723 alist->push_back(gfli);
References GooseFieldListItem::digestability, GooseFieldListItem::geese, GooseFieldListItem::geesesp, GooseFieldListItem::geesespTimed, GooseFieldListItem::geeseTimed, GooseFieldListItem::grain, GooseFieldListItem::grass, GooseFieldListItem::lastsownveg, GooseFieldListItem::maize, GooseFieldListItem::openness, GooseFieldListItem::polyref, GooseFieldListItem::previouscrop, GooseFieldListItem::roostdists, GooseFieldListItem::vegheight, GooseFieldListItem::vegphase, GooseFieldListItem::vegtype, and GooseFieldListItem::vegtypechr.
◆ GetGooseNumbers() [1/2]
int Landscape::GetGooseNumbers |
( |
int |
a_poly | ) |
|
This returns the number of geese on the polygon the day before.
References m_polymapping.
◆ GetGooseNumbers() [2/2]
int Landscape::GetGooseNumbers |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
This returns the number of geese on the polygon specifed by a_x, a_y the day before.
This returns the number of geese on the polygon the day before.
◆ GetHareFoodQuality()
double Landscape::GetHareFoodQuality |
( |
int |
a_polygon | ) |
|
- Todo:
- Decide where to classify new LE types for hare 1
3411 case tole_Freshwater:
3413 case tole_Saltwater:
3416 case tole_ConiferousForest:
3417 case tole_DeciduousForest:
3418 case tole_MixedForest:
3419 case tole_SmallRoad:
3420 case tole_LargeRoad:
3421 case tole_ActivePit:
3422 case tole_UrbanNoVeg:
3423 case tole_UrbanPark:
3427 case tole_MetalledPath:
3435 case tole_RiversidePlants:
3436 case tole_RiversideTrees:
3439 case tole_StoneWall:
3442 case tole_PitDisused:
3443 case tole_RoadsideVerge:
3446 case tole_AmenityGrass:
3448 case tole_BuiltUpWithParkland:
3449 case tole_Churchyard:
3450 case tole_HeritageSite:
3455 case tole_Wasteland:
3456 case tole_IndividualTree:
3457 case tole_WoodyEnergyCrop:
3458 case tole_PlantNursery:
3460 case tole_WindTurbine:
3461 case tole_WoodlandMargin:
3462 case tole_Vildtager:
3466 #ifdef __Perfectfood
3469 #ifdef __YEARLYVARIABLEFOODQUALITY
3470 digest *= m_OurPopulationManager->m_GoodYearBadYear;
3473 double access = 1.0;
3475 double grazedreduction[4] = { 1.0, 0.8, 0.2, 0.05 };
3478 if ((veg_height <= 0) && (weeds < 0.1))
return 0.25;
3480 bool veg_patchy =
true;
3481 #else // If it is not the special case of the 1950s
3492 if (access<0) access = 0;
3500 if (access<0) access = 0;
References g_FarmIntensivenessH, and g_VegHeightForageReduction.
◆ GetPolymapping()
int Landscape::GetPolymapping |
( |
int |
a_index | ) |
|
|
inline |
◆ GetQuarryNumbers()
int Landscape::GetQuarryNumbers |
( |
int |
a_poly | ) |
|
This returns the number of geese which are legal quarry on the polygon the day before.
This returns the number of geese on the polygon the day before.
References m_polymapping.
◆ GetVegArea()
double Landscape::GetVegArea |
( |
int |
v | ) |
|
|
inline |
◆ GISASCII_Output()
void Landscape::GISASCII_Output |
( |
string |
outpfile, |
|
|
int |
UTMX, |
|
|
int |
UTMY |
|
) |
| |
|
protected |
Write ASCII file of the ALMaSS map.
Here we write a ASCII file of the current map. Useful when visualizing output from simulations. The function will output the entity that is defined in the config: l_map_ascii_map_entity. The default is polyref number (l_map_ascii_map_entity = 1).
- Parameters
-
[in] | outpfile | Name of the output file |
[in] | UTMX | Utm x-coordinate of the lower lefthand corner of the map |
[in] | UTMY | Utm y-coordinate of the lower lefthand corner of the map |
3516 OFILE = fopen( outpfile.c_str(),
"w" );
3518 g_msg->Warn( WARN_FILE,
"Landscape::GISASCII_Output() "
3519 "Unable to open file for writing:",
3524 fprintf(OFILE,
"ncols %d\n",
m_width);
3525 fprintf(OFILE,
"nrows %d\n",
m_height);
3526 fprintf(OFILE,
"xllcorner %d\n", UTMX );
3527 fprintf(OFILE,
"yllcorner %d\n", UTMY );
3528 fprintf(OFILE,
"cellsize %d\n", 1 );
3529 fprintf(OFILE,
"NODATA_value %d\n", -9999 );
3532 for (
int y = 0; y <
m_height; y++) {
3533 for (
int x = 0; x <
m_width; x++) {
3536 fprintf(OFILE,
"%c", c );
3541 for (
int y = 0; y <
m_height; y++) {
3542 for (
int x = 0; x <
m_width; x++) {
3545 fprintf( OFILE,
"%c", c );
References l_map_ascii_map_entity().
◆ GrazeVegetation()
void Landscape::GrazeVegetation |
( |
int |
a_poly, |
|
|
double |
a_forage |
|
) |
| |
|
inline |
◆ GrazeVegetationTotal()
void Landscape::GrazeVegetationTotal |
( |
int |
a_poly, |
|
|
double |
a_forage |
|
) |
| |
|
inline |
Removes grazing forage from a poly and divides this out per m2.
References m_elems, and m_polymapping.
◆ hb_Add()
void Landscape::hb_Add |
( |
void |
| ) |
|
|
protected |
◆ hb_AddNewHedgebanks()
void Landscape::hb_AddNewHedgebanks |
( |
int |
a_orig_poly_num | ) |
|
|
protected |
◆ hb_Cleanup()
void Landscape::hb_Cleanup |
( |
void |
| ) |
|
|
protected |
◆ hb_ClearPolygon()
void Landscape::hb_ClearPolygon |
( |
int |
a_poly_num | ) |
|
|
protected |
◆ hb_DownPolyNumbers()
void Landscape::hb_DownPolyNumbers |
( |
void |
| ) |
|
|
protected |
◆ hb_FindBoundingBox()
bool Landscape::hb_FindBoundingBox |
( |
int |
a_poly_num | ) |
|
|
protected |
◆ hb_FindHedges()
void Landscape::hb_FindHedges |
( |
void |
| ) |
|
|
protected |
◆ hb_GenerateHBPolys()
void Landscape::hb_GenerateHBPolys |
( |
void |
| ) |
|
|
protected |
◆ hb_HasNeighbourColor()
bool Landscape::hb_HasNeighbourColor |
( |
int |
a_x, |
|
|
int |
a_y, |
|
|
int |
a_neighbour_color |
|
) |
| |
|
protected |
◆ hb_HasOtherNeighbour()
bool Landscape::hb_HasOtherNeighbour |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
protected |
◆ hb_MapBorder()
bool Landscape::hb_MapBorder |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
protected |
◆ hb_MarkTheBresenhamWay()
void Landscape::hb_MarkTheBresenhamWay |
( |
void |
| ) |
|
|
protected |
◆ hb_MarkTopFromLocalMax()
void Landscape::hb_MarkTopFromLocalMax |
( |
int |
a_color | ) |
|
|
protected |
◆ hb_MaxUnpaintedNegNeighbour()
int Landscape::hb_MaxUnpaintedNegNeighbour |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
protected |
◆ hb_PaintBorder()
void Landscape::hb_PaintBorder |
( |
int |
a_color | ) |
|
|
protected |
◆ hb_PaintWhoHasNeighbourColor()
bool Landscape::hb_PaintWhoHasNeighbourColor |
( |
int |
a_neighbour_color, |
|
|
int |
a_new_color |
|
) |
| |
|
protected |
◆ hb_ResetColorBits()
void Landscape::hb_ResetColorBits |
( |
void |
| ) |
|
|
protected |
◆ hb_RestoreHedgeCore()
void Landscape::hb_RestoreHedgeCore |
( |
int |
a_orig_poly_number | ) |
|
|
protected |
◆ hb_StripingDist()
int Landscape::hb_StripingDist |
( |
void |
| ) |
|
|
protected |
◆ hb_UpPolyNumbers()
void Landscape::hb_UpPolyNumbers |
( |
void |
| ) |
|
|
protected |
◆ HowManyPonds()
int Landscape::HowManyPonds |
( |
| ) |
|
|
inline |
◆ IncOsmiaNest()
void Landscape::IncOsmiaNest |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ IncTreatCounter()
void Landscape::IncTreatCounter |
( |
int |
a_treat | ) |
|
3576 if (a_treat < 0 || a_treat >= last_treatment) {
3578 sprintf(errornum,
"%d", a_treat);
3579 g_msg->Warn(WARN_BUG,
"Landscape::IncTreatCounter(): Index"" out of range!", errornum);
Referenced by LE::SetLastTreatment().
◆ InitOsmiaBeeNesting()
void Landscape::InitOsmiaBeeNesting |
( |
| ) |
|
Read in the Osmia nest density files and allocate to each LE object.
Reads in an input file Ela and provides a max nest number to each instance of LE* in the m_elems vector
4700 array<int, tole_Foobar> tole_ref;
4701 array<double, tole_Foobar> maxOsmiaNests;
4702 array<double, tole_Foobar> minOsmiaNests;
4704 if (!ifile.is_open()) {
4711 if (length != tole_Foobar) {
4712 g_msg->Warn(
"Inconsistent file length with tole_Foobar: ",
int(tole_Foobar));
4716 for (
int i = 0; i < length; i++)
4718 ifile >> tole_ref[i] >> minOsmiaNests[i] >> maxOsmiaNests[i];
4721 for (
unsigned int e = 0; e <
m_elems.size(); e++) {
4722 int eletype =
m_elems[e]->GetALMaSSEleType();
4725 for (
int j = 0; j < length; j++)
4727 if (tole_ref[j] == eletype) {
4733 g_msg->Warn(
"Inconsistent file data, missing tole type ref: ", eletype);
4737 m_elems[e]->SetMaxOsmiaNests(minOsmiaNests[found] +
double(
g_rand_uni() * (maxOsmiaNests[found] - minOsmiaNests[found])));
References cfg_OsmiaNestByLE_Datafile(), and g_rand_uni().
◆ IsFieldType()
bool Landscape::IsFieldType |
( |
TTypesOfLandscapeElement |
a_tole | ) |
|
|
inline |
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)
◆ LineHighTest()
int Landscape::LineHighTest |
( |
int |
a_cx, |
|
|
int |
a_cy, |
|
|
double |
a_offsetx, |
|
|
double |
a_offsety |
|
) |
| |
|
inline |
Provides a measure of the shortest distance in using a vector from a_cx,a_cy unitl tall obstacles are encountered in both +ve & -ve directions.
- Returns
- d1 is the distance from cx,cy to the obstruction. Runs out a line along a vector set by offsetx & offsety, from cx & cy until it meets too many high elements.
Will only stop when two consecutive squares return 'high'.
The criteria for threat or non-open are based on geese and include tall objects and roads
473 int x = (
int) (a_cx + a_offsetx * counter);
474 int y = (
int) (a_cy + a_offsety * counter);
475 if (x<1 || x >= (
m_width-2) || y<1 || y >= (
m_height-2))
return counter;
478 if ((tole == tole_LargeRoad) || (tole == tole_SmallRoad) || (tole == tole_HedgeBank))
return counter;
481 x = (
int) (a_cx + a_offsetx * (counter+1));
482 y = (
int) (a_cy + a_offsety * (counter+1));
◆ MagicMapP2PolyRef()
int Landscape::MagicMapP2PolyRef |
( |
int |
a_magic | ) |
|
|
inline |
◆ NewElement()
LE * Landscape::NewElement |
( |
TTypesOfLandscapeElement |
a_type | ) |
|
|
protected |
3690 static char error_num[20];
3696 case tole_HedgeBank:
3699 case tole_BeetleBank:
3702 case tole_RoadsideVerge:
3708 case tole_FieldBoundary:
3717 case tole_OrchardBand:
3720 case tole_MownGrass:
3732 case tole_PermanentSetaside:
3735 case tole_PermPasture:
3738 case tole_PermPastureLowYield:
3741 case tole_PermPastureTussocky:
3744 case tole_NaturalGrassDry:
3747 case tole_UnknownGrass:
3750 case tole_RiversidePlants:
3753 case tole_PitDisused:
3756 case tole_RiversideTrees:
3759 case tole_DeciduousForest:
3762 case tole_MixedForest:
3765 case tole_YoungForest:
3768 case tole_ConiferousForest:
3771 case tole_StoneWall:
3783 case tole_SmallRoad:
3786 case tole_LargeRoad:
3792 case tole_ActivePit:
3795 case tole_Freshwater:
3804 case tole_Saltwater:
3813 case tole_AmenityGrass:
3819 case tole_UrbanNoVeg:
3822 case tole_UrbanPark:
3825 case tole_BuiltUpWithParkland:
3834 case tole_RoadsideSlope:
3837 case tole_MetalledPath:
3843 case tole_Churchyard:
3846 case tole_NaturalGrassWet:
3849 case tole_Saltmarsh:
3855 case tole_HeritageSite:
3858 case tole_UnsprayedFieldMargin:
3861 case tole_Wasteland:
3864 case tole_IndividualTree:
3867 case tole_PlantNursery:
3870 case tole_Vildtager:
3873 case tole_WindTurbine:
3876 case tole_WoodyEnergyCrop:
3879 case tole_WoodlandMargin:
3891 case tole_Chameleon:
3894 case tole_DrainageDitch:
3900 case tole_WaterBufferZone:
3907 sprintf(error_num,
"%d", a_type);
3908 g_msg->Warn(WARN_FILE,
"Landscape::NewElement(): Unknown landscape element requested:", error_num);
3913 elem->SetElementType(a_type);
References LE_TypeClass::BackTranslateEleTypes(), g_letype, and LE::SetPollenNectarData().
◆ PolysDump()
void Landscape::PolysDump |
( |
const char * |
a_filename | ) |
|
|
protected |
1805 ofstream outf(a_filename, ios::out);
1806 int l_num_polys = 0;
1808 if (!outf.is_open()) {
1809 g_msg->Warn(WARN_FILE,
"Landscape::PolysDump(): Unable to open file", a_filename);
1814 unsigned sz = (unsigned)
m_elems.size();
1815 for (
unsigned int i = 0; i < sz; i++) {
1816 if (
m_elems[i]->GetMapValid())
1820 outf << l_num_polys << endl;
1821 outf <<
"PolyType" <<
'\t' <<
"PolyRefNum" <<
'\t' <<
"Area" <<
'\t' <<
"FarmRef" <<
'\t' <<
"UnSprayedMarginRef" <<
'\t' <<
"SoilType" <<
'\t' <<
"Openness" <<
'\t' <<
"CentroidX" <<
'\t' <<
"CentroidY" << endl;
1830 for (
unsigned int i = 0; i <
m_elems.size(); i++)
1832 if (
m_elems[i]->GetMapValid())
1834 outf <<
m_elems[i]->GetALMaSSEleType() <<
'\t' <<
m_elems[i]->GetPoly() <<
'\t' <<
m_elems[i]->GetArea() <<
'\t' <<
1835 m_elems[i]->GetOwnerFile() <<
'\t' <<
m_elems[i]->GetUnsprayedMarginPolyRef() <<
'\t' <<
m_elems[i]->GetSoilType() <<
'\t' <<
m_elems[i]->GetOpenness()
1836 <<
'\t' <<
m_elems[i]->GetCentroidX() <<
'\t' <<
m_elems[i]->GetCentroidY() << endl;
◆ PolysRemoveInvalid()
bool Landscape::PolysRemoveInvalid |
( |
void |
| ) |
|
|
protected |
PolysValidate or ChangeMapMapping must be called after this method
1777 bool didsomething =
false;
1778 vector < LE * > l_temp;
1779 cout <<
"Tidying up the polygon map in PolysRemoveInvalid" << endl;
1781 for (
unsigned int i = 0; i < sz; i++ ) {
1782 if (
m_elems[ i ]->GetMapValid() ) {
1783 unsigned int j = (
int) l_temp.size();
1784 l_temp.resize( j + 1 );
1790 didsomething =
true;
1794 for (
unsigned int i = 0; i < l_temp.size(); i++ ) {
1797 m_elems.resize( l_temp.size() );
1799 return didsomething;
References m_polymapping.
◆ PolysRenumber()
void Landscape::PolysRenumber |
( |
void |
| ) |
|
|
protected |
2059 cout <<
"In Landscape::Landscape() Polygon renumber." << endl;
2060 for (
unsigned int i = 0; i <
m_elems.size(); i++)
2063 int index =
m_elems[i]->GetMapIndex();
2068 g_msg->Warn(WARN_FILE,
"Landscape::Landscape() ""Map to be dumped due to polygon renumber",
"");
References m_polymapping.
◆ PolysValidate()
void Landscape::PolysValidate |
( |
bool |
a_exit_on_invalid | ) |
|
|
protected |
1748 for (
unsigned int i = 0; i <
m_elems.size(); i++ ) {
1749 m_elems[ i ]->SetMapValid(
false );
1752 sprintf( l_err,
"%d",
m_elems[ i ]->GetPoly() );
1753 g_msg->Warn( WARN_FILE,
"Landscape::PolysValidate(): Invalid polymapping ", l_err );
1759 if ( a_exit_on_invalid ) {
1760 for (
unsigned int i = 0; i <
m_elems.size(); i++ ) {
1761 if ( !
m_elems[ i ]->GetMapValid() ) {
1763 sprintf( l_err,
"%d",
m_elems[ i ]->GetPoly() );
1764 g_msg->Warn( WARN_FILE,
"Landscape::PolysValidate(): Invalid polygon ", l_err );
References m_polymapping.
◆ PolytypeToString()
std::string Landscape::PolytypeToString |
( |
TTypesOfLandscapeElement |
a_le_type | ) |
|
4090 switch (a_le_type) {
4093 case tole_RoadsideVerge:
4094 return " Roadside Verge";
4097 case tole_FieldBoundary:
4098 return " Field Boundary";
4105 case tole_PermPastureTussocky:
4106 return " PermPastureTussocky";
4107 case tole_PermanentSetaside:
4108 return " Permanent Setaside";
4109 case tole_PermPasture:
4110 return " Permanent Pasture";
4111 case tole_PermPastureLowYield:
4112 return " PermPastureLowYield";
4113 case tole_NaturalGrassDry:
4114 return " Natural Grass";
4115 case tole_NaturalGrassWet:
4116 return " Natural Grass Wet";
4117 case tole_RiversidePlants:
4118 return " Riverside Plants";
4119 case tole_PitDisused:
4120 return " Pit Disused";
4121 case tole_RiversideTrees:
4122 return " Riverside Trees";
4123 case tole_DeciduousForest:
4124 return " Deciduous Forest";
4125 case tole_MixedForest:
4126 return " Mixed Forest";
4127 case tole_ConiferousForest:
4128 return " Coniferous Forest";
4129 case tole_YoungForest:
4130 return " Young Forest";
4131 case tole_StoneWall:
4132 return " Stone Wall";
4137 case tole_SmallRoad:
4138 return " Small Road";
4139 case tole_LargeRoad:
4140 return " Large Road";
4143 case tole_ActivePit:
4144 return " Active Pit";
4147 case tole_Freshwater:
4148 return " Fresh Water";
4151 case tole_Saltwater:
4152 return " Saltwater";
4156 return " Bare Rock";
4157 case tole_HedgeBank:
4158 return " Hedgebank";
4163 case tole_OrchardBand:
4164 return " Orchard Band";
4165 case tole_MownGrass:
4166 return " Mown Grass";
4167 case tole_UnsprayedFieldMargin:
4168 return " UnsprayedFieldMargin";
4169 case tole_AmenityGrass:
4170 return " AmenityGrass";
4173 case tole_UrbanNoVeg:
4174 return " UrbanNoVeg";
4177 case tole_UrbanPark:
4178 return " UrbanPark";
4179 case tole_BuiltUpWithParkland:
4180 return " BuiltUpWithParkland";
4185 case tole_RoadsideSlope:
4186 return " RoadsideSlope";
4187 case tole_MetalledPath:
4188 return " MetalledPath";
4191 case tole_Churchyard:
4192 return " Churchyard";
4193 case tole_Saltmarsh:
4194 return " Saltmarsh";
4197 case tole_HeritageSite:
4198 return " HeritageSite";
4199 case tole_BeetleBank:
4200 return " Beetle Bank";
4201 case tole_UnknownGrass:
4202 return " Unknown Grass";
4203 case tole_Wasteland:
4204 return " Waste/Building Land";
4205 case tole_IndividualTree:
4206 return " IndividualTree";
4207 case tole_PlantNursery:
4208 return " PlantNursery";
4209 case tole_Vildtager:
4210 return " Vildtager";
4211 case tole_WindTurbine:
4212 return " WindTurbine";
4213 case tole_WoodyEnergyCrop:
4214 return " WoodyEnergyCrop";
4215 case tole_WoodlandMargin:
4216 return " WoodlandMargin";
4223 case tole_WaterBufferZone:
4224 return " Unsprayed buffer zone around water";
4227 sprintf(error_num,
"%d", a_le_type);
4228 g_msg->Warn(WARN_FILE,
"Landscape::PolytypeToString(): Unknown event type:", error_num);
◆ ReadOpenness()
void Landscape::ReadOpenness |
( |
void |
| ) |
|
Reads openness values from a standard input file for all polygons.
◆ ReadPolys()
void Landscape::ReadPolys |
( |
const char * |
a_polyfile | ) |
|
|
protected |
◆ ReadPolys2()
void Landscape::ReadPolys2 |
( |
const char * |
a_polyfile | ) |
|
|
protected |
reads in polygon information. Version 2 including centroid and openness information
The polygon file consists of 9 columns:
- Polygon Number 2. Type 3. Area as a double 4. Owner (-1 = now owner), 5- -1 or unsprayed margin polynum
, column 6 is soil type (-1 if not used), column 7 is the polygon openness score (-1 if unset), 8 is the x-coordinate of the centroid, and 9 is the y-coordinate of the centroid. If either of these centroid coords are -1, then the centroid calculation will be forced.
If this is to be used then cfg_map_usesoiltypes needs to be set as true (default true).
As of December 2014 there is a header row of information to be skipped here
As of July 2013 we have the need to use really big maps, hence polygon reference numbers need to be kept within reasonable bounds. It is now a requirement that any polyref number is < twice the total number of polygons in the file.
This is a quick way to replace one type with another for some simulations, polygon type 150 therefore has some special uses
With the polygons renumbered, we can safely set the hb_first_free_poly_num to the number of polygons we have.
1904 string rubbish =
"";
1905 ifstream ifile(a_polyfile);
1906 if (!ifile.is_open()) {
1907 g_msg->Warn(WARN_FILE,
"Landscape::ReadPolys(): Unable to open file", a_polyfile);
1912 ifile >> NoPolygons;
1915 for (
int i = 0; i < 9; i++){ ifile >> rubbish; }
1919 int np = NoPolygons;
1920 if (NoPolygons < 10000) np = 10000;
1924 for (
int i = 0; i < np * 2; i++) {
1930 for (
int x = 0; x < NoPolygons; x++)
1932 int PolyNum, Owner, PolyType, RealPolyType, URef, SoilType, openness, Centroid_x, Centroid_y;
1933 TTypesOfLandscapeElement Type;
1935 ifile >> PolyType >> PolyNum >> Area >> Owner >> URef >> SoilType >> openness >> Centroid_x >> Centroid_y;
1937 if ((SoilType > 16) || (PolyNum<0))
1939 std::sprintf(error_num,
"%d", NoPolygons);
1940 g_msg->Warn(WARN_FILE,
"Landscape::ReadPolys(): Polygon file empty before "
1941 "reading number of specified polygons (old polygon file format?):", error_num);
1947 if ((-1 != Owner) && !farmsrenum)
1953 RealPolyType = PolyType;
1955 if (PolyType == 150)
1961 if (Type == tole_Missing)
1971 m_elems[ElemIndex++] = newland;
1974 newland->
SetArea(floor(0.5 + Area));
1975 newland->SetALMaSSEleType(RealPolyType);
1978 newland->SetCentroid(Centroid_x,Centroid_y);
1988 if (-1 == Owner && (Type == tole_Field || Type == tole_YoungForest || Type == tole_Orchard || Type == tole_PermPastureTussocky || Type == tole_PermPasture || Type == tole_PermanentSetaside || Type == tole_PermPastureLowYield || Type == tole_WoodyEnergyCrop || Type == tole_Vildtager || Type == tole_PlantNursery)) {
1990 sprintf(error_num,
"%d", PolyNum);
1991 g_msg->Warn(WARN_FILE,
"Landscape::ReadPolys(): Farm polygon does not belong to a farm:", error_num);
1994 if (-1 != Owner && Type != tole_Field && Type != tole_YoungForest && Type != tole_Orchard && Type != tole_PermPastureTussocky && Type != tole_PermPasture && Type != tole_PermanentSetaside && Type != tole_PermPastureLowYield && Type != tole_WoodyEnergyCrop && Type != tole_Vildtager && Type != tole_PlantNursery) {
1996 sprintf(error_num,
"%d", PolyNum);
1997 g_msg->Warn(WARN_FILE,
"Landscape::ReadPolys(): Farm polygon does not have element type tole_Field:", error_num);
2005 if (g_map_le_borders.value())
2007 if (
random(100) < g_map_le_border_chance.value())
2014 if (newland->GetElementType() == tole_Field)
2016 if (g_map_le_unsprayedmargins.value())
2018 if (
random(100) < g_map_le_unsprayedmargins_chance.value())
2029 sprintf(error_num,
"%d", PolyNum);
2030 g_msg->Warn(WARN_FILE,
"Landscape::ReadPolys(): Duplicate polygon in file", error_num);
References g_letype, l_map_chameleon_replace_num(), m_polymapping, random(), LE::SetArea(), LE::SetBorder(), LE::SetMapIndex(), LE::SetOpenness(), LE::SetPoly(), LE::SetSoilType(), LE::SetUnsprayedMarginPolyRef(), and LE_TypeClass::TranslateEleTypes().
◆ ReadSymbols()
bool Landscape::ReadSymbols |
( |
const char * |
a_cfgfile | ) |
|
|
inline |
789 return g_cfg->ReadSymbols( a_cfgfile );
◆ RebuildPolyMapping()
void Landscape::RebuildPolyMapping |
( |
| ) |
|
|
inlineprotected |
◆ RecordGooseNumbers()
void Landscape::RecordGooseNumbers |
( |
int |
a_poly, |
|
|
int |
a_number |
|
) |
| |
This records the number of geese on the polygon the day before. To prevent lots of unnecessary clearing of values two values are saved, the number and simulation day - on reading the simulation day number can be used to modify the return value - see GetGooseNumbers()
This records the number of geese on the polygon the day before. To prevent lots of unnecessary clearing of values two values are saved, the number and simulation day - on reading the simulation day number can be used to modify the return value - see GetGooseNumbers()
Note that the record is the for the day before because this method is called by DoFirst, so there are no geese today
References m_polymapping.
◆ RecordGooseNumbersTimed()
void Landscape::RecordGooseNumbersTimed |
( |
int |
a_poly, |
|
|
int |
a_number |
|
) |
| |
This records the number of geese on the polygon the day before at a predefined time. To prevent lots of unnecessary clearing of values two values are saved, the number and simulation day - on reading the simulation day number can be used to modify the return value - see GetGooseNumbers()
This records the number of geese on the polygon the day before at a predefined time. To prevent lots of unnecessary clearing of values two values are saved, the number and simulation day - on reading the simulation day number can be used to modify the return value - see GetGooseNumbers()
References m_polymapping.
◆ RecordGooseRoostDist()
void Landscape::RecordGooseRoostDist |
( |
int |
a_polyref, |
|
|
int |
a_dist, |
|
|
GooseSpecies |
a_goose |
|
) |
| |
Records the distance to the closest roost of goose species.
This records the distance to the closest roost for a goose species.
References m_polymapping.
◆ RecordGooseSpNumbers()
void Landscape::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 unnecessary clearing of values two values are saved, the number and simulation day - on reading the simulation day number can be used to modify the return value - see GetGooseNumbers()
This records the number of geese on the polygon the day before by species. To prevent lots of unnecessary clearing of values two values are saved, the number and simulation day - on reading the simulation day number can be used to modify the return value - see GetGooseNumbers()
Note that the record is the for the day before because this method is called by DoFirst, so there are no geese today
References m_polymapping.
◆ RecordGooseSpNumbersTimed()
void Landscape::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. To prevent lots of unnecessary clearing of values two values are saved, the number and simulation day - on reading the simulation day number can be used to modify the return value - see GetGooseNumbers()
This records the number of geese on the polygon the day before at a predefined time by species. To prevent lots of unnecessary clearing of values two values are saved, the number and simulation day - on reading the simulation day number can be used to modify the return value - see GetGooseNumbers()
References m_polymapping.
◆ ReleaseOsmiaNest()
void Landscape::ReleaseOsmiaNest |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ RemoveMissingValues()
void Landscape::RemoveMissingValues |
( |
void |
| ) |
|
|
protected |
A method for replacing missing values in the map with corrected ones - slow.
2093 int mapwidth =
m_land->MapWidth();
2094 int mapheight =
m_land->MapHeight();
2098 found =
false; counter++;
2099 for (
int x = 1; x < mapwidth-1; x++)
2101 for (
int y = 1; y < mapheight-1; y++)
2103 int apoly =
m_land->Get(x,y);
2106 m_land->MissingCellReplace(x, y,
true);
2111 }
while (counter<50);
2113 for (
int x = 0; x < mapwidth; x++)
2115 for (
int y = 0; y < mapheight; y++)
2117 int apoly =
m_land->Get(x, y);
2122 m_land->MissingCellReplaceWrap(x, y,
true);
References m_polymapping.
◆ RemoveSmallPolygons()
int Landscape::RemoveSmallPolygons |
( |
void |
| ) |
|
|
protected |
Removes small polygons from the map.
The method removes small polygons from the map and joins them with polygons that are close too them - there different rules depending on the type of polygon we have. Some small polygons can be legal, others need something done. Field polygons with management also have some minimum restrictions which are different from normal polygons.
This method is not written for efficiency, so simple brute force approaches are taken - it will take time to execute.
Rules:
- Linear features: Isolated cells of these are possible, but they should not be separate polygons. These need to be joined together to form bigger, if not contiguous polygons
- other 1m cell polygons need to be removed and replaced with the most common surrounding cell
- Field polygons: If they are less than 1000m2 then they are assumed to be grassland
2205 for (
int i = 0; i <
m_elems.size(); i++)
2207 TTypesOfLandscapeElement tole =
m_elems[i]->GetElementType();
2213 case tole_FieldBoundary:
2214 case tole_HedgeBank:
2216 case tole_IndividualTree:
2217 case tole_MetalledPath:
2219 case tole_RiversidePlants:
2220 case tole_RiversideTrees:
2221 case tole_RoadsideSlope:
2222 case tole_RoadsideVerge:
2223 case tole_SmallRoad:
2224 case tole_StoneWall:
2228 case tole_UnsprayedFieldMargin:
2229 case tole_WaterBufferZone:
2236 int poly =
m_elems[i]->GetPoly();
2239 g_msg->Warn(WARN_FILE,
"Landscape::RemoveSmallPolygons: Centroid not in polygon: ", i);
2243 if (
m_land->CellReplacementNeighbour(pt.
m_x, pt.
m_y, poly) == 1) {
2245 m_elems[i]->SetMapValid(
false);
2251 else if (tole == tole_Field)
2258 grass->SetElementType(tole_NaturalGrassDry);
2261 m_elems[i] = dynamic_cast<LE*>(grass);
References LE_TypeClass::BackTranslateEleTypes(), LE::DoCopy(), g_letype, APoint::m_x, APoint::m_y, and LE::SetOwner().
◆ ResetGrainAndMaize()
void Landscape::ResetGrainAndMaize |
( |
| ) |
|
Resets all grain.
To avoid grain from previous years sticking onto fields and confusing the goose foraging model, we make a hard reset of everything.
736 for (
unsigned int i = 0; i <
m_elems.size(); i++)
◆ RodenticidePredatorsEvaluation()
◆ SetBirdMaizeForage()
void Landscape::SetBirdMaizeForage |
( |
int |
a_polyref, |
|
|
double |
a_fooddensity |
|
) |
| |
|
inline |
Sets the maize forage resource as seen from a goose standpoint at a polygon.
References m_elems, and m_polymapping.
◆ SetBirdSeedForage()
void Landscape::SetBirdSeedForage |
( |
int |
a_polyref, |
|
|
double |
a_fooddensity |
|
) |
| |
|
inline |
Sets the grain forage resource as seen from a goose standpoint at a polygon.
References m_elems, and m_polymapping.
◆ SetLESignal()
void Landscape::SetLESignal |
( |
int |
a_polyref, |
|
|
LE_Signal |
a_signal |
|
) |
| |
◆ SetMaleNewtPresent()
void Landscape::SetMaleNewtPresent |
( |
int |
a_InPondIndex | ) |
|
|
inline |
Sets a male as being present in a pond.
349 {
m_elems[a_InPondIndex]->SetMaleNewtPresent(
true); }
References m_elems.
◆ SetPolymapping()
void Landscape::SetPolymapping |
( |
int |
a_index, |
|
|
int |
a_val |
|
) |
| |
|
inline |
◆ SetPolyMaxMinExtents()
void Landscape::SetPolyMaxMinExtents |
( |
void |
| ) |
|
1626 cout <<
"Setting max min polygon extents" << endl;
1627 int mwidth =
m_land->MapWidth();
1628 int mheight =
m_land->MapHeight();
1629 for (
int x = 0; x < mwidth; x++ ) {
1630 for (
int y = 0; y < mheight; y++ ) {
1631 int polyindex =
m_land->Get( x, y );
1633 unsigned int ele_ref= polyindex;
References m_polymapping.
◆ SetThePopManager()
Set the pointer to the current main population manager.
References m_ThePopManager.
Referenced by main().
◆ SimulationClosingActions()
void Landscape::SimulationClosingActions |
( |
| ) |
|
These are the things that are needed to be done after the simulation ends, but before landscape objects are deleted.
References cfg_OptimisingFarms.
Referenced by CloseDownSim().
◆ SkylarkEvaluation()
void Landscape::SkylarkEvaluation |
( |
SkTerritories * |
a_skt | ) |
|
3026 for (
unsigned i=0; i<
m_elems.size(); i++) {
3027 a_skt->PreCachePoly(
m_elems[i]->GetPoly());
◆ StepOneValid()
bool Landscape::StepOneValid |
( |
int |
a_polyindex, |
|
|
int |
a_x, |
|
|
int |
a_y, |
|
|
int |
step |
|
) |
| |
|
protected |
2432 int x_add[ 8 ] = { 1*a_step, 1*a_step, 0, -1*a_step, -1*a_step, -1*a_step, 0, 1*a_step };
2433 int y_add[ 8 ] = { 0, -1*a_step, -1*a_step, -1*a_step, 0, 1*a_step, 1*a_step, 1*a_step };
2434 int width =
m_land->MapWidth();
2435 int height =
m_land->MapHeight();
2437 for (
unsigned int i = 0; i < 8; i++ ) {
2438 if ( ( a_x + x_add[ i ] < width ) && ( a_x + x_add[ i ] >= 0 ) && ( a_y + y_add[ i ] < height ) && ( a_y + y_add[ i ] >= 0 ) )
2440 index =
m_land->Get( a_x + x_add[ i ], a_y + y_add[ i ] );
2441 if ( index == a_polyindex )
2443 m_elems[a_polyindex]->SetValidXY(a_x + x_add[ i ], a_y + y_add[ i ]);
◆ SubtractPondLarvalFood()
bool Landscape::SubtractPondLarvalFood |
( |
double |
a_food, |
|
|
int |
a_polyrefindex |
|
) |
| |
Removes larval food from a pond and returns true if it was possible, otherwise false.
665 return dynamic_cast<Pond*>(
m_elems[a_polyrefindex])->SubtractLarvalFood(a_food);
◆ SupplyBirdMaizeForage() [1/2]
double Landscape::SupplyBirdMaizeForage |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyBirdMaizeForage() [2/2]
double Landscape::SupplyBirdMaizeForage |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
Returns the maize forage resource as seen from a goose standpoint at an x,y location.
References m_elems, and m_land.
◆ SupplyBirdSeedForage() [1/2]
double Landscape::SupplyBirdSeedForage |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyBirdSeedForage() [2/2]
double Landscape::SupplyBirdSeedForage |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
Returns the grain forage resource as seen from a goose standpoint at an x,y location.
References m_elems, m_land, and m_polymapping.
◆ SupplyCentroid()
APoint Landscape::SupplyCentroid |
( |
int |
a_polyref | ) |
|
◆ SupplyCentroidIndex()
APoint Landscape::SupplyCentroidIndex |
( |
int |
a_polyrefindex | ) |
|
772 return m_elems[ a_polyrefindex ]->GetCentroid();
◆ SupplyCentroidX() [1/2]
int Landscape::SupplyCentroidX |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyCentroidX() [2/2]
int Landscape::SupplyCentroidX |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyCentroidY() [1/2]
int Landscape::SupplyCentroidY |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyCentroidY() [2/2]
int Landscape::SupplyCentroidY |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyCountryDesig()
int Landscape::SupplyCountryDesig |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyDayDegrees()
double Landscape::SupplyDayDegrees |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyDayInMonth()
int Landscape::SupplyDayInMonth |
( |
void |
| ) |
|
|
inline |
1608 return g_date->GetDayInMonth();
Referenced by RunTheSim().
◆ SupplyDayInYear()
int Landscape::SupplyDayInYear |
( |
void |
| ) |
|
|
inline |
1598 return g_date->DayInYear();
◆ SupplyDaylength() [1/2]
int Landscape::SupplyDaylength |
( |
long |
a_date | ) |
|
|
inline |
1525 return g_date->DayLength( a_date );
◆ SupplyDaylength() [2/2]
int Landscape::SupplyDaylength |
( |
void |
| ) |
|
|
inline |
1532 return g_date->DayLength();
◆ SupplyDaylightProp()
double Landscape::SupplyDaylightProp |
( |
| ) |
|
|
inline |
825 {
return g_date->GetDaylightProportion(); }
◆ SupplyDeadBiomass() [1/2]
double Landscape::SupplyDeadBiomass |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyDeadBiomass() [2/2]
double Landscape::SupplyDeadBiomass |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyElementSubType() [1/2]
int Landscape::SupplyElementSubType |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyElementSubType() [2/2]
int Landscape::SupplyElementSubType |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyElementType() [1/2]
TTypesOfLandscapeElement Landscape::SupplyElementType |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyElementType() [2/2]
TTypesOfLandscapeElement Landscape::SupplyElementType |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyElementTypeCC()
TTypesOfLandscapeElement Landscape::SupplyElementTypeCC |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyElementTypeFromVector()
TTypesOfLandscapeElement Landscape::SupplyElementTypeFromVector |
( |
unsigned int |
a_index | ) |
|
|
inline |
◆ SupplyFarmAnimalCensus()
int Landscape::SupplyFarmAnimalCensus |
( |
int |
a_farm_ref, |
|
|
int |
a_LifeStage |
|
) |
| |
◆ SupplyFarmArea()
int Landscape::SupplyFarmArea |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyFarmIntensity() [1/2]
int Landscape::SupplyFarmIntensity |
( |
int |
a_polyref | ) |
|
◆ SupplyFarmIntensity() [2/2]
int Landscape::SupplyFarmIntensity |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
◆ SupplyFarmIntensityI()
int Landscape::SupplyFarmIntensityI |
( |
int |
a_polyindex | ) |
|
752 return m_elems[ a_polyindex ]->GetOwner()->GetIntensity();
◆ SupplyFarmManagerPtr()
FarmManager* Landscape::SupplyFarmManagerPtr |
( |
| ) |
|
|
inline |
◆ SupplyFarmOwner() [1/2]
int Landscape::SupplyFarmOwner |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyFarmOwner() [2/2]
int Landscape::SupplyFarmOwner |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyFarmOwnerIndex() [1/2]
int Landscape::SupplyFarmOwnerIndex |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyFarmOwnerIndex() [2/2]
int Landscape::SupplyFarmOwnerIndex |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyFarmPtr()
Farm* Landscape::SupplyFarmPtr |
( |
int |
a_owner | ) |
|
|
inline |
◆ SupplyFarmType() [1/2]
TTypesOfFarm Landscape::SupplyFarmType |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyFarmType() [2/2]
TTypesOfFarm Landscape::SupplyFarmType |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyGlobalDate()
long Landscape::SupplyGlobalDate |
( |
void |
| ) |
|
|
inline |
1623 return g_date->Date();
◆ SupplyGlobalRadiation() [1/2]
double Landscape::SupplyGlobalRadiation |
( |
| ) |
|
|
inline |
◆ SupplyGlobalRadiation() [2/2]
double Landscape::SupplyGlobalRadiation |
( |
long |
a_date | ) |
|
|
inline |
1348 return g_weather->GetGlobalRadiation( a_date );
◆ SupplyGooseGrazingForageH() [1/2]
double Landscape::SupplyGooseGrazingForageH |
( |
double |
a_height, |
|
|
GooseSpecies |
a_goose |
|
) |
| |
|
inline |
◆ SupplyGooseGrazingForageH() [2/2]
double Landscape::SupplyGooseGrazingForageH |
( |
int |
a_polygon, |
|
|
GooseSpecies |
a_goose |
|
) |
| |
|
inline |
Returns the leaf forage resource as seen from a goose standpoint at a polygon referenced by number based on height only.
- Parameters
-
a_polygon | [in] The polygon refence number for the polygon we are interested in (assumed grass or cereals). This needs to be checked before calling |
a_goose | [in] Is the type of goose calling which is needed to determine how to assess the value of the current forage availability (ie its different for different types of geese) |
- Returns
- KJ/min
574 if (a_goose == gs_Pinkfoot)
578 if (a_goose == gs_Barnacle)
582 if (a_goose == gs_Greylag)
586 Warn(
"Landscape::SupplyGooseGrazingForage",
"Unknown Goose Type");
References m_elems, m_GooseIntakeRateVSVegetationHeight_BG, m_GooseIntakeRateVSVegetationHeight_GL, m_GooseIntakeRateVSVegetationHeight_PF, m_polymapping, and Warn().
◆ SupplyGrazingPressure() [1/2]
int Landscape::SupplyGrazingPressure |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyGrazingPressure() [2/2]
int Landscape::SupplyGrazingPressure |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyGrazingPressureVector()
int Landscape::SupplyGrazingPressureVector |
( |
unsigned int |
a_index | ) |
|
|
inline |
1234 return m_elems[ a_index ]->GetCattleGrazing();
References m_elems.
◆ SupplyGreenBiomass() [1/2]
double Landscape::SupplyGreenBiomass |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyGreenBiomass() [2/2]
double Landscape::SupplyGreenBiomass |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyHasTramlines() [1/2]
bool Landscape::SupplyHasTramlines |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyHasTramlines() [2/2]
bool Landscape::SupplyHasTramlines |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyHour()
int Landscape::SupplyHour |
( |
void |
| ) |
|
|
inline |
Get the hour of the day.
1587 return g_date->GetHour();
◆ SupplyHumidity()
double Landscape::SupplyHumidity |
( |
void |
| ) |
|
|
inline |
1395 return g_weather->GetHumidity();
◆ SupplyInsects() [1/2]
double Landscape::SupplyInsects |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyInsects() [2/2]
double Landscape::SupplyInsects |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyInStubble()
bool Landscape::SupplyInStubble |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyIsCereal()
bool Landscape::SupplyIsCereal |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyIsCereal2()
bool Landscape::SupplyIsCereal2 |
( |
TTypesOfVegetation |
a_vege_type | ) |
|
536 case tov_SpringBarley:
537 case tov_SpringBarleySpr:
538 case tov_WinterBarley:
539 case tov_SpringWheat:
540 case tov_WinterWheat:
544 case tov_SpringBarleySeed:
545 case tov_SpringBarleyStrigling:
546 case tov_SpringBarleyStriglingSingle:
547 case tov_SpringBarleyStriglingCulm:
548 case tov_WinterWheatStrigling:
549 case tov_WinterWheatStriglingSingle:
550 case tov_WinterWheatStriglingCulm:
551 case tov_OWinterBarley:
552 case tov_OWinterBarleyExt:
554 case tov_SpringBarleyGrass:
555 case tov_SpringBarleyCloverGrass:
556 case tov_SpringBarleyPeaCloverGrassStrigling:
557 case tov_OSpringBarley:
558 case tov_OSpringBarleyPigs:
559 case tov_OWinterWheatUndersown:
560 case tov_OWinterWheat:
563 case tov_WWheatPControl:
564 case tov_WWheatPToxicControl:
565 case tov_WWheatPTreatment:
566 case tov_AgroChemIndustryCereal:
567 case tov_SpringBarleyPTreatment:
568 case tov_SpringBarleySKManagement:
569 case tov_OSpringBarleyExt:
570 case tov_OSpringBarleyGrass:
571 case tov_OSpringBarleyClover:
572 case tov_PLWinterWheat:
573 case tov_PLWinterBarley:
574 case tov_PLWinterRye:
575 case tov_PLWinterTriticale:
576 case tov_PLSpringWheat:
577 case tov_PLSpringBarley:
578 case tov_NLWinterWheat:
579 case tov_NLSpringBarley:
581 default:
return false;
◆ SupplyIsGrass()
bool Landscape::SupplyIsGrass |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyIsGrass2()
bool Landscape::SupplyIsGrass2 |
( |
TTypesOfVegetation |
a_vege_type | ) |
|
507 case tov_NaturalGrass:
508 case tov_PermanentGrassGrazed:
509 case tov_PermanentGrassLowYield:
510 case tov_PermanentGrassTussocky:
511 case tov_PermanentSetaside:
515 case tov_OSeedGrass1:
516 case tov_OSeedGrass2:
517 case tov_CloverGrassGrazed1:
518 case tov_CloverGrassGrazed2:
519 case tov_OCloverGrassGrazed1:
520 case tov_OCloverGrassGrazed2:
521 case tov_OrchardCrop:
522 case tov_YoungForest:
523 case tov_FodderGrass:
525 case tov_WaterBufferZone:
527 default:
return false;
◆ SupplyIsMatureCereal()
bool Landscape::SupplyIsMatureCereal |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyJustMown()
bool Landscape::SupplyJustMown |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyJustMownVector()
bool Landscape::SupplyJustMownVector |
( |
unsigned int |
a_index | ) |
|
|
inline |
◆ SupplyJustSprayed() [1/2]
int Landscape::SupplyJustSprayed |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyJustSprayed() [2/2]
int Landscape::SupplyJustSprayed |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyJustSprayedVector()
int Landscape::SupplyJustSprayedVector |
( |
unsigned int |
a_index | ) |
|
|
inline |
1272 return m_elems[ a_index ]->IsRecentlySprayed();
References m_elems.
◆ SupplyLAGreen() [1/2]
double Landscape::SupplyLAGreen |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyLAGreen() [2/2]
double Landscape::SupplyLAGreen |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyLargeOpenFieldsNearXY()
polylist * Landscape::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,y.
There is a limit of 1000 polygons to return. There are probably more speed efficient ways to do this, but the simplest is to simply trawl through the list of polygons and pull out each polygon with an openness score > a_openness - then see if the centroid is within range. NB calling method must delete the polylist* passed back!
18/12/2013 this method has been rendered obselete by changes to hunters referring to famers rather than a co-ordinate and range.
Calculates distance from location a_x, a_y. This is done using an approximation to pythagorus to avoid a speed problem.
NB this will crash if either a_dy or a_dx are zero!
792 polylist* p_list =
new polylist;
793 unsigned sz = (unsigned)
m_elems.size();
794 for (
unsigned i=0; i<sz; i++)
796 if (
m_elems[i]->GetOpenness() > a_openness)
800 if (a_x>pt.
m_x) dx = a_x-pt.
m_x;
else dx = pt.
m_x-a_x;
801 if (a_y>pt.
m_y) dy = a_y-pt.
m_y;
else dy = pt.
m_y-a_y;
806 if (dx>dy) dist = dx + (dy * dy) /(2 * dx);
else dist = dy + (dx * dx) /(2 * dy);
807 if (dist<=a_range) p_list->push_back(
m_elems[i]->GetPoly());
References APoint::m_x, and APoint::m_y.
◆ SupplyLargestPolyNumUsed()
int Landscape::SupplyLargestPolyNumUsed |
( |
| ) |
|
|
inline |
◆ SupplyLastSownVeg() [1/2]
TTypesOfVegetation Landscape::SupplyLastSownVeg |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyLastSownVeg() [2/2]
TTypesOfVegetation Landscape::SupplyLastSownVeg |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyLastSownVegVector()
TTypesOfVegetation Landscape::SupplyLastSownVegVector |
( |
unsigned int |
a_index | ) |
|
|
inline |
◆ SupplyLastTreatment() [1/2]
int Landscape::SupplyLastTreatment |
( |
int |
a_polyref, |
|
|
int * |
a_index |
|
) |
| |
|
inline |
◆ SupplyLastTreatment() [2/2]
int Landscape::SupplyLastTreatment |
( |
int |
a_x, |
|
|
int |
a_y, |
|
|
int * |
a_index |
|
) |
| |
|
inline |
◆ SupplyLATotal()
double Landscape::SupplyLATotal |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyLECount()
int Landscape::SupplyLECount |
( |
void |
| ) |
|
◆ SupplyLEHigh()
bool Landscape::SupplyLEHigh |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
Tests whether the polygon at a_x,a_y is designated as high.
References m_elems, and m_land.
◆ SupplyLENext()
int Landscape::SupplyLENext |
( |
void |
| ) |
|
◆ SupplyLEPointer()
LE * Landscape::SupplyLEPointer |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyLEReset()
void Landscape::SupplyLEReset |
( |
void |
| ) |
|
◆ SupplyLESignal()
◆ SupplyMagicMapP()
int * Landscape::SupplyMagicMapP |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
1511 return m_land->GetMagicP( a_x, a_y );
References m_land.
◆ SupplyMaleNewtPresent()
bool Landscape::SupplyMaleNewtPresent |
( |
int |
a_InPondIndex | ) |
|
|
inline |
Determines if a male is present in a pond.
351 {
return m_elems[a_InPondIndex]->IsMaleNewtPresent(); }
References m_elems.
◆ SupplyMeanTemp()
double Landscape::SupplyMeanTemp |
( |
long |
a_date, |
|
|
unsigned int |
a_period |
|
) |
| |
|
inline |
1374 return g_weather->GetMeanTemp( a_date, a_period );
◆ SupplyMinute()
int Landscape::SupplyMinute |
( |
void |
| ) |
|
|
inline |
Get the minute of the hour.
1593 return g_date->GetMinute();
◆ SupplyMonth()
int Landscape::SupplyMonth |
( |
void |
| ) |
|
|
inline |
1603 return g_date->GetMonth();
Referenced by RunTheSim().
◆ SupplyNectar() [1/2]
PollenNectarQuality Landscape::SupplyNectar |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyNectar() [2/2]
PollenNectarQuality Landscape::SupplyNectar |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyNightProp()
double Landscape::SupplyNightProp |
( |
| ) |
|
|
inline |
826 {
return 1.0-g_date->GetDaylightProportion(); }
◆ SupplyNumberOfFarms()
int Landscape::SupplyNumberOfFarms |
( |
| ) |
|
|
inline |
◆ SupplyNumberOfPolygons()
unsigned int Landscape::SupplyNumberOfPolygons |
( |
void |
| ) |
|
|
inline |
◆ SupplyOpenness() [1/2]
int Landscape::SupplyOpenness |
( |
int |
a_poly | ) |
|
|
inline |
◆ SupplyOpenness() [2/2]
int Landscape::SupplyOpenness |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyOptFarmType()
TTypesOfOptFarms Landscape::SupplyOptFarmType |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
1193 OptimisingFarm * opf;
1194 opf = dynamic_cast<OptimisingFarm*>(
m_elems[
m_land->Get( a_x, a_y ) ]->GetOwner());
1195 return opf-> Get_farmType();
References m_elems, and m_land.
◆ SupplyOsmiaNest()
bool Landscape::SupplyOsmiaNest |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
Find out whether an osmia nest can be made here.
References m_elems, and m_land.
◆ SupplyOverspray()
bool Landscape::SupplyOverspray |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
◆ SupplyPesticide() [1/2]
double Landscape::SupplyPesticide |
( |
int |
a_polyref, |
|
|
PlantProtectionProducts |
a_ppp |
|
) |
| |
Gets total pesticide for the centroid of a polygon.
630 #ifdef __DETAILED_PESTICIDE_FATE
631 pp =
g_pest->SupplyPesticideS(a_polyref, a_ppp);
632 pp +=
g_pest->SupplyPesticideP(a_polyref, a_ppp);
634 pp =
g_pest->SupplyPesticide(a_polyref, a_ppp);
References g_pest, and l_pest_enable_pesticide_engine.
◆ SupplyPesticide() [2/2]
double Landscape::SupplyPesticide |
( |
int |
a_x, |
|
|
int |
a_y, |
|
|
PlantProtectionProducts |
a_ppp |
|
) |
| |
Gets total pesticide for a location.
588 #ifdef __DETAILED_PESTICIDE_FATE
590 pp =
g_pest->SupplyPesticideS(a_x, a_y, a_ppp);
591 pp +=
g_pest->SupplyPesticideP(a_x, a_y, a_ppp);
593 pp =
g_pest->SupplyPesticide(a_x, a_y, a_ppp);
References g_pest.
Referenced by Pond::CalcPondPesticide().
◆ SupplyPesticideCell()
int Landscape::SupplyPesticideCell |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyPesticideDecay()
bool Landscape::SupplyPesticideDecay |
( |
PlantProtectionProducts |
a_ppp | ) |
|
Returns true if there is any pesticide in the system at all at this point.
778 return g_pest->GetAnythingToDecay(a_ppp);
References g_pest.
◆ SupplyPesticideP() [1/2]
double Landscape::SupplyPesticideP |
( |
int |
a_polyref, |
|
|
PlantProtectionProducts |
a_ppp |
|
) |
| |
Gets plant pesticide for the centroid of a polygon.
655 #ifdef __DETAILED_PESTICIDE_FATE
656 pp =
g_pest->SupplyPesticideP(a_polyref, a_ppp);
658 pp =
g_pest->SupplyPesticide(a_polyref, a_ppp);
References g_pest, and l_pest_enable_pesticide_engine.
◆ SupplyPesticideP() [2/2]
double Landscape::SupplyPesticideP |
( |
int |
a_x, |
|
|
int |
a_y, |
|
|
PlantProtectionProducts |
a_ppp |
|
) |
| |
Gets plant pesticide for a location.
607 #ifdef __DETAILED_PESTICIDE_FATE
608 pp =
g_pest->SupplyPesticideP(a_x, a_y, a_ppp);
610 pp =
g_pest->SupplyPesticide(a_x, a_y, a_ppp);
References g_pest.
◆ SupplyPesticideS() [1/2]
double Landscape::SupplyPesticideS |
( |
int |
a_polyref, |
|
|
PlantProtectionProducts |
a_ppp |
|
) |
| |
Gets soil pesticide for the centroid of a polygon.
643 #ifdef __DETAILED_PESTICIDE_FATE
644 pp =
g_pest->SupplyPesticideS(a_polyref, a_ppp);
646 pp =
g_pest->SupplyPesticide(a_polyref, a_ppp);
References g_pest, and l_pest_enable_pesticide_engine.
◆ SupplyPesticideS() [2/2]
double Landscape::SupplyPesticideS |
( |
int |
a_x, |
|
|
int |
a_y, |
|
|
PlantProtectionProducts |
a_ppp |
|
) |
| |
Gets soil pesticide for a location.
618 #ifdef __DETAILED_PESTICIDE_FATE
619 pp =
g_pest->SupplyPesticideS(a_x, a_y, a_ppp);
621 pp =
g_pest->SupplyPesticide(a_x, a_y, a_ppp);
References g_pest.
◆ SupplyPesticideType()
◆ SupplyPollen() [1/2]
PollenNectarQuality Landscape::SupplyPollen |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyPollen() [2/2]
PollenNectarQuality Landscape::SupplyPollen |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyPolygonArea()
double Landscape::SupplyPolygonArea |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyPolygonAreaVector()
double Landscape::SupplyPolygonAreaVector |
( |
int |
a_polyref | ) |
|
|
inline |
Returns the area of a polygon using the vector index as a reference.
1202 return m_elems[ a_polyref ]->GetArea();
References m_elems.
◆ SupplyPolyRef()
int Landscape::SupplyPolyRef |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyPolyRefCC()
int Landscape::SupplyPolyRefCC |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyPolyRefIndex()
int Landscape::SupplyPolyRefIndex |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyPolyRefVector()
int Landscape::SupplyPolyRefVector |
( |
unsigned int |
a_index | ) |
|
|
inline |
◆ SupplyPondIndex()
int Landscape::SupplyPondIndex |
( |
int |
a_pondref | ) |
|
|
inline |
◆ SupplyPondPesticide()
double Landscape::SupplyPondPesticide |
( |
int |
a_poly_index | ) |
|
|
inline |
Get the pesticide concentration per liter from a pond (must be a pond index on calling)
761 {
return dynamic_cast<Pond*>(
m_elems[a_poly_index])->SupplyPondPesticide(); }
References m_elems.
◆ SupplyRain() [1/2]
double Landscape::SupplyRain |
( |
long |
a_date | ) |
|
|
inline |
1360 return g_weather->GetRain( a_date );
◆ SupplyRain() [2/2]
double Landscape::SupplyRain |
( |
void |
| ) |
|
|
inline |
1367 return g_weather->GetRain();
◆ SupplyRainPeriod()
double Landscape::SupplyRainPeriod |
( |
long |
a_date, |
|
|
int |
a_period |
|
) |
| |
|
inline |
1353 return g_weather->GetRainPeriod( a_date, a_period );
◆ SupplyRandomPondIndex()
int Landscape::SupplyRandomPondIndex |
( |
| ) |
|
◆ SupplyRandomPondRef()
int Landscape::SupplyRandomPondRef |
( |
| ) |
|
◆ SupplyRoadWidth()
◆ SupplyRodenticide()
double Landscape::SupplyRodenticide |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
◆ SupplyRodenticidePredatoryManager()
◆ SupplyShouldSpray()
bool Landscape::SupplyShouldSpray |
( |
| ) |
|
|
inline |
◆ SupplySimAreaHeight()
int Landscape::SupplySimAreaHeight |
( |
void |
| ) |
|
|
inline |
◆ SupplySimAreaMaxExtent()
int Landscape::SupplySimAreaMaxExtent |
( |
void |
| ) |
|
|
inline |
◆ SupplySimAreaMinExtent()
int Landscape::SupplySimAreaMinExtent |
( |
void |
| ) |
|
◆ SupplySimAreaWidth()
int Landscape::SupplySimAreaWidth |
( |
void |
| ) |
|
|
inline |
◆ SupplySkScrapes()
bool Landscape::SupplySkScrapes |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplySnowcover() [1/2]
bool Landscape::SupplySnowcover |
( |
long |
a_date | ) |
|
|
inline |
1432 return g_weather->GetSnow( a_date );
◆ SupplySnowcover() [2/2]
bool Landscape::SupplySnowcover |
( |
void |
| ) |
|
|
inline |
1439 return g_weather->GetSnow();
◆ SupplySnowDepth()
double Landscape::SupplySnowDepth |
( |
void |
| ) |
|
|
inline |
1446 return g_weather->GetSnowDepth();
◆ SupplySoilType()
int Landscape::SupplySoilType |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
Returns the soil type in ALMaSS types reference numbers.
References m_elems, and m_land.
◆ SupplySoilTypeR()
int Landscape::SupplySoilTypeR |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
Returns the soil type in rabbit warren reference numbers.
References m_elems, and m_land.
◆ SupplyTemp() [1/2]
double Landscape::SupplyTemp |
( |
long |
a_date | ) |
|
|
inline |
1381 return g_weather->GetTemp( a_date );
◆ SupplyTemp() [2/2]
double Landscape::SupplyTemp |
( |
void |
| ) |
|
|
inline |
◆ SupplyTempPeriod()
double Landscape::SupplyTempPeriod |
( |
long |
a_date, |
|
|
int |
a_period |
|
) |
| |
|
inline |
1412 return g_weather->GetTempPeriod( a_date, a_period );
◆ SupplyThePopManager()
Get the pointer to the current main population manager.
References m_ThePopManager.
◆ SupplyTotalNectar() [1/2]
double Landscape::SupplyTotalNectar |
( |
int |
a_polyref | ) |
|
|
inline |
383 {
return m_elems[a_polyref]->GetTotalNectar(); };
References m_elems.
◆ SupplyTotalNectar() [2/2]
double Landscape::SupplyTotalNectar |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyTotalPollen() [1/2]
double Landscape::SupplyTotalPollen |
( |
int |
a_polyref | ) |
|
|
inline |
379 {
return m_elems[a_polyref]->GetTotalPollen(); };
References m_elems.
◆ SupplyTotalPollen() [2/2]
double Landscape::SupplyTotalPollen |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyTrafficLoad() [1/2]
double Landscape::SupplyTrafficLoad |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyTrafficLoad() [2/2]
double Landscape::SupplyTrafficLoad |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyTreeAge() [1/2]
int Landscape::SupplyTreeAge |
( |
int |
a_Polyref | ) |
|
|
inline |
◆ SupplyTreeAge() [2/2]
◆ SupplyTreeHeight() [1/2]
int Landscape::SupplyTreeHeight |
( |
int |
| ) |
|
|
inline |
◆ SupplyTreeHeight() [2/2]
int Landscape::SupplyTreeHeight |
( |
int |
, |
|
|
int |
|
|
) |
| |
|
inline |
◆ SupplyUnderGrowthWidth() [1/2]
int Landscape::SupplyUnderGrowthWidth |
( |
int |
| ) |
|
|
inline |
◆ SupplyUnderGrowthWidth() [2/2]
int Landscape::SupplyUnderGrowthWidth |
( |
int |
, |
|
|
int |
|
|
) |
| |
|
inline |
◆ SupplyValidX()
int Landscape::SupplyValidX |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyValidY()
int Landscape::SupplyValidY |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyVegAge() [1/2]
int Landscape::SupplyVegAge |
( |
int |
a_Polyref | ) |
|
|
inline |
◆ SupplyVegAge() [2/2]
int Landscape::SupplyVegAge |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyVegBiomass() [1/2]
double Landscape::SupplyVegBiomass |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyVegBiomass() [2/2]
double Landscape::SupplyVegBiomass |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyVegBiomassVector()
double Landscape::SupplyVegBiomassVector |
( |
unsigned int |
a_index | ) |
|
|
inline |
◆ SupplyVegCover() [1/2]
double Landscape::SupplyVegCover |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyVegCover() [2/2]
double Landscape::SupplyVegCover |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyVegCoverVector()
double Landscape::SupplyVegCoverVector |
( |
unsigned int |
a_index | ) |
|
|
inline |
◆ SupplyVegDensity() [1/2]
int Landscape::SupplyVegDensity |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyVegDensity() [2/2]
int Landscape::SupplyVegDensity |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyVegDigestability() [1/2]
double Landscape::SupplyVegDigestability |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyVegDigestability() [2/2]
double Landscape::SupplyVegDigestability |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyVegDigestabilityVector()
double Landscape::SupplyVegDigestabilityVector |
( |
unsigned int |
a_index | ) |
|
|
inline |
916 return m_elems[ a_index ]->GetDigestability();
References m_elems.
◆ SupplyVegHeight() [1/2]
double Landscape::SupplyVegHeight |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyVegHeight() [2/2]
double Landscape::SupplyVegHeight |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyVegHeightVector()
double Landscape::SupplyVegHeightVector |
( |
unsigned int |
a_index | ) |
|
|
inline |
◆ SupplyVegPatchy() [1/2]
bool Landscape::SupplyVegPatchy |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyVegPatchy() [2/2]
bool Landscape::SupplyVegPatchy |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyVegPhase()
int Landscape::SupplyVegPhase |
( |
int |
a_poly | ) |
|
|
inline |
◆ SupplyVegType() [1/2]
TTypesOfVegetation Landscape::SupplyVegType |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyVegType() [2/2]
TTypesOfVegetation Landscape::SupplyVegType |
( |
int |
polyref | ) |
|
|
inline |
◆ SupplyVegTypeVector()
TTypesOfVegetation Landscape::SupplyVegTypeVector |
( |
unsigned int |
a_index | ) |
|
|
inline |
◆ SupplyVersion()
const char* Landscape::SupplyVersion |
( |
void |
| ) |
|
|
inline |
◆ SupplyWeedBiomass() [1/2]
double Landscape::SupplyWeedBiomass |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyWeedBiomass() [2/2]
double Landscape::SupplyWeedBiomass |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyWind() [1/2]
double Landscape::SupplyWind |
( |
long |
a_date | ) |
|
|
inline |
1402 return g_weather->GetWind( a_date );
◆ SupplyWind() [2/2]
double Landscape::SupplyWind |
( |
void |
| ) |
|
|
inline |
1419 return g_weather->GetWind();
◆ SupplyWindDirection()
int Landscape::SupplyWindDirection |
( |
void |
| ) |
|
|
inline |
1425 return g_weather->GetWindDirection();
◆ SupplyWindPeriod()
double Landscape::SupplyWindPeriod |
( |
long |
a_date, |
|
|
int |
a_period |
|
) |
| |
|
inline |
1407 return g_weather->GetWindPeriod( a_date, a_period );
◆ SupplyYear()
int Landscape::SupplyYear |
( |
void |
| ) |
|
|
inline |
1613 return g_date->GetYear();
◆ SupplyYearNumber()
int Landscape::SupplyYearNumber |
( |
void |
| ) |
|
|
inline |
1618 return g_date->GetYearNumber();
◆ TestCropManagement()
void Landscape::TestCropManagement |
( |
void |
| ) |
|
|
protected |
◆ Tick()
void Landscape::Tick |
( |
void |
| ) |
|
If the farmer decision making model is on, the function:
- calls #FarmManager::ActualProfit() function on March 1st each year starting from the 2nd year of the simulation
- starting from the 7th year, it saves the previous year's crop set for each farm and calls the #FarmManager::ChooseDecisionMode_for_farms() function
- saves all crop prices as last year prices (needed if crop prices are not constant)
- saves the number of day degrees in a period March 1st - November 1st. See #FarmManager::daydegrees.
- modifies energy maize price each year if the model is run with energy maize.
1480 for (
unsigned int i = 0; i <
m_elems.size(); i++) {
1481 m_elems[ i ]->StoreLAItotal();
1485 if (g_date->JanFirst()) {
1490 for (
unsigned int i = 0; i <
m_elems.size(); i++) {
1491 m_elems[ i ]->SetGrowthPhase( janfirst );
1494 else if (g_date->MarchFirst()) {
1495 for (
unsigned int i = 0; i <
m_elems.size(); i++) {
1496 m_elems[ i ]->SetGrowthPhase( marchfirst );
1497 m_elems[i]->SetStubble(
false);
1507 for (
unsigned int i = 0; i <
m_elems.size(); i++) {
1509 m_elems[ i ]->DoDevelopment();
1516 if (g_date->DayInYear() == g_date->DayInYear( 1, 03 ) && g_date->GetYearNumber()>1) {
1521 ofstream ofile2(
"CropDistribution.txt", ios::app );
1523 int last_year = g_date->GetYearNumber() - 1;
1524 ofile2 << last_year <<
'\t';
1532 if (g_date->GetYearNumber() > 7) {
1540 if (g_date->GetYearNumber() > 1 && g_date->DayInYear() == g_date->DayInYear( 1, 03 )) {
1541 for (
int f = 0; f < (toof_Foobar * tos_Foobar); f++) {
1542 int no_crops =
m_FarmManager->pm_data->Get_cropTypes_almass_size();
1543 for (
int c = 0; c < no_crops; c++) {
1544 double old_price =
m_FarmManager->pm_data->Get_sellingPrice( tov_Undefined*f +
m_FarmManager->pm_data->Get_cropTypes_almass( c ) );
1545 m_FarmManager->pm_data->Set_sellingPrice_lastyr( old_price, tov_Undefined*f +
m_FarmManager->pm_data->Get_cropTypes_almass( c ) );
1554 if (g_date->DayInYear() == g_date->DayInYear( 1, 03 ) && g_date->GetYearNumber() != 0) {
1555 ofstream ofileEM(
"Maize_energy_price_yearly.txt", ios::app );
1556 int year = g_date->GetYearNumber();
1557 ofileEM << year <<
'\t';
1558 ofileEM <<
m_FarmManager->pm_data->Get_sellingPrice( tov_Maize );
1564 if (g_date->DayInYear() == g_date->DayInYear( 1, 03 ) && g_date->GetYearNumber() > 0) {
1565 for (
int f = 0; f < (toof_Foobar * tos_Foobar); f++) {
1566 double new_price =
m_FarmManager->pm_data->Get_emaize_price( g_date->GetYearNumber() );
1567 m_FarmManager->pm_data->Set_sellingPrice( new_price, tov_Undefined*f + tov_Maize );
1590 if (g_date->GetDayInMonth() == 1)
References cfg_MaizeEnergy, cfg_OptimiseBedriftsmodelCrops, cfg_OptimisingFarms, cfg_pesticidemapnoyears(), cfg_pesticidemapon(), cfg_pesticidemapstartyear(), cfg_pesticidemaptype(), cfg_productapplicendyear(), cfg_productapplicstartyear(), cfg_rodenticide_enable(), g_pest, g_rand_uni(), l_map_dump_event_enable(), l_map_dump_event_x1(), l_map_dump_event_x2(), l_map_dump_event_y1(), l_map_dump_event_y2(), l_map_dump_veg_enable(), l_map_dump_veg_x(), l_map_dump_veg_y(), and l_pest_enable_pesticide_engine.
Referenced by TurnTheWorld().
◆ TranslateEleTypes()
TTypesOfLandscapeElement Landscape::TranslateEleTypes |
( |
int |
EleReference | ) |
|
|
inline |
◆ TranslateVegTypes()
TTypesOfVegetation Landscape::TranslateVegTypes |
( |
int |
VegReference | ) |
|
|
inline |
◆ TurnTheWorld()
void Landscape::TurnTheWorld |
( |
void |
| ) |
|
|
inline |
◆ UMarginTest()
bool Landscape::UMarginTest |
( |
int |
a_fieldpoly, |
|
|
int |
a_borderpoly, |
|
|
int |
a_x, |
|
|
int |
a_y, |
|
|
int |
a_width |
|
) |
| |
|
protected |
2671 int x_add[ 8 ] = { 1*a_width, 1*a_width, 0, -1*a_width, -1*a_width, -1*a_width, 0, 1*a_width };
2672 int y_add[ 8 ] = { 0, -1*a_width, -1*a_width, -1*a_width, 0, 1*a_width, 1*a_width, 1*a_width };
2673 int width =
m_land->MapWidth();
2674 int height =
m_land->MapHeight();
2676 for (
unsigned int i = 0; i < 8; i++ ) {
2677 if ( ( a_x + x_add[ i ] >= width ) || ( a_x + x_add[ i ] < 0 ) || ( a_y + y_add[ i ] >= height )
2678 || ( a_y + y_add[ i ] < 0 ) ) {
2682 index =
m_land->Get( a_x + x_add[ i ], a_y + y_add[ i ] );
2683 if ( ( index != a_fieldindex ) && ( index != a_marginindex ) )
return true;
◆ UnsprayedMarginAdd()
void Landscape::UnsprayedMarginAdd |
( |
LE * |
a_field | ) |
|
|
protected |
◆ UnsprayedMarginScan()
void Landscape::UnsprayedMarginScan |
( |
LE * |
a_field, |
|
|
int |
a_width |
|
) |
| |
|
protected |
2640 int fieldpoly = a_field->
GetPoly();
2641 int borderpoly = umargin->
GetPoly();
2644 int notforever = 5000;
2654 while ( --notforever ) {
2656 if (
UMarginTest( fieldindex, borderindex, x, y, a_width ) ) {
2658 m_land->Put( x, y, borderindex );
2663 if ( !
BorderStep( fieldindex, borderindex, & x, & y ) )
References LE::AddArea(), g_landscape_p, LE::GetPoly(), LE::GetUnsprayedMarginPolyRef(), LE::GetValidX(), LE::GetValidY(), m_polymapping, and SupplyLEPointer().
◆ UpdateOsmiaNesting()
void Landscape::UpdateOsmiaNesting |
( |
| ) |
|
|
inline |
Tesll all LE objects to update their osmia nest status.
References m_elems.
◆ VegDump()
void Landscape::VegDump |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
protected |
1645 FILE * vfile=fopen(
"VegDump.txt",
"a" );
1647 g_msg->Warn( WARN_FILE,
"Landscape::VegDump(): Unable to open file",
"VegDump.txt" );
1651 int year = g_date->GetYear();
1656 double density = bio / ( hei + 1 );
1669 fprintf( vfile,
"%d\t%d\t%g\t%g\t%d\t%g\t%g\t%g\t%i\t%g\t%g\t%g\t%g\t%g\t%g\t%g\t%g\n", year, day, hei, bio, grazed, density, cover, weeds, VegType, insects, LATotal, LAGreen, digest, GreenBiomass, DeadBiomass, ggraze, grain );
◆ VegtypeToString()
std::string Landscape::VegtypeToString |
( |
TTypesOfVegetation |
a_veg | ) |
|
4241 case tov_BroadBeans:
4242 return "BroadBeans ";
4243 case tov_FodderGrass:
4244 return "FodderGrass ";
4245 case tov_CloverGrassGrazed1:
4246 return "CloverGrassGrazed1 ";
4247 case tov_CloverGrassGrazed2:
4248 return "CloverGrassGrazed2 ";
4250 return "FieldPeas ";
4251 case tov_FieldPeasSilage:
4252 return "FieldPeasSilage ";
4253 case tov_FodderBeet:
4254 return "FodderBeet ";
4256 return "SugarBeet ";
4257 case tov_OFodderBeet:
4258 return "OFodderBeet ";
4263 case tov_MaizeSilage:
4264 return "MaizeSilage ";
4265 case tov_OMaizeSilage:
4266 return "OMaizeSilage ";
4267 case tov_NaturalGrass:
4268 return "NaturalGrass ";
4273 case tov_OrchardCrop:
4274 return "OrchardCrop ";
4277 case tov_OBarleyPeaCloverGrass:
4278 return "OBarleyPeaCloverGrass";
4281 case tov_OCloverGrassGrazed1:
4282 return "OCloverGrassGrazed1 ";
4283 case tov_OCloverGrassGrazed2:
4284 return "OCloverGrassGrazed2 ";
4285 case tov_OCloverGrassSilage1:
4286 return "OCloverGrassSilage1 ";
4287 case tov_OFieldPeas:
4288 return "OFieldPeas ";
4289 case tov_OFieldPeasSilage:
4290 return "OFieldPeasSilage ";
4291 case tov_OFirstYearDanger:
4292 return "OFirstYearDanger ";
4293 case tov_OGrazingPigs:
4294 return "OGrazingPigs ";
4297 case tov_OPermanentGrassGrazed:
4298 return "OPermanentGrassGrazed";
4300 return "OPotatoes ";
4301 case tov_OSBarleySilage:
4302 return "OSBarleySilage ";
4303 case tov_OSeedGrass1:
4304 return "OSeedGrass1 ";
4305 case tov_OSeedGrass2:
4306 return "OSeedGrass2 ";
4308 return "OSetaside ";
4309 case tov_OSpringBarley:
4310 return "OSpringBarley ";
4311 case tov_OSpringBarleyExt:
4312 return "OSpringBarleyExt ";
4313 case tov_OSpringBarleyClover:
4314 return "OSpringBarleyClover ";
4315 case tov_OSpringBarleyGrass:
4316 return "OSpringBarleyGrass ";
4317 case tov_OSpringBarleyPigs:
4318 return "OSpringBarleyPigs ";
4319 case tov_OTriticale:
4320 return "OTriticale ";
4321 case tov_OWinterBarley:
4322 return "OWinterBarley ";
4323 case tov_OWinterBarleyExt:
4324 return "OWinterBarleyExt ";
4325 case tov_OWinterRape:
4326 return "OWinterRape ";
4327 case tov_OWinterRye:
4328 return "OWinterRye ";
4329 case tov_OWinterWheatUndersown:
4330 return "OWinterWheatUndersown";
4331 case tov_OWinterWheat:
4332 return "OWinterWheat";
4333 case tov_OWinterWheatUndersownExt:
4334 return "OWinterWheatUsowExt ";
4335 case tov_PermanentGrassGrazed:
4336 return "PermanentGrassGrazed ";
4337 case tov_PermanentGrassLowYield:
4338 return "PermanentGrassLowYield";
4339 case tov_PermanentGrassTussocky:
4340 return "PermanentGrassTussocky";
4341 case tov_PermanentSetaside:
4342 return "PermanentSetaside ";
4344 return "PotatoesEat ";
4345 case tov_PotatoesIndustry:
4346 return "PotatoesIndustry ";
4347 case tov_SeedGrass1:
4348 return "SeedGrass1 ";
4349 case tov_SeedGrass2:
4350 return "SeedGrass2 ";
4353 case tov_SpringBarley:
4354 return "SpringBarley ";
4355 case tov_SpringBarleySpr:
4356 return "SpringBarleySpr ";
4357 case tov_SpringBarleyPTreatment:
4358 return "SpringBarleyPTreat ";
4359 case tov_SpringBarleySKManagement:
4360 return "SpringBarleySKMan ";
4361 case tov_SpringBarleyCloverGrass:
4362 return "SprBarleyCloverGrass ";
4363 case tov_SpringBarleyGrass:
4364 return "SpringBarleyGrass ";
4365 case tov_SpringBarleySeed:
4366 return "SpringBarleySeed ";
4367 case tov_SpringBarleySilage:
4368 return "SpringBarleySilage ";
4369 case tov_SpringRape:
4370 return "SpringRape ";
4371 case tov_SpringWheat:
4372 return "SpringWheat ";
4373 case tov_AgroChemIndustryCereal:
4374 return "AgroChemIndustry Cereal ";
4376 return "Triticale ";
4377 case tov_WinterBarley:
4378 return "WinterBarley ";
4379 case tov_WinterRape:
4380 return "WinterRape ";
4382 return "WinterRye ";
4383 case tov_WinterWheat:
4384 return "WinterWheat ";
4385 case tov_WinterWheatShort:
4386 return "WinterWheatShort ";
4387 case tov_WWheatPControl:
4388 return "P Trial Control ";
4389 case tov_WWheatPToxicControl:
4390 return "P Trial Toxic Control";
4391 case tov_WWheatPTreatment:
4392 return "P Trial Treatment ";
4394 return "Undefined ";
4395 case tov_WinterWheatStrigling:
4396 return "WWStrigling ";
4397 case tov_WinterWheatStriglingSingle:
4398 return "WWStriglingSingle ";
4399 case tov_WinterWheatStriglingCulm:
4400 return "WWStriglingCulm ";
4401 case tov_SpringBarleyCloverGrassStrigling:
4402 return "SBPCGStrigling ";
4403 case tov_SpringBarleyStrigling:
4404 return "SBarleyStrigling ";
4405 case tov_SpringBarleyStriglingSingle:
4406 return "SBarleyStriglingSgl ";
4407 case tov_SpringBarleyStriglingCulm:
4408 return "SBarleyStriglingCulm ";
4409 case tov_MaizeStrigling:
4410 return "MaizseStrigling ";
4411 case tov_WinterRapeStrigling:
4412 return "WRapeStrigling ";
4413 case tov_WinterRyeStrigling:
4414 return "WRyeStrigling ";
4415 case tov_WinterBarleyStrigling:
4416 return "WBStrigling ";
4417 case tov_FieldPeasStrigling:
4418 return "FieldPeasStrigling ";
4419 case tov_SpringBarleyPeaCloverGrassStrigling:
4420 return "SBPeaCloverGrassStr ";
4421 case tov_YoungForest:
4422 return "Young Forest ";
4424 return "Wasteland ";
4426 return "Heath/Grass ";
4427 case tov_PlantNursery:
4428 return "Plant Nursery ";
4429 case tov_NorwegianPotatoes:
4430 return "Norwegian Potatoes ";
4431 case tov_NorwegianOats:
4432 return "Norwegian Oats ";
4433 case tov_NorwegianSpringBarley:
4434 return "Norwegian Spr. Barley";
4436 case tov_WaterBufferZone:
4437 return "Unsprayed buffer zone around water";
4439 case tov_PLWinterWheat:
4440 return "Polish Winter Wheat ";
4441 case tov_PLWinterRape:
4442 return "Polish Winter Rape ";
4443 case tov_PLWinterBarley:
4444 return "Polish Winter Barley ";
4445 case tov_PLWinterTriticale:
4446 return "Polish Winter Triticale ";
4447 case tov_PLWinterRye:
4448 return "Polish Winter Rye ";
4449 case tov_PLSpringWheat:
4450 return "Polish Spring Wheat ";
4451 case tov_PLSpringBarley:
4452 return "Polish Spring Barley ";
4454 return "Polish Maize ";
4455 case tov_PLMaizeSilage:
4456 return "Polish Maize Silage ";
4457 case tov_PLPotatoes:
4458 return "Polish Potatoes ";
4460 return "Polish Beet ";
4461 case tov_PLFodderLucerne1:
4462 return "Polish Fodder Lucerne first year ";
4463 case tov_PLFodderLucerne2:
4464 return "Polish Fodder Lucerne second/third year ";
4466 return "Polish Carrots ";
4467 case tov_PLSpringBarleySpr:
4468 return "Polish Spring Barley with Spring Plough ";
4469 case tov_PLWinterWheatLate:
4470 return "Polish Winter Wheat late sown ";
4472 return "Polish Beet with Spring Plough ";
4474 return "Polish Beans ";
4477 return "Dutch Beet ";
4479 return "Dutch Carrots ";
4481 return "Dutch Maize ";
4482 case tov_NLPotatoes:
4483 return "Dutch Potatoes ";
4484 case tov_NLSpringBarley:
4485 return "Dutch Spring Barley ";
4486 case tov_NLWinterWheat:
4487 return "Dutch Winter Wheat ";
4489 return "Dutch Cabbage ";
4491 return "Dutch Tulips ";
4492 case tov_NLGrassGrazed1:
4493 return "Dutch TemporalGrassGrazed1 ";
4494 case tov_NLGrassGrazed1Spring:
4495 return "Dutch TemporalGrassGrazed1 after catch crop ";
4496 case tov_NLGrassGrazed2:
4497 return "Dutch TemporalGrassGrazed2 ";
4498 case tov_NLGrassGrazedLast:
4499 return "Dutch TemporalGrassGrazedLast ";
4500 case tov_NLPermanentGrassGrazed:
4501 return "Dutch PermanentGrassGrazed ";
4502 case tov_NLBeetSpring:
4503 return "Dutch Beet after catch crop ";
4504 case tov_NLCarrotsSpring:
4505 return "Dutch Carrots after catch crop ";
4506 case tov_NLMaizeSpring:
4507 return "Dutch Maize after catch crop ";
4508 case tov_NLPotatoesSpring:
4509 return "Dutch Potatoes after catch crop ";
4510 case tov_NLSpringBarleySpring:
4511 return "Dutch Spring Barley after catch crop ";
4512 case tov_NLCabbageSpring:
4513 return "Dutch Cabbage after catch crop ";
4514 case tov_NLCatchPeaCrop:
4515 return "Dutch Catch Pea Crop ";
4517 case tov_DummyCropPestTesting:
4518 return "Dummy Crop for Testing of Pesticide Sparying Distribution ";
4521 sprintf(error_num,
"%d", a_veg);
4522 g_msg->Warn(WARN_FILE,
"Landscape::VegtypeToString(): Unknown event type:", error_num);
◆ Warn()
void Landscape::Warn |
( |
std::string |
a_msg1, |
|
|
std::string |
a_msg2 |
|
) |
| |
|
inline |
◆ WriteOpenness()
void Landscape::WriteOpenness |
( |
void |
| ) |
|
Stores openness for all polygons to a standard file.
◆ hb_border_pixels
int Landscape::hb_border_pixels |
|
protected |
◆ hb_core_pixels
int Landscape::hb_core_pixels |
|
protected |
◆ hb_first_free_poly_num
int Landscape::hb_first_free_poly_num |
|
protected |
◆ hb_hedges
vector<int> Landscape::hb_hedges |
|
protected |
◆ hb_height
◆ hb_map
◆ hb_max_x
◆ hb_max_y
◆ hb_min_x
◆ hb_min_y
◆ hb_new_hbs
vector<LE*> Landscape::hb_new_hbs |
|
protected |
◆ hb_size
◆ hb_width
◆ l_vegtype_areas
double* Landscape::l_vegtype_areas |
|
private |
◆ le_signal_index
int Landscape::le_signal_index |
|
protected |
◆ m_DoMissingPolygonsManipulations
bool Landscape::m_DoMissingPolygonsManipulations |
|
private |
Flag to signal that missing polygons exist
◆ m_elems
vector<LE*> Landscape::m_elems |
|
private |
List of all landscape elements. The index is a sequential number, to get the polynum look this number up in m_polymapping.
Referenced by GetActualGooseGrazingForage(), GrazeVegetation(), GrazeVegetationTotal(), IncOsmiaNest(), MagicMapP2PolyRef(), RebuildPolyMapping(), ReleaseOsmiaNest(), SetBirdMaizeForage(), SetBirdSeedForage(), SetMaleNewtPresent(), SupplyBirdMaizeForage(), SupplyBirdSeedForage(), SupplyCentroidX(), SupplyCentroidY(), SupplyCountryDesig(), SupplyDayDegrees(), SupplyDeadBiomass(), SupplyElementSubType(), SupplyElementType(), SupplyElementTypeCC(), SupplyElementTypeFromVector(), SupplyFarmArea(), SupplyFarmOwner(), SupplyFarmOwnerIndex(), SupplyFarmType(), SupplyGooseGrazingForageH(), SupplyGrazingPressure(), SupplyGrazingPressureVector(), SupplyGreenBiomass(), SupplyHasTramlines(), SupplyInsects(), SupplyInStubble(), SupplyIsCereal(), SupplyIsGrass(), SupplyIsMatureCereal(), SupplyJustMown(), SupplyJustMownVector(), SupplyJustSprayed(), SupplyJustSprayedVector(), SupplyLAGreen(), SupplyLastSownVeg(), SupplyLastSownVegVector(), SupplyLastTreatment(), SupplyLATotal(), SupplyLEHigh(), SupplyLEPointer(), SupplyMaleNewtPresent(), SupplyNectar(), SupplyNumberOfPolygons(), SupplyOpenness(), SupplyOptFarmType(), SupplyOsmiaNest(), SupplyPesticideCell(), SupplyPollen(), SupplyPolygonArea(), SupplyPolygonAreaVector(), SupplyPolyRef(), SupplyPolyRefCC(), SupplyPolyRefVector(), SupplyPondPesticide(), SupplySkScrapes(), SupplySoilType(), SupplySoilTypeR(), SupplyTotalNectar(), SupplyTotalPollen(), SupplyTrafficLoad(), SupplyValidX(), SupplyValidY(), SupplyVegAge(), SupplyVegBiomass(), SupplyVegBiomassVector(), SupplyVegCover(), SupplyVegCoverVector(), SupplyVegDensity(), SupplyVegDigestability(), SupplyVegDigestabilityVector(), SupplyVegHeight(), SupplyVegHeightVector(), SupplyVegPatchy(), SupplyVegPhase(), SupplyVegType(), SupplyVegTypeVector(), SupplyWeedBiomass(), and UpdateOsmiaNesting().
◆ m_FarmManager
FarmManager* Landscape::m_FarmManager |
|
private |
◆ m_GooseIntakeRateVSVegetationHeight_BG
Polynomial2CurveClass* Landscape::m_GooseIntakeRateVSVegetationHeight_BG |
|
private |
◆ m_GooseIntakeRateVSVegetationHeight_GL
Polynomial2CurveClass* Landscape::m_GooseIntakeRateVSVegetationHeight_GL |
|
private |
◆ m_GooseIntakeRateVSVegetationHeight_PF
Polynomial2CurveClass* Landscape::m_GooseIntakeRateVSVegetationHeight_PF |
|
private |
◆ m_height
◆ m_height10
int Landscape::m_height10 |
|
private |
◆ m_land
RasterMap* Landscape::m_land |
|
private |
The big map.
Referenced by GetActualGooseGrazingForage(), IncOsmiaNest(), ReleaseOsmiaNest(), SupplyBirdMaizeForage(), SupplyBirdSeedForage(), SupplyCentroidX(), SupplyCentroidY(), SupplyCountryDesig(), SupplyDeadBiomass(), SupplyElementSubType(), SupplyElementType(), SupplyElementTypeCC(), SupplyFarmOwner(), SupplyFarmOwnerIndex(), SupplyFarmType(), SupplyGrazingPressure(), SupplyGreenBiomass(), SupplyHasTramlines(), SupplyInsects(), SupplyJustSprayed(), SupplyLAGreen(), SupplyLastSownVeg(), SupplyLastTreatment(), SupplyLATotal(), SupplyLEHigh(), SupplyMagicMapP(), SupplyNectar(), SupplyOpenness(), SupplyOptFarmType(), SupplyOsmiaNest(), SupplyPollen(), SupplyPolyRef(), SupplyPolyRefCC(), SupplyPolyRefIndex(), SupplySoilType(), SupplySoilTypeR(), SupplyTotalNectar(), SupplyTotalPollen(), SupplyTrafficLoad(), SupplyVegAge(), SupplyVegBiomass(), SupplyVegCover(), SupplyVegDensity(), SupplyVegDigestability(), SupplyVegHeight(), SupplyVegPatchy(), SupplyVegType(), and SupplyWeedBiomass().
◆ m_LargestPolyNumUsed
int Landscape::m_LargestPolyNumUsed |
|
protected |
◆ m_maxextent
int Landscape::m_maxextent |
|
private |
◆ m_minmaxextent
int Landscape::m_minmaxextent |
|
private |
◆ m_NeedCentroidCalculation
bool Landscape::m_NeedCentroidCalculation |
|
private |
a flag to ensure centroid calculation on object construction
◆ m_NeedOpennessCalculation
bool Landscape::m_NeedOpennessCalculation |
|
private |
a flag to ensure openness calculation on object construction
◆ m_PesticideMap
PesticideMap* Landscape::m_PesticideMap |
|
private |
For specialised pesticide recording.
◆ m_PesticideType
An attribute to hold the pesticide type being tested, if there is one, if not default is -1.
Referenced by SupplyPesticideType().
◆ m_polymapping
vector<int> Landscape::m_polymapping |
|
private |
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.
Referenced by GetActualGooseGrazingForage(), GetPolymapping(), GrazeVegetation(), GrazeVegetationTotal(), RebuildPolyMapping(), SetBirdMaizeForage(), SetBirdSeedForage(), SetPolymapping(), SupplyBirdMaizeForage(), SupplyBirdSeedForage(), SupplyCentroidX(), SupplyCentroidY(), SupplyDayDegrees(), SupplyDeadBiomass(), SupplyElementSubType(), SupplyElementType(), SupplyFarmArea(), SupplyFarmOwner(), SupplyFarmOwnerIndex(), SupplyFarmType(), SupplyGooseGrazingForageH(), SupplyGrazingPressure(), SupplyGreenBiomass(), SupplyHasTramlines(), SupplyInsects(), SupplyInStubble(), SupplyIsCereal(), SupplyIsGrass(), SupplyIsMatureCereal(), SupplyJustMown(), SupplyJustSprayed(), SupplyLAGreen(), SupplyLastSownVeg(), SupplyLastTreatment(), SupplyLEPointer(), SupplyOpenness(), SupplyPesticideCell(), SupplyPolygonArea(), SupplySkScrapes(), SupplyTrafficLoad(), SupplyValidX(), SupplyValidY(), SupplyVegAge(), SupplyVegBiomass(), SupplyVegCover(), SupplyVegDensity(), SupplyVegDigestability(), SupplyVegHeight(), SupplyVegPatchy(), SupplyVegPhase(), SupplyVegType(), and SupplyWeedBiomass().
◆ m_PondIndexList
vector<int> Landscape::m_PondIndexList |
|
protected |
◆ m_PondRefsList
vector<int> Landscape::m_PondRefsList |
|
protected |
◆ m_RodenticideManager
◆ m_RodenticidePreds
◆ m_ThePopManager
◆ m_toxShouldSpray
bool Landscape::m_toxShouldSpray |
|
protected |
◆ m_treatment_counts
int Landscape::m_treatment_counts[last_treatment] |
|
protected |
◆ m_versioninfo
char Landscape::m_versioninfo[30] |
|
private |
◆ m_width
◆ m_width10
◆ m_x_add
int Landscape::m_x_add[8] |
|
protected |
◆ m_y_add
int Landscape::m_y_add[8] |
|
protected |
The documentation for this class was generated from the following files:
static const int version_major
Definition: Landscape.cpp:49
int BackTranslateEleTypes(TTypesOfLandscapeElement EleReference)
Definition: elements.cpp:3610
void CalculateCentroids(void)
Definition: Landscape.cpp:3040
vector< int > m_PondRefsList
List of pond polyrefs.
Definition: landscape.h:199
char m_versioninfo[30]
Definition: landscape.h:115
double SupplyVegDigestability(int a_polyref)
Definition: landscape.h:919
Definition: elements.h:1304
LE * SupplyLEPointer(int a_polyref)
Definition: landscape.h:1099
Definition: elements.h:961
double grass[gs_foobar]
Definition: landscape.h:91
void DumpMapInfoByArea(const char *a_filename, bool a_append, bool a_dump_zero_areas, bool a_write_veg_names)
Definition: Landscape.cpp:3652
void SetOwner(Farm *a_owner, int a_owner_num, int a_owner_index)
Definition: elements.h:219
std::string lastsownveg
Definition: landscape.h:98
static CfgBool l_map_dump_treatcounts_enable("MAP_DUMP_TREATCOUNTS_ENABLE", CFG_CUSTOM, false)
static CfgInt cfg_mintownbuildingnumber("MAP_MINTOWNBUILDINGNUMBER", CFG_CUSTOM, 6)
double SupplyGreenBiomass(int a_polyref)
Definition: landscape.h:1017
Definition: elements.h:1239
CfgInt cfg_pesticidemapnoyears("PEST_MAP_NOYEARS", CFG_CUSTOM, 1)
The numer of years of pesticide mapping.
RodenticidePredators_Population_Manager * m_RodenticidePreds
Definition: landscape.h:158
double SupplyLATotal(int a_x, int a_y)
Definition: landscape.h:1004
Landscape * g_landscape_p
Definition: Landscape.cpp:258
void DumpMap(const char *a_filename)
Definition: Landscape.cpp:1386
void Tick()
Updates the rodenticide exposure for all predator territories.
Definition: RodenticidePredators.cpp:386
double vegheight
Definition: landscape.h:94
static CfgInt l_map_no_pesticide_fields("MAP_NO_PESTICIDE_FIELDS", CFG_CUSTOM, 0)
double GetArea(void)
Definition: elements.h:196
TTypesOfVegetation SupplyVegType(int a_x, int a_y)
Definition: landscape.h:1321
Definition: elements.h:992
Definition: elements.h:874
TTypesOfLandscapeElement SupplyElementType(int a_polyref)
Definition: landscape.h:1110
Definition: elements.h:920
void PolysDump(const char *a_filename)
Definition: Landscape.cpp:1803
Definition: elements.h:947
int geeseTimed
Definition: landscape.h:85
std::string VegtypeToString(TTypesOfVegetation a_veg)
Definition: Landscape.cpp:4235
int RemoveSmallPolygons(void)
Removes small polygons from the map.
Definition: Landscape.cpp:2184
CfgBool cfg_dumpvegjan("G_VEGAREASJAN_ON", CFG_CUSTOM, false)
bool UMarginTest(int a_fieldpoly, int a_borderpoly, int a_x, int a_y, int a_width)
Definition: Landscape.cpp:2669
int SupplyLECount(void)
Definition: Landscape.cpp:3562
bool BorderStep(int a_fieldpoly, int a_borderpoly, int *a_x, int *a_y)
Definition: Landscape.cpp:2479
int m_height
Definition: landscape.h:139
double SupplyLAGreen(int a_polyref)
Definition: landscape.h:1041
static CfgInt l_map_dump_event_x2("MAP_DUMP_EVENT_XB", CFG_CUSTOM, 4333)
void RemoveMissingValues()
A method for replacing missing values in the map with corrected ones - slow.
Definition: Landscape.cpp:2090
std::string previouscrop
Definition: landscape.h:97
void VegDump(int x, int y)
Definition: Landscape.cpp:1644
class LE_TypeClass * g_letype
Definition: elements.cpp:277
void GISASCII_Output(string outpfile, int UTMX, int UTMY)
Write ASCII file of the ALMaSS map.
Definition: Landscape.cpp:3507
Ponds are defined as freshwater bodies between 25m2 and 5000m2. For newts the effective size is limit...
Definition: elements.h:1183
Definition: elements.h:1082
int GetPoly(void)
Returns the polyref number for this polygon.
Definition: elements.h:189
PollenNectarDevelopmentData * g_nectarpollen
Definition: Landscape.cpp:241
Definition: elements.h:894
void CorrectCoords(int &x, int &y)
Function to prevent wrap around errors with co-ordinates using x/y pair.
Definition: landscape.h:1535
int SupplyGrazingPressure(int a_polyref)
Definition: landscape.h:1227
Definition: elements.h:881
static CfgBool l_map_dump_veg_enable("MAP_DUMP_VEG_ENABLE", CFG_CUSTOM, true)
Definition: elements.h:1034
void SetSoilType(int a_st)
Definition: elements.h:287
int m_width
Definition: landscape.h:138
void SetBorder(LE *a_border)
Definition: elements.h:320
Definition: elements.h:1245
int BackTranslateVegTypes(TTypesOfVegetation VegReference)
Definition: landscape.h:1669
Definition: elements.h:754
Definition: elements.h:1160
double g_VegHeightForageReduction
Definition: elements.h:954
int GetValidX(void)
Definition: elements.h:330
static CfgBool l_map_art_hedgebanks("MAP_ART_HEDGEBANKS", CFG_CUSTOM, false)
CfgInt cfg_HedgeSubtypeMaximum("HEDGE_SUBTYPEMAXIMUM", CFG_CUSTOM, 3)
Definition: elements.h:1124
Definition: elements.h:779
int polyref
Definition: landscape.h:82
Definition: elements.h:1015
Definition: elements.h:849
CfgInt cfg_pesticidetesttype("PESTICIDETESTYPE", CFG_CUSTOM, -1)
static CfgBool l_map_write_ascii("MAP_WRITE_ASCII", CFG_CUSTOM, false)
Used if an ASCII file for use in GIS applications should be written.
Definition: elements.h:1064
CfgBool cfg_OptimisingFarms
static CfgInt cfg_BeetleBankType("BBANK_TYPE", CFG_CUSTOM,(int) tole_BeetleBank)
int geesesp[gs_foobar]
Definition: landscape.h:84
Definition: landscape.h:63
CfgStr cfg_dumpvegjunefile("G_VEGAREASJUNE_FILENAME", CFG_CUSTOM, "DUMPVEG_JUNE.TXT")
static CfgInt l_map_ascii_utm_y("MAP_ASCII_UTM_Y", CFG_CUSTOM, 0)
If we write an ASCII file provide UTM-y of lower lefthand corner.
void SetUnsprayedMarginPolyRef(int a_unsprayedmargin)
Definition: elements.h:322
static CfgStr l_map_map_file("MAP_MAP_FILE", CFG_CUSTOM, "map.lsb")
void FillVegAreaData()
Definition: Landscape.cpp:3641
vector< int > m_polymapping
Definition: landscape.h:130
Definition: elements.h:1152
CfgStr l_map_dump_map_file("MAP_DUMP_MAP_FILE", CFG_CUSTOM, "dump.lsb")
Definition: elements.h:1286
Definition: elements.h:908
PesticideMap * m_PesticideMap
For specialised pesticide recording.
Definition: landscape.h:133
CfgBool cfg_DumpFarmAreas
double SupplyWeedBiomass(int a_polyref)
Definition: landscape.h:964
static CfgInt cfg_mintownbuildingdistance("MAP_MINTOWNBUILDINGDISTANCE", CFG_CUSTOM, 100)
void SetOpenness(int a_openness)
Records the openness statistic for this polygon.
Definition: elements.h:380
CfgStr l_map_dump_poly_file("MAP_DUMP_POLY_FILE", CFG_CUSTOM, "dump_polyrefs.txt")
boost::variate_generator< base_generator_type &, boost::uniform_real<> > g_rand_uni(g_generator, g_uni_dist)
double SupplyDeadBiomass(int a_polyref)
Definition: landscape.h:1029
Definition: elements.h:1144
static CfgInt l_map_dump_veg_y("MAP_DUMP_VEG_Y", CFG_CUSTOM, 100)
CfgInt cfg_HedgeSubtypeMinimum("HEDGE_SUBTYPEMINIMUM", CFG_CUSTOM, 0)
static CfgInt cfg_MaxPondSize("MAP_MAXPONDSIZE", CFG_CUSTOM, 5000)
If freshwater area is below this it is designated a pond.
Definition: elements.h:1052
FarmManager * m_FarmManager
List of all the farms.
Definition: landscape.h:119
void SetPolyMaxMinExtents(void)
Definition: Landscape.cpp:1622
static CfgBool l_map_exit_on_zero_area("MAP_EXIT_ON_ZERO_AREA", CFG_CUSTOM, true)
TTypesOfVegetation vegtype
Definition: landscape.h:92
void RebuildPolyMapping()
Definition: landscape.h:213
int roostdists[gs_foobar]
Definition: landscape.h:87
Definition: elements.h:967
TTypesOfLandscapeElement TranslateEleTypes(int EleReference)
Definition: elements.cpp:2995
void BorderAdd(LE *a_field, TTypesOfLandscapeElement a_type)
Definition: Landscape.cpp:2347
void Tick(void)
Definition: Landscape.cpp:1467
Definition: landscape.h:63
static CfgBool l_map_dump_enable("MAP_DUMP_ENABLE", CFG_CUSTOM, false)
static CfgBool cfg_AddBeetleBanks("BBANKS_ADD", CFG_CUSTOM, false)
void AddArea(double a_area_diff)
Definition: elements.h:316
void UnsprayedMarginAdd(LE *a_field)
Definition: Landscape.cpp:2617
CfgInt cfg_BeetleBankMinX("BBANK_MINX", CFG_CUSTOM, 0)
int m_maxextent
Definition: landscape.h:143
RodenticideManager * m_RodenticideManager
Definition: landscape.h:157
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
CfgInt cfg_BeetleBankMaxX("BBANK_MAXX", CFG_CUSTOM, 100000)
Definition: elements.h:974
void ReadPolys2(const char *a_polyfile)
reads in polygon information. Version 2 including centroid and openness information
Definition: Landscape.cpp:1892
void PolysRenumber(void)
Definition: Landscape.cpp:2057
Definition: elements.h:70
void UnsprayedMarginScan(LE *a_field, int a_width)
Definition: Landscape.cpp:2638
Definition: elements.h:1076
Definition: elements.h:787
Polynomial2CurveClass * m_GooseIntakeRateVSVegetationHeight_GL
Definition: landscape.h:162
static CfgBool l_map_print_version_info("MAP_PRINT_VERSION_INFO", CFG_CUSTOM, true)
A simple class defining an x,y coordinate set.
Definition: ALMaSS_Setup.h:52
bool m_DoMissingPolygonsManipulations
Definition: landscape.h:150
static CfgStr l_map_weather_file("MAP_WEATHER_FILE", CFG_CUSTOM, "weather.pre")
int hb_first_free_poly_num
Definition: landscape.h:274
Definition: elements.h:808
static CfgStr l_map_dump_treatcounts_file("MAP_DUMP_TREATCOUNTS_FILE", CFG_CUSTOM, "treatment_counts.txt")
vector< int > m_PondIndexList
List of pond indexes.
Definition: landscape.h:197
void AddBeetleBanks(TTypesOfLandscapeElement a_tole)
Definition: Landscape.cpp:2723
void BorderScan(LE *a_field, int a_width)
Definition: Landscape.cpp:2365
static CfgBool l_map_calc_openness("MAP_CALC_OPENNESS", CFG_CUSTOM, false)
Definition: elements.h:1166
static CfgInt l_map_ascii_map_entity("MAP_ASCII_MAP_ENTITY", CFG_CUSTOM, 1)
If we write an ASCII file what should be the mapped entity? 1 = polyref, 2 = elementype.
void Tick(void)
Advance one day.
Definition: Rodenticide.cpp:214
Definition: elements.h:768
LE_Signal SupplyLESignal(int a_polyref)
Definition: Landscape.cpp:3566
bool SupplyVegPatchy(int a_polyref)
Definition: landscape.h:986
Definition: elements.h:1118
void BeetleBankAdd(int x, int y, int angle, int length, LE *a_field, TTypesOfLandscapeElement a_tole)
Definition: Landscape.cpp:2971
static CfgFloat cfg_BeetleBankMaxArea("BBANK_MAXAREA", CFG_CUSTOM, 0.05)
double maize
Definition: landscape.h:90
static CfgStr l_map_poly_file("MAP_POLY_FILE", CFG_CUSTOM, "polygonrefs.txt")
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
int m_treatment_counts[last_treatment]
Definition: landscape.h:193
void SetPoly(int a_poly)
Definition: elements.h:226
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
bool m_toxShouldSpray
Definition: landscape.h:317
Definition: RodenticidePredators.h:50
Definition: elements.h:1227
void CountMapSquares(void)
Definition: Landscape.cpp:2040
static CfgInt l_map_dump_event_y2("MAP_DUMP_EVENT_YB", CFG_CUSTOM, 2889)
Definition: elements.h:795
Definition: elements.h:1298
static CfgBool l_map_dump_gfx_enable("MAP_DUMP_GFX_ENABLE", CFG_CUSTOM, false)
int m_y_add[8]
Definition: landscape.h:267
int m_width10
Definition: landscape.h:140
CfgBool cfg_BeetleBankInvert("BBANK_INVERT", CFG_CUSTOM, false)
static CfgInt l_map_ascii_utm_x("MAP_ASCII_UTM_X", CFG_CUSTOM, 0)
If we write an ASCII file provide UTM-x of lower lefthand corner.
int SupplyDayInYear(void)
Definition: landscape.h:1596
Class for management of bait locations.
Definition: Rodenticide.h:72
double SupplyVegBiomass(int a_polyref)
Definition: landscape.h:953
void DumpTreatCounters(const char *a_filename)
Definition: Landscape.cpp:3586
static CfgStr cfg_OsmiaNestByLE_Datafile("OSMIA_NESTBYLEDATAFILE", CFG_CUSTOM, "OsmiaNestsByHabitat.txt")
CfgBool cfg_pesticidemapon("PEST_MAP_ON", CFG_CUSTOM, false)
Flag determining whether we are using the pesticide map.
static CfgBool l_map_consolidatepolys("MAP_CONSOLIDATEPOLYS", CFG_CUSTOM, false)
Used to consolidate polygons with no special behaviour into a single polygon of that type.
int m_x
Definition: ALMaSS_Setup.h:55
Definition: elements.h:1266
double SupplyBirdSeedForage(int a_polyref)
Returns the grain forage resource.
Definition: landscape.h:614
Definition: elements.h:1251
int FindLongestAxis(int *x, int *y, int *a_length)
Definition: Landscape.cpp:2851
static CfgInt cfg_BeetleBankChance("BBANK_CHANCE", CFG_CUSTOM, 100)
int SupplyYearNumber(void)
Definition: landscape.h:1616
Definition: elements.h:818
Definition: elements.h:740
Definition: elements.h:727
double SupplyVegCover(int a_polyref)
Definition: landscape.h:1048
unsigned int LE_Signal
Definition: elements.h:35
CfgBool l_pest_enable_pesticide_engine
double g_SpeedyDivides[2001]
A generally useful array of fast divide calculators by multiplication.
Definition: Landscape.cpp:250
CfgBool cfg_pesticidemaptype("PEST_MAP_TYPE", CFG_CUSTOM, false)
True for specific pesticide, false for general pesticides.
void ChangeMapMapping(void)
Definition: Landscape.cpp:2130
CfgInt cfg_pesticidemapcellsize("PEST_MAP_CELLSIZE", CFG_CUSTOM, 10)
The output cell size for pesticides - a performance penalty if this does not match the pesticide cell...
Definition: elements.h:1292
Definition: elements.h:1100
static CfgBool l_map_removesmallpolygons("MAP_REMOVESMALLPOLYGONS", CFG_CUSTOM, false)
CfgBool cfg_rodenticide_enable("RODENTICIDE_ENABLE", CFG_CUSTOM, false)
void SetValidXY(int a_valid_x, int a_valid_y)
Definition: elements.h:325
Definition: elements.h:761
RasterMap * m_land
The big map.
Definition: landscape.h:125
bool FindFieldCenter(LE *a_field, int *x, int *y)
Definition: Landscape.cpp:2799
void SetMapValid(bool a_valid)
Definition: elements.h:227
TTypesOfVegetation TranslateVegTypes(int VegReference)
Definition: elements.cpp:3088
Definition: elements.h:1257
std::string EventtypeToString(int a_event)
Definition: Landscape.cpp:3918
A list item entry of field polygon reference numbers with associated openness and goose food scores.
Definition: landscape.h:80
bool m_NeedCentroidCalculation
a flag to ensure centroid calculation on object construction
Definition: landscape.h:146
void ForceArea(void)
Definition: Landscape.cpp:2072
unsigned int FarmAnimalCensus(unsigned int a_farm, unsigned int a_typeofanimal)
Definition: PopulationManager.cpp:1261
void SetPollenNectarData(int a_almasstype)
sets the pollen and nectar information
Definition: elements.cpp:605
Definition: elements.h:1130
Definition: elements.h:1058
void CreatePondList()
Creates a list of pond polygon refs/indexes for easy look up.
Definition: Landscape.cpp:2594
static CfgStr l_map_cropcurves_file("MAP_CROPCURVES_FILE", CFG_CUSTOM, "curves.pre")
double SupplyInsects(int a_polyref)
Definition: landscape.h:1088
Definition: elements.h:861
Polynomial2CurveClass * m_GooseIntakeRateVSVegetationHeight_BG
Definition: landscape.h:161
Definition: elements.h:1221
void BorderRemoval(void)
Definition: Landscape.cpp:2271
bool BeetleBankPossible(LE *a_field, TTypesOfLandscapeElement a_tole)
Definition: Landscape.cpp:2772
Definition: elements.h:81
void CalculateOpenness(bool a_realcalc)
Causes openness to be calulated and stored for all polygons.
Definition: Landscape.cpp:322
Definition: elements.h:914
Definition: elements.h:1274
double SupplyVegHeight(int a_polyref)
Definition: landscape.h:936
static CfgInt l_map_dump_event_y1("MAP_DUMP_EVENT_YA", CFG_CUSTOM, 2909)
CfgBool cfg_dumpvegjune("G_VEGAREASJUNE_ON", CFG_CUSTOM, false)
int le_signal_index
Definition: landscape.h:319
int geese
Definition: landscape.h:83
Definition: elements.h:1040
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
int random(int a_range)
Definition: ALMaSS_CmdLine.cpp:142
std::string vegtypechr
Definition: landscape.h:93
int geesespTimed[gs_foobar]
Definition: landscape.h:86
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
Definition: elements.h:1004
Definition: elements.h:1088
virtual void SetVegPatchy(bool p)
Definition: elements.h:585
static const int version_revision
Definition: Landscape.cpp:51
void PreCachePoly(int a_poly)
Definition: RodenticidePredators.h:60
void DoCopy(const LE *a_Le)
a copy function to be used because a copy constuctor won't work
Definition: elements.cpp:372
Definition: elements.h:843
CfgInt cfg_pesticidemapstartyear("PEST_MAP_STARTYEAR", CFG_CUSTOM, 0)
The first simulation year the pesticide is mapped.
bool BorderTest(int a_fieldpoly, int a_borderpoly, int a_x, int a_y)
Definition: Landscape.cpp:2452
Polynomial2CurveClass * m_GooseIntakeRateVSVegetationHeight_PF
Curve relatning goose intake rates in KJ/min to vegetation height.
Definition: landscape.h:160
Definition: elements.h:833
static CfgInt l_map_chameleon_replace_num("MAP_CHAMELEON_REPLACE_NUM", CFG_CUSTOM, 58)
Definition: elements.h:940
Definition: elements.h:855
double digestability
Definition: landscape.h:95
CfgBool l_map_print_git_version_info("MAP_PRINT_GIT_VERSION_INFO", CFG_CUSTOM, false)
Should git version info be printed to file and console?
CfgInt cfg_productapplicendyear("PEST_PROCTAPPLICENDYEAR", CFG_CUSTOM,-1)
LE * NewElement(TTypesOfLandscapeElement a_type)
Definition: Landscape.cpp:3688
double openness
Definition: landscape.h:88
bool PolysRemoveInvalid(void)
Definition: Landscape.cpp:1772
Definition: elements.h:1136
int m_LargestPolyNumUsed
Definition: landscape.h:194
void SupplyLEReset(void)
Definition: Landscape.cpp:3551
void AxisLoop(int a_poly, int *a_x, int *a_y, int a_axis)
Definition: Landscape.cpp:2938
Definition: elements.h:986
void DumpMapGraphics(const char *a_filename)
Definition: Landscape.cpp:3599
void CentroidSpiralOut(int a_polyref, int &a_x, int &a_y)
Definition: Landscape.cpp:3073
static CfgInt l_map_dump_veg_x("MAP_DUMP_VEG_X", CFG_CUSTOM, 100)
int GetUnsprayedMarginPolyRef(void)
Definition: elements.h:319
CfgStr cfg_dumpvegjanfile("G_VEGAREASJAN_FILENAME", CFG_CUSTOM, "DUMPVEG_JAN.TXT")
static CfgInt cfg_BeetleBankWidth("BBANK_WIDTH", CFG_CUSTOM, 4)
Definition: elements.h:867
void UpdateOsmiaNesting()
Tesll all LE objects to update their osmia nest status.
Definition: landscape.h:856
Definition: elements.h:888
Definition: elements.h:980
static CfgStr l_map_dump_gfx_file("MAP_DUMP_GFX_FILE", CFG_CUSTOM, "dump.ppm")
void SetArea(double a_area)
Definition: elements.h:229
void BuildingDesignationCalc()
used to calculate whether a building is rural or town - for rodenticide use
Definition: Landscape.cpp:3287
int BackTranslateVegTypes(TTypesOfVegetation VegReference)
Definition: elements.cpp:3345
int m_minmaxextent
Definition: landscape.h:142
double g_FarmIntensivenessH
Definition: elements.h:747
static CfgBool l_map_dump_event_enable("MAP_DUMP_EVENT_ENABLE", CFG_CUSTOM, false)
std::vector< GooseFieldListItem > GooseFieldList
A list of GooseFieldListItem s.
Definition: landscape.h:103
LE * GetBorder(void)
Definition: elements.h:317
static const char * version_date
Definition: Landscape.cpp:52
int m_x_add[8]
Definition: landscape.h:266
Population_Manager * m_ThePopManager
a pointer to the current main population manager
Definition: landscape.h:155
int SupplyLastTreatment(int a_polyref, int *a_index)
Definition: landscape.h:1331
static CfgInt l_map_dump_event_x1("MAP_DUMP_EVENT_XA", CFG_CUSTOM, 4287)
int SupplyPolyRefIndex(int a_x, int a_y)
Definition: landscape.h:1493
void PolysValidate(bool a_exit_on_invalid)
Definition: Landscape.cpp:1746
int SupplyLENext(void)
Definition: Landscape.cpp:3555
static const int version_minor
Definition: Landscape.cpp:50
double grain
Definition: landscape.h:89
bool FindValidXY(int a_field, int &a_x, int &a_y)
Definition: Landscape.cpp:2688
void Warn(std::string a_msg1, std::string a_msg2)
Definition: landscape.h:1579
Definition: elements.h:1171
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
int vegphase
Definition: landscape.h:96
TTypesOfPesticide
Definition: landscape.h:65
CfgInt cfg_productapplicstartyear("PEST_PROCTAPPLICSTARTYEAR", CFG_CUSTOM, 9999999)
int m_height10
Definition: landscape.h:141
bool m_NeedOpennessCalculation
a flag to ensure openness calculation on object construction
Definition: landscape.h:148
int SupplyPolyRef(int a_x, int a_y)
Definition: landscape.h:1488
CfgInt cfg_BeetleBankMaxY("BBANK_MAXY", CFG_CUSTOM, 100000)
void EventDump(int x, int y, int x2, int y2)
Definition: Landscape.cpp:1697
int GetValidY(void)
Definition: elements.h:331
void SetMapIndex(int a_map_index)
Definition: elements.h:191
CfgBool cfg_OptimiseBedriftsmodelCrops
double * l_vegtype_areas
Definition: landscape.h:153
int m_y
Definition: ALMaSS_Setup.h:56
long SupplyGlobalDate(void)
Definition: landscape.h:1621
static CfgInt l_map_umargin_width("MAP_UMARGINWIDTH", CFG_CUSTOM, 12)
Definition: elements.h:1094
Definition: elements.h:1046
void SetLESignal(int a_polyref, LE_Signal a_signal)
Definition: Landscape.cpp:3570
double GetRodenticide(unsigned a_x, int a_y)
Return the poisoned mice value at x,y.
Definition: Rodenticide.h:141
void ConsolidatePolys(void)
Definition: Landscape.cpp:1329
CfgInt cfg_BeetleBankMinY("BBANK_MINY", CFG_CUSTOM, 0)