ALMaSS Vole ODDox
1.1
The vole 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.
Definition at line 112 of file Landscape.h.
◆ ~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.
Definition at line 814 of file Landscape.cpp.
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;
874 g_letype =
new LE_TypeClass;
875 cout <<
"Creating PlantGrowthData Object" << endl;
877 cout <<
"Creating PollenNectarDevelopmentData Object" << endl;
878 g_nectarpollen =
new PollenNectarDevelopmentData(
"toleALMaSSNectarPollenInput.txt",
"tovALMaSSNectarPollenInput.txt",
this);
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++) {
919 Pond* pond =
new Pond;
921 pond->SetALMaSSEleType(g_letype->BackTranslateEleTypes(
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++)
944 double area =
m_elems[i]->GetArea();
946 if ((areaMinrect / area > 4) || (area < 1000))
955 wl->SetPoly(
m_elems[i]->GetPoly());
956 wl->SetArea(floor(0.5 + area));
957 wl->SetSoilType(
m_elems[i]->GetSoilType());
958 wl->SetUnsprayedMarginPolyRef(-1);
959 wl->SetCentroid(-1, -1);
968 for (
unsigned int i = 0; i <
m_elems.size(); i++)
974 wl->SetPoly(
m_elems[i]->GetPoly());
975 wl->SetArea(
m_elems[i]->GetArea());
976 wl->SetSoilType(
m_elems[i]->GetSoilType());
977 wl->SetUnsprayedMarginPolyRef(-1);
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++) {
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++) {
1179 m_elems[i]->SetSubType(l_subtype);
1188 for (
unsigned int i = 0; i <
m_elems.size(); i++) {
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++) {
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 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, g_landscape_p, 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(), last_treatment, tole_Field, tole_Freshwater, tole_HedgeBank, tole_Hedges, tole_Missing, tole_Orchard, tole_Pond, tole_Wasteland, tov_Undefined, version_date, version_major, version_minor, and version_revision.
◆ AddBeetleBanks()
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
Definition at line 2723 of file Landscape.cpp.
2737 unsigned sz=(unsigned)
m_elems.size();
2738 for (
unsigned i=0; i<sz; i++)
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 tole_Field.
◆ 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.
Definition at line 2898 of file Landscape.cpp.
2903 int ap1 = a_polyindex;
2904 while (ap1 == a_polyindex)
2906 a_cor->m_x +=
m_x_add[a_axis];
2907 a_cor->m_y +=
m_y_add[a_axis];
2908 if (a_cor->m_x >=
m_width - 1) { a_cor->m_x =
m_width - 1;
return; }
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; }
2912 ap1 =
m_land->Get(a_cor->m_x, a_cor->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.
Definition at line 2938 of file Landscape.cpp.
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.
Definition at line 2917 of file Landscape.cpp.
2922 int ap1 = a_polyindex;
2924 while (ap1 == a_polyindex && count<a_limit)
2926 a_cor->m_x +=
m_x_add[a_axis];
2927 a_cor->m_y +=
m_y_add[a_axis];
2928 if (a_cor->m_x >=
m_width - 1) { a_cor->m_x =
m_width - 1;
return; }
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; }
2932 ap1 =
m_land->Get(a_cor->m_x, a_cor->m_y);
◆ BackTranslateEleTypes()
◆ BackTranslateVegTypes()
Definition at line 1669 of file Landscape.h.
1671 return g_letype->BackTranslateVegTypes( VegReference );
Referenced by NLCatchPeaCrop::Do(), NLMaizeSpring::Do(), DummyCropPestTesting::Do(), PLFodderLucerne2::Do(), NLMaize::Do(), NLBeetSpring::Do(), NLCarrotsSpring::Do(), NLBeet::Do(), NLCarrots::Do(), NLSpringBarleySpring::Do(), NLCabbageSpring::Do(), NLCabbage::Do(), PLCarrots::Do(), NLSpringBarley::Do(), NLWinterWheat::Do(), PLSpringBarleySpr::Do(), PLFodderLucerne1::Do(), PLBeetSpr::Do(), NLPermanentGrassGrazed::Do(), NLGrassGrazed1Spring::Do(), NLGrassGrazed2::Do(), PLBeans::Do(), NLGrassGrazedLast::Do(), NLGrassGrazed1::Do(), NLPotatoesSpring::Do(), PLWinterRye::Do(), NLPotatoes::Do(), PLMaizeSilage::Do(), PLMaize::Do(), PLSpringBarley::Do(), NLTulips::Do(), PLWinterTriticale::Do(), PLSpringWheat::Do(), PLWinterWheat::Do(), PLBeet::Do(), PLWinterWheatLate::Do(), PLWinterBarley::Do(), PLPotatoes::Do(), PLWinterRape::Do(), WinterWheat::Do(), and Vole_Base::Set_VegBorn().
◆ BeetleBankAdd()
◆ BeetleBankPossible()
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
Definition at line 2772 of file Landscape.cpp.
2779 int farea=(int)a_field->GetArea();
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(), and cfg_BeetleBankWidth().
◆ BorderAdd()
Definition at line 2347 of file Landscape.cpp.
2348 int x = a_field->GetValidX();
2349 int y = a_field->GetValidY();
2350 if ( ( x == -1 ) || ( y == -1 ) ) {
2351 g_msg->Warn( WARN_BUG,
"Landscape::BorderAdd(): Uninitialized border coordinate!",
"" );
2355 a_field->SetBorder( border );
2360 border->SetArea( 0.0 );
2361 BorderScan(a_field, g_map_le_borderwidth.value());
References m_polymapping.
◆ BorderNeed()
Definition at line 4529 of file Landscape.cpp.
4530 static char error_num[20];
4531 bool AddBorder =
false;
4605 sprintf(error_num,
"%d", a_letype);
4606 g_msg->Warn(WARN_BUG,
"Landscape::BorderNeed(): Unknown element type:", error_num);
References tole_ActivePit, tole_AmenityGrass, tole_BareRock, tole_BeetleBank, tole_Building, tole_BuiltUpWithParkland, tole_Carpark, tole_Churchyard, tole_Coast, tole_ConiferousForest, tole_Copse, tole_DeciduousForest, tole_Fence, tole_Field, tole_FieldBoundary, tole_FishFarm, tole_Freshwater, tole_Garden, tole_Heath, tole_HedgeBank, tole_Hedges, tole_HeritageSite, tole_IndividualTree, tole_LargeRoad, tole_Marsh, tole_MetalledPath, tole_MixedForest, tole_MownGrass, tole_NaturalGrassDry, tole_NaturalGrassWet, tole_Orchard, tole_OrchardBand, tole_Parkland, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPastureTussocky, tole_PitDisused, tole_PlantNursery, tole_Pond, tole_Pylon, tole_Railway, tole_River, tole_RiversidePlants, tole_RiversideTrees, tole_RoadsideSlope, tole_RoadsideVerge, tole_Saltmarsh, tole_Saltwater, tole_SandDune, tole_Scrub, tole_SmallRoad, tole_StoneWall, tole_Stream, tole_Track, tole_UnsprayedFieldMargin, tole_UrbanNoVeg, tole_UrbanPark, tole_UrbanVeg, tole_Vildtager, tole_WaterBufferZone, tole_WindTurbine, tole_WoodlandMargin, tole_WoodyEnergyCrop, and tole_YoungForest.
◆ BorderRemoval()
void Landscape::BorderRemoval |
( |
void |
| ) |
|
|
protected |
Definition at line 2271 of file Landscape.cpp.
2273 for (
int x=1; x<(
m_width-1); x++)
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 );
References tole_Field, tole_FieldBoundary, tole_HedgeBank, and tole_Hedges.
◆ 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.
Definition at line 2365 of file Landscape.cpp.
2370 LE * border = a_field->GetBorder();
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());
2394 AxisLoop(fieldindex, &coord, random(8));
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);
2403 a_field->AddArea(-1.0);
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);
2411 border->AddArea(1.0);
2412 border->SetMapValid(
true);
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 l_map_exit_on_zero_area(), and m_polymapping.
◆ BorderStep() [1/2]
bool Landscape::BorderStep |
( |
int |
a_fieldpoly, |
|
|
int |
a_borderpoly, |
|
|
APoint * |
a_coord |
|
) |
| |
|
protected |
Definition at line 2537 of file Landscape.cpp.
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];
◆ BorderStep() [2/2]
bool Landscape::BorderStep |
( |
int |
a_fieldpoly, |
|
|
int |
a_borderpoly, |
|
|
int * |
a_x, |
|
|
int * |
a_y |
|
) |
| |
|
protected |
Definition at line 2479 of file Landscape.cpp.
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 |
Definition at line 2452 of file Landscape.cpp.
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 |
( |
| ) |
|
◆ 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.
Definition at line 3040 of file Landscape.cpp.
3047 cout <<
"In Centroid Calculations" << endl;
3049 for (
int p = 0; p< (int)
m_elems.size(); p++)
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
Definition at line 322 of file Landscape.cpp.
327 cout <<
"In CalculateOpenness" << endl;
329 for (
unsigned int i = 0; i <
m_elems.size(); i++)
348 else m_elems[i]->SetOpenness(0);
355 if (a_realcalc) cout << endl;
References tole_Field, tole_Marsh, tole_NaturalGrassDry, tole_NaturalGrassWet, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPastureTussocky, and tole_Scrub.
◆ 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.
Definition at line 401 of file Landscape.cpp.
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.
Definition at line 359 of file Landscape.cpp.
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 |
|
) |
| |
Definition at line 3073 of file Landscape.cpp.
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.
Definition at line 2130 of file Landscape.cpp.
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()
Check if needed and record pesticide application.
Definition at line 669 of file Landscape.cpp.
References cfg_pesticidemapon(), cfg_pesticidemaptype(), insecticide, and testpesticide.
Referenced by Farm::FungicideTreat(), OptimisingFarm::FungicideTreat(), Farm::HerbicideTreat(), OptimisingFarm::HerbicideTreat(), Farm::InsecticideTreat(), OptimisingFarm::InsecticideTreat(), Farm::Molluscicide(), and Farm::ProductApplication().
◆ 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.
Definition at line 1329 of file Landscape.cpp.
1336 const int TypesToReplace = 16;
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, tole_BareRock, tole_BuiltUpWithParkland, tole_Carpark, tole_Churchyard, tole_Coast, tole_Garden, tole_HeritageSite, tole_IndividualTree, tole_PlantNursery, tole_River, tole_RiversidePlants, tole_RiversideTrees, tole_Saltwater, tole_SandDune, tole_StoneWall, and tole_UrbanNoVeg.
◆ CorrectCoords()
void Landscape::CorrectCoords |
( |
int & |
x, |
|
|
int & |
y |
|
) |
| |
|
inline |
◆ 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
Definition at line 1555 of file Landscape.h.
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, and m_width.
◆ CorrectCoordsPt()
APoint Landscape::CorrectCoordsPt |
( |
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.
Definition at line 1544 of file Landscape.h.
References m_height, m_height10, m_width, and m_width10.
◆ CorrectHeight()
int Landscape::CorrectHeight |
( |
int |
y | ) |
|
|
inline |
◆ CorrectWidth()
int Landscape::CorrectWidth |
( |
int |
x | ) |
|
|
inline |
◆ CountMapSquares()
void Landscape::CountMapSquares |
( |
void |
| ) |
|
|
protected |
Definition at line 2040 of file Landscape.cpp.
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
Definition at line 2594 of file Landscape.cpp.
2597 for (
unsigned int i = 0; i <
m_elems.size(); i++)
References tole_Pond.
◆ DegreesDump()
void Landscape::DegreesDump |
( |
| ) |
|
|
protected |
◆ DumpAllSymbolsAndExit()
void Landscape::DumpAllSymbolsAndExit |
( |
const char * |
a_dumpfile | ) |
|
|
inline |
Definition at line 785 of file Landscape.h.
786 g_cfg->DumpAllSymbolsAndExit( a_dumpfile );
◆ DumpCentroids()
void Landscape::DumpCentroids |
( |
void |
| ) |
|
Definition at line 3275 of file Landscape.cpp.
3277 ofstream centroidfile(
"PolygonCentroids.txt", ios::out);
3278 centroidfile<<
"Polyref"<<
'\t'<<
"CX"<<
'\t'<<
"CY"<<
'\t'<<
"Type"<<
'\t'<<
"Area"<<
'\t'<<
"Country Designation"<<endl;
3279 for (
int p = 0; p< (int)
m_elems.size(); p++)
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 |
Definition at line 1386 of file Landscape.cpp.
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 |
Definition at line 3599 of file Landscape.cpp.
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;
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);
References tole_Field.
◆ DumpMapInfoByArea()
void Landscape::DumpMapInfoByArea |
( |
const char * |
a_filename, |
|
|
bool |
a_append, |
|
|
bool |
a_dump_zero_areas, |
|
|
bool |
a_write_veg_names |
|
) |
| |
Definition at line 3652 of file Landscape.cpp.
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);
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)
3680 fprintf(outf,
"\n");
References tov_OFirstYearDanger, and tov_Undefined.
◆ DumpPublicSymbols()
void Landscape::DumpPublicSymbols |
( |
const char * |
a_dumpfile, |
|
|
CfgSecureLevel |
a_level |
|
) |
| |
|
inline |
Definition at line 781 of file Landscape.h.
783 g_cfg->DumpPublicSymbols( a_dumpfile, a_level );
◆ DumpTreatCounters()
void Landscape::DumpTreatCounters |
( |
const char * |
a_filename | ) |
|
|
protected |
Definition at line 3586 of file Landscape.cpp.
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);
References last_treatment, and start.
◆ DumpVegAreaData()
void Landscape::DumpVegAreaData |
( |
int |
a_day | ) |
|
◆ EventDump()
void Landscape::EventDump |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
x2, |
|
|
int |
y2 |
|
) |
| |
|
protected |
Definition at line 1697 of file Landscape.cpp.
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" );
References sleep_all_day.
◆ EventDumpPesticides()
void Landscape::EventDumpPesticides |
( |
int |
x1, |
|
|
int |
y1 |
|
) |
| |
|
protected |
Definition at line 1720 of file Landscape.cpp.
1721 FILE * vfile=fopen(
"EventDump.txt",
"a" );
1723 g_msg->Warn( WARN_FILE,
"Landscape::EventDump(): Unable to open file",
"EventDump.txt" );
1740 if (herb+fung+ins >0 ) fprintf( vfile,
"%d\t%d\t%d\t%d\n", day, herb, fung, ins );
References fungicide_treat, herbicide_treat, insecticide_treat, and sleep_all_day.
◆ EventtypeToString()
std::string Landscape::EventtypeToString |
( |
int |
a_event | ) |
|
Definition at line 3918 of file Landscape.cpp.
3925 return " sleep_all_day";
3927 return " autumn_plough";
3929 return " stubble_plough";
3931 return " stubble_cultivator_heavy";
3933 return " heavy_cultivator_aggregate";
3935 return " autumn_harrow";
3937 return " preseeding_cultivator";
3939 return " preseeding_cultivator_sow";
3941 return " autumn_roll";
3943 return " autumn_sow";
3945 return " winter_plough";
3947 return " deep_ploughing";
3949 return " spring_plough";
3951 return " spring_harrow";
3953 return " spring_roll";
3955 return " spring_sow";
3957 return " spring_sow_with_ferti";
3965 return " fp_liquidNH3";
3967 return " fp_slurry";
3969 return " fp_ammoniumsulphate";
3971 return " fp_manganesesulphate";
3973 return " fp_manure";
3975 return " fp_greenmanure";
3977 return " fp_sludge";
3981 return " fp_calcium";
3987 return " fa_slurry";
3989 return " fa_ammoniumsulphate";
3991 return " fa_manganesesulphate";
3993 return " fa_manure";
3995 return " fa_greenmanure";
3997 return " fa_sludge";
4001 return " fa_calcium";
4003 return " herbicide_treat";
4005 return " growth_regulator";
4007 return " fungicide_treat";
4009 return " insecticide_treat";
4011 return "pesticide_product_treat";
4013 return " syninsecticide_treat";
4015 return " molluscicide";
4017 return " row_cultivation";
4019 return " strigling";
4021 return " flammebehandling";
4023 return " hilling_up";
4031 return " cattle_out";
4035 return " cut_to_hay";
4037 return " cut_to_silage";
4039 return " straw_chopping";
4041 return " hay_turning";
4043 return " hay_bailing";
4045 return " stubble_harrowing";
4047 return "autumn_or_spring_plough";
4049 return " burn_straw_stubble";
4053 return " cut_weeds";
4055 return " strigling_sow";
4057 return "PesticideTrialTreatment";
4059 return " PesticideTrialToxic";
4061 return " PesticideTrialControl";
4063 return " Glyphosate on setaside";
4067 return " strigling_hill";
4069 return " bed_forming";
4071 return " flower_cutting";
4073 return " bulb_harvest";
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);
References autumn_harrow, autumn_or_spring_plough, autumn_plough, autumn_roll, autumn_sow, bed_forming, biocide, bulb_harvest, burn_straw_stubble, cattle_out, cut_to_hay, cut_to_silage, cut_weeds, deep_ploughing, fa_ammoniumsulphate, fa_calcium, fa_greenmanure, fa_manganesesulphate, fa_manure, fa_npk, fa_pk, fa_rsm, fa_sludge, fa_slurry, flammebehandling, flower_cutting, fp_ammoniumsulphate, fp_calcium, fp_greenmanure, fp_liquidNH3, fp_manganesesulphate, fp_manure, fp_npk, fp_npks, fp_pk, fp_rsm, fp_sludge, fp_slurry, fungicide_treat, glyphosate, growth_regulator, harvest, hay_bailing, hay_turning, heavy_cultivator_aggregate, herbicide_treat, hilling_up, insecticide_treat, molluscicide, mow, pigs_out, preseeding_cultivator, preseeding_cultivator_sow, product_treat, row_cultivation, sleep_all_day, spring_harrow, spring_plough, spring_roll, spring_sow, spring_sow_with_ferti, start, straw_chopping, straw_covering, straw_removal, strigling, strigling_hill, strigling_sow, stubble_cultivator_heavy, stubble_harrowing, stubble_plough, swathing, syninsecticide_treat, trial_control, trial_insecticidetreat, trial_toxiccontrol, water, and winter_plough.
Referenced by Vole_JuvenileMale::OnFarmEvent(), and Vole_JuvenileFemale::OnFarmEvent().
◆ FillVegAreaData()
void Landscape::FillVegAreaData |
( |
| ) |
|
◆ FindFieldCenter()
bool Landscape::FindFieldCenter |
( |
LE * |
a_field, |
|
|
int * |
x, |
|
|
int * |
y |
|
) |
| |
|
protected |
Definition at line 2799 of file Landscape.cpp.
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) {
◆ FindLongestAxis()
int Landscape::FindLongestAxis |
( |
int * |
x, |
|
|
int * |
y, |
|
|
int * |
a_length |
|
) |
| |
|
protected |
Definition at line 2851 of file Landscape.cpp.
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 |
Definition at line 2688 of file Landscape.cpp.
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 |
Definition at line 2072 of file Landscape.cpp.
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
Definition at line 607 of file Landscape.h.
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
Definition at line 596 of file Landscape.h.
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.
Definition at line 685 of file Landscape.cpp.
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 | ) |
|
◆ 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.
Definition at line 3397 of file Landscape.cpp.
◆ GetHareFoodQuality()
double Landscape::GetHareFoodQuality |
( |
int |
a_polygon | ) |
|
- Todo:
- Decide where to classify new LE types for hare 1
Definition at line 3403 of file Landscape.cpp.
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, g_VegHeightForageReduction, tole_ActivePit, tole_AmenityGrass, tole_BareRock, tole_Building, tole_BuiltUpWithParkland, tole_Carpark, tole_Churchyard, tole_Coast, tole_ConiferousForest, tole_Copse, tole_DeciduousForest, tole_Fence, tole_FishFarm, tole_Freshwater, tole_Garden, tole_Hedges, tole_HeritageSite, tole_IndividualTree, tole_LargeRoad, tole_Marsh, tole_MetalledPath, tole_MixedForest, tole_Parkland, tole_PitDisused, tole_PlantNursery, tole_Pond, tole_Pylon, tole_Railway, tole_River, tole_RiversidePlants, tole_RiversideTrees, tole_RoadsideVerge, tole_Saltwater, tole_SandDune, tole_Scrub, tole_SmallRoad, tole_StoneWall, tole_Stream, tole_Track, tole_UrbanNoVeg, tole_UrbanPark, tole_Vildtager, tole_Wasteland, tole_WindTurbine, tole_WoodlandMargin, and tole_WoodyEnergyCrop.
◆ 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.
Definition at line 3390 of file Landscape.cpp.
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 |
Definition at line 3507 of file Landscape.cpp.
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 |
◆ 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 | ) |
|
Definition at line 3575 of file Landscape.cpp.
3578 sprintf(errornum,
"%d", a_treat);
3579 g_msg->Warn(WARN_BUG,
"Landscape::IncTreatCounter(): Index"" out of range!", errornum);
References last_treatment.
◆ 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
Definition at line 4697 of file Landscape.cpp.
4700 array<int, tole_Foobar> tole_ref;
4701 array<double, tole_Foobar> maxOsmiaNests;
4702 array<double, tole_Foobar> minOsmiaNests;
4704 if (!ifile.is_open()) {
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(), g_rand_uni(), and tole_Foobar.
◆ IsFieldType()
◆ 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
Definition at line 461 of file Landscape.cpp.
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;
481 x = (int) (a_cx + a_offsetx * (counter+1));
482 y = (int) (a_cy + a_offsety * (counter+1));
References tole_HedgeBank, tole_LargeRoad, and tole_SmallRoad.
◆ MagicMapP2PolyRef()
int Landscape::MagicMapP2PolyRef |
( |
int |
a_magic | ) |
|
|
inline |
◆ NewElement()
Definition at line 3688 of file Landscape.cpp.
3690 static char error_num[20];
3697 elem =
new HedgeBank;
3700 elem =
new BeetleBank;
3703 elem =
new RoadsideVerge;
3709 elem =
new FieldBoundary;
3718 elem =
new OrchardBand;
3721 elem =
new MownGrass;
3733 elem =
new PermanentSetaside;
3736 elem =
new PermPasture;
3739 elem =
new PermPastureLowYield;
3742 elem =
new PermPastureTussocky;
3745 elem =
new NaturalGrassDry;
3748 elem =
new NaturalGrassDry;
3751 elem =
new RiversidePlants;
3754 elem =
new PitDisused;
3757 elem =
new RiversideTrees;
3760 elem =
new DeciduousForest;
3763 elem =
new MixedForest;
3766 elem =
new YoungForest;
3769 elem =
new ConiferousForest;
3772 elem =
new StoneWall;
3784 elem =
new SmallRoad;
3787 elem =
new LargeRoad;
3790 elem =
new Building;
3793 elem =
new ActivePit;
3796 elem =
new Freshwater;
3805 elem =
new Saltwater;
3811 elem =
new BareRock;
3814 elem =
new AmenityGrass;
3817 elem =
new Parkland;
3820 elem =
new UrbanNoVeg;
3823 elem =
new UrbanPark;
3826 elem =
new BuiltUpWithParkland;
3829 elem =
new SandDune;
3835 elem =
new RoadsideSlope;
3838 elem =
new MetalledPath;
3844 elem =
new Churchyard;
3847 elem =
new NaturalGrassWet;
3850 elem =
new Saltmarsh;
3856 elem =
new HeritageSite;
3859 elem =
new UnsprayedFieldMargin;
3862 elem =
new Wasteland;
3865 elem =
new IndividualTree;
3868 elem =
new PlantNursery;
3871 elem =
new Vildtager;
3874 elem =
new WindTurbine;
3877 elem =
new WoodyEnergyCrop;
3880 elem =
new WoodlandMargin;
3886 elem =
new FishFarm;
3892 elem =
new ChameleonLE;
3895 elem =
new DrainageDitch;
3898 elem =
new UrbanVeg;
3901 elem =
new WaterBufferZone;
3907 sprintf(error_num,
"%d", a_type);
3908 g_msg->Warn(WARN_FILE,
"Landscape::NewElement(): Unknown landscape element requested:", error_num);
3912 elem->SetALMaSSEleType(g_letype->BackTranslateEleTypes(a_type));
3913 elem->SetElementType(a_type);
3914 elem->SetPollenNectarData(g_letype->BackTranslateEleTypes(a_type));
References tole_ActivePit, tole_AmenityGrass, tole_BareRock, tole_BeetleBank, tole_Building, tole_BuiltUpWithParkland, tole_Canal, tole_Carpark, tole_Chameleon, tole_Churchyard, tole_Coast, tole_ConiferousForest, tole_Copse, tole_DeciduousForest, tole_DrainageDitch, tole_Fence, tole_Field, tole_FieldBoundary, tole_FishFarm, tole_Freshwater, tole_Garden, tole_Heath, tole_HedgeBank, tole_Hedges, tole_HeritageSite, tole_IndividualTree, tole_LargeRoad, tole_Marsh, tole_MetalledPath, tole_Missing, tole_MixedForest, tole_MownGrass, tole_NaturalGrassDry, tole_NaturalGrassWet, tole_Orchard, tole_OrchardBand, tole_Parkland, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPastureTussocky, tole_PitDisused, tole_PlantNursery, tole_Pond, tole_Pylon, tole_Railway, tole_River, tole_RiversidePlants, tole_RiversideTrees, tole_RoadsideSlope, tole_RoadsideVerge, tole_Saltmarsh, tole_Saltwater, tole_SandDune, tole_Scrub, tole_SmallRoad, tole_StoneWall, tole_Stream, tole_Track, tole_UnknownGrass, tole_UnsprayedFieldMargin, tole_UrbanNoVeg, tole_UrbanPark, tole_UrbanVeg, tole_Vildtager, tole_Wasteland, tole_WaterBufferZone, tole_WindTurbine, tole_WoodlandMargin, tole_WoodyEnergyCrop, and tole_YoungForest.
◆ PolysDump()
void Landscape::PolysDump |
( |
const char * |
a_filename | ) |
|
|
protected |
Definition at line 1803 of file Landscape.cpp.
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
Definition at line 1772 of file Landscape.cpp.
1777 bool didsomething =
false;
1778 vector < LE * > l_temp;
1779 cout <<
"Tidying up the polygon map in PolysRemoveInvalid" << endl;
1780 unsigned int sz= (int)
m_elems.size();
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 |
Definition at line 2057 of file Landscape.cpp.
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 |
Definition at line 1746 of file Landscape.cpp.
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()
Definition at line 4087 of file Landscape.cpp.
4090 switch (a_le_type) {
4094 return " Roadside Verge";
4098 return " Field Boundary";
4106 return " PermPastureTussocky";
4108 return " Permanent Setaside";
4110 return " Permanent Pasture";
4112 return " PermPastureLowYield";
4114 return " Natural Grass";
4116 return " Natural Grass Wet";
4118 return " Riverside Plants";
4120 return " Pit Disused";
4122 return " Riverside Trees";
4124 return " Deciduous Forest";
4126 return " Mixed Forest";
4128 return " Coniferous Forest";
4130 return " Young Forest";
4132 return " Stone Wall";
4138 return " Small Road";
4140 return " Large Road";
4144 return " Active Pit";
4148 return " Fresh Water";
4152 return " Saltwater";
4156 return " Bare Rock";
4158 return " Hedgebank";
4164 return " Orchard Band";
4166 return " Mown Grass";
4168 return " UnsprayedFieldMargin";
4170 return " AmenityGrass";
4174 return " UrbanNoVeg";
4178 return " UrbanPark";
4180 return " BuiltUpWithParkland";
4186 return " RoadsideSlope";
4188 return " MetalledPath";
4192 return " Churchyard";
4194 return " Saltmarsh";
4198 return " HeritageSite";
4200 return " Beetle Bank";
4202 return " Unknown Grass";
4204 return " Waste/Building Land";
4206 return " IndividualTree";
4208 return " PlantNursery";
4210 return " Vildtager";
4212 return " WindTurbine";
4214 return " WoodyEnergyCrop";
4216 return " WoodlandMargin";
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);
References tole_ActivePit, tole_AmenityGrass, tole_BareRock, tole_BeetleBank, tole_Building, tole_BuiltUpWithParkland, tole_Carpark, tole_Churchyard, tole_Coast, tole_ConiferousForest, tole_Copse, tole_DeciduousForest, tole_Fence, tole_Field, tole_FieldBoundary, tole_FishFarm, tole_Foobar, tole_Freshwater, tole_Garden, tole_Heath, tole_HedgeBank, tole_Hedges, tole_HeritageSite, tole_IndividualTree, tole_LargeRoad, tole_Marsh, tole_MetalledPath, tole_MixedForest, tole_MownGrass, tole_NaturalGrassDry, tole_NaturalGrassWet, tole_Orchard, tole_OrchardBand, tole_Parkland, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPastureTussocky, tole_PitDisused, tole_PlantNursery, tole_Pond, tole_Pylon, tole_Railway, tole_River, tole_RiversidePlants, tole_RiversideTrees, tole_RoadsideSlope, tole_RoadsideVerge, tole_Saltmarsh, tole_Saltwater, tole_SandDune, tole_Scrub, tole_SmallRoad, tole_StoneWall, tole_Stream, tole_Track, tole_UnknownGrass, tole_UnsprayedFieldMargin, tole_UrbanNoVeg, tole_UrbanPark, tole_UrbanVeg, tole_Vildtager, tole_Wasteland, tole_WaterBufferZone, tole_WindTurbine, tole_WoodlandMargin, tole_WoodyEnergyCrop, and tole_YoungForest.
◆ 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.
Definition at line 1892 of file Landscape.cpp.
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;
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)
1960 Type = g_letype->TranslateEleTypes(PolyType);
1971 m_elems[ElemIndex++] = newland;
1972 newland->SetPoly(PolyNum);
1973 newland->SetMapIndex(PolyNum);
1974 newland->SetArea(floor(0.5 + Area));
1975 newland->SetALMaSSEleType(RealPolyType);
1976 newland->SetSoilType(SoilType);
1977 newland->SetUnsprayedMarginPolyRef(URef);
1978 newland->SetCentroid(Centroid_x,Centroid_y);
1979 newland->SetOpenness(openness);
1990 sprintf(error_num,
"%d", PolyNum);
1991 g_msg->Warn(WARN_FILE,
"Landscape::ReadPolys(): Farm polygon does not belong to a farm:", error_num);
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())
2010 newland->SetBorder((LE *)1);
2016 if (g_map_le_unsprayedmargins.value())
2018 if (random(100) < g_map_le_unsprayedmargins_chance.value())
2021 newland->SetUnsprayedMarginPolyRef(1);
2029 sprintf(error_num,
"%d", PolyNum);
2030 g_msg->Warn(WARN_FILE,
"Landscape::ReadPolys(): Duplicate polygon in file", error_num);
References l_map_chameleon_replace_num(), m_polymapping, tole_Field, tole_Missing, tole_Orchard, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPastureTussocky, tole_PlantNursery, tole_Vildtager, tole_WoodyEnergyCrop, and tole_YoungForest.
◆ ReadSymbols()
bool Landscape::ReadSymbols |
( |
const char * |
a_cfgfile | ) |
|
|
inline |
Definition at line 788 of file Landscape.h.
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
Definition at line 3328 of file Landscape.cpp.
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()
Definition at line 3341 of file Landscape.cpp.
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.
Definition at line 3373 of file Landscape.cpp.
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
Definition at line 3352 of file Landscape.cpp.
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()
Definition at line 3363 of file Landscape.cpp.
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.
Definition at line 2090 of file Landscape.cpp.
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, and tole_Missing.
◆ 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
Definition at line 2184 of file Landscape.cpp.
2205 for (
int i = 0; i <
m_elems.size(); i++)
2208 int area = int(
m_elems[i]->GetArea());
2234 APoint pt =
m_elems[i]->GetCentroid();
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);
2255 NaturalGrassDry* grass =
new NaturalGrassDry;
2259 grass->SetOwner(NULL,-1,-1);
2261 m_elems[i] = dynamic_cast<LE*>(grass);
References tole_Fence, tole_Field, tole_FieldBoundary, tole_HedgeBank, tole_Hedges, tole_IndividualTree, tole_MetalledPath, tole_NaturalGrassDry, tole_River, tole_RiversidePlants, tole_RiversideTrees, tole_RoadsideSlope, tole_RoadsideVerge, tole_SmallRoad, tole_StoneWall, tole_Stream, tole_Track, tole_UnsprayedFieldMargin, and tole_WaterBufferZone.
◆ 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.
Definition at line 730 of file Landscape.cpp.
736 for (
unsigned int i = 0; i <
m_elems.size(); i++)
◆ RodenticidePredatorsEvaluation()
void Landscape::RodenticidePredatorsEvaluation |
( |
RodenticidePredators_Population_Manager * |
a_rppm | ) |
|
◆ SetBirdMaizeForage()
void Landscape::SetBirdMaizeForage |
( |
int |
a_polyref, |
|
|
double |
a_fooddensity |
|
) |
| |
|
inline |
◆ SetBirdSeedForage()
void Landscape::SetBirdSeedForage |
( |
int |
a_polyref, |
|
|
double |
a_fooddensity |
|
) |
| |
|
inline |
◆ 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.
Definition at line 349 of file Landscape.h.
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 |
| ) |
|
Definition at line 1622 of file Landscape.cpp.
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()
◆ SimulationClosingActions()
void Landscape::SimulationClosingActions |
( |
| ) |
|
These are the things that are needed to be done after the simulation ends, but before landscape objects are deleted.
Definition at line 1455 of file Landscape.cpp.
References cfg_OptimisingFarms.
◆ SkylarkEvaluation()
void Landscape::SkylarkEvaluation |
( |
SkTerritories * |
a_skt | ) |
|
◆ StepOneValid()
bool Landscape::StepOneValid |
( |
int |
a_polyindex, |
|
|
int |
a_x, |
|
|
int |
a_y, |
|
|
int |
step |
|
) |
| |
|
protected |
Definition at line 2429 of file Landscape.cpp.
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.
Definition at line 664 of file Landscape.cpp.
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.
Definition at line 640 of file Landscape.h.
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 |
◆ SupplyCentroid()
APoint Landscape::SupplyCentroid |
( |
int |
a_polyref | ) |
|
◆ SupplyCentroidIndex()
APoint Landscape::SupplyCentroidIndex |
( |
int |
a_polyrefindex | ) |
|
◆ 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 |
◆ SupplyDayInYear()
int Landscape::SupplyDayInYear |
( |
void |
| ) |
|
|
inline |
Definition at line 1596 of file Landscape.h.
1598 return g_date->DayInYear();
Referenced by Weasel::BeginStep(), Owl::BeginStep(), Vole_Population_Manager::Catastrophe(), Vole_Population_Manager::DoFirst(), Vole_JuvenileMale::EndStep(), Vole_Male::EndStep(), Vole_JuvenileFemale::EndStep(), FarmManager::FarmManagement(), Vole_Population_Manager::GeneticsOutputFile(), VoleSummaryOutput::OPrint(), TPredator_Population_Manager::PredAutumnSample(), TPredator_Population_Manager::PredSampleFile(), TPredator_Population_Manager::PredSpringAutumnSample(), TPredator_Population_Manager::PredSpringSample(), Vole_Population_Manager::ResistanceOutput(), TPredator_Population_Manager::Run(), Vole_Female::st_GiveBirth(), Vole_Male::st_Maturation(), Vole_Population_Manager::TheAgeSexLocationProbe(), Vole_Population_Manager::TheReallyBigOutputProbe(), and Vole_Population_Manager::TheSexRatiosProbe().
◆ SupplyDaylength() [1/2]
int Landscape::SupplyDaylength |
( |
long |
a_date | ) |
|
|
inline |
Definition at line 1523 of file Landscape.h.
1525 return g_date->DayLength( a_date );
◆ SupplyDaylength() [2/2]
int Landscape::SupplyDaylength |
( |
void |
| ) |
|
|
inline |
Definition at line 1530 of file Landscape.h.
1532 return g_date->DayLength();
◆ SupplyDaylightProp()
double Landscape::SupplyDaylightProp |
( |
| ) |
|
|
inline |
Definition at line 825 of file Landscape.h.
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]
Definition at line 1110 of file Landscape.h.
References m_elems, and m_polymapping.
Referenced by Vole_Population_Manager::BarrierSearch(), Vole_Base::CheckTraps(), Vole_Base::CopyMyself(), Vole_Population_Manager::GeneticsOutputFile(), TPredator_Population_Manager::PredSampleFile(), Vole_Base::Set_ElemBorn(), Vole_JuvenileMale::st_BecomeSubAdult(), Vole_JuvenileFemale::st_BecomeSubAdult(), Vole_Female::st_Lactating(), Vole_Population_Manager::SuitableStartingLocation(), Vole_Base::SupplyElemType(), and Vole_Population_Manager::TheReallyBigOutputProbe().
◆ SupplyElementType() [2/2]
◆ SupplyElementTypeCC()
◆ SupplyElementTypeFromVector()
◆ 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 | ) |
|
◆ SupplyFarmManagerPtr()
◆ 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]
◆ SupplyFarmType() [2/2]
◆ SupplyGlobalDate()
long Landscape::SupplyGlobalDate |
( |
void |
| ) |
|
|
inline |
◆ SupplyGlobalRadiation() [1/2]
double Landscape::SupplyGlobalRadiation |
( |
| ) |
|
|
inline |
Definition at line 1341 of file Landscape.h.
1343 return g_weather->GetGlobalRadiation( );
◆ SupplyGlobalRadiation() [2/2]
double Landscape::SupplyGlobalRadiation |
( |
long |
a_date | ) |
|
|
inline |
Definition at line 1346 of file Landscape.h.
1348 return g_weather->GetGlobalRadiation( a_date );
◆ SupplyGooseGrazingForageH() [1/2]
double Landscape::SupplyGooseGrazingForageH |
( |
double |
a_height, |
|
|
GooseSpecies |
a_goose |
|
) |
| |
|
inline |
Returns the leaf forage resource as seen from a goose standpoint at a polygon based on the height only.
- Parameters
-
a_height | [in] The vegetation height (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
Definition at line 541 of file Landscape.h.
548 if (a_goose == gs_Pinkfoot)
552 if (a_goose == gs_Barnacle)
554 if (a_height == 0.0)
return 0.0;
557 if (a_goose == gs_Greylag)
561 Warn(
"Landscape::SupplyGooseGrazingForage",
"Unknown Goose Type");
References m_GooseIntakeRateVSVegetationHeight_BG, m_GooseIntakeRateVSVegetationHeight_GL, m_GooseIntakeRateVSVegetationHeight_PF, and Warn().
◆ 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
Definition at line 567 of file Landscape.h.
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 |
◆ 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.
Definition at line 1586 of file Landscape.h.
1587 return g_date->GetHour();
◆ SupplyHumidity()
double Landscape::SupplyHumidity |
( |
void |
| ) |
|
|
inline |
Definition at line 1393 of file Landscape.h.
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()
Definition at line 532 of file Landscape.cpp.
581 default:
return false;
References tov_AgroChemIndustryCereal, tov_NLSpringBarley, tov_NLWinterWheat, tov_Oats, tov_OOats, tov_OSpringBarley, tov_OSpringBarleyClover, tov_OSpringBarleyExt, tov_OSpringBarleyGrass, tov_OSpringBarleyPigs, tov_OTriticale, tov_OWinterBarley, tov_OWinterBarleyExt, tov_OWinterRye, tov_OWinterWheat, tov_OWinterWheatUndersown, tov_PLSpringBarley, tov_PLSpringWheat, tov_PLWinterBarley, tov_PLWinterRye, tov_PLWinterTriticale, tov_PLWinterWheat, tov_SpringBarley, tov_SpringBarleyCloverGrass, tov_SpringBarleyGrass, tov_SpringBarleyPeaCloverGrassStrigling, tov_SpringBarleyPTreatment, tov_SpringBarleySeed, tov_SpringBarleySKManagement, tov_SpringBarleySpr, tov_SpringBarleyStrigling, tov_SpringBarleyStriglingCulm, tov_SpringBarleyStriglingSingle, tov_SpringWheat, tov_Triticale, tov_WinterBarley, tov_WinterRye, tov_WinterWheat, tov_WinterWheatStrigling, tov_WinterWheatStriglingCulm, tov_WinterWheatStriglingSingle, tov_WWheatPControl, tov_WWheatPToxicControl, and tov_WWheatPTreatment.
◆ SupplyIsGrass()
bool Landscape::SupplyIsGrass |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyIsGrass2()
Definition at line 503 of file Landscape.cpp.
527 default:
return false;
References tov_CloverGrassGrazed1, tov_CloverGrassGrazed2, tov_FodderGrass, tov_Heath, tov_NaturalGrass, tov_OCloverGrassGrazed1, tov_OCloverGrassGrazed2, tov_OrchardCrop, tov_OSeedGrass1, tov_OSeedGrass2, tov_PermanentGrassGrazed, tov_PermanentGrassLowYield, tov_PermanentGrassTussocky, tov_PermanentSetaside, tov_SeedGrass1, tov_SeedGrass2, tov_Setaside, tov_WaterBufferZone, and tov_YoungForest.
◆ 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 |
◆ 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!
Definition at line 782 of file Landscape.cpp.
793 unsigned sz = (unsigned)
m_elems.size();
794 for (
unsigned i=0; i<sz; i++)
796 if (
m_elems[i]->GetOpenness() > a_openness)
798 APoint pt =
m_elems[i]->GetCentroid();
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());
◆ SupplyLargestPolyNumUsed()
int Landscape::SupplyLargestPolyNumUsed |
( |
| ) |
|
|
inline |
◆ SupplyLastSownVeg() [1/2]
◆ SupplyLastSownVeg() [2/2]
◆ SupplyLastSownVegVector()
◆ 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.
Definition at line 455 of file Landscape.h.
References m_elems, and m_land.
◆ SupplyLENext()
int Landscape::SupplyLENext |
( |
void |
| ) |
|
◆ SupplyLEPointer()
LE * Landscape::SupplyLEPointer |
( |
int |
a_polyref | ) |
|
|
inline |
Definition at line 1099 of file Landscape.h.
References m_elems, and m_polymapping.
Referenced by Farm::AutumnHarrow(), Farm::AutumnPlough(), Farm::AutumnRoll(), Farm::AutumnSow(), Farm::BedForming(), Farm::Biocide(), Farm::BulbHarvest(), Farm::BurnStrawStubble(), Farm::CattleIsOut(), Farm::CattleIsOutLow(), Farm::CattleOut(), Farm::CattleOutLowGrazing(), Farm::CutOrch(), Farm::CutToHay(), Farm::CutToSilage(), Farm::CutWeeds(), Farm::DeepPlough(), Farm::FA_AmmoniumSulphate(), Farm::FA_Calcium(), Farm::FA_GreenManure(), Farm::FA_ManganeseSulphate(), Farm::FA_Manure(), Farm::FA_NPK(), Farm::FA_NPKS(), Farm::FA_PK(), Farm::FA_RSM(), Farm::FA_Sludge(), Farm::FA_Slurry(), Farm::FlowerCutting(), Farm::FP_AmmoniumSulphate(), Farm::FP_Calcium(), Farm::FP_GreenManure(), Farm::FP_LiquidNH3(), Farm::FP_ManganeseSulphate(), Farm::FP_Manure(), Farm::FP_NPK(), Farm::FP_NPKS(), Farm::FP_PK(), Farm::FP_RSM(), Farm::FP_Sludge(), Farm::FP_Slurry(), Farm::Harvest(), OptimisingFarm::Harvest(), Farm::HarvestLong(), Farm::HayBailing(), Farm::HayTurning(), Farm::HeavyCultivatorAggregate(), Farm::HillingUp(), Farm::PigsAreOut(), Farm::PigsAreOutForced(), Farm::PigsOut(), Farm::PreseedingCultivator(), Farm::PreseedingCultivatorSow(), Farm::RowCultivation(), Farm::ShallowHarrow(), Farm::SleepAllDay(), Farm::SpringHarrow(), Farm::SpringPlough(), Farm::SpringRoll(), Farm::SpringSow(), Farm::SpringSowWithFerti(), Farm::StrawChopping(), Farm::StrawCovering(), Farm::StrawRemoval(), Farm::Strigling(), Farm::StriglingHill(), Farm::StriglingSow(), Farm::StubbleCultivatorHeavy(), Farm::StubbleHarrowing(), Farm::StubblePlough(), Farm::Swathing(), UnsprayedMarginScan(), Farm::Water(), and Farm::WinterPlough().
◆ SupplyLEReset()
void Landscape::SupplyLEReset |
( |
void |
| ) |
|
◆ SupplyLESignal()
LE_Signal Landscape::SupplyLESignal |
( |
int |
a_polyref | ) |
|
◆ SupplyMagicMapP()
int * Landscape::SupplyMagicMapP |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyMaleNewtPresent()
bool Landscape::SupplyMaleNewtPresent |
( |
int |
a_InPondIndex | ) |
|
|
inline |
Determines if a male is present in a pond.
Definition at line 351 of file Landscape.h.
351 {
return m_elems[a_InPondIndex]->IsMaleNewtPresent(); }
References m_elems.
◆ SupplyMeanTemp()
double Landscape::SupplyMeanTemp |
( |
long |
a_date, |
|
|
unsigned int |
a_period |
|
) |
| |
|
inline |
◆ SupplyMinute()
int Landscape::SupplyMinute |
( |
void |
| ) |
|
|
inline |
Get the minute of the hour.
Definition at line 1592 of file Landscape.h.
1593 return g_date->GetMinute();
◆ SupplyMonth()
int Landscape::SupplyMonth |
( |
void |
| ) |
|
|
inline |
◆ 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 |
Definition at line 826 of file Landscape.h.
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()
◆ SupplyOsmiaNest()
bool Landscape::SupplyOsmiaNest |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyOverspray()
bool Landscape::SupplyOverspray |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
◆ SupplyPesticide() [1/2]
◆ SupplyPesticide() [2/2]
Gets total pesticide for a location.
Definition at line 586 of file Landscape.cpp.
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.
◆ SupplyPesticideCell()
int Landscape::SupplyPesticideCell |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyPesticideDecay()
Returns true if there is any pesticide in the system at all at this point.
Definition at line 776 of file Landscape.cpp.
778 return g_pest->GetAnythingToDecay(a_ppp);
References g_pest.
◆ SupplyPesticideP() [1/2]
◆ SupplyPesticideP() [2/2]
Gets plant pesticide for a location.
Definition at line 605 of file Landscape.cpp.
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]
◆ SupplyPesticideS() [2/2]
Gets soil pesticide for a location.
Definition at line 616 of file Landscape.cpp.
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.
Definition at line 1200 of file Landscape.h.
1202 return m_elems[ a_polyref ]->GetArea();
References m_elems.
◆ SupplyPolyRef()
int Landscape::SupplyPolyRef |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
Definition at line 1488 of file Landscape.h.
References m_elems, and m_land.
Referenced by Vole_Population_Manager::BarrierSearch(), Vole_Base::CopyMyself(), Vole_Population_Manager::GeneticsOutputFile(), TPredator_Population_Manager::PredSampleFile(), Vole_Base::Set_PolyRefBorn(), Vole_JuvenileMale::st_BecomeSubAdult(), Vole_JuvenileFemale::st_BecomeSubAdult(), Vole_Female::st_Lactating(), TAnimal::SupplyPolygonRef(), and Vole_Population_Manager::TheReallyBigOutputProbe().
◆ 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)
Definition at line 761 of file Landscape.h.
761 {
return dynamic_cast<Pond*>(
m_elems[a_poly_index])->SupplyPondPesticide(); }
References m_elems.
◆ SupplyRain() [1/2]
double Landscape::SupplyRain |
( |
long |
a_date | ) |
|
|
inline |
Definition at line 1358 of file Landscape.h.
1360 return g_weather->GetRain( a_date );
◆ SupplyRain() [2/2]
double Landscape::SupplyRain |
( |
void |
| ) |
|
|
inline |
Definition at line 1365 of file Landscape.h.
1367 return g_weather->GetRain();
◆ SupplyRainPeriod()
double Landscape::SupplyRainPeriod |
( |
long |
a_date, |
|
|
int |
a_period |
|
) |
| |
|
inline |
Definition at line 1351 of file Landscape.h.
1353 return g_weather->GetRainPeriod( a_date, a_period );
◆ SupplyRandomPondIndex()
int Landscape::SupplyRandomPondIndex |
( |
| ) |
|
◆ SupplyRandomPondRef()
int Landscape::SupplyRandomPondRef |
( |
| ) |
|
◆ SupplyRoadWidth()
int Landscape::SupplyRoadWidth |
( |
int |
, |
|
|
int |
|
|
) |
| |
|
inline |
◆ SupplyRodenticide()
double Landscape::SupplyRodenticide |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
◆ SupplyRodenticidePredatoryManager()
RodenticidePredators_Population_Manager* Landscape::SupplyRodenticidePredatoryManager |
( |
| ) |
|
|
inline |
◆ SupplyShouldSpray()
bool Landscape::SupplyShouldSpray |
( |
| ) |
|
|
inline |
Definition at line 357 of file Landscape.h.
References m_toxShouldSpray.
Referenced by CloverGrassGrazed2::Do(), FodderGrass::Do(), CloverGrassGrazed1::Do(), SpringBarleyCloverGrass::Do(), NLSpringBarleySpring::Do(), NLCabbageSpring::Do(), NLCabbage::Do(), SpringBarleySilage::Do(), SpringBarleySpr::Do(), NLSpringBarley::Do(), NLWinterWheat::Do(), PLSpringBarleySpr::Do(), SpringBarley::Do(), SpringRape::Do(), PLBeetSpr::Do(), PLBeans::Do(), WinterRape::Do(), NLPotatoesSpring::Do(), NLPotatoes::Do(), PLMaizeSilage::Do(), PLSpringBarley::Do(), PLMaize::Do(), NLTulips::Do(), PLWinterTriticale::Do(), PLWinterBarley::Do(), PLWinterWheatLate::Do(), PLSpringWheat::Do(), PLWinterWheat::Do(), PLBeet::Do(), PLPotatoes::Do(), PLWinterRape::Do(), and WinterWheat::Do().
◆ 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 |
Definition at line 1430 of file Landscape.h.
1432 return g_weather->GetSnow( a_date );
◆ SupplySnowcover() [2/2]
bool Landscape::SupplySnowcover |
( |
void |
| ) |
|
|
inline |
Definition at line 1437 of file Landscape.h.
1439 return g_weather->GetSnow();
◆ SupplySnowDepth()
double Landscape::SupplySnowDepth |
( |
void |
| ) |
|
|
inline |
Definition at line 1444 of file Landscape.h.
1446 return g_weather->GetSnowDepth();
◆ SupplySoilType()
int Landscape::SupplySoilType |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplySoilTypeR()
int Landscape::SupplySoilTypeR |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyTemp() [1/2]
double Landscape::SupplyTemp |
( |
long |
a_date | ) |
|
|
inline |
Definition at line 1379 of file Landscape.h.
1381 return g_weather->GetTemp( a_date );
◆ SupplyTemp() [2/2]
double Landscape::SupplyTemp |
( |
void |
| ) |
|
|
inline |
Definition at line 1386 of file Landscape.h.
1388 return g_weather->GetTemp();
◆ SupplyTempPeriod()
double Landscape::SupplyTempPeriod |
( |
long |
a_date, |
|
|
int |
a_period |
|
) |
| |
|
inline |
Definition at line 1410 of file Landscape.h.
1412 return g_weather->GetTempPeriod( a_date, a_period );
◆ SupplyThePopManager()
◆ SupplyTotalNectar() [1/2]
double Landscape::SupplyTotalNectar |
( |
int |
a_polyref | ) |
|
|
inline |
◆ SupplyTotalNectar() [2/2]
double Landscape::SupplyTotalNectar |
( |
int |
a_x, |
|
|
int |
a_y |
|
) |
| |
|
inline |
◆ SupplyTotalPollen() [1/2]
double Landscape::SupplyTotalPollen |
( |
int |
a_polyref | ) |
|
|
inline |
◆ 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]
int Landscape::SupplyTreeAge |
( |
int |
, |
|
|
int |
|
|
) |
| |
|
inline |
◆ 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 |
◆ 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]
◆ SupplyVegType() [2/2]
◆ SupplyVegTypeVector()
◆ 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 |
Definition at line 1400 of file Landscape.h.
1402 return g_weather->GetWind( a_date );
◆ SupplyWind() [2/2]
double Landscape::SupplyWind |
( |
void |
| ) |
|
|
inline |
Definition at line 1417 of file Landscape.h.
1419 return g_weather->GetWind();
◆ SupplyWindDirection()
int Landscape::SupplyWindDirection |
( |
void |
| ) |
|
|
inline |
Definition at line 1423 of file Landscape.h.
1425 return g_weather->GetWindDirection();
◆ SupplyWindPeriod()
double Landscape::SupplyWindPeriod |
( |
long |
a_date, |
|
|
int |
a_period |
|
) |
| |
|
inline |
Definition at line 1405 of file Landscape.h.
1407 return g_weather->GetWindPeriod( a_date, a_period );
◆ SupplyYear()
int Landscape::SupplyYear |
( |
void |
| ) |
|
|
inline |
◆ SupplyYearNumber()
int Landscape::SupplyYearNumber |
( |
void |
| ) |
|
|
inline |
Definition at line 1616 of file Landscape.h.
1618 return g_date->GetYearNumber();
Referenced by Vole_Population_Manager::Catastrophe(), Vole_Base::CheckTraps(), Vole_Population_Manager::CreateObjects_Init(), OrchardCrop::Do(), SpringBarleyPTreatment::Do(), WWheatPTreatment::Do(), Vole_Population_Manager::DoFirst(), FarmManager::FarmManagement(), Vole_Population_Manager::GeneticsOutputFile(), VoleSummaryOutput::OPrint(), TPredator_Population_Manager::PredAutumnSample(), TPredator_Population_Manager::PredSampleFile(), TPredator_Population_Manager::PredSpringAutumnSample(), TPredator_Population_Manager::PredSpringSample(), Farm::ProductApplication_DateLimited(), Vole_Population_Manager::ResistanceOutput(), TPredator_Population_Manager::Run(), Vole_Population_Manager::TheAgeSexLocationProbe(), Vole_Population_Manager::TheReallyBigOutputProbe(), and Vole_Population_Manager::TheSexRatiosProbe().
◆ 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.
Definition at line 1467 of file Landscape.cpp.
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 )) {
1543 for (
int c = 0; c < no_crops; 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';
1564 if (g_date->DayInYear() == g_date->DayInYear( 1, 03 ) && g_date->GetYearNumber() > 0) {
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(), l_pest_enable_pesticide_engine, toof_Foobar, tos_Foobar, tov_Maize, and tov_Undefined.
Referenced by TurnTheWorld().
◆ TranslateEleTypes()
Definition at line 1648 of file Landscape.h.
1650 return g_letype->TranslateEleTypes( EleReference );
◆ TranslateVegTypes()
Definition at line 1655 of file Landscape.h.
1657 return g_letype->TranslateVegTypes( VegReference );
◆ 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 |
Definition at line 2669 of file Landscape.cpp.
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 |
Definition at line 2638 of file Landscape.cpp.
2640 int fieldpoly = a_field->GetPoly();
2641 int borderpoly = umargin->GetPoly();
2644 int notforever = 5000;
2648 int x = a_field->GetValidX();
2649 int y = a_field->GetValidY();
2654 while ( --notforever ) {
2656 if (
UMarginTest( fieldindex, borderindex, x, y, a_width ) ) {
2658 m_land->Put( x, y, borderindex );
2659 a_field->AddArea( -1.0 );
2660 umargin->AddArea( 1.0 );
2663 if ( !
BorderStep( fieldindex, borderindex, & x, & y ) )
References g_landscape_p, m_polymapping, and SupplyLEPointer().
◆ UpdateOsmiaNesting()
void Landscape::UpdateOsmiaNesting |
( |
| ) |
|
|
inline |
Tesll all LE objects to update their osmia nest status.
Definition at line 856 of file Landscape.h.
References m_elems.
◆ VegDump()
void Landscape::VegDump |
( |
int |
x, |
|
|
int |
y |
|
) |
| |
|
protected |
Definition at line 1644 of file Landscape.cpp.
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()
Definition at line 4235 of file Landscape.cpp.
4242 return "BroadBeans ";
4244 return "FodderGrass ";
4246 return "CloverGrassGrazed1 ";
4248 return "CloverGrassGrazed2 ";
4250 return "FieldPeas ";
4252 return "FieldPeasSilage ";
4254 return "FodderBeet ";
4256 return "SugarBeet ";
4258 return "OFodderBeet ";
4264 return "MaizeSilage ";
4266 return "OMaizeSilage ";
4268 return "NaturalGrass ";
4274 return "OrchardCrop ";
4278 return "OBarleyPeaCloverGrass";
4282 return "OCloverGrassGrazed1 ";
4284 return "OCloverGrassGrazed2 ";
4286 return "OCloverGrassSilage1 ";
4288 return "OFieldPeas ";
4290 return "OFieldPeasSilage ";
4292 return "OFirstYearDanger ";
4294 return "OGrazingPigs ";
4298 return "OPermanentGrassGrazed";
4300 return "OPotatoes ";
4302 return "OSBarleySilage ";
4304 return "OSeedGrass1 ";
4306 return "OSeedGrass2 ";
4308 return "OSetaside ";
4310 return "OSpringBarley ";
4312 return "OSpringBarleyExt ";
4314 return "OSpringBarleyClover ";
4316 return "OSpringBarleyGrass ";
4318 return "OSpringBarleyPigs ";
4320 return "OTriticale ";
4322 return "OWinterBarley ";
4324 return "OWinterBarleyExt ";
4326 return "OWinterRape ";
4328 return "OWinterRye ";
4330 return "OWinterWheatUndersown";
4332 return "OWinterWheat";
4334 return "OWinterWheatUsowExt ";
4336 return "PermanentGrassGrazed ";
4338 return "PermanentGrassLowYield";
4340 return "PermanentGrassTussocky";
4342 return "PermanentSetaside ";
4344 return "PotatoesEat ";
4346 return "PotatoesIndustry ";
4348 return "SeedGrass1 ";
4350 return "SeedGrass2 ";
4354 return "SpringBarley ";
4356 return "SpringBarleySpr ";
4358 return "SpringBarleyPTreat ";
4360 return "SpringBarleySKMan ";
4362 return "SprBarleyCloverGrass ";
4364 return "SpringBarleyGrass ";
4366 return "SpringBarleySeed ";
4368 return "SpringBarleySilage ";
4370 return "SpringRape ";
4372 return "SpringWheat ";
4374 return "AgroChemIndustry Cereal ";
4376 return "Triticale ";
4378 return "WinterBarley ";
4380 return "WinterRape ";
4382 return "WinterRye ";
4384 return "WinterWheat ";
4386 return "WinterWheatShort ";
4388 return "P Trial Control ";
4390 return "P Trial Toxic Control";
4392 return "P Trial Treatment ";
4394 return "Undefined ";
4396 return "WWStrigling ";
4398 return "WWStriglingSingle ";
4400 return "WWStriglingCulm ";
4402 return "SBPCGStrigling ";
4404 return "SBarleyStrigling ";
4406 return "SBarleyStriglingSgl ";
4408 return "SBarleyStriglingCulm ";
4410 return "MaizseStrigling ";
4412 return "WRapeStrigling ";
4414 return "WRyeStrigling ";
4416 return "WBStrigling ";
4418 return "FieldPeasStrigling ";
4420 return "SBPeaCloverGrassStr ";
4422 return "Young Forest ";
4424 return "Wasteland ";
4426 return "Heath/Grass ";
4428 return "Plant Nursery ";
4430 return "Norwegian Potatoes ";
4432 return "Norwegian Oats ";
4434 return "Norwegian Spr. Barley";
4437 return "Unsprayed buffer zone around water";
4440 return "Polish Winter Wheat ";
4442 return "Polish Winter Rape ";
4444 return "Polish Winter Barley ";
4446 return "Polish Winter Triticale ";
4448 return "Polish Winter Rye ";
4450 return "Polish Spring Wheat ";
4452 return "Polish Spring Barley ";
4454 return "Polish Maize ";
4456 return "Polish Maize Silage ";
4458 return "Polish Potatoes ";
4460 return "Polish Beet ";
4462 return "Polish Fodder Lucerne first year ";
4464 return "Polish Fodder Lucerne second/third year ";
4466 return "Polish Carrots ";
4468 return "Polish Spring Barley with Spring Plough ";
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 ";
4483 return "Dutch Potatoes ";
4485 return "Dutch Spring Barley ";
4487 return "Dutch Winter Wheat ";
4489 return "Dutch Cabbage ";
4491 return "Dutch Tulips ";
4493 return "Dutch TemporalGrassGrazed1 ";
4495 return "Dutch TemporalGrassGrazed1 after catch crop ";
4497 return "Dutch TemporalGrassGrazed2 ";
4499 return "Dutch TemporalGrassGrazedLast ";
4501 return "Dutch PermanentGrassGrazed ";
4503 return "Dutch Beet after catch crop ";
4505 return "Dutch Carrots after catch crop ";
4507 return "Dutch Maize after catch crop ";
4509 return "Dutch Potatoes after catch crop ";
4511 return "Dutch Spring Barley after catch crop ";
4513 return "Dutch Cabbage after catch crop ";
4515 return "Dutch Catch Pea Crop ";
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);
References tov_AgroChemIndustryCereal, tov_BroadBeans, tov_Carrots, tov_CloverGrassGrazed1, tov_CloverGrassGrazed2, tov_DummyCropPestTesting, tov_FieldPeas, tov_FieldPeasSilage, tov_FieldPeasStrigling, tov_FodderBeet, tov_FodderGrass, tov_Heath, tov_Lawn, tov_Maize, tov_MaizeSilage, tov_MaizeStrigling, tov_NaturalGrass, tov_NLBeet, tov_NLBeetSpring, tov_NLCabbage, tov_NLCabbageSpring, tov_NLCarrots, tov_NLCarrotsSpring, tov_NLCatchPeaCrop, tov_NLGrassGrazed1, tov_NLGrassGrazed1Spring, tov_NLGrassGrazed2, tov_NLGrassGrazedLast, tov_NLMaize, tov_NLMaizeSpring, tov_NLPermanentGrassGrazed, tov_NLPotatoes, tov_NLPotatoesSpring, tov_NLSpringBarley, tov_NLSpringBarleySpring, tov_NLTulips, tov_NLWinterWheat, tov_NoGrowth, tov_None, tov_NorwegianOats, tov_NorwegianPotatoes, tov_NorwegianSpringBarley, tov_Oats, tov_OBarleyPeaCloverGrass, tov_OCarrots, tov_OCloverGrassGrazed1, tov_OCloverGrassGrazed2, tov_OCloverGrassSilage1, tov_OFieldPeas, tov_OFieldPeasSilage, tov_OFirstYearDanger, tov_OFodderBeet, tov_OGrazingPigs, tov_OMaizeSilage, tov_OOats, tov_OPermanentGrassGrazed, tov_OPotatoes, tov_OrchardCrop, tov_OSBarleySilage, tov_OSeedGrass1, tov_OSeedGrass2, tov_OSetaside, tov_OSpringBarley, tov_OSpringBarleyClover, tov_OSpringBarleyExt, tov_OSpringBarleyGrass, tov_OSpringBarleyPigs, tov_OTriticale, tov_OWinterBarley, tov_OWinterBarleyExt, tov_OWinterRape, tov_OWinterRye, tov_OWinterWheat, tov_OWinterWheatUndersown, tov_OWinterWheatUndersownExt, tov_PermanentGrassGrazed, tov_PermanentGrassLowYield, tov_PermanentGrassTussocky, tov_PermanentSetaside, tov_PlantNursery, tov_PLBeans, tov_PLBeet, tov_PLBeetSpr, tov_PLCarrots, tov_PLFodderLucerne1, tov_PLFodderLucerne2, tov_PLMaize, tov_PLMaizeSilage, tov_PLPotatoes, tov_PLSpringBarley, tov_PLSpringBarleySpr, tov_PLSpringWheat, tov_PLWinterBarley, tov_PLWinterRape, tov_PLWinterRye, tov_PLWinterTriticale, tov_PLWinterWheat, tov_PLWinterWheatLate, tov_Potatoes, tov_PotatoesIndustry, tov_SeedGrass1, tov_SeedGrass2, tov_Setaside, tov_SpringBarley, tov_SpringBarleyCloverGrass, tov_SpringBarleyCloverGrassStrigling, tov_SpringBarleyGrass, tov_SpringBarleyPeaCloverGrassStrigling, tov_SpringBarleyPTreatment, tov_SpringBarleySeed, tov_SpringBarleySilage, tov_SpringBarleySKManagement, tov_SpringBarleySpr, tov_SpringBarleyStrigling, tov_SpringBarleyStriglingCulm, tov_SpringBarleyStriglingSingle, tov_SpringRape, tov_SpringWheat, tov_SugarBeet, tov_Triticale, tov_Undefined, tov_Wasteland, tov_WaterBufferZone, tov_WinterBarley, tov_WinterBarleyStrigling, tov_WinterRape, tov_WinterRapeStrigling, tov_WinterRye, tov_WinterRyeStrigling, tov_WinterWheat, tov_WinterWheatShort, tov_WinterWheatStrigling, tov_WinterWheatStriglingCulm, tov_WinterWheatStriglingSingle, tov_WWheatPControl, tov_WWheatPToxicControl, tov_WWheatPTreatment, and tov_YoungForest.
Referenced by MaizeStrigling::Do().
◆ Warn()
void Landscape::Warn |
( |
std::string |
a_msg1, |
|
|
std::string |
a_msg2 |
|
) |
| |
|
inline |
Definition at line 1579 of file Landscape.h.
1581 g_msg->Warn( WARN_MSG, a_msg1, a_msg2 );
Referenced by Vole_Population_Manager::AssessHabitat(), Vole_Population_Manager::DoFirst(), Vole_Population_Manager::GeneticsOutputFile(), Vole_Population_Manager::ImpactedProbe(), Vole_Population_Manager::Init(), Vole_Base::MoveQuality(), Vole_Population_Manager::OpenResistanceOutput(), TPredator_Population_Manager::PredAutumnSample(), TPredator_Population_Manager::PredSampleFile(), TPredator_Population_Manager::PredSpringAutumnSample(), TPredator_Population_Manager::PredSpringSample(), TPredator_Population_Manager::Run(), Vole_Population_Manager::SendMessage(), Weasel::Step(), Owl::Step(), Vole_JuvenileMale::Step(), Vole_Male::Step(), Vole_JuvenileFemale::Step(), Vole_Female::Step(), and SupplyGooseGrazingForageH().
◆ 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
Definition at line 150 of file Landscape.h.
◆ 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.
Definition at line 122 of file Landscape.h.
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
◆ 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.
Definition at line 125 of file Landscape.h.
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
Definition at line 146 of file Landscape.h.
◆ m_NeedOpennessCalculation
bool Landscape::m_NeedOpennessCalculation |
|
private |
a flag to ensure openness calculation on object construction
Definition at line 148 of file Landscape.h.
◆ m_PesticideMap
PesticideMap* Landscape::m_PesticideMap |
|
private |
For specialised pesticide recording.
Definition at line 133 of file Landscape.h.
◆ m_PesticideType
◆ 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.
Definition at line 130 of file Landscape.h.
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
RodenticideManager* Landscape::m_RodenticideManager |
|
private |
◆ m_RodenticidePreds
RodenticidePredators_Population_Manager* Landscape::m_RodenticidePreds |
|
private |
◆ m_ThePopManager
◆ m_toxShouldSpray
bool Landscape::m_toxShouldSpray |
|
protected |
◆ m_treatment_counts
◆ 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
void CalculateCentroids(void)
vector< int > m_PondRefsList
List of pond polyrefs.
double SupplyVegDigestability(int a_polyref)
int GetRenumberedFarmRef(int a_farmref)
Returns the farm ref index for a farmref.
double Get_cropTotals(int i)
LE * SupplyLEPointer(int a_polyref)
void DumpMapInfoByArea(const char *a_filename, bool a_append, bool a_dump_zero_areas, bool a_write_veg_names)
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)
std::vector< GooseFieldListItem > GooseFieldList
A list of GooseFieldListItem s.
void FindNeighbours()
Finds all OptimisingFarms' neighbours and saves them in the farm's OptimisingFarm::m_neighbours vecto...
CfgInt cfg_pesticidemapnoyears("PEST_MAP_NOYEARS", CFG_CUSTOM, 1)
The numer of years of pesticide mapping.
RodenticidePredators_Population_Manager * m_RodenticidePreds
double SupplyLATotal(int a_x, int a_y)
Landscape * g_landscape_p
void DumpMap(const char *a_filename)
static CfgInt l_map_no_pesticide_fields("MAP_NO_PESTICIDE_FIELDS", CFG_CUSTOM, 0)
TTypesOfVegetation SupplyVegType(int a_x, int a_y)
TTypesOfLandscapeElement SupplyElementType(int a_polyref)
void PolysDump(const char *a_filename)
std::string VegtypeToString(TTypesOfVegetation a_veg)
int RemoveSmallPolygons(void)
Removes small polygons from the map.
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)
double Get_sellingPrice(int i)
void ChooseDecisionMode_for_farms()
Calls OptimisingFarm::ChooseDecisionMode for all optimising farms.
bool BorderStep(int a_fieldpoly, int a_borderpoly, int *a_x, int *a_y)
vector< unsigned > polylist
double SupplyLAGreen(int a_polyref)
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.
void VegDump(int x, int y)
void GISASCII_Output(string outpfile, int UTMX, int UTMY)
Write ASCII file of the ALMaSS map.
PollenNectarDevelopmentData * g_nectarpollen
void DumpFarmrefs()
dumps the farmrefs file to a standard named file
void CorrectCoords(int &x, int &y)
Function to prevent wrap around errors with co-ordinates using x/y pair.
int SupplyGrazingPressure(int a_polyref)
static CfgBool l_map_dump_veg_enable("MAP_DUMP_VEG_ENABLE", CFG_CUSTOM, true)
void InitFarms()
Calls OptimisingFarm::Init for all optimising farms.
int BackTranslateVegTypes(TTypesOfVegetation VegReference)
double g_VegHeightForageReduction
static CfgBool l_map_art_hedgebanks("MAP_ART_HEDGEBANKS", CFG_CUSTOM, false)
CfgInt cfg_HedgeSubtypeMaximum("HEDGE_SUBTYPEMAXIMUM", CFG_CUSTOM, 3)
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.
void Set_sellingPrice(double a_value, int i)
CfgBool cfg_OptimisingFarms
static CfgInt cfg_BeetleBankType("BBANK_TYPE", CFG_CUSTOM,(int) tole_BeetleBank)
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.
static CfgStr l_map_map_file("MAP_MAP_FILE", CFG_CUSTOM, "map.lsb")
vector< int > m_polymapping
CfgStr l_map_dump_map_file("MAP_DUMP_MAP_FILE", CFG_CUSTOM, "dump.lsb")
PesticideMap * m_PesticideMap
For specialised pesticide recording.
CfgBool cfg_DumpFarmAreas
double SupplyWeedBiomass(int a_polyref)
static CfgInt cfg_mintownbuildingdistance("MAP_MINTOWNBUILDINGDISTANCE", CFG_CUSTOM, 100)
Farm * GetFarmPtr(int a_owner)
Returns the pointer to a farm with a specific number.
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)
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.
FarmManager * m_FarmManager
List of all the farms.
void SetPolyMaxMinExtents(void)
static CfgBool l_map_exit_on_zero_area("MAP_EXIT_ON_ZERO_AREA", CFG_CUSTOM, true)
TTypesOfVegetation vegtype
void RebuildPolyMapping()
int roostdists[gs_foobar]
void BorderAdd(LE *a_field, TTypesOfLandscapeElement a_type)
static CfgBool l_map_dump_enable("MAP_DUMP_ENABLE", CFG_CUSTOM, false)
static CfgBool cfg_AddBeetleBanks("BBANKS_ADD", CFG_CUSTOM, false)
void UnsprayedMarginAdd(LE *a_field)
CfgInt cfg_BeetleBankMinX("BBANK_MINX", CFG_CUSTOM, 0)
RodenticideManager * m_RodenticideManager
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,...
CfgInt cfg_BeetleBankMaxX("BBANK_MAXX", CFG_CUSTOM, 100000)
TTypesOfVegetation Get_cropTypes_almass(int i)
void ReadPolys2(const char *a_polyfile)
reads in polygon information. Version 2 including centroid and openness information
void UnsprayedMarginScan(LE *a_field, int a_width)
void ActualProfit()
Calls OptimisingFarm::ActualProfit for all optimising farms.
Polynomial2CurveClass * m_GooseIntakeRateVSVegetationHeight_GL
static CfgBool l_map_print_version_info("MAP_PRINT_VERSION_INFO", CFG_CUSTOM, true)
bool m_DoMissingPolygonsManipulations
static CfgStr l_map_weather_file("MAP_WEATHER_FILE", CFG_CUSTOM, "weather.pre")
void PrintFinalResults()
At the end of a simulation it prints results on crop distribution, pesticide and fertilizer usage.
int hb_first_free_poly_num
static CfgStr l_map_dump_treatcounts_file("MAP_DUMP_TREATCOUNTS_FILE", CFG_CUSTOM, "treatment_counts.txt")
vector< int > m_PondIndexList
List of pond indexes.
void AddBeetleBanks(TTypesOfLandscapeElement a_tole)
void BorderScan(LE *a_field, int a_width)
void FarmManagement()
Runs the daily farm management for each farm, but also calculates annual spilled grain and maize.
static CfgBool l_map_calc_openness("MAP_CALC_OPENNESS", CFG_CUSTOM, false)
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 Save_last_years_crops_for_farms()
Calls OptimisingFarm::Save_last_years_crops for all optimising farms.
LE_Signal SupplyLESignal(int a_polyref)
bool SupplyVegPatchy(int a_polyref)
void Set_sellingPrice_lastyr(double a_value, int i)
void AddField(int a_OwnerIndex, LE *a_newland, int a_Owner)
void BeetleBankAdd(int x, int y, int angle, int length, LE *a_field, TTypesOfLandscapeElement a_tole)
static CfgFloat cfg_BeetleBankMaxArea("BBANK_MAXAREA", CFG_CUSTOM, 0.05)
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...
int m_treatment_counts[last_treatment]
TTypesOfPesticide m_PesticideType
An attribute to hold the pesticide type being tested, if there is one, if not default is -1.
double Get_emaize_price(int i)
void CountMapSquares(void)
static CfgInt l_map_dump_event_y2("MAP_DUMP_EVENT_YB", CFG_CUSTOM, 2889)
static CfgBool l_map_dump_gfx_enable("MAP_DUMP_GFX_ENABLE", CFG_CUSTOM, false)
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)
double SupplyVegBiomass(int a_polyref)
void DumpTreatCounters(const char *a_filename)
void Switch_rotation()
Switches OptimisingFarms Farm::m_rotation to the list of all possible rotational crops.
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.
double SupplyBirdSeedForage(int a_polyref)
Returns the grain forage resource.
int FindLongestAxis(int *x, int *y, int *a_length)
static CfgInt cfg_BeetleBankChance("BBANK_CHANCE", CFG_CUSTOM, 100)
int SupplyYearNumber(void)
double SupplyVegCover(int a_polyref)
CfgBool l_pest_enable_pesticide_engine
double g_SpeedyDivides[2001]
A generally useful array of fast divide calculators by multiplication.
CfgBool cfg_pesticidemaptype("PEST_MAP_TYPE", CFG_CUSTOM, false)
True for specific pesticide, false for general pesticides.
void ChangeMapMapping(void)
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...
static CfgBool l_map_removesmallpolygons("MAP_REMOVESMALLPOLYGONS", CFG_CUSTOM, false)
CfgBool cfg_rodenticide_enable("RODENTICIDE_ENABLE", CFG_CUSTOM, false)
RasterMap * m_land
The big map.
bool FindFieldCenter(LE *a_field, int *x, int *y)
std::string EventtypeToString(int a_event)
A list item entry of field polygon reference numbers with associated openness and goose food scores.
bool m_NeedCentroidCalculation
a flag to ensure centroid calculation on object construction
int ConnectFarm(int a_owner)
unsigned int FarmAnimalCensus(unsigned int a_farm, unsigned int a_typeofanimal)
void CreatePondList()
Creates a list of pond polygon refs/indexes for easy look up.
static CfgStr l_map_cropcurves_file("MAP_CROPCURVES_FILE", CFG_CUSTOM, "curves.pre")
double SupplyInsects(int a_polyref)
Polynomial2CurveClass * m_GooseIntakeRateVSVegetationHeight_BG
int Get_cropTypes_almass_size()
bool BeetleBankPossible(LE *a_field, TTypesOfLandscapeElement a_tole)
void CalculateOpenness(bool a_realcalc)
Causes openness to be calulated and stored for all polygons.
double SupplyVegHeight(int a_polyref)
static CfgInt l_map_dump_event_y1("MAP_DUMP_EVENT_YA", CFG_CUSTOM, 2909)
double GetDD(void)
Returnes day degrees for the period March 1st - November 1st. Used for determining yields of crops th...
CfgBool cfg_dumpvegjune("G_VEGAREASJUNE_ON", CFG_CUSTOM, false)
bool SupplyLEHigh(int a_x, int a_y)
Tests whether the polygon at a_x,a_y is designated as high.
int geesespTimed[gs_foobar]
int CalulateFieldOpennessAllCells(int a_pref)
Provides a measure of the shortest distance in 360 degree, e-g- looking NE % SW before tall obstacles...
void InitiateManagement(void)
static const int version_revision
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)
Polynomial2CurveClass * m_GooseIntakeRateVSVegetationHeight_PF
Curve relatning goose intake rates in KJ/min to vegetation height.
static CfgInt l_map_chameleon_replace_num("MAP_CHAMELEON_REPLACE_NUM", CFG_CUSTOM, 58)
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)
bool PolysRemoveInvalid(void)
void AxisLoop(int a_poly, int *a_x, int *a_y, int a_axis)
void Save_diff_farm_types_areas()
Calculates and saves total areas of all optimising farms and specific farm types.
bool GetIsRenumbered()
Returns the flag for renumbering.
void DumpMapGraphics(const char *a_filename)
void CentroidSpiralOut(int a_polyref, int &a_x, int &a_y)
static CfgInt l_map_dump_veg_x("MAP_DUMP_VEG_X", CFG_CUSTOM, 100)
CfgStr cfg_dumpvegjanfile("G_VEGAREASJAN_FILENAME", CFG_CUSTOM, "DUMPVEG_JAN.TXT")
static CfgInt cfg_BeetleBankWidth("BBANK_WIDTH", CFG_CUSTOM, 4)
DataForOptimisation * pm_data
Pointer to the DataForOptimisation.
void UpdateOsmiaNesting()
Tesll all LE objects to update their osmia nest status.
A farm that carries out crop, pesticide and fertilizer planning using simplified optimisation or othe...
static CfgStr l_map_dump_gfx_file("MAP_DUMP_GFX_FILE", CFG_CUSTOM, "dump.ppm")
void BuildingDesignationCalc()
used to calculate whether a building is rural or town - for rodenticide use
void SetSpilledGrain(bool a_spilledgrain)
Set m_SpilledGrain which is the flag for either 2013 (true) or 2014 (false) spilled grain distributio...
double g_FarmIntensivenessH
static CfgBool l_map_dump_event_enable("MAP_DUMP_EVENT_ENABLE", CFG_CUSTOM, false)
static const char * version_date
Population_Manager * m_ThePopManager
a pointer to the current main population manager
int SupplyLastTreatment(int a_polyref, int *a_index)
static CfgInt l_map_dump_event_x1("MAP_DUMP_EVENT_XA", CFG_CUSTOM, 4287)
int SupplyPolyRefIndex(int a_x, int a_y)
int Get_cropTotals_size()
void PolysValidate(bool a_exit_on_invalid)
static const int version_minor
bool FindValidXY(int a_field, int &a_x, int &a_y)
void Warn(std::string a_msg1, std::string a_msg2)
vector< LE * > m_elems
List of all landscape elements. The index is a sequential number, to get the polynum look this number...
CfgInt cfg_productapplicstartyear("PEST_PROCTAPPLICSTARTYEAR", CFG_CUSTOM, 9999999)
bool m_NeedOpennessCalculation
a flag to ensure openness calculation on object construction
int SupplyPolyRef(int a_x, int a_y)
CfgInt cfg_BeetleBankMaxY("BBANK_MAXY", CFG_CUSTOM, 100000)
void EventDump(int x, int y, int x2, int y2)
CfgBool cfg_OptimiseBedriftsmodelCrops
void Set_cropTotals(int i, double value)
long SupplyGlobalDate(void)
static CfgInt l_map_umargin_width("MAP_UMARGINWIDTH", CFG_CUSTOM, 12)
void SetLESignal(int a_polyref, LE_Signal a_signal)
void ConsolidatePolys(void)
CfgInt cfg_BeetleBankMinY("BBANK_MINY", CFG_CUSTOM, 0)