File failed to load: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/extensions/ams.js
ALMaSS  1.2 (after EcoStack, March 2024)
The Animal, Landscape and Man Simulation System
All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Landscape Class Reference

The landscape class containing all environmental and topographical data. More...

#include <Landscape.h>

Public Member Functions

vector< vector< int > > CalculateMaskCorners (int a_centroid_x, int a_centroid_y, int a_half_width)
 The function to calculate the corners of mask(s) for the given centroid and half-width with wrapping around. More...
 
void GenerateCellLocDict ()
 The function to create the dictionary of cell locations for every polygon. More...
 
void GeneratePolyIDMapWithinDist ()
 The function to find all the polygons within the a certain distance to each location. More...
 
std::vector< APointSupplyLocsVectorPoly (int a_poly_id)
 The function to get the vector of all the locations for the given poly ID. More...
 
APoint SupplyARandomLocPoly (int a_poly_id)
 The function to get a random location for the given poly ID. More...
 
APoint SupplyARandomLocPollenPoly (int a_poly_id)
 The function to get a random location with pollen available for the given polygon. More...
 
APoint SupplyARandomLocNectarPoly (int a_poly_id)
 The function to get a random location with nectar available for the given polygon. More...
 
APoint SupplyARandomLocResourcePoly (int a_poly_id, std::map< int, int > &a_index_locs, std::map< int, vector< APoint >> &a_poly_cell_locs, Eigen::MatrixXf &a_prop_map)
 The function to get a random location for the given resource and the given poly ID. More...
 
double SupplyPollenAtLocInPoly (int a_poly_id, APoint a_start_loc, double a_required_amount, vector< APoint > *a_locs, vector< double > *a_pest_vec)
 The function to get the given pollen in the give location in the polygon ID, the locations for the required amount of pollen are stored in a_locs, the pesticide residue are stored in a_pest_vet, the foraged amount of pollen are returned. More...
 
double SupplyNectarAtLocInPoly (int a_poly_id, APoint a_start_loc, double a_required_amount, vector< APoint > *a_locs, vector< double > *a_pest_vec)
 The function to get the given nectar in the given location in the polygon ID, the locations for the required amount of nectar are stored in a_locs, the pesticide residue are stored in a_pest_vet, the foraged amount of nectar are returned. More...
 
double SupplyResourceAtLocInPoly (int a_poly_id, APoint a_start_loc, double a_required_amount, vector< APoint > *a_locs, vector< double > *a_pest_vec, Eigen::MatrixXf &a_resource_map, int a_num_avail_cell, PollenNectarData a_resource_data, bool a_is_pollen)
 The function to get the given amount of the required resource for the given location, the function returns the foraged amount. More...
 
void ResetFlowerLocIndex (void)
 The function to reset the index for the indices of the locations with flower resource. More...
 
PollenNectarData SupplyPollenHabitatType (int a_habitat_type)
 Supply the pollen of the current day for the given habitat type. More...
 
PollenNectarData SupplyNectarHabitatType (int a_habitat_type)
 Supply the nectar of the current day for the given habitat type. More...
 
void SetPollenMap (int a_poly_id, double a_pollen_quantity, int a_min_x, int a_min_y, int a_max_x, int a_max_y)
 The function to set the pollen quantity for all the cells that belong to the given polygon ID. More...
 
void SetNectarMap (int a_poly_id, double a_nectar_quantity, int a_min_x, int a_min_y, int a_max_x, int a_max_y)
 The function to set the nectar quantity for all the cells that belong to the given polygon ID. More...
 
void SetGreenBiomassMap (int a_poly_id, double a_green_biomass, int a_min_x, int a_min_y, int a_max_x, int a_max_y)
 The function to set the green biomass (in kg) for all the cells that belong to the given polygon ID. Used to scale the transfer of pesticide into the plant. More...
 
double SupplyLocMaxPollen (int &a_peak_loc_x, int &a_peak_loc_y, int a_min_x, int a_min_y, int a_max_x, int a_max_y, int a_incr=1)
 Supply the location with the maximum pollen amount location for the given area. More...
 
double SupplyLocMaxNectar (int &a_peak_loc_x, int &a_peak_loc_y, int a_min_x, int a_min_y, int a_max_x, int a_max_y, int a_incr=1)
 Supply the location with the maximum nectar amount location for the given area. More...
 
void RunHiddenYear ()
 The function to generate the vector list of pixies for polygons with flower resource. More...
 
void FillVegAreaData ()
 Runs through all polygons and records the area of each vegetation type. More...
 
double SupplyVegArea (int v)
 Records all area vegetation types and transform it into a table. More...
 
void DumpVegAreaData (int a_day)
 Saves the information on vegetation types and areas. More...
 
void SkylarkEvaluation (SkTerritories *a_skt)
 Evaluation to find Skylark territory. More...
 
void RodenticidePredatorsEvaluation (RodenticidePredators_Population_Manager *a_rppm)
 Evaluation to find Rodenticide Predator territory. More...
 
PopulationManagerListSupplyThePopManagerList ()
 Set the pointer to the list of active population managers. More...
 
int DistanceToP (APoint a_Here, APoint a_There)
 Distance to the current main population manager, calculates distance from 2 coordinates to other 2 coordinates. More...
 
int DistanceToPSquared (APoint a_Here, APoint a_There)
 Distance to the current main population manager, calculates distance from 2 coordinates to other 2 coordinates but do not square root (for efficiency) More...
 
void SetThePopManagerList (PopulationManagerList *a_ptr)
 Set the pointer to the list of active population managers. More...
 
int SupplyVegPhase (int a_poly)
 Returns the current vegetation growth phase for a polygon. More...
 
double SupplyPestIncidenceFactor ()
 Returns Landscape::m_pestincidencefactor. More...
 
void SetPolymapping (int a_index, int a_val)
 Sets an entry in the polymapping to a specific value. More...
 
int SupplyPolymapping (int a_index)
 Returns the value of the m_polymapping array indexed by a_index. More...
 
int SupplyMaxPoly ()
 Returns the size of the Landscape::m_elems vector. More...
 
Eigen::ArrayXXi * SupplyPolyIdMapPtr ()
 Returns pointer to the Eigen Array for poly id map. More...
 
Eigen::ArrayXXf * SupplyGreenBiomassMapPtr ()
 Returns pointer to the Eigen array for green biomass. More...
 
Eigen::MatrixXf * SupplyPollenMapPtr ()
 Returns pointer to the Eigen matrix for pollen. More...
 
Eigen::MatrixXf * SupplyNectarMapPtr ()
 Returns pointer to the Eigen matrix for nectar. More...
 
list< LE * > SupplyAllVegPolys ()
 Creates a vector containing a list of all the polygons that do not have tov_None as the vegetation type. More...
 
 ~Landscape (void)
 
 Landscape (bool dump_exit=true)
 
bool IsHiddenYear (void)
 The function to return whether it is in the hidden year. More...
 
void SimulationClosingActions ()
 
void Tick (void)
 
void TurnTheWorld (void)
 
int HowManyPonds () const
 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) const
 Returns the index of a pond based on pondref or -1 if not found. More...
 
void SetMaleNewtPresent (const 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...
 
FarmSupplyFarmPtr (int a_owner)
 Returns a pointer to a farm owned by a farmer with a specific farm reference number. More...
 
FarmManagerSupplyFarmManagerPtr ()
 Returns m_FarmManager, the pointer to the farm manager instance. More...
 
RasterMapSupplyRasterMap ()
 Returns m_land, the pointer to the raster map instance. More...
 
int SupplyLargestPolyNumUsed ()
 Returns m_LargestPolyNumUsed. More...
 
bool SupplyShouldSpray ()
 Returns m_toxShouldSpray, a flag indicating whether pesticide should be sprayed. More...
 
std::string SupplyCountryCode ()
 Returns m_countryCode, e.g. "DK" for Denmark. More...
 
int SupplyTimezone ()
 
void SetCountryCode (std::string country_code)
 Sets m_countryCode, e.g. "DK" for Denmark. More...
 
string SupplyLandscapeName ()
 Returns the current landscape name. More...
 
void SetSpeciesFunctions (TTypesOfPopulation a_species)
 This is the jumping off point for any landscape related species setup, it creates function pointers to these special functions. More...
 
void SetPolygonLock (int a_polyref)
 Function to set the given polygon lock. More...
 
void ReleasePolygonLock (int a_polyref)
 Function to release the given polygon locks. More...
 
double SupplyLatitude ()
 Returns m_latitude of the landscape location. More...
 
double SupplyLongitude ()
 Returns m_longitude of the landscape location. More...
 
void SetLatitude (double latitude)
 Sets the latitude of the landscape location. More...
 
void SetLongitude (double longitude)
 Sets the longitude of the landscape location. More...
 
double SupplyVegDigestibilityVector (unsigned int a_index)
 Gets the digestibility of the vegetation based on an index to the Landscape::m_elems array. More...
 
double SupplyVegDigestibility (int a_polyref)
 Gets the digestibility of the vegetation for a polygon given by a_polyref or based on the x, y coordinates given by a_x, a_y. More...
 
double SupplyVegDigestibility (int a_x, int a_y)
 Gets the digestibility of the vegetation for a polygon given by a_polyref or based on the x, y coordinates given by a_x, a_y. More...
 
double SupplyVegHeightVector (unsigned int a_index)
 Returns the height of the vegetation using the index to Landscape::m_elems. More...
 
double SupplyVegHeight (int a_polyref)
 Returns the height of the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y. More...
 
double SupplyVegHeight (int a_x, int a_y)
 Returns the height of the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y. More...
 
double SupplyVegBiomassVector (unsigned int a_index)
 Returns the biomass of the vegetation using the index a_index to Landscape::m_elems. More...
 
double SupplyVegBiomass (int a_polyref)
 Returns the biomass of the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y. More...
 
double SupplyVegBiomass (int a_x, int a_y)
 Returns the biomass of the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y. More...
 
int SupplyVegDensity (int a_polyref)
 Returns the density of the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y. More...
 
int SupplyVegDensity (int a_x, int a_y)
 Returns the density of the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y. More...
 
double SupplyWeedBiomass (int a_polyref)
 Returns the weed biomass of the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y. More...
 
double SupplyWeedBiomass (int a_x, int a_y)
 Returns the weed biomass of the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y. More...
 
void CalHaibitatFlowerResource ()
 Calculate the flower resouce for all the habitat types with flower resource. More...
 
PollenNectarData SupplyPollen (int a_polyref)
 Returns information on the pollen produced by the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y. More...
 
PollenNectarData SupplyPollen (int a_x, int a_y)
 Returns information on the pollen produced by the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y. More...
 
void RemovePollenInLoc (int a_x, int a_y, double a_mount)
 Remove the foraged ammount of pollen quantity from the cell indexed by a_x, a_y. More...
 
PollenNectarData SupplyNectar (int a_polyref)
 Returns information on the nectar produced by the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y. More...
 
PollenNectarData SupplyNectar (int a_x, int a_y)
 Returns information on the nectar produced by the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y. More...
 
void RemoveNectarInLoc (int a_x, int a_y, double a_mount)
 Remove the foraged ammount of pollen quantity from the cell indexed by a_x, a_y. More...
 
double SupplySugar (int a_polyref)
 Returns information on the sugar produced by the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
double SupplySugar (int a_x, int a_y)
 Returns information on the sugar produced by the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
double SupplyPollenQuantity (int a_polyref)
 Returns the pollen quantity produced by the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
double SupplyPollenQuantity (int a_x, int a_y)
 Returns the pollen quantity produced by the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
double SupplyNectarQuantity (int a_polyref)
 Returns the XXX of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
double SupplyNectarQuantity (int a_x, int a_y)
 Returns the XXX of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
double SupplyTotalNectar (int a_polyref)
 Returns the nectar quantity produced by the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
double SupplyTotalNectar (int a_x, int a_y)
 Returns the nectar quantity produced by the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
void RemoveNectarFromTotal (int a_polyref, double a_removed_amount)
 Remove the given amount of nectar from the total amount in the given polygon. More...
 
double SupplyTotalPollen (int a_polyref)
 Returns the sugar quantity produced by of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
double SupplyTotalPollen (int a_x, int a_y)
 Returns the sugar quantity produced by of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
void RemovePollenFromTotal (int a_polyref, double a_removed_amount)
 Remove the given amount of pollen from the total amount in the given polygon. More...
 
double SupplyNecDD (int a_polyref)
 Returns the current day degree sum for nectar production of the vegetation using the polygon reference number a_polyref. More...
 
double SupplySugDD (int a_polyref)
 Returns the current day degree sum for sugar production of the vegetation using the polygon reference number a_polyref. More...
 
double SupplyPolDD (int a_polyref)
 Returns the current day degree sum for pollen production of the vegetation using the polygon reference number a_polyref. More...
 
bool SupplySkScrapes (int a_polyref)
 Returns the presence of skylark scrapes in the vegetation using the polygon reference number a_polyref. More...
 
double SupplyInterestedGreenBiomass (int a_polyref)
 Returns the insterested green biomass of the vegetation using the polygon reference number a_polyref. More...
 
double SupplyInterestedGreenBiomass (int a_x, int a_y)
 Returns the interested green biomass of the vegetation using the polygon reference number a_polyref. More...
 
double SupplyInterestedGreenBiomassTotal (int a_polyref)
 Returns the interested green biomass of the vegetation+weeds using the polygon reference number a_polyref. More...
 
double SupplyInterestedGreenBiomassTotal (int a_x, int a_y)
 Returns the interested green biomass of the vegetation+weeds using the x,y coordinate. More...
 
double SupplyGreenBiomass (int a_polyref)
 Returns the green biomass of the vegetation using the polygon reference number a_polyref. More...
 
double SupplyGreenBiomass (int a_x, int a_y)
 Returns the green biomass of the vegetation using the polygon reference number a_polyref. More...
 
double SupplyGreenBiomassTotal (int a_polyref)
 Returns the green biomass of the vegetation+weeds using the polygon reference number a_polyref. More...
 
double SupplyGreenBiomassTotal (int a_x, int a_y)
 Returns the green biomass of the vegetation+weeds using the x,y coordinate. More...
 
double SupplyGreenBiomassProp (int a_polyref)
 Returns the green biomass as a proportion of biomass of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
double SupplyGreenBiomassProp (int a_x, int a_y)
 Returns the green biomass as a proportion of biomass of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
double SupplyVegGrowthStage (int a_polyref)
 Returns the vegetation growth stage of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
double SupplyVegGrowthStage (int a_x, int a_y)
 Returns the vegetation growth stage of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
double SupplyDeadBiomass (int a_polyref)
 Returns the dead biomass of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
double SupplyDeadBiomass (int a_x, int a_y)
 Returns the dead biomass of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
double SupplyLAGreen (int a_polyref)
 Returns the green leaf area of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
double SupplyLAGreen (int a_x, int a_y)
 Returns the green leaf area of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
double SupplyLATotal (int a_polyref)
 Returns leaf area in total of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
double SupplyLATotal (int a_x, int a_y)
 Returns leaf area in total of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
double SupplyVegCover (int a_polyref)
 Returns the vegetation cover proportion of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
bool SupplyIsVeg (int a_x, int a_y)
 Indicated if this polygon type is descended from VegElement. More...
 
double SupplyVegCoverVector (unsigned int a_index)
 Returns the vegetation cover proportion of the vegetation using the polygon index to Landscape::m_elems. More...
 
double SupplyVegCover (int a_x, int a_y)
 Returns the vegetation cover proportion of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
TTypesOfVegetation SupplyLastSownVeg (int a_polyref)
 Returns the last type of vegetation sown on a field using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
TTypesOfVegetation SupplyLastSownVeg (int a_x, int a_y)
 Returns the last type of vegetation sown on a field using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
TTypesOfVegetation SupplyLastSownVegVector (unsigned int a_index)
 Returns the last type of vegetation sown on a field using the polygon index to Landscape::m_elems. More...
 
double SupplyInsects (int a_polyref)
 Returns the insect biomass on a polygon using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
double SupplyInsects (int a_x, int a_y)
 Returns the insect biomass on a polygon using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
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...
 
double SupplySeedCoating (int a_polyref, PlantProtectionProducts a_ppp)
 Gets total seed coating for the centorid of a polygen. 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 SupplyPesticidePlantSurface (int a_x, int a_y, PlantProtectionProducts a_ppp)
 Gets plant surface pesticide for a location. More...
 
double SupplyPesticideInPlant (int a_x, int a_y, PlantProtectionProducts a_ppp)
 Gets pesticide within plant for a location. More...
 
double SupplyPesticideNectar (int a_x, int a_y, PlantProtectionProducts a_ppp)
 Gets nectar pesticide for a location. More...
 
double SupplyPesticidePollen (int a_x, int a_y, PlantProtectionProducts a_ppp)
 Gets pollen pesticide for a location. More...
 
PlantProtectionProducts SupplySprayPesticideType (int a_x, int a_y)
 Gets the sprayed pesticide type in the given location. More...
 
double SupplySprayPesticideRate (int a_x, int a_y)
 Gets the sprayed pesticide rate in the given 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...
 
double SupplyPesticidePlantSurface (int a_polyref, PlantProtectionProducts a_ppp)
 Gets plant surface pesticide for the centroid of a polygon. More...
 
double SupplyPesticideInPlant (int a_polyref, PlantProtectionProducts a_ppp)
 Gets pesticide within plant for the centroid of a polygon. More...
 
double SupplyPesticideNectar (int a_polyref, PlantProtectionProducts a_ppp)
 Gets nectar pesticide for the centroid of a polygon. More...
 
double SupplyPesticidePollen (int a_polyref, PlantProtectionProducts a_ppp)
 Gets pollen pesticide for the centroid of a polygon. More...
 
PlantProtectionProducts SupplySprayPesticideType (int a_polyref)
 Gets the sprayed pesticide type in the given field. More...
 
double SupplySprayPesticideRate (int a_polyref)
 Gets the sprayed pesticide rate in the given field. More...
 
RodenticidePredators_Population_Manager * SupplyRodenticidePredatoryManager ()
 
TTypesOfPesticide SupplyPesticideType (void)
 Gets type of pesticide effect from a reference. More...
 
GooseFieldListGetGooseFields (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 LKM - used?? More...
 
void ReadOpenness (void)
 Reads openness values from a standard input file for all polygons LKM - used?? More...
 
int CalculateFieldOpennessCentroid (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 CalculateFieldOpennessAllCells (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...
 
polylistSupplyLargeOpenFieldsNearXY (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...
 
bool SupplyIsHumanDominated (TTypesOfLandscapeElement a_tole_type)
 For the roe deer, determines the extent of human activity and returns bool. 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)
 Returns the centroid of a polygon using the polygon reference number a_polyref. More...
 
APoint SupplyCentroidIndex (int a_polyrefindex)
 Returns the centroid of a polygon using the polygon index in m_elems. More...
 
int SupplyCentroidX (int a_polyref)
 Returns the centroid x-coordinate of a polygon using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
int SupplyCentroidY (int a_polyref)
 Returns the centroid y-coordinate of a polygon using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
int SupplyCentroidX (int a_x, int a_y)
 Returns the centroid x-coordinate of a polygon using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
int SupplyCentroidY (int a_x, int a_y)
 Returns the centroid y-coordinate of a polygon using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y. More...
 
double SupplyFarmIntensity (int a_x, int a_y)
 Returns the farm intensity classification of the polygon using the polygon reference number a_polyref or coordinates a_x, a_y. More...
 
double SupplyFarmIntensity (int a_polyref)
 Returns the farm intensity classification of the polygon using the polygon reference number a_polyref or coordinates a_x, a_y. More...
 
double SupplyFarmIntensityI (int a_polyindex)
 Returns the farm intensity classification of the polygon using the polygon index in m_elems. More...
 
TTypesOfLandscapeElement SupplyElementType (int a_polyref)
 Returns the landscape type of the polygon using the polygon reference number a_polyref or coordinates a_x, a_y. Returns the value as a TTypesOfLandscapeElement. More...
 
TTypesOfLandscapeElement SupplyElementType (int a_x, int a_y)
 Returns the landscape type of the polygon using the polygon reference number a_polyref or coordinates a_x, a_y. Returns the value as a TTypesOfLandscapeElement. More...
 
TTypesOfLandscapeElement SupplyElementTypeCC (int a_x, int a_y)
 Returns the landscape type of the polygon using coordinates a_x, a_y, but allowing correction of coordinates for out of scope values. Returns the value as a TTypesOfLandscapeElement. More...
 
TTypesOfLandscapeElement GetOwner_tole (int a_x, int a_y)
 Returns the landscape type of the polygon owner (used in cases relating to e.g. unsprayed field margins) using coordinates a_x, a_y. Returns the value as a TTypesOfLandscapeElement. More...
 
int SupplyCountryDesig (int a_x, int a_y)
 Returns the designation of country or urban of the polygon using coordinates a_x, a_y. More...
 
int SupplyElementSubType (int a_polyref)
 Returns the landscape element sub-type of the polygon using the polygon reference number a_polyref or coordinates a_x, a_y. More...
 
int SupplyElementSubType (int a_x, int a_y)
 Returns the landscape element sub-type of the polygon using the polygon reference number a_polyref or coordinates a_x, a_y. More...
 
TTypesOfVegetation SupplyVegType (int a_x, int a_y)
 Returns the vegetation type of the polygon using the polygon reference number a_polyref or coordinates a_x, a_y. Returns the value as a # TTypesOfVegetation. More...
 
TTypesOfVegetation SupplyVegType (int polyref)
 Returns the vegetation type of the polygon using the polygon reference number a_polyref or coordinates a_x, a_y. Returns the value as a # TTypesOfVegetation. More...
 
TTypesOfCrops SupplyCropType (int a_x, int a_y)
 Returns the crop type of the polygon using the polygon reference number a_polyref or coordinates a_x, a_y. Returns the value as a # TTypesOfCrops. More...
 
TTypesOfCrops SupplyCropType (int polyref)
 Returns the crop type of the polygon using the polygon reference number a_polyref or coordinates a_x, a_y. Returns the value as a # TTypesOfCrops. More...
 
TTypesOfVegetation SupplyVegTypeVector (unsigned int a_index)
 Returns the vegetation type of the polygon using the polygon index to m_elems. Returns the value as a # TTypesOfVegetation. More...
 
int SupplyGrazingPressureVector (unsigned int a_index)
 Returns the grazing pressure of the polygon using the polygon index to m_elems. More...
 
int SupplyGrazingPressure (int a_polyref)
 Returns the grazing pressure of the polygon using the polygon reference number a_polyref or coordinates a_x, a_y. More...
 
int SupplyGrazingPressure (int a_x, int a_y)
 Returns the grazing pressure of the polygon using the polygon reference number a_polyref or coordinates a_x, a_y. More...
 
vector< int > SupplyPolyWithFlowers (void)
 Returns m_poly_with_flowers, a list of polygons with flowering modelled. More...
 
bool SupplyAttIsHigh (int a_x, int a_y)
 Tests whether the polygon at a_x,a_y is designated as xxx. More...
 
bool SupplyAttIsWater (int a_x, int a_y)
 Returns whether a polygon at coordinates a_x, a_y has the attribute Water set. More...
 
bool SupplyAttIsForest (int a_x, int a_y)
 Returns whether a polygon at coordinates a_x, a_y has the attribute Forest set. More...
 
bool SupplyAttIsForest (int a_polyref)
 Returns whether a polygon at coordinates a_x, a_y has the attribute Forest set. More...
 
bool SupplyAttIsWoody (int a_x, int a_y)
 Returns whether a polygon at coordinates a_x, a_y has the attribute Woody. More...
 
bool SupplyAttIsUrbanNoVeg (int a_x, int a_y)
 Returns whether a polygon at coordinates a_x, a_y, or by a_polyref has the attribute High set. More...
 
bool SupplyAttIsUrbanNoVeg (int a_polyref)
 Returns whether a polygon at coordinates a_x, a_y, or by a_polyref has the attribute High set. More...
 
bool SupplyAttIsVegPatchy (int a_polyref)
 Returns whether a polygon at coordinates a_x, a_y, or by a_polyref has the attribute Is Patchy set. More...
 
bool SupplyAttIsVegPatchy (int a_x, int a_y)
 Returns whether a polygon at coordinates a_x, a_y, or by a_polyref has the attribute Is Patchy set. More...
 
bool SupplyAttIsVegCereal (int a_polyref)
 Returns whether a polygon at coordinates a_x, a_y, or by a_polyref has the attribute Is Cereal set. More...
 
bool SupplyAttIsVegMatureCereal (int a_polyref)
 Returns whether a polygon at coordinates a_x, a_y, or by a_polyref has the attribute Is Mature Cereal set. More...
 
bool SupplyAttIsVegGrass (int a_polyref)
 Returns whether a polygon a_polyref has the attribute Is Grass set. More...
 
bool SupplyAttIsVegGrass (int a_x, int a_y)
 Returns whether a polygon a_polyref has the attribute Is Grass set. More...
 
bool SupplyAttIsVegGooseGrass (int a_polyref)
 Returns whether a polygon a_polyref has the attribute Is Goose Grass set. More...
 
bool SupplyAttIsVegMaize (int a_polyref)
 Returns whether a polygon a_polyref has the attribute Is Maize set. More...
 
bool SupplyAttUserDefinedBool (int a_polyref)
 Returns the user defined boolean attribute of a polygon using the polygon reference number a_polyref, or coordinates a_x, a_y. More...
 
bool SupplyAttUserDefinedBool (int a_x, int a_y)
 Returns the user defined boolean attribute of a polygon using the polygon reference number a_polyref, or coordinates a_x, a_y. More...
 
int SupplyAttUserDefinedInt (int a_polyref)
 Returns the user defined integer attribute of a polygon using the polygon reference number a_polyref. More...
 
void SetAttUserDefinedBool (int a_polyref, bool a_value)
 Sets the user defined boolean attribute of a polygon using the polygon reference number a_polyref. More...
 
void SetAttUserDefinedInt (int a_polyref, int a_value)
 ets the user defined integer attribute of a polygon using the polygon reference number a_polyref More...
 
bool ClassificationHigh (TTypesOfLandscapeElement tole)
 Returns whether the polygon is classfied as high. More...
 
bool ClassificationWater (TTypesOfLandscapeElement tole)
 Returns whether the polygon is classfied as water. More...
 
bool ClassificationFieldType (TTypesOfLandscapeElement a_tole)
 Returns whether the polygon is classfied as a field. More...
 
bool ClassificationUrbanNoVeg (TTypesOfLandscapeElement a_tole)
 Returns whether the polygon is classfied as urban with no vegetation. More...
 
bool ClassificationForest (TTypesOfLandscapeElement a_tole)
 Returns whether the polygon is classfied as woodland. More...
 
bool ClassificationWoody (TTypesOfLandscapeElement a_tole)
 Returns whether the polygon is classfied as woody. More...
 
void Set_all_Att_UserDefinedBool (bool(*udf_fnc)(TTypesOfLandscapeElement))
 used to classify the userdefinedbool attribute and set it - this requires supplying the correct classification function More...
 
void Set_all_Att_UserDefinedInt (int(*udf_fnc)(TTypesOfLandscapeElement))
 used to classify the userdefinedint attribute and set it - this requires supplying the correct classification function More...
 
bool ClassificationVegGrass (TTypesOfVegetation a_vege_type)
 Returns whether a vegetation type is classified as Grass. More...
 
bool ClassificationVegCereal (TTypesOfVegetation a_vege_type)
 Returns whether a vegetation type is classified as cereal. More...
 
bool ClassificationVegMatureCereal (TTypesOfVegetation a_vege_type)
 Returns whether a vegetation type is classified as cereal grown to maturity. More...
 
bool ClassificationVegGooseGrass (TTypesOfVegetation a_vege_type)
 Returns whether a vegetation type is classified as Goose Grass. More...
 
bool ClassificationVegMaize (TTypesOfVegetation a_vege_type)
 Returns whether a vegetation type is classified as maize. More...
 
bool ClassificationPermCrop (TTypesOfVegetation a_vege_type)
 Returns whether a vegetation type is classified as a permanent crop. More...
 
void Set_TOLE_Att (LE *elem)
 Uses a point to an LE instance and sets all the attributes based on its tole type. More...
 
void Set_TOV_Att (LE *elem)
 Uses a point to an LE instance and sets all the attributes based on its tov type. More...
 
bool SupplyLEHigh (int a_x, int a_y)
 Function for backwards code compatibility when Set_Att_High would now be used. More...
 
bool IsFieldType (TTypesOfLandscapeElement a_tole)
 Function for backwards code compatibility when TOV attributes would now be used. More...
 
bool SupplyIsCereal2 (TTypesOfVegetation a_vege_type)
 Function for backwards code compatibility when cereal attributes would now be used. More...
 
bool SupplyIsGrass2 (TTypesOfVegetation a_vege_type)
 Function for backwards code compatibility when grass attributes would now be used. More...
 
bool SupplyVegPatchy (int a_polyref)
 Returns whether the polygon referenced by a_polyref or a_x, a_y has a vegetation type designated as patchy. More...
 
bool SupplyVegPatchy (int a_x, int a_y)
 Returns whether the polygon referenced by a_polyref or a_x, a_y has a vegetation type designated as patchy. More...
 
bool SupplyHasTramlines (int a_x, int a_y)
 Returns whether the polygon referenced by a_polyref or a_x, a_y has a vegetation type with tramlines. More...
 
bool SupplyHasTramlines (int a_polyref)
 Returns whether the polygon referenced by a_polyref or a_x, a_y has a vegetation type with tramlines. More...
 
bool SupplyJustMownVector (unsigned int a_index)
 Returns the whether the vegetation was mown for the polygon referenced the index to Landscape::m_elems. More...
 
bool SupplyJustMown (int a_polyref)
 Returns the whether the vegetation was mown for the polygon referenced by a_polyref or a_x, a_y. More...
 
int SupplyJustSprayedVector (unsigned int a_index)
 Returns whether the polygon referenced by an index to Landscape::m_elems has been sprayed in the last timestep. More...
 
int SupplyJustSprayed (int a_polyref)
 Returns whether the polygon referenced by a_polyref or a_x, a_y has been sprayed in the last timestep. More...
 
int SupplyJustSprayed (int a_x, int a_y)
 Returns whether the polygon referenced by a_polyref or a_x, a_y has been sprayed in the last timestep. More...
 
int SupplyTreeAge (int a_Polyref)
 Returns the tree age for the polygon referenced by a_polyref or a_x, a_y. More...
 
int SupplyTreeAge (int, int)
 Returns the tree age for the polygon referenced by a_polyref or a_x, a_y. More...
 
int SupplyVegAge (int a_Polyref)
 Returns the vegetation age for the polygon referenced by a_polyref or a_x, a_y. More...
 
int SupplyVegAge (int a_x, int a_y)
 Returns the vegetation age for the polygon referenced by a_polyref or a_x, a_y. More...
 
int SupplyNumberOfFarms ()
 Returns the number of farms in the current landscape. More...
 
int SupplyFarmOwner (int a_x, int a_y)
 Returns the farm owner pointer for the polygon referenced by a_polyref or a_x, a_y. More...
 
int SupplyFarmOwner (int a_polyref)
 Returns the farm owner pointer for the polygon referenced by a_polyref or a_x, a_y. More...
 
int SupplyFarmOwnerIndex (int a_x, int a_y)
 Returns the farm owner reference number for the polygon referenced by a_polyref or a_x, a_y. More...
 
int SupplyFarmOwnerIndex (int a_polyref)
 Returns the farm owner reference number for the polygon referenced by a_polyref or a_x, a_y. More...
 
TTypesOfFarm SupplyFarmType (int a_polyref)
 Returns the farm type for the polygon referenced by a_polyref or a_x, a_y. More...
 
TTypesOfFarm SupplyFarmType (int a_x, int a_y)
 Returns the farm type for the polygon referenced by a_polyref or a_x, a_y. More...
 
string SupplyFarmRotFilename (int a_polyref)
 Returns filename for the rotation file (if any) for the polygon referenced by a_polyref or a_x, a_y. More...
 
string SupplyFarmRotFilename (int a_x, int a_y)
 Returns filename for the rotation file (if any) for the polygon referenced by a_polyref or a_x, a_y. More...
 
int SupplyFarmArea (int a_polyref)
 Returns the farm area of a farm that owns a particular polygon. More...
 
double SupplyPolygonAreaVector (int a_polyref)
 Returns the polygon area of a particular polygon using an index to m_elems. More...
 
double SupplyPolygonArea (int a_polyref)
 Returns the polygon area of a particular polygon referenced by polygon. More...
 
int SupplyGrainDist ()
 Returns m_grain_dist, a binary condition for good or bad years of spilled grain. More...
 
void SetGrainDist (int a_dist)
 Sets m_grain_dist, a binary condition for good or bad years of spilled grain. More...
 
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 in stubble. 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)
 Returns the last treatment recorded for the polygon. More...
 
int SupplyLastTreatment (int a_x, int a_y, int *a_index)
 Returns the last treatment recorded for the polygon. More...
 
double GetHareFoodQuality (int a_polygon)
 Returns the hare food quality of polygons LKM. More...
 
double SupplyGlobalRadiation ()
 Passes a request on to the associated Weather class function, the global amount of sunshine for the current day. More...
 
double SupplyGlobalRadiation (long a_date)
 Passes a request on to the associated Weather class function, the global mean amount of sunshine for the current day. More...
 
double SupplyRain (void)
 Passes a request on to the associated Weather class function, the amount of rain for the current day. More...
 
double SupplyTemp (void)
 Passes a request on to the associated Weather class function, the temperature for the current day. More...
 
double SupplyMinTemp (void)
 Passes a request on to the associated Weather class function, the minimum temperature for the current day. More...
 
double SupplyMaxTemp (void)
 Passes a request on to the associated Weather class function, the maximum temperature for the current day. More...
 
double SupplyMinTempYesterday (void)
 Passes a request on to the associated Weather class function, the minimum temperature for yesterday. More...
 
double SupplyMaxTempYesterday (void)
 Passes a request on to the associated Weather class function, the maximum temperature for yesterday. More...
 
double SupplyMinTempTomorrow (void)
 Passes a request on to the associated Weather class function, the minimum temperature for tomorrow. More...
 
double SupplyMaxTempTomorrow (void)
 Passes a request on to the associated Weather class function, the maximum temperature for tomorrow. More...
 
double SupplySoilTemp (void)
 Passes a request on to the associated Weather class function, the soil temperature for the current day. More...
 
double SupplyHumidity (void)
 Passes a request on to the associated Weather class function, the mean humidity for the current day. More...
 
double SupplyMeanTemp (long a_date, unsigned int a_period)
 Passes a request on to the associated Weather class function, the mean temperature for the current day. More...
 
double SupplyWind (void)
 Passes a request on to the associated Weather class function, the wind speed for the current day. More...
 
int SupplyWindDirection (void)
 Passes a request on to the associated Weather class function, the wind direction in 4 directions for the current day. More...
 
int SupplyWindDirection8 (void)
 Passes a request on to the associated Weather class function, the wind direction in 8 directions for the current day. More...
 
double SupplyWindDirectionRadians (void)
 Passes a request on to the associated Weather class function, the wind direction in radians for the current day. More...
 
double SupplySnowDepth (void)
 Passes a request on to the associated Weather class function, the snow depth for the current day. More...
 
bool SupplySnowcover (void)
 Passes a request on to the associated Weather class function, the snow cover for the current day. More...
 
int SupplyDaylength (void)
 Passes a request on to the associated Weather class function, the day length for the current day. More...
 
double SupplyTempHour (int hour)
 Returns the temperature in a given hour (0 to 23) More...
 
double SupplySoilTempHour (int hour)
 Returns the soil temperature in a given hour (0 to 23) More...
 
double SupplyWindHour (int hour)
 Returns the wind speed in a given hour (0 to 23) More...
 
double SupplyRainHour (int hour)
 Returns the amount of rain in a given hour (0 to 23) More...
 
double SupplyRadiationHour (int hour)
 Returns the amount of sunshine in a given hour (0 to 23) More...
 
double SupplyRain (long a_date)
 Passes a request on to the associated Weather class function, the amount of rain for all dates. More...
 
double SupplyTemp (long a_date)
 Passes a request on to the associated Weather class function, the temperature for all dates. More...
 
double SupplySoilTemp (long a_date)
 Passes a request on to the associated Weather class function, the soil temperature for all dates. More...
 
double SupplyWind (long a_date)
 Passes a request on to the associated Weather class function, the wind speed for all dates. More...
 
double SupplyDayDegrees (int a_polyref)
 Passes a request on to the associated Weather class function, the day degrees for all dates. More...
 
double SupplyRainPeriod (long a_date, int a_period)
 Passes a request on to the associated Weather class function, the total amount of rain from a_date and a_period of days. More...
 
double SupplyWindPeriod (long a_date, int a_period)
 Passes a request on to the associated Weather class function, the total wind speed from a_date and a_period of days. More...
 
double SupplyTempPeriod (long a_date, int a_period)
 Passes a request on to the associated Weather class function, the total temperature from a_date and a_period of days. More...
 
bool SupplySnowcover (long a_date)
 Passes a request on to the associated Weather class function, the snow cover for the current day. More...
 
int SupplyPolyRef (int a_x, int a_y)
 Get the in map polygon reference number from the x, y location. More...
 
int SupplyUMRef (int a_x, int a_y)
 Get the unsprayed margin reference number from the polygon at x,y. More...
 
LESupplyPolyLEptr (int a_x, int a_y)
 Get the pointer to the LE object associated with the polygon at x,y location or by using the polygon reference. More...
 
LESupplyPolyLEptr (int a_polyref)
 Get the pointer to the LE object associated with the polygon at x,y location or by using the polygon reference. More...
 
int SupplyPolyRefIndex (int a_x, int a_y)
 Get the index to the m_elems array for a polygon at location x,y. More...
 
int SupplyPolyRefCC (int a_x, int a_y)
 Get the in map polygon reference number from the x,y location, and correcting for possible wrap around coordinates. More...
 
vector< LE * > * SupplyPolyListPtr ()
 Returns the pointer to m_elemns. More...
 
int SupplySimAreaWidth (void)
 Gets the simulation landscape width. More...
 
int SupplySimAreaHeight (void)
 Gets the simulation landscape height. More...
 
int SupplySimAreaMaxExtent (void)
 Returns which ever is larger, height or width of simulation landscape. More...
 
int SupplySimAreaMinExtent (void)
 Returns which ever is smaller, height or width of simulation landscape LKM - used?? More...
 
int SupplyDaylength (long a_date)
 Passes a request on to the associated Calendar class function, the day length. More...
 
int SupplyDayInYear (void)
 Passes a request on to the associated Calendar class function, the day in the year. More...
 
int SupplyHour (void)
 Passes a request on to the associated Calendar class function, the hour of the day. More...
 
int SupplyMinute (void)
 Passes a request on to the associated Calendar class function, the minute of the hour. More...
 
unsigned int SupplyNumberOfPolygons (void)
 Returns the number of polygons in the landscape. More...
 
TTypesOfLandscapeElement SupplyElementTypeFromVector (unsigned int a_index)
 Gets the TTypesOfVegetation type of a polygon using the m_elems. More...
 
TTypesOfLandscapeElement SupplyOwner_tole (int a_x, int a_y)
 Gets the farm owner reference of a polygon, or -1 if not owned by a farmer. More...
 
int SupplyPolyRefVector (unsigned int a_index)
 Gets the polygon reference number from the index to m_elems. More...
 
int SupplyPesticideCell (int a_polyref)
 Gets the index to the cell used to store pesticide information from the coordinates x, y. More...
 
int SupplyValidX (int a_polyref)
 Returns an x-coordinate guaranteed to be within the polygon referenced. More...
 
int SupplyValidY (int a_polyref)
 Returns an y-coordinate guaranteed to be within the polygon referenced. More...
 
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)
 Function to prevent wrap around errors with width LKM. More...
 
int CorrectHeight (int y)
 Function to prevent wrap around errors with height LKM. More...
 
void SetPolyMaxMinExtents (void)
 Sets MapValid as true for each polygon found. More...
 
void CalculateCentroids (void)
 Calculate centroid for each polygon found. More...
 
void DumpCentroids (void)
 Saves centroid information for each polygon found. More...
 
void BuildingDesignationCalc ()
 used to calculate whether a building as rural or town - for rodenticide use More...
 
void CentroidSpiralOut (int a_polyref, int &a_x, int &a_y)
 Function to move from midx & midy and outwards in concentric circles until a location that matches the polyref is found LKM. More...
 
const char * SupplyVersion (void)
 Returns version info LKM. More...
 
void DumpPublicSymbols (const char *a_dumpfile, CfgSecureLevel a_level)
 Dumps all configuration values with a security level at or below a_level to a_dumpfile in alphabetical order. More...
 
void DumpAllSymbolsAndExit (const char *a_dumpfile)
 Dumps all configuration values, including private ones, to a_dumpfile and then calls exit() More...
 
bool ReadSymbols (const char *a_cfgfile)
 Reads and parses a_cfgfile for configuration values. More...
 
void DumpMapInfoByArea (const char *a_filename, bool a_append, bool a_dump_zero_areas, bool a_write_veg_names)
 Dumps landscape information by area LKM. More...
 
void Warn (std::string a_msg1, std::string a_msg2)
 Wrapper for the g_msg Warn function. More...
 
int * SupplyMagicMapP (int a_x, int a_y)
 Returns a pointer to the map at position x, y. The value found through it is an internal number from the landscape simulator, that uniquely identifies a polygon, it is not the polygon number - to find this apply MagicMap2PolyRef. More...
 
int MagicMapP2PolyRef (int a_magic)
 Converts the internal number generated from SupplyMagicMapP to the polygon number. More...
 
int SupplyRoadWidth (int, int)
 Returns the width of roads. More...
 
double SupplyTrafficLoad (int a_x, int a_y)
 Returns the traffic load. More...
 
double SupplyTrafficLoad (int a_polyref)
 Returns the traffic load. More...
 
int SupplyTreeHeight (int, int)
 Returns the height of trees. More...
 
int SupplyUnderGrowthWidth (int, int)
 Returns the width of undergrowth. More...
 
int SupplyTreeHeight (int)
 Returns the height of trees. More...
 
int SupplyUnderGrowthWidth (int)
 Returns the width of undergrowth. More...
 
long SupplyGlobalDate (void)
 Passes a request on to the associated Calendar class function, returns the simulation global date for the day, month and year supplied. More...
 
int SupplyYear (void)
 Passes a request on to the associated Calendar class function, returns m_year. More...
 
int SupplyYearNumber (void)
 Passes a request on to the associated Calendar class function, returns m_simulationyear
More...
 
int SupplyMonth (void)
 Passes a request on to the associated Calendar class function, returns m_month + 1 (the calendar month)
More...
 
std::string SupplyMonthName (void)
 Passes a request on to the associated Calendar class function, returns the month name (e.g., January)
More...
 
int SupplyDayInMonth (void)
 Passes a request on to the associated Calendar class function, returns m_day_in_month
More...
 
double SupplyDaylightProp ()
 Passes a request on to the associated Calendar class function, returns m_daylightproportion
More...
 
double SupplyNightProp ()
 Passes a request on to the associated Calendar class function, returns 1.0 - m_daylightproportion
More...
 
void SupplyLEReset (void)
 Resets internal state for the LE loop generator. More...
 
int SupplyLENext (void)
 Returns -1 at if the end of the list of m_elems is reached, polyref otherwise. More...
 
int SupplyLECount (void)
 Returns number of all landscape elements. More...
 
LE_Signal SupplyLESignal (int a_polyref)
 Returns current signal mask for polygon. More...
 
void SetLESignal (int a_polyref, LE_Signal a_signal)
 Writes the mask back out to the polygon. More...
 
void IncTreatCounter (int a_treat)
 Records that a farm treatment of the type specified has occurred. More...
 
TTypesOfLandscapeElement TranslateEleTypes (int EleReference)
 Returns element type translated from the ALMaSS reference number. More...
 
TTypesOfVegetation TranslateVegTypes (int VegReference)
 Returns vegetation type translated from the ALMaSS reference number. More...
 
TTypesOfLandscapeElement TranslateEleTypesFromString (string EleReference)
 Returns element type translated from the ALMaSS reference string. More...
 
LESupplyLEPointer (int a_polyref)
 Returns a pointer to the object referred to by the polygon number. More...
 
int BackTranslateEleTypes (TTypesOfLandscapeElement EleReference)
 Returns the ALMaSS reference number translated from the TTypesOfLandscapeElement type. More...
 
int BackTranslateVegTypes (TTypesOfVegetation VegReference)
 Returns the ALMaSS reference number translated from the TTypesOfVegetation type. More...
 
std::string EventtypeToString (int a_event)
 Returns the text representation of a treatment type. More...
 
std::string PolytypeToString (TTypesOfLandscapeElement a_le_type)
 Returns the text representation of a TTypesOfLandscapeElement type. More...
 
std::string VegtypeToString (TTypesOfVegetation a_veg)
 Returns the text representation of a TTypesOfVegetation type. More...
 
std::string CropTypeToString (TTypesOfCrops a_crop)
 Returns the text representation of a TTypesOfCrops type. More...
 
std::string FarmtypeToString (TTypesOfFarm a_farmtype)
 Returns the text name of a TTypesOfFarm type. More...
 

Public Attributes

int m_grain_dist
 Declaration of attribute, m_grain_dist, a binary condition for good or bad years of spilled grain. More...
 

Protected Member Functions

void GISASCII_Output (string outpfile, int UTMX, int UTMY)
 Write ASCII file of the ALMaSS map. More...
 
int ReadPolys1 (const char *a_polyfile)
 Is used to take a look in the input file for polygons to figure out what the format is (since multiple formats are allowed) More...
 
void ReadFlowerSpeciesComp (const char *a_flower_file)
 This function is to read the habitat species composition for flower resource. More...
 
void ReadPolys2 (const char *a_polyfile, int a_format)
 Based on the format of the file (since multiple formats are allowed), this reads the polygon information from an input file. This method sets up the Landscape::m_polymapping lookup table, checks validity of polygon and associated farm information and creates the LE instances to populate the Landscape::m_elems array, and if needed creates the links between unsprayed margins and the owner tole type. More...
 
void PolysValidate (bool a_exit_on_invalid)
 Checks for internal consistency in the polygon information, e.g. being sure that all polygons mentioned are actually in the map. More...
 
bool PolysRemoveInvalid (void)
 Checks whether all polygons are in the map, removing those that are not. More...
 
void PolysDump (const char *a_filename)
 Called if the landscape is manipulated to save the new version of the polyref input file. More...
 
void DumpMap (const char *a_filename)
 Called if the landscape is manipulated to save the new version of the.lsb input file(i.e.the topographical map) More...
 
void ConsolidatePolys (void)
 Used to replace polygons or combine them when there is no special management associated with them.This just reduces the number of polygon entries and saves time and space. More...
 
void CountMapSquares (void)
 Calculates the area for each polygon in the mapand stores it in LE::m_squares_in_map. More...
 
void PolysRenumber (void)
 Renumbers the polygons from 0 to the number of LE instances - 1. This saves space, and also means that the polygon number becomes the same as the index in Landscape::m_elems, allowing quicker lookup(reduces indirection by 1) More...
 
void RebuildPolyMapping ()
 Called if there is any change in the polygons and loops through all polygons resetting the Landscape::m_polymapping value. More...
 
void ForceArea (void)
 Check of polygon areas. Each polygon should be present in the map with the correct area recorded, otherwise this method raises an error. More...
 
void ChangeMapMapping (void)
 Maps the polygon numbers directly to the indices in m_elems. More...
 
LENewElement (TTypesOfLandscapeElement a_type)
 NewElement Creates a new LE instance and where possible it will create the highest level in the class hierarchy e.g. tole_Portarea has no behaviour so can be created as a NonVegElement (LE->NonVegElement), removing the need to have a Portarea class. More...
 
void RemoveMissingValues ()
 A method for replacing missing values in the map with corrected ones. More...
 
void VegDump (int x, int y)
 Records vegetation charateristics for the x, y location. More...
 
void EventDump (int x, int y, int x2, int y2)
 Records farm events carried out on the x, y locations. More...
 
void EventDumpPesticides (int x1, int y1)
 Records pesticided application farm events carried out on the x,y location. More...
 
void DegreesDump ()
 Prints the sum of day degrees. See FarmManager::daydegrees. More...
 
bool BorderNeed (TTypesOfLandscapeElement a_letype)
 Currently unused test for adding borders. More...
 
int BorderAdd (LE *a_field, TTypesOfLandscapeElement a_type, int a_allAround=1)
 Adds a border of the specified type (could be an unsprayed margin) around a field
More...
 
bool BorderTest (int a_fieldindex, int a_borderindex, int a_x, int a_y)
 Used to decide if a coordinate location should become a border/unsprayed margin. More...
 
void BorderRemoval (void)
 Removes field boundaries, hedgebanks and hedges if they are adjacent to a field. More...
 
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 AddBeetleBanks (TTypesOfLandscapeElement a_tole)
 The starting point for adding beetlebanks to a field (can be used to add ‘banks’ of any tole_type. More...
 
int AddBeetleBankIfPossible (LE *a_field, TTypesOfLandscapeElement a_tole)
 Determines whether a beetlebank can be added to the field depending on physical characteristics and adds it. More...
 
bool FindFieldCenter (LE *a_field, int *x, int *y)
 Finds a location in the middle of a field to ‘seed a beetlebank’ More...
 
int FindLongestAxis (int *x, int *y)
 From a central location finds the longest axis of a field. More...
 
int FindBestRectangle (int a_polyindex, int *a_x, int *a_y, int *a_width, int *a_x_start, int *a_y_start)
 From a central location finds the biggest rectangle that fits inside the field. More...
 
void AxisLoop (int a_poly, int *a_x, int *a_y, int a_axis)
 Tests the length of a vector to find when we step outside a given polygon. More...
 
void AddPatches (TTypesOfLandscapeElement a_tole)
 The starting point for adding patches to a field (can be used to add patches of any tole_type) More...
 
int AddPatchIfPossible (LE *a_field, TTypesOfLandscapeElement a_tole)
 Determines whether a patch can be added to the field depending on physical characteristics and adds it. More...
 
void hb_Add (void)
 The entry point for adding hedgebanks. Hedgebanks are created by replacing part of hedge polygons with the tole_HedgeBank If the hedge is wide this will be with a border on each side, if narrow then by inserting hedgebank between trees. More...
 
void hb_AddNewHedgebanks (int a_orig_poly_num)
 Adds new hedgebanks. More...
 
int hb_StripingDist (void)
 Striping distribution function for the new hedgebanks LKM. More...
 
void hb_GenerateHBPolys (void)
 Creates the necessary new hedgebank polygons in Landscape::m_elems. More...
 
void hb_FindHedges (void)
 Generate a list of polygon numbers for new hedgebank addition. More...
 
bool hb_FindBoundingBox (int a_poly_num)
 Finds a rectangle that encloses the hedge to be manipulated. More...
 
void hb_UpPolyNumbers (void)
 Adds a big number to all polygon refs in the map to create space to safely manipulate the hedge pixels. More...
 
void hb_ClearPolygon (int a_poly_num)
 Replaces all values in the map for a polygon with a temporary value ready for manipulation. More...
 
void hb_PaintBorder (int a_color)
 Identifies all border hedge pixels. More...
 
bool hb_MapBorder (int a_x, int a_y)
 Checks for out of bounds hedgebank coordinates. More...
 
bool hb_HasOtherNeighbour (int a_x, int a_y)
 Checks if a pixel has any non hedge neighbour cell. More...
 
bool hb_PaintWhoHasNeighbourColor (int a_neighbour_color, int a_new_color)
 Pushes a value to a pixel cell that denotes that is has a neighbour that is not hedge. More...
 
bool hb_HasNeighbourColor (int a_x, int a_y, int a_neighbour_color)
 Tests for an already process neighbour cell. More...
 
void hb_MarkTopFromLocalMax (int a_color)
 Used to identify the distance a cell is from the centre of a hedge. More...
 
void hb_MarkTheBresenhamWay (void)
 ‘Paints’ the core of a hedge with a negative number for use in deciding what becomes hedgebank later More...
 
int hb_MaxUnpaintedNegNeighbour (int a_x, int a_y)
 Determines the width from centre to edge of hedge. More...
 
void hb_ResetColorBits (void)
 Remove high number colour bits from the map. More...
 
void hb_RestoreHedgeCore (int a_orig_poly_number)
 LKM. More...
 
void hb_DownPolyNumbers (void)
 Reverses the process carried out by Landscape::hb_UpPolyNumbers. More...
 
void DumpMapGraphics (const char *a_filename)
 Saves the graphics for the landscape LKM. More...
 
void DumpTreatCounters (const char *a_filename)
 When the simulation is closed this method saves the number of each farm management that has been carried out. More...
 

Protected Attributes

int m_treatment_counts [last_treatment]
 Array for containing the treatment counts. More...
 
int m_LargestPolyNumUsed
 The largest polygon number used. More...
 
vector< int > m_PondIndexList
 List of pond indexes. More...
 
vector< int > m_PondRefsList
 List of pond polyrefs. More...
 
vector< int > hb_hedges
 Declaration of attributes for hedgebanks. More...
 
vector< LE * > hb_new_hbs
 
int m_x_add [16]
 
int m_y_add [16]
 
int * hb_map
 
int hb_width
 
int hb_height
 
int hb_size
 
int hb_min_x
 
int hb_max_x
 
int hb_min_y
 
int hb_max_y
 
int hb_first_free_poly_num
 
int hb_core_pixels
 
int hb_border_pixels
 
TTypesOfPesticide m_PesticideType
 An attribute to hold the pesticide type being tested, if there is one, if not default is -1. More...
 
bool m_toxShouldSpray
 A flag indicating whether pesticide should be sprayed. More...
 
int le_signal_index
 Index for the LE signal loop. More...
 
std::string m_countryCode = "None"
 Declaration of attributes for country and coordinates. More...
 
double m_latitude = -1
 
double m_longitude = -1
 
bool m_firstyear
 Flag to indicate the that the first year is run (i.e. before simulation starts) More...
 
string LandscapeName
 A holder for the landscape name for output if needed. More...
 

Private Member Functions

void GrainDump ()
 Records total amount of grain / seed / maize available as forage for each polygon. More...
 

Private Attributes

std::vector< omp_nest_lock_t * > m_poly_omp_locks
 The locks for all the polygon. More...
 
char m_versioninfo [30]
 Version info. Initialized by the constructor. More...
 
FarmManagerm_FarmManager
 List of all the farms. More...
 
vector< LE * > m_elems
 List of all landscape elements. The index is a sequential number, to get the polynum look this number up in m_polymapping. More...
 
RasterMapm_land
 The big map. More...
 
vector< int > m_polymapping
 
vector< int > m_poly_with_flowers
 
PesticideMapm_PesticideMap = nullptr
 For specialised pesticide recording. More...
 
PesticideTablem_PesticideTable = nullptr
 For specialised pesticide recording. More...
 
PestIncidenceManagerm_PestIncidenceManager
 A pest incidence manager. More...
 
double m_pestincidencefactor
 
int m_width
 Declaration of attributes for correcting coordinates before modulus operations, saves an indirection when doing inline function calls. More...
 
int m_height
 Area length. More...
 
int m_width10
 Area width times 10. More...
 
int m_height10
 Area length times 10. More...
 
int m_minmaxextent
 Area minimum extent, the smallest value of m_width or m_height
More...
 
int m_maxextent
 Area maximum extent, the largest value of m_width or m_height
More...
 
int m_area
 Area of the whole landscape. More...
 
bool m_NeedCentroidCalculation
 A flag to ensure centroid calculation on object construction. More...
 
bool m_NeedOpennessCalculation
 A flag to ensure openness calculation on object construction. More...
 
bool m_DoMissingPolygonsManipulations
 A flag to signal that missing polygons exist. More...
 
double * l_vegtype_areas
 For veg area dumps. More...
 
PopulationManagerListm_ThePopManagerList
 A pointer to the current main population manager. More...
 
RodenticideManager * m_RodenticideManager
 A pointer to the rodenticide manager. More...
 
RodenticidePredators_Population_Manager * m_RodenticidePreds
 A pointer to the Rodenticide predators population´manager. More...
 
Polynomial2CurveClassm_GooseIntakeRateVSVegetationHeight_PF
 A curve relating goose intake rates in KJ/min to vegetation height for Pink-footed Goose (PF) More...
 
Polynomial2CurveClassm_GooseIntakeRateVSVegetationHeight_BG
 A curve relating goose intake rates in KJ/min to vegetation height for Barnacle Goose (BG) More...
 
Polynomial2CurveClassm_GooseIntakeRateVSVegetationHeight_GL
 A curve relating goose intake rates in KJ/min to vegetation height for Greylag Goose (GL) More...
 
std::map< int, vector< int > > m_habitat_species
 This the dictionary to store the composition of species for every habitat type. More...
 
std::map< int, vector< double > > m_habitat_flower_num
 This is the dictionary to store the proportion of each composition for every habitat. More...
 
std::map< int, PollenNectarDatam_habitat_pollen
 This is the dictionary to store the pollen data of each habitat type for the given day. More...
 
std::map< int, PollenNectarDatam_habitat_nectar
 This is the dictionary to store the nectar data of each habitat type fo the given day. More...
 
std::map< int, vector< APoint > > m_poly_cell_locs
 This is the dictionary to store all the locations for each polygon. More...
 
std::map< int, vector< APoint > > m_poly_cell_locs_pollen
 This is the dictionary to store all the locations used for quick access to pollen. More...
 
std::map< int, int > m_index_locs_pollen
 This is the dictionary to store all the index in m_poly_cell_locs_pollen start from which there is no pollen available. More...
 
std::map< int, vector< APoint > > m_poly_cell_locs_nectar
 This is the dictionary to store all the locations used for quick access to nectar. More...
 
std::map< int, int > m_index_locs_nectar
 This is the dictionary to store all the index in m_poly_cell_locs_nectar start from which there is no nectar available. More...
 
Eigen::MatrixXf m_pollen_map
 This is the matrix to store the pollen proportion (0-1) left for each cell. More...
 
Eigen::MatrixXf m_nectar_map
 This is the matrix to store the nectar proportion (0-1) left for each cell. More...
 
Eigen::ArrayXXf m_biomass_map
 This is the array to store the green biomass for each cell. More...
 
Eigen::ArrayXXi m_polyid_map
 This is the array to store the polygon ID for each cell. More...
 
std::vector< std::vector< std::vector< int > > > m_map_polyid_within_dist
 This is the vector to store all the polygon IDs within a certain distance to each location in a landscape. More...
 

Detailed Description

The landscape class containing all environmental and topographical data.

Constructor & Destructor Documentation

◆ ~Landscape()

Landscape::~Landscape ( void  )
2890  {
2891  for (int i=0; i<m_poly_omp_locks.size(); i++){
2892  omp_destroy_nest_lock(m_poly_omp_locks[i]);
2893  delete m_poly_omp_locks[i];
2894  }
2897  }
2898 
2899 #ifdef __RECORDFARMEVENTS
2900  m_farmeventfile->close();
2901  delete m_farmeventfile;
2902 #endif
2903 
2904  for ( unsigned int i = 0; i < m_elems.size(); i++ )
2905  delete m_elems[ i ];
2906 
2907  free( l_vegtype_areas );
2908  delete m_land;
2909  //delete g_rotation;
2910  delete m_PestIncidenceManager;
2912  {
2913  delete m_RodenticideManager;
2914  delete m_RodenticidePreds;
2915  }
2916  delete m_FarmManager;
2920  // delete g_msg; // Must be last.
2921 
2922  if (m_PesticideMap)
2923  {
2924  delete m_PesticideMap;
2925  }
2926 
2927  if (m_PesticideTable)
2928  {
2929  delete m_PesticideTable;
2930  }
2931 }

References cfg_rodenticide_enable, l_map_dump_treatcounts_enable, l_map_dump_treatcounts_file, CfgBool::value(), and CfgStr::value().

◆ Landscape()

Landscape::Landscape ( bool  dump_exit = true)

The landscape constructor sets up all the mapping, environment and management for the landscape simulation.

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.

After the main structure is created the constructor can carry out optional more complex manipulations. These are adding hedgebanks, field boundaries, softening orchard boundaries, adding unsprayed margins, and adding beetlebanks.

After special manipulations the graphics for the landscape can be saved.

If there were any structural changes to the map by the time the execution reaches towards the end of the constructor, then a series of checks are run, before the map is saved as a new map with a _dump added to the end of the current map name. This ensures that the saved map is internally consistent.

Counts up the ponds and store them, at this point the constructor is finished with structural polygon handling.

The Farm managment is then initiated, which means that from this point all polygons will have a type of vegetation allocated. Once all polygons have their tov types, the attributes based on tov type are set.

There are a number of options to dump vegetation, event etc. information if selected, this depends on different configureation variables as needed.

If rodenticide handling is enabled then rodenticide mapping provides access to predicted relative density of poisoned rodents per unit area. To do this the constructor creates a RodenticideManager and a RodenticidePredators_Population_Manager

Optional output files are created here as needed depending on defines or config variables

There is a also some special set up required for some species models which is done at the end of the constructor

1806  {
1810  // Set up operation flags
1811  bool didRenumber = false;
1812  bool didCalcCentroids = false;
1813  bool didConsolidate = false;
1814  bool didCalcOpenness = false;
1815  bool didCalcOther = false;
1816  m_NeedCentroidCalculation = false;
1817  m_NeedOpennessCalculation = false;
1819  // Set up globals
1820  g_landscape_ptr = this;
1821  for (int i = 1; i <= 2000; i++) {
1822  g_speedy_Divides[i] = 1 / double(i);
1823  }
1824  // The following arrays correspond to:
1825  // 0, 22.5, 45, 67.5, 90, 112.5, 135, 157.5, 180, 202.5, 225, 247.5, 270, 292.5, 315, 337.5
1826  // E, ENE, NE, NNE, N, NNW, NW, WNW, W, WSW, SW, SSW, S, SSE, SE, ESE
1827  int x_add[16] = { 1, 2, 1, 1, 0, -1, -1, -2, -1, -2, -1, -1, 0, 1, 1, 2 };
1828  int y_add[16] = { 0, -1, -1, -2, -1, -2, -1, -1, 0, 1, 1, 2, 1, 2, 1, 1 };
1829  for (int i = 0; i < 16; i++) {
1830  m_x_add[i] = x_add[i];
1831  m_y_add[i] = y_add[i];
1832  }
1833 
1835 
1837  cout << "This program uses the Landscape simulator " << m_versioninfo << endl;
1838  }
1839 #ifdef __GITVERSION
1841  {
1842  std::cout << "hash=" << GIT_HASH << ", time=" << COMPILE_TIME << ", branch=" << GIT_BRANCH << std::endl;
1843  }
1844 #endif
1845 
1846 
1847  // For creating a list of all cfg symbols when needed.
1848  //g_cfg->DumpPublicSymbols( "publicsymbols.cfg", CFG_PUBLIC );
1849  //exit(1);
1850 
1851  m_LargestPolyNumUsed = -1;
1852  m_pestincidencefactor = 1.0;
1853 
1854  // Reset treatment counters.
1855  for (int i = 0; i < last_treatment; i++) {
1856  m_treatment_counts[i] = 0;
1857  }
1858  // Due to difficulties with ordering of events here we take a sneak peek at the polyref file
1859  cout << "Setting country and lat/long " << l_map_poly_file.value() << endl;
1860  int format = ReadPolys1(l_map_poly_file.value());
1861 
1862  cout << "Creating FarmManager Object" << endl;
1863  m_FarmManager = new FarmManager(this);
1864 
1867  }
1868  // Set the vegetation type biomass scalers
1869  for (int v = 0; v < tov_Undefined; v++) { VegElement::SetBiomassScalers(static_cast<TTypesOfVegetation>(v)); }
1870  cout << "Reading polygon reference file " << l_map_poly_file.value() << endl;
1871  ReadPolys2(l_map_poly_file.value(), format); // lct: creates LE ( Landscape->m_elems[i] ) associated to each polygon, and associted field polygons to farm owners, and sets flags for borders and unsprayed margin processing
1872 
1873  cout << "Creating RasterMap Object from file " << l_map_map_file.value() << endl;
1874  m_land = new RasterMap(l_map_map_file.value(), this);
1875  m_width = m_land->MapWidth();
1876  m_height = m_land->MapHeight();
1877  m_area = m_width * m_height;
1879  m_width10 = 10 * m_width;
1880  m_height10 = 10 * m_height;
1882 
1884  // Validate polygons, ie. ensure those reference in the
1885  // polygon file also shows up in the map.
1886  cout << "In PolysValidate" << endl;
1887  PolysValidate(false);
1888  cout << "In PolysRemoveInvalid" << endl;
1890  cout << "Creating ponds" << endl;
1891  if (cfg_MaxPondSize.value() > 0) {
1892  // This takes any small freshwater and converts it to a pond.
1893  for (unsigned int i = 0; i < m_elems.size(); i++) {
1894  if (m_elems[i]->GetElementType() == tole_Freshwater) {
1895  if (m_elems[i]->GetArea() <= cfg_MaxPondSize.value()) {
1896  Pond* pond = new Pond(this);
1897  pond->DoCopy(m_elems[i]);
1898  pond->SetALMaSSEleType(g_letype->BackTranslateEleTypes(tole_Pond));
1899  pond->SetElementType(tole_Pond);
1900  // lct: We need to free the previous memory , then link to new element
1901  delete m_elems[i];
1902  m_elems[i] = dynamic_cast<LE*>(pond);
1903  }
1904  }
1905  }
1906  }
1907  cout << "In PolysValidate second time" << endl;
1908  PolysValidate(true);
1909 
1916  {
1917  cout << "In DoMissingPolygonsManipulations" << endl;
1918  // Find big continuous polygons
1919  for (unsigned int i = 0; i < m_elems.size(); i++)
1920  {
1921  if (m_elems[i]->GetElementType() == tole_Missing)
1922  {
1923  double area = m_elems[i]->GetArea();
1924  int areaMinrect = (m_elems[i]->GetMaxX() - m_elems[i]->GetMinX()) * (m_elems[i]->GetMaxY() - m_elems[i]->GetMinY());
1925  if ((areaMinrect / area > 4) || (area < 1000))
1926  {
1927  // Unlikely to be a field, or if so a very narrow odd one. We will assume this is a missing data issue.
1928  }
1929  else
1930  {
1931  // Big poly with more than 25% of the included rectangle covered, must be a field of some sort.
1932  // create a new wasteland and swap this in to the m_elems, then delete the old missing polygon
1933  LE * wl = NewElement(tole_Wasteland);
1934  wl->SetPoly(m_elems[i]->GetPoly());
1935  wl->SetArea(floor(0.5 + area)); // lct: To Remove This was already rounded wl->SetArea(area) should be enough
1936  wl->SetSoilType(m_elems[i]->GetSoilType());
1937  wl->SetUnsprayedMarginPolyRef(-1);
1938  wl->SetCentroid(-1, -1);
1939  wl->SetOpenness(0);
1940  delete m_elems[i];
1941  m_elems[i] = wl;
1942  }
1943  }
1944  }
1945  // By here all the big ones should be safely tidied away to wasteland and now we need to deal with the raster map.
1947  for (unsigned int i = 0; i < m_elems.size(); i++)
1948  {
1949  // Now we deal with all the little ones that were not by fields
1950  if (m_elems[i]->GetElementType() == tole_Missing)
1951  {
1952  LE * wl = NewElement(tole_Wasteland);
1953  wl->SetPoly(m_elems[i]->GetPoly());
1954  wl->SetArea(m_elems[i]->GetArea());
1955  wl->SetSoilType(m_elems[i]->GetSoilType());
1956  wl->SetUnsprayedMarginPolyRef(-1);
1957  wl->SetCentroid(-1, -1);
1958  wl->SetOpenness(0);
1959  delete m_elems[i];
1960  m_elems[i] = wl;
1961  }
1962  }
1963  cout << "In PolysValidate third time" << endl;
1964  PolysValidate(false);
1965  if (PolysRemoveInvalid()) {
1966  cout << "In PolysValidate fourth time" << endl;
1967  PolysValidate(true);
1968  }
1969  g_msg->Warn("Landscape::Landscape(): Dump and normal exit to follow after resolving missing polygons. ", "");
1970  didCalcOther = true;
1971  }
1972 
1973  // ChangeMapMapping() also enters a valid starting
1974  // coordinate for the border generating farm method below.
1975  cout << "In ChangeMapMapping" << endl;
1976  ChangeMapMapping();
1977 
1981  if ((m_LargestPolyNumUsed != ((int)m_elems.size() - 1)))
1982  {
1983  cout << "In poly renumber" << endl;
1984 
1985  PolysRenumber();
1986  didRenumber = true;
1987  }
1988  // do we want to remove small polygons?
1990  {
1991  cout << "In Landscape::Landscape() Small polygon removal" << endl;
1992  int removed = RemoveSmallPolygons();
1993  g_msg->Warn("Landscape::Landscape(): Dump and normal exit to follow after removing small polygons and map dump. Polygons removed:", removed);
1994  didCalcOther = true;
1995  }
1996  // Do we want to re-write the current files and consolidate polys?
1997  else if (l_map_consolidatepolys.value())
1998  {
1999  cout << "In consolidate polys" << endl;
2000  didConsolidate = true;
2001  ConsolidatePolys();
2002  }
2003  else if (g_map_le_borderremoval.value())
2004  {
2005  cout << "In map_le_borderremoval" << endl;
2006  // Does not use centroids so is safe to use here
2007  BorderRemoval();
2008  CountMapSquares();
2009  ForceArea();
2010  g_msg->Warn(WARN_FILE, "Landscape::Landscape() - BorderRemoval "" map dump to follow.", "");
2011  didCalcOther = true;
2012  }
2013 
2014 
2015  // By the time we reach this point we need to have completed all major polygon removal and are ready to calculate centroids if they are needed. There
2016  // are two reasons for this - 1) that we did not have them in the original polyref file, 2) that we changed the map
2017  if (didConsolidate || didCalcOther || m_NeedCentroidCalculation)
2018  {
2019  PolysValidate(false);
2020  if (PolysRemoveInvalid()) PolysValidate(true);
2021  ChangeMapMapping();
2022  PolysRenumber();
2024  didCalcCentroids = true;
2025  }
2026  if (didConsolidate || didCalcOther || m_NeedCentroidCalculation || didCalcCentroids || l_map_calc_openness.value())
2027  {
2029  else CalculateOpenness(false);
2030  didCalcOpenness = true;
2031  }
2032  if (didCalcCentroids || didConsolidate || didCalcOpenness || didCalcOther || m_NeedCentroidCalculation || didRenumber || !m_FarmManager->GetIsRenumbered())
2033  {
2034  // We need to dump the map and polyrefs
2035  string filestr = l_map_map_file.value();
2036  std::size_t ind = filestr.find(".lsb"); // Find the starting position of substring in the string
2037  if (ind != std::string::npos) {
2038  filestr.erase(ind, 4); // erase function takes two parameter, the starting index in the string from where you want to erase characters and total no of characters you want to erase.
2039  std::cout << filestr << "\n";
2040  }
2041  string dumpmap = filestr + "_dump.lsb";
2042  string farmstr = filestr + "_farmref_dump.txt";
2043  string polystr = filestr + "_polyref_dump.txt";
2044 
2045  m_FarmManager->DumpFarmrefs(farmstr.c_str());
2046  DumpMap(dumpmap.c_str());
2047  PolysDump(polystr.c_str());
2048  if (dump_exit) {
2049  g_msg->Warn(WARN_FILE, "Landscape::Landscape() ""Normal exit after dump.", "Remember to rename the new map and polyref file.");
2050  exit(0);
2051  }
2052  else {
2053  g_msg->Warn(WARN_FILE, "Landscape::Landscape() ""Dump file done", "Remember to rename the new map and polyref file.");
2054  }
2055  }
2056 
2062  // Below here we have the more complicated map manipulations. These will need recalculation of centroids and openness after they are run.
2063  // However, we really do not want to get here with invalid centroids, hence forced dump and exit for manipulations up to this point.
2064 
2065  didCalcOther = false;
2066  // Add artificial hedgebanks to the hedges in the landscape,
2067  // if requested.
2068  if (l_map_art_hedgebanks.value()) {
2069  hb_Add();
2070  didCalcOther = true;
2071  }
2072  else if (g_map_le_borders.value()) // Can't create borders and hedgerows at the same time, so independently checked
2073  {
2074  cout << "Generating LE Borders around fields" << endl;
2075  cout << "Border chance = " << g_map_le_border_chance.value() << endl;
2076  cout << "Border width = " << g_map_le_borderwidth.value() << endl;
2077  cout << "Adding Borders" << endl;
2078 
2079  // Keep track of how much area the borders take up per farm
2080  std::vector<int> border_area_per_farm(m_FarmManager->GetNoFarms(), 0);
2081  std::vector<int> total_area_per_farm;
2082  for (int f = 0; f < m_FarmManager->GetNoFarms(); f++) {
2083  total_area_per_farm.push_back(m_FarmManager->GetFarmTotalSize(f));
2084  }
2085  unsigned sz = (unsigned)m_elems.size();
2086  int begin = 1;
2087  // If the flag is set to true, we first try to limit the border to one side of the field (begin == 0)
2088  // If not we only run through the fields once and add borders all around the edge (begin == 1)
2090  begin = 0;
2091  }
2092  for (int allAround = begin; allAround <= 1; allAround++){
2093  int Nborders = 0;
2094  for (unsigned i = 0; i < sz; i++) {
2095  if (m_elems[i]->GetBorder() != NULL || (allAround == begin && m_elems[i]->GetOwner() != NULL && g_random_fnc(100) < g_map_le_border_chance.value())){
2096  // Border around this element, so must be a farm field.
2097  // If the field is too small then ignore it
2098  if (m_elems[i]->GetArea() > g_map_le_borders_min_field_size.value()){
2099  int farm_id = m_elems[i]->GetOwnerIndex();
2100 
2101  // Check if farm already has enough border area
2102  if (border_area_per_farm[farm_id] < total_area_per_farm[farm_id] * cfg_FarmAreaPercentage.value() * 0.01) {
2104  int area_temp = BorderAdd(m_elems[i], t, allAround);
2105  if (area_temp > 0) {
2106  Nborders++;
2107  border_area_per_farm[farm_id] += area_temp;
2108  }
2109  }
2110  }
2111  }
2112  }
2113  g_msg->Warn(WARN_MSG, "Landscape::Landscape(): In border adding iteration: ", allAround);
2114  g_msg->WarnAddInfo(WARN_MSG, "Landscape::Landscape(): Fields with border successfully added: ", Nborders);
2115  }
2116  didCalcOther = true;
2117  }
2118  else // Some special code to 'soften' the edges of orchards
2120  {
2121  // Generate border around each *orchard* landscape element.
2122  for (unsigned int i = 0; i < m_elems.size(); i++) {
2123  if (m_elems[i]->GetElementType() == tole_Orchard)
2124  {
2126  int area = BorderAdd(m_elems[i], t);
2127  }
2128  }
2129  didCalcOther = true;
2130  }
2131 
2133  {
2134  std::vector<int> border_area_per_farm(m_FarmManager->GetNoFarms(), 0);
2135  std::vector<int> total_area_per_farm;
2136  for (int f = 0; f < m_FarmManager->GetNoFarms(); f++) {
2137  total_area_per_farm.push_back(m_FarmManager->GetFarmTotalSize(f));
2138  }
2139  int begin = 1;
2140  for (int allAround = begin; allAround <= 1; allAround++){
2141  int Nborders = 0;
2142 
2143  // Generate border around each *orchard* landscape element.
2144  for (unsigned int i = 0; i < m_elems.size(); i++) {
2145  if (m_elems[i]->GetElementType() == tole_OliveGrove)
2146  {
2147  if (m_elems[i]->GetBorder() != NULL || (allAround == begin && m_elems[i]->GetOwner() != NULL && g_random_fnc(100) < g_map_le_border_chance.value())){
2148  // Border around this element, so must be a farm field.
2149  // If the field is too small then ignore it
2150  if (m_elems[i]->GetArea() > g_map_le_borders_min_field_size.value()){
2151  int farm_id = m_elems[i]->GetOwnerIndex();
2152 
2153  // Check if farm already has enough border area
2154  if (border_area_per_farm[farm_id] < total_area_per_farm[farm_id] * cfg_FarmAreaPercentage.value() * 0.01) {
2156  int area_temp = BorderAdd(m_elems[i], t, allAround);
2157  if (area_temp > 0) {
2158  Nborders++;
2159  border_area_per_farm[farm_id] += area_temp;
2160  }
2161  }
2162  }
2163  }
2164  }
2165  g_msg->Warn(WARN_MSG, "Landscape::Landscape(): In border adding iteration: ", allAround);
2166  g_msg->WarnAddInfo(WARN_MSG, "Landscape::Landscape(): Fields with border successfully added: ", Nborders);
2167  }
2168  }
2169  didCalcOther = true;
2170  }
2171  else
2172  // Unsprayed Margin Code....
2174  {
2175  cout << "Adding unsprayed margins" << endl;
2176 
2177  // Generate border around each *farm* landscape element.
2178  for (unsigned int i = 0; i < m_elems.size(); i++)
2179  {
2180  if (m_elems[i]->GetUnsprayedMarginPolyRef() == 1)
2181  {
2182  // But not if the field is too small to have them
2183  if (m_elems[i]->GetArea() > g_map_le_umargin_min_field_size.value())
2184  {
2186  }
2187  else m_elems[i]->SetUnsprayedMarginPolyRef(-1);
2188  }
2189  }
2190  didCalcOther = true;
2191  }
2192  else if (cfg_AddBeetleBanks.value())
2193  {
2194  cout << "Adding beetle banks/strips now" << endl;
2196  didCalcOther = true;
2197  }
2198  else if (cfg_AddPatches.value())
2199  {
2200  cout << "Adding patches now" << endl;
2202  didCalcOther = true;
2203  }
2204 
2207  {
2209  }
2215  if (l_map_dump_enable.value() || didCalcOther)
2216  {
2217  CountMapSquares();
2218  ForceArea();
2219  PolysValidate(false);
2220  if (PolysRemoveInvalid()) PolysValidate(true);
2221  ChangeMapMapping();
2222  PolysRenumber();
2225  string filestr = l_map_map_file.value();
2226  std::size_t ind = filestr.find(".lsb"); // Find the starting position of substring in the string
2227  if (ind != std::string::npos) {
2228  filestr.erase(ind, 4); // erase function takes two parameter, the starting index in the string from where you want to erase characters and total no of characters you want to erase.
2229  std::cout << filestr << "\n";
2230  }
2231  string dumpmap = filestr + "_dump.lsb";
2232  string farmstr = filestr + "_farmref_dump.txt";
2233  string polystr = filestr + "_polyref_dump.txt";
2234  m_FarmManager->DumpFarmrefs(farmstr.c_str());
2235  cout << "Dumping map" << endl;
2236  DumpMap(dumpmap.c_str());
2237  cout << "Dumping polygon refs file" << endl;
2238  PolysDump(polystr.c_str());
2239  if (dump_exit) {
2240  g_msg->Warn(WARN_FILE, "Landscape::Landscape() ""Normal exit after dump.", "Remember to rename the new map and polyref file.");
2241  exit(0);
2242  }
2243  else {
2244  g_msg->Warn(WARN_FILE, "Landscape::Landscape() ""Dump file done", "Remember to rename the new map and polyref file.");
2245  }
2246  }
2247 
2248  // Set the type of hedgebanks.
2249  int l_subtype = cfg_HedgeSubtypeMinimum.value();
2250  for (unsigned int i = 0; i < m_elems.size(); i++) {
2251  if (m_elems[i]->GetElementType() == tole_HedgeBank) {
2252  m_elems[i]->SetSubType(l_subtype);
2253  if (++l_subtype >= cfg_HedgeSubtypeMaximum.value())
2254  l_subtype = cfg_HedgeSubtypeMinimum.value();
2255  }
2256  }
2257 
2258  // And another to set the type of hedges
2259  // ***CJT*** 2003-12-02
2260  l_subtype = 0;
2261  for (unsigned int i = 0; i < m_elems.size(); i++) {
2262  if (m_elems[i]->GetElementType() == tole_Hedges) {
2263  m_elems[i]->SetSubType(l_subtype);
2264  if (++l_subtype >= 3)
2265  l_subtype = 0;
2266  }
2267  }
2271  CreatePondList();
2276  cout << "Initiating farm management" << endl;
2278  //Set the TOV attributes
2279  for (unsigned int i = 0; i < m_elems.size(); i++) {
2280  Set_TOV_Att(m_elems[i]);
2281  }
2282 
2283  m_toxShouldSpray = false; // Flag for special pesticide tests
2286  g_date->Reset();
2287 
2288  /*
2289  if ( g_farm_test_crop.value() ) {
2290  TestCropManagement();
2291  exit( 0 );
2292  }
2293  */
2294 
2295  // Set up treatment flags
2296  // Reset internal state for the LE loop generator.
2297  // Compulsory!
2298  SupplyLEReset();
2299  // Get number of *all* landscape elements.
2300  int l_count = SupplyLECount();
2301 
2302  // Now loop through then.
2303  for (int i = 0; i < l_count; i++) {
2304  // Fetch next LE by its polygon reference number. Alternative
2305  // loop mechanism: This will return -1 at end-of-loop.
2306  int a_poly = SupplyLENext();
2307 
2308  // Skip uninteresting polygons by type, ownership,
2309  // phase of the moon, whatever.
2310  // if ( these_are_not_the_droids_we_are_looking_for( a_poly )) {
2311  if (SupplyElementType(a_poly) != tole_Field)
2312  continue;
2313 
2314  // Example: Set x% of them to ignore insecticide of all types.
2316  // Get current signal mask for polygon.
2317  LE_Signal l_signal = SupplyLESignal(a_poly);
2318  // Logical OR in/AND out the signals you are interested in.
2319  // The current signals are at the top of Elements.h
2320  //l_signal |= LE_SIG_NO_INSECTICIDE | LE_SIG_NO_SYNG_INSECT | LE_SIG_NO_HERBICIDE | LE_SIG_NO_FUNGICIDE | LE_SIG_NO_GROWTH_REG;
2321  //l_signal |= LE_SIG_NO_INSECTICIDE | LE_SIG_NO_SYNG_INSECT | LE_SIG_NO_HERBICIDE;
2322  // Write the mask back out to the polygon.
2323  SetLESignal(a_poly, l_signal);
2324  }
2325  }
2326  // for veg area dumps
2327  l_vegtype_areas = (double *)malloc(sizeof(double) * (tov_Undefined + 1));
2328 
2329  if (l_vegtype_areas == NULL) {
2330  g_msg->Warn(WARN_BUG, "Landscape::Landscape(): Out of memory!", "");
2331  exit(1);
2332  }
2333  FILE * outf;
2334  if (cfg_dumpvegjan.value()) {
2335  outf = fopen(cfg_dumpvegjanfile.value(), "w");
2336  if (!outf) {
2337  g_msg->Warn(WARN_FILE, "Landscape::DumpMapInfoByArea(): ""Unable to create file", cfg_dumpvegjanfile.value());
2338  exit(1);
2339  }
2340  else
2341  fclose(outf);
2342  }
2343 
2344  if (cfg_dumpvegjune.value()) {
2345  outf = fopen(cfg_dumpvegjunefile.value(), "w");
2346  if (!outf) {
2347  g_msg->Warn(WARN_FILE, "Landscape::DumpMapInfoByArea(): ""Unable to create file", cfg_dumpvegjunefile.value());
2348  exit(1);
2349  }
2350  else
2351  fclose(outf);
2352  }
2353 
2357  if (l_map_dump_veg_enable.value()) {
2358  FILE * f;
2359  f = fopen("VegDump.txt", "w");
2360  if (!f) {
2361  g_msg->Warn(WARN_BUG, "Landscape::Landscape(): VegDump.txt could not be created", "");
2362  exit(1);
2363  }
2364  fprintf(f, "Year\tDayOfYear\tMonth\tDay\tHeight\tBiomass\tGrazed\tDensity\tCover\tWeedBiomass\ttovNum\tInsectBiomass\tLATotal\tLAGreen\tDigestibility\tGreenBiomass\tDeadBiomass\tGooseGrazing\tSpilledGrain\tPollen\tNectar\n");
2365  fclose(f);
2366  }
2368  FILE * f;
2369  f = fopen("GrainDump.txt", "w");
2370  if (!f) {
2371  g_msg->Warn(WARN_BUG, "Landscape::Landscape(): GrainDump.txt could not be created", "");
2372  exit(1);
2373  }
2374  fprintf(f, "SimDay\tYear\tDayOfYear\tMonth\tDay\tpoly\tvegtype\tGrain\tMaize\n");
2375  fclose(f);
2376  }
2378  FILE * f;
2379  f = fopen("EventDump.txt", "w");
2380  if (!f) {
2381  g_msg->Warn(WARN_BUG, "Landscape::Landscape(): EventDump.txt could not be created", "");
2382  exit(1);
2383  }
2384  fclose(f);
2385  }
2386 
2387  if (cfg_DumpFarmAreas.value()){
2389  }
2390 
2391  // If we are testing a pesticide then set the enum attribute
2398  {
2399  m_RodenticideManager = new RodenticideManager("BaitLocations_input.txt", this);
2400  m_RodenticidePreds = new RodenticidePredators_Population_Manager(this);
2401  }
2402 
2406  // Write ASCII file:
2407  if (l_map_write_ascii.value()) {
2408  int x = l_map_ascii_utm_x.value();
2409  int y = l_map_ascii_utm_y.value();
2410  GISASCII_Output("AsciiLandscape.txt", x, y);
2411  }
2412 
2413 #ifdef __FLOWERTESTING
2414  fstream ofilepntotal(cfg_total_polnek_file.value(), ios::out);
2415  ofilepntotal.close();
2416  fstream ofilepntov(cfg_tov_polnek_file.value(), ios::out);
2417  ofilepntov.close();
2418  fstream ofilepn(cfg_habitat_polnek_file.value(), ios::out);
2419  ofilepn.close();
2420 #endif
2421 #ifdef __RECORDFARMEVENTS
2422  m_farmeventfile = new ofstream(cfg_farmeventfile.value(), ofstream::out);
2423  // write header
2424  (*m_farmeventfile) << "Farm No \t Parcel No \t TOV \t FarmToDo \t Day \t Year \n";
2425 #endif
2426 
2429  //Pinkfeet
2431  //Barnacle
2433  //Greylag
2435  if (cfg_WriteCurve.value()) {
2439  }
2440  if (cfg_pollen_nectar_on.value()) {
2441 
2442  //Pollen and nectar ini
2443  m_pollen_map.resize(m_height, m_width);
2444  m_pollen_map.fill(0);
2445  m_nectar_map.resize(m_height, m_width);
2446  m_nectar_map.fill(0);
2447  m_polyid_map.resize(m_height, m_width);
2450  for (int i = 0; i < m_height; i++) {
2451  m_map_polyid_within_dist[i].resize(m_width);
2452  }
2453  //GeneratePolyIDMapWithinDist();
2454  // Initialize biomass map used when transferring pesticides to plant compartments
2455  m_biomass_map.resize(m_height, m_width);
2456  m_biomass_map.setZero();
2457  }
2458 
2459 
2460  m_poly_omp_locks.resize(m_elems.size());
2461  for (int i=0; i<m_poly_omp_locks.size(); i++){
2462  m_poly_omp_locks[i] = new omp_nest_lock_t;
2463  omp_init_nest_lock(m_poly_omp_locks[i]);
2464  }
2465 }

References LE_TypeClass::BackTranslateEleTypes(), cfg_AddBeetleBanks, cfg_AddPatches, 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_FarmAreaPercentage, cfg_farmeventfile, cfg_G6A, cfg_G6B, cfg_G6C, cfg_G6D, cfg_G6E, cfg_G6F, cfg_G6G, cfg_G6H, cfg_habitat_polnek_file, cfg_HedgeSubtypeMaximum, cfg_HedgeSubtypeMinimum, cfg_MaxPondSize, cfg_P1A, cfg_P1B, cfg_P1C, cfg_P1D, cfg_P1E, cfg_P1F, cfg_P1G, cfg_P1H, cfg_PatchesType, cfg_pesticidemapcellsize, cfg_pesticidemapnoyears, cfg_pesticidemapon, cfg_pesticidemapstartyear, cfg_pesticidemaptype, cfg_pesticidetableon, cfg_pesticidetesttype, cfg_PestIncidenceMax, cfg_PestIncidenceMin, cfg_pollen_nectar_on, cfg_rodenticide_enable, cfg_total_polnek_file, cfg_tov_polnek_file, cfg_WriteCurve, LE::DoCopy(), g_date, g_landscape_ptr, g_letype, g_map_le_border_chance, g_map_le_border_limited, g_map_le_borderremoval, g_map_le_borders, g_map_le_borders_min_field_size, g_map_le_borderstype, g_map_le_borderwidth, g_map_le_umargin_min_field_size, g_map_le_unsprayedmargins, g_map_olivetree_borders, g_map_orchards_borders, g_msg, g_random_fnc(), g_speedy_Divides, l_map_art_hedgebanks, l_map_ascii_utm_x, l_map_ascii_utm_y, l_map_calc_openness, l_map_consolidatepolys, l_map_dump_enable, l_map_dump_event_enable, l_map_dump_gfx_enable, l_map_dump_gfx_file, l_map_dump_grain_enable, l_map_dump_veg_enable, l_map_map_file, l_map_nectarpollencomposition, 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_write_ascii, last_treatment, RasterMap::MapWidth(), Calendar::Reset(), LE::SetArea(), VegElement::SetBiomassScalers(), LE::SetCentroid(), LE::SetOpenness(), LE::SetPoly(), LE::SetSoilType(), LE::SetUnsprayedMarginPolyRef(), tole_Field, tole_Freshwater, tole_HedgeBank, tole_Hedges, tole_Missing, tole_OliveGrove, tole_Orchard, tole_Pond, tole_UnsprayedFieldMargin, tole_Wasteland, tov_Undefined, LE_TypeClass::TranslateEleTypes(), CfgInt::value(), CfgFloat::value(), CfgBool::value(), CfgStr::value(), version_date, version_major, version_minor, version_revision, MapErrorMsg::Warn(), WARN_BUG, WARN_FILE, WARN_MSG, MapErrorMsg::WarnAddInfo(), and CurveClass::WriteDataFile().

Member Function Documentation

◆ AddBeetleBankIfPossible()

int Landscape::AddBeetleBankIfPossible ( LE a_field,
TTypesOfLandscapeElement  a_tole 
)
protected

Determines whether a beetlebank can be added to the field depending on physical characteristics and adds it.

Beetle bank placement rules are:
Field is above cfg_BeetleBankMaxDistance (default = 150m) long and wide Beetle banks are place along the long direction of the field

4651  {
4657  int cx = a_field->GetCentroidX();
4658  int cy = a_field->GetCentroidY();
4659  // The centroid is the only estimate we have (and it at least should be in the field).
4660  // So start here and find the centre
4661  if (!FindFieldCenter(a_field, &cx, &cy)) return -1;
4662 
4663  // Find the rectangle that describes the field the best
4664  // Returns the alignment of the longest axis in the rectangle
4665  // and sets width and starting point on short side of best rectangle
4666  int width = 0;
4667  int x_start_perp = 0;
4668  int y_start_perp = 0;
4669  int alignment = FindBestRectangle(a_field->GetPoly(), &cx, &cy, &width, &x_start_perp, &y_start_perp);
4670  if (alignment == -1) return -1;
4671  // Get alignment of shortest axis (perpendicular to longest axis)
4672  int perp = alignment + 4;
4673  if (perp >= 8) perp -= 8;
4674  // Find the number of beetle banks (if any)
4675  if (width < cfg_BeetleBankMaxDistance.value()) return -1;
4676  int numberOfBanks = floor((float)width / cfg_BeetleBankMaxDistance.value());
4677  // Correct for the length of the step
4678  if (alignment == 2 || alignment == 6) width /= sqrt(2);
4679  if (alignment == 1 || alignment == 3 || alignment == 5 || alignment == 7) width /= sqrt(5);
4680  // Find the distance between the banks so they are equidistant
4681  float distBetweenBanks = (float)width / (numberOfBanks+1);
4682  // Now create the banks along the longest axis of the best rectangle
4683  int beetle_bank_total_area = 0;
4684  for (int n = 1; n <= numberOfBanks; n++) {
4685  // Find the appropriate length and starting point
4686  int x_start = x_start_perp - n * distBetweenBanks * m_x_add[perp];
4687  int y_start = y_start_perp - n * distBetweenBanks * m_y_add[perp];
4688  int x_end = x_start_perp - n * distBetweenBanks * m_x_add[perp];
4689  int y_end = y_start_perp - n * distBetweenBanks * m_y_add[perp];
4690  AxisLoop(a_field->GetPoly(), &x_start, &y_start, alignment);
4691  x_start -= (cfg_BeetleBankWidth.value() + 1) * m_x_add[alignment];
4692  y_start -= (cfg_BeetleBankWidth.value() + 1) * m_y_add[alignment];
4693  AxisLoop(a_field->GetPoly(), &x_end, &y_end, alignment + 8);
4694  x_end -= (cfg_BeetleBankWidth.value() + 1) * m_x_add[alignment + 8];
4695  y_end -= (cfg_BeetleBankWidth.value() + 1) * m_y_add[alignment + 8];
4696  APoint p_start(x_start, y_start);
4697  APoint p_end(x_end, y_end);
4698  int length = DistanceToP(p_start, p_end);
4699  // Correct for the length of the step
4700  if (alignment == 2 || alignment == 6) length /= sqrt(2);
4701  if (alignment == 1 || alignment == 3 || alignment == 5 || alignment == 7) length /= sqrt(5);
4702 
4703  // Make the new landscape element
4704  LE* BeetleBank;
4705  BeetleBank = NewElement(a_tole);
4706  BeetleBank->SetALMaSSEleType(g_letype->BackTranslateEleTypes(a_tole));
4707  BeetleBank->SetVegPatchy(true);
4709  m_elems.resize(m_elems.size() + 1);
4710  m_elems[m_elems.size() - 1] = BeetleBank;
4713  BeetleBank->SetSlope(a_field->GetSlope());
4714  BeetleBank->SetAspect(a_field->GetAspect());
4715  BeetleBank->SetElevation(a_field->GetElevation());
4716  BeetleBank->SetOwner(a_field->GetOwner(), a_field->GetOwner()->GetFarmNumber(), a_field->GetOwnerIndex());
4717  //Set pollen and nectar curve
4719  int area = 0;
4720  int width = cfg_BeetleBankWidth.value();
4721  // Correct for the length of the step (opposite of length correction, to keep area constant)
4722  if (alignment == 2 || alignment == 6) width *= sqrt(2);
4723  if (alignment == 1 || alignment == 3 || alignment == 5 || alignment == 7) width *= sqrt(5);
4724  // Vectors are used to add all cells in the region even if the step along the longest direction is in both x and y at the same time
4725  // If the alignment is 45 degrees (or 135 degrees) the perpendicular step has 2 substeps
4726  // If the alignment is 22.5 degrees (or 67.5, 112.5, 157.5 degrees) the perpendicular step has 5 substeps
4727  vector<vector<int>> x_direction = { {0}, { -1, -1, 0, 1, 0}, { -1, 0 }, { 0, 0, 1, 0, 1}, { -1 }, { 0, 0, -1, 0, -1 }, { 0, -1 }, { 1, 1, 0, -1, 0 } };
4728  vector<vector<int>> y_direction = { {-1}, { 0, 0, -1, 0, -1}, { 0, -1 }, { 1, 1, 0, -1, 0}, { 0 }, { 1, 1, 0, -1, 0 }, { 1, 0 }, { 0, 0, -1, 0, -1 } };
4729  vector<int> l_direction = { 1, 5, 2, 5, 1, 5, 2, 5 };
4730  int tx = 0;
4731  int ty = 0;
4732 
4733  int iteration = 0;
4734  for (int w = 0; w < width; w++) {
4735  if (w > 0) {
4736  if (w % l_direction[alignment] == 0) iteration++;
4737  tx += x_direction[alignment][w - iteration * l_direction[alignment]];
4738  ty += y_direction[alignment][w - iteration * l_direction[alignment]];
4739  }
4740  for (int i = 0; i < length; i++) {
4741  int x_temp = tx + x_start - i * m_x_add[alignment];
4742  int y_temp = ty + y_start - i * m_y_add[alignment];
4743  if ((x_temp >= 0) && (y_temp >= 0) && (x_temp < m_width) && (y_temp < m_height)) {
4744  // Only add to beetle bank if we are still in the field
4745  if (a_field->GetPoly() == m_land->Get(x_temp, y_temp)) {
4746  m_land->Put(x_temp, y_temp, (int)m_elems.size() - 1);
4747  area += 1;
4748  a_field->AddArea(-1.0);
4749  }
4750  }
4751  }
4752  }
4753  BeetleBank->SetArea(double(area));
4754  beetle_bank_total_area += area;
4755  BeetleBank->SetValidXY(x_start + 0.5 * length * m_x_add[alignment], y_start + 0.5 * length * m_y_add[alignment]);
4756  BeetleBank->SetMapValid(true);
4757 
4758  }
4759  return beetle_bank_total_area;
4760 }

References LE::AddArea(), LE_TypeClass::BackTranslateEleTypes(), cfg_BeetleBankMaxDistance, cfg_BeetleBankWidth, cfg_FlowerStripPollenNectarCurveNum, g_letype, LE::GetAspect(), LE::GetCentroidX(), LE::GetCentroidY(), LE::GetElevation(), Farm::GetFarmNumber(), LE::GetOwner(), LE::GetOwnerIndex(), LE::GetPoly(), LE::GetSlope(), m_polymapping, LE::SetArea(), LE::SetAspect(), LE::SetElevation(), LE::SetMapIndex(), LE::SetMapValid(), LE::SetOwner(), LE::SetPollenNectarCurveRef(), LE::SetPoly(), LE::SetSlope(), LE::SetValidXY(), VegElement::SetVegPatchy(), and CfgInt::value().

◆ AddBeetleBanks()

void Landscape::AddBeetleBanks ( TTypesOfLandscapeElement  a_tole)
protected

The starting point for adding beetlebanks to a field (can be used to add ‘banks’ of any tole_type.

Beetle-bank addition - tests whether we can add a bank (or more) 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

4593  {
4594  // **************************************************************************************
4598  // **************************************************************************************
4606  int BBs=0;
4607  int tx1 = cfg_BeetleBankMinX.value();
4608  int tx2 = cfg_BeetleBankMaxX.value();
4609  int ty1 = cfg_BeetleBankMinY.value();
4610  int ty2 = cfg_BeetleBankMaxY.value();
4611  bool doit = false;
4612  unsigned sz=(unsigned) m_elems.size();
4613 
4614  std::vector<int> beetle_bank_area_per_farm(m_FarmManager->GetNoFarms(), 0);
4615 
4616  for (unsigned i=0; i<sz; i++){
4617  if (m_elems[ i ]->GetElementType() == tole_Field){
4618  doit = false;
4619  int cx = m_elems[ i ]->GetCentroidX();
4620  int cy = m_elems[ i ]->GetCentroidY();
4621  if (!cfg_BeetleBankInvert.value()){
4622  if ((cx >= tx1) && (cy >= ty1) && (cx <= tx2) && (cy <= ty2)){
4623  doit = true;
4624  }
4625  }
4626  else if ((cx < tx1) || (cy < ty1) || (cx > tx2) || (cy > ty2)){
4627  doit = true;
4628  }
4629  if (doit){
4630  int farm_id = m_elems[i]->GetOwnerIndex();
4631  int farm_area = m_FarmManager->GetFarmTotalSize(farm_id);
4632  // Field is in the right area, use chance to see if beetle bank should be added
4634  // Check if farm already has enough beetle bank area
4635  if (beetle_bank_area_per_farm[farm_id] < farm_area * cfg_FarmAreaPercentage.value() * 0.01) {
4636  int area_temp = AddBeetleBankIfPossible(m_elems[i], a_tole);
4637  if (area_temp > 0) {
4638  BBs++;
4639  beetle_bank_area_per_farm[farm_id] += area_temp;
4640  }
4641  }
4642  }
4643  }
4644  }
4645  }
4646  g_msg->Warn( WARN_MSG, "Landscape::AddBeetleBanks(): Fields with BeetleBanks successfully added: ", BBs);
4647 }

References cfg_BeetleBankChance, cfg_BeetleBankInvert, cfg_BeetleBankMaxX, cfg_BeetleBankMaxY, cfg_BeetleBankMinX, cfg_BeetleBankMinY, cfg_FarmAreaPercentage, g_msg, g_random_fnc(), tole_Field, CfgInt::value(), CfgBool::value(), MapErrorMsg::Warn(), and WARN_MSG.

◆ AddPatches()

void Landscape::AddPatches ( TTypesOfLandscapeElement  a_tole)
protected

The starting point for adding patches to a field (can be used to add patches of any tole_type)

Patches addition - tests whether we can add a patch 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 patch. This will depend on the probabilities and the size of the field. To provide for more flexibilty, a tole_type is passed, and patches may be created of any tole_type.

4977  {
4978  // **************************************************************************************
4982  // **************************************************************************************
4988  int Npatches = 0;
4989  unsigned sz = (unsigned)m_elems.size();
4990 
4991  std::vector<int> patches_area_per_farm(m_FarmManager->GetNoFarms(), 0);
4992 
4993  for (unsigned i = 0; i < sz; i++) {
4994  if (m_elems[i]->GetElementType() == tole_Field) {
4995  int farm_id = m_elems[i]->GetOwnerIndex();
4996  int farm_area = m_FarmManager->GetFarmTotalSize(farm_id);
4997  // Check if farm already has enough beetle bank area
4998  if (patches_area_per_farm[farm_id] < farm_area * cfg_FarmAreaPercentage.value() * 0.01) {
4999  int area_temp = AddPatchIfPossible(m_elems[i], a_tole);
5000  if (area_temp > 0) {
5001  Npatches++;
5002  patches_area_per_farm[farm_id] += area_temp;
5003  }
5004  }
5005  }
5006  }
5007  g_msg->Warn(WARN_MSG, "Landscape::AddPatches(): Fields with patch successfully added: ", Npatches);
5008 }

References cfg_FarmAreaPercentage, g_msg, tole_Field, CfgInt::value(), MapErrorMsg::Warn(), and WARN_MSG.

◆ AddPatchIfPossible()

int Landscape::AddPatchIfPossible ( LE a_field,
TTypesOfLandscapeElement  a_tole 
)
protected

Determines whether a patch can be added to the field depending on physical characteristics and adds it.

Patch placement rules are:
The field is above 1 / (cfg_PatchesFieldAreaMaxPercentage * 0.01) * cfg_PatchesMinWidth ** 2 m2 (default is 1/0.15 * 10**2 = 666 m2. The patch can not be bigger than cfg_PatchesMaxWidth ** 2 m2 (default is 100**2 = 10.000 m2) Patches are place in the middle of the field

5010  {
5018  // Check if field is to small to add patch
5019  if (a_field->GetArea() * cfg_PatchesFieldAreaMaxPercentage.value() * 0.01 < pow(cfg_PatchesMinWidth.value(),2))
5020  {
5021  cout << "Field area of " << a_field->GetArea() << " is to small for a patch" << endl;
5022  return -1;
5023  }
5024  int cx = a_field->GetCentroidX();
5025  int cy = a_field->GetCentroidY();
5026  // The centroid is the only estimate we have (and it at least should be in the field).
5027  // So start here and find the centre
5028  if (!FindFieldCenter(a_field, &cx, &cy)) return -1;
5029 
5030  // Make the new landscape element
5031  LE* Patch;
5032  Patch = NewElement(a_tole);
5033  Patch->SetALMaSSEleType(g_letype->BackTranslateEleTypes(a_tole));
5034  Patch->SetVegPatchy(true);
5036  m_elems.resize(m_elems.size() + 1);
5037  m_elems[m_elems.size() - 1] = Patch;
5039  Patch->SetPoly(hb_first_free_poly_num++);
5040  Patch->SetSlope(a_field->GetSlope());
5041  Patch->SetAspect(a_field->GetAspect());
5042  Patch->SetElevation(a_field->GetElevation());
5043  //Patch->SetOwner(a_field->GetOwner(), a_field->GetOwner()->GetFarmNumber(), a_field->GetOwnerIndex());
5044  //Set pollen and nectar curve
5046  int area = 0;
5047 
5048  // Add patch by spiraling out from the center cx, cy
5049  int x = 0, y = 0, dx = 0;
5050  int dy = -1;
5051  int t = cfg_PatchesMaxWidth.value();
5052  int margin = cfg_PatchesFreeMargin.value();
5053  int field_poly = a_field->GetPoly();
5054  int patch_poly = Patch->GetPoly();
5055  int temp;
5056  for (int i = 0; i < pow(t,2); i++) {
5057  //cout << x << "," << y << endl;
5058  if ((-t / 2 <= x) && (x <= t / 2) && (-t / 2 <= y) && (y <= t / 2)) {
5059  // Only add to patch if we are still in the field (and have the wanted margin around the patch)
5060  vector<int> x_coords = { cx + x, cx + x + margin, cx + x - margin, cx + x, cx + x };
5061  vector<int> y_coords = { cy + y, cy + y, cy + y, cy + y + margin, cy + y - margin };
5062  bool outOfBound = false;
5063  for (int j = 0; j < 5; j++) {
5064  if ((x_coords[j] >= 0) && (y_coords[j] >= 0) && (x_coords[j] < m_width) && (y_coords[j] < m_height)) { // Check we are in map
5065  if (field_poly != m_land->Get(x_coords[j], y_coords[j]) && patch_poly != m_land->Get(x_coords[j], y_coords[j])) { // Check if we are outside of field
5066  outOfBound = true;
5067  break;
5068  }
5069  }
5070  }
5071  if (outOfBound) continue;
5072  if ((cx + x >= 0) && (cy + y >= 0) && (cx + x < m_width) && (cy + y < m_height)) {
5073  m_land->Put(cx + x, cy + y, (int)m_elems.size() - 1);
5074  area += 1;
5075  a_field->AddArea(-1.0);
5076  // Check that the area is less than cfg_PatchesFieldAreaMaxPercentage or exit for-loop
5077  if (area > a_field->GetArea() * cfg_PatchesFieldAreaMaxPercentage.value() * 0.01) break;
5078  }
5079  }
5080  if ((x == y) || ((x < 0) && (x == -y)) || ((x > 0) && (x == 1 - y))) {
5081  temp = -dy;
5082  dy = dx;
5083  dx = temp;
5084  }
5085  x += dx;
5086  y += dy;
5087  }
5088  Patch->SetArea(double(area));
5089  Patch->SetValidXY(cx, cy);
5090  Patch->SetMapValid(true);
5091 
5092  return area;
5093 }

References LE::AddArea(), LE_TypeClass::BackTranslateEleTypes(), cfg_FlowerStripPollenNectarCurveNum, cfg_PatchesFieldAreaMaxPercentage, cfg_PatchesFreeMargin, cfg_PatchesMaxWidth, cfg_PatchesMinWidth, g_letype, LE::GetArea(), LE::GetAspect(), LE::GetCentroidX(), LE::GetCentroidY(), LE::GetElevation(), LE::GetPoly(), LE::GetSlope(), m_polymapping, LE::SetArea(), LE::SetAspect(), LE::SetElevation(), LE::SetMapIndex(), LE::SetMapValid(), LE::SetPollenNectarCurveRef(), LE::SetPoly(), LE::SetSlope(), LE::SetValidXY(), LE::SetVegPatchy(), and CfgInt::value().

◆ AxisLoop()

void Landscape::AxisLoop ( int  a_poly,
int *  a_x,
int *  a_y,
int  a_axis 
)
protected

Tests the length of a vector to find when we step outside a given polygon.

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.

4940  {
4945  int ap1 = a_polyindex;
4946  while (ap1 == a_polyindex)
4947  {
4948  *(a_x) += m_x_add[a_axis];
4949  *(a_y) += m_y_add[a_axis];
4950  // Before we try to get a polyindex from the map, check we are still on the world
4951  if (*(a_x) < 0)
4952  {
4953  return;
4954  }
4955  if (*(a_y) < 0)
4956  {
4957  return;
4958  }
4959  if (*(a_x) >= m_width)
4960  {
4961  return;
4962  }
4963  if (*(a_y) >= m_height)
4964  {
4965  return;
4966  }
4967  // OK still in the map, get the polyindex
4968  ap1 = m_land->Get((*a_x), (*a_y)); // NB this returns the m_elemens index not the polyref (ChangeMapMapping has been called by here)
4969  }
4970 }

◆ BackTranslateEleTypes()

int Landscape::BackTranslateEleTypes ( TTypesOfLandscapeElement  EleReference)
inline

Returns the ALMaSS reference number translated from the TTypesOfLandscapeElement type.

2333 {
2334  return g_letype->BackTranslateEleTypes( EleReference );
2335 }

References LE_TypeClass::BackTranslateEleTypes(), and g_letype.

Referenced by Vole_Base::Set_ElemBorn().

◆ BackTranslateVegTypes()

int Landscape::BackTranslateVegTypes ( TTypesOfVegetation  VegReference)
inline

Returns the ALMaSS reference number translated from the TTypesOfVegetation type.

2339 {
2340  return g_letype->BackTranslateVegTypes( VegReference );
2341 }

References LE_TypeClass::BackTranslateVegTypes(), and g_letype.

Referenced by Vole_Base::Set_VegBorn().

◆ BorderAdd()

int Landscape::BorderAdd ( LE a_field,
TTypesOfLandscapeElement  a_type,
int  a_allAround = 1 
)
protected

Adds a border of the specified type (could be an unsprayed margin) around a field

4411  {
4412 
4413  LE* border;
4414  int width;
4415  // If it is an unsprayed field margin
4416  if (a_type == tole_UnsprayedFieldMargin) {
4417  width = l_map_umargin_width.value();
4418  }
4419  else { // otherwise it is a border
4420  width = g_map_le_borderwidth.value();
4421  }
4422 
4423  if(a_field->GetBorder() != NULL){
4424  border = a_field->GetBorder();
4425  }
4426  else {
4427  // Create border and add it to list of elements
4428  border = NewElement(a_type);
4430  m_elems.resize(m_elems.size() + 1);
4431  m_elems[m_elems.size() - 1] = border;
4432 
4433  // If it is an unsprayed field margin
4434  if (a_type == tole_UnsprayedFieldMargin) {
4436  TTypesOfLandscapeElement tole = a_field->GetElementType();
4437  border->SetOwner_tole(tole);
4438  }
4439  else { // otherwise it is a border
4440  a_field->SetBorder(border);
4441  }
4442 
4443  // Add more information about border
4445  border->SetPoly(hb_first_free_poly_num++);
4446  border->SetSlope(a_field->GetSlope());
4447  border->SetAspect(a_field->GetAspect());
4448  border->SetElevation(a_field->GetElevation());
4449  if (ClassificationFieldType(a_type) == true) {
4450  border->SetOwner(a_field->GetOwner(), a_field->GetOwner()->GetFarmNumber(), a_field->GetOwnerIndex());
4451  }
4452  //Set pollen and nectar curve
4454  }
4455  // Check that centroids are inside the polygon and valid.
4456  int fieldpoly = a_field->GetPoly(); // fieldpoly is the polygon number
4457  int borderpoly = border->GetPoly(); // borderpoly is the polygon number
4458  int borderindex = m_polymapping[borderpoly]; // borderindex is the elems index for the border
4459  int fieldindex = m_polymapping[fieldpoly]; // fieldindex is the elems index
4460 
4461  // Create coordinates for circle with radius equal to the width of the border to be used for creating the border
4462  std::vector<int> x_circle;
4463  std::vector<int> y_circle;
4464  int n_circle = 0;
4465  for (int dx = -width; dx <= width; dx++) {
4466  for (int dy = -width; dy <= width; dy++) {
4467  int dist = hypot(dx, dy);
4468  if (dist <= width) {
4469  x_circle.push_back(dx);
4470  y_circle.push_back(dy);
4471  n_circle++;
4472  }
4473  }
4474  }
4475 
4476  // Find the centre of the field
4477  int cx = a_field->GetCentroidX();
4478  int cy = a_field->GetCentroidY();
4479  FindFieldCenter(a_field, &cx, &cy);
4480  // Find the rectangle that describes the field the best
4481  // Returns the alignment of the longest axis in the rectangle
4482  // and sets width and starting point on short side of best rectangle
4483  int field_width = 0;
4484  int x_start_perp = 0;
4485  int y_start_perp = 0;
4486  int alignment = FindBestRectangle(a_field->GetPoly(), &cx, &cy, &field_width, &x_start_perp, &y_start_perp);
4487 
4488  // Check that field is not too narrow
4489  if (field_width <= g_map_le_minfieldwidth.value()) {
4490  if (a_type == tole_UnsprayedFieldMargin) a_field->SetUnsprayedMarginPolyRef(-1);
4491  return -1;
4492  }
4493 
4494  int x1 = cx;
4495  int y1 = cy;
4496  int x2 = cx;
4497  int y2 = cy;
4498  if (a_allAround == 0) { // Only calculate points if they are going to be used;
4499  AxisLoop(a_field->GetPoly(), &x1, &y1, alignment + 1);
4500  AxisLoop(a_field->GetPoly(), &x2, &y2, alignment + 7);
4501  }
4502 
4503  // Loop through all pixels in rectangle surrounding the field
4504  int min_x = a_field->GetMinX();
4505  int max_x = a_field->GetMaxX();
4506  int min_y = a_field->GetMinY();
4507  int max_y = a_field->GetMaxY();
4508  //if (max(x1, x2) < max_x - width) max_x = max(x1, x2);
4509  //if (max(y1, y2) < max_y - width) max_y = max(y1, y2);
4510  //if (min(x1, x2) > min_x + width) min_x = min(x1, x2);
4511  //if (min(y1, y2) < min_y + width) min_y = min(y1, y2);
4512  int area = 0;
4513  for (int x = min_x; x <= max_x; x++) { // Loop through x
4514  for (int y = min_y; y <= max_y; y++) { // Loop through y
4515  // Make sure we are inside map
4516  if ((x >= 0) && (y >= 0) && (x < m_width) && (y < m_height)) {
4517  int positionGood = 1;
4518  if (a_allAround == 0) {
4519  // Only add on one side of line between P1(x1,y1) and P2(x2,y2)
4520  positionGood = std::copysign(1, (x2 - x1) * (y - y1) - (y2 - y1) * (x - x1));
4521  }
4522  if (positionGood >= 0) {
4523  int index = m_land->Get(x, y);
4524  if (index == fieldindex) { // Check that the current pixel is in the field
4525  for (int i = 0; i < n_circle; i++) { // Look in a circle around the pixel with a radius of the border width
4526  if (BorderTest(fieldindex, borderindex, x + x_circle[i], y + y_circle[i])) { // Test if pixel should be border
4527  m_land->Put(x, y, borderindex); // Add this pixel to the border element in the map
4528  area += 1;
4529  a_field->AddArea(-1.0); // Subtract area from field
4530  break; // Added border so stop testing
4531  }
4532  }
4533  }
4534  }
4535  }
4536  }
4537  }
4538 
4539  // If nothing was added to the border remove it again
4540  if (area == 0) {
4541  border->SetMapValid(false);
4542  // If it is an unsprayed field margin also remove border from field
4543  if (a_type == tole_UnsprayedFieldMargin) {
4544  a_field->SetUnsprayedMarginPolyRef(-1);
4545  }
4546  }
4547  else{
4548  border->AddArea(area);
4549  }
4550 
4551  return area;
4552 }

References LE::AddArea(), cfg_FlowerStripPollenNectarCurveNum, g_map_le_borderwidth, g_map_le_minfieldwidth, LE::GetAspect(), LE::GetBorder(), LE::GetCentroidX(), LE::GetCentroidY(), LE::GetElevation(), Farm::GetFarmNumber(), LE::GetMaxX(), LE::GetMaxY(), LE::GetMinX(), LE::GetMinY(), LE::GetOwner(), LE::GetOwnerIndex(), LE::GetPoly(), LE::GetSlope(), l_map_umargin_width, m_polymapping, LE::SetAspect(), LE::SetBorder(), LE::SetElevation(), LE::SetMapIndex(), LE::SetMapValid(), LE::SetOwner(), LE::SetPollenNectarCurveRef(), LE::SetPoly(), LE::SetSlope(), LE::SetUnsprayedMarginPolyRef(), tole_UnsprayedFieldMargin, and CfgInt::value().

◆ BorderNeed()

bool Landscape::BorderNeed ( TTypesOfLandscapeElement  a_letype)
protected

Currently unused test for adding borders.

7657  {
7658  static char error_num[20];
7659  bool AddBorder = false;
7660  switch (a_letype) {
7661  // No border is needed toward these neighbouring element types.
7662  case tole_BeetleBank:
7664  case tole_OrchardBand:
7665  case tole_FieldBoundary:
7666  case tole_FlowerStrip:
7668  case tole_MownGrassStrip:
7669  break;
7670 
7671  case tole_Marsh:
7672  case tole_IndividualTree:
7673  case tole_PlantNursery:
7674  case tole_Vildtager:
7675  case tole_WindTurbine:
7676  case tole_WoodyEnergyCrop:
7677  case tole_WoodlandMargin:
7678  case tole_Pylon:
7679  case tole_NaturalGrassDry:
7680  case tole_Railway:
7681  case tole_Scrub:
7682  case tole_Field:
7684  case tole_PermPasture:
7687  case tole_PitDisused:
7688  case tole_RiversideTrees:
7689  case tole_DeciduousForest:
7690  case tole_MixedForest:
7691  case tole_YoungForest:
7692  case tole_ConiferousForest:
7693  case tole_StoneWall:
7694  case tole_Fence:
7695  case tole_Garden:
7696  case tole_Track:
7697  case tole_SmallRoad:
7698  case tole_LargeRoad:
7699  case tole_Building:
7700  case tole_ActivePit:
7701  case tole_Pond:
7702  case tole_FishFarm:
7703  case tole_Freshwater:
7704  case tole_River:
7705  case tole_Saltwater:
7706  case tole_Coast:
7707  case tole_BareRock:
7708  case tole_Heath:
7709  case tole_Orchard:
7710  case tole_AmenityGrass:
7711  case tole_Parkland:
7712  case tole_UrbanNoVeg:
7713  case tole_UrbanVeg:
7714  case tole_UrbanPark:
7716  case tole_SandDune:
7717  case tole_Copse:
7718  case tole_NaturalGrassWet:
7719  case tole_RoadsideSlope:
7720  case tole_MetalledPath:
7721  case tole_Carpark:
7722  case tole_Churchyard:
7723  case tole_Saltmarsh:
7724  case tole_Stream:
7725  case tole_HeritageSite:
7726  AddBorder = true;
7727  break;
7728 
7729  default:
7730  g_msg->Warn(WARN_BUG, "Landscape::BorderNeed(): Unknown element type: ", int(a_letype));
7731  exit(1);
7732  }
7733  return AddBorder;
7734 }

References g_msg, 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_FlowerStrip, tole_FlowerStripWithRotation, tole_Freshwater, tole_Garden, tole_Heath, tole_HeritageSite, tole_IndividualTree, tole_LargeRoad, tole_Marsh, tole_MetalledPath, tole_MixedForest, tole_MownGrassStrip, 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_RiversideTrees, tole_RoadsideSlope, 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_WindTurbine, tole_WoodlandMargin, tole_WoodyEnergyCrop, tole_YoungForest, MapErrorMsg::Warn(), and WARN_BUG.

◆ BorderRemoval()

void Landscape::BorderRemoval ( void  )
protected

Removes field boundaries, hedgebanks and hedges if they are adjacent to a field.

Removes field boundaries, hedgebanks and hedges if they are adjacent to a field . This can be used for example if we want to be sure of the amount of added elements or their width.

4331  {
4336  // This does not need to be efficient, just do the job
4337  for (int x=1; x<(m_width-1); x++)
4338  for (int y=1; y<(m_height-1); y++)
4339  {
4341  if ((tole==tole_FieldBoundary) || (tole==tole_HedgeBank) || (tole==tole_Hedges) || (tole == tole_FlowerStrip))
4342  {
4343  if ( SupplyElementType(x-1,y-1) == tole_Field)
4344  {
4345  // Set the x,y location to be this field
4346  int fieldindex = SupplyPolyRefIndex(x-1,y-1);
4347  m_land->Put( x, y, fieldindex );
4348 
4349  }
4350  else
4351  if ( SupplyElementType(x-1,y) == tole_Field)
4352  {
4353  // Set the x,y location to be this field
4354  int fieldindex = SupplyPolyRefIndex(x-1,y);
4355  m_land->Put( x, y, fieldindex );
4356 
4357  }
4358  else
4359  if ( SupplyElementType(x-1,y+1) == tole_Field)
4360  {
4361  // Set the x,y location to be this field
4362  int fieldindex = SupplyPolyRefIndex(x-1,y+1);
4363  m_land->Put( x, y, fieldindex );
4364 
4365  }
4366  else
4367  if ( SupplyElementType(x,y-1) == tole_Field)
4368  {
4369  // Set the x,y location to be this field
4370  int fieldindex = SupplyPolyRefIndex(x,y-1);
4371  m_land->Put( x, y, fieldindex );
4372 
4373  }
4374  else
4375  if ( SupplyElementType(x,y+1) == tole_Field)
4376  {
4377  // Set the x,y location to be this field
4378  int fieldindex = SupplyPolyRefIndex(x,y+1);
4379  m_land->Put( x, y, fieldindex );
4380 
4381  }
4382  else
4383  if ( SupplyElementType(x+1,y-1) == tole_Field)
4384  {
4385  // Set the x,y location to be this field
4386  int fieldindex = SupplyPolyRefIndex(x+1,y-1);
4387  m_land->Put( x, y, fieldindex );
4388 
4389  }
4390  else
4391  if ( SupplyElementType(x+1,y) == tole_Field)
4392  {
4393  // Set the x,y location to be this field
4394  int fieldindex = SupplyPolyRefIndex(x+1,y);
4395  m_land->Put( x, y, fieldindex );
4396 
4397  }
4398  else
4399  if ( SupplyElementType(x+1,y+1) == tole_Field)
4400  {
4401  // Set the x,y location to be this field
4402  int fieldindex = SupplyPolyRefIndex(x+1,y+1);
4403  m_land->Put( x, y, fieldindex );
4404 
4405  }
4406  }
4407  }
4408 }

References tole_Field, tole_FieldBoundary, tole_FlowerStrip, tole_HedgeBank, and tole_Hedges.

◆ BorderTest()

bool Landscape::BorderTest ( int  a_fieldindex,
int  a_borderindex,
int  a_x,
int  a_y 
)
protected

Used to decide if a coordinate location should become a border/unsprayed margin.

4555  {
4556  // If the neighbouring cell is outside the landscape
4557  if ((a_x_neighbour >= m_width) || (a_x_neighbour < 0) || (a_y_neighbour >= m_height) || (a_y_neighbour < 0)) {
4558  return true;
4559  }
4560  // If the neighbouring cell is not the field itself, a border, an individual tree, pylon or wind turbine
4561  int index = m_land->Get(a_x_neighbour, a_y_neighbour);
4564  if ((index != a_fieldindex) && (index != a_borderindex) && (tole != tole_IndividualTree) && (tole != tole_Pylon) && (tole != tole_WindTurbine) && (tole != tole_FieldBoundary || cfg_BordersNextToFieldBoundary.value()) && (tole != border_tole) && (tole!= tole_Field || cfg_BordersBetweenFields.value())) {
4565  return true;
4566  }
4567  return false;
4568 }

References cfg_BordersBetweenFields, cfg_BordersNextToFieldBoundary, g_landscape_ptr, SupplyElementTypeFromVector(), tole_Field, tole_FieldBoundary, tole_IndividualTree, tole_Pylon, tole_WindTurbine, and CfgBool::value().

◆ BuildingDesignationCalc()

void Landscape::BuildingDesignationCalc ( )

used to calculate whether a building as rural or town - for rodenticide use

Runs through all elements and identifies the ones where rodenticide bait may be placed. If it is a building then we count the number of buildings near to it and designate it town if there are more than cfg_mintownbuildingnumber.

5357 {
5362  cout << "In BuildingDesignationCalc" << endl;
5363  for (int p = 0; p< (int)m_elems.size(); p++)
5364  {
5365  TTypesOfLandscapeElement tole = m_elems[p]->GetElementType();
5366  if ( tole == tole_Building)
5367  {
5368  int cx = m_elems[p]->GetCentroidX();
5369  int cy = m_elems[p]->GetCentroidY();
5370  int near = 0;
5371  for (int j = 0; j< (int)m_elems.size(); j++)
5372  {
5373  if (m_elems[j]->GetElementType() == tole_Building)
5374  {
5375  int nx = m_elems[j]->GetCentroidX();
5376  int ny = m_elems[j]->GetCentroidY();
5377  int dx =abs(cx-nx);
5378  int dy =abs(cy-ny);
5379  if ((dx < cfg_mintownbuildingdistance.value()) && (dy < cfg_mintownbuildingdistance.value())) near++;
5380  if (near > cfg_mintownbuildingdistance.value()) break;
5381  }
5382  }
5383  if (near <= cfg_mintownbuildingnumber.value()) m_elems[p]->SetCountryDesignation(1); // Not enough buildings close by, so it is a country building
5384  else m_elems[p]->SetCountryDesignation(0);
5385  }
5386  else if (tole == tole_YoungForest)
5387  {
5388  m_elems[p]->SetCountryDesignation(2);
5389  }
5390  else if ((tole == tole_DeciduousForest) || ( tole == tole_MixedForest) || ( tole == tole_ConiferousForest ) ) m_elems[p]->SetCountryDesignation(3);
5391 
5392  }
5393 }

References cfg_mintownbuildingdistance, cfg_mintownbuildingnumber, tole_Building, tole_ConiferousForest, tole_DeciduousForest, tole_MixedForest, tole_YoungForest, and CfgInt::value().

◆ CalculateCentroids()

void Landscape::CalculateCentroids ( void  )

Calculate centroid for each polygon found.

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.

5111 {
5117  cout << "In Centroid Calculations" << endl;
5118  // For each polygon
5119  for (int p = 0; p< (int)m_elems.size(); p++)
5120  {
5121  // Calcuate the actual centre
5122  int x1 = m_elems[p]->GetMinX();
5123  int y1 = m_elems[p]->GetMinY();
5124  int x2 = m_elems[p]->GetMaxX();
5125  int y2 = m_elems[p]->GetMaxY();
5126 
5127  int midx = (x1 + x2) / 2;
5128  int midy = (y1 + y2) / 2;
5129  // Now from midx & midy we move outwards in concentric circles until we find a location that matches our polyref.
5130  int polyindex = p; // Change mapmapping has been called by now, so the map contains m_elems indices.
5131  CentroidSpiralOut(polyindex, midx, midy);
5132  // Now we want to be sure that we are in the middle of the polygon not on the edge. This is tricky for complex shaped polygons,
5133  // but we have a stab at it by using the FindLongestAxis method. This puts us in the centre of the longest axis in 8 directions
5134  // from this point
5135  FindLongestAxis(&midx, &midy);
5136  m_elems[p]->SetCentroid(midx, midy);
5137  }
5139 }

◆ CalculateFieldOpennessAllCells()

int Landscape::CalculateFieldOpennessAllCells ( 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.

496 {
497  int dline;
498  int d0 = 0;
499  int minX = m_elems[a_pref]->GetMinX();
500  int minY = m_elems[a_pref]->GetMinY();
501  int maxX = m_elems[a_pref]->GetMaxX();
502  int maxY = m_elems[a_pref]->GetMaxY();
503  for (int ax = minX; ax <= maxX; ax+=10)
504  {
505  for (int ay = minY; ay <= maxY; ay+=10)
506  {
507  dline = m_maxextent; // this is the width of the landscape and will always be at least as big as the biggest return value possible
508  // Get a possible point for this field
509  int cx = ax;
510  int cy = ay;
511  if (m_land->Get(ax, ay) == a_pref)
512  {
517  double offsetx = -1;
518  double offsety = -1;
519  double dx = 1.0 / 45.0;
520  double dy = 0.0;
521  for (int deg = 0; deg<90; deg++)
522  {
524  int d1 = LineHighTest(cx, cy, offsetx, offsety);
525  int d2 = LineHighTest(cx, cy, 0 - offsetx, 0 - offsety);
526  int d = d1;
527  if (d1 > d2) d = d2;
528  if (dline > d) dline = d; // get the minimum
529  offsetx = offsetx + dx;
530  offsety = offsety + dy;
531  }
532  offsetx = 1;
533  offsety = 1;
534  dy = 0 - dx;
535  dx = 0;
536  for (int deg = 0; deg<90; deg++)
537  {
539  int d1 = LineHighTest(cx, cy, offsetx, offsety);
540  int d2 = LineHighTest(cx, cy, 0 - offsetx, 0 - offsety);
541  int d = d1;
542  if (d1 > d2) d = d2;
543  if (dline > d) dline = d;
544  offsetx = offsetx + dx;
545  offsety = offsety + dy;
546  }
547  if (dline > d0) d0 = dline; // Get the maximum. Here we might also want to do something like create statistics from the range of dline
548  }
549  }
550  }
551  return d0;
552 }

◆ CalculateFieldOpennessCentroid()

int Landscape::CalculateFieldOpennessCentroid ( 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.

454 {
455  // Get the centre point for this field
456  int d0 = m_maxextent; // this is the width of the landscape and will always be at least as big as the biggest return value possible
457  int cx = m_elems[a_pref]->GetCentroidX();
458  int cy = m_elems[a_pref]->GetCentroidY();
459 
461  double offsetx = -1;
462  double offsety = -1;
463  double dx = 1.0 / 45.0;
464  double dy = 0.0;
465  for (int deg = 0; deg<90; deg++)
466  {
468  int d1 = LineHighTest(cx, cy, offsetx, offsety);
469  int d2 = LineHighTest(cx, cy, 0 - offsetx, 0 - offsety);
470  int d = d1;
471  if (d1 > d2) d = d2;
472  if (d0 > d) d0 = d;
473  offsetx = offsetx + dx;
474  offsety = offsety + dy;
475  }
476  offsetx = 1;
477  offsety = 1;
478  dy = 0 - dx;
479  dx = 0;
480  for (int deg = 0; deg<90; deg++)
481  {
483  int d1 = LineHighTest(cx, cy, offsetx, offsety);
484  int d2 = LineHighTest(cx, cy, 0 - offsetx, 0 - offsety);
485  int d = d1;
486  if (d1 > d2) d = d2;
487  if (d0 > d) d0 = d;
488  offsetx = offsetx + dx;
489  offsety = offsety + dy;
490  }
491  return d0;
492 }

◆ CalculateMaskCorners()

vector< vector< int > > Landscape::CalculateMaskCorners ( int  a_centroid_x,
int  a_centroid_y,
int  a_half_width 
)

The function to calculate the corners of mask(s) for the given centroid and half-width with wrapping around.

2540  {
2541  vector<vector<int>> return_corners;
2542  //get the corners of the mask
2543  int temp_min_x = a_centroid_x - a_half_width;
2544  int temp_max_x = a_centroid_x + a_half_width;
2545  int temp_min_y = a_centroid_y - a_half_width;
2546  int temp_max_y = a_centroid_y + a_half_width;
2547 
2548  //check if the corners are within the landscape, if yes, only one mask
2549  if(temp_min_x>=0 && temp_max_x<m_width && temp_min_y>=0 && temp_max_y<m_height){
2550  //if the corners are within the landscape, return the corners -- only one mask
2551  return_corners.push_back({temp_min_x, temp_min_y, temp_max_x, temp_max_y});
2552  return return_corners;
2553  }
2554  //if only axis is out of the landscape, two masks
2555  else if(temp_min_x<0 && temp_max_x<m_width && temp_min_y>=0 && temp_max_y<m_height){
2556  //if only the min_x is out of the landscape, return two masks
2557  return_corners.push_back({0, temp_min_y, temp_max_x, temp_max_y});
2558  return_corners.push_back({m_width+temp_min_x, temp_min_y, m_width-1, temp_max_y});
2559  return return_corners;
2560  }
2561  else if(temp_min_x>=0 && temp_max_x>=m_width && temp_min_y>=0 && temp_max_y<m_height){
2562  //if only the max_x is out of the landscape, return two masks
2563  return_corners.push_back({temp_min_x, temp_min_y, m_width-1, temp_max_y});
2564  return_corners.push_back({0, temp_min_y, temp_max_x-m_width, temp_max_y});
2565  return return_corners;
2566  }
2567  else if(temp_min_x>=0 && temp_max_x<m_width && temp_min_y<0 && temp_max_y<m_height){
2568  //if only the min_y is out of the landscape, return two masks
2569  return_corners.push_back({temp_min_x, 0, temp_max_x, temp_max_y});
2570  return_corners.push_back({temp_min_x, m_height+temp_min_y, temp_max_x, m_height-1});
2571  return return_corners;
2572  }
2573  else if(temp_min_x>=0 && temp_max_x<m_width && temp_min_y>=0 && temp_max_y>=m_height){
2574  //if only the max_y is out of the landscape, return two masks
2575  return_corners.push_back({temp_min_x, temp_min_y, temp_max_x, m_height-1});
2576  return_corners.push_back({temp_min_x, 0, temp_max_x, temp_max_y-m_height});
2577  return return_corners;
2578  }
2579 
2580  //if both axis are out of the landscape, four masks
2581  else if(temp_min_x<0 && temp_max_x<m_width && temp_min_y<0 && temp_max_y<m_height){
2582  //if the min_x and min_y are out of the landscape, return four masks
2583  return_corners.push_back({0, 0, temp_max_x, temp_max_y});
2584  return_corners.push_back({m_width+temp_min_x, 0, m_width-1, temp_max_y});
2585  return_corners.push_back({0, m_height+temp_min_y, temp_max_x, m_height-1});
2586  return_corners.push_back({m_width+temp_min_x, m_height+temp_min_y, m_width-1, m_height-1});
2587  return return_corners;
2588  }
2589  else if(temp_min_x>=0 && temp_max_x>=m_width && temp_min_y<0 && temp_max_y<m_height){
2590  //if the max_x and min_y are out of the landscape, return four masks
2591  return_corners.push_back({temp_min_x, 0, m_width-1, temp_max_y});
2592  return_corners.push_back({0, 0, temp_max_x-m_width, temp_max_y});
2593  return_corners.push_back({temp_min_x, m_height+temp_min_y, m_width-1, m_height-1});
2594  return_corners.push_back({0, m_height+temp_min_y, temp_max_x-m_width, m_height-1});
2595  return return_corners;
2596  }
2597  else if(temp_min_x>=0 && temp_max_x>=m_width && temp_min_y>=0 && temp_max_y>=m_height){
2598  //if the min_x and max_y are out of the landscape, return four masks
2599  return_corners.push_back({temp_min_x, temp_min_y, m_width-1, m_height-1});
2600  return_corners.push_back({temp_min_x, 0, m_width-1, temp_max_y-m_height});
2601  return_corners.push_back({0, temp_min_y, temp_max_x-m_width, m_height-1});
2602  return_corners.push_back({0, 0, temp_max_x-m_width, temp_max_y-m_height});
2603  return return_corners;
2604  }
2605  else if(temp_min_x<0 && temp_max_x<m_width && temp_min_y>=0 && temp_max_y>=m_height){
2606  //if the max_x and max_y are out of the landscape, return four masks
2607  return_corners.push_back({0, temp_min_y, temp_max_x, m_height-1});
2608  return_corners.push_back({m_width+temp_min_x, temp_min_y, m_width-1, m_height-1});
2609  return_corners.push_back({0, 0, temp_max_x, temp_max_y-m_height});
2610  return_corners.push_back({m_width+temp_min_x, 0, m_width-1, temp_max_y-m_height});
2611  return return_corners;
2612  }
2613 }

Referenced by Osmia_Female::Forage().

◆ 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

417 {
421  cout << "In CalculateOpenness" << endl;
422 
423  for (unsigned int i = 0; i < m_elems.size(); i++)
424  {
425  TTypesOfLandscapeElement tole = m_elems[i]->GetElementType();
426  switch (tole)
427  {
428  case tole_Field:
429  case tole_Marsh:
430  case tole_Scrub:
434  case tole_PermPasture:
437  if (a_realcalc)
438  {
439  cout << i << " ";
440  m_elems[i]->SetOpenness(CalculateFieldOpennessAllCells(i));
441  }
442  else m_elems[i]->SetOpenness(0);
443  break;
444  default:
445  m_elems[i]->SetOpenness(0);
446  break;
447  }
448  }
449  if (a_realcalc) cout << endl;
450 }

References tole_Field, tole_Marsh, tole_NaturalGrassDry, tole_NaturalGrassWet, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPastureTussocky, and tole_Scrub.

◆ CalHaibitatFlowerResource()

void Landscape::CalHaibitatFlowerResource ( )

Calculate the flower resouce for all the habitat types with flower resource.

Note
This is a temporary solution to make flower strips flowring earlier by 50 days to make them ready for Osmia.
3492  {
3493  for (auto [key, value] : m_habitat_species){
3494  m_habitat_pollen[key].m_quantity = 0;
3495  m_habitat_pollen[key].m_quality = 0;
3496  m_habitat_nectar[key].m_quantity = 0;
3497  m_habitat_nectar[key].m_quality = 0;
3498  for (int i = 0; i<value.size(); i++){
3499  if(m_habitat_flower_num[key][i]>0){
3501  if(key == 59){
3505  }
3506  else if(key == 27){
3510  }
3511  else if(key == 24){
3515  }
3516  else if(key == 29){
3520  }
3521  else if(key == 23){
3525  }
3526  else if(key == 17){
3530  }
3531  else if(key == 4){
3535  }
3536  else{
3540  }
3541  //if(m_habitat_nectar[key].m_quality > m_habitat_nectar[key].m_quantity)
3542  // cout<<"Error: Habitat "<<key<<" has more nectar quality than quantity"<<endl;
3543  }
3544  }
3545  for (int i = 0; i<value.size(); i++){
3547 
3548  m_habitat_pollen[key].m_quality = 1;
3549  }
3550  }
3551  }
3552 }

References cfg_FlowerStripStartFloweringTimePush, g_nectarpollen, PollenNectarData::m_quality, PollenNectarData::m_quantity, PollenNectarDevelopmentData::supplyNectarHabitatSpeciesCurrentDay(), PollenNectarDevelopmentData::supplyNectarHabitatSpeciesGivenDay(), PollenNectarDevelopmentData::supplyPollenHabitatSpeciesCurrentDay(), PollenNectarDevelopmentData::supplyPollenHabitatSpeciesGivenDay(), and CfgInt::value().

◆ CentroidSpiralOut()

void Landscape::CentroidSpiralOut ( int  a_polyref,
int &  a_x,
int &  a_y 
)

Function to move from midx & midy and outwards in concentric circles until a location that matches the polyref is found LKM.

5143 {
5144  if (SupplyPolyRefIndex(a_x, a_y) == a_polyref) return; // Found it so return
5145  // Otherwise its not found so we need to start to spiral out
5146  int loop = 1;
5147  int sx = a_x;
5148  int sy = a_y;
5149  do {
5150  a_y = sy - loop;
5151  for (int i = 0 - loop; i <= loop; i++)
5152  {
5153  a_x = sx + i;
5154  CorrectCoords(a_x, a_y);
5155  if (SupplyPolyRefIndex(a_x, a_y) == a_polyref)
5156  return; // Found it so return
5157  }
5158  a_y = sy + loop;
5159  for (int i = 0 - loop; i <= loop; i++)
5160  {
5161  a_x = sx + i;
5162  CorrectCoords(a_x, a_y);
5163  if (SupplyPolyRefIndex(a_x, a_y) == a_polyref)
5164  return; // Found it so return
5165  }
5166  a_x = sx + loop;
5167  for (int j = 0 - (loop - 1); j< loop; j++)
5168  {
5169  a_y = sy + j;
5170  CorrectCoords(a_x, a_y);
5171  if (SupplyPolyRefIndex(a_x, a_y) == a_polyref)
5172  return; // Found it so return
5173  }
5174  a_x = sx - loop;
5175  for (int j = 0 - (loop - 1); j< loop; j++)
5176  {
5177  a_y = sy + j;
5178  CorrectCoords(a_x, a_y);
5179  if (SupplyPolyRefIndex(a_x, a_y) == a_polyref)
5180  return; // Found it so return
5181  }
5182  loop++;
5183  } while (loop<m_minmaxextent); // This stopping rule should hopefully not be needed, it is set very high.
5184  g_msg->Warn("Landscape::CentroidSpiralOut: Failure of centroid main loop. Looking for polygon index ",a_polyref);
5185  a_x = m_elems[a_polyref]->GetMinX();
5186  a_y = m_elems[a_polyref]->GetMinY();
5187 }

References g_msg, and MapErrorMsg::Warn().

◆ ChangeMapMapping()

void Landscape::ChangeMapMapping ( void  )
protected

Maps the polygon numbers directly to the indices in m_elems.

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.

4188  {
4194  cout << "In Change Map Mapping" << endl;
4195  int mapwidth = m_land->MapWidth();
4196  int mapheight = m_land->MapHeight();
4197  int pest_map_width = mapwidth >> PEST_GRIDSIZE_POW2;
4198  if ( mapwidth & ( PEST_GRIDSIZE - 1 ) ) pest_map_width++;
4199  int oldindex = -1;
4200  for ( int x = 0; x < mapwidth; x++ )
4201  {
4202  for ( int y = 0; y < mapheight; y++ )
4203  {
4204  int polynum = m_land->Get( x, y ); // the polyref e.g. = 1, m_polymapping[ polynum ] = 0
4205  m_elems[ m_polymapping[ polynum ]]->SetMapIndex( m_polymapping[ polynum ] ); // Here we set index in the map to the index in elements, i.e. 0
4206  m_elems[ m_polymapping[ polynum ]]->SetMapValid( true );
4207  // Do the translation.
4208  m_land->Put( x, y, m_polymapping[ polynum ] ); // and now we write this to the map, i.e. 0
4209  // This coordinate is now valid. Throw these coordinates into
4210  // the associated landscape element.
4211  int index = m_polymapping[ SupplyPolyRef( x, y ) ];
4212  if ( index != oldindex )
4213  {
4214  m_elems[ index ]->SetValidXY( x, y );
4215  int l_x = x >> PEST_GRIDSIZE_POW2;
4216  int l_y = y >> PEST_GRIDSIZE_POW2;
4217  int pref = l_y * pest_map_width + l_x;
4218  m_elems[ index ]->SetPesticideCell( pref );
4219  oldindex = index;
4220  }
4221  }
4222  }
4223  RebuildPolyMapping();
4224 /*
4225 // Check that all of the polygons are mentioned in the map.
4226  if ( l_map_check_polygon_xref.value() )
4227  {
4228  for ( unsigned int i = 0; i < m_elems.size(); i++ )
4229  {
4230  if ( !m_elems[ i ]->GetMapValid() ) {
4231  char poly[ 20 ];
4232  sprintf( poly, "%d", m_elems[ i ]->GetPoly() );
4233  g_msg->Warn( WARN_FILE, "Landscape::ChangeMapMapping(): ""Polygon number referenced but not in map file: ", poly );
4234  exit( 1 );
4235  }
4236  }
4237  }
4238 */
4239 }

References m_polymapping, PEST_GRIDSIZE, and PEST_GRIDSIZE_POW2.

◆ CheckForPesticideRecord()

void Landscape::CheckForPesticideRecord ( LE a_field,
TTypesOfPesticideCategory  a_pcide 
)

Check if needed and record pesticide application.

a_pcide can be insecticides, herbicides or fungicides, or it can be a 'test' pesticide

1624 {
1628  if (cfg_pesticidemapon.value())
1629  {
1630  if (cfg_pesticidemaptype.value() == false)
1631  {
1632  m_PesticideMap->Spray(a_field, a_pcide);
1633  }
1634  else
1635  {
1636  if (a_pcide == testpesticide) m_PesticideMap->Spray(a_field, insecticide);
1637  }
1638  }
1640  {
1641  m_PesticideTable->Spray(a_field, a_pcide);
1642  }
1643 }

References cfg_pesticidemapon, cfg_pesticidemaptype, cfg_pesticidetableon, insecticide, testpesticide, and CfgBool::value().

Referenced by Farm::FungicideTreat(), Farm::HerbicideTreat(), Farm::InsecticideTreat(), Farm::Molluscicide(), and Farm::ProductApplication().

◆ ClassificationFieldType()

bool Landscape::ClassificationFieldType ( TTypesOfLandscapeElement  a_tole)

Returns whether the polygon is classfied as a field.

1182  {
1183  switch (a_tole)
1184  {
1185  // Annual rotational field, with varying crops on it
1186  case tole_Field:
1187  // (semi-)permanent managed crops:
1188  case tole_Orchard:
1190  case tole_PermPasture:
1193  case tole_PermPastureTussockyWet: // tole NOT implemented yet
1194  // case tole_Vildtager:
1195  case tole_YoungForest:
1196  case tole_WoodyEnergyCrop:
1197  // new (2021):
1198  case tole_PlantNursery:
1199  case tole_MontadoCorkOak:
1200  case tole_MontadoHolmOak:
1201  case tole_MontadoMixed:
1203  case tole_CorkOakForest:
1204  case tole_HolmOakForest:
1205  case tole_OtherOakForest:
1206  case tole_ChestnutForest:
1207  case tole_EucalyptusForest:
1209  case tole_StonePineForest:
1210  case tole_Vineyard:
1211  case tole_OliveGrove:
1212  case tole_RiceField:
1213  // new (2021 DK Perm Crops):
1214  case tole_OOrchard:
1215  case tole_BushFruit:
1216  case tole_OBushFruit:
1217  case tole_ChristmasTrees:
1218  case tole_OChristmasTrees:
1219  case tole_EnergyCrop:
1220  case tole_OEnergyCrop:
1221  case tole_FarmForest:
1222  case tole_OFarmForest:
1223  case tole_PermPasturePigs:
1224  case tole_OPermPasturePigs:
1225  case tole_OPermPasture:
1227  case tole_FarmYoungForest:
1228  case tole_OFarmYoungForest:
1229  // new (2021 PT Perm Crops):
1230  case tole_AlmondPlantation:
1231  case tole_WalnutPlantation:
1232  // new (2021 FI Perm crops):
1233  case tole_FarmBufferZone:
1234  case tole_NaturalFarmGrass:
1235  case tole_GreenFallow:
1237  // new (2021 DE Perm Crops):
1238  case tole_FlowersPerm:
1239  case tole_AsparagusPerm:
1240  case tole_OAsparagusPerm:
1241  case tole_MushroomPerm:
1242  case tole_OtherPermCrop:
1243  return true;
1244  default:
1245  return false;
1246  }
1247 }

References tole_AgroForestrySystem, tole_AlmondPlantation, tole_AsparagusPerm, tole_BushFruit, tole_ChestnutForest, tole_ChristmasTrees, tole_CorkOakForest, tole_EnergyCrop, tole_EucalyptusForest, tole_FarmBufferZone, tole_FarmFeedingGround, tole_FarmForest, tole_FarmYoungForest, tole_Field, tole_FlowersPerm, tole_GreenFallow, tole_HolmOakForest, tole_MaritimePineForest, tole_MontadoCorkOak, tole_MontadoHolmOak, tole_MontadoMixed, tole_MushroomPerm, tole_NaturalFarmGrass, tole_OAsparagusPerm, tole_OBushFruit, tole_OChristmasTrees, tole_OEnergyCrop, tole_OFarmForest, tole_OFarmYoungForest, tole_OliveGrove, tole_OOrchard, tole_OPermPasture, tole_OPermPastureLowYield, tole_OPermPasturePigs, tole_Orchard, tole_OtherOakForest, tole_OtherPermCrop, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPasturePigs, tole_PermPastureTussocky, tole_PermPastureTussockyWet, tole_PlantNursery, tole_RiceField, tole_StonePineForest, tole_Vineyard, tole_WalnutPlantation, tole_WoodyEnergyCrop, and tole_YoungForest.

Referenced by IsFieldType().

◆ ClassificationForest()

bool Landscape::ClassificationForest ( TTypesOfLandscapeElement  a_tole)

Returns whether the polygon is classfied as woodland.

1323  {
1324 
1325  switch (tole) {
1326  case tole_WoodyEnergyCrop:
1327  case tole_DeciduousForest:
1328  case tole_MixedForest:
1329  case tole_ConiferousForest:
1330  case tole_Copse:
1331  case tole_IndividualTree:
1332  case tole_WoodlandMargin:
1333  case tole_Scrub:
1334  case tole_SwampForest:
1335  case tole_MontadoCorkOak:
1336  case tole_MontadoHolmOak:
1337  case tole_MontadoMixed:
1339  case tole_CorkOakForest:
1340  case tole_HolmOakForest:
1341  case tole_OtherOakForest:
1342  case tole_ChestnutForest:
1343  case tole_EucalyptusForest:
1344  case tole_InvasiveForest:
1346  case tole_StonePineForest:
1347  case tole_YoungForest:
1348  case tole_RiversideTrees:
1349  case tole_FarmForest:
1350  case tole_OFarmForest:
1351  return true;
1352  }
1353  return false;
1354 }

References tole_AgroForestrySystem, tole_ChestnutForest, tole_ConiferousForest, tole_Copse, tole_CorkOakForest, tole_DeciduousForest, tole_EucalyptusForest, tole_FarmForest, tole_HolmOakForest, tole_IndividualTree, tole_InvasiveForest, tole_MaritimePineForest, tole_MixedForest, tole_MontadoCorkOak, tole_MontadoHolmOak, tole_MontadoMixed, tole_OFarmForest, tole_OtherOakForest, tole_RiversideTrees, tole_Scrub, tole_StonePineForest, tole_SwampForest, tole_WoodlandMargin, tole_WoodyEnergyCrop, and tole_YoungForest.

Referenced by Set_TOLE_Att().

◆ ClassificationHigh()

bool Landscape::ClassificationHigh ( TTypesOfLandscapeElement  tole)

Returns whether the polygon is classfied as high.

1251  {
1252 
1253  if (ClassificationForest(tole))
1254  return true;
1255 
1256  switch (tole) {
1257  // NonVegetated
1259  case tole_PitDisused:
1260  case tole_UrbanNoVeg:
1261  case tole_UrbanVeg:
1262  case tole_Garden:
1263  case tole_StoneWall:
1264  case tole_WindTurbine:
1265  case tole_Pylon:
1266  case tole_ActivePit:
1267  case tole_Building:
1268  // Vegetated
1269  case tole_RiversideTrees:
1270  case tole_PlantNursery:
1271  case tole_Hedges:
1272  // orchards and orchard bands
1273  case tole_WoodyEnergyCrop:
1274  case tole_Orchard:
1275  case tole_OrchardBand:
1276  return true;
1277  }
1278 
1279  return false;
1280 }

References tole_ActivePit, tole_Building, tole_BuiltUpWithParkland, tole_Garden, tole_Hedges, tole_Orchard, tole_OrchardBand, tole_PitDisused, tole_PlantNursery, tole_Pylon, tole_RiversideTrees, tole_StoneWall, tole_UrbanNoVeg, tole_UrbanVeg, tole_WindTurbine, and tole_WoodyEnergyCrop.

Referenced by Set_TOLE_Att().

◆ ClassificationPermCrop()

bool Landscape::ClassificationPermCrop ( TTypesOfVegetation  a_vege_type)

Returns whether a vegetation type is classified as a permanent crop.

Currently (18/03/2015) only used for goose foraging, so silage maize does not produce grain

632 {
634  switch (a_vege_type)
635  {
646  case tov_YoungForest:
647  case tov_OrchardCrop:
648  case tov_NLOrchardCrop:
654  case tov_PTShrubPastures:
655  case tov_PTCorkOak:
656  case tov_PTVineyards:
659  case tov_DKOrchApple:
660  case tov_DKOrchPear:
661  case tov_DKOrchCherry:
662  case tov_DKOrchOther:
663  case tov_DKOOrchApple:
664  case tov_DKOOrchPear:
665  case tov_DKOOrchCherry:
666  case tov_DKOOrchOther:
668  case tov_DEOrchard:
670  case tov_DEOOrchard:
673  case tov_DEBushFruitPerm:
679  return true;
680  default: // No matching code so is should not be permanent crop
681  return false;
682  }
683 }

References tov_DEAsparagusEstablishedPlantation, tov_DEBushFruitPerm, tov_DEOAsparagusEstablishedPlantation, tov_DEOBushFruitPerm, tov_DEOOrchard, tov_DEOPermanentGrassGrazed, tov_DEOPermanentGrassLowYield, tov_DEOrchard, tov_DEPermanentGrassGrazed, tov_DEPermanentGrassLowYield, tov_DKBushFruit_Perm1, tov_DKBushFruit_Perm2, tov_DKChristmasTrees_Perm, tov_DKGrassTussocky_Perm, tov_DKOChristmasTrees_Perm, tov_DKOOrchApple, tov_DKOOrchCherry, tov_DKOOrchOther, tov_DKOOrchPear, tov_DKOrchApple, tov_DKOrchardCrop_Perm, tov_DKOrchCherry, tov_DKOrchOther, tov_DKOrchPear, tov_DKPlantNursery_Perm, tov_FINaturalGrassland_Perm, tov_NLOrchardCrop, tov_NLPermanentGrassGrazed, tov_NLPermanentGrassGrazedExtensive, tov_OrchardCrop, tov_PermanentGrassGrazed, tov_PermanentGrassLowYield, tov_PermanentGrassTussocky, tov_PermanentSetAside, tov_PTCorkOak, tov_PTOliveGroveIntensive, tov_PTOliveGroveSuperIntensive, tov_PTOliveGroveTraditional, tov_PTOliveGroveTradOrganic, tov_PTPermanentGrassGrazed, tov_PTShrubPastures, tov_PTVineyards, and tov_YoungForest.

◆ ClassificationUrbanNoVeg()

bool Landscape::ClassificationUrbanNoVeg ( TTypesOfLandscapeElement  a_tole)

Returns whether the polygon is classfied as urban with no vegetation.

1302  {
1303 
1304  switch (tole) {
1305  case tole_UrbanNoVeg:
1306  case tole_Airport:
1307  case tole_Portarea:
1308  case tole_Carpark:
1309  case tole_SmallRoad:
1310  case tole_LargeRoad:
1311  case tole_RefuseSite:
1312  case tole_ActivePit:
1313  case tole_MetalledPath:
1314  case tole_Building:
1315  case tole_AmenityGrass:
1316  case tole_MownGrassStrip:
1317  return true;
1318  }
1319  return false;
1320 }

References tole_ActivePit, tole_Airport, tole_AmenityGrass, tole_Building, tole_Carpark, tole_LargeRoad, tole_MetalledPath, tole_MownGrassStrip, tole_Portarea, tole_RefuseSite, tole_SmallRoad, and tole_UrbanNoVeg.

Referenced by Set_TOLE_Att().

◆ ClassificationVegCereal()

bool Landscape::ClassificationVegCereal ( TTypesOfVegetation  a_vege_type)

Returns whether a vegetation type is classified as cereal.

1032 {
1033  switch (a_vege_type)
1034  {
1035  case tov_SpringBarley:
1036  case tov_SpringBarleySpr:
1037  case tov_WinterBarley:
1038  case tov_SpringWheat:
1039  case tov_WinterWheat:
1040  case tov_WinterRye:
1041  case tov_Oats:
1042  case tov_Triticale:
1043  case tov_SpringBarleySeed:
1050  case tov_OWinterBarley:
1051  case tov_OWinterBarleyExt:
1052  case tov_OWinterRye:
1053  case tov_SpringBarleyGrass:
1056  case tov_OSpringBarley:
1057  case tov_OSpringBarleyPigs:
1059  case tov_OWinterWheat:
1060  case tov_OOats:
1061  case tov_OTriticale:
1062  case tov_WWheatPControl:
1064  case tov_WWheatPTreatment:
1068  case tov_OSpringBarleyExt:
1071  case tov_PLWinterWheat:
1072  case tov_PLWinterBarley:
1073  case tov_PLWinterRye:
1074  case tov_PLWinterTriticale:
1075  case tov_PLSpringWheat:
1076  case tov_PLSpringBarley:
1077  case tov_NLWinterWheat:
1078  case tov_NLSpringBarley:
1079  case tov_PLSpringBarleySpr:
1080  case tov_PLWinterWheatLate:
1081  case tov_PLMaize:
1082  case tov_PLMaizeSilage:
1083  case tov_Maize:
1084  case tov_MaizeSilage:
1085  case tov_MaizeStrigling:
1086  case tov_NLMaize:
1088  case tov_NLMaizeSpring:
1090  case tov_OSBarleySilage:
1091  case tov_DKWinterWheat:
1092  case tov_DKOWinterWheat:
1093  case tov_DKWinterWheat_CC:
1094  case tov_DKOWinterWheat_CC:
1095  case tov_DKSpringBarley:
1096  case tov_DKOSpringBarley:
1097  case tov_DKSpringBarley_CC:
1101  case tov_FIWinterWheat:
1102  case tov_FIOWinterWheat:
1103  case tov_FISpringWheat:
1104  case tov_FIOSpringWheat:
1105  case tov_FIWinterRye:
1106  case tov_FIOWinterRye:
1107  case tov_FISpringOats:
1108  case tov_FIOSpringOats:
1114  case tov_SESpringBarley:
1115  case tov_SEWinterWheat:
1116  case tov_FRWinterWheat:
1117  case tov_FRWinterBarley:
1118  case tov_FRWinterTriticale:
1119  case tov_DKCerealLegume:
1120  case tov_DKOCerealLegume:
1124  case tov_DKOSpringOats:
1125  case tov_DKOSpringOats_CC:
1126  case tov_DKOSpringWheat:
1127  case tov_DKOWinterBarley:
1128  case tov_DKOWinterRape:
1129  case tov_DKOWinterRye:
1130  case tov_DKOWinterRye_CC:
1133  case tov_DKSpringOats:
1134  case tov_DKSpringOats_CC:
1135  case tov_DKSpringWheat:
1136  case tov_DKWinterBarley:
1137  case tov_DKWinterRape:
1138  case tov_DKWinterRye:
1139  case tov_DKWinterRye_CC:
1140  case tov_UKMaize:
1141  case tov_UKSpringBarley:
1142  case tov_UKWinterBarley:
1143  case tov_UKWinterWheat:
1144  case tov_DEWinterWheat:
1145  case tov_DEWinterWheatLate:
1146  case tov_DEOats:
1147  case tov_DESpringRye:
1148  case tov_DEMaize:
1149  case tov_DEMaizeSilage:
1150  case tov_DEWinterRye:
1151  case tov_DEWinterBarley:
1152  case tov_DETriticale:
1153  case tov_DEOWinterWheat:
1154  case tov_DEOOats:
1155  case tov_DEOMaize:
1156  case tov_DEOMaizeSilage:
1157  case tov_DEOWinterRye:
1158  case tov_DEOWinterBarley:
1159  case tov_DEOTriticale:
1160  case tov_DESpringBarley:
1161  case tov_PTMaize:
1162  case tov_PTMaize_Hort:
1163  case tov_PTOats:
1164  case tov_PTWinterWheat:
1165  case tov_PTSorghum:
1166  case tov_PTTriticale:
1167  case tov_PTWinterBarley:
1168  case tov_PTWinterRye:
1169  case tov_IRSpringWheat:
1170  case tov_IRSpringBarley:
1171  case tov_IRSpringOats:
1172  case tov_IRWinterWheat:
1173  case tov_IRWinterBarley:
1174  case tov_IRWinterOats:
1175  return true;
1176  default: return false;
1177  }
1178 }

References tov_AgroChemIndustryCereal, tov_DEMaize, tov_DEMaizeSilage, tov_DEOats, tov_DEOMaize, tov_DEOMaizeSilage, tov_DEOOats, tov_DEOTriticale, tov_DEOWinterBarley, tov_DEOWinterRye, tov_DEOWinterWheat, tov_DESpringBarley, tov_DESpringRye, tov_DETriticale, tov_DEWinterBarley, tov_DEWinterRye, tov_DEWinterWheat, tov_DEWinterWheatLate, tov_DKCerealLegume, tov_DKCerealLegume_Whole, tov_DKOCerealLegume, tov_DKOCerealLegume_Whole, tov_DKOSpringBarley, tov_DKOSpringBarley_CC, tov_DKOSpringBarleyCloverGrass, tov_DKOSpringBarleySilage, tov_DKOSpringOats, tov_DKOSpringOats_CC, tov_DKOSpringWheat, tov_DKOWinterBarley, tov_DKOWinterRape, tov_DKOWinterRye, tov_DKOWinterRye_CC, tov_DKOWinterWheat, tov_DKOWinterWheat_CC, tov_DKSpringBarley, tov_DKSpringBarley_CC, tov_DKSpringBarley_Green, tov_DKSpringBarleyCloverGrass, tov_DKSpringBarleySilage, tov_DKSpringOats, tov_DKSpringOats_CC, tov_DKSpringWheat, tov_DKWinterBarley, tov_DKWinterRape, tov_DKWinterRye, tov_DKWinterRye_CC, tov_DKWinterWheat, tov_DKWinterWheat_CC, tov_FIOSpringBarley_Fodder, tov_FIOSpringBarley_Malt, tov_FIOSpringOats, tov_FIOSpringWheat, tov_FIOWinterRye, tov_FIOWinterWheat, tov_FISpringBarley_Fodder, tov_FISpringBarley_Malt, tov_FISpringOats, tov_FISpringWheat, tov_FISprSpringBarley_Fodder, tov_FIWinterRye, tov_FIWinterWheat, tov_FRWinterBarley, tov_FRWinterTriticale, tov_FRWinterWheat, tov_IRSpringBarley, tov_IRSpringOats, tov_IRSpringWheat, tov_IRWinterBarley, tov_IRWinterOats, tov_IRWinterWheat, tov_Maize, tov_MaizeSilage, tov_MaizeStrigling, tov_NLMaize, tov_NLMaizeSpring, tov_NLSpringBarley, tov_NLSpringBarleySpring, tov_NLWinterWheat, tov_Oats, tov_OBarleyPeaCloverGrass, tov_OOats, tov_OSBarleySilage, tov_OSpringBarley, tov_OSpringBarleyClover, tov_OSpringBarleyExt, tov_OSpringBarleyGrass, tov_OSpringBarleyPigs, tov_OTriticale, tov_OWinterBarley, tov_OWinterBarleyExt, tov_OWinterRye, tov_OWinterWheat, tov_OWinterWheatUndersown, tov_PLMaize, tov_PLMaizeSilage, tov_PLSpringBarley, tov_PLSpringBarleySpr, tov_PLSpringWheat, tov_PLWinterBarley, tov_PLWinterRye, tov_PLWinterTriticale, tov_PLWinterWheat, tov_PLWinterWheatLate, tov_PTMaize, tov_PTMaize_Hort, tov_PTOats, tov_PTSorghum, tov_PTTriticale, tov_PTWinterBarley, tov_PTWinterRye, tov_PTWinterWheat, tov_SESpringBarley, tov_SEWinterWheat, 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_UKMaize, tov_UKSpringBarley, tov_UKWinterBarley, tov_UKWinterWheat, tov_WinterBarley, tov_WinterRye, tov_WinterWheat, tov_WinterWheatStrigling, tov_WinterWheatStriglingCulm, tov_WinterWheatStriglingSingle, tov_WWheatPControl, tov_WWheatPToxicControl, and tov_WWheatPTreatment.

Referenced by Set_TOV_Att(), and SupplyIsCereal2().

◆ ClassificationVegGooseGrass()

bool Landscape::ClassificationVegGooseGrass ( TTypesOfVegetation  a_vege_type)

Returns whether a vegetation type is classified as Goose Grass.

719 {
720  switch (a_vege_type)
721  {
722  case tov_NaturalGrass:
728  case tov_SeedGrass1:
729  case tov_SeedGrass2:
730  case tov_OSeedGrass1:
731  case tov_OSeedGrass2:
737  case tov_FodderGrass:
740  case tov_NLGrassGrazed1:
742  case tov_NLGrassGrazed2:
754  case tov_FIFeedingGround:
755  case tov_FIBufferZone:
764  case tov_UKTempGrass:
765  case tov_PTRyegrass:
766  case tov_PTYellowLupin:
770  case tov_PTGrassGrazed:
778  return true;
779  default:
780  return false;
781  }
782 }

References tov_CloverGrassGrazed1, tov_CloverGrassGrazed2, tov_DEOPermanentGrassGrazed, tov_DEOPermanentGrassLowYield, tov_DEPermanentGrassGrazed, tov_DEPermanentGrassLowYield, tov_DKGrassGrazed_Perm, tov_DKGrassLowYield_Perm, tov_DKGrassTussocky_Perm, tov_DKOGrassLowYield_Perm, tov_FIBufferZone, tov_FIBufferZone_Perm, tov_FIFeedingGround, tov_FIGrasslandPasturePerennial1, tov_FIGrasslandPasturePerennial2, tov_FIGrasslandSilageAnnual, tov_FIGrasslandSilagePerennial1, tov_FIGrasslandSilagePerennial2, tov_FIGreenFallow_1year, tov_FIGreenFallow_Perm, tov_FINaturalGrassland, tov_FINaturalGrassland_Perm, tov_FodderGrass, tov_FRGrassland_Perm, tov_IRGrassland_no_reseed, tov_IRGrassland_reseed, tov_NaturalGrass, tov_NLGrassGrazed1, tov_NLGrassGrazed1Spring, tov_NLGrassGrazed2, tov_NLGrassGrazedExtensive1, tov_NLGrassGrazedExtensive1Spring, tov_NLGrassGrazedExtensive2, tov_NLGrassGrazedExtensiveLast, tov_NLGrassGrazedLast, tov_NLPermanentGrassGrazed, tov_NLPermanentGrassGrazedExtensive, tov_OCloverGrassGrazed1, tov_OCloverGrassGrazed2, tov_OSeedGrass1, tov_OSeedGrass2, tov_PermanentGrassGrazed, tov_PermanentGrassLowYield, tov_PermanentGrassTussocky, tov_PLFodderLucerne1, tov_PLFodderLucerne2, tov_PTCloverGrassGrazed1, tov_PTCloverGrassGrazed2, tov_PTGrassGrazed, tov_PTPermanentGrassGrazed, tov_PTRyegrass, tov_PTYellowLupin, tov_SeedGrass1, tov_SeedGrass2, tov_UKPermanentGrass, and tov_UKTempGrass.

Referenced by Set_TOV_Att().

◆ ClassificationVegGrass()

bool Landscape::ClassificationVegGrass ( TTypesOfVegetation  a_vege_type)

Returns whether a vegetation type is classified as Grass.

922 {
923  switch (a_vege_type)
924  {
925  case tov_NaturalGrass:
933  case tov_SetAside:
934  case tov_OSetAside:
935  case tov_SeedGrass1:
936  case tov_SeedGrass2:
937  case tov_OSeedGrass1:
938  case tov_OSeedGrass2:
943  case tov_OrchardCrop:
944  case tov_NLOrchardCrop:
945  case tov_YoungForest:
946  case tov_FodderGrass:
947  case tov_Heath:
948  case tov_WaterBufferZone:
952  case tov_PTCorkOak:
953  case tov_PTVineyards:
954  case tov_PTRyegrass:
955  case tov_PTYellowLupin:
956  case tov_PTSetAside:
968  case tov_FIFeedingGround:
969  case tov_FIBufferZone:
989  case tov_DKOVegSeeds:
990  case tov_DKGrazingPigs:
991  case tov_DKOGrazingPigs:
996  case tov_DKSetAside:
1006  case tov_DEOrchard:
1007  case tov_DEOOrchard:
1008  case tov_DKOSetAside:
1010  case tov_DKOrchApple:
1011  case tov_DKOrchPear:
1012  case tov_DKOrchCherry:
1013  case tov_DKOrchOther:
1014  case tov_DKOOrchApple:
1015  case tov_DKOOrchPear:
1016  case tov_DKOOrchCherry:
1017  case tov_DKOOrchOther:
1018  case tov_FRGrassland_Perm:
1019  case tov_FRGrassland:
1023  case tov_Wasteland:
1024  return true;
1025  default:
1026  return false;
1027  }
1028 }

References tov_CloverGrassGrazed1, tov_CloverGrassGrazed2, tov_DEGrasslandSilageAnnual, tov_DEGreenFallow_1year, tov_DEOGrasslandSilageAnnual, tov_DEOGreenFallow_1year, tov_DEOOrchard, tov_DEOPermanentGrassGrazed, tov_DEOPermanentGrassLowYield, tov_DEOrchard, tov_DEPermanentGrassGrazed, tov_DEPermanentGrassLowYield, tov_DKCloverGrassGrazed1, tov_DKCloverGrassGrazed2, tov_DKCloverGrassGrazed3, tov_DKGrassGrazed_Perm, tov_DKGrassLowYield_Perm, tov_DKGrassTussocky_Perm, tov_DKGrazingPigs, tov_DKGrazingPigs_Perm, tov_DKOCloverGrassGrazed1, tov_DKOCloverGrassGrazed2, tov_DKOCloverGrassGrazed3, tov_DKOGrassGrazed_Perm, tov_DKOGrassLowYield_Perm, tov_DKOGrazingPigs, tov_DKOGrazingPigs_Perm, tov_DKOOrchApple, tov_DKOOrchCherry, tov_DKOOrchOther, tov_DKOOrchPear, tov_DKOptimalFlowerMix1, tov_DKOptimalFlowerMix2, tov_DKOptimalFlowerMix3, tov_DKOrchApple, tov_DKOrchardCrop_Perm, tov_DKOrchCherry, tov_DKOrchOther, tov_DKOrchPear, tov_DKOSeedGrassRye_Spring, tov_DKOSetAside, tov_DKOSetAside_SummerMow, tov_DKOSpringFodderGrass, tov_DKOVegSeeds, tov_DKOWinterCloverGrassGrazedSown, tov_DKOWinterFodderGrass, tov_DKPlantNursery_Perm, tov_DKSeedGrassFescue_Spring, tov_DKSeedGrassRye_Spring, tov_DKSetAside, tov_DKSetAside_SummerMow, tov_DKSpringFodderGrass, tov_DKWinterCloverGrassGrazedSown, tov_DKWinterFodderGrass, tov_FIBufferZone, tov_FIBufferZone_Perm, tov_FIFeedingGround, tov_FIGrasslandPasturePerennial1, tov_FIGrasslandPasturePerennial2, tov_FIGrasslandSilageAnnual, tov_FIGrasslandSilagePerennial1, tov_FIGrasslandSilagePerennial2, tov_FIGreenFallow_1year, tov_FIGreenFallow_Perm, tov_FINaturalGrassland, tov_FINaturalGrassland_Perm, tov_FodderGrass, tov_FRGrassland, tov_FRGrassland_Perm, tov_Heath, tov_NaturalGrass, tov_NLOrchardCrop, tov_NLPermanentGrassGrazed, tov_NLPermanentGrassGrazedExtensive, tov_OCloverGrassGrazed1, tov_OCloverGrassGrazed2, tov_OrchardCrop, tov_OSeedGrass1, tov_OSeedGrass2, tov_OSetAside, tov_PermanentGrassGrazed, tov_PermanentGrassLowYield, tov_PermanentGrassTussocky, tov_PermanentSetAside, tov_PTCloverGrassGrazed1, tov_PTCloverGrassGrazed2, tov_PTCorkOak, tov_PTPermanentGrassGrazed, tov_PTRyegrass, tov_PTSetAside, tov_PTVineyards, tov_PTYellowLupin, tov_SeedGrass1, tov_SeedGrass2, tov_SetAside, tov_UKPermanentGrass, tov_Wasteland, tov_WaterBufferZone, and tov_YoungForest.

Referenced by Beetle_Adult::IsSuitableForHibernation(), Set_TOV_Att(), and SupplyIsGrass2().

◆ ClassificationVegMaize()

bool Landscape::ClassificationVegMaize ( TTypesOfVegetation  a_vege_type)

Returns whether a vegetation type is classified as maize.

Currently (18/03/2015) only used for goose foraging, so silage maize does not produce grain

688 {
690  switch (a_vege_type)
691  {
692  case tov_Maize:
693  case tov_OMaizeSilage:
694  case tov_MaizeSilage:
695  case tov_PLMaize:
696  case tov_PLMaizeSilage:
697  case tov_NLMaize:
698  case tov_NLMaizeSpring:
699  case tov_UKMaize:
700  case tov_DEMaize:
701  case tov_DEMaizeSilage:
702  case tov_DEOMaize:
703  case tov_DEOMaizeSilage:
704  case tov_PTMaize:
705  case tov_PTMaize_Hort:
706  case tov_DKMaize:
707  case tov_DKMaizeSilage:
708  case tov_DKOMaize:
709  case tov_DKOMaizeSilage:
710 
711  return true;
712  default: // No matching code so is should not be maize
713  return false;
714  }
715 }

References tov_DEMaize, tov_DEMaizeSilage, tov_DEOMaize, tov_DEOMaizeSilage, tov_DKMaize, tov_DKMaizeSilage, tov_DKOMaize, tov_DKOMaizeSilage, tov_Maize, tov_MaizeSilage, tov_NLMaize, tov_NLMaizeSpring, tov_OMaizeSilage, tov_PLMaize, tov_PLMaizeSilage, tov_PTMaize, tov_PTMaize_Hort, and tov_UKMaize.

Referenced by Set_TOV_Att().

◆ ClassificationVegMatureCereal()

bool Landscape::ClassificationVegMatureCereal ( TTypesOfVegetation  a_vege_type)

Returns whether a vegetation type is classified as cereal grown to maturity.

786 {
787  switch (a_vege_type)
788  {
789  case tov_SpringBarley:
790  case tov_SpringBarleySpr:
791  case tov_WinterBarley:
792  case tov_SpringWheat:
793  case tov_WinterWheat:
794  case tov_WinterRye:
795  case tov_Oats:
796  case tov_Triticale:
804  case tov_OWinterBarley:
806  case tov_OWinterRye:
810  case tov_OSpringBarley:
813  case tov_OWinterWheat:
814  case tov_OOats:
815  case tov_OTriticale:
816  case tov_WWheatPControl:
825  case tov_PLWinterWheat:
826  case tov_PLWinterBarley:
827  case tov_PLWinterRye:
829  case tov_PLSpringWheat:
830  case tov_PLSpringBarley:
833  case tov_NLSpringBarley:
834  case tov_NLWinterWheat:
836  case tov_DKWinterWheat:
837  case tov_DKOWinterWheat:
838  case tov_DKSpringBarley:
839  case tov_DKOSpringBarley:
846  case tov_FIWinterWheat:
847  case tov_FIOWinterWheat:
848  case tov_FISpringWheat:
849  case tov_FIOSpringWheat:
850  case tov_FIWinterRye:
851  case tov_FIOWinterRye:
852  case tov_FISpringOats:
853  case tov_FIOSpringOats:
859  case tov_SESpringBarley:
860  case tov_SEWinterWheat:
861  case tov_FRWinterWheat:
862  case tov_FRWinterBarley:
864  case tov_DKCerealLegume:
865  case tov_DKOCerealLegume:
869  case tov_DKOSpringOats:
870  case tov_DKOSpringWheat:
871  case tov_DKOWinterBarley:
872  case tov_DKOWinterRape:
873  case tov_DKOWinterRye:
874  case tov_DKOWinterRye_CC:
875  case tov_DKWinterRye_CC:
878  case tov_DKSpringOats:
879  case tov_DKSpringOats_CC:
881  case tov_DKSpringWheat:
882  case tov_DKWinterBarley:
883  case tov_DKWinterRape:
884  case tov_DKWinterRye:
885  case tov_UKSpringBarley:
886  case tov_UKWinterBarley:
887  case tov_UKWinterWheat:
888  case tov_DEWinterWheat:
890  case tov_DEWinterBarley:
891  case tov_DEWinterRye:
892  case tov_DETriticale:
893  case tov_DEOats:
894  case tov_DESpringRye:
895  case tov_DEOWinterWheat:
896  case tov_DEOWinterBarley:
897  case tov_DEOWinterRye:
898  case tov_DEOTriticale:
899  case tov_DEOOats:
900  case tov_DEOSpringRye:
901  case tov_DESpringBarley:
902  case tov_PTOats:
903  case tov_PTWinterWheat:
904  case tov_PTSorghum:
905  case tov_PTTriticale:
906  case tov_PTWinterBarley:
907  case tov_PTWinterRye:
908  case tov_IRSpringWheat:
909  case tov_IRSpringBarley:
910  case tov_IRSpringOats:
911  case tov_IRWinterWheat:
912  case tov_IRWinterBarley:
913  case tov_IRWinterOats:
914  return true;
915  default:
916  return false;
917  }
918 }

References tov_AgroChemIndustryCereal, tov_DEOats, tov_DEOOats, tov_DEOSpringRye, tov_DEOTriticale, tov_DEOWinterBarley, tov_DEOWinterRye, tov_DEOWinterWheat, tov_DESpringBarley, tov_DESpringRye, tov_DETriticale, tov_DEWinterBarley, tov_DEWinterRye, tov_DEWinterWheat, tov_DEWinterWheatLate, tov_DKCerealLegume, tov_DKCerealLegume_Whole, tov_DKOCerealLegume, tov_DKOCerealLegume_Whole, tov_DKOSpringBarley, tov_DKOSpringBarley_CC, tov_DKOSpringBarleyCloverGrass, tov_DKOSpringBarleySilage, tov_DKOSpringOats, tov_DKOSpringOats_CC, tov_DKOSpringWheat, tov_DKOWinterBarley, tov_DKOWinterRape, tov_DKOWinterRye, tov_DKOWinterRye_CC, tov_DKOWinterWheat, tov_DKOWinterWheat_CC, tov_DKSpringBarley, tov_DKSpringBarley_CC, tov_DKSpringBarley_Green, tov_DKSpringBarleyCloverGrass, tov_DKSpringBarleySilage, tov_DKSpringOats, tov_DKSpringOats_CC, tov_DKSpringWheat, tov_DKWinterBarley, tov_DKWinterRape, tov_DKWinterRye, tov_DKWinterRye_CC, tov_DKWinterWheat, tov_DKWinterWheat_CC, tov_FIOSpringBarley_Fodder, tov_FIOSpringBarley_Malt, tov_FIOSpringOats, tov_FIOSpringWheat, tov_FIOWinterRye, tov_FIOWinterWheat, tov_FISpringBarley_Fodder, tov_FISpringBarley_Malt, tov_FISpringOats, tov_FISpringWheat, tov_FISprSpringBarley_Fodder, tov_FIWinterRye, tov_FIWinterWheat, tov_FRWinterBarley, tov_FRWinterTriticale, tov_FRWinterWheat, tov_IRSpringBarley, tov_IRSpringOats, tov_IRSpringWheat, tov_IRWinterBarley, tov_IRWinterOats, tov_IRWinterWheat, tov_NLSpringBarley, tov_NLSpringBarleySpring, 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_PLSpringBarleySpr, tov_PLSpringWheat, tov_PLWinterBarley, tov_PLWinterRye, tov_PLWinterTriticale, tov_PLWinterWheat, tov_PLWinterWheatLate, tov_PTOats, tov_PTSorghum, tov_PTTriticale, tov_PTWinterBarley, tov_PTWinterRye, tov_PTWinterWheat, tov_SESpringBarley, tov_SEWinterWheat, 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_UKSpringBarley, tov_UKWinterBarley, tov_UKWinterWheat, tov_WinterBarley, tov_WinterRye, tov_WinterWheat, tov_WinterWheatStrigling, tov_WinterWheatStriglingCulm, tov_WinterWheatStriglingSingle, tov_WWheatPControl, tov_WWheatPToxicControl, and tov_WWheatPTreatment.

Referenced by Set_TOV_Att().

◆ ClassificationWater()

bool Landscape::ClassificationWater ( TTypesOfLandscapeElement  tole)

Returns whether the polygon is classfied as water.

1284  {
1285 
1286  switch (tole) {
1287  case tole_Saltwater:
1288  case tole_River:
1289  case tole_Pond:
1290  case tole_RiverBed:
1291  case tole_Freshwater:
1292  case tole_Canal:
1293  case tole_Stream:
1294  case tole_DrainageDitch:
1295  return true;
1296  }
1297  return false;
1298 }

References tole_Canal, tole_DrainageDitch, tole_Freshwater, tole_Pond, tole_River, tole_RiverBed, tole_Saltwater, and tole_Stream.

Referenced by Set_TOLE_Att().

◆ ClassificationWoody()

bool Landscape::ClassificationWoody ( TTypesOfLandscapeElement  a_tole)

Returns whether the polygon is classfied as woody.

1357  {
1358 
1359  if (ClassificationForest(tole))
1360  return true;
1361 
1362  switch (tole) {
1363  case tole_Hedges:
1364  case tole_HedgeBank:
1365  case tole_Vineyard:
1366  case tole_OliveGrove:
1367  case tole_Orchard:
1368  case tole_OOrchard:
1369  case tole_ChristmasTrees:
1370  case tole_OChristmasTrees:
1371  case tole_FarmYoungForest:
1372  case tole_OFarmYoungForest:
1373  case tole_OrchardBand:
1374  case tole_ForestAisle:
1375  case tole_WoodyEnergyCrop:
1376  case tole_AlmondPlantation:
1377  case tole_WalnutPlantation:
1378  return true;
1379  }
1380 
1381  return false;
1382 }

References tole_AlmondPlantation, tole_ChristmasTrees, tole_FarmYoungForest, tole_ForestAisle, tole_HedgeBank, tole_Hedges, tole_OChristmasTrees, tole_OFarmYoungForest, tole_OliveGrove, tole_OOrchard, tole_Orchard, tole_OrchardBand, tole_Vineyard, tole_WalnutPlantation, and tole_WoodyEnergyCrop.

Referenced by Set_TOLE_Att().

◆ ConsolidatePolys()

void Landscape::ConsolidatePolys ( void  )
protected

Used to replace polygons or combine them when there is no special management associated with them.This just reduces the number of polygon entries and saves time and space.

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.

2796 {
2802  const int TypesToReplace = 16;
2803  TTypesOfLandscapeElement replaceList[TypesToReplace] = {
2804  tole_River,
2808  tole_BareRock,
2810  tole_Carpark,
2812  tole_Coast,
2813  tole_Garden,
2818  tole_SandDune,
2820  };
2821  int foundList[TypesToReplace];
2822  cout << "Consolidating polygons with no special behaviour" << endl;
2823  for (int i = 0; i < TypesToReplace; i++) foundList[i] = -1;
2824  int mapwidth = m_land->MapWidth();
2825  int mapheight = m_land->MapHeight();
2826  for (int x = 0; x < mapwidth; x++)
2827  {
2828  for (int y = 0; y < mapheight; y++)
2829  {
2830  int ele = m_land->Get(x, y);
2831  TTypesOfLandscapeElement tole = m_elems[m_polymapping[ele]]->GetElementType();
2832  for (int t = 0; t < TypesToReplace; t++)
2833  {
2834  if (tole == replaceList[t])
2835  {
2836  // Must do something with this cell
2837  if (foundList[t] == -1) foundList[t] = ele;
2838  else
2839  {
2840  // Need to replace this cell
2841  m_land->Put(x, y, foundList[t]);
2842  }
2843  }
2844  }
2845  }
2846  }
2847  // At this point there should be many polygons that are not in the map. So we need to run the valid test.
2848  g_msg->Warn(WARN_FILE, "Landscape::ConsolidatePolys() - ""Consolidate map dump.", "");
2849 }

References g_msg, 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, tole_UrbanNoVeg, MapErrorMsg::Warn(), and WARN_FILE.

◆ CorrectCoords()

void Landscape::CorrectCoords ( int &  x,
int &  y 
)
inline

Function to prevent wrap around errors with co-ordinates using x/y pair.

m_width10 & m_height10 are used to avoid problems with co-ordinate values that are very large. Problems will only occur if coords passed are >10x the world width or height.

2207 {
2211  x = (m_width10 + x) % m_width;
2212  y = (m_height10 + y) % m_height;
2213 }

References m_height, m_height10, m_width, and m_width10.

Referenced by Skylark_Female::CheckForFields(), Osmia_Female::FindNestLocation(), Vole_Population_Manager::IsTrap(), and Osmia_Female::st_Dispersal().

◆ 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

2227 {
2231  if (a_pt.m_x >= m_width) a_pt.m_x = m_width - 1;
2232  if (a_pt.m_y >= m_height) a_pt.m_y = m_height - 1;
2233  if (a_pt.m_x < 0) a_pt.m_x = 0;
2234  if (a_pt.m_y < 0) a_pt.m_y = 0;
2235 }

References m_height, m_width, APoint::m_x, and APoint::m_y.

◆ 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.

2216 {
2220  APoint pt;
2221  pt.m_x = (m_width10 + x) % m_width;
2222  pt.m_y = (m_height10 + y) % m_height;
2223  return pt;
2224 }

References m_height, m_height10, m_width, m_width10, APoint::m_x, and APoint::m_y.

Referenced by Hare_Female::PlaceYoung().

◆ CorrectHeight()

int Landscape::CorrectHeight ( int  y)
inline

Function to prevent wrap around errors with height LKM.

2245 {
2246  return (m_height10+y)%m_height;
2247 }

References m_height, and m_height10.

◆ CorrectWidth()

int Landscape::CorrectWidth ( int  x)
inline

Function to prevent wrap around errors with width LKM.

2239 {
2240  return (m_width10+x)%m_width;
2241 }

References m_width, and m_width10.

◆ CountMapSquares()

void Landscape::CountMapSquares ( void  )
protected

Calculates the area for each polygon in the mapand stores it in LE::m_squares_in_map.

Runs through the list of polygons in Landscape::m_elems and zeros the areas. Then traverses the entire landscape and counts the number of map squares associated with each polygon, storing this as the polygon area ( LE:m_squares_in_map ).

4052  {
4058  int mapwidth = m_land->MapWidth();
4059  int mapheight = m_land->MapHeight();
4060  for ( unsigned int i = 0; i < m_elems.size(); i++ ) {
4061  m_elems[i]->SetArea(0);
4062  m_elems[ i ]->m_squares_in_map=0;
4063  }
4064 
4065  for ( int x = 0; x < mapwidth; x++ ) {
4066  for ( int y = 0; y < mapheight; y++ ) {
4067  int l_ele = m_land->Get( x, y );
4068  m_elems[ l_ele ]->m_squares_in_map++;
4069  }
4070  }
4071 }

◆ 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

4572 {
4574  for (unsigned int i = 0; i < m_elems.size(); i++)
4575  {
4576  if (m_elems[i]->GetElementType() == tole_Pond) {
4577  m_PondIndexList.push_back(i);
4578  m_PondRefsList.push_back(m_elems[i]->GetPoly());
4579  }
4580  }
4581 }

References tole_Pond.

◆ CropTypeToString()

std::string Landscape::CropTypeToString ( TTypesOfCrops  a_crop)

Returns the text representation of a TTypesOfCrops type.

7393  {
7394  switch (a_crop) {
7395  case toc_AsparagusEstablishedPlantation: return "AsparagusEstablishedPlantation";
7396  case toc_Beans: return "Beans";
7397  case toc_Beans_Whole: return "Beans_Whole";
7398  case toc_Beet: return "Beet";
7399  case toc_BushFruit: return "BushFruit";
7400  case toc_Cabbage: return "Cabbage";
7401  case toc_CabbageSpring: return "CabbageSpring";
7402  case toc_Carrots: return "Carrots";
7403  case toc_CarrotsSpring: return "CarrotsSpring";
7404  case toc_CatchCropPea: return "CatchCropPea";
7405  case toc_CloverGrassGrazed1: return "CloverGrassGrazed1";
7406  case toc_CloverGrassGrazed2: return "CloverGrassGrazed2";
7407  case toc_CloverGrassGrazed3: return "CloverGrassGrazed3";
7408  case toc_CorkOak: return "CorkOak";
7409  case toc_DummyCropPestTesting: return "DummyCropPestTesting";
7410  case toc_Fallow: return "Fallow";
7411  case toc_FarmForest: return "FarmForest";
7412  case toc_FieldPeas: return "FieldPeas";
7413  case toc_FieldPeasSilage: return "FieldPeasSilage";
7414  case toc_FieldPeasStrigling: return "FieldPeasStrigling";
7415  case toc_FodderBeet: return "FodderBeet";
7416  case toc_FodderGrass: return "FodderGrass";
7417  case toc_FodderLucerne1: return "FodderLucerne1";
7418  case toc_FodderLucerne2: return "FodderLucerne2";
7419  case toc_GenericCatchCrop: return "GenericCatchCrop";
7420  case toc_GrassGrazed1: return "GrassGrazed1";
7421  case toc_GrassGrazed2: return "GrassGrazed2";
7422  case toc_GrassGrazedExtensive: return "GrassGrazedExtensive";
7423  case toc_GrassGrazedLast: return "GrassGrazedLast";
7424  case toc_GrazingPigs: return "GrazingPigs";
7425  case toc_Horticulture: return "Horticulture";
7426  case toc_Maize: return "Maize";
7427  case toc_MaizeSilage: return "MaizeSilage";
7428  case toc_MaizeSpring: return "MaizeSpring";
7429  case toc_MaizeStrigling: return "MaizeStrigling";
7430  case toc_MixedVeg: return "MixedVeg";
7431  case toc_OAsparagusEstablishedPlantation: return "OAsparagusEstablishedPlantation";
7432  case toc_Oats: return "Oats";
7433  case toc_OBarleyPeaCloverGrass: return "OBarleyPeaCloverGrass";
7434  case toc_OBeans: return "OBeans";
7435  case toc_OBeans_Whole: return "OBeans_Whole";
7436  case toc_OBushFruit: return "OBushFruit";
7437  case toc_OCabbage: return "OCabbage";
7438  case toc_OCarrots: return "OCarrots";
7439  case toc_OCloverGrassGrazed1: return "OCloverGrassGrazed1";
7440  case toc_OCloverGrassGrazed2: return "OCloverGrassGrazed2";
7441  case toc_OCloverGrassGrazed3: return "OCloverGrassGrazed3";
7442  case toc_OCloverGrassSilage1: return "OCloverGrassSilage1";
7443  case toc_OFarmForest: return "OFarmForest";
7444  case toc_OFieldPeas: return "OFieldPeas";
7445  case toc_OFieldPeasSilage: return "OFieldPeasSilage";
7446  case toc_OFirstYearDanger: return "OFirstYearDanger";
7447  case toc_OFodderBeet: return "OFodderBeet";
7448  case toc_OFodderGrass: return "OFodderGrass";
7449  case toc_OGrazingPigs: return "OGrazingPigs";
7450  case toc_OliveGrove: return "OliveGrove";
7451  case toc_OLentils: return "OLentils";
7452  case toc_OLupines: return "OLupines";
7453  case toc_OMaize: return "OMaize";
7454  case toc_OMaizeSilage: return "OMaizeSilage";
7455  case toc_OMixedVeg: return "OMixedVeg";
7456  case toc_OOats: return "OOats";
7457  case toc_OOrchApple: return "OOrchApple";
7458  case toc_OOrchardCrop: return "OOrchardCrop ";
7459  case toc_OOrchCherry: return "OOrchCherry";
7460  case toc_OOrchOther: return "OOrchOther";
7461  case toc_OOrchPear: return "OOrchPear";
7462  case toc_OPermanentGrassGrazed: return "OPermanentGrassGrazed";
7463  case toc_OPermanentGrassLowYield: return "OPermanentGrassLowYield";
7464  case toc_OPotatoes: return "OPotatoes";
7465  case toc_OPotatoesIndustry: return "OPotatoesIndustry";
7466  case toc_OPotatoesSeed: return "OPotatoesSeed";
7467  case toc_OrchApple: return "OrchApple";
7468  case toc_OrchardCrop: return "OrchardCrop";
7469  case toc_OrchCherry: return "OrchCherry";
7470  case toc_OrchOther: return "OrchOther";
7471  case toc_OrchPear: return "OrchPear";
7472  case toc_ORyeGrass: return "ORyeGrass";
7473  case toc_OSBarleySilage: return "OSBarleySilage";
7474  case toc_OSeedGrass1: return "OSeedGrass1";
7475  case toc_OSeedGrass2: return "OSeedGrass2";
7476  case toc_OSetAside: return "OSetAside";
7477  case toc_OSetAside_Flower: return "OSetAside_Flower";
7478  case toc_OSpringBarley: return "OSpringBarley";
7479  case toc_OSpringBarleyCloverGrass: return "OSpringBarleyCloverGrass";
7480  case toc_OSpringBarleyExtensive: return "OSpringBarleyExtensive";
7481  case toc_OSpringBarleyPigs: return "OSpringBarleyPigs";
7482  case toc_OSpringBarleyPeaCloverGrass: return "OSpringBarleyPeaCloverGrass";
7483  case toc_OSpringBarleySilage: return "OSpringBarleySilage";
7484  case toc_OSpringRape: return "OSpringRape";
7485  case toc_OSpringRye: return "OSpringRye";
7486  case toc_OSpringWheat: return "OSpringWheat";
7487  case toc_OStarchPotato: return "OStarchPotato";
7488  case toc_OSugarBeet: return "OSugarBeet";
7489  case toc_OTriticale: return "OTriticale";
7490  case toc_OVegSeeds: return "OVegSeeds";
7491  case toc_OWinterBarley: return "OWinterBarley";
7492  case toc_OWinterBarleyExtensive: return "OWinterBarleyExtensive";
7493  case toc_OWinterRape: return "OWinterRape";
7494  case toc_OWinterRye: return "OWinterRye";
7495  case toc_OWinterWheat: return "OWinterWheat";
7496  case toc_OWinterWheatUndersown: return "OWinterWheatUndersown";
7497  case toc_OWinterWheatUndersownExtensive: return "OWinterWheatUndersownExtensive";
7498  case toc_OYoungForestCrop: return "OYoungForestCrop";
7499  case toc_PermanentGrassGrazed: return "PermanentGrassGrazed";
7500  case toc_PermanentGrassLowYield: return "PermanentGrassLowYield";
7501  case toc_PermanentGrassTussocky: return "PermanentGrassTussocky";
7502  case toc_PermanentSetAside: return "PermanentSetAside";
7503  case toc_PlantNursery: return "PlantNursery";
7504  case toc_Potatoes: return "Potatoes";
7505  case toc_PotatoesIndustry: return "PotatoesIndustry";
7506  case toc_PotatoesSeed: return "PotatoesSeed";
7507  case toc_PotatoesSpring: return "PotatoesSpring";
7508  case toc_Ryegrass: return "Ryegrass";
7509  case toc_ORyegrass: return "ORyegrass";
7510  case toc_SeedGrass1: return "SeedGrass1";
7511  case toc_SeedGrass2: return "SeedGrass2";
7512  case toc_SetAside: return "SetAside";
7513  case toc_Sorghum: return "Sorghum";
7514  case toc_SpringBarley: return "SpringBarley";
7515  case toc_SpringBarleyCloverGrass: return "SpringBarleyCloverGrass";
7516  case toc_SpringBarleyPeaCloverGrass: return "SpringBarleyPeaCloverGrass";
7517  case toc_SpringBarleySeed: return "SpringBarleySeed";
7518  case toc_SpringBarleySilage: return "SpringBarleySilage";
7519  case toc_SpringRape: return "SpringRape";
7520  case toc_SpringRye: return "SpringRye";
7521  case toc_SpringWheat: return "SpringWheat";
7522  case toc_StarchPotato: return "StarchPotato";
7523  case toc_SugarBeet: return "SugarBeet";
7524  case toc_Sunflower: return "Sunflower";
7525  case toc_Triticale: return "Triticale";
7526  case toc_Tulips: return "Tulips";
7527  case toc_Turnip: return "Turnip";
7528  case toc_Unmanaged: return "Unmanaged";
7529  case toc_Vineyards: return "Vineyards";
7530  case toc_VegSeeds: return "VegSeeds";
7531  case toc_WinterBarley: return "WinterBarley";
7532  case toc_WinterRape: return "WinterRape";
7533  case toc_WinterRye: return "WinterRye";
7534  case toc_WinterTriticale: return "WinterTriticale";
7535  case toc_WinterWheat: return "WinterWheat";
7536  case toc_YellowLupin: return "YellowLupin";
7537  case toc_YoungForestCrop: return "YoungForestCrop";
7538  case toc_None: return "None";
7539  }
7540 }

References toc_AsparagusEstablishedPlantation, toc_Beans, toc_Beans_Whole, toc_Beet, toc_BushFruit, toc_Cabbage, toc_CabbageSpring, toc_Carrots, toc_CarrotsSpring, toc_CatchCropPea, toc_CloverGrassGrazed1, toc_CloverGrassGrazed2, toc_CloverGrassGrazed3, toc_CorkOak, toc_DummyCropPestTesting, toc_Fallow, toc_FarmForest, toc_FieldPeas, toc_FieldPeasSilage, toc_FieldPeasStrigling, toc_FodderBeet, toc_FodderGrass, toc_FodderLucerne1, toc_FodderLucerne2, toc_GenericCatchCrop, toc_GrassGrazed1, toc_GrassGrazed2, toc_GrassGrazedExtensive, toc_GrassGrazedLast, toc_GrazingPigs, toc_Horticulture, toc_Maize, toc_MaizeSilage, toc_MaizeSpring, toc_MaizeStrigling, toc_MixedVeg, toc_None, toc_OAsparagusEstablishedPlantation, toc_Oats, toc_OBarleyPeaCloverGrass, toc_OBeans, toc_OBeans_Whole, toc_OBushFruit, toc_OCabbage, toc_OCarrots, toc_OCloverGrassGrazed1, toc_OCloverGrassGrazed2, toc_OCloverGrassGrazed3, toc_OCloverGrassSilage1, toc_OFarmForest, toc_OFieldPeas, toc_OFieldPeasSilage, toc_OFirstYearDanger, toc_OFodderBeet, toc_OFodderGrass, toc_OGrazingPigs, toc_OLentils, toc_OliveGrove, toc_OLupines, toc_OMaize, toc_OMaizeSilage, toc_OMixedVeg, toc_OOats, toc_OOrchApple, toc_OOrchardCrop, toc_OOrchCherry, toc_OOrchOther, toc_OOrchPear, toc_OPermanentGrassGrazed, toc_OPermanentGrassLowYield, toc_OPotatoes, toc_OPotatoesIndustry, toc_OPotatoesSeed, toc_OrchApple, toc_OrchardCrop, toc_OrchCherry, toc_OrchOther, toc_OrchPear, toc_ORyeGrass, toc_ORyegrass, toc_OSBarleySilage, toc_OSeedGrass1, toc_OSeedGrass2, toc_OSetAside, toc_OSetAside_Flower, toc_OSpringBarley, toc_OSpringBarleyCloverGrass, toc_OSpringBarleyExtensive, toc_OSpringBarleyPeaCloverGrass, toc_OSpringBarleyPigs, toc_OSpringBarleySilage, toc_OSpringRape, toc_OSpringRye, toc_OSpringWheat, toc_OStarchPotato, toc_OSugarBeet, toc_OTriticale, toc_OVegSeeds, toc_OWinterBarley, toc_OWinterBarleyExtensive, toc_OWinterRape, toc_OWinterRye, toc_OWinterWheat, toc_OWinterWheatUndersown, toc_OWinterWheatUndersownExtensive, toc_OYoungForestCrop, toc_PermanentGrassGrazed, toc_PermanentGrassLowYield, toc_PermanentGrassTussocky, toc_PermanentSetAside, toc_PlantNursery, toc_Potatoes, toc_PotatoesIndustry, toc_PotatoesSeed, toc_PotatoesSpring, toc_Ryegrass, toc_SeedGrass1, toc_SeedGrass2, toc_SetAside, toc_Sorghum, toc_SpringBarley, toc_SpringBarleyCloverGrass, toc_SpringBarleyPeaCloverGrass, toc_SpringBarleySeed, toc_SpringBarleySilage, toc_SpringRape, toc_SpringRye, toc_SpringWheat, toc_StarchPotato, toc_SugarBeet, toc_Sunflower, toc_Triticale, toc_Tulips, toc_Turnip, toc_Unmanaged, toc_VegSeeds, toc_Vineyards, toc_WinterBarley, toc_WinterRape, toc_WinterRye, toc_WinterTriticale, toc_WinterWheat, toc_YellowLupin, and toc_YoungForestCrop.

◆ DegreesDump()

void Landscape::DegreesDump ( )
protected

Prints the sum of day degrees. See FarmManager::daydegrees.

3251  {
3252 
3253  ofstream ofile ("Daydegrees.txt", ios::app);
3254  //print degrees
3255  ofile << m_FarmManager->GetDD();
3256  ofile << endl;
3257  ofile.close();
3258 }

◆ DistanceToP()

int Landscape::DistanceToP ( APoint  a_Here,
APoint  a_There 
)

Distance to the current main population manager, calculates distance from 2 coordinates to other 2 coordinates.

Landscape::DistanceToP - calculates distance from 2 coordinates to other 2 coordinates.

1709 {
1710  int x = (a_Here.m_x - a_There.m_x);
1711  int y = (a_Here.m_y - a_There.m_y);
1712  if (x < 0) x = x * -1;
1713  if (y < 0) y = y * -1;
1714  if (x > (m_width / 2)) x = m_width - x;
1715  if (y > (m_height / 2)) y = m_height - y;
1716  if ((x != 0) || (y != 0))
1717  {
1718  return (int)(sqrt(double((x * x) + (y * y))));
1719  }
1720  else return 0; // in the case where object is standing on a_There
1721 }

References APoint::m_x, and APoint::m_y.

◆ DistanceToPSquared()

int Landscape::DistanceToPSquared ( APoint  a_Here,
APoint  a_There 
)

Distance to the current main population manager, calculates distance from 2 coordinates to other 2 coordinates but do not square root (for efficiency)

Landscape::DistanceToPSquared - calculates distance from 2 coordinates to other 2 coordinates but do not square root (for efficiency).

1727 {
1728  int x = (a_Here.m_x - a_There.m_x);
1729  int y = (a_Here.m_y - a_There.m_y);
1730  if (x < 0) x = x * -1;
1731  if (y < 0) y = y * -1;
1732  if (x > (m_width / 2)) x = m_width - x;
1733  if (y > (m_height / 2)) y = m_height - y;
1734  if ((x != 0) || (y != 0))
1735  {
1736  return ((x * x) + (y * y));
1737  }
1738  else return 0; // in the case where object is standing on a_There
1739 }

References APoint::m_x, and APoint::m_y.

◆ DumpAllSymbolsAndExit()

void Landscape::DumpAllSymbolsAndExit ( const char *  a_dumpfile)
inline

Dumps all configuration values, including private ones, to a_dumpfile and then calls exit()

1395  {
1396  g_cfg->DumpAllSymbolsAndExit(a_dumpfile);
1397  }

References g_cfg.

◆ DumpCentroids()

void Landscape::DumpCentroids ( void  )

Saves centroid information for each polygon found.

5345 {
5346  ofstream centroidfile("PolygonCentroids.txt", ios::out);
5347  centroidfile<<"Polyref"<<'\t'<<"CX"<<'\t'<<"CY"<<'\t'<<"Type"<<'\t'<<"Area"<<'\t'<<"Country Designation"<<endl;
5348  for (int p = 0; p< (int)m_elems.size(); p++)
5349  {
5350  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;
5351  }
5352  centroidfile.close();
5353 }

◆ DumpMap()

void Landscape::DumpMap ( const char *  a_filename)
protected

Called if the landscape is manipulated to save the new version of the.lsb input file(i.e.the topographical map)

2853 {
2854  int * l_map = m_land->GetMagicP(0, 0); // Hmmm - this is a nasty way round the class data protection. Gets a pointer direct to m_map in rastermap.
2855  /* FILE * l_file;
2856  l_file = fopen(a_filename, "wb" );
2857  if ( !l_file ) {
2858  g_msg->Warn( WARN_FILE, "Landscape::DumpMap(): Unable to open file", a_filename );
2859  exit( 0 );
2860  }
2861 
2862  char * l_id = m_land->GetID();
2863 
2864 
2865  fwrite( l_id, 1, 12, l_file );
2866  fwrite( & m_width, 1, sizeof( int ), l_file );
2867  if (cfg_rectangularmaps_on.value() )
2868  {
2869  fwrite( & m_height, 1, sizeof( int ), l_file );
2870  }
2871  for ( int i = 0; i < m_width * m_height; i++ )
2872  {
2873  LE* le = m_elems[m_polymapping[l_map[i]]];
2874  int l_poly = le->GetPoly();
2875  fwrite( & l_poly, 1, sizeof( int ), l_file );
2876  }
2877  fclose( l_file );
2878  */
2879  ofstream OFile( a_filename, ios::binary);
2880  char id[12] = { "An LSB File" };
2881  OFile.write(id, 12);
2882  OFile.write((char*)&m_width, sizeof (int));
2883  OFile.write((char*)&m_height, sizeof (int));
2884  OFile.write((char*)l_map, m_width*m_height*sizeof (int));
2885  OFile.close();
2886 }

◆ DumpMapGraphics()

void Landscape::DumpMapGraphics ( const char *  a_filename)
protected

Saves the graphics for the landscape LKM.

5670  {
5671  unsigned int linesize = m_maxextent * 3;
5672  unsigned char * frame_buffer = (unsigned char *)malloc(sizeof(unsigned char)* linesize);
5673 
5674  if (frame_buffer == NULL) {
5675  g_msg->Warn(WARN_FILE, "Landscape::DumpMapGraphics(): Out of memory!", "");
5676  exit(1);
5677  }
5678 
5679  FILE * l_file = fopen(a_filename, "w");
5680  if (!l_file) {
5681  g_msg->Warn(WARN_FILE, "Landscape::DumpMapGraphics(): ""Unable to open file for writing: %s\n", a_filename);
5682  exit(1);
5683  }
5684 
5685  fprintf(l_file, "P6\n%d %d %d\n", m_width, m_height, 255);
5686 
5687  for (int y = 0; y < m_height; y++) {
5688  int i = 0;
5689  for (int x = 0; x < m_width; x++) {
5690  int eletype = (int)SupplyElementType(x, y);
5691  int localcolor = 16777215 / eletype;
5692 
5693  if (eletype == (int)tole_Field) {
5694  int category;
5695  double hei = SupplyVegHeight(x, y);
5696  if (hei > 50.0) category = 0; else category = (int)(200.0 - (hei * 4.0));
5697  localcolor = ((category * 65536) + 65535);
5698  }
5699 
5700  frame_buffer[i++] = (unsigned char)(localcolor & 0xff);
5701  frame_buffer[i++] = (unsigned char)((localcolor >> 8) & 0xff);
5702  frame_buffer[i++] = (unsigned char)((localcolor >> 16) & 0xff);
5703  }
5704  fwrite(frame_buffer, sizeof(unsigned char), linesize, l_file);
5705  }
5706 
5707  fclose(l_file);
5708 
5709  free(frame_buffer);
5710 }

References g_msg, tole_Field, MapErrorMsg::Warn(), and WARN_FILE.

◆ DumpMapInfoByArea()

void Landscape::DumpMapInfoByArea ( const char *  a_filename,
bool  a_append,
bool  a_dump_zero_areas,
bool  a_write_veg_names 
)

Dumps landscape information by area LKM.

5723  {
5724  FillVegAreaData();
5725  FILE * outf;
5726  if (a_append) {
5727  outf = fopen(a_filename, "a");
5728  if (!outf) {
5729  g_msg->Warn(WARN_FILE, "Landscape::DumpMapInfoByArea(): ""Unable to open file for appending", a_filename);
5730  exit(1);
5731  }
5732  }
5733  else {
5734  outf = fopen(a_filename, "w");
5735  if (!outf) {
5736  g_msg->Warn(WARN_FILE, "Landscape::DumpMapInfoByArea(): ""Unable to open file for writing", a_filename);
5737  exit(1);
5738  }
5739  }
5740 
5741  // Emit element type info.
5742  for (unsigned int i = 0; i < tov_Undefined + 1; i++) {
5743  if (i == tov_OFirstYearDanger)
5744  continue;
5745  if (!a_dump_zero_areas && l_vegtype_areas[i] < 0.5)
5746  continue;
5747 
5748  fprintf(outf, "Date: %6ld\tVeg Type: %3d\tArea: %10.0f", g_date->OldDays() + g_date->DayInYear() - 364, i, l_vegtype_areas[i]);
5749  if (a_write_veg_names)
5750  fprintf(outf, "\tVeg Name:%s\n", VegtypeToString((TTypesOfVegetation)i).c_str());
5751  else
5752  fprintf(outf, "\n");
5753  }
5754 
5755  fclose(outf);
5756 }

References Calendar::DayInYear(), g_date, g_msg, Calendar::OldDays(), tov_OFirstYearDanger, tov_Undefined, MapErrorMsg::Warn(), and WARN_FILE.

◆ DumpPublicSymbols()

void Landscape::DumpPublicSymbols ( const char *  a_dumpfile,
CfgSecureLevel  a_level 
)
inline

Dumps all configuration values with a security level at or below a_level to a_dumpfile in alphabetical order.

1391  {
1392  g_cfg->DumpPublicSymbols(a_dumpfile, a_level);
1393  }

References g_cfg.

◆ DumpTreatCounters()

void Landscape::DumpTreatCounters ( const char *  a_filename)
protected

When the simulation is closed this method saves the number of each farm management that has been carried out.

5657  {
5658  FILE * l_file = fopen(a_filename, "w");
5659  if (!l_file) {
5660  g_msg->Warn(WARN_FILE, "Landscape::DumpTreatCounters(): ""Unable to open file for writing: %s\n", a_filename);
5661  exit(1);
5662  }
5663 
5664  for (int i = start; i < last_treatment; i++) {
5665  fprintf(l_file, "%3d %s %10d\n", i, EventtypeToString(i).c_str(), m_treatment_counts[i]);
5666  }
5667  fclose(l_file);
5668 }

References g_msg, last_treatment, start, MapErrorMsg::Warn(), and WARN_FILE.

◆ DumpVegAreaData()

void Landscape::DumpVegAreaData ( int  a_day)

Saves the information on vegetation types and areas.

7804  {
7805 
7806  if (cfg_dumpvegjan.value()) {
7807  if ((a_day % 365) == 0) { // Jan 1st
7808  DumpMapInfoByArea(cfg_dumpvegjanfile.value(), true, true, true);
7809  return;
7810  }
7811  }
7812  if (cfg_dumpvegjune.value()) {
7813  if ((a_day % 365) == 152) { // 1st June
7814  DumpMapInfoByArea(cfg_dumpvegjunefile.value(), true, true, true);
7815  }
7816  }
7817 
7818 }

References cfg_dumpvegjan, cfg_dumpvegjanfile, cfg_dumpvegjune, cfg_dumpvegjunefile, CfgBool::value(), and CfgStr::value().

Referenced by RunTheSim().

◆ EventDump()

void Landscape::EventDump ( int  x,
int  y,
int  x2,
int  y2 
)
protected

Records farm events carried out on the x, y locations.

3261  {
3262  FILE * vfile=fopen("EventDump.txt", "a" );
3263  if (!vfile) {
3264  g_msg->Warn( WARN_FILE, "Landscape::EventDump(): Unable to open file", "EventDump.txt" );
3265  exit( 1 );
3266  }
3267  FarmToDo event;
3268  int i = 0;
3269  int day = SupplyDayInYear();
3270  fprintf( vfile, "%d: ", day );
3271  while ( ( event = ( FarmToDo )SupplyLastTreatment( x1, y1, & i ) ) != sleep_all_day ) {
3272  fprintf( vfile, "%d ", event );
3273  }
3274  i = 0;
3275  fprintf( vfile, " - " );
3276  while ( ( event = ( FarmToDo )SupplyLastTreatment( x2, y2, & i ) ) != sleep_all_day ) {
3277  fprintf( vfile, "%d ", event );
3278  }
3279  fprintf( vfile, "\n" );
3280  fclose( vfile );
3281 }

References g_msg, sleep_all_day, MapErrorMsg::Warn(), and WARN_FILE.

◆ EventDumpPesticides()

void Landscape::EventDumpPesticides ( int  x1,
int  y1 
)
protected

Records pesticided application farm events carried out on the x,y location.

3284  {
3285  FILE * vfile=fopen("EventDump.txt", "a" );
3286  if (!vfile) {
3287  g_msg->Warn( WARN_FILE, "Landscape::EventDump(): Unable to open file", "EventDump.txt" );
3288  exit( 1 );
3289  }
3290  FarmToDo a_event;
3291  int i = 0;
3292  int day = this->SupplyGlobalDate();
3293  int herb = 0;
3294  int fung = 0;
3295  int ins = 0;
3296  while ( ( a_event = ( FarmToDo )SupplyLastTreatment( x1, y1, & i ) ) != sleep_all_day ) {
3297  if (a_event == herbicide_treat )
3298  {
3299  herb++;
3300  }
3301  else if (a_event == fungicide_treat ) fung++;
3302  else if (a_event == insecticide_treat) ins++;
3303  }
3304  if (herb+fung+ins >0 ) fprintf( vfile, "%d\t%d\t%d\t%d\n", day, herb, fung, ins );
3305  i = 0;
3306  fclose( vfile );
3307 }

References fungicide_treat, g_msg, herbicide_treat, insecticide_treat, sleep_all_day, MapErrorMsg::Warn(), and WARN_FILE.

◆ EventtypeToString()

std::string Landscape::EventtypeToString ( int  a_event)

Returns the text representation of a treatment type.

6024  {
6025  switch (a_event) {
6026  case start:
6027  return "start";
6028  case sleep_all_day:
6029  return "sleep_all_day";
6030  case autumn_plough:
6031  return "autumn_plough";
6032  case stubble_plough:
6033  return "stubble_plough";
6035  return "stubble_cultivator_heavy";
6037  return "heavy_cultivator_aggregate";
6038  case autumn_harrow:
6039  return "autumn_harrow";
6040  case preseeding_cultivator:
6041  return "preseeding_cultivator";
6043  return "preseeding_cultivator_sow";
6044  case autumn_roll:
6045  return "autumn_roll";
6046  case autumn_sow:
6047  return "autumn_sow";
6048  case winter_plough:
6049  return "winter_plough";
6050  case winter_harrow:
6051  return "winter_harrow";
6052  case deep_ploughing:
6053  return "deep_ploughing";
6054  case spring_plough:
6055  return "spring_plough";
6056  case spring_harrow:
6057  return "spring_harrow";
6058  case spring_roll:
6059  return "spring_roll";
6060  case spring_sow:
6061  return "spring_sow";
6062  case spring_sow_with_ferti:
6063  return "spring_sow_with_ferti";
6064  case summer_plough:
6065  return "summer_plough";
6066  case summer_harrow:
6067  return "summer_harrow";
6068  case summer_sow:
6069  return "summer_sow";
6070  case fp_npks:
6071  return "fp_npks";
6072  case fp_npk:
6073  return "fp_npk";
6074  case fp_pk:
6075  return "fp_pk";
6076  case fp_p:
6077  return "fp_p";
6078  case fp_k:
6079  return "fp_k";
6080  case fp_sk:
6081  return "fp_sk";
6082  case fp_liquidNH3:
6083  return "fp_liquidNH3";
6084  case fp_slurry:
6085  return "fp_slurry";
6086  case fp_ammoniumsulphate:
6087  return "fp_ammoniumsulphate";
6088  case fp_manganesesulphate:
6089  return "fp_manganesesulphate";
6090  case fp_manure:
6091  return "fp_manure";
6092  case fp_greenmanure:
6093  return "fp_greenmanure";
6094  case fp_sludge:
6095  return "fp_sludge";
6096  case fp_rsm:
6097  return "fp_rsm";
6098  case fp_calcium:
6099  return "fp_calcium";
6100  case fa_npks:
6101  return "fa_npks";
6102  case fa_npk:
6103  return "fa_npk";
6104  case fa_pk:
6105  return "fa_pk";
6106  case fa_p:
6107  return "fa_p";
6108  case fa_k:
6109  return "fa_k";
6110  case fa_sk:
6111  return "fa_sk";
6112  case fa_slurry:
6113  return "fa_slurry";
6114  case fa_ammoniumsulphate:
6115  return "fa_ammoniumsulphate";
6116  case fa_manganesesulphate:
6117  return "fa_manganesesulphate";
6118  case fa_manure:
6119  return "fa_manure";
6120  case fa_greenmanure:
6121  return "fa_greenmanure";
6122  case fa_sludge:
6123  return "fa_sludge";
6124  case fa_rsm:
6125  return "fa_rsm";
6126  case fa_calcium:
6127  return "fa_calcium";
6128  case herbicide_treat:
6129  return "herbicide_treat";
6130  case growth_regulator:
6131  return "growth_regulator";
6132  case fungicide_treat:
6133  return "fungicide_treat";
6134  case insecticide_treat:
6135  return "insecticide_treat";
6136  case org_insecticide:
6137  return "organic insecticide";
6138  case org_herbicide:
6139  return "organic herbicide";
6140  case org_fungicide:
6141  return "organic fungicide";
6142  case product_treat:
6143  return "pesticide_product_treat";
6144  case syninsecticide_treat:
6145  return "syninsecticide_treat";
6146  case molluscicide:
6147  return "molluscicide";
6148  case row_cultivation:
6149  return "row_cultivation";
6150  case strigling:
6151  return "strigling";
6152  case flammebehandling:
6153  return "flammebehandling";
6154  case hilling_up:
6155  return "hilling_up";
6156  case water:
6157  return "water";
6158  case swathing:
6159  return "swathing";
6160  case harvest:
6161  return "harvest";
6162  case cattle_out:
6163  return "cattle_out";
6164  case cattle_out_low:
6165  return "cattle_out_low";
6166  case pigs_out:
6167  return "pigs_out";
6168  case cut_to_hay:
6169  return "cut_to_hay";
6170  case cut_to_silage:
6171  return "cut_to_silage";
6172  case straw_chopping:
6173  return "straw_chopping";
6174  case hay_turning:
6175  return "hay_turning";
6176  case hay_bailing:
6177  return "hay_bailing";
6178  case stubble_harrowing:
6179  return "stubble_harrowing";
6181  return "autumn_or_spring_plough";
6182  case burn_straw_stubble:
6183  return "burn_straw_stubble";
6184  case burn_top:
6185  return "burn_top";
6186  case mow:
6187  return "mow";
6188  case cut_weeds:
6189  return "cut_weeds";
6190  case strigling_sow:
6191  return "strigling_sow";
6193  return "PesticideTrialTreatment";
6194  case trial_toxiccontrol:
6195  return "PesticideTrialToxic";
6196  case trial_control:
6197  return "PesticideTrialControl";
6198  case glyphosate:
6199  return "Glyphosate on setaside";
6200  case biocide:
6201  return "biocide";
6202  case strigling_hill:
6203  return "strigling_hill";
6204  case bed_forming:
6205  return "bed_forming";
6206  case flower_cutting:
6207  return "flower_cutting";
6208  case bulb_harvest:
6209  return "bulb_harvest";
6210  case straw_covering:
6211  return "straw_covering";
6212  case straw_removal:
6213  return "straw_removal";
6214  case pruning:
6215  return "pruning";
6216  case shredding:
6217  return "shredding";
6218  case green_harvest:
6219  return "green_harvest";
6220  case fiber_covering:
6221  return " fiber_covering";
6222  case fiber_removal:
6223  return " fiber_removal";
6224  case shallow_harrow:
6225  return "shallow harrow";
6226  case fp_boron:
6227  return "fp_boron";
6228  case fp_n:
6229  return "fp_n";
6230  case fp_nk:
6231  return "fp_nk";
6232  case fa_nk:
6233  return "fa_nk";
6234  case fp_ns:
6235  return "fp_ns";
6236  case fp_nc:
6237  return "fp_nc";
6238  case autumn_sow_with_ferti:
6239  return "autumn_sow_with_ferti";
6240  case harvest_bushfruit:
6241  return "harvest_bushfruit";
6242  case fp_cu:
6243  return "fp_cu";
6244  case fa_n:
6245  return "fa_n";
6246  case fa_cu:
6247  return "fa_cu";
6248  case fa_boron:
6249  return "fa_boron";
6250  case fa_pks:
6251  return "fa_pks";
6252  case fp_pks:
6253  return "fp_pks";
6254  case harvestshoots:
6255  return "harvest_shoots";
6256  case manual_weeding:
6257  return "manual_weeding";
6258  case pheromone:
6259  return "pheromone";
6260  default:
6261  g_msg->Warn(WARN_FILE, "Landscape::EventtypeToString(): Unknown event type:", int(a_event));
6262  exit(1);
6263  }
6264 }

References autumn_harrow, autumn_or_spring_plough, autumn_plough, autumn_roll, autumn_sow, autumn_sow_with_ferti, bed_forming, biocide, bulb_harvest, burn_straw_stubble, burn_top, cattle_out, cattle_out_low, cut_to_hay, cut_to_silage, cut_weeds, deep_ploughing, fa_ammoniumsulphate, fa_boron, fa_calcium, fa_cu, fa_greenmanure, fa_k, fa_manganesesulphate, fa_manure, fa_n, fa_nk, fa_npk, fa_npks, fa_p, fa_pk, fa_pks, fa_rsm, fa_sk, fa_sludge, fa_slurry, fiber_covering, fiber_removal, flammebehandling, flower_cutting, fp_ammoniumsulphate, fp_boron, fp_calcium, fp_cu, fp_greenmanure, fp_k, fp_liquidNH3, fp_manganesesulphate, fp_manure, fp_n, fp_nc, fp_nk, fp_npk, fp_npks, fp_ns, fp_p, fp_pk, fp_pks, fp_rsm, fp_sk, fp_sludge, fp_slurry, fungicide_treat, g_msg, glyphosate, green_harvest, growth_regulator, harvest, harvest_bushfruit, harvestshoots, hay_bailing, hay_turning, heavy_cultivator_aggregate, herbicide_treat, hilling_up, insecticide_treat, manual_weeding, molluscicide, mow, org_fungicide, org_herbicide, org_insecticide, pheromone, pigs_out, preseeding_cultivator, preseeding_cultivator_sow, product_treat, pruning, row_cultivation, shallow_harrow, shredding, 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, summer_harrow, summer_plough, summer_sow, swathing, syninsecticide_treat, trial_control, trial_insecticidetreat, trial_toxiccontrol, MapErrorMsg::Warn(), WARN_FILE, water, winter_harrow, and winter_plough.

Referenced by Vole_JuvenileMale::OnFarmEvent(), Vole_JuvenileFemale::OnFarmEvent(), Skylark_Clutch::OnFarmEvent(), Skylark_Nestling::OnFarmEvent(), Skylark_PreFledgeling::OnFarmEvent(), Skylark_Female::OnFarmEvent(), Skylark_Male::OnFarmEvent(), Hare_Infant::OnFarmEvent(), and Hare_Young::OnFarmEvent().

◆ FarmtypeToString()

std::string Landscape::FarmtypeToString ( TTypesOfFarm  a_farmtype)

Returns the text name of a TTypesOfFarm type.

7543  {
7544  switch (a_farmtype)
7545  {
7547  return "Conventional Cattle";
7548  case tof_ConventionalPig:
7549  return "Conventional Pig";
7550  case tof_ConventionalPlant:
7551  return "Conventional Plant";
7552  case tof_OrganicCattle:
7553  return "Organic Cattle";
7554  case tof_OrganicPig:
7555  return "Organic Pig";
7556  case tof_OrganicPlant:
7557  return "Organic Plant";
7558  case tof_PTrialControl:
7559  return "PTrialControl";
7560  case tof_PTrialTreatment:
7561  return "PTrialTreatment";
7563  return "PTrialToxicControl";
7564  case tof_ConvMarginalJord:
7565  return "ConvMarginalJord";
7567  return "AgroChemIndustryCerealFarm1";
7569  return "AgroChemIndustryCerealFarm2";
7571  return "AgroChemIndustryCerealFarm3";
7572  case tof_NoPesticideBase:
7573  return "NoPesticideBase";
7574  case tof_NoPesticideNoP:
7575  return "NoPesticideNoP";
7576  case tof_UserDefinedFarm1:
7577  return "UserDefinedFarm1";
7578  case tof_UserDefinedFarm2:
7579  return "UserDefinedFarm2";
7580  case tof_UserDefinedFarm3:
7581  return "UserDefinedFarm3";
7582  case tof_UserDefinedFarm4:
7583  return "UserDefinedFarm4";
7584  case tof_UserDefinedFarm5:
7585  return "UserDefinedFarm5";
7586  case tof_UserDefinedFarm6:
7587  return "UserDefinedFarm6";
7588  case tof_UserDefinedFarm7:
7589  return "UserDefinedFarm7";
7590  case tof_UserDefinedFarm8:
7591  return "UserDefinedFarm8";
7592  case tof_UserDefinedFarm9:
7593  return "UserDefinedFarm9";
7594  case tof_UserDefinedFarm10:
7595  return "UserDefinedFarm10";
7596  case tof_UserDefinedFarm11:
7597  return "UserDefinedFarm11";
7598  case tof_UserDefinedFarm12:
7599  return "UserDefinedFarm12";
7600  case tof_UserDefinedFarm13:
7601  return "UserDefinedFarm13";
7602  case tof_UserDefinedFarm14:
7603  return "UserDefinedFarm14";
7604  case tof_UserDefinedFarm15:
7605  return "UserDefinedFarm15";
7606  case tof_UserDefinedFarm16:
7607  return "UserDefinedFarm16";
7608  case tof_UserDefinedFarm17:
7609  return "UserDefinedFarm17";
7610  case tof_UserDefinedFarm18:
7611  return "UserDefinedFarm18";
7612  case tof_UserDefinedFarm19:
7613  return "UserDefinedFarm19";
7614  case tof_UserDefinedFarm20:
7615  return "UserDefinedFarm20";
7616  case tof_UserDefinedFarm21:
7617  return "UserDefinedFarm21";
7618  case tof_UserDefinedFarm22:
7619  return "UserDefinedFarm22";
7620  case tof_UserDefinedFarm23:
7621  return "UserDefinedFarm23";
7622  case tof_UserDefinedFarm24:
7623  return "UserDefinedFarm24";
7624  case tof_UserDefinedFarm25:
7625  return "UserDefinedFarm25";
7626  case tof_UserDefinedFarm26:
7627  return "UserDefinedFarm26";
7628  case tof_UserDefinedFarm27:
7629  return "UserDefinedFarm27";
7630  case tof_UserDefinedFarm28:
7631  return "UserDefinedFarm28";
7632  case tof_UserDefinedFarm29:
7633  return "UserDefinedFarm29";
7634  case tof_UserDefinedFarm30:
7635  return "UserDefinedFarm30";
7636  case tof_UserDefinedFarm31:
7637  return "UserDefinedFarm31";
7638  case tof_UserDefinedFarm32:
7639  return "UserDefinedFarm32";
7640  case tof_UserDefinedFarm33:
7641  return "UserDefinedFarm33";
7642  case tof_UserDefinedFarm34:
7643  return "UserDefinedFarm34";
7644  case tof_UserDefinedFarm35:
7645  return "UserDefinedFarm35";
7646  case tof_UserDefinedFarm36:
7647  return "UserDefinedFarm36";
7648  case tof_OptimisingFarm:
7649  return "OptimisingFarm";
7650  default:
7651  g_msg->Warn(WARN_FILE, "Landscape::FarmtypeToString(): Unknown farm type:", int(a_farmtype));
7652  exit(1);
7653  }
7654 
7655 }

References g_msg, tof_AgroChemIndustryCerealFarm1, tof_AgroChemIndustryCerealFarm2, tof_AgroChemIndustryCerealFarm3, tof_ConventionalCattle, tof_ConventionalPig, tof_ConventionalPlant, tof_ConvMarginalJord, tof_NoPesticideBase, tof_NoPesticideNoP, tof_OptimisingFarm, tof_OrganicCattle, tof_OrganicPig, tof_OrganicPlant, tof_PTrialControl, tof_PTrialToxicControl, tof_PTrialTreatment, tof_UserDefinedFarm1, tof_UserDefinedFarm10, tof_UserDefinedFarm11, tof_UserDefinedFarm12, tof_UserDefinedFarm13, tof_UserDefinedFarm14, tof_UserDefinedFarm15, tof_UserDefinedFarm16, tof_UserDefinedFarm17, tof_UserDefinedFarm18, tof_UserDefinedFarm19, tof_UserDefinedFarm2, tof_UserDefinedFarm20, tof_UserDefinedFarm21, tof_UserDefinedFarm22, tof_UserDefinedFarm23, tof_UserDefinedFarm24, tof_UserDefinedFarm25, tof_UserDefinedFarm26, tof_UserDefinedFarm27, tof_UserDefinedFarm28, tof_UserDefinedFarm29, tof_UserDefinedFarm3, tof_UserDefinedFarm30, tof_UserDefinedFarm31, tof_UserDefinedFarm32, tof_UserDefinedFarm33, tof_UserDefinedFarm34, tof_UserDefinedFarm35, tof_UserDefinedFarm36, tof_UserDefinedFarm4, tof_UserDefinedFarm5, tof_UserDefinedFarm6, tof_UserDefinedFarm7, tof_UserDefinedFarm8, tof_UserDefinedFarm9, MapErrorMsg::Warn(), and WARN_FILE.

◆ FillVegAreaData()

void Landscape::FillVegAreaData ( )

Runs through all polygons and records the area of each vegetation type.

5712  {
5713  for (unsigned int i = 0; i < (tov_Undefined + 1); i++) {
5714  l_vegtype_areas[i] = 0.0;
5715  }
5716 
5717  // Sum up statistics on element type.
5718  for (unsigned int i = 0; i < m_elems.size(); i++) {
5719  l_vegtype_areas[m_elems[i]->GetVegType()] += m_elems[i]->GetArea();
5720  }
5721 }

References tov_Undefined.

Referenced by Population_Manager::SpeciesSpecificReporting().

◆ FindBestRectangle()

int Landscape::FindBestRectangle ( int  a_polyindex,
int *  a_x,
int *  a_y,
int *  a_width,
int *  a_x_start,
int *  a_y_start 
)
protected

From a central location finds the biggest rectangle that fits inside the field.

This method finds the rectangle that describes the field the best, which means the orientation of the rectangle that gives the biggest in-field area to the total area of the rectangle. The orientation of the longest axis of the rectangle is returned. The width (lenght of shortest axis) as well as starting point (x and y) on the short side of the rectangle is also saved.

4815 {
4822  int ourpoly = SupplyPolyRef(*(a_x), *(a_y));
4823  int dist[8];
4824  int dist_steps[8];
4825  int distx[16];
4826  int disty[16];
4827  int found = -1;
4828  int perp = -1;
4829  int max_area = 0;
4830  int fx[16];
4831  int fy[16];
4832  // Find the distance from the center to the edge in 16 different directions (spaced with 22.5 degrees)
4833  for (unsigned v = 0; v < 16; v++){
4834  int x1 = *(a_x);
4835  int y1 = *(a_y);
4836  AxisLoop(ourpoly, &x1, &y1, v);
4837  x1 -= m_x_add[v];
4838  y1 -= m_y_add[v];
4839  fx[v] = x1;
4840  fy[v] = y1;
4841  distx[v] = abs(*(a_x)-x1);
4842  disty[v] = abs(*(a_y)-y1);
4843  }
4844  // Calculate the length of each of the 8 axis
4845  for (int di = 0; di < 8; di++){
4846  int ddx = distx[di] + distx[di + 8];
4847  int ddy = disty[di] + disty[di + 8];
4848  int temp_dist = sqrt(pow(ddx, 2) + pow(ddy, 2));
4849  dist[di] = temp_dist;
4850  if (di == 2 || di == 6) dist_steps[di] = temp_dist / sqrt(2);
4851  else if (di == 1 || di == 3 || di == 5 || di == 7) dist_steps[di] = temp_dist / sqrt(5);
4852  else dist_steps[di] = temp_dist;
4853  }
4854  // Calculate the area to decide which rectangle is the best
4855  double area_fraction = 0;
4856  for (int i = 0; i < 4; i++){
4857  // Check how much of area is belonging to polygon
4858  int in_area = 0;
4859  int out_area = 0;
4860  // Loop over every cell in rectangle
4861  for (int l = 0; l < dist_steps[i]; l++) {
4862  int temp_x_axis1 = fx[i] - l * m_x_add[i];
4863  int temp_y_axis1 = fy[i] - l * m_y_add[i];
4864  for (int h = 0; h < dist_steps[i + 4]; h++) {
4865  int temp_x_axis2 = temp_x_axis1 - distx[i + 4] - h * m_x_add[i + 4];
4866  int temp_y_axis2 = temp_y_axis1 - disty[i + 4] - h * m_y_add[i + 4];
4867  if ((temp_x_axis2 >= 0) && (temp_y_axis2 >= 0) && (temp_x_axis2 < m_width) && (temp_y_axis2 < m_height)) {
4868  if (a_polyindex == m_land->Get(temp_x_axis2, temp_y_axis2)) in_area++;
4869  else out_area++;
4870  }
4871  }
4872  }
4873  // Check which rectangle has the best area ratio
4874  double temp_frac = (double)in_area / (in_area + out_area);
4875  if (temp_frac > area_fraction) {
4876  area_fraction = temp_frac;
4877  // Check which side is the longest
4878  if (dist[i] > dist[i + 4]) { found = i; perp = i + 4; }
4879  else { found = i + 4; perp = i; }
4880  // Save width and starting point on short side of rectangle
4881  *a_width = dist[perp];
4882  *a_x_start = fx[perp];
4883  *a_y_start = fy[perp];
4884  }
4885  }
4886  return found;
4887 }

◆ FindFieldCenter()

bool Landscape::FindFieldCenter ( LE a_field,
int *  x,
int *  y 
)
protected

Finds a location in the middle of a field to ‘seed a beetlebank’

4763  {
4764  // Start at x,y
4765  // works by selecting the point that is a mean of the co-ords of the centers of 8 axes from this point that are in the field.
4766  // Then do it again, and again until we don't move more than 1m or we have tried too many times
4767 
4768  int ourpoly=SupplyPolyRef(*(x),*(y));
4769  if (ourpoly!=a_field->GetPoly()) return false;
4770  int centers[2][16];
4771  int tries=0;
4772  int diff=999;
4773  int x1=*(x);
4774  int y1=*(y);
4775  int centreX=x1;
4776  int centreY=y1;
4777  // NB we might escape without bounds checking here because the polygon number does not wrap round - will only ever be a problem if we go SimX+1,SimY+1
4778  while ((diff>1) && (tries++<100)) {
4779  for (unsigned v=0; v<8; v++) {
4780  x1=centreX;
4781  y1=centreY;
4782  AxisLoop(ourpoly, &x1, &y1, v);
4783  centers[0][v]=x1-m_x_add[v];
4784  centers[1][v]=y1-m_y_add[v];
4785  x1=centreX;
4786  y1=centreY;
4787  AxisLoop(ourpoly, &x1, &y1, v+8);
4788  centers[0][v+8]=x1-m_x_add[v+8];
4789  centers[1][v+8]=y1-m_y_add[v+8];
4790  }
4791  int oldx=centreX;
4792  int oldy=centreY;
4793  centreX=0;
4794  centreY=0;
4795  for (int h=0; h<16; h++) {
4796  centreX+=centers[0][h];
4797  centreY+=centers[1][h];
4798  }
4799  centreX/=16;
4800  centreY/=16;
4801  diff=abs(oldx-centreX)+abs(oldy-centreY);
4802  }
4803  *(x)=centreX;
4804  *(y)=centreY;
4805  int tourpoly=SupplyPolyRef(*(x),*(y));
4806  if (tourpoly!=ourpoly) {
4807  return false; // can happen eg if there is a pond in the middle of the field
4808  }
4809 
4810  return true;
4811 }

References LE::GetPoly().

◆ FindLongestAxis()

int Landscape::FindLongestAxis ( int *  x,
int *  y 
)
protected

From a central location finds the longest axis of a field.

4890 {
4891  int ourpoly=SupplyPolyRef(*(a_x),*(a_y));
4892  int dist[8];
4893  int distx[16];
4894  int disty[16];
4895  int found = -1;
4896  double length = 0;
4897  int dx[16];
4898  int dy[16];
4899  int fx[16];
4900  int fy[16];
4901  for (unsigned v=0; v<16; v++)
4902  {
4903  int x1=*(a_x);
4904  int y1=*(a_y);
4905  AxisLoop(ourpoly, &x1, &y1, v);
4906  x1 -= m_x_add[v];
4907  y1 -= m_y_add[v];
4908  dx[v] = abs(*(a_x)-x1);
4909  dy[v] = abs(*(a_y)-y1);
4910  fx[v] = x1;
4911  fy[v] = y1;
4912  distx[v] = dx[v];
4913  disty[v] = dy[v];
4914  }
4915  for (int di = 0; di < 8; di++)
4916  {
4917  int ddx = distx[di] + distx[di + 8];
4918  int ddy = disty[di] + disty[di + 8];
4919  dist[di] = sqrt(pow(ddx, 2) + pow(ddy, 2));
4920  if (dist[di] > length)
4921  {
4922  found = di;
4923  length = dist[di];
4924  }
4925  }
4926  // Correct for the length of the step
4927  if (found == 2 || found == 6 || found == 10 || found == 14) length /= sqrt(2);
4928  if (found == 1 || found == 3 || found == 5 || found == 7 || found == 9 || found == 11 || found ==13 || found == 15) length /= sqrt(5);
4929 
4930  if (found == -1) return 0;
4931  // Now need to find the middle of the axis.
4932  int l = length*0.5;
4933  if (fx[found] > fx[found + 8]) *(a_x) = fx[found + 8] + m_x_add[found] * l; else *(a_x) = fx[found + 8] - m_x_add[found + 8] * l;
4934  if (fy[found] > fy[found + 8]) *(a_y) = fy[found + 8] + m_y_add[found] * l; else *(a_y) = fy[found + 8] - m_y_add[found + 8] * l;
4935 
4936  return found;
4937 }

◆ ForceArea()

void Landscape::ForceArea ( void  )
protected

Check of polygon areas. Each polygon should be present in the map with the correct area recorded, otherwise this method raises an error.

4130  {
4131  int l_area_sum = 0;
4132 
4133  for ( unsigned int i = 0; i < m_elems.size(); i++ ) {
4134  m_elems[ i ]->SetArea( ( double )m_elems[ i ]->m_squares_in_map );
4135  if ( m_elems[ i ]->m_squares_in_map > 0 ) {
4136  m_elems[ i ]->SetMapValid( true );
4137  l_area_sum += m_elems[ i ]->m_squares_in_map;
4138  }
4139  }
4140 
4141  if ( l_area_sum != m_width * m_height ) {
4142  g_msg->Warn( WARN_BUG, "Landscape::ForceArea(): Polygon areas doesn't"" sum up to map area!", "" );
4143  exit( 1 );
4144  }
4145 }

References g_msg, MapErrorMsg::Warn(), and WARN_BUG.

◆ GenerateCellLocDict()

void Landscape::GenerateCellLocDict ( )

The function to create the dictionary of cell locations for every polygon.

2524  {
2525  APoint temp_loc;
2526  //loop through all the locations to initialise the locations for every polygon
2527  for (int x=0; x<m_width; x++){
2528  for (int y=0; y<m_height; y++){
2529  temp_loc.m_x = x;
2530  temp_loc.m_y = y;
2531  int temp_poly_id = SupplyPolyRef(x,y);
2532  m_poly_cell_locs_pollen[temp_poly_id].push_back(temp_loc);
2533  m_poly_cell_locs_nectar[temp_poly_id].push_back(temp_loc);
2534  m_poly_cell_locs[temp_poly_id].push_back(temp_loc);
2535  m_polyid_map(y,x) = temp_poly_id;
2536  }
2537  }
2538 }

References APoint::m_x, and APoint::m_y.

◆ GeneratePolyIDMapWithinDist()

void Landscape::GeneratePolyIDMapWithinDist ( )

The function to find all the polygons within the a certain distance to each location.

2467  {
2468  /* int temp_x, temp_y;
2469  int temp_polyid;
2470  for (int y = -cfg_distance_to_select_nearby_polygons.value(); y<m_height+cfg_distance_to_select_nearby_polygons.value(); y++){
2471  cout<<"y: "<<y<<endl;
2472  for (int x = -cfg_distance_to_select_nearby_polygons.value(); x<m_width+cfg_distance_to_select_nearby_polygons.value(); x++){
2473  temp_x = x;
2474  temp_y = y;
2475  if(temp_x<0 || temp_x>=m_width)
2476  temp_x=CorrectWidth(temp_x);
2477  if(temp_y<0 || temp_y>=m_height)
2478  temp_y=CorrectHeight(temp_y);
2479  temp_polyid = SupplyPolyRef(temp_y, temp_x);
2480  int x_index_start = x-cfg_distance_to_select_nearby_polygons.value()>0?x-cfg_distance_to_select_nearby_polygons.value():0;
2481  int x_index_end = x+cfg_distance_to_select_nearby_polygons.value()<m_width?x+cfg_distance_to_select_nearby_polygons.value():m_width-1;
2482  int y_index_start = y-cfg_distance_to_select_nearby_polygons.value()>0?y-cfg_distance_to_select_nearby_polygons.value():0;
2483  int y_index_end = y+cfg_distance_to_select_nearby_polygons.value()<m_height?y+cfg_distance_to_select_nearby_polygons.value():m_height-1;
2484  // for (int x_index =x_index_start; x_index<=x_index_end; x_index++){
2485  // for (int y_index = y_index_start; y_index<=y_index_end; y_index++){
2486  // if (x_index>=0 && x_index<m_width && y_index>=0 && y_index<m_height){
2487  // m_map_polyid_within_dist[y_index][x_index].push_back(temp_polyid);
2488  // }
2489  // }
2490  // }
2491  }
2492  } */
2493  for (int y = 0; y<m_height; y++){
2494  cout<<"y: "<<y<<endl;
2495  for (int x = 0; x<m_width; x++){
2496  //cout<<"x: "<<x<<" y: "<<y<<endl;
2497  vector<vector<int>> temp_masks = CalculateMaskCorners(x,y, cfg_distance_to_select_nearby_polygons.value());
2498  for (int i=0; i<temp_masks.size(); i++){
2499  Eigen::ArrayXXi temp_v = m_polyid_map(Eigen::seq(temp_masks[i][1], temp_masks[i][3]), Eigen::seq(temp_masks[i][0], temp_masks[i][2]));
2500  //cout<<temp_v<<endl;
2501  std::set<int> q{temp_v.data(), temp_v.data() + temp_v.size()};
2502  //Eigen::Map<Eigen::RowVectorXi> temp_v(m_polyid_map(Eigen::seq(temp_masks[i][1], temp_masks[i][3]), Eigen::seq(temp_masks[i][0], temp_masks[i][2])).data(), (temp_masks[i][3]-temp_masks[i][1]+1) * (temp_masks[i][2]-temp_masks[i][0]+1));
2503  //Eigen::SparseMatrix<int> A((temp_masks[i][3]-temp_masks[i][1]+1),(temp_masks[i][2]-temp_masks[i][0]+1));
2504  //A.setFromTriplets(temp_v.begin(), temp_v.end());
2505  //std::set<int> temp_set(temp_v.begin(), temp_v.end());
2506  //for (auto& it : temp_set) {
2507  // m_map_polyid_within_dist[y][x].push_back(it);
2508  //}
2509 
2510  // for (int x_index=temp_masks[i][0]; x_index<=temp_masks[i][2]; x_index++){
2511  // for (int y_index=temp_masks[i][1]; y_index<=temp_masks[i][3]; y_index++){
2512  // int temp_poly_id = SupplyPolyRef(x_index, y_index);
2513  // auto it = std::find(m_map_polyid_within_dist[y][x].begin(), m_map_polyid_within_dist[y][x].end(), temp_poly_id);
2514  // if (it == m_map_polyid_within_dist[y][x].end()){
2515  // m_map_polyid_within_dist[y][x].push_back(temp_poly_id);
2516  // }
2517  // }
2518  // }
2519  }
2520  }
2521  }
2522 }

References cfg_distance_to_select_nearby_polygons, and CfgFloat::value().

◆ 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
1142  {
1143  return m_elems[m_polymapping[a_polygon]]->GetGooseGrazingForage(a_goose);
1144  }

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
1131  {
1132  return m_elems[m_land->Get(a_x, a_y)]->GetGooseGrazingForage(a_goose);
1133  }

References RasterMap::Get(), m_elems, and m_land.

◆ GetGooseFields()

GooseFieldList * Landscape::GetGooseFields ( double  a_minopenness)

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.

1647 {
1654  GooseFieldList* alist = new GooseFieldList;
1658  GooseFieldListItem gfli;
1659  for (unsigned int i = 0; i < m_elems.size(); i++)
1660  {
1661  if (m_elems[i]->GetOpenness() > a_minopenness)
1662  {
1663  for (int g = gs_Pinkfoot; g < gs_foobar; g++)
1664  {
1665  gfli.grass[g] = m_elems[i]->GetGooseGrazingForage((GooseSpecies)g);
1666  gfli.geesesp[g] = m_elems[i]->GetGooseSpNosToday((GooseSpecies)g);
1667  gfli.geesespTimed[g] = m_elems[i]->GetGooseSpNosTodayTimed((GooseSpecies)g);
1668  gfli.roostdists[g] = m_elems[i]->GetGooseRoostDist((GooseSpecies)g);
1669  }
1670  gfli.grain = m_elems[i]->GetBirdSeed();
1671  gfli.maize = m_elems[ i ]->GetBirdMaize();
1672  gfli.openness = m_elems[ i ]->GetOpenness();
1673  int pref = m_elems[ i ]->GetPoly();
1674  gfli.polyref = pref;
1675  gfli.geese = m_elems[i]->GetGooseNosToday();
1676  gfli.geeseTimed = m_elems[i]->GetGooseNosTodayTimed();
1677  gfli.vegtype = m_elems[i]->GetVegType();
1678  gfli.vegtypechr = VegtypeToString(m_elems[i]->GetVegType());
1679  gfli.vegheight = m_elems[i]->GetVegHeight();
1680  gfli.digestability = m_elems[i]->GetDigestibility();
1681  gfli.vegphase = m_elems[i]->GetVegPhase();
1682  gfli.previouscrop = VegtypeToString( m_elems[ i ]->GetPreviousTov( m_elems[ i ]->GetRotIndex() ) );
1683  gfli.lastsownveg = VegtypeToString( m_elems[ i ]->GetLastSownVeg() );
1684  alist->push_back(gfli);
1685  }
1686  }
1687  return alist;
1688 }

References GooseFieldListItem::digestability, GooseFieldListItem::geese, GooseFieldListItem::geesesp, GooseFieldListItem::geesespTimed, GooseFieldListItem::geeseTimed, GooseFieldListItem::grain, GooseFieldListItem::grass, GooseFieldListItem::lastsownveg, GooseFieldListItem::maize, GooseFieldListItem::openness, GooseFieldListItem::polyref, GooseFieldListItem::previouscrop, GooseFieldListItem::roostdists, GooseFieldListItem::vegheight, GooseFieldListItem::vegphase, GooseFieldListItem::vegtype, and GooseFieldListItem::vegtypechr.

◆ GetGooseNumbers() [1/2]

int Landscape::GetGooseNumbers ( int  a_poly)

This returns the number of geese on the polygon the day before.

5452  {
5453  return m_elems[m_polymapping[a_polyref]]->GetGooseNos();
5454  }

References m_polymapping.

◆ GetGooseNumbers() [2/2]

int Landscape::GetGooseNumbers ( int  a_x,
int  a_y 
)

This returns the number of geese on the polygon specifed by a_x, a_y the day before.

This returns the number of geese on the polygon the day before.

5467  {
5468  return m_elems[m_land->Get(a_x, a_y)]->GetGooseNos();
5469  }

◆ GetHareFoodQuality()

double Landscape::GetHareFoodQuality ( int  a_polygon)

Returns the hare food quality of polygons LKM.

5473 {
5474  double digest;
5475  TTypesOfLandscapeElement habitat = SupplyElementType(a_polygon);
5476  switch (habitat) {
5477  // Impossible stuff
5478  case tole_Building:
5479  case tole_Pond:
5480  case tole_Freshwater:
5481  case tole_River:
5482  case tole_Saltwater:
5483  case tole_Coast:
5484  case tole_BareRock:
5485  case tole_ConiferousForest:
5486  case tole_DeciduousForest:
5487  case tole_MixedForest:
5488  case tole_SmallRoad:
5489  case tole_LargeRoad:
5490  case tole_ActivePit:
5491  case tole_UrbanNoVeg:
5492  case tole_UrbanPark:
5493  case tole_SandDune:
5494  case tole_Copse:
5495  case tole_Stream:
5496  case tole_MetalledPath:
5497  case tole_Carpark:
5498  case tole_FishFarm:
5499  case tole_Fence:
5500  case tole_IndividualTree:
5501  case tole_WoodyEnergyCrop:
5502  case tole_PlantNursery:
5503  case tole_Pylon:
5504  case tole_WindTurbine:
5505  // EnergyBalance(activity_Foraging, 100); // This is a bug - it penalises for foraging in impossible areas - not intended but not found until after parameter fitting! Removed 28/07/2014
5506  return 0.0;
5507 
5508  // Questionable stuff
5509  case tole_RiversidePlants:
5510  case tole_RiversideTrees:
5511  case tole_Garden:
5512  case tole_Track:
5513  case tole_StoneWall:
5514  case tole_Hedges:
5515  case tole_Marsh:
5516  case tole_PitDisused:
5517  case tole_RoadsideVerge:
5518  case tole_Railway:
5519  case tole_Scrub:
5520  case tole_AmenityGrass:
5521  case tole_Parkland:
5523  case tole_Churchyard:
5524  case tole_HeritageSite:
5525  return 0.25; // was 0.25 being half of access to low digestability stuff
5526  // case tole_MownGrass:
5527  // digest = 0.8; // Added 28/07/2014 this is a way to compensate for the lack of choice when foraging, i.e. the whole area is assumed to be foraged equally.
5528  case tole_WoodlandMargin:
5529  case tole_Vildtager:
5530  case tole_Wasteland:
5531  default:
5532  digest = SupplyVegDigestibility(a_polygon);
5533 /* if (digest < 0) {
5534  LE* le = SupplyLEPointer(a_polygon);
5535  int rubbish = 0;
5536  }*/
5537  }
5538 #ifdef __Perfectfood
5539  return 0.8;
5540 #else
5541 #ifdef __YEARLYVARIABLEFOODQUALITY
5542  digest *= m_OurPopulationManager->m_GoodYearBadYear;
5543 #endif
5544  double veg_height;
5545  double access = 1.0;
5546  // double grazedreduction[4] = { 1.0, 0.75, 0.5, 0.25 };
5547  double grazedreduction[5] = { 1.0, 0.8, 0.5, 0.2, 0.05 };
5548  veg_height = SupplyVegHeight(a_polygon);
5549  double weeds = SupplyWeedBiomass(a_polygon);
5550  if ((veg_height <= 0) && (weeds < 0.1)) return 0.25; // Always something to eat, but not much.
5551 #ifdef __Hare1950s
5552  bool veg_patchy = true;
5553 #else // If it is not the special case of the 1950s
5554  //
5555  bool veg_patchy = SupplyVegPatchy(a_polygon);
5556 #endif
5557  if (veg_patchy)
5558  {
5559  // Patchy vegetation - normally full access
5560  if (veg_height>50)
5561  {
5562  // no food at only at very very tall
5563  access -= ((veg_height - 50)* g_VegHeightForageReduction);
5564  if (access<0) access = 0;
5565  }
5566  }
5567  else
5568  {
5569  if (veg_height>g_FarmIntensivenessH)
5570  {
5571  access -= ((veg_height - g_FarmIntensivenessH) * g_VegHeightForageReduction);
5572  if (access<0) access = 0;
5573  }
5574  }
5575  return access * digest * grazedreduction[SupplyGrazingPressure(a_polygon)];
5576 #endif
5577 }

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.

Referenced by THare::ForageSquare(), THare::ForageSquareP(), and Hare_Juvenile::st_Dispersal().

◆ GetOwner_tole()

TTypesOfLandscapeElement Landscape::GetOwner_tole ( int  a_x,
int  a_y 
)
inline

Returns the landscape type of the polygon owner (used in cases relating to e.g. unsprayed field margins) using coordinates a_x, a_y. Returns the value as a TTypesOfLandscapeElement.

1743 {
1744  return m_elems[m_land->Get(a_x, a_y)]->GetOwner_tole();
1745 }

References RasterMap::Get(), m_elems, and m_land.

Referenced by beetle_tole_movemap_init(), Beetle_Population_Manager::IsStartHabitat(), Beetle_Population_Manager::Probe(), TAnimal::SupplyPolygonType(), and Beetle_Adult::TryToReproduce().

◆ 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.

5459  {
5460  return m_elems[m_polymapping[a_polyref]]->GetQuarryNos();
5461  }

References m_polymapping.

◆ 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]outpfileName of the output file
[in]UTMXUtm x-coordinate of the lower lefthand corner of the map
[in]UTMYUtm y-coordinate of the lower lefthand corner of the map
5579  {
5587  ofstream OFILE;
5588  OFILE.open(outpfile.c_str());
5589  if (!OFILE) {
5590  g_msg->Warn(WARN_FILE, "Landscape::GISASCII_Output() "
5591  "Unable to open file for writing:",
5592  outpfile);
5593  exit(1);
5594  }
5595  OFILE << "ncols " << m_width << endl;
5596  OFILE << "nrows " << m_height << endl;
5597  OFILE << "xllcorner " << UTMX << endl;
5598  OFILE << "yllcorner " << UTMY << endl;
5599  OFILE << "cellsize " << 1 << endl;
5600  OFILE << "NODATA_value " << -9999 << endl;
5601  // The polyref loop
5602  if (l_map_ascii_map_entity.value() == 1) {
5603  for (int y = 0; y < m_height; y++) {
5604  for (int x = 0; x < m_width; x++) {
5605  OFILE << '\t' << SupplyPolyRef(x, y);
5606  }
5607  OFILE << endl;
5608  }
5609  }
5610  // The element type loop
5611  if (l_map_ascii_map_entity.value() == 2) {
5612  for (int y = 0; y < m_height; y++) {
5613  for (int x = 0; x < m_width; x++) {
5614  OFILE << '\t' << int(SupplyElementType(x, y));
5615  }
5616  OFILE << endl;
5617  }
5618  OFILE.close();
5619  }
5620 }

References g_msg, l_map_ascii_map_entity, CfgInt::value(), MapErrorMsg::Warn(), and WARN_FILE.

◆ GrainDump()

void Landscape::GrainDump ( )
private

Records total amount of grain / seed / maize available as forage for each polygon.

Records total amount of grain/seed/maize available as forage for each polygon with forage available. Information is dumped to GrainDump.txt

3181  {
3185  FILE * vfile=fopen("GrainDump.txt", "a" );
3186  if (!vfile) {
3187  g_msg->Warn( WARN_FILE, "Landscape::GrainDump(): Unable to open file", "GrainDump.txt" );
3188  exit( 1 );
3189  }
3190  int day = g_date->Date();
3191  int year = g_date->GetYear();
3192  int yearday = SupplyDayInYear();
3193  std::string monthname = SupplyMonthName();
3194  int day_month = SupplyDayInMonth();
3195  for (unsigned int i = 0; i < m_elems.size(); i++) {
3196  double grain = (m_elems[ i ]-> GetBirdSeed())*(m_elems[ i ]-> GetArea());
3197  double maize = m_elems[ i ]-> GetBirdMaize()*(m_elems[ i ]-> GetArea());
3198  long poly = m_elems[i] -> GetVegType();
3199  if ((grain>0)||(maize>0)){
3200  fprintf( vfile, "%4d\t%4d\t%4d\t%10s\t%3d\t%5d\t%5d\t%7.3f\t%7.3f\n",day, year, yearday, monthname.c_str(), day_month, i, poly, grain,maize );
3201  }
3202 
3203 
3204  }
3205 
3206  fclose( vfile );
3207 }

References Calendar::Date(), g_date, g_msg, Calendar::GetYear(), MapErrorMsg::Warn(), and WARN_FILE.

◆ GrazeVegetation()

void Landscape::GrazeVegetation ( int  a_poly,
double  a_forage 
)
inline

Removes grazing forage from a poly per m2.

1204  {
1205  m_elems[m_polymapping[a_poly]]->GrazeVegetation(a_forage, true);
1206  }

References m_elems, and m_polymapping.

◆ GrazeVegetationTotal()

void Landscape::GrazeVegetationTotal ( int  a_poly,
double  a_forage 
)
inline

Removes grazing forage from a poly and divides this out per m2.

1210  {
1211  m_elems[m_polymapping[a_poly]]->GrazeVegetationTotal(a_forage);
1212  }

References m_elems, and m_polymapping.

◆ hb_Add()

void Landscape::hb_Add ( void  )
protected

The entry point for adding hedgebanks. Hedgebanks are created by replacing part of hedge polygons with the tole_HedgeBank If the hedge is wide this will be with a border on each side, if narrow then by inserting hedgebank between trees.

57 {
58  // Make a local copy of the actual map parameters for speed
59  // purposes. We are going to use these *a lot*.
60  hb_map = m_land->GetMagicP( 0, 0 );
64 
65  //#ifdef HB_TESTING
66  //m_elems[m_polymapping
67  //[hb_map[750 + 600*hb_width]]]->SetElementType( tole_Hedges );
68  //#endif
69 
70  // Generate a list of polygon numbers + HB_MAGIC for all hedge elements
71  // in our current map.
72  hb_FindHedges();
73 
74  // As one lemming at the cliff edge said to the other: "Let's Go!"
75 
76  // For every hedge polygon:
77  cout << "Hedges: " << int(hb_hedges.size()) << endl;
78  fflush(stdout);
79 
80  double l_inc = 50.0/((double)hb_hedges.size());
81  double l_count = 0.001;
82 
83  for ( unsigned int i=0; i<hb_hedges.size(); i++ ) {
84  l_count += l_inc;
85  if ( l_count > 1.0 ) {
86  l_count = 0.001;
87  cout <<".";
88  fflush(stdout);
89  }
90  // Find the enclosing bounding box for our current polygon.
91  if ( ! hb_FindBoundingBox( hb_hedges[i] )) {
92  // Might want to raise a runtime error upon ending here.
93  // The test for hb_FindBoundingBox() fails if we have a polygon
94  // without any pixels in the main map!
95  continue;
96  }
97 
98  // Move all polygon numbers in our bounding box up! by HB_MAGIC
99  // to make room for our 'paint' values in the space below.
101 
103 
104  hb_PaintBorder( 0 );
105 
106  int l_color = 0;
107  while ( hb_PaintWhoHasNeighbourColor( l_color,
108  l_color + 1 )) {
109  l_color++;
110  }
111 
112  double l_percent = (double)hb_core_pixels/
113  ((double)hb_core_pixels+(double)hb_border_pixels);
114 
115  if ( l_percent > l_map_art_hb_core_thres.value()) {
116  // We ought to have at least *some* visible core area
117  // within the polygon, so do a simple scan.
118 
119  // l_color now happens to contain the maximum contour/color value
120  // within our current polygon.
121  int l_min = (int)((double)l_color * l_map_art_hb_width.value());
122  while ( l_color > l_min ) {
123  hb_MarkTopFromLocalMax( l_color );
125  l_color--;
126  }
127  } else {
128  // Very thin hedge (1->2 meters),
129  // use special border case scan when adding hedge banks.
131  }
132 
134 
135  // All the previous steps were just preparations.
136  // Now do the serious stuff.
138 
139 #ifdef HB_TESTING
140  // Sanity check.
141  for ( int j=0; j<hb_size; j++ ) {
142  if ( m_polymapping[ hb_map[ j ] - HB_MAGIC ] == -1 ) {
143  cout << "Oh dear!" << endl;
144  exit(1);
145  }
146  }
147 
148  char ffname[24];
149  sprintf( ffname, "test%02d.ppm", i);
150 #endif
151 
152  // Restore order to the map before continuing.
154 
155 #ifdef HB_TESTING
156  hb_dump_map( 0, hb_width, 0, hb_height, ffname, false );
157 #endif
158  }
159 
160  cout << endl;;
161 #ifdef HB_TESTING
162  // Quick reminder.
163  for ( unsigned int i=0; i<m_elems.size(); i++ ) {
164  if ( m_elems[i]->GetArea() < 0.9 &&
165  m_elems[i]->GetElementType() != tole_FieldBoundary ) {
166  // Note: Field boundaries have not been scanned yet at this point,
167  // so they will have a zero area right here and now.
168  cout << "Warning: Polygon " << m_elems[i]->GetPoly() << "of type " << PolytypeToString( m_elems[i]->GetElementType() << "came up with area" << m_elems[i]->GetArea() << endl;
169  }
170  }
171  exit(0);
172 #endif
173 }

References RasterMap::GetMagicP(), hb_AddNewHedgebanks(), hb_border_pixels, hb_ClearPolygon(), hb_core_pixels, hb_DownPolyNumbers(), hb_FindBoundingBox(), hb_FindHedges(), hb_hedges, hb_height, HB_MAGIC, hb_map, hb_MarkTheBresenhamWay(), hb_MarkTopFromLocalMax(), hb_PaintBorder(), hb_PaintWhoHasNeighbourColor(), hb_ResetColorBits(), hb_RestoreHedgeCore(), hb_size, hb_UpPolyNumbers(), hb_width, l_map_art_hb_core_thres, l_map_art_hb_width, m_elems, m_land, m_polymapping, RasterMap::MapHeight(), RasterMap::MapWidth(), PolytypeToString(), tole_FieldBoundary, and CfgFloat::value().

◆ hb_AddNewHedgebanks()

void Landscape::hb_AddNewHedgebanks ( int  a_orig_poly_num)
protected

Adds new hedgebanks.

196 {
198 
199  for ( int l_y=hb_min_y; l_y<=hb_max_y; l_y++ ) {
200  for ( int l_x=hb_min_x; l_x<=hb_max_x; l_x++ ) {
201  int i = l_y*hb_width + l_x;
202  int l_val = hb_map[ i ];
203  if ( l_val >= 0 && l_val < HB_MAGIC ) {
204  hb_map[ i ] = hb_StripingDist() + HB_MAGIC;
205  /*
206  m_elems[m_polymapping[hb_map[ i ]-HB_MAGIC]]->AddArea( 1.0 );
207  m_elems[m_polymapping[hb_map[ i ]-HB_MAGIC]]->m_squares_in_map++;
208  m_elems[m_polymapping[a_orig_poly_num]]->AddArea( -1.0 );
209  if ( m_elems[m_polymapping[a_orig_poly_num]]->GetArea() < 0.0 ) {
210  printf("%d %d !!!\n", l_x, l_y );
211  exit(1);
212  }
213  */
214  //m_elems[m_polymapping[a_orig_poly_num]]->m_squares_in_map--;
215  }
216  }
217  }
218 }

References hb_GenerateHBPolys(), HB_MAGIC, hb_map, hb_max_x, hb_max_y, hb_min_x, hb_min_y, hb_StripingDist(), and hb_width.

Referenced by hb_Add().

◆ hb_ClearPolygon()

void Landscape::hb_ClearPolygon ( int  a_poly_num)
protected

Replaces all values in the map for a polygon with a temporary value ready for manipulation.

411 {
412  // 'Paint' every pixel which belongs to the current polygon with the
413  // value HB_MAGIC_COLOR.
414  for ( int l_y=hb_min_y; l_y<=hb_max_y; l_y++ ) {
415  for ( int l_x=hb_min_x; l_x<=hb_max_x; l_x++ ) {
416  int l_coord = l_y*hb_width + l_x;
417  if ( hb_map[ l_coord ] == a_poly_num ) {
418  hb_map[ l_coord ] = HB_MAGIC_COLOR;
419  }
420  }
421  }
422 }

References HB_MAGIC_COLOR, hb_map, hb_max_x, hb_max_y, hb_min_x, hb_min_y, and hb_width.

Referenced by hb_Add().

◆ hb_DownPolyNumbers()

void Landscape::hb_DownPolyNumbers ( void  )
protected

Reverses the process carried out by Landscape::hb_UpPolyNumbers.

713 {
714  for ( int i=0; i<hb_size; i++ ) {
715  if ( hb_map[ i ] >= HB_MAGIC ) {
716  hb_map[ i ] -= HB_MAGIC;
717  }
718  }
719 }

References HB_MAGIC, hb_map, and hb_size.

Referenced by hb_Add().

◆ hb_FindBoundingBox()

bool Landscape::hb_FindBoundingBox ( int  a_poly_num)
protected

Finds a rectangle that encloses the hedge to be manipulated.

241 {
242  hb_min_x = hb_width + 1;
243  hb_max_x = -1;
244 
245  hb_min_y = hb_height + 1;
246  hb_max_y = -1;
247 
248  bool l_found = false;
249 
250  // Search for every pixel which belongs to the current polygon, and
251  // min and max values for x and y. Values are inclusive.
252  for ( int l_y=0; l_y<hb_height; l_y++ ) {
253  for ( int l_x=0; l_x<hb_width; l_x++ ) {
254  if ( hb_map[ l_y*hb_width + l_x ] == a_poly_num ) {
255  l_found = true;
256  if ( l_x < hb_min_x)
257  hb_min_x = l_x;
258  else if ( l_x > hb_max_x)
259  hb_max_x = l_x;
260  if ( l_y < hb_min_y)
261  hb_min_y = l_y;
262  else if ( l_y > hb_max_y)
263  hb_max_y = l_y;
264  }
265  }
266  }
267 
268  return l_found;
269 }

References hb_height, hb_map, hb_max_x, hb_max_y, hb_min_x, hb_min_y, and hb_width.

Referenced by hb_Add().

◆ hb_FindHedges()

void Landscape::hb_FindHedges ( void  )
protected

Generate a list of polygon numbers for new hedgebank addition.

274 {
275  for ( unsigned int i=0; i<m_elems.size(); i++ ) {
276  if ( tole_Hedges == m_elems[i]->GetElementType() ) {
277  hb_hedges.resize( hb_hedges.size() + 1 );
278  hb_hedges[ hb_hedges.size() - 1 ] =
279  m_elems[i]->GetPoly();
280  }
281  }
282 }

References hb_hedges, m_elems, and tole_Hedges.

Referenced by hb_Add().

◆ hb_GenerateHBPolys()

void Landscape::hb_GenerateHBPolys ( void  )
protected

Creates the necessary new hedgebank polygons in Landscape::m_elems.

178 {
179  hb_new_hbs.resize( l_map_art_hb_nums.value() );
180 
181  for ( int i =0; i<l_map_art_hb_nums.value(); i++ ) {
183  hb_new_hbs[ i ]->SetArea( 0.0 );
184  hb_new_hbs[ i ]->SetSubType( i );
185  m_elems.resize( m_elems.size() + 1 );
186  m_elems[ m_elems.size() - 1 ] = hb_new_hbs[ i ];
188  (int) m_elems.size() - 1;
189  hb_new_hbs[ i ]->SetPoly( hb_first_free_poly_num++ );
190  }
191 }

References hb_first_free_poly_num, hb_new_hbs, l_map_art_hb_nums, m_elems, m_polymapping, NewElement(), tole_HedgeBank, and CfgInt::value().

Referenced by hb_AddNewHedgebanks().

◆ hb_HasNeighbourColor()

bool Landscape::hb_HasNeighbourColor ( int  a_x,
int  a_y,
int  a_neighbour_color 
)
inlineprotected

Tests for an already process neighbour cell.

451 {
452  bool l_neighbour_has_color = false;
453  bool loop=false;
454 
455  do {
456  a_x -= 1;
457  a_y -= 1;
458  if ( a_x >= 0 && a_y >= 0 &&
459  hb_map[ a_x + a_y*hb_width ] == a_neighbour_color ) {
460  l_neighbour_has_color = true;
461  break;
462  }
463 
464  a_x++;
465  if ( hb_map[ a_x + a_y*hb_width ] == a_neighbour_color ) {
466  l_neighbour_has_color = true;
467  break;
468  }
469 
470  a_x++;
471  if ( a_x < hb_width &&
472  hb_map[ a_x + a_y*hb_width ] == a_neighbour_color ) {
473  l_neighbour_has_color = true;
474  break;
475  }
476 
477  a_x -= 2;
478  a_y += 1;
479  if ( a_x >= 0 &&
480  hb_map[ a_x + a_y*hb_width ] == a_neighbour_color ) {
481  l_neighbour_has_color = true;
482  break;
483  }
484 
485  a_x += 2;
486  if ( a_x < hb_width &&
487  hb_map[ a_x + a_y*hb_width ] == a_neighbour_color ) {
488  l_neighbour_has_color = true;
489  break;
490  }
491 
492  a_x -= 2;
493  a_y += 1;
494 
495  if ( a_y >= hb_height )
496  break;
497 
498  if ( a_x >= 0 &&
499  hb_map[ a_x + a_y*hb_width ] == a_neighbour_color ) {
500  l_neighbour_has_color = true;
501  break;
502  }
503 
504  a_x++;
505  if ( hb_map[ a_x + a_y*hb_width ] == a_neighbour_color ) {
506  l_neighbour_has_color = true;
507  break;
508  }
509 
510  a_x++;
511  if ( a_x < hb_width &&
512  hb_map[ a_x + a_y*hb_width ] == a_neighbour_color ) {
513  l_neighbour_has_color = true;
514  break;
515  }
516  } while ( loop ); // was while (false) CJT 16-05-06
517 
518  return l_neighbour_has_color;
519 }

References hb_height, hb_map, and hb_width.

Referenced by hb_PaintWhoHasNeighbourColor().

◆ hb_HasOtherNeighbour()

bool Landscape::hb_HasOtherNeighbour ( int  a_x,
int  a_y 
)
inlineprotected

Checks if a pixel has any non hedge neighbour cell.

337 {
338  bool l_has_neighbour = false;
339  bool loop=false;
340 
341  // Who said C++ needs the goto statement? ;-)
342  do {
343  a_x -= 1;
344  a_y -= 1;
345 
346  if ( hb_MapBorder( a_x, a_y ) ||
347  hb_map[ a_x + a_y*hb_width ] >= HB_MAGIC ) {
348  l_has_neighbour = true;
349  break;
350  }
351 
352  a_x++;
353  if ( hb_MapBorder( a_x, a_y ) ||
354  hb_map[ a_x + a_y*hb_width ] >= HB_MAGIC ) {
355  l_has_neighbour = true;
356  break;
357  }
358 
359  a_x++;
360  if ( hb_MapBorder( a_x, a_y ) ||
361  hb_map[ a_x + a_y*hb_width ] >= HB_MAGIC ) {
362  l_has_neighbour = true;
363  break;
364  }
365 
366  a_x -= 2;
367  a_y += 1;
368  if ( hb_MapBorder( a_x, a_y ) ||
369  hb_map[ a_x + a_y*hb_width ] >= HB_MAGIC ) {
370  l_has_neighbour = true;
371  break;
372  }
373 
374  a_x += 2;
375  if ( hb_MapBorder( a_x, a_y ) ||
376  hb_map[ a_x + a_y*hb_width ] >= HB_MAGIC ) {
377  l_has_neighbour = true;
378  break;
379  }
380 
381  a_x -= 2;
382  a_y += 1;
383 
384  if ( hb_MapBorder( a_x, a_y ) ||
385  hb_map[ a_x + a_y*hb_width ] >= HB_MAGIC ) {
386  l_has_neighbour = true;
387  break;
388  }
389 
390  a_x++;
391  if ( hb_MapBorder( a_x, a_y ) ||
392  hb_map[ a_x + a_y*hb_width ] >= HB_MAGIC ) {
393  l_has_neighbour = true;
394  break;
395  }
396 
397  a_x++;
398  if ( hb_MapBorder( a_x, a_y ) ||
399  hb_map[ a_x + a_y*hb_width ] >= HB_MAGIC ) {
400  l_has_neighbour = true;
401  break;
402  }
403  } while ( loop ); // was while (false) CJT 16-05-06
404 
405  return l_has_neighbour;
406 }

References HB_MAGIC, hb_map, hb_MapBorder(), and hb_width.

Referenced by hb_PaintBorder().

◆ hb_MapBorder()

bool Landscape::hb_MapBorder ( int  a_x,
int  a_y 
)
inlineprotected

Checks for out of bounds hedgebank coordinates.

323 {
324  if ( a_x < 0 ||
325  a_y < 0 ||
326  a_x >= hb_width ||
327  a_y >= hb_height ) {
328  return true;
329  }
330 
331  return false;
332 }

References hb_height, and hb_width.

Referenced by hb_HasOtherNeighbour().

◆ hb_MarkTheBresenhamWay()

void Landscape::hb_MarkTheBresenhamWay ( void  )
protected

‘Paints’ the core of a hedge with a negative number for use in deciding what becomes hedgebank later

627 {
628  double l_hb = l_map_art_hb_width.value()*10000.0;
629  double l_up = 10000.0 - l_hb;
630  bool l_is_hb = true;
631  double l_length = (double)(g_random_fnc( (int)l_hb )) * 0.0001 *
633  double l_hb_remain = 0.0;
634  double l_up_remain = 0.0;
635 
636  for ( int l_y=hb_min_y; l_y<=hb_max_y; l_y++) {
637  // Note: The missing update of l_x below is intentional.
638  for ( int l_x=hb_min_x; l_x<=hb_max_x; ) {
639  int l_coord = l_y*hb_width + l_x;
640  if ( hb_map[ l_coord ] < HB_MAGIC ) {
641  // 'Painting' with a negative value turns a pixel into
642  // hedgebank 'core', ie. hedge!
643 
644  // Paint segment length with appropriate type.
645  if ( l_length >= 1.0 ) {
646  if ( l_is_hb ) {
647  hb_map[ l_coord ] = 0;
648  } else {
649  hb_map[ l_coord ] = -1;
650  }
651  l_length -= 1.0;
652  l_x++;
653  } else {
654  // Change state.
655  if ( l_is_hb ) {
656  l_is_hb = false;
657  l_hb_remain = l_length;
658  l_length = (double)(g_random_fnc( (int)l_up )) * 0.0001 *
659  l_map_art_hb_seg_len.value() + l_up_remain;
660  } else {
661  l_is_hb = true;
662  l_up_remain = l_length;
663  l_length = (double)(g_random_fnc( (int)l_hb )) * 0.0001 *
664  l_map_art_hb_seg_len.value() + l_hb_remain;
665  }
666  }
667  } else {
668  // Pixel not part of the hedge, just update the coordinate.
669  l_x++;
670  }
671  }
672  }
673 }

References g_random_fnc(), HB_MAGIC, hb_map, hb_max_x, hb_max_y, hb_min_x, hb_min_y, hb_width, l_map_art_hb_seg_len, l_map_art_hb_width, and CfgFloat::value().

Referenced by hb_Add().

◆ hb_MarkTopFromLocalMax()

void Landscape::hb_MarkTopFromLocalMax ( int  a_color)
protected

Used to identify the distance a cell is from the centre of a hedge.

Sweeps through the map.If we find a pixel, which has a value equal to a_color and not a negative neighbour, then mark it as negative with an absolute value equal to the number of steps from here and out to the center/perimeter polygons border, calculated as the given percentage.
If one or more negative numbers are found among the neighbours, some that were not marked during this round, then assign a negative value equal to the minimum found plus one.

677 {
688  for ( int l_y=hb_min_y; l_y<=hb_max_y; l_y++ ) {
689  for ( int l_x=hb_min_x; l_x<=hb_max_x; l_x++ ) {
690  int l_coord = l_y*hb_width + l_x;
691  int l_max;
692  if ( hb_map[ l_coord ] == a_color ) {
693  l_max = hb_MaxUnpaintedNegNeighbour( l_x, l_y );
694  if ( l_max < 0 ) {
695  if ( ++l_max < 0 ) {
696  hb_map[ l_coord ] = l_max;
697  } else {
698  // l_max was precisely -1
699  hb_map[ l_coord ] = -1;
700  }
701  } else {
702  // We are a local maxima.
703  hb_map[ l_coord ] = -a_color;
704  }
705  hb_map[ l_coord ] ^= HB_MAGIC_PAINTER_BIT;
706  }
707  }
708  }
709 }

References HB_MAGIC_PAINTER_BIT, hb_map, hb_max_x, hb_max_y, hb_MaxUnpaintedNegNeighbour(), hb_min_x, hb_min_y, and hb_width.

Referenced by hb_Add().

◆ hb_MaxUnpaintedNegNeighbour()

int Landscape::hb_MaxUnpaintedNegNeighbour ( int  a_x,
int  a_y 
)
inlineprotected

Determines the width from centre to edge of hedge.

547 {
548  int l_max_neg = 0;
549  int l_val;
550  bool loop=false; // This is just to avoid the warning about constant expression if we use: do {...} while (false)
551 
552  do {
553  a_x -= 1;
554  a_y -= 1;
555  if ( a_x >= 0 && a_y >= 0 ) {
556  l_val = hb_map[ a_x + a_y*hb_width ];
557  if ( l_val < l_max_neg && (l_val & HB_MAGIC_PAINTER_BIT)) {
558  l_max_neg = l_val;
559  }
560  }
561 
562  a_x++;
563  l_val = hb_map[ a_x + a_y*hb_width ];
564  if ( l_val < l_max_neg && (l_val & HB_MAGIC_PAINTER_BIT)) {
565  l_max_neg = l_val;
566  }
567 
568  a_x++;
569  if ( a_x < hb_width ) {
570  l_val = hb_map[ a_x + a_y*hb_width ];
571  if ( l_val < l_max_neg && (l_val & HB_MAGIC_PAINTER_BIT)) {
572  l_max_neg = l_val;
573  }
574  }
575 
576  a_x -= 2;
577  a_y += 1;
578  if ( a_x >= 0 ) {
579  l_val = hb_map[ a_x + a_y*hb_width ];
580  if ( l_val < l_max_neg && (l_val & HB_MAGIC_PAINTER_BIT)) {
581  l_max_neg = l_val;
582  }
583  }
584 
585  a_x += 2;
586  if ( a_x < hb_width ) {
587  l_val = hb_map[ a_x + a_y*hb_width ];
588  if ( l_val < l_max_neg && (l_val & HB_MAGIC_PAINTER_BIT)) {
589  l_max_neg = l_val;
590  }
591  }
592 
593  a_x -= 2;
594  a_y += 1;
595 
596  if ( a_y >= hb_height )
597  break;
598 
599  if ( a_x >= 0 ) {
600  l_val = hb_map[ a_x + a_y*hb_width ];
601  if ( l_val < l_max_neg && (l_val & HB_MAGIC_PAINTER_BIT)) {
602  l_max_neg = l_val;
603  }
604  }
605 
606  a_x++;
607  l_val = hb_map[ a_x + a_y*hb_width ];
608  if ( l_val < l_max_neg && (l_val & HB_MAGIC_PAINTER_BIT)) {
609  l_max_neg = l_val;
610  }
611 
612  a_x++;
613  if ( a_x < hb_width ) {
614  l_val = hb_map[ a_x + a_y*hb_width ];
615  if ( l_val < l_max_neg && (l_val & HB_MAGIC_PAINTER_BIT)) {
616  l_max_neg = l_val;
617  }
618  }
619  } while ( loop );
620 
621  return l_max_neg;
622 }

References hb_height, HB_MAGIC_PAINTER_BIT, hb_map, and hb_width.

Referenced by hb_MarkTopFromLocalMax().

◆ hb_PaintBorder()

void Landscape::hb_PaintBorder ( int  a_color)
protected

Identifies all border hedge pixels.

427 {
428  hb_border_pixels = 0;
429  hb_core_pixels = 0;
430  // Paint every pixel which belongs to the current polygon, and which
431  // does have a neighbour *not* equal to HB_MAGIC_COLOR (our marker value).
432  for ( int l_y=hb_min_y; l_y<=hb_max_y; l_y++ ) {
433  for ( int l_x=hb_min_x; l_x<=hb_max_x; l_x++ ) {
434  int l_coord = l_y*hb_width + l_x;
435  if ( hb_map[ l_coord ] == HB_MAGIC_COLOR ) {
436  if ( hb_HasOtherNeighbour( l_x, l_y )) {
437  hb_map[ l_coord ] = a_color;
439  } else {
440  hb_core_pixels++;
441  }
442  }
443  }
444  }
445 }

References hb_border_pixels, hb_core_pixels, hb_HasOtherNeighbour(), HB_MAGIC_COLOR, hb_map, hb_max_x, hb_max_y, hb_min_x, hb_min_y, and hb_width.

Referenced by hb_Add().

◆ hb_PaintWhoHasNeighbourColor()

bool Landscape::hb_PaintWhoHasNeighbourColor ( int  a_neighbour_color,
int  a_new_color 
)
protected

Pushes a value to a pixel cell that denotes that is has a neighbour that is not hedge.

525 {
526  // Paint every pixel which belongs to the current polygon, and which
527  // has a neighbour with a color equal to a_neighbour_color.
528 
529  bool l_at_least_one = false;
530  for ( int l_y=hb_min_y; l_y<=hb_max_y; l_y++ ) {
531  for ( int l_x=hb_min_x; l_x<=hb_max_x; l_x++ ) {
532  if ( hb_map[l_y*hb_width + l_x] == HB_MAGIC_COLOR &&
533  hb_HasNeighbourColor( l_x, l_y, a_neighbour_color )) {
534  hb_map[l_y*hb_width + l_x] = a_new_color;
535  l_at_least_one = true;
536  }
537  }
538  }
539 
540  return l_at_least_one;
541 }

References hb_HasNeighbourColor(), HB_MAGIC_COLOR, hb_map, hb_max_x, hb_max_y, hb_min_x, hb_min_y, and hb_width.

Referenced by hb_Add().

◆ hb_ResetColorBits()

void Landscape::hb_ResetColorBits ( void  )
protected

Remove high number colour bits from the map.

296 {
297  for ( int l_y=hb_min_y; l_y<=hb_max_y; l_y++ ) {
298  for ( int l_x=hb_min_x; l_x<=hb_max_x; l_x++ ) {
299  int l_coord = l_y*hb_width + l_x;
300  if ( hb_map[l_coord] < 0 )
301  hb_map[l_coord] |= HB_MAGIC_PAINTER_BIT;
302  }
303  }
304 }

References HB_MAGIC_PAINTER_BIT, hb_map, hb_max_x, hb_max_y, hb_min_x, hb_min_y, and hb_width.

Referenced by hb_Add().

◆ hb_RestoreHedgeCore()

void Landscape::hb_RestoreHedgeCore ( int  a_orig_poly_number)
protected

LKM.

309 {
310  for ( int l_y=hb_min_y; l_y<=hb_max_y; l_y++ ) {
311  for ( int l_x=hb_min_x; l_x<=hb_max_x; l_x++ ) {
312  int l_coord = l_y*hb_width + l_x;
313  if ( hb_map[l_coord] < 0 ) {
314  hb_map[l_coord] = a_orig_poly_number;
315  }
316  }
317  }
318 }

References hb_map, hb_max_x, hb_max_y, hb_min_x, hb_min_y, and hb_width.

Referenced by hb_Add().

◆ hb_StripingDist()

int Landscape::hb_StripingDist ( void  )
protected

Striping distribution function for the new hedgebanks LKM.

223 {
224  // Striping distribution function for the new hedgebanks.
225  static LE* l_curr_ele = NULL;
226 
227  if ( !l_curr_ele ) {
228  l_curr_ele = hb_new_hbs[ g_random_fnc( l_map_art_hb_nums.value()) ];
229  return l_curr_ele->GetPoly();
230  }
231 
233  l_curr_ele = hb_new_hbs[ g_random_fnc( l_map_art_hb_nums.value()) ];
234 
235  return l_curr_ele->GetPoly();
236 }

References g_random_fnc(), LE::GetPoly(), hb_new_hbs, l_map_art_hb_nums, l_map_art_hb_tran_prob, and CfgInt::value().

Referenced by hb_AddNewHedgebanks().

◆ hb_UpPolyNumbers()

void Landscape::hb_UpPolyNumbers ( void  )
protected

Adds a big number to all polygon refs in the map to create space to safely manipulate the hedge pixels.

287 {
288  for ( int i=0; i<hb_size; i++ ) {
289  hb_map[ i ] += HB_MAGIC;
290  }
291 }

References HB_MAGIC, hb_map, and hb_size.

Referenced by hb_Add().

◆ HowManyPonds()

int Landscape::HowManyPonds ( ) const
inline

Returns the number of ponds in the landscape.

555 { return static_cast<int>(m_PondIndexList.size()); }

References m_PondIndexList.

◆ IncTreatCounter()

void Landscape::IncTreatCounter ( int  a_treat)

Records that a farm treatment of the type specified has occurred.

5646  {
5647  if (a_treat < 0 || a_treat >= last_treatment) {
5648  char errornum[20];
5649  sprintf(errornum, "%d", a_treat);
5650  g_msg->Warn(WARN_BUG, "Landscape::IncTreatCounter(): Index"" out of range!", errornum);
5651  exit(1);
5652  }
5653  m_treatment_counts[a_treat] ++;
5654 }

References g_msg, last_treatment, MapErrorMsg::Warn(), and WARN_BUG.

◆ IsFieldType()

bool Landscape::IsFieldType ( TTypesOfLandscapeElement  a_tole)
inline

Function for backwards code compatibility when TOV attributes would now be used.

998 { return ClassificationFieldType(a_tole); }

References ClassificationFieldType().

◆ IsHiddenYear()

bool Landscape::IsHiddenYear ( void  )
inline

The function to return whether it is in the hidden year.

546 {return m_firstyear;}

References m_firstyear.

◆ 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

556 {
561  int d1=-1;
562  int counter = 1;
563  bool found = false;
564  while (!found)
565  {
567  int x = (int) (a_cx + a_offsetx * counter);
568  int y = (int) (a_cy + a_offsety * counter);
569  if (x<1 || x >= (m_width-2) || y<1 || y >= (m_height-2)) return counter;
572  if ((tole == tole_LargeRoad) || (tole == tole_SmallRoad) || (tole == tole_HedgeBank)) return counter;
573  if (SupplyLEHigh(x,y))
574  {
575  x = (int) (a_cx + a_offsetx * (counter+1));
576  y = (int) (a_cy + a_offsety * (counter+1));
577  if (SupplyLEHigh(x,y)) found = true;
578  d1=counter;
579  }
580  counter++;
581  }
582  return d1;
583 }

References tole_HedgeBank, tole_LargeRoad, and tole_SmallRoad.

◆ MagicMapP2PolyRef()

int Landscape::MagicMapP2PolyRef ( int  a_magic)
inline

Converts the internal number generated from SupplyMagicMapP to the polygon number.

2192 {
2193  return m_elems[ a_magic ]->GetPoly();
2194 }

References m_elems.

◆ NewElement()

LE * Landscape::NewElement ( TTypesOfLandscapeElement  a_type)
protected

NewElement Creates a new LE instance and where possible it will create the highest level in the class hierarchy e.g. tole_Portarea has no behaviour so can be created as a NonVegElement (LE->NonVegElement), removing the need to have a Portarea class.

Here we reduce the amount of classes that need to be created by lumping those with no special, or the same behaviour into the base class, and then differentiating with an attribute specifying the tole type.

5760  {
5765  LE * elem;
5766  int subtype = 1;
5767  double l_rand;
5768 
5769  switch (a_type) {
5770  // NonVegetated Elements
5771  case tole_BareRock:
5772  case tole_AmenityGrass:
5773  case tole_Fence:
5774  case tole_Parkland:
5775  case tole_Saltwater:
5776  case tole_River:
5777  case tole_SandDune:
5778  case tole_Track:
5779  case tole_MetalledPath:
5780  case tole_Stream:
5781  case tole_HeritageSite:
5782  case tole_RiverBed:
5783  case tole_RefuseSite:
5784  case tole_Coast:
5785  case tole_Chameleon:
5786  case tole_Carpark:
5787  case tole_Churchyard:
5788  case tole_FishFarm:
5789  case tole_Canal:
5790  case tole_Freshwater:
5792  case tole_PitDisused:
5793  case tole_UrbanNoVeg:
5794  case tole_UrbanVeg:
5795  case tole_StoneWall:
5796  case tole_WindTurbine:
5797  case tole_Pylon:
5798  case tole_ActivePit:
5799  case tole_Airport:
5800  case tole_Portarea:
5801  case tole_Saltpans:
5802  case tole_Pipeline:
5803  elem = new NonVegElement(a_type, this);
5804  break;
5805  case tole_DrainageDitch:
5806  case tole_Garden:
5807  case tole_UrbanPark:
5808  elem = new VegElement(a_type, this);
5809  break;
5810  case tole_Building:
5811  elem = new NonVegElement(a_type, this);
5812  elem->SetCountryDesignation(0); // default = 0 = town
5813  break;
5814  case tole_SmallRoad:
5815  elem = new SmallRoad(this);
5816  break;
5817  case tole_LargeRoad:
5818  elem = new LargeRoad(this);
5819  break;
5820  case tole_Pond:
5821  elem = new Pond(this);
5822  break;
5823  // Vegetated Elements
5824  case tole_Railway:
5825  case tole_RiversidePlants:
5826  elem = new VegElement(a_type, this);
5827  // default tov_noGrowth in the constructor
5828  break;
5829  case tole_WoodyEnergyCrop: // not really wused
5830  case tole_DeciduousForest:
5831  case tole_MixedForest:
5832  case tole_ConiferousForest:
5833  case tole_Copse:
5834  case tole_IndividualTree:
5835  case tole_WoodlandMargin:
5836  case tole_Scrub:
5837  case tole_SwampForest:
5838  case tole_MontadoCorkOak:
5839  case tole_MontadoHolmOak:
5840  case tole_MontadoMixed:
5842  case tole_CorkOakForest:
5843  case tole_HolmOakForest:
5844  case tole_OtherOakForest:
5845  case tole_ChestnutForest:
5846  case tole_EucalyptusForest:
5847  case tole_InvasiveForest:
5849  case tole_StonePineForest:
5850  case tole_RiversideTrees:
5851  elem = new ForestElement(a_type, this);
5852  break;
5853  case tole_YoungForest:
5854  // Vegetation type set in Farm InitiateManagement
5855  elem = new ForestElement(a_type, this);
5856  elem->SetVegPatchy(true);
5857  break;
5858  case tole_PlantNursery:
5859  // Vegetation type set in Farm InitiateManagement
5860  elem = new VegElement(a_type, this);
5861  break;
5862  case tole_Vildtager:
5863  elem = new VegElement(a_type, this);
5865  elem->SetVegPatchy(true);
5866  break;
5867  case tole_ForestAisle:
5868  case tole_SolarPanel:
5869  elem = new VegElement(a_type, this);
5871  elem->SetVegPatchy(true);
5872  elem->Set_Att_VegGrass(true);
5873  break;
5874  case tole_Marsh:
5875  case tole_Saltmarsh:
5876  elem = new VegElement(a_type, this);
5878  elem->SetVegGrowthScalerRand();
5879  elem->Set_Att_VegGrass(true);
5880  elem->SetVegPatchy(true);
5881  break;
5882  case tole_Hedges:
5883  elem = new Hedges(this);
5884  break;
5885  case tole_HedgeBank:
5886  elem = new HedgeBank(this);
5887  break;
5888  case tole_BeetleBank:
5889  elem = new BeetleBank(this);
5890  break;
5891  case tole_FieldBoundary:
5892  elem = new FieldBoundary(this, a_type);
5893  //elem->SetVegType(tov_NaturalGrass);
5894  break;
5895  case tole_FlowerStrip:
5896  // Currently one third are given each subtype, but this can be altered afterwards using SetSubType
5897  l_rand = g_rand_uni_fnc();
5898  if (l_rand < 0.33) subtype = 2; else if (l_rand < 0.67) subtype = 3;
5899  elem = new FlowerStrip(this,subtype);
5900  break;
5902  // One third are given each subtype and they will then rotate between them
5903  l_rand = g_rand_uni_fnc();
5904  if (l_rand < 0.33) subtype = 2; else if (l_rand < 0.67) subtype = 3;
5905  elem = new FlowerStripWithRotation(this, subtype);
5906  break;
5907  case tole_Orchard:
5908  // Vegetation type set in Farm InitiateManagement
5909  elem = new Orchard(this);
5910  break;
5911  case tole_OrchardBand:
5912  elem = new OrchardBand(this);
5913  break;
5914  case tole_MownGrassStrip:
5915  elem = new MownGrassStrip(this);
5916  break;
5917  case tole_Heath:
5918  elem = new VegElement(a_type, this);
5919  elem->SetVegType(tov_Heath);
5920  elem->SetVegPatchy(true);
5921  elem->SetVegGrowthScalerRand();
5922  break;
5923  case tole_Field:
5924  elem = new Field(this);
5925  break;
5926  // Other permament crops
5927  case tole_Vineyard:
5928  case tole_OliveGrove:
5929  elem = new VegElement(a_type, this);
5930  break;
5931  case tole_RiceField:
5932  case tole_AlmondPlantation:
5933  case tole_WalnutPlantation:
5934  case tole_FarmBufferZone:
5935  case tole_NaturalFarmGrass:
5936  case tole_GreenFallow:
5938  case tole_FlowersPerm:
5939  case tole_AsparagusPerm:
5940  case tole_OAsparagusPerm:
5941  case tole_MushroomPerm:
5942  case tole_OtherPermCrop:
5943  // lct: temporary, to develop (Vegetation type set in Farm InitiateManagement)
5944  elem = new VegElement(a_type, this);
5945  break;
5946  // Pastures and Grass
5948  // Vegetation type set in Farm InitiateManagement
5949  elem = new PermanentSetaside(this);
5950  break;
5951  case tole_PermPasture:
5952  case tole_PermPasturePigs:
5953  case tole_OPermPasturePigs:
5954  case tole_OPermPasture:
5955  // Vegetation type set in Farm InitiateManagement
5956  elem = new PastureElement(a_type, this);
5958  break;
5961  // Vegetation type set in Farm InitiateManagement
5962  elem = new PastureElement(a_type, this);
5964  break;
5966  // Vegetation type set in Farm InitiateManagement
5967  elem = new PastureElement(a_type, this);
5968  elem->SetVegPatchy(true);
5969  elem->SetDigestibility(0.8);
5971  break;
5972  case tole_NaturalGrassDry:
5973  case tole_NaturalGrassWet:
5974  case tole_UnknownGrass:
5975  elem = new NaturalGrass(a_type, this);
5976  break;
5977  case tole_OOrchard: // Vegetation type set in Farm InitiateManagement
5978  case tole_BushFruit:
5979  case tole_OBushFruit:
5980  case tole_ChristmasTrees:
5981  case tole_OChristmasTrees:
5982  case tole_EnergyCrop:
5983  case tole_OEnergyCrop:
5984  case tole_FarmForest:
5985  case tole_OFarmForest:
5986  case tole_FarmYoungForest:
5987  case tole_OFarmYoungForest:
5988  elem = new VegElement(a_type, this);
5989  break;
5990  case tole_Wasteland:
5991  elem = new NaturalGrass(a_type, this);
5992  elem->SetVegType(tov_Wasteland);
5993  elem->SetVegPatchy(true);
5994  elem->Set_Att_VegGrass(true);
5995  break;
5996  case tole_WaterBufferZone:
5997  elem = new WaterBufferZone(this);
5998  break;
5999  case tole_RoadsideSlope:
6000  elem = new RoadsideVerge(a_type, this);
6001  break;
6002  case tole_RoadsideVerge:
6003  elem = new RoadsideVerge(a_type, this);
6004  elem->SetVegGrowthScalerRand();
6005  break;
6007  elem = new UnsprayedFieldMargin(this);
6008  break;
6009  case tole_Missing:
6010  elem = new LE(this); // These should never be actually used.
6011  break;
6012  default:
6013  g_msg->Warn(WARN_FILE, "Landscape::NewElement(): Unknown landscape element requested:", int(a_type));
6014  exit(1);
6015  } //switch
6016 
6017  // Set the TOLE attributes
6018  Set_TOLE_Att(elem);
6019  // Set the external code
6020  elem->SetALMaSSEleType(g_letype->BackTranslateEleTypes(a_type));
6021  return elem;
6022 }

References LE_TypeClass::BackTranslateEleTypes(), cfg_farm_cattle_grazing_lvl_lowyield, cfg_farm_cattle_grazing_lvl_pasture, cfg_farm_cattle_grazing_lvl_tussocky, g_letype, g_msg, g_rand_uni_fnc(), LE::Set_Att_VegGrass(), LE::SetCountryDesignation(), LE::SetDigestibility(), LE::SetGrazingLevel(), LE::SetVegGrowthScalerRand(), LE::SetVegPatchy(), LE::SetVegType(), tole_ActivePit, tole_AgroForestrySystem, tole_Airport, tole_AlmondPlantation, tole_AmenityGrass, tole_AsparagusPerm, tole_BareRock, tole_BeetleBank, tole_Building, tole_BuiltUpWithParkland, tole_BushFruit, tole_Canal, tole_Carpark, tole_Chameleon, tole_ChestnutForest, tole_ChristmasTrees, tole_Churchyard, tole_Coast, tole_ConiferousForest, tole_Copse, tole_CorkOakForest, tole_DeciduousForest, tole_DrainageDitch, tole_EnergyCrop, tole_EucalyptusForest, tole_FarmBufferZone, tole_FarmFeedingGround, tole_FarmForest, tole_FarmYoungForest, tole_Fence, tole_Field, tole_FieldBoundary, tole_FishFarm, tole_FlowersPerm, tole_FlowerStrip, tole_FlowerStripWithRotation, tole_ForestAisle, tole_Freshwater, tole_Garden, tole_GreenFallow, tole_Heath, tole_HedgeBank, tole_Hedges, tole_HeritageSite, tole_HolmOakForest, tole_IndividualTree, tole_InvasiveForest, tole_LargeRoad, tole_MaritimePineForest, tole_Marsh, tole_MetalledPath, tole_Missing, tole_MixedForest, tole_MontadoCorkOak, tole_MontadoHolmOak, tole_MontadoMixed, tole_MownGrassStrip, tole_MushroomPerm, tole_NaturalFarmGrass, tole_NaturalGrassDry, tole_NaturalGrassWet, tole_OAsparagusPerm, tole_OBushFruit, tole_OChristmasTrees, tole_OEnergyCrop, tole_OFarmForest, tole_OFarmYoungForest, tole_OliveGrove, tole_OOrchard, tole_OPermPasture, tole_OPermPastureLowYield, tole_OPermPasturePigs, tole_Orchard, tole_OrchardBand, tole_OtherOakForest, tole_OtherPermCrop, tole_Parkland, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPasturePigs, tole_PermPastureTussocky, tole_Pipeline, tole_PitDisused, tole_PlantNursery, tole_Pond, tole_Portarea, tole_Pylon, tole_Railway, tole_RefuseSite, tole_RiceField, tole_River, tole_RiverBed, tole_RiversidePlants, tole_RiversideTrees, tole_RoadsideSlope, tole_RoadsideVerge, tole_Saltmarsh, tole_Saltpans, tole_Saltwater, tole_SandDune, tole_Scrub, tole_SmallRoad, tole_SolarPanel, tole_StonePineForest, tole_StoneWall, tole_Stream, tole_SwampForest, tole_Track, tole_UnknownGrass, tole_UnsprayedFieldMargin, tole_UrbanNoVeg, tole_UrbanPark, tole_UrbanVeg, tole_Vildtager, tole_Vineyard, tole_WalnutPlantation, tole_Wasteland, tole_WaterBufferZone, tole_WindTurbine, tole_WoodlandMargin, tole_WoodyEnergyCrop, tole_YoungForest, tov_Heath, tov_NaturalGrass, tov_Wasteland, CfgInt::value(), MapErrorMsg::Warn(), and WARN_FILE.

Referenced by hb_GenerateHBPolys().

◆ PolysDump()

void Landscape::PolysDump ( const char *  a_filename)
protected

Called if the landscape is manipulated to save the new version of the polyref input file.

3369 {
3370  ofstream outf(a_filename, ios::out);
3371  int l_num_polys = 0;
3372 
3373  if (!outf.is_open()) {
3374  g_msg->Warn(WARN_FILE, "Landscape::PolysDump(): Unable to open file", a_filename);
3375  exit(1);
3376  }
3377 
3378  // Count up number if active polygons in our list.
3379  unsigned sz = (unsigned)m_elems.size();
3380  for (unsigned int i = 0; i < sz; i++) {
3381  if (m_elems[i]->GetMapValid())
3382  l_num_polys++;
3383  }
3384 
3385  outf << this->SupplyCountryCode() << " " << "Latitude " << this->SupplyLatitude() << " Longitude " << this->SupplyLongitude() << "\n";
3386  outf << l_num_polys << endl;
3387  outf << "PolyType" << '\t' << "PolyRefNum" << '\t' << "Area" << '\t' << "FarmRef" << '\t' << "UnSprayedMarginRef" << '\t' << "SoilType" << '\t' << "Openness" << '\t' << "CentroidX" << '\t' << "CentroidY" << '\t' << "Elevation" << '\t' << "Slope" << '\t' << "Aspect" << '\t' << "PollenNectarCurve" << endl;
3388 
3389  // Now we can output the file
3390  // The last column needs to be changed from -1 to curve number after defining GetPollenNectarCurveRef()
3391  for (unsigned int i = 0; i < m_elems.size(); i++)
3392  {
3393  if (m_elems[i]->GetMapValid())
3394  {
3395  outf << m_elems[i]->GetALMaSSEleType() << '\t' << m_elems[i]->GetPoly() << '\t' << m_elems[i]->GetArea() << '\t' <<
3396  m_elems[i]->GetOwnerFile() << '\t' << m_elems[i]->GetUnsprayedMarginPolyRef() << '\t' << m_elems[i]->GetSoilType() << '\t' << m_elems[i]->GetOpenness()
3397  << '\t' << m_elems[i]->GetCentroidX() << '\t' << m_elems[i]->GetCentroidY() << '\t' << m_elems[i]->GetElevation() << '\t' << m_elems[i]->GetSlope() << '\t' << m_elems[i]->GetAspect() << '\t' << m_elems[i]->GetPollenNectarCurveRef() << endl;
3398  }
3399  }
3400  outf.close();
3401 }

References g_msg, MapErrorMsg::Warn(), and WARN_FILE.

◆ PolysRemoveInvalid()

bool Landscape::PolysRemoveInvalid ( void  )
protected

Checks whether all polygons are in the map, removing those that are not.

PolysValidate or ChangeMapMapping must be called after this method

3337 {
3341  bool didsomething = false;
3342  vector < LE* > l_temp;
3343  cout << "Tidying up the polygon map in PolysRemoveInvalid" << endl;
3344  unsigned int sz = (int)m_elems.size();
3345  for (unsigned int i = 0; i < sz; i++) {
3346  if (m_elems[i]->GetMapValid()) {
3347  unsigned int j = (int)l_temp.size();
3348  l_temp.resize(j + 1);
3349  l_temp[j] = m_elems[i];
3350  }
3351  else {
3352  // cout << "Deleted m_elems index:" << m_polymapping[ m_elems[ i ]->GetPoly() ] << " Polynumber :" << m_elems[ i ]->GetPoly() << BackTranslateEleTypes(m_elems[ i ]->GetElementType()) << endl;
3353  m_polymapping[m_elems[i]->GetPoly()] = -1;
3354  delete m_elems[i];
3355  didsomething = true;
3356  }
3357  }
3358 
3359  for (unsigned int i = 0; i < l_temp.size(); i++) {
3360  m_elems[i] = l_temp[i];
3361  }
3362  m_elems.resize(l_temp.size());
3364  return didsomething;
3365 }

References m_polymapping.

◆ PolysRenumber()

void Landscape::PolysRenumber ( void  )
protected

Renumbers the polygons from 0 to the number of LE instances - 1. This saves space, and also means that the polygon number becomes the same as the index in Landscape::m_elems, allowing quicker lookup(reduces indirection by 1)

This saves space in arrays by removing unused polygon numbers and renumbering, then triggering a dump of the landscape files. It uses a shortcut in that the polygons are already mapped to an array without space, so we use the index of this array to define the new polygon number. There is one problem however, that is if the polygon is a field then it might have a an unsprayed field margin reference, and that reference cannot be renumbered in this way. This requires a two step pass, first to find the unsprayed margin polygons, then to map the new and old numbers, then pass through again and reset all fields to point to the correct new polygon number.

4075 {
4085  cout << "In Landscape::Landscape() Polygon renumber." << endl;
4086  vector<int>unsprayedmargins_original;
4087  vector<int>unsprayedmargins_new;
4088 
4089  for (unsigned int i = 0; i < m_elems.size(); i++)
4090  {
4091  // Need to reset the poly number
4092  int index = m_elems[i]->GetMapIndex(); // This is the number currently in the map matrix
4093  // Deal with potential unsprayed margins by recording them here
4094  if (m_elems[i]->GetALMaSSEleType() == 31)
4095  {
4096  int oldpoly = m_elems[i]->GetPoly();
4097  unsprayedmargins_original.push_back(oldpoly);
4098  unsprayedmargins_new.push_back(i);
4099  }
4100  m_elems[i]->SetPoly(index); // The map index and the polygon number are now one and the same
4101  m_polymapping[index] = i; // The polymapping is now linked via index to the m_elems index (i)
4102  }
4103  // Now run through the m_elems and replace original unsprayed margin refs with the new ones
4104  for (unsigned int i = 0; i < m_elems.size(); i++)
4105  {
4106  int old = m_elems[i]->GetUnsprayedMarginPolyRef();
4107  if (old!=-1)
4108  {
4109  bool found = false;
4110  for (unsigned j = 0; j < unsprayedmargins_original.size(); j++)
4111  {
4112  if (old == unsprayedmargins_original[j])
4113  {
4114  m_elems[i]->SetUnsprayedMarginPolyRef(unsprayedmargins_new[j]);
4115  found = true;
4116  break;
4117  }
4118  }
4119  if (!found)
4120  {
4121  g_msg->Warn( "Landscape::Landscape() Mismatch in unsprayed margins refs: ", old);
4122  }
4123  }
4124  }
4125  m_LargestPolyNumUsed = (int) m_elems.size()-1;
4126  g_msg->Warn(WARN_FILE, "Landscape::Landscape() ""Map to be dumped due to polygon renumber", "");
4127 }

References g_msg, m_polymapping, MapErrorMsg::Warn(), and WARN_FILE.

◆ PolysValidate()

void Landscape::PolysValidate ( bool  a_exit_on_invalid)
protected

Checks for internal consistency in the polygon information, e.g. being sure that all polygons mentioned are actually in the map.

3310  {
3311  // First loop just sets the MapValid as false (and checks for a major screw-up if this elemenent does not exist even in the list
3312  for ( unsigned int i = 0; i < m_elems.size(); i++ ) {
3313  m_elems[ i ]->SetMapValid( false );
3314  if ( m_polymapping[ m_elems[ i ]->GetPoly() ] == -1 ) {
3315  char l_err[ 20 ];
3316  sprintf( l_err, "%d", m_elems[ i ]->GetPoly() );
3317  g_msg->Warn( WARN_FILE, "Landscape::PolysValidate(): Invalid polymapping ", l_err );
3318  exit( 1 );
3319  }
3320  }
3321  // Now go through the whole map and for each polygon found set MapValid as true.
3323  if ( a_exit_on_invalid ) {
3324  for ( unsigned int i = 0; i < m_elems.size(); i++ ) {
3325  if ( !m_elems[ i ]->GetMapValid() ) {
3326  char l_err[ 20 ];
3327  sprintf( l_err, "%d", m_elems[ i ]->GetPoly() );
3328  g_msg->Warn( WARN_FILE, "Landscape::PolysValidate(): Invalid polygon ", l_err );
3329  exit( 0 );
3330  }
3331  }
3332  }
3333 }

References g_msg, m_polymapping, MapErrorMsg::Warn(), and WARN_FILE.

◆ PolytypeToString()

std::string Landscape::PolytypeToString ( TTypesOfLandscapeElement  a_le_type)

Returns the text representation of a TTypesOfLandscapeElement type.

6268  {
6269 
6270  switch (a_le_type) {
6271  case tole_Hedges:
6272  return " Hedge";
6273  case tole_RoadsideVerge:
6274  return " Roadside Verge";
6275  case tole_Railway:
6276  return " Railway";
6277  case tole_FieldBoundary:
6278  return " Field Boundary";
6279  case tole_Marsh:
6280  return " Marsh";
6281  case tole_Scrub:
6282  return " Scrub";
6283  case tole_Field:
6284  return " Field";
6286  return " PermPastureTussocky";
6288  return " Permanent Setaside";
6289  case tole_PermPasture:
6290  return " Permanent Pasture";
6292  return " PermPastureLowYield";
6293  case tole_NaturalGrassDry:
6294  return " Natural Grass";
6295  case tole_NaturalGrassWet:
6296  return " Natural Grass Wet";
6297  case tole_RiversidePlants:
6298  return " Riverside Plants";
6299  case tole_PitDisused:
6300  return " Pit Disused";
6301  case tole_RiversideTrees:
6302  return " Riverside Trees";
6303  case tole_DeciduousForest:
6304  return " Deciduous Forest";
6305  case tole_MixedForest:
6306  return " Mixed Forest";
6307  case tole_ConiferousForest:
6308  return " Coniferous Forest";
6309  case tole_YoungForest:
6310  return " Young Forest";
6311  case tole_StoneWall:
6312  return " Stone Wall";
6313  case tole_Garden:
6314  return " Garden";
6315  case tole_Track:
6316  return " Track";
6317  case tole_SmallRoad:
6318  return " Small Road";
6319  case tole_LargeRoad:
6320  return " Large Road";
6321  case tole_Building:
6322  return " Building";
6323  case tole_ActivePit:
6324  return " Active Pit";
6325  case tole_Pond:
6326  return " Pond";
6327  case tole_Freshwater:
6328  return " Fresh Water";
6329  case tole_River:
6330  return " River";
6331  case tole_Saltwater:
6332  return " Saltwater";
6333  case tole_Coast:
6334  return " Coast";
6335  case tole_BareRock:
6336  return " Bare Rock";
6337  case tole_HedgeBank:
6338  return " Hedgebank";
6339  case tole_Heath:
6340  return " Heath";
6341  case tole_Orchard:
6342  return " Orchard";
6343  case tole_OrchardBand:
6344  return " Orchard Band";
6345  case tole_MownGrassStrip:
6346  return " Mown Grass Strip";
6348  return " UnsprayedFieldMargin";
6349  case tole_AmenityGrass:
6350  return " AmenityGrass";
6351  case tole_Parkland:
6352  return " Parkland";
6353  case tole_UrbanNoVeg:
6354  return " UrbanNoVeg";
6355  case tole_UrbanVeg:
6356  return " UrbanVeg";
6357  case tole_UrbanPark:
6358  return " UrbanPark";
6360  return " BuiltUpWithParkland";
6361  case tole_SandDune:
6362  return " SandDune";
6363  case tole_Copse:
6364  return " Copse";
6365  case tole_RoadsideSlope:
6366  return " RoadsideSlope";
6367  case tole_MetalledPath:
6368  return " MetalledPath";
6369  case tole_Carpark:
6370  return " Carpark";
6371  case tole_Churchyard:
6372  return " Churchyard";
6373  case tole_Saltmarsh:
6374  return " Saltmarsh";
6375  case tole_Stream:
6376  return " Stream";
6377  case tole_HeritageSite:
6378  return " HeritageSite";
6379  case tole_BeetleBank: //141
6380  return " Beetle Bank";
6381  case tole_UnknownGrass:
6382  return " Unknown Grass";
6383  case tole_Wasteland:
6384  return " Waste/Building Land";
6385  case tole_IndividualTree:
6386  return " IndividualTree";
6387  case tole_PlantNursery:
6388  return " PlantNursery";
6389  case tole_Vildtager:
6390  return " Vildtager";
6391  case tole_WindTurbine:
6392  return " WindTurbine";
6393  case tole_WoodyEnergyCrop:
6394  return " WoodyEnergyCrop";
6395  case tole_WoodlandMargin:
6396  return " WoodlandMargin";
6397  case tole_Pylon:
6398  return " Pylon";
6399  case tole_FishFarm:
6400  return " FishFarm";
6401  case tole_Fence:
6402  return " Fence";
6403  case tole_WaterBufferZone:
6404  return " Unsprayed buffer zone around water";
6405  case tole_DrainageDitch:
6406  return " DrainageDitch";
6407  case tole_Vineyard:
6408  return "Vineyard";
6409  case tole_OliveGrove:
6410  return "OliveGrove";
6411  case tole_RiceField:
6412  return "Rice Field";
6413  case tole_MontadoCorkOak:
6414  return "MontadoCorkOak";
6415  case tole_MontadoHolmOak:
6416  return "MontadoHolmOak";
6417  case tole_MontadoMixed:
6418  return "MontadoMixed";
6420  return "AgroForestrySystem";
6421  case tole_CorkOakForest:
6422  return "CorkOakForest";
6423  case tole_HolmOakForest:
6424  return "HolmOakForest";
6425  case tole_OtherOakForest:
6426  return "OtherOakForest";
6427  case tole_ChestnutForest:
6428  return "ChestnutForest";
6429  case tole_EucalyptusForest:
6430  return "EucalyptusForest";
6432  return "MaritimePineForest";
6433  case tole_StonePineForest:
6434  return "StonePineForest";
6435  case tole_InvasiveForest:
6436  return "InvasiveForest";
6437  case tole_Portarea:
6438  return "Portarea";
6439  case tole_Airport:
6440  return "Airport";
6441  case tole_Saltpans:
6442  return "Saltpans";
6443  case tole_SwampForest:
6444  return "SwampForest";
6445  case tole_Pipeline:
6446  return "Pipeline";
6447  case tole_SolarPanel:
6448  return "SolarPanel";
6449  case tole_ForestAisle:
6450  return "ForestAisle";
6451  case tole_OOrchard:
6452  return "OOrchard";
6453  case tole_BushFruit:
6454  return "BushFruit";
6455  case tole_OBushFruit:
6456  return "OBushFruit";
6457  case tole_ChristmasTrees:
6458  return "ChristmasTrees";
6459  case tole_OChristmasTrees:
6460  return "OChristmasTrees";
6461  case tole_EnergyCrop:
6462  return "EnergyCrop";
6463  case tole_OEnergyCrop:
6464  return "OEnergyCrop";
6465  case tole_FarmForest:
6466  return "FarmForest";
6467  case tole_OFarmForest:
6468  return "OFarmForest";
6469  case tole_PermPasturePigs:
6470  return "PermPasturePigs";
6471  case tole_OPermPasturePigs:
6472  return "OPermPasturePigs";
6473  case tole_OPermPasture:
6474  return "OPermPasture";
6476  return "OPermPastureLowYield";
6477  case tole_FarmYoungForest:
6478  return "FarmYoungForest";
6479  case tole_OFarmYoungForest:
6480  return "OFarmYoungForest";
6481  case tole_AlmondPlantation:
6482  return "AlmondPlantation";
6483  case tole_WalnutPlantation:
6484  return "WalnutPlantation";
6485  case tole_FarmBufferZone:
6486  return "FarmBufferZone";
6487  case tole_NaturalFarmGrass:
6488  return "NaturalFarmGrass";
6489  case tole_GreenFallow:
6490  return "GreenFallow";
6492  return "FarmFeedingGround";
6493  case tole_FlowersPerm:
6494  return "FlowersPerm";
6495  case tole_AsparagusPerm:
6496  return "AsparagusPerm";
6497  case tole_OAsparagusPerm:
6498  return "Organic AsparagusPerm";
6499  case tole_MushroomPerm:
6500  return "MushroomPerm";
6501  case tole_OtherPermCrop:
6502  return "OtherPermCrop";
6503  case tole_FlowerStrip:
6504  return "Flower Strip";
6506  return "Flower Strip with rotation";
6507  case tole_RefuseSite:
6508  return "Refuse site";
6509  case tole_Foobar:
6510  default:
6511  g_msg->Warn(WARN_FILE, "Landscape::PolytypeToString(): Unknown event type: ",int(a_le_type));
6512  exit(1);
6513  }
6514 }

References g_msg, tole_ActivePit, tole_AgroForestrySystem, tole_Airport, tole_AlmondPlantation, tole_AmenityGrass, tole_AsparagusPerm, tole_BareRock, tole_BeetleBank, tole_Building, tole_BuiltUpWithParkland, tole_BushFruit, tole_Carpark, tole_ChestnutForest, tole_ChristmasTrees, tole_Churchyard, tole_Coast, tole_ConiferousForest, tole_Copse, tole_CorkOakForest, tole_DeciduousForest, tole_DrainageDitch, tole_EnergyCrop, tole_EucalyptusForest, tole_FarmBufferZone, tole_FarmFeedingGround, tole_FarmForest, tole_FarmYoungForest, tole_Fence, tole_Field, tole_FieldBoundary, tole_FishFarm, tole_FlowersPerm, tole_FlowerStrip, tole_FlowerStripWithRotation, tole_Foobar, tole_ForestAisle, tole_Freshwater, tole_Garden, tole_GreenFallow, tole_Heath, tole_HedgeBank, tole_Hedges, tole_HeritageSite, tole_HolmOakForest, tole_IndividualTree, tole_InvasiveForest, tole_LargeRoad, tole_MaritimePineForest, tole_Marsh, tole_MetalledPath, tole_MixedForest, tole_MontadoCorkOak, tole_MontadoHolmOak, tole_MontadoMixed, tole_MownGrassStrip, tole_MushroomPerm, tole_NaturalFarmGrass, tole_NaturalGrassDry, tole_NaturalGrassWet, tole_OAsparagusPerm, tole_OBushFruit, tole_OChristmasTrees, tole_OEnergyCrop, tole_OFarmForest, tole_OFarmYoungForest, tole_OliveGrove, tole_OOrchard, tole_OPermPasture, tole_OPermPastureLowYield, tole_OPermPasturePigs, tole_Orchard, tole_OrchardBand, tole_OtherOakForest, tole_OtherPermCrop, tole_Parkland, tole_PermanentSetaside, tole_PermPasture, tole_PermPastureLowYield, tole_PermPasturePigs, tole_PermPastureTussocky, tole_Pipeline, tole_PitDisused, tole_PlantNursery, tole_Pond, tole_Portarea, tole_Pylon, tole_Railway, tole_RefuseSite, tole_RiceField, tole_River, tole_RiversidePlants, tole_RiversideTrees, tole_RoadsideSlope, tole_RoadsideVerge, tole_Saltmarsh, tole_Saltpans, tole_Saltwater, tole_SandDune, tole_Scrub, tole_SmallRoad, tole_SolarPanel, tole_StonePineForest, tole_StoneWall, tole_Stream, tole_SwampForest, tole_Track, tole_UnknownGrass, tole_UnsprayedFieldMargin, tole_UrbanNoVeg, tole_UrbanPark, tole_UrbanVeg, tole_Vildtager, tole_Vineyard, tole_WalnutPlantation, tole_Wasteland, tole_WaterBufferZone, tole_WindTurbine, tole_WoodlandMargin, tole_WoodyEnergyCrop, tole_YoungForest, MapErrorMsg::Warn(), and WARN_FILE.

Referenced by hb_Add().

◆ ReadFlowerSpeciesComp()

void Landscape::ReadFlowerSpeciesComp ( const char *  a_flower_file)
protected

This function is to read the habitat species composition for flower resource.

3442  {
3443  std::cout << "Reading Habitats Nectar Pollen Composition File " << a_flower_file << "\n";
3444  ifstream infile_hab_com;
3445  infile_hab_com.open(a_flower_file, ios::in);
3446  //check if there is an input file
3447  if (!infile_hab_com.is_open()) {
3448  g_msg->Warn("Landscape::ReadFlowerSpeciesComp() Cannot open the file", a_flower_file);
3449  exit(1);
3450  }
3451 
3452  //read the habitata composition file
3453  int no_habitat, no_composition, habitat_id, species_id;
3454  double flower_num;
3455  double rubbish;
3456  string species_name; // this is droped, not stored
3457  string flower_unit_type;
3458 
3459  vector<int> temp_composition_vec;
3460  vector<double> temp_flower_num_vec;
3461  infile_hab_com >> no_habitat;
3462  for (int i = 0; i<no_habitat; i++){
3463  //if(i==57)
3464  // int a = 0;
3465  infile_hab_com >> habitat_id >> no_composition;
3466 
3467  //composition
3468  temp_composition_vec.clear();
3469  temp_flower_num_vec.clear();
3470  for (int j = 0; j<no_composition; j++){
3471  infile_hab_com >> species_name >> flower_unit_type >> species_id >> flower_num >> rubbish >> rubbish >> rubbish >> rubbish >> rubbish >> rubbish >> rubbish >> rubbish >> rubbish >> rubbish;
3472  //-1 means that we don't have information for this species
3473  if(species_id<0 || flower_num<=0){
3474  continue;
3475  }
3476  temp_composition_vec.push_back(species_id);
3477  temp_flower_num_vec.push_back(flower_num);
3478  }
3479  m_habitat_species.insert({habitat_id, temp_composition_vec});
3480  m_habitat_flower_num.insert({habitat_id, temp_flower_num_vec});
3481  PollenNectarData temp_pollen;
3482  m_habitat_pollen.insert({habitat_id, temp_pollen});
3483  PollenNectarData temp_nectar;
3484  m_habitat_nectar.insert({habitat_id, temp_nectar});
3485  #ifdef __FLOWERTESTING
3486  m_polyid_habitat.insert({habitat_id, -1});
3487  #endif
3488  }
3489  infile_hab_com.close();
3490 }

References g_msg, and MapErrorMsg::Warn().

◆ ReadOpenness()

void Landscape::ReadOpenness ( void  )

Reads openness values from a standard input file for all polygons LKM - used??

◆ ReadPolys1()

int Landscape::ReadPolys1 ( const char *  a_polyfile)
protected

Is used to take a look in the input file for polygons to figure out what the format is (since multiple formats are allowed)

This is a new file format 2020/2021 to include country code, latitude, longitude, aspect, slope, elevation, and the pollen/nectar curve number

3405 {
3406  // Read first line and figure out what format i have
3407  int format = 0;
3408  int NoPolygons;
3409  float latitude, longitude;
3410  std::string country_code;
3411  string rubbish = "";
3412  string firstline = ""; // added for parsing between the two formats
3413  ifstream pifile(a_polyfile);
3414  if (!pifile.is_open()) {
3415  g_msg->Warn(WARN_FILE, "Landscape::ReadPolys1(): Unable to open file", a_polyfile);
3416  }
3417  // Read first line and figure out what format we have
3418  getline(pifile, firstline);
3419 
3420  // Default Location
3421  this->SetCountryCode("DK");
3422  this->SetLatitude(56.166666);
3423  this->SetLongitude(10.1999992);
3424 
3425  if (!(std::stringstream(firstline) >> NoPolygons))
3426  {
3430  format = 1;
3431  std::stringstream(firstline) >> country_code >> rubbish >> latitude >> rubbish >> longitude;
3432  pifile >> NoPolygons;
3433  this->SetCountryCode(country_code);
3434  this->SetLatitude(latitude);
3435  this->SetLongitude(longitude);
3436  }
3437  m_elems.resize(NoPolygons);
3438  pifile.close();
3439  return format;
3440 }

References g_msg, MapErrorMsg::Warn(), and WARN_FILE.

◆ ReadPolys2()

void Landscape::ReadPolys2 ( const char *  a_polyfile,
int  a_format 
)
protected

Based on the format of the file (since multiple formats are allowed), this reads the polygon information from an input file. This method sets up the Landscape::m_polymapping lookup table, checks validity of polygon and associated farm information and creates the LE instances to populate the Landscape::m_elems array, and if needed creates the links between unsprayed margins and the owner tole type.

The polygon file consists of 9 or 13 columns:

  1. 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

Here we need to set the pollen curve - there are a few possible options The PollenNectarCurve variable holds either:
-3 (relies on tov type), we set to zero for now but later the program will alter it when the veg is changed. This should only be for fields.
-2 (not needed for this poly - default curve 0,
-1 column not filled in, default to zero curve,
or a curve reference from the habitat set

Note
This is a temperoary settings for EcoStack

With the polygons renumbered, we can safely set the hb_first_free_poly_num to the number of polygons we have.

3585 {
3592  // Need to figure out if the farms are already renumbered - as the Farm manager
3593  bool farmsrenum = m_FarmManager->GetIsRenumbered();
3594 
3595  int NoPolygons = int(m_elems.size());
3596  string rubbish = ""; //put here the names of the parameters;
3597  ifstream ifile(a_polyfile);
3598  if (!ifile.is_open()) {
3599  g_msg->Warn(WARN_FILE, "Landscape::ReadPolys2(): Unable to open file", a_polyfile);
3600  std::exit(1);
3601  }
3602  char error_num[20];
3604  for (int i = 0; i < ((a_format == 0) ? 10 : 19); i++) { ifile >> rubbish; }
3605 
3609  int np = NoPolygons;
3610  if (NoPolygons < 10000) np = 10000; // this is just to cope with old maps with < 10000 polygons that do not follow the rules for new maps
3611  m_polymapping.resize(np * 2);
3612 
3613  // Set all mappings to unused.
3614  for (int i = 0; i < np * 2; i++) {
3615  m_polymapping[i] = -1;
3616  }
3617 
3618  int ElemIndex = 0;
3619 
3620  for (int x = 0; x < NoPolygons; x++)
3621  {
3622  int PolyNum, Owner, PolyType, RealPolyType, URef, SoilType, openness, Centroid_x, Centroid_y;
3623  float Elevation = -1, Slope = -1, Aspect = -1;
3624  int PollenNectarCurve = 0;
3625 
3627  float Area;
3628  ifile >> PolyType >> PolyNum >> Area >> Owner >> URef >> SoilType >> openness >> Centroid_x >> Centroid_y;
3629 
3630  if (a_format == 1)
3631  {
3632  ifile >> Elevation >> Slope >> Aspect >> PollenNectarCurve;
3633  }
3634 
3635  // ToDo: Check input validity for elev, slope and aspect once agreed
3636 
3637  // Here we make some tests to check input validity
3638  if ((SoilType > 16) || (PolyNum<0))
3639  {
3640  std::sprintf(error_num, "%d", NoPolygons);
3641  g_msg->Warn(WARN_FILE, "Landscape::ReadPolys(): Polygon file empty before "
3642  "reading number of specified polygons (old polygon file format?):", error_num);
3643  std::exit(1);
3644  }
3645 
3646  // Owner is the farm number or -1. If farms have not been renumbered then this needs mapped to the index in the list of farms.
3647  // Because we create this sequentially in Farm.cpp we have a constant index.
3648  if ((-1 != Owner) && !farmsrenum)
3649  {
3650  // Need to replace the Owner with the new renumbered ref.
3651  Owner = m_FarmManager->GetRenumberedFarmRef(Owner);
3652  }
3653 
3654  RealPolyType = PolyType;
3656  if (PolyType == 150)
3657  {
3658  PolyType = l_map_chameleon_replace_num.value();
3659  }
3660 
3661  Type = g_letype->TranslateEleTypes(PolyType);
3662  if (Type == tole_Missing)
3663  {
3665  }
3666  if (-1 == m_polymapping[PolyNum])
3667  {
3668  // First time we have encountered this polygon number.
3669  // Borders are not mapped in this list.
3670  m_polymapping[PolyNum] = ElemIndex;
3671  LE * newland = NewElement(Type);
3672  m_elems[ElemIndex++] = newland;
3673  newland->SetPoly(PolyNum);
3674  newland->SetMapIndex(PolyNum);
3675  newland->SetArea(floor(0.5 + Area));
3676  newland->SetALMaSSEleType(RealPolyType);
3677  newland->SetSoilType(SoilType);
3678  newland->SetUnsprayedMarginPolyRef(URef);
3679  newland->SetCentroid(Centroid_x,Centroid_y);
3680  newland->SetOpenness(openness);
3681  newland->SetElevation(Elevation);
3682  newland->SetSlope(Slope);
3683  newland->SetAspect(Aspect);
3691  //when there is flower resource, add the poly ref.
3692  if(PollenNectarCurve>0 || PollenNectarCurve==-3){
3693  m_poly_with_flowers.push_back(PolyNum);
3694  #ifdef __FLOWERTESTING
3695  if (PollenNectarCurve == -3 && m_polyid_farm == -1) m_polyid_farm = PolyNum;
3696  if (PollenNectarCurve >0){
3697  m_polyid_habitat.at(PollenNectarCurve) = PolyNum;
3698  }
3699  #endif
3700  }
3701  //check if we need to add boders, if yes we need to keep -1 and -3
3702  if (PollenNectarCurve < 1 && !(g_map_le_borders.value())) PollenNectarCurve = 0;
3703  newland->SetPollenNectarCurveRef(PollenNectarCurve);
3704  newland->PollenNectarReset();
3705 
3707  if(Type == tole_Heath){
3708  newland->SetPollenNectarCurveRef(9);
3709  newland->PollenNectarReset();
3710  }
3711 
3712  if(Type == tole_Marsh || Type == tole_Saltmarsh){
3713  newland->SetPollenNectarCurveRef(60);
3714  newland->PollenNectarReset();
3715  }
3716 
3717  if(Type == tole_RoadsideSlope){
3718  newland->SetPollenNectarCurveRef(17);
3719  newland->PollenNectarReset();
3720  }
3721 
3722  if(Type == tole_PlantNursery){
3723  newland->SetPollenNectarCurveRef(34); //curve for garden
3724  newland->PollenNectarReset();
3725  }
3726 
3727  if(Type == tole_Vildtager){
3728  newland->SetPollenNectarCurveRef(24);
3729  newland->PollenNectarReset();
3730  }
3731 
3732  if(Type == tole_WoodyEnergyCrop){
3733  newland->SetPollenNectarCurveRef(3);
3734  newland->PollenNectarReset();
3735  }
3736 
3737  if(Type == tole_ForestAisle){
3738  newland->SetPollenNectarCurveRef(32);
3739  newland->PollenNectarReset();
3740  }
3741 
3742  if(Type == tole_ChristmasTrees || Type == tole_OChristmasTrees){
3743  newland->SetPollenNectarCurveRef(4);
3744  newland->PollenNectarReset();
3745  }
3746 
3747  if(Type == tole_FlowersPerm){
3748  newland->SetPollenNectarCurveRef(59);
3749  newland->PollenNectarReset();
3750  }
3751 
3752 
3753  // Just for fun, or maybe because we might need it later, remember the actual largest polynum used
3754  if (PolyNum>m_LargestPolyNumUsed) m_LargestPolyNumUsed = PolyNum;
3755  // Now set any centroid or openness recalcuation flags
3756  if ((Centroid_x < 0) || (Centroid_y < 0)) m_NeedCentroidCalculation= true;
3757  if (openness < 0) m_NeedOpennessCalculation = true;
3758  // Two types of possible errors: Landscape element that is a field,
3759  // but doesn't belong to a farm, or a farm element not of type field.
3760  // Check for both cases.
3761  if (-1 == Owner && ClassificationFieldType(Type) == true ) {
3762  // No owner but field polygon.
3763  sprintf(error_num, "%d", PolyNum);
3764  g_msg->Warn(WARN_FILE, "Landscape::ReadPolys(): Farm polygon does not belong to a farm:", error_num);
3765  exit(1);
3766  }
3767  if (-1 != Owner && ClassificationFieldType(Type) == false ) {
3768  // An owner but not field elements.
3769  sprintf(error_num, "%d", PolyNum);
3770  g_msg->Warn(WARN_FILE, "Landscape::ReadPolys(): Farm polygon does not have element type tole_Field:", error_num);
3771  exit(1);
3772  }
3773 
3774  if (-1 != Owner)
3775  {
3776  m_FarmManager->ConnectFarm(Owner);
3777  m_FarmManager->AddField(Owner, newland, Owner);
3778 
3779  // Code to generate unsprayed margins....
3780  if (newland->GetElementType() == tole_Field)
3781  {
3783  {
3785  {
3786  // This is a farm field, so signal adding a margin
3787  newland->SetUnsprayedMarginPolyRef(1);
3788  }
3789  }
3790  }
3791  // ..to here
3792  }
3793 
3794  //initialise the dictionay for cell locations of every polygon
3795  std::vector<APoint> temp_vec_cell_loc;
3796  m_poly_cell_locs.insert({newland->GetPoly(), temp_vec_cell_loc});
3797  m_poly_cell_locs_nectar.insert({newland->GetPoly(), temp_vec_cell_loc});
3798  m_index_locs_nectar.insert({newland->GetPoly(), 0}); //no available nectar
3799  m_poly_cell_locs_pollen.insert({newland->GetPoly(), temp_vec_cell_loc});
3800  m_index_locs_pollen.insert({newland->GetPoly(), 0}); //no available pollen
3801  }
3802  else {
3803  sprintf(error_num, "%d", PolyNum);
3804  g_msg->Warn(WARN_FILE, "Landscape::ReadPolys2(): Duplicate polygon in file", error_num);
3805  exit(1);
3806  }
3807  }
3808  ifile.close();
3810  hb_first_free_poly_num = m_elems[NoPolygons - 1]->GetPoly() + 1;
3811  for (int i = 0; i < NoPolygons; i++)
3812  {
3813  if (m_elems[i]->GetUnsprayedMarginPolyRef() != -1)
3814  {
3815  TTypesOfLandscapeElement tole = m_elems[i]->GetElementType();
3816  int umref = m_elems[i]->GetUnsprayedMarginPolyRef();
3817  m_elems[m_polymapping[umref]]->SetOwner_tole(tole);
3818  }
3819  }
3820 }

References g_letype, g_map_le_borders, g_map_le_unsprayedmargins, g_map_le_unsprayedmargins_chance, g_msg, g_random_fnc(), LE::GetPoly(), l_map_chameleon_replace_num, m_polymapping, LE::PollenNectarReset(), LE::SetArea(), LE::SetAspect(), LE::SetCentroid(), LE::SetElevation(), LE::SetMapIndex(), LE::SetOpenness(), LE::SetPollenNectarCurveRef(), LE::SetPoly(), LE::SetSlope(), LE::SetSoilType(), LE::SetUnsprayedMarginPolyRef(), tole_ChristmasTrees, tole_Field, tole_FlowersPerm, tole_ForestAisle, tole_Heath, tole_Marsh, tole_Missing, tole_OChristmasTrees, tole_PlantNursery, tole_RoadsideSlope, tole_Saltmarsh, tole_Vildtager, tole_WoodyEnergyCrop, LE_TypeClass::TranslateEleTypes(), CfgInt::value(), CfgBool::value(), MapErrorMsg::Warn(), and WARN_FILE.

◆ ReadSymbols()

bool Landscape::ReadSymbols ( const char *  a_cfgfile)
inline

Reads and parses a_cfgfile for configuration values.

1399  {
1400  return g_cfg->ReadSymbols(a_cfgfile);
1401  }

References g_cfg.

◆ RebuildPolyMapping()

void Landscape::RebuildPolyMapping ( )
inlineprotected

Called if there is any change in the polygons and loops through all polygons resetting the Landscape::m_polymapping value.

396  { // Rebuild m_polymapping.
397  const int sz = (int)m_elems.size();
398  for (int i = 0; i < sz; i++)
399  {
400  m_polymapping[m_elems[i]->GetMapIndex()] = i;
401  }
402  }

References m_elems, and m_polymapping.

◆ 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

5398 {
5404  int day = SupplyDayInYear();
5405  m_elems[m_polymapping[a_polyref]]->SetGooseNos(a_number, day);
5406 }

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()

5411 {
5416  int day = SupplyDayInYear();
5417  m_elems[m_polymapping[a_polyref]]->SetGooseNosTimed(a_number, day);
5418 }

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.

5442  {
5446  m_elems[m_polymapping[a_polyref]]->SetGooseRoostDist(a_dist, a_goose);
5447  }

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

5421  {
5428  int day = SupplyDayInYear();
5429  m_elems[m_polymapping[a_polyref]]->SetGooseSpNos(a_number, day, a_goose);
5430  }

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()

5432  {
5438  int day = SupplyDayInYear();
5439  m_elems[m_polymapping[a_polyref]]->SetGooseSpNosTimed(a_number, day, a_goose);
5440  }

References m_polymapping.

◆ ReleasePolygonLock()

void Landscape::ReleasePolygonLock ( int  a_polyref)
inline

Function to release the given polygon locks.

603 { omp_unset_nest_lock(m_poly_omp_locks[a_polyref]); }

References m_poly_omp_locks.

Referenced by Osmia_Population_Manager::CreateNest(), Osmia_Population_Manager::ReleaseOsmiaNest(), and Osmia_Female::st_ReproductiveBehaviour().

◆ RemoveMissingValues()

void Landscape::RemoveMissingValues ( void  )
protected

A method for replacing missing values in the map with corrected ones.

4149 {
4150  bool found; // the flag for something left to work with
4151  int mapwidth = m_land->MapWidth();
4152  int mapheight = m_land->MapHeight();
4153  int counter = 0;
4154  do
4155  {
4156  found = false; counter++;
4157  for (int x = 1; x < mapwidth-1; x++)
4158  {
4159  for (int y = 1; y < mapheight-1; y++)
4160  {
4161  int apoly = m_land->Get(x,y);
4162  if (m_elems[m_polymapping[apoly]]->GetElementType() == tole_Missing)
4163  {
4164  m_land->MissingCellReplace(x, y, true);
4165  }
4166  }
4167  }
4168  counter++;
4169  } while (counter<50);
4170  // Now we only have the edges to deal with
4171  for (int x = 0; x < mapwidth; x++)
4172  {
4173  for (int y = 0; y < mapheight; y++)
4174  {
4175  int apoly = m_land->Get(x, y);
4176  if (m_elems[m_polymapping[apoly]]->GetElementType() == tole_Missing)
4177  {
4178  found = true;
4179  counter++;
4180  m_land->MissingCellReplaceWrap(x, y, true);
4181  }
4182  }
4183  }
4184  // Now we the ones that are not next to fields to deal with
4185 }

References m_polymapping, and tole_Missing.

◆ RemoveNectarFromTotal()

void Landscape::RemoveNectarFromTotal ( int  a_polyref,
double  a_removed_amount 
)
inline

Remove the given amount of nectar from the total amount in the given polygon.

669 {m_elems[a_polyref]->ChangeTotalNectar(a_removed_amount);}

References m_elems.

Referenced by SupplyNectarAtLocInPoly().

◆ RemoveNectarInLoc()

void Landscape::RemoveNectarInLoc ( int  a_x,
int  a_y,
double  a_mount 
)

Remove the foraged ammount of pollen quantity from the cell indexed by a_x, a_y.

3560  {
3561  m_nectar_map(a_y,a_x) -= a_mount;
3562  if(m_nectar_map(a_y,a_x)<0) m_nectar_map(a_y,a_x)=0; //set to zero if negative
3563  RemoveNectarFromTotal(m_land->Get(a_x, a_y), a_mount);
3564 }

◆ RemovePollenFromTotal()

void Landscape::RemovePollenFromTotal ( int  a_polyref,
double  a_removed_amount 
)
inline

Remove the given amount of pollen from the total amount in the given polygon.

675 {m_elems[a_polyref]->ChangeTotalPollen(a_removed_amount);}

References m_elems.

Referenced by SupplyPollenAtLocInPoly().

◆ RemovePollenInLoc()

void Landscape::RemovePollenInLoc ( int  a_x,
int  a_y,
double  a_mount 
)

Remove the foraged ammount of pollen quantity from the cell indexed by a_x, a_y.

3554  {
3555  m_pollen_map(a_y,a_x) -= a_mount;
3556  if(m_pollen_map(a_y,a_x)<0) m_pollen_map(a_y,a_x)=0; //set to zero if negative
3557  RemovePollenFromTotal(m_land->Get(a_x, a_y), a_mount);
3558 }

◆ 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
4243 {
4257  // To be sure we first count the map squares
4258  CountMapSquares();
4259  // Then force the area to match the counted squares
4260  ForceArea();
4261  // Next find polygons that don't match other rules and are single cells - remove these
4262  int removed = 0;
4263  for (int i = 0; i < m_elems.size(); i++)
4264  {
4265  TTypesOfLandscapeElement tole = m_elems[i]->GetElementType();
4266  int area = int(m_elems[i]->GetArea());
4267  if (area == 1)
4268  {
4269  switch (tole)
4270  {
4271  case tole_FieldBoundary:
4272  case tole_HedgeBank:
4273  case tole_Hedges:
4274  case tole_IndividualTree:
4275  case tole_MetalledPath:
4276  case tole_River:
4277  case tole_RiversidePlants:
4278  case tole_RiversideTrees:
4279  case tole_RoadsideSlope:
4280  case tole_RoadsideVerge:
4281  case tole_SmallRoad:
4282  case tole_StoneWall:
4283  case tole_Fence:
4284  case tole_Stream:
4285  case tole_Track:
4287  case tole_WaterBufferZone:
4288  case tole_FlowerStrip:
4290  // These could be part of a bigger polygon, so leave them alone for now.
4291  break;
4292  default:
4293  // Get rid of this one.
4294  APoint pt = m_elems[i]->GetCentroid();
4295  // Just check that the centroid is correct
4296  int poly = m_elems[i]->GetPoly();
4297  if (poly != i)
4298  {
4299  g_msg->Warn(WARN_FILE, "Landscape::RemoveSmallPolygons: Centroid not in polygon: ", i);
4300  exit(99);
4301  }
4302  // The next line just fixes the map, and replaces the cell value
4303  if (m_land->CellReplacementNeighbour(pt.m_x, pt.m_y, poly) == 1) {
4304  // Now we need to remove the polygon. This means we must also rebuild the map later.
4305  m_elems[i]->SetMapValid(false);
4306  removed++;
4307  }
4308  }
4309  }
4310  // Field removal below 100m2
4311  else if (tole == tole_Field)
4312  {
4313  if (area < 100) {
4314  // Need to copy the useful information to new grassland element and switch that one in, removing the field.
4315  NaturalGrass* grass = new NaturalGrass(tole_NaturalGrassDry, this);
4316  grass->DoCopy(m_elems[i]);
4317  grass->SetALMaSSEleType(g_letype->BackTranslateEleTypes(tole_NaturalGrassDry));
4318  grass->SetElementType(tole_NaturalGrassDry);
4319  grass->SetOwner(NULL,-1,-1);
4320  delete m_elems[i]; // remove the old LE
4321  m_elems[i] = dynamic_cast<LE*>(grass);
4322  }
4323  }
4324  }
4326  ChangeMapMapping();
4327  return removed;
4328 }

References LE_TypeClass::BackTranslateEleTypes(), LE::DoCopy(), g_letype, g_msg, APoint::m_x, APoint::m_y, LE::SetOwner(), tole_Fence, tole_Field, tole_FieldBoundary, tole_FlowerStrip, tole_FlowerStripWithRotation, 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, tole_WaterBufferZone, MapErrorMsg::Warn(), and WARN_FILE.

◆ ResetFlowerLocIndex()

void Landscape::ResetFlowerLocIndex ( void  )

The function to reset the index for the indices of the locations with flower resource.

3822  {
3823  for (int i=0; i<m_poly_with_flowers.size(); i++){
3824  int temp_poly_id = m_poly_with_flowers[i];
3825  //first pollen
3826  PollenNectarData temp_pollen = SupplyPollen(temp_poly_id);
3827  if(temp_pollen.m_quantity>0){
3828  m_index_locs_pollen[temp_poly_id] = m_poly_cell_locs_pollen[temp_poly_id].size(); //new day, when there is pollen, it it full
3829  }
3830  else{
3831  m_index_locs_pollen[temp_poly_id] = 0;
3832  }
3833  //second pollen
3834  PollenNectarData temp_nectar = SupplyNectar(temp_poly_id);
3835  if(temp_nectar.m_quantity>0){
3836  m_index_locs_nectar[temp_poly_id] = m_poly_cell_locs_nectar[temp_poly_id].size(); //new day, when there is nectar, it it full
3837  }
3838  else{
3839  m_index_locs_nectar[temp_poly_id] = 0;
3840  }
3841  }
3842 }

References PollenNectarData::m_quantity.

◆ 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.

1692 {
1697  for (unsigned int i = 0; i < m_elems.size(); i++)
1698  {
1699  m_elems[i]->SetBirdSeed(0.0);
1700  m_elems[i]->SetBirdMaize(0.0);
1701  }
1702 }

◆ RodenticidePredatorsEvaluation()

void Landscape::RodenticidePredatorsEvaluation ( RodenticidePredators_Population_Manager *  a_rppm)

Evaluation to find Rodenticide Predator territory.

5103 {
5104  for (unsigned i=0; i<m_elems.size(); i++) {
5105  a_rppm->PreCachePoly(m_elems[i]->GetPoly());
5106  }
5107 }

◆ RunHiddenYear()

void Landscape::RunHiddenYear ( )

The function to generate the vector list of pixies for polygons with flower resource.

2782 {
2783  // Run a year to remove any start up effects
2784  cout << "Running initial start-up year" << endl;
2785  m_firstyear = true;
2786  g_date->Reset2();
2787  for (unsigned int i = 0; i < 365; i++)
2788  {
2789  Tick();
2790  }
2791  m_firstyear = false;
2793 }

References cfg_pesticidetableon, g_date, Calendar::Reset2(), and CfgBool::value().

Referenced by main().

◆ Set_all_Att_UserDefinedBool()

void Landscape::Set_all_Att_UserDefinedBool ( bool(*)(TTypesOfLandscapeElement udf_fnc)
inline

used to classify the userdefinedbool attribute and set it - this requires supplying the correct classification function

932  {
933  for (auto& elem : m_elems)
934 
935  {
936  elem->Set_Att_UserDefinedBool(udf_fnc(elem->GetElementType()));
937  }
938  }

References m_elems.

Referenced by THare_Population_Manager::Init().

◆ Set_all_Att_UserDefinedInt()

void Landscape::Set_all_Att_UserDefinedInt ( int(*)(TTypesOfLandscapeElement udf_fnc)
inline

used to classify the userdefinedint attribute and set it - this requires supplying the correct classification function

942  {
943  for (auto& elem : m_elems)
944 
945  {
946  elem->Set_Att_UserDefinedInt(udf_fnc(elem->GetElementType()));
947  }
948  }

References m_elems.

◆ Set_TOLE_Att()

void Landscape::Set_TOLE_Att ( LE elem)
inline

Uses a point to an LE instance and sets all the attributes based on its tole type.

Sets attribute to high

Sets attribute to water

Sets attribute to urban areas without vegetation

Sets attribute to woodland

Sets attribute to woody

965  {
967  elem->Set_Att_High(ClassificationHigh(elem->GetElementType()));
969  elem->Set_Att_Water(ClassificationWater(elem->GetElementType()));
971  elem->Set_Att_UrbanNoVeg(ClassificationUrbanNoVeg(elem->GetElementType()));
973  elem->Set_Att_Forest(ClassificationForest(elem->GetElementType()));
975  elem->Set_Att_Woody(ClassificationWoody(elem->GetElementType()));
976  }

References ClassificationForest(), ClassificationHigh(), ClassificationUrbanNoVeg(), ClassificationWater(), ClassificationWoody(), LE::Set_Att_Forest(), LE::Set_Att_High(), LE::Set_Att_UrbanNoVeg(), LE::Set_Att_Water(), and LE::Set_Att_Woody().

◆ Set_TOV_Att()

void Landscape::Set_TOV_Att ( LE elem)
inline

Uses a point to an LE instance and sets all the attributes based on its tov type.

Sets attribute to grass vegetation

Sets attribute to grass vegetation for geese

Sets attribute to cereal

Sets attribute to mature cereal

Sets attribute to maize

980  {
981  // patchy is set other places for now
983  elem->Set_Att_VegGrass(ClassificationVegGrass(elem->GetVegType()));
985  elem->Set_Att_VegGooseGrass(ClassificationVegGooseGrass(elem->GetVegType()));
987  elem->Set_Att_VegCereal(ClassificationVegCereal(elem->GetVegType()));
989  elem->Set_Att_VegMatureCereal(ClassificationVegMatureCereal(elem->GetVegType()));
991  elem->Set_Att_VegMaize(ClassificationVegMaize(elem->GetVegType()));
992  }

References ClassificationVegCereal(), ClassificationVegGooseGrass(), ClassificationVegGrass(), ClassificationVegMaize(), ClassificationVegMatureCereal(), LE::Set_Att_VegCereal(), LE::Set_Att_VegGooseGrass(), LE::Set_Att_VegGrass(), LE::Set_Att_VegMaize(), and LE::Set_Att_VegMatureCereal().

◆ SetAttUserDefinedBool()

void Landscape::SetAttUserDefinedBool ( int  a_polyref,
bool  a_value 
)
inline

Sets the user defined boolean attribute of a polygon using the polygon reference number a_polyref.

914 { m_elems[m_polymapping[a_polyref]]->Set_Att_UserDefinedBool(a_value); }

References m_elems, and m_polymapping.

◆ SetAttUserDefinedInt()

void Landscape::SetAttUserDefinedInt ( int  a_polyref,
int  a_value 
)
inline

ets the user defined integer attribute of a polygon using the polygon reference number a_polyref

916 { m_elems[m_polymapping[a_polyref]]->Set_Att_UserDefinedInt(a_value); }

References m_elems, and m_polymapping.

◆ SetBirdMaizeForage()

void Landscape::SetBirdMaizeForage ( int  a_polyref,
double  a_fooddensity 
)
inline

Sets the maize forage resource as seen from a goose standpoint at a polygon.

1071  {
1072  m_elems[m_polymapping[a_polyref]]->SetBirdMaize(a_fooddensity);
1073  }

References m_elems, and m_polymapping.

◆ SetBirdSeedForage()

void Landscape::SetBirdSeedForage ( int  a_polyref,
double  a_fooddensity 
)
inline

Sets the grain forage resource as seen from a goose standpoint at a polygon.

1067  {
1068  m_elems[m_polymapping[a_polyref]]->SetBirdSeed(a_fooddensity);
1069  }

References m_elems, and m_polymapping.

◆ SetCountryCode()

void Landscape::SetCountryCode ( std::string  country_code)
inline

Sets m_countryCode, e.g. "DK" for Denmark.

593 { m_countryCode = country_code; };

References m_countryCode.

◆ SetGrainDist()

void Landscape::SetGrainDist ( int  a_dist)
inline

Sets m_grain_dist, a binary condition for good or bad years of spilled grain.

1064 { m_grain_dist = a_dist; }

References m_grain_dist.

◆ SetGreenBiomassMap()

void Landscape::SetGreenBiomassMap ( int  a_poly_id,
double  a_green_biomass,
int  a_min_x,
int  a_min_y,
int  a_max_x,
int  a_max_y 
)

The function to set the green biomass (in kg) for all the cells that belong to the given polygon ID. Used to scale the transfer of pesticide into the plant.

4045  {
4046  m_biomass_map(Eigen::seq(a_min_y, a_max_y), Eigen::seq(a_min_x, a_max_x)) = (m_polyid_map(Eigen::seq(a_min_y, a_max_y), Eigen::seq(a_min_x, a_max_x)) == a_poly_id).select(a_green_biomass/1000, m_biomass_map(Eigen::seq(a_min_y, a_max_y), Eigen::seq(a_min_x, a_max_x)));
4047 }

Referenced by VegElement::RecalculateBugsNStuff().

◆ SetLatitude()

void Landscape::SetLatitude ( double  latitude)
inline

Sets the latitude of the landscape location.

609 { m_latitude = latitude; };

References m_latitude.

◆ SetLESignal()

void Landscape::SetLESignal ( int  a_polyref,
LE_Signal  a_signal 
)

Writes the mask back out to the polygon.

5641  {
5642  m_elems[m_polymapping[a_polyref]]->SetSignal(a_signal);
5643 }

References m_polymapping.

◆ SetLongitude()

void Landscape::SetLongitude ( double  longitude)
inline

Sets the longitude of the landscape location.

611 { m_longitude = longitude; };

References m_longitude.

◆ SetMaleNewtPresent()

void Landscape::SetMaleNewtPresent ( const int  a_InPondIndex)
inline

Sets a male as being present in a pond.

568 { m_elems[a_InPondIndex]->SetMaleNewtPresent(true); }

References m_elems.

◆ SetNectarMap()

void Landscape::SetNectarMap ( int  a_poly_id,
double  a_nectar_quantity,
int  a_min_x,
int  a_min_y,
int  a_max_x,
int  a_max_y 
)

The function to set the nectar quantity for all the cells that belong to the given polygon ID.

4041  {
4042  m_nectar_map(Eigen::seq(a_min_y,a_max_y), Eigen::seq(a_min_x, a_max_x)) = (m_polyid_map(Eigen::seq(a_min_y,a_max_y), Eigen::seq(a_min_x, a_max_x))==a_poly_id).select(a_nectar_quantity, m_nectar_map(Eigen::seq(a_min_y,a_max_y), Eigen::seq(a_min_x, a_max_x)));
4043 }

Referenced by VegElement::RecalculateBugsNStuff().

◆ SetPollenMap()

void Landscape::SetPollenMap ( int  a_poly_id,
double  a_pollen_quantity,
int  a_min_x,
int  a_min_y,
int  a_max_x,
int  a_max_y 
)

The function to set the pollen quantity for all the cells that belong to the given polygon ID.

4037  {
4038  m_pollen_map(Eigen::seq(a_min_y,a_max_y), Eigen::seq(a_min_x, a_max_x)) = (m_polyid_map(Eigen::seq(a_min_y,a_max_y), Eigen::seq(a_min_x, a_max_x))==a_poly_id).select(a_pollen_quantity, m_pollen_map(Eigen::seq(a_min_y,a_max_y), Eigen::seq(a_min_x, a_max_x)));
4039 }

Referenced by VegElement::RecalculateBugsNStuff().

◆ SetPolygonLock()

void Landscape::SetPolygonLock ( int  a_polyref)
inline

Function to set the given polygon lock.

601 { omp_set_nest_lock(m_poly_omp_locks[a_polyref]); }

References m_poly_omp_locks.

Referenced by Osmia_Population_Manager::CreateNest(), Osmia_Population_Manager::ReleaseOsmiaNest(), and Osmia_Female::st_ReproductiveBehaviour().

◆ SetPolymapping()

void Landscape::SetPolymapping ( int  a_index,
int  a_val 
)
inline

Sets an entry in the polymapping to a specific value.

327 { m_polymapping[a_index] = a_val; }

References m_polymapping.

◆ SetPolyMaxMinExtents()

void Landscape::SetPolyMaxMinExtents ( void  )

Sets MapValid as true for each polygon found.

3122 {
3123  // All polygon manipulation is settled now we need to give the polygons some information about themselves
3124  // This takes a little time but save time later one
3125  cout << "Setting max min polygon extents" << endl;
3126  int mwidth = m_land->MapWidth();
3127  int mheight = m_land->MapHeight();
3128  for ( int x = 0; x < mwidth; x++ ) {
3129  for ( int y = 0; y < mheight; y++ ) {
3130  int polyindex = m_land->Get( x, y );
3131  // Mark that we have seen this polygon.
3132  unsigned int ele_ref= polyindex;
3133  if (m_elems[m_polymapping[ele_ref]]->GetMaxX() < x) m_elems[m_polymapping[ele_ref]]->SetMaxX(x);
3134  if (m_elems[m_polymapping[ele_ref]]->GetMaxY() < y) m_elems[m_polymapping[ele_ref]]->SetMaxY(y);
3135  if (m_elems[m_polymapping[ele_ref]]->GetMinX() > x) m_elems[m_polymapping[ele_ref]]->SetMinX(x);
3136  if (m_elems[m_polymapping[ele_ref]]->GetMinY() > y) m_elems[m_polymapping[ele_ref]]->SetMinY(y);
3137  m_elems[m_polymapping[ele_ref]]->SetMapValid(true);
3138  }
3139  }
3140 }

References m_polymapping.

◆ SetSpeciesFunctions()

void Landscape::SetSpeciesFunctions ( TTypesOfPopulation  a_species)

This is the jumping off point for any landscape related species setup, it creates function pointers to these special functions.

7821  {
7822  // SetSpeciesFunction cannot be static - so we need to find an object instead
7823  for (auto& elem : m_elems) {
7824  elem->SetSpeciesFunction(a_species);
7825  }
7826 }

Referenced by CreatePopulationManager(), SubPopulation_Population_Manager::SetNoProbesAndSpeciesSpecificFunctions(), and Population_Manager::SetNoProbesAndSpeciesSpecificFunctions().

◆ SetThePopManagerList()

void Landscape::SetThePopManagerList ( PopulationManagerList a_ptr)
inline

Set the pointer to the list of active population managers.

319 { m_ThePopManagerList = a_ptr; }

References m_ThePopManagerList.

Referenced by main().

◆ SimulationClosingActions()

void Landscape::SimulationClosingActions ( )

These are the things that are needed to be done after the simulation ends, but before landscape objects are deleted.

2935 {
2939  ;
2940 }

Referenced by CloseDownSim().

◆ SkylarkEvaluation()

void Landscape::SkylarkEvaluation ( SkTerritories a_skt)

Evaluation to find Skylark territory.

5095  {
5096  for (unsigned i=0; i<m_elems.size(); i++) {
5097  a_skt->PreCachePoly(m_elems[i]->GetPoly());
5098  }
5099 }

References SkTerritories::PreCachePoly().

Referenced by SkTerritories::PreFillQualGrid().

◆ 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.

1618  {
1619  return dynamic_cast<Pond*>(m_elems[a_polyrefindex])->SubtractLarvalFood(a_food);
1620 }

◆ SupplyAllVegPolys()

list<LE*> Landscape::SupplyAllVegPolys ( )
inline

Creates a vector containing a list of all the polygons that do not have tov_None as the vegetation type.

351  {
352  list<LE*> Plist;
353  for (auto it = m_elems.begin(); it != m_elems.end(); ++it) {
354  if ((*it)->GetVegType() != tov_None) {
355  Plist.push_back(*it);
356  }
357  }
358  return Plist;
359  }

References m_elems, and tov_None.

◆ SupplyARandomLocNectarPoly()

APoint Landscape::SupplyARandomLocNectarPoly ( int  a_poly_id)
inline

The function to get a random location with nectar available for the given polygon.

References m_index_locs_nectar, m_nectar_map, m_poly_cell_locs_nectar, and SupplyARandomLocResourcePoly().

◆ SupplyARandomLocPollenPoly()

APoint Landscape::SupplyARandomLocPollenPoly ( int  a_poly_id)
inline

The function to get a random location with pollen available for the given polygon.

References m_index_locs_pollen, m_pollen_map, m_poly_cell_locs_pollen, and SupplyARandomLocResourcePoly().

Referenced by Osmia_Female::st_ReproductiveBehaviour().

◆ SupplyARandomLocPoly()

APoint Landscape::SupplyARandomLocPoly ( int  a_poly_id)
inline

The function to get a random location for the given poly ID.

263 {return m_poly_cell_locs[a_poly_id][g_random_fnc(static_cast<int>(m_poly_cell_locs[a_poly_id].size()))];}

References g_random_fnc(), and m_poly_cell_locs.

Referenced by Osmia_Population_Manager::Osmia_Population_Manager().

◆ SupplyARandomLocResourcePoly()

APoint Landscape::SupplyARandomLocResourcePoly ( int  a_poly_id,
std::map< int, int > &  a_index_locs,
std::map< int, vector< APoint >> &  a_poly_cell_locs,
Eigen::MatrixXf &  a_prop_map 
)

The function to get a random location for the given resource and the given poly ID.

3844  {
3845  //get the number of cells with pollen, 0 means no pollen
3846  int temp_total_available_cell_num = a_index_locs[a_poly_id];
3847  int temp_cell_index;
3848  int temp_x, temp_y;
3849  if(temp_total_available_cell_num>0){
3850  //there is at least one cell with pollen, get a random one
3851  temp_cell_index = g_random_fnc(temp_total_available_cell_num);
3852  temp_x = a_poly_cell_locs[a_poly_id][temp_cell_index].m_x;
3853  temp_y = a_poly_cell_locs[a_poly_id][temp_cell_index].m_y;
3854  if(a_prop_map(temp_y, temp_x)>0){
3855  return APoint(temp_x, temp_y);
3856  }
3857  else{
3858  //the cell is not available (could be taken by the foragers), get the next one until the end or find one
3859  do{
3860  //first we move the empty cell to the end of the vector and update the index
3861  APoint temp_point = a_poly_cell_locs[a_poly_id][temp_cell_index];
3862  a_poly_cell_locs[a_poly_id][temp_cell_index] = a_poly_cell_locs[a_poly_id][temp_total_available_cell_num-1];
3863  a_poly_cell_locs[a_poly_id][temp_total_available_cell_num-1] = temp_point;
3864  a_index_locs[a_poly_id]--;
3865  temp_total_available_cell_num--;
3866  temp_x = a_poly_cell_locs[a_poly_id][temp_cell_index].m_x;
3867  temp_y = a_poly_cell_locs[a_poly_id][temp_cell_index].m_y;
3868  if(a_prop_map(temp_y, temp_x)>0){
3869  return APoint(temp_x, temp_y);
3870  }
3871  }while(temp_total_available_cell_num>temp_cell_index);
3872  //if we reach here, it means we have reached the end of the vector and still not found a cell with pollen, so we go forward
3873  if(temp_cell_index!=0){
3874  do{
3875  temp_cell_index--;
3876  temp_x = a_poly_cell_locs[a_poly_id][temp_cell_index].m_x;
3877  temp_y = a_poly_cell_locs[a_poly_id][temp_cell_index].m_y;
3878  if(a_prop_map(temp_y, temp_x)>0){
3879  return APoint(temp_x, temp_y);
3880  }
3881  a_index_locs[a_poly_id]--;
3882  temp_total_available_cell_num--;
3883  }while(temp_cell_index>0);
3884  }
3885  //if we reach here, it means we have searched the whold vector and still not found a cell with pollen, so we return a point with negative coordinates
3886  return APoint(-1,-1);
3887  }
3888  }
3889  else{
3890  return APoint(-1,-1); //no available pollen, return a point with negative coordinates
3891  }
3892 }

References g_random_fnc(), and APoint::m_x.

Referenced by SupplyARandomLocNectarPoly(), and SupplyARandomLocPollenPoly().

◆ SupplyAttIsForest() [1/2]

bool Landscape::SupplyAttIsForest ( int  a_polyref)
inline

Returns whether a polygon at coordinates a_x, a_y has the attribute Forest set.

883 { return m_elems[m_polymapping[a_polyref]]->Is_Att_Forest(); }

References m_elems, and m_polymapping.

◆ SupplyAttIsForest() [2/2]

bool Landscape::SupplyAttIsForest ( int  a_x,
int  a_y 
)
inline

Returns whether a polygon at coordinates a_x, a_y has the attribute Forest set.

881 { return m_elems[m_land->Get(a_x, a_y)]->Is_Att_Forest(); }

References RasterMap::Get(), m_elems, and m_land.

Referenced by not_nest_friendly(), SkTerritories::PrePoly2Qual(), and SkTerritories::PrePolyNQual().

◆ SupplyAttIsHigh()

bool Landscape::SupplyAttIsHigh ( int  a_x,
int  a_y 
)
inline

Tests whether the polygon at a_x,a_y is designated as xxx.

Returns whether a polygon at coordinates a_x, a_y has the attribute High set

877 { return m_elems[m_land->Get(a_x, a_y)]->Is_Att_High(); }

References RasterMap::Get(), m_elems, and m_land.

Referenced by SupplyLEHigh().

◆ SupplyAttIsUrbanNoVeg() [1/2]

bool Landscape::SupplyAttIsUrbanNoVeg ( int  a_polyref)
inline

Returns whether a polygon at coordinates a_x, a_y, or by a_polyref has the attribute High set.

889 { return m_elems[m_polymapping[a_polyref]]->Is_Att_UrbanNoVeg(); }

References m_elems, and m_polymapping.

◆ SupplyAttIsUrbanNoVeg() [2/2]

bool Landscape::SupplyAttIsUrbanNoVeg ( int  a_x,
int  a_y 
)
inline

Returns whether a polygon at coordinates a_x, a_y, or by a_polyref has the attribute High set.

887 { return m_elems[m_land->Get(a_x, a_y)]->Is_Att_UrbanNoVeg(); }

References RasterMap::Get(), m_elems, and m_land.

Referenced by SkTerritories::PrePoly2Qual(), and SkTerritories::PrePolyNQual().

◆ SupplyAttIsVegCereal()

bool Landscape::SupplyAttIsVegCereal ( int  a_polyref)
inline

Returns whether a polygon at coordinates a_x, a_y, or by a_polyref has the attribute Is Cereal set.

895 { return m_elems[m_polymapping[a_polyref]]->Is_Att_VegCereal(); }

References m_elems, and m_polymapping.

◆ SupplyAttIsVegGooseGrass()

bool Landscape::SupplyAttIsVegGooseGrass ( int  a_polyref)
inline

Returns whether a polygon a_polyref has the attribute Is Goose Grass set.

903 { return m_elems[m_polymapping[a_polyref]]->Is_Att_VegGooseGrass(); }

References m_elems, and m_polymapping.

◆ SupplyAttIsVegGrass() [1/2]

bool Landscape::SupplyAttIsVegGrass ( int  a_polyref)
inline

Returns whether a polygon a_polyref has the attribute Is Grass set.

899 { return m_elems[m_polymapping[a_polyref]]->Is_Att_VegGrass(); }

References m_elems, and m_polymapping.

Referenced by Oedothorax_Juvenile::CheckToleTovIndex().

◆ SupplyAttIsVegGrass() [2/2]

bool Landscape::SupplyAttIsVegGrass ( int  a_x,
int  a_y 
)
inline

Returns whether a polygon a_polyref has the attribute Is Grass set.

901 { return m_elems[m_land->Get(a_x, a_y)]->Is_Att_VegGrass(); }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyAttIsVegMaize()

bool Landscape::SupplyAttIsVegMaize ( int  a_polyref)
inline

Returns whether a polygon a_polyref has the attribute Is Maize set.

905 { return m_elems[m_polymapping[a_polyref]]->Is_Att_VegMaize(); }

References m_elems, and m_polymapping.

◆ SupplyAttIsVegMatureCereal()

bool Landscape::SupplyAttIsVegMatureCereal ( int  a_polyref)
inline

Returns whether a polygon at coordinates a_x, a_y, or by a_polyref has the attribute Is Mature Cereal set.

897 { return m_elems[m_polymapping[a_polyref]]->Is_Att_VegMatureCereal(); }

References m_elems, and m_polymapping.

◆ SupplyAttIsVegPatchy() [1/2]

bool Landscape::SupplyAttIsVegPatchy ( int  a_polyref)
inline

Returns whether a polygon at coordinates a_x, a_y, or by a_polyref has the attribute Is Patchy set.

891 { return m_elems[m_polymapping[a_polyref]]->Is_Att_VegPatchy(); }

References m_elems, and m_polymapping.

Referenced by SupplyVegPatchy().

◆ SupplyAttIsVegPatchy() [2/2]

bool Landscape::SupplyAttIsVegPatchy ( int  a_x,
int  a_y 
)
inline

Returns whether a polygon at coordinates a_x, a_y, or by a_polyref has the attribute Is Patchy set.

893 { return m_elems[m_land->Get(a_x, a_y)]->Is_Att_VegPatchy(); };

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyAttIsWater()

bool Landscape::SupplyAttIsWater ( int  a_x,
int  a_y 
)
inline

Returns whether a polygon at coordinates a_x, a_y has the attribute Water set.

879 { return m_elems[m_land->Get(a_x, a_y)]->Is_Att_Water(); }

References RasterMap::Get(), m_elems, and m_land.

Referenced by hare_tole_can_walkacross(), hare_tole_init_friendly(), spider_tole_egss_position_valid(), spider_tole_juvenile_maturation_valid(), and spider_tole_lethal().

◆ SupplyAttIsWoody()

bool Landscape::SupplyAttIsWoody ( int  a_x,
int  a_y 
)
inline

Returns whether a polygon at coordinates a_x, a_y has the attribute Woody.

885 { return m_elems[m_land->Get(a_x, a_y)]->Is_Att_Woody(); }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyAttUserDefinedBool() [1/2]

bool Landscape::SupplyAttUserDefinedBool ( int  a_polyref)
inline

Returns the user defined boolean attribute of a polygon using the polygon reference number a_polyref, or coordinates a_x, a_y.

908 { return m_elems[m_polymapping[a_polyref]]->Is_Att_UserDefinedBool(); }

References m_elems, and m_polymapping.

Referenced by THare_Population_Manager::Init().

◆ SupplyAttUserDefinedBool() [2/2]

bool Landscape::SupplyAttUserDefinedBool ( int  a_x,
int  a_y 
)
inline

Returns the user defined boolean attribute of a polygon using the polygon reference number a_polyref, or coordinates a_x, a_y.

910 { return m_elems[m_land->Get(a_x, a_y)]->Is_Att_UserDefinedBool(); }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyAttUserDefinedInt()

int Landscape::SupplyAttUserDefinedInt ( int  a_polyref)
inline

Returns the user defined integer attribute of a polygon using the polygon reference number a_polyref.

912 { return m_elems[m_polymapping[a_polyref]]->Is_Att_UserDefinedInt(); }

References m_elems, and m_polymapping.

◆ SupplyBirdMaizeForage() [1/2]

double Landscape::SupplyBirdMaizeForage ( int  a_polyref)
inline

Returns the maize forage resource.

1162  {
1163  return m_elems[m_polymapping[a_polyref]]->GetBirdMaize();
1164  }

References m_elems, and m_polymapping.

◆ 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.

1174  {
1175  return m_elems[m_land->Get(a_x, a_y)]->GetBirdMaize();
1176  }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyBirdSeedForage() [1/2]

double Landscape::SupplyBirdSeedForage ( int  a_polyref)
inline

Returns the grain forage resource.

1149  {
1150  return m_elems[m_polymapping[a_polyref]]->GetBirdSeed();
1151  }

References m_elems, and m_polymapping.

◆ SupplyBirdSeedForage() [2/2]

double Landscape::SupplyBirdSeedForage ( int  a_x,
int  a_y 
)
inline

Returns the grain forage resource as seen from a goose standpoint at an x,y location.

1156  {
1157  return m_elems[m_polymapping[m_land->Get(a_x, a_y)]]->GetBirdSeed();
1158  }

References RasterMap::Get(), m_elems, m_land, and m_polymapping.

◆ SupplyCentroid()

APoint Landscape::SupplyCentroid ( int  a_polyref)

Returns the centroid of a polygon using the polygon reference number a_polyref.

1758  {
1759  return m_elems[ m_polymapping[ a_polyref ] ]->GetCentroid();
1760 }

References m_polymapping.

◆ SupplyCentroidIndex()

APoint Landscape::SupplyCentroidIndex ( int  a_polyrefindex)

Returns the centroid of a polygon using the polygon index in m_elems.

1763  {
1764  return m_elems[ a_polyrefindex ]->GetCentroid();
1765 }

◆ SupplyCentroidX() [1/2]

int Landscape::SupplyCentroidX ( int  a_polyref)
inline

Returns the centroid x-coordinate of a polygon using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

826  {
827  return m_elems[m_polymapping[a_polyref]]->GetCentroidX();
828  }

References m_elems, and m_polymapping.

◆ SupplyCentroidX() [2/2]

int Landscape::SupplyCentroidX ( int  a_x,
int  a_y 
)
inline

Returns the centroid x-coordinate of a polygon using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

832 { return m_elems[m_land->Get(a_x, a_y)]->GetCentroidX(); }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyCentroidY() [1/2]

int Landscape::SupplyCentroidY ( int  a_polyref)
inline

Returns the centroid y-coordinate of a polygon using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

830 { return m_elems[m_polymapping[a_polyref]]->GetCentroidY(); }

References m_elems, and m_polymapping.

◆ SupplyCentroidY() [2/2]

int Landscape::SupplyCentroidY ( int  a_x,
int  a_y 
)
inline

Returns the centroid y-coordinate of a polygon using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

834 { return m_elems[m_land->Get(a_x, a_y)]->GetCentroidY(); }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyCountryCode()

std::string Landscape::SupplyCountryCode ( )
inline

Returns m_countryCode, e.g. "DK" for Denmark.

582 { return m_countryCode; };

References m_countryCode.

◆ SupplyCountryDesig()

int Landscape::SupplyCountryDesig ( int  a_x,
int  a_y 
)
inline

Returns the designation of country or urban of the polygon using coordinates a_x, a_y.

1758 {
1759  return m_elems[ m_land->Get( a_x, a_y ) ]->GetCountryDesignation();
1760 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyCropType() [1/2]

TTypesOfCrops Landscape::SupplyCropType ( int  a_x,
int  a_y 
)
inline

Returns the crop type of the polygon using the polygon reference number a_polyref or coordinates a_x, a_y. Returns the value as a # TTypesOfCrops.

1932 {
1933  return m_elems[ m_land->Get( a_x, a_y ) ]->GetCropType();
1934 }

References RasterMap::Get(), m_elems, and m_land.

Referenced by Aphid::calSuitabilityShared(), THare::ForageSquare(), THare::ForageSquareP(), spider_toc_index(), Hare_Juvenile::st_Dispersal(), vole_tole_move_quality(), and vole_toletoc_asses_habitat_score().

◆ SupplyCropType() [2/2]

TTypesOfCrops Landscape::SupplyCropType ( int  polyref)
inline

Returns the crop type of the polygon using the polygon reference number a_polyref or coordinates a_x, a_y. Returns the value as a # TTypesOfCrops.

1844 {
1845  return m_elems[ m_polymapping[ a_polyref ] ]->GetCropType();
1846 }

References m_elems, and m_polymapping.

◆ SupplyDayDegrees()

double Landscape::SupplyDayDegrees ( int  a_polyref)
inline

Passes a request on to the associated Weather class function, the day degrees for all dates.

1937 {
1938  return m_elems[ m_polymapping[ a_polyref ]]->GetDayDegrees();
1939 }

References m_elems, and m_polymapping.

◆ SupplyDayInMonth()

int Landscape::SupplyDayInMonth ( void  )
inline

Passes a request on to the associated Calendar class function, returns m_day_in_month

2278 {
2279  return g_date->GetDayInMonth();
2280 }

References g_date, and Calendar::GetDayInMonth().

Referenced by Population_Manager::BeginningOfMonth(), TPredator_Population_Manager::PredSampleFile(), Population_Manager::Run(), and RunTheSim().

◆ SupplyDayInYear()

int Landscape::SupplyDayInYear ( void  )
inline

Passes a request on to the associated Calendar class function, the day in the year.

2268 {
2269  return g_date->DayInYear();
2270 }

References Calendar::DayInYear(), and g_date.

Referenced by Weasel::BeginStep(), Owl::BeginStep(), Beetle_Larvae::BeginStep(), Beetle_Pupae::BeginStep(), Hare_Male::BeginStep(), Hare_Female::BeginStep(), Erigone_Population_Manager::Catastrophe(), Oedothorax_Population_Manager::Catastrophe(), Vole_Population_Manager::Catastrophe(), Skylark_Population_Manager::Catastrophe(), THare_Population_Manager::Catastrophe(), Beetle_Population_Manager::Catastrophe(), Beetle_Population_Manager::Catastrophe2(), Bembidion_Population_Manager::CreateObjects(), PoecilusCupreus_Population_Manager::CreateObjects(), Ladybird_Population_Manager::CreateObjects(), Beetle_Population_Manager::DoBeetleActiveProbe(), Osmia_Population_Manager::DoBefore(), Erigone_Population_Manager::DoFirst(), Oedothorax_Population_Manager::DoFirst(), Vole_Population_Manager::DoFirst(), Bembidion_Population_Manager::DoFirst(), Skylark_Population_Manager::DoFirst(), THare_Population_Manager::DoFirst(), Beetle_Population_Manager::DoFirst(), Osmia_Population_Manager::DoLast(), THare_Population_Manager::DoLast(), Hare_Female::dumpEnergy(), Vole_JuvenileMale::EndStep(), Vole_Male::EndStep(), Vole_JuvenileFemale::EndStep(), THare_Population_Manager::ExtraPopMort(), Vole_Population_Manager::GeneticsOutputFile(), Hare_Male::InternalPesticideHandlingAndResponse(), Hare_Female::InternalPesticideHandlingAndResponse(), THare_Population_Manager::MRROutputs(), Skylark_Nestling::OnDeserted(), Skylark_Female::OnMateDying(), Skylark_Male::OnMateDying(), Skylark_Female::OnMateHomeless(), Skylark_Male::OnMateLeaving(), Skylark_Nestling::OnYouHaveBeenEaten(), VoleSummaryOutput::OPrint(), THare_Population_Manager::POMOutputs(), TPredator_Population_Manager::PredAutumnSample(), TPredator_Population_Manager::PredSampleFile(), TPredator_Population_Manager::PredSpringAutumnSample(), TPredator_Population_Manager::PredSpringSample(), Spider_Egg::ReInit(), Vole_Population_Manager::ResistanceOutput(), TPredator_Population_Manager::Run(), SubPopulation_Population_Manager::Run(), Population_Manager::Run(), Hare_Juvenile::ShouldMature(), Spider_Egg::Spider_Egg(), Skylark_Male::st_AttractingAMate(), Skylark_Female::st_BuildingUpResources(), Skylark_Clutch::st_Developing(), Skylark_Nestling::st_Developing(), Skylark_Female::st_Dying(), Skylark_Female::st_Emigrating(), Skylark_Male::st_Emigrating(), Skylark_Female::st_Floating(), Skylark_Male::st_Floating(), Skylark_Female::st_Flocking(), Skylark_Male::st_Flocking(), Vole_Female::st_GiveBirth(), Skylark_Female::st_GivingUpTerritory(), Skylark_Female::st_Laying(), Skylark_Female::st_MakingNest(), Vole_Male::st_Maturation(), Skylark_Female::st_PreparingForBreeding(), Skylark_Female::st_StartingNewBrood(), Skylark_Female::st_StoppingBreeding(), Skylark_Female::Step(), Vole_Population_Manager::TheAgeSexLocationProbe(), Vole_Population_Manager::TheReallyBigOutputProbe(), Vole_Population_Manager::TheSexRatiosProbe(), Aphid_Population_Manager::updateDevelopmentSeason(), and Hare_Female::UpdateOestrous().

◆ SupplyDaylength() [1/2]

int Landscape::SupplyDaylength ( long  a_date)
inline

Passes a request on to the associated Calendar class function, the day length.

2197 {
2198  return g_date->DayLength( a_date );
2199 }

References Calendar::DayLength(), and g_date.

◆ SupplyDaylength() [2/2]

◆ SupplyDaylightProp()

double Landscape::SupplyDaylightProp ( )
inline

Passes a request on to the associated Calendar class function, returns m_daylightproportion

1455 { return g_date->GetDaylightProportion(); }

References g_date, and Calendar::GetDaylightProportion().

◆ SupplyDeadBiomass() [1/2]

double Landscape::SupplyDeadBiomass ( int  a_polyref)
inline

Returns the dead biomass of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

1653 {
1654  return m_elems[ m_polymapping[ a_polyref ]]->GetDeadBiomass();
1655 }

References m_elems, and m_polymapping.

Referenced by Aphid::doReproduction(), and Pesticide::RecordAllPesticideCompartments().

◆ SupplyDeadBiomass() [2/2]

double Landscape::SupplyDeadBiomass ( int  a_x,
int  a_y 
)
inline

Returns the dead biomass of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

1658 {
1659  return m_elems[ m_land->Get( a_x, a_y ) ]->GetDeadBiomass();
1660 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyElementSubType() [1/2]

int Landscape::SupplyElementSubType ( int  a_polyref)
inline

Returns the landscape element sub-type of the polygon using the polygon reference number a_polyref or coordinates a_x, a_y.

1748 {
1749  return m_elems[ m_polymapping[ a_polyref ]]->GetSubType();
1750 }

References m_elems, and m_polymapping.

◆ SupplyElementSubType() [2/2]

int Landscape::SupplyElementSubType ( int  a_x,
int  a_y 
)
inline

Returns the landscape element sub-type of the polygon using the polygon reference number a_polyref or coordinates a_x, a_y.

1753 {
1754  return m_elems[ m_land->Get( a_x, a_y ) ]->GetSubType();
1755 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyElementType() [1/2]

TTypesOfLandscapeElement Landscape::SupplyElementType ( int  a_polyref)
inline

◆ SupplyElementType() [2/2]

TTypesOfLandscapeElement Landscape::SupplyElementType ( int  a_x,
int  a_y 
)
inline

Returns the landscape type of the polygon using the polygon reference number a_polyref or coordinates a_x, a_y. Returns the value as a TTypesOfLandscapeElement.

1738 {
1739  return m_elems[m_land->Get(a_x, a_y)]->GetElementType();
1740 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyElementTypeCC()

TTypesOfLandscapeElement Landscape::SupplyElementTypeCC ( int  a_x,
int  a_y 
)
inline

Returns the landscape type of the polygon using coordinates a_x, a_y, but allowing correction of coordinates for out of scope values. Returns the value as a TTypesOfLandscapeElement.

1764 {
1765  a_x = (a_x + m_width10) % m_width;
1766  a_y = (a_y + m_height10) % m_height;
1767  return m_elems[ m_land->Get( a_x, a_y ) ]->GetElementType();
1768 }

References RasterMap::Get(), m_elems, m_height, m_height10, m_land, m_width, and m_width10.

◆ SupplyElementTypeFromVector()

TTypesOfLandscapeElement Landscape::SupplyElementTypeFromVector ( unsigned int  a_index)
inline

Gets the TTypesOfVegetation type of a polygon using the m_elems.

1728 {
1729  return m_elems[ a_index ]->GetElementType();
1730 }

References m_elems.

Referenced by BorderTest(), Pesticide::DiffusionMatrixInit(), Osmia_Nest_Manager::InitOsmiaBeeNesting(), vole_tole_move_quality(), and vole_toletoc_asses_habitat_score().

◆ SupplyFarmArea()

int Landscape::SupplyFarmArea ( int  a_polyref)
inline

Returns the farm area of a farm that owns a particular polygon.

1826 {
1827  return m_elems[ m_polymapping[ a_polyref ]]->GetOwner()->GetArea();
1828 }

References m_elems, and m_polymapping.

◆ SupplyFarmIntensity() [1/2]

double Landscape::SupplyFarmIntensity ( int  a_polyref)

Returns the farm intensity classification of the polygon using the polygon reference number a_polyref or coordinates a_x, a_y.

1751  {
1752  Farm* fptr = m_elems[m_polymapping[a_polyref]]->GetOwner();
1753  if (fptr != nullptr) return fptr->GetIntensity();
1754  return 0.0;
1755 }

References Farm::GetIntensity(), and m_polymapping.

◆ SupplyFarmIntensity() [2/2]

double Landscape::SupplyFarmIntensity ( int  a_x,
int  a_y 
)

Returns the farm intensity classification of the polygon using the polygon reference number a_polyref or coordinates a_x, a_y.

1746  {
1747  return m_elems[ m_land->Get( a_x, a_y ) ]->GetOwner()->GetIntensity();
1748 }

Referenced by VegElement::DoDevelopment(), and VegElement::RecalculateBugsNStuff().

◆ SupplyFarmIntensityI()

double Landscape::SupplyFarmIntensityI ( int  a_polyindex)

Returns the farm intensity classification of the polygon using the polygon index in m_elems.

1741  {
1742  return m_elems[ a_polyindex ]->GetOwner()->GetIntensity();
1743 }

◆ SupplyFarmManagerPtr()

FarmManager* Landscape::SupplyFarmManagerPtr ( )
inline

Returns m_FarmManager, the pointer to the farm manager instance.

574 { return m_FarmManager; }

References m_FarmManager.

◆ SupplyFarmOwner() [1/2]

int Landscape::SupplyFarmOwner ( int  a_polyref)
inline

Returns the farm owner pointer for the polygon referenced by a_polyref or a_x, a_y.

1779 {
1780  return m_elems[ m_polymapping[ a_polyref ]]->GetOwnerFile();
1781 }

References m_elems, and m_polymapping.

◆ SupplyFarmOwner() [2/2]

int Landscape::SupplyFarmOwner ( int  a_x,
int  a_y 
)
inline

Returns the farm owner pointer for the polygon referenced by a_polyref or a_x, a_y.

1774  {
1775  return m_elems[ m_land->Get( a_x, a_y ) ]->GetOwnerFile();
1776 }

References RasterMap::Get(), m_elems, and m_land.

Referenced by Skylark_Population_Manager::BreedingPairsOutput(), Beetle_Population_Manager::Probe(), and TAnimal::SupplyFarmOwnerRef().

◆ SupplyFarmOwnerIndex() [1/2]

int Landscape::SupplyFarmOwnerIndex ( int  a_polyref)
inline

Returns the farm owner reference number for the polygon referenced by a_polyref or a_x, a_y.

1789 {
1790  return m_elems[ m_polymapping[ a_polyref ]]->GetOwnerIndex();
1791 }

References m_elems, and m_polymapping.

◆ SupplyFarmOwnerIndex() [2/2]

int Landscape::SupplyFarmOwnerIndex ( int  a_x,
int  a_y 
)
inline

Returns the farm owner reference number for the polygon referenced by a_polyref or a_x, a_y.

1784 {
1785  return m_elems[ m_land->Get( a_x, a_y ) ]->GetOwnerIndex();
1786 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyFarmPtr()

Farm* Landscape::SupplyFarmPtr ( int  a_owner)
inline

Returns a pointer to a farm owned by a farmer with a specific farm reference number.

572 { return m_FarmManager->GetFarmPtr(a_owner); }

References FarmManager::GetFarmPtr(), and m_FarmManager.

◆ SupplyFarmRotFilename() [1/2]

string Landscape::SupplyFarmRotFilename ( int  a_polyref)
inline

Returns filename for the rotation file (if any) for the polygon referenced by a_polyref or a_x, a_y.

1805 {
1806 
1807  return m_elems[m_polymapping[a_polyref]]->GetOwner()->GetRotFilename();
1808 
1809 }

References m_elems, and m_polymapping.

◆ SupplyFarmRotFilename() [2/2]

string Landscape::SupplyFarmRotFilename ( int  a_x,
int  a_y 
)
inline

Returns filename for the rotation file (if any) for the polygon referenced by a_polyref or a_x, a_y.

1813 {
1814 
1815  return m_elems[m_land->Get(a_x, a_y)]->GetOwner()->GetRotFilename();
1816 
1817 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyFarmType() [1/2]

TTypesOfFarm Landscape::SupplyFarmType ( int  a_polyref)
inline

Returns the farm type for the polygon referenced by a_polyref or a_x, a_y.

1794 {
1795  return m_elems[ m_polymapping[ a_polyref ]]->GetOwner()->GetType();
1796 }

References m_elems, and m_polymapping.

◆ SupplyFarmType() [2/2]

TTypesOfFarm Landscape::SupplyFarmType ( int  a_x,
int  a_y 
)
inline

Returns the farm type for the polygon referenced by a_polyref or a_x, a_y.

1799 {
1800  return m_elems[ m_land->Get( a_x, a_y ) ]->GetOwner()->GetType();
1801 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyGlobalDate()

long Landscape::SupplyGlobalDate ( void  )
inline

Passes a request on to the associated Calendar class function, returns the simulation global date for the day, month and year supplied.

2293 {
2294  return g_date->Date();
2295 }

References Calendar::Date(), and g_date.

Referenced by Erigone_Population_Manager::DoFirst(), Oedothorax_Population_Manager::DoFirst(), Vole_Population_Manager::DoFirst(), and Skylark_Female::st_PreparingForBreeding().

◆ SupplyGlobalRadiation() [1/2]

double Landscape::SupplyGlobalRadiation ( )
inline

Passes a request on to the associated Weather class function, the global amount of sunshine for the current day.

1952 {
1953  return g_weather->GetGlobalRadiation( );
1954 }

References g_weather, and Weather::GetGlobalRadiation().

Referenced by VegElement::RecalculateBugsNStuff().

◆ SupplyGlobalRadiation() [2/2]

double Landscape::SupplyGlobalRadiation ( long  a_date)
inline

Passes a request on to the associated Weather class function, the global mean amount of sunshine for the current day.

1957 {
1958  return g_weather->GetGlobalRadiation( a_date );
1959 }

References g_weather, and Weather::GetGlobalRadiation().

◆ 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
1076  {
1082  if (a_goose == gs_Pinkfoot)
1083  {
1084  return m_GooseIntakeRateVSVegetationHeight_PF->GetY(a_height);
1085  }
1086  if (a_goose == gs_Barnacle)
1087  {
1088  if (a_height == 0.0) return 0.0;
1089  else return m_GooseIntakeRateVSVegetationHeight_BG->GetY(a_height);
1090  }
1091  if (a_goose == gs_Greylag)
1092  {
1093  return m_GooseIntakeRateVSVegetationHeight_GL->GetY(a_height);
1094  }
1095  Warn("Landscape::SupplyGooseGrazingForage", "Unknown Goose Type");
1096  exit(1);
1097  }

References CurveClass::GetY(), m_GooseIntakeRateVSVegetationHeight_BG, m_GooseIntakeRateVSVegetationHeight_GL, m_GooseIntakeRateVSVegetationHeight_PF, and Warn().

Referenced by VegElement::CalcGooseForageResources().

◆ 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
1102  {
1108  if (a_goose == gs_Pinkfoot)
1109  {
1110  return m_GooseIntakeRateVSVegetationHeight_PF->GetY(m_elems[m_polymapping[a_polygon]]->GetVegHeight());
1111  }
1112  if (a_goose == gs_Barnacle)
1113  {
1114  return m_GooseIntakeRateVSVegetationHeight_BG->GetY(m_elems[m_polymapping[a_polygon]]->GetVegHeight());
1115  }
1116  if (a_goose == gs_Greylag)
1117  {
1118  return m_GooseIntakeRateVSVegetationHeight_GL->GetY(m_elems[m_polymapping[a_polygon]]->GetVegHeight());
1119  }
1120  Warn("Landscape::SupplyGooseGrazingForage", "Unknown Goose Type");
1121  exit(1);
1122  }

References CurveClass::GetY(), m_elems, m_GooseIntakeRateVSVegetationHeight_BG, m_GooseIntakeRateVSVegetationHeight_GL, m_GooseIntakeRateVSVegetationHeight_PF, m_polymapping, and Warn().

◆ SupplyGrainDist()

int Landscape::SupplyGrainDist ( )
inline

Returns m_grain_dist, a binary condition for good or bad years of spilled grain.

1062 { return m_grain_dist; }

References m_grain_dist.

◆ SupplyGrazingPressure() [1/2]

int Landscape::SupplyGrazingPressure ( int  a_polyref)
inline

Returns the grazing pressure of the polygon using the polygon reference number a_polyref or coordinates a_x, a_y.

1849 {
1850  return m_elems[ m_polymapping[ a_polyref ] ]->GetCattleGrazing();
1851 }

References m_elems, and m_polymapping.

Referenced by Skylark_Clutch::OnFarmEvent(), and Skylark_Nestling::OnFarmEvent().

◆ SupplyGrazingPressure() [2/2]

int Landscape::SupplyGrazingPressure ( int  a_x,
int  a_y 
)
inline

Returns the grazing pressure of the polygon using the polygon reference number a_polyref or coordinates a_x, a_y.

1859 {
1860  return m_elems[ m_land->Get( a_x, a_y ) ]->GetCattleGrazing();
1861 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyGrazingPressureVector()

int Landscape::SupplyGrazingPressureVector ( unsigned int  a_index)
inline

Returns the grazing pressure of the polygon using the polygon index to m_elems.

1854 {
1855  return m_elems[ a_index ]->GetCattleGrazing();
1856 }

References m_elems.

Referenced by vole_tole_move_quality(), and vole_toletoc_asses_habitat_score().

◆ SupplyGreenBiomass() [1/2]

double Landscape::SupplyGreenBiomass ( int  a_polyref)
inline

Returns the green biomass of the vegetation using the polygon reference number a_polyref.

1613 {
1614  return m_elems[ m_polymapping[ a_polyref ]]->GetGreenBiomass();
1615 }

References m_elems, and m_polymapping.

Referenced by SubPopulation::calPopuDensity(), Aphid::doReproduction(), Pesticide::RecordAllPesticideCompartments(), and SubPopulation_Population_Manager::Run().

◆ SupplyGreenBiomass() [2/2]

double Landscape::SupplyGreenBiomass ( int  a_x,
int  a_y 
)
inline

Returns the green biomass of the vegetation using the polygon reference number a_polyref.

1618 {
1619  return m_elems[m_land->Get(a_x, a_y)]->GetGreenBiomass();
1620 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyGreenBiomassMapPtr()

Eigen::ArrayXXf* Landscape::SupplyGreenBiomassMapPtr ( )
inline

Returns pointer to the Eigen array for green biomass.

335 { return &m_biomass_map; }

References m_biomass_map.

◆ SupplyGreenBiomassProp() [1/2]

double Landscape::SupplyGreenBiomassProp ( int  a_polyref)
inline

Returns the green biomass as a proportion of biomass of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

1633 {
1634  return m_elems[ m_polymapping[ a_polyref ]]->GetGreenBiomassProp();
1635 }

References m_elems, and m_polymapping.

Referenced by Aphid::calSuitabilityShared(), and Aphid::doReproduction().

◆ SupplyGreenBiomassProp() [2/2]

double Landscape::SupplyGreenBiomassProp ( int  a_x,
int  a_y 
)
inline

Returns the green biomass as a proportion of biomass of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

1638 {
1639  return m_elems[ m_land->Get( a_x, a_y ) ]->GetGreenBiomassProp();
1640 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyGreenBiomassTotal() [1/2]

double Landscape::SupplyGreenBiomassTotal ( int  a_polyref)
inline

Returns the green biomass of the vegetation+weeds using the polygon reference number a_polyref.

1628 {
1629  return m_elems[m_polymapping[a_polyref]]->GetGreenBiomass() + m_elems[m_polymapping[a_polyref]]->GetWeedBiomass();
1630 }

References m_elems, and m_polymapping.

◆ SupplyGreenBiomassTotal() [2/2]

double Landscape::SupplyGreenBiomassTotal ( int  a_x,
int  a_y 
)
inline

Returns the green biomass of the vegetation+weeds using the x,y coordinate.

1623 {
1624  return m_elems[m_land->Get(a_x, a_y)]->GetGreenBiomass() + m_elems[m_land->Get(a_x, a_y)]->GetWeedBiomass();
1625 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyHasTramlines() [1/2]

bool Landscape::SupplyHasTramlines ( int  a_polyref)
inline

Returns whether the polygon referenced by a_polyref or a_x, a_y has a vegetation type with tramlines.

1866 {
1867  return m_elems[ m_polymapping[ a_polyref ] ]->HasTramlines();
1868 }

References m_elems, and m_polymapping.

◆ SupplyHasTramlines() [2/2]

bool Landscape::SupplyHasTramlines ( int  a_x,
int  a_y 
)
inline

Returns whether the polygon referenced by a_polyref or a_x, a_y has a vegetation type with tramlines.

1871 {
1872  return m_elems[ m_land->Get( a_x, a_y ) ]->HasTramlines();
1873 }

References RasterMap::Get(), m_elems, and m_land.

Referenced by Skylark_Adult::GetVegHindrance(), and SkTerritories::PrePolyNQual().

◆ SupplyHour()

int Landscape::SupplyHour ( void  )
inline

Passes a request on to the associated Calendar class function, the hour of the day.

Get the hour of the day.

2257  {
2258  return g_date->GetHour();
2259 }

References g_date, and Calendar::GetHour().

◆ SupplyHumidity()

double Landscape::SupplyHumidity ( void  )
inline

Passes a request on to the associated Weather class function, the mean humidity for the current day.

2040 {
2041  return g_weather->GetHumidity();
2042 }

References g_weather, and Weather::GetHumidity().

◆ SupplyInsects() [1/2]

double Landscape::SupplyInsects ( int  a_polyref)
inline

Returns the insect biomass on a polygon using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

1713 {
1714  return m_elems[ m_polymapping[ a_polyref ]]->GetInsectPop();
1715 }

References m_elems, and m_polymapping.

Referenced by Spider_Juvenile::AssessFood(), and Skylark_Male::GetFood().

◆ SupplyInsects() [2/2]

double Landscape::SupplyInsects ( int  a_x,
int  a_y 
)
inline

Returns the insect biomass on a polygon using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

1718 {
1719  return m_elems[ m_land->Get( a_x, a_y ) ]->GetInsectPop();
1720 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyInStubble()

bool Landscape::SupplyInStubble ( int  a_polyref)
inline

Returns whether its cereal in stubble.

1168  {
1169  return m_elems[m_polymapping[a_polyref]]->GetStubble();
1170  }

References m_elems, and m_polymapping.

◆ SupplyInterestedGreenBiomass() [1/2]

double Landscape::SupplyInterestedGreenBiomass ( int  a_polyref)
inline

Returns the insterested green biomass of the vegetation using the polygon reference number a_polyref.

1593 {
1594  return m_elems[ m_polymapping[ a_polyref ]]->GetInterestedGreenBiomass();
1595 }

References m_elems, and m_polymapping.

◆ SupplyInterestedGreenBiomass() [2/2]

double Landscape::SupplyInterestedGreenBiomass ( int  a_x,
int  a_y 
)
inline

Returns the interested green biomass of the vegetation using the polygon reference number a_polyref.

1598 {
1599  return m_elems[m_land->Get(a_x, a_y)]->GetInterestedGreenBiomass();
1600 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyInterestedGreenBiomassTotal() [1/2]

double Landscape::SupplyInterestedGreenBiomassTotal ( int  a_polyref)
inline

Returns the interested green biomass of the vegetation+weeds using the polygon reference number a_polyref.

1608 {
1609  return m_elems[m_polymapping[a_polyref]]->GetInterestedGreenBiomass() + m_elems[m_polymapping[a_polyref]]->GetWeedBiomass();
1610 }

References m_elems, and m_polymapping.

Referenced by Aphid::calPopuDensity(), Aphid::doReproduction(), and Aphid_Population_Manager::initialiseSimWithEggs().

◆ SupplyInterestedGreenBiomassTotal() [2/2]

double Landscape::SupplyInterestedGreenBiomassTotal ( int  a_x,
int  a_y 
)
inline

Returns the interested green biomass of the vegetation+weeds using the x,y coordinate.

1603 {
1604  return m_elems[m_land->Get(a_x, a_y)]->GetInterestedGreenBiomass() + m_elems[m_land->Get(a_x, a_y)]->GetWeedBiomass();
1605 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyIsCereal2()

bool Landscape::SupplyIsCereal2 ( TTypesOfVegetation  a_vege_type)
inline

Function for backwards code compatibility when cereal attributes would now be used.

1000 { return ClassificationVegCereal(a_vege_type); }

References ClassificationVegCereal().

◆ SupplyIsGrass2()

bool Landscape::SupplyIsGrass2 ( TTypesOfVegetation  a_vege_type)
inline

Function for backwards code compatibility when grass attributes would now be used.

1002 { return ClassificationVegGrass(a_vege_type); }

References ClassificationVegGrass().

◆ SupplyIsHumanDominated()

bool Landscape::SupplyIsHumanDominated ( TTypesOfLandscapeElement  a_tole_type)

For the roe deer, determines the extent of human activity and returns bool.

598 {
599  switch (a_tole_type)
600  {
601  case tole_Railway: //118
602  case tole_Garden: //11//tole20
603  case tole_Track: //123
604  case tole_SmallRoad: //122
605  case tole_LargeRoad: //121
606  case tole_Building: //5
607  case tole_ActivePit: //115
608  case tole_AmenityGrass: //12
609  case tole_Parkland: //14
610  case tole_UrbanNoVeg: //8
611  case tole_UrbanPark: //17
612  case tole_BuiltUpWithParkland: //16
613  case tole_RoadsideSlope: //201
614  case tole_MetalledPath: //202
615  case tole_Carpark: //203
616  case tole_Churchyard: //204
617  case tole_HeritageSite: //208
618  case tole_Wasteland: // 209
619  case tole_PlantNursery: //
620  case tole_Pylon:
621  case tole_WindTurbine:
622  case tole_FishFarm: // 220
623  case tole_UrbanVeg: // Urban vegetated but not garden or park 9
624  case tole_RefuseSite: // 224
625  return true;
626  }
627  return false;
628 }

References tole_ActivePit, tole_AmenityGrass, tole_Building, tole_BuiltUpWithParkland, tole_Carpark, tole_Churchyard, tole_FishFarm, tole_Garden, tole_HeritageSite, tole_LargeRoad, tole_MetalledPath, tole_Parkland, tole_PlantNursery, tole_Pylon, tole_Railway, tole_RefuseSite, tole_RoadsideSlope, tole_SmallRoad, tole_Track, tole_UrbanNoVeg, tole_UrbanPark, tole_UrbanVeg, tole_Wasteland, and tole_WindTurbine.

◆ SupplyIsVeg()

bool Landscape::SupplyIsVeg ( int  a_x,
int  a_y 
)
inline

Indicated if this polygon type is descended from VegElement.

1673 {
1674  return m_elems[m_land->Get(a_x, a_y)]->GetIsVeg();
1675 }

References RasterMap::Get(), m_elems, and m_land.

Referenced by Oedothorax_Juvenile::CheckToleTovIndex().

◆ SupplyJustMown()

bool Landscape::SupplyJustMown ( int  a_polyref)
inline

Returns the whether the vegetation was mown for the polygon referenced by a_polyref or a_x, a_y.

1881 {
1882  return m_elems[ m_polymapping[ a_polyref ] ]->IsRecentlyMown();
1883 }

References m_elems, and m_polymapping.

◆ SupplyJustMownVector()

bool Landscape::SupplyJustMownVector ( unsigned int  a_index)
inline

Returns the whether the vegetation was mown for the polygon referenced the index to Landscape::m_elems.

1876 {
1877  return m_elems[ a_index ]->IsRecentlyMown();
1878 }

References m_elems.

Referenced by vole_tole_move_quality(), and vole_toletoc_asses_habitat_score().

◆ SupplyJustSprayed() [1/2]

int Landscape::SupplyJustSprayed ( int  a_polyref)
inline

Returns whether the polygon referenced by a_polyref or a_x, a_y has been sprayed in the last timestep.

1891 {
1892  return m_elems[ m_polymapping[ a_polyref ] ]->IsRecentlySprayed();
1893 }

References m_elems, and m_polymapping.

◆ SupplyJustSprayed() [2/2]

int Landscape::SupplyJustSprayed ( int  a_x,
int  a_y 
)
inline

Returns whether the polygon referenced by a_polyref or a_x, a_y has been sprayed in the last timestep.

1896 {
1897  return m_elems[ m_land->Get( a_x, a_y ) ]->IsRecentlySprayed();
1898 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyJustSprayedVector()

int Landscape::SupplyJustSprayedVector ( unsigned int  a_index)
inline

Returns whether the polygon referenced by an index to Landscape::m_elems has been sprayed in the last timestep.

1886 {
1887  return m_elems[ a_index ]->IsRecentlySprayed();
1888 }

References m_elems.

Referenced by vole_tole_move_quality().

◆ SupplyLAGreen() [1/2]

double Landscape::SupplyLAGreen ( int  a_polyref)
inline

Returns the green leaf area of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

1663 {
1664  return m_elems[ m_polymapping[ a_polyref ]]->GetLAGreen();
1665 }

References m_elems, and m_polymapping.

◆ SupplyLAGreen() [2/2]

double Landscape::SupplyLAGreen ( int  a_x,
int  a_y 
)
inline

Returns the green leaf area of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

1588 {
1589  return m_elems[ m_land->Get( a_x, a_y ) ]->GetLAGreen();
1590 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyLandscapeName()

string Landscape::SupplyLandscapeName ( )
inline

Returns the current landscape name.

595 { return LandscapeName; }

References LandscapeName.

◆ 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!

1775 {
1784  polylist* p_list = new polylist;
1785  unsigned sz = (unsigned) m_elems.size();
1786  for (unsigned i=0; i<sz; i++)
1787  {
1788  if ( m_elems[i]->GetOpenness() > a_openness)
1789  {
1790  APoint pt = m_elems[i]->GetCentroid();
1791  int dx, dy;
1792  if (a_x>pt.m_x) dx = a_x-pt.m_x; else dx = pt.m_x-a_x;
1793  if (a_y>pt.m_y) dy = a_y-pt.m_y; else dy = pt.m_y-a_y;
1794  dx++; dy++; // prevents crash with maths below.
1796  int dist;
1798  if (dx>dy) dist = dx + (dy * dy) /(2 * dx); else dist = dy + (dx * dx) /(2 * dy);
1799  if (dist<=a_range) p_list->push_back( m_elems[i]->GetPoly());
1800  }
1801  }
1802  return p_list;
1803 }

References APoint::m_x, and APoint::m_y.

◆ SupplyLargestPolyNumUsed()

int Landscape::SupplyLargestPolyNumUsed ( )
inline

◆ SupplyLastSownVeg() [1/2]

TTypesOfVegetation Landscape::SupplyLastSownVeg ( int  a_polyref)
inline

Returns the last type of vegetation sown on a field using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

1693 {
1694  return m_elems[m_polymapping[a_polyref]]->GetLastSownVeg();
1695 }

References m_elems, and m_polymapping.

◆ SupplyLastSownVeg() [2/2]

TTypesOfVegetation Landscape::SupplyLastSownVeg ( int  a_x,
int  a_y 
)
inline

Returns the last type of vegetation sown on a field using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

1698 {
1699  return m_elems[m_land->Get(a_x, a_y)]->GetLastSownVeg();
1700 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyLastSownVegVector()

TTypesOfVegetation Landscape::SupplyLastSownVegVector ( unsigned int  a_index)
inline

Returns the last type of vegetation sown on a field using the polygon index to Landscape::m_elems.

1688 {
1689  return m_elems[a_index]->GetLastSownVeg();
1690 }

References m_elems.

◆ SupplyLastTreatment() [1/2]

int Landscape::SupplyLastTreatment ( int  a_polyref,
int *  a_index 
)
inline

Returns the last treatment recorded for the polygon.

1942 {
1943  return m_elems[ m_polymapping[ a_polyref ]]->GetLastTreatment( a_index );
1944 }

References m_elems, and m_polymapping.

Referenced by TAnimal::CheckManagement(), PoecilusCupreus_Pupae::CheckManagementBeetle(), Beetle_Base::CheckManagementBeetle(), and TAnimal::CheckManagementXY().

◆ SupplyLastTreatment() [2/2]

int Landscape::SupplyLastTreatment ( int  a_x,
int  a_y,
int *  a_index 
)
inline

Returns the last treatment recorded for the polygon.

1947 {
1948  return m_elems[ m_land->Get( a_x, a_y ) ]->GetLastTreatment( a_index );
1949 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyLatitude()

double Landscape::SupplyLatitude ( )
inline

Returns m_latitude of the landscape location.

605 { return m_latitude; };

References m_latitude.

Referenced by main().

◆ SupplyLATotal() [1/2]

double Landscape::SupplyLATotal ( int  a_polyref)
inline

Returns leaf area in total of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

1583 {
1584  return m_elems[m_polymapping[a_polyref]]->GetLATotal();
1585 }

References m_elems, and m_polymapping.

◆ SupplyLATotal() [2/2]

double Landscape::SupplyLATotal ( int  a_x,
int  a_y 
)
inline

Returns leaf area in total of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

1578 {
1579  return m_elems[m_land->Get(a_x, a_y)]->GetLATotal();
1580 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyLECount()

int Landscape::SupplyLECount ( void  )

Returns number of all landscape elements.

5633  {
5634  return (int)m_elems.size();
5635 }

◆ SupplyLEHigh()

bool Landscape::SupplyLEHigh ( int  a_x,
int  a_y 
)
inline

Function for backwards code compatibility when Set_Att_High would now be used.

996 { return SupplyAttIsHigh(a_x, a_y); }

References SupplyAttIsHigh().

◆ SupplyLENext()

int Landscape::SupplyLENext ( void  )

Returns -1 at if the end of the list of m_elems is reached, polyref otherwise.

5626  {
5627  if ((unsigned int)le_signal_index == m_elems.size()) {
5628  return -1;
5629  }
5630  return m_elems[le_signal_index++]->GetPoly();
5631 }

◆ SupplyLEPointer()

◆ SupplyLEReset()

void Landscape::SupplyLEReset ( void  )

Resets internal state for the LE loop generator.

5622  {
5623  le_signal_index = 0;
5624 }

◆ SupplyLESignal()

LE_Signal Landscape::SupplyLESignal ( int  a_polyref)

Returns current signal mask for polygon.

5637  {
5638  return m_elems[m_polymapping[a_polyref]]->GetSignal();
5639 }

References m_polymapping.

◆ SupplyLocMaxNectar()

double Landscape::SupplyLocMaxNectar ( int &  a_peak_loc_x,
int &  a_peak_loc_y,
int  a_min_x,
int  a_min_y,
int  a_max_x,
int  a_max_y,
int  a_incr = 1 
)

Supply the location with the maximum nectar amount location for the given area.

3575  {
3576  double max_nectar = m_nectar_map(Eigen::seq(a_min_y,a_max_y, a_incr), Eigen::seq(a_min_x, a_max_x, a_incr)).maxCoeff(&a_peak_loc_y, &a_peak_loc_x);
3577  a_peak_loc_x = a_min_x+a_peak_loc_x*a_incr;
3578  a_peak_loc_y = a_min_y+a_peak_loc_y*a_incr;
3579  return (max_nectar);;
3580 }

◆ SupplyLocMaxPollen()

double Landscape::SupplyLocMaxPollen ( int &  a_peak_loc_x,
int &  a_peak_loc_y,
int  a_min_x,
int  a_min_y,
int  a_max_x,
int  a_max_y,
int  a_incr = 1 
)

Supply the location with the maximum pollen amount location for the given area.

3566  {
3567  double max_pollen = m_pollen_map(Eigen::seq(a_min_y,a_max_y, a_incr), Eigen::seq(a_min_x, a_max_x, a_incr)).maxCoeff(&a_peak_loc_y, &a_peak_loc_x);
3568  a_peak_loc_x = a_min_x+a_peak_loc_x*a_incr;
3569  a_peak_loc_y = a_min_y+a_peak_loc_y*a_incr;
3570  //cout<<m_pollen_map(Eigen::seq(a_min_y,a_max_y), Eigen::seq(a_min_x, a_max_x))<<endl;
3571  //cout<<"Max found: "<<max_pollen<<"Polytype"<<SupplyElementType(a_peak_loc_x, a_peak_loc_y)<<endl;
3572  return (max_pollen);;
3573 }

Referenced by Osmia_Female::Forage().

◆ SupplyLocsVectorPoly()

std::vector<APoint> Landscape::SupplyLocsVectorPoly ( int  a_poly_id)
inline

The function to get the vector of all the locations for the given poly ID.

261 {return m_poly_cell_locs[a_poly_id];}

References m_poly_cell_locs.

◆ SupplyLongitude()

double Landscape::SupplyLongitude ( )
inline

Returns m_longitude of the landscape location.

607 { return m_longitude; };

References m_longitude.

Referenced by main().

◆ SupplyMagicMapP()

int * Landscape::SupplyMagicMapP ( int  a_x,
int  a_y 
)
inline

Returns a pointer to the map at position x, y. The value found through it is an internal number from the landscape simulator, that uniquely identifies a polygon, it is not the polygon number - to find this apply MagicMap2PolyRef.

2187 {
2188  return m_land->GetMagicP( a_x, a_y );
2189 }

References RasterMap::GetMagicP(), and m_land.

◆ SupplyMaleNewtPresent()

bool Landscape::SupplyMaleNewtPresent ( int  a_InPondIndex)
inline

Determines if a male is present in a pond.

570 { return m_elems[a_InPondIndex]->IsMaleNewtPresent(); }

References m_elems.

◆ SupplyMaxPoly()

int Landscape::SupplyMaxPoly ( )
inline

Returns the size of the Landscape::m_elems vector.

331 { return int(m_elems.size()); }

References m_elems.

Referenced by Pesticide::DiffusionMatrixInit(), Pesticide::MainMapDecay(), and Pesticide::Pesticide().

◆ SupplyMaxTemp()

double Landscape::SupplyMaxTemp ( void  )
inline

Passes a request on to the associated Weather class function, the maximum temperature for the current day.

2004 {
2005  return g_weather->GetMaxTemp();
2006 }

References g_weather, and Weather::GetMaxTemp().

Referenced by PoecilusCupreus_Population_Manager::DayDegreeCalculations().

◆ SupplyMaxTempTomorrow()

double Landscape::SupplyMaxTempTomorrow ( void  )
inline

Passes a request on to the associated Weather class function, the maximum temperature for tomorrow.

2024 {
2025  return g_weather->GetMaxTempTomorrow();
2026 }

References g_weather, and Weather::GetMaxTempTomorrow().

◆ SupplyMaxTempYesterday()

double Landscape::SupplyMaxTempYesterday ( void  )
inline

Passes a request on to the associated Weather class function, the maximum temperature for yesterday.

2014 {
2015  return g_weather->GetMaxTempYesterday();
2016 }

References g_weather, and Weather::GetMaxTempYesterday().

◆ SupplyMeanTemp()

double Landscape::SupplyMeanTemp ( long  a_date,
unsigned int  a_period 
)
inline

Passes a request on to the associated Weather class function, the mean temperature for the current day.

1979 {
1980  return g_weather->GetMeanTemp( a_date, a_period );
1981 }

References g_weather, and Weather::GetMeanTemp().

Referenced by Vole_Population_Manager::DoFirst().

◆ SupplyMinTemp()

double Landscape::SupplyMinTemp ( void  )
inline

Passes a request on to the associated Weather class function, the minimum temperature for the current day.

1999 {
2000  return g_weather->GetMinTemp();
2001 }

References g_weather, and Weather::GetMinTemp().

Referenced by PoecilusCupreus_Population_Manager::DayDegreeCalculations().

◆ SupplyMinTempTomorrow()

double Landscape::SupplyMinTempTomorrow ( void  )
inline

Passes a request on to the associated Weather class function, the minimum temperature for tomorrow.

2019 {
2020  return g_weather->GetMinTempTomorrow();
2021 }

References g_weather, and Weather::GetMinTempTomorrow().

◆ SupplyMinTempYesterday()

double Landscape::SupplyMinTempYesterday ( void  )
inline

Passes a request on to the associated Weather class function, the minimum temperature for yesterday.

2009 {
2010  return g_weather->GetMinTempYesterday();
2011 }

References g_weather, and Weather::GetMinTempYesterday().

◆ SupplyMinute()

int Landscape::SupplyMinute ( void  )
inline

Passes a request on to the associated Calendar class function, the minute of the hour.

Get the minute of the hour.

2263  {
2264  return g_date->GetMinute();
2265 }

References g_date, and Calendar::GetMinute().

◆ SupplyMonth()

◆ SupplyMonthName()

std::string Landscape::SupplyMonthName ( void  )

Passes a request on to the associated Calendar class function, returns the month name (e.g., January)

3144 {
3145  int m = g_date->GetMonth();
3146  char error_num[10];
3147 
3148  switch (m) {
3149  case 1:
3150  return "January";
3151  case 2:
3152  return "February";
3153  case 3:
3154  return "March";
3155  case 4:
3156  return "April";
3157  case 5:
3158  return "May";
3159  case 6:
3160  return "June";
3161  case 7:
3162  return "July";
3163  case 8:
3164  return "August";
3165  case 9:
3166  return "September";
3167  case 10:
3168  return "October";
3169  case 11:
3170  return "November";
3171  case 12:
3172  return "December";
3173  default:
3174  sprintf(error_num, "%d", m);
3175  g_msg->Warn(WARN_FILE, "Landscape::SupplyMonthName(): Unknown event type:", error_num);
3176  exit(1);
3177  }
3178 }

References g_date, g_msg, Calendar::GetMonth(), MapErrorMsg::Warn(), and WARN_FILE.

◆ SupplyNecDD()

double Landscape::SupplyNecDD ( int  a_polyref)
inline

Returns the current day degree sum for nectar production of the vegetation using the polygon reference number a_polyref.

677 { return m_elems[a_polyref]->supplyNecDD(); }

References m_elems.

◆ SupplyNectar() [1/2]

PollenNectarData Landscape::SupplyNectar ( int  a_polyref)
inline

Returns information on the nectar produced by the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y.

647 { return m_elems[a_polyref]->GetNectar(); }

References m_elems.

Referenced by Osmia_Female::st_ReproductiveBehaviour(), and SupplyNectarAtLocInPoly().

◆ SupplyNectar() [2/2]

PollenNectarData Landscape::SupplyNectar ( int  a_x,
int  a_y 
)
inline

Returns information on the nectar produced by the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y.

649 { return m_elems[m_land->Get(a_x, a_y)]->GetNectar(); }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyNectarAtLocInPoly()

double Landscape::SupplyNectarAtLocInPoly ( int  a_poly_id,
APoint  a_start_loc,
double  a_required_amount,
vector< APoint > *  a_locs,
vector< double > *  a_pest_vec 
)
inline

The function to get the given nectar in the given location in the polygon ID, the locations for the required amount of nectar are stored in a_locs, the pesticide residue are stored in a_pest_vet, the foraged amount of nectar are returned.

277  {
278  double temp_nectar = SupplyResourceAtLocInPoly(a_poly_id, a_start_loc, a_required_amount, a_locs, a_pest_vec, m_nectar_map ,m_index_locs_nectar[a_poly_id], SupplyNectar(a_poly_id), false);
279  RemoveNectarFromTotal(a_poly_id, temp_nectar);
280  return temp_nectar;
281  }

References m_index_locs_nectar, m_nectar_map, RemoveNectarFromTotal(), SupplyNectar(), and SupplyResourceAtLocInPoly().

◆ SupplyNectarHabitatType()

PollenNectarData Landscape::SupplyNectarHabitatType ( int  a_habitat_type)
inline

Supply the nectar of the current day for the given habitat type.

289 {return m_habitat_nectar[a_habitat_type];}

References m_habitat_nectar.

Referenced by VegElement::PollenNectarPhenologyCalculation().

◆ SupplyNectarMapPtr()

Eigen::MatrixXf* Landscape::SupplyNectarMapPtr ( )
inline

Returns pointer to the Eigen matrix for nectar.

339 { return &m_nectar_map; }

References m_nectar_map.

Referenced by Pesticide::TwinMapDiffusionMatrix().

◆ SupplyNectarQuantity() [1/2]

double Landscape::SupplyNectarQuantity ( int  a_polyref)
inline

Returns the XXX of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

661 { return m_elems[a_polyref]->GetNectarQuantity(); }

References m_elems.

Referenced by Pesticide::MainMapDecay(), and Pesticide::RecordAllPesticideCompartments().

◆ SupplyNectarQuantity() [2/2]

double Landscape::SupplyNectarQuantity ( int  a_x,
int  a_y 
)
inline

Returns the XXX of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

663 { return m_nectar_map(a_y,a_x); }

References m_nectar_map.

◆ SupplyNightProp()

double Landscape::SupplyNightProp ( )
inline

Passes a request on to the associated Calendar class function, returns 1.0 - m_daylightproportion

1457 { return 1.0 - g_date->GetDaylightProportion(); }

References g_date, and Calendar::GetDaylightProportion().

◆ SupplyNumberOfFarms()

int Landscape::SupplyNumberOfFarms ( )
inline

Returns the number of farms in the current landscape.

1770  {
1771  return m_FarmManager->GetNoFarms();
1772 }

References FarmManager::GetNoFarms(), and m_FarmManager.

◆ SupplyNumberOfPolygons()

unsigned int Landscape::SupplyNumberOfPolygons ( void  )
inline

◆ SupplyOpenness() [1/2]

int Landscape::SupplyOpenness ( int  a_poly)
inline

Get openness for a polygon.

806 { return m_elems[m_polymapping[a_poly]]->GetOpenness(); }

References m_elems, and m_polymapping.

◆ SupplyOpenness() [2/2]

int Landscape::SupplyOpenness ( int  a_x,
int  a_y 
)
inline

Get openness for a location.

808 { return m_elems[m_land->Get(a_x, a_y)]->GetOpenness(); }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyOverspray()

bool Landscape::SupplyOverspray ( int  a_x,
int  a_y 
)

Gets the overspray flag.

1414 {
1415  if (!l_pest_enable_pesticide_engine.value()) return false;
1416  return m_elems[m_land->Get(a_x, a_y)]->GetSprayedToday();
1417 }

References l_pest_enable_pesticide_engine, and CfgBool::value().

◆ SupplyOwner_tole()

TTypesOfLandscapeElement Landscape::SupplyOwner_tole ( int  a_x,
int  a_y 
)
inline

Gets the farm owner reference of a polygon, or -1 if not owned by a farmer.

2163 {
2164  return m_elems[m_land->Get(a_x, a_y)]->GetOwner_tole();
2165 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyPesticide() [1/2]

double Landscape::SupplyPesticide ( int  a_polyref,
PlantProtectionProducts  a_ppp 
)

Gets total pesticide for the centroid of a polygon.

1520  {
1521  if (!l_pest_enable_pesticide_engine.value()) return 0.0;
1522  double pp;
1523 #ifdef __DETAILED_PESTICIDE_FATE
1524  pp = g_pest->SupplyPesticideS(a_polyref, a_ppp);
1525  pp += g_pest->SupplyPesticideP(a_polyref, a_ppp);
1526 #else
1527  pp = g_pest->SupplyPesticide(a_polyref, a_ppp);
1528 #endif
1529  return pp;
1530 }

References g_pest, l_pest_enable_pesticide_engine, Pesticide::SupplyPesticide(), and CfgBool::value().

◆ SupplyPesticide() [2/2]

double Landscape::SupplyPesticide ( int  a_x,
int  a_y,
PlantProtectionProducts  a_ppp 
)

Gets total pesticide for a location.

1386  {
1387  if (!l_pest_enable_pesticide_engine.value()) return 0.0;
1388  double pp;
1389 #ifdef __DETAILED_PESTICIDE_FATE
1390  // This should be avoided if possible because it is inefficient
1391  pp = g_pest->SupplyPesticideS(a_x, a_y, a_ppp);
1392  pp += g_pest->SupplyPesticideP(a_x, a_y, a_ppp);
1393 #else
1394  pp = g_pest->SupplyPesticide(a_x, a_y, a_ppp);
1395 #endif
1396  return pp;
1397 }

References g_pest, l_pest_enable_pesticide_engine, Pesticide::SupplyPesticide(), and CfgBool::value().

Referenced by Pond::CalcPondPesticide(), Spider_Egg::EndStep(), Spider_Juvenile::EndStep(), Spider_Female::EndStep(), Beetle_Larvae::EndStep(), Beetle_Pupae::EndStep(), Beetle_Adult::EndStep(), Skylark_Male::GetFood(), and Pesticide::MainMapDecay().

◆ SupplyPesticideCell()

int Landscape::SupplyPesticideCell ( int  a_polyref)
inline

Gets the index to the cell used to store pesticide information from the coordinates x, y.

2133 {
2134  return m_elems[ m_polymapping[ a_polyref ] ]->GetPesticideCell();
2135 }

References m_elems, and m_polymapping.

Referenced by Pesticide::SupplyPesticide().

◆ SupplyPesticideDecay()

bool Landscape::SupplyPesticideDecay ( PlantProtectionProducts  a_ppp)

Returns true if there is any pesticide in the system at all at this point.

1769 {
1770  return g_pest->GetAnythingToDecay(a_ppp);
1771 }

References g_pest, and Pesticide::GetAnythingToDecay().

◆ SupplyPesticideInPlant() [1/2]

double Landscape::SupplyPesticideInPlant ( int  a_polyref,
PlantProtectionProducts  a_ppp 
)

Gets pesticide within plant for the centroid of a polygon.

1572  {
1573  if (!l_pest_enable_pesticide_engine.value()) return 0.0;
1574  double pp;
1575 #ifdef __DETAILED_PESTICIDE_FATE
1576  #ifdef __FLOWER_PESTICIDE
1577  pp = g_pest->SupplyPesticideInPlant(a_polyref, a_ppp);
1578  #else
1579  pp = g_pest->SupplyPesticideP(a_polyref, a_ppp);
1580  #endif
1581 #else
1582  pp = g_pest->SupplyPesticide(a_polyref, a_ppp);
1583 #endif
1584  return pp;
1585 }

References g_pest, l_pest_enable_pesticide_engine, Pesticide::SupplyPesticide(), and CfgBool::value().

◆ SupplyPesticideInPlant() [2/2]

double Landscape::SupplyPesticideInPlant ( int  a_x,
int  a_y,
PlantProtectionProducts  a_ppp 
)

Gets pesticide within plant for a location.

1459  {
1460  if (!l_pest_enable_pesticide_engine.value()) return 0.0;
1461  double pp;
1462 #ifdef __DETAILED_PESTICIDE_FATE
1463  #ifdef __FLOWER_PESTICIDE
1464  pp = g_pest->SupplyPesticideInPlant(a_x, a_y, a_ppp);
1465  #else
1466  pp = g_pest->SupplyPesticideP(a_x, a_y, a_ppp);
1467  #endif
1468 #else
1469  pp = g_pest->SupplyPesticide(a_x, a_y, a_ppp);
1470 #endif
1471  return pp;
1472 }

References g_pest, l_pest_enable_pesticide_engine, Pesticide::SupplyPesticide(), and CfgBool::value().

◆ SupplyPesticideNectar() [1/2]

double Landscape::SupplyPesticideNectar ( int  a_polyref,
PlantProtectionProducts  a_ppp 
)

Gets nectar pesticide for the centroid of a polygon.

1587  {
1588  if (!l_pest_enable_pesticide_engine.value()) return 0.0;
1589  double pp;
1590 #ifdef __DETAILED_PESTICIDE_FATE
1591  #ifdef __FLOWER_PESTICIDE
1592  pp = g_pest->SupplyPesticideNectar(a_polyref, a_ppp);
1593  #else
1594  pp = g_pest->SupplyPesticideP(a_polyref, a_ppp);
1595  #endif
1596 #else
1597  pp = g_pest->SupplyPesticide(a_polyref, a_ppp);
1598 #endif
1599  return pp;
1600 }

References g_pest, l_pest_enable_pesticide_engine, Pesticide::SupplyPesticide(), and CfgBool::value().

◆ SupplyPesticideNectar() [2/2]

double Landscape::SupplyPesticideNectar ( int  a_x,
int  a_y,
PlantProtectionProducts  a_ppp 
)

Gets nectar pesticide for a location.

1474  {
1475  if (!l_pest_enable_pesticide_engine.value()) return 0.0;
1476  double pp;
1477 #ifdef __DETAILED_PESTICIDE_FATE
1478  #ifdef __FLOWER_PESTICIDE
1479  pp = g_pest->SupplyPesticideNectar(a_x, a_y, a_ppp);
1480  #else
1481  pp = g_pest->SupplyPesticideP(a_x, a_y, a_ppp);
1482  #endif
1483 #else
1484  pp = g_pest->SupplyPesticide(a_x, a_y, a_ppp);
1485 #endif
1486  return pp;
1487 }

References g_pest, l_pest_enable_pesticide_engine, Pesticide::SupplyPesticide(), and CfgBool::value().

Referenced by Osmia_Female::st_ReproductiveBehaviour().

◆ SupplyPesticideP() [1/2]

double Landscape::SupplyPesticideP ( int  a_polyref,
PlantProtectionProducts  a_ppp 
)

Gets plant pesticide for the centroid of a polygon.

1545  {
1546  if (!l_pest_enable_pesticide_engine.value()) return 0.0;
1547  double pp;
1548 #ifdef __DETAILED_PESTICIDE_FATE
1549  pp = g_pest->SupplyPesticideP(a_polyref, a_ppp);
1550 #else
1551  pp = g_pest->SupplyPesticide(a_polyref, a_ppp);
1552 #endif
1553  return pp;
1554 }

References g_pest, l_pest_enable_pesticide_engine, Pesticide::SupplyPesticide(), and CfgBool::value().

◆ SupplyPesticideP() [2/2]

double Landscape::SupplyPesticideP ( int  a_x,
int  a_y,
PlantProtectionProducts  a_ppp 
)

Gets plant pesticide for a location.

1420  {
1421  if (!l_pest_enable_pesticide_engine.value()) return 0.0;
1422  double pp;
1423 #ifdef __DETAILED_PESTICIDE_FATE
1424  pp = g_pest->SupplyPesticideP(a_x, a_y, a_ppp);
1425 #else
1426  pp = g_pest->SupplyPesticide(a_x, a_y, a_ppp);
1427 #endif
1428  return pp;
1429 }

References g_pest, l_pest_enable_pesticide_engine, Pesticide::SupplyPesticide(), and CfgBool::value().

Referenced by THare::ForageSquareP().

◆ SupplyPesticidePlantSurface() [1/2]

double Landscape::SupplyPesticidePlantSurface ( int  a_polyref,
PlantProtectionProducts  a_ppp 
)

Gets plant surface pesticide for the centroid of a polygon.

1557  {
1558  if (!l_pest_enable_pesticide_engine.value()) return 0.0;
1559  double pp;
1560 #ifdef __DETAILED_PESTICIDE_FATE
1561  #ifdef __FLOWER_PESTICIDE
1562  pp = g_pest->SupplyPesticidePlantSurface(a_polyref, a_ppp);
1563  #else
1564  pp = g_pest->SupplyPesticideP(a_polyref, a_ppp);
1565  #endif
1566 #else
1567  pp = g_pest->SupplyPesticide(a_polyref, a_ppp);
1568 #endif
1569  return pp;
1570 }

References g_pest, l_pest_enable_pesticide_engine, Pesticide::SupplyPesticide(), and CfgBool::value().

◆ SupplyPesticidePlantSurface() [2/2]

double Landscape::SupplyPesticidePlantSurface ( int  a_x,
int  a_y,
PlantProtectionProducts  a_ppp 
)

Gets plant surface pesticide for a location.

1444  {
1445  if (!l_pest_enable_pesticide_engine.value()) return 0.0;
1446  double pp;
1447 #ifdef __DETAILED_PESTICIDE_FATE
1448  #ifdef __FLOWER_PESTICIDE
1449  pp = g_pest->SupplyPesticidePlantSurface(a_x, a_y, a_ppp);
1450  #else
1451  pp = g_pest->SupplyPesticideP(a_x, a_y, a_ppp);
1452  #endif
1453 #else
1454  pp = g_pest->SupplyPesticide(a_x, a_y, a_ppp);
1455 #endif
1456  return pp;
1457 }

References g_pest, l_pest_enable_pesticide_engine, Pesticide::SupplyPesticide(), and CfgBool::value().

Referenced by PesticideToxicity::doContact(), and Osmia_Female::st_ReproductiveBehaviour().

◆ SupplyPesticidePollen() [1/2]

double Landscape::SupplyPesticidePollen ( int  a_polyref,
PlantProtectionProducts  a_ppp 
)

Gets pollen pesticide for the centroid of a polygon.

1602  {
1603  if (!l_pest_enable_pesticide_engine.value()) return 0.0;
1604  double pp;
1605 #ifdef __DETAILED_PESTICIDE_FATE
1606  #ifdef __FLOWER_PESTICIDE
1607  pp = g_pest->SupplyPesticidePollen(a_polyref, a_ppp);
1608  #else
1609  pp = g_pest->SupplyPesticideP(a_polyref, a_ppp);
1610  #endif
1611 #else
1612  pp = g_pest->SupplyPesticide(a_polyref, a_ppp);
1613 #endif
1614  return pp;
1615 }

References g_pest, l_pest_enable_pesticide_engine, Pesticide::SupplyPesticide(), and CfgBool::value().

◆ SupplyPesticidePollen() [2/2]

double Landscape::SupplyPesticidePollen ( int  a_x,
int  a_y,
PlantProtectionProducts  a_ppp 
)

Gets pollen pesticide for a location.

1489  {
1490  if (!l_pest_enable_pesticide_engine.value()) return 0.0;
1491  double pp;
1492 #ifdef __DETAILED_PESTICIDE_FATE
1493  #ifdef __FLOWER_PESTICIDE
1494  pp = g_pest->SupplyPesticidePollen(a_x, a_y, a_ppp);
1495  #else
1496  pp = g_pest->SupplyPesticideP(a_x, a_y, a_ppp);
1497  #endif
1498 #else
1499  pp = g_pest->SupplyPesticide(a_x, a_y, a_ppp);
1500 #endif
1501  return pp;
1502 }

References g_pest, l_pest_enable_pesticide_engine, Pesticide::SupplyPesticide(), and CfgBool::value().

◆ SupplyPesticideS() [1/2]

double Landscape::SupplyPesticideS ( int  a_polyref,
PlantProtectionProducts  a_ppp 
)

Gets soil pesticide for the centroid of a polygon.

1533  {
1534  if (!l_pest_enable_pesticide_engine.value()) return 0.0;
1535  double pp;
1536 #ifdef __DETAILED_PESTICIDE_FATE
1537  pp = g_pest->SupplyPesticideS(a_polyref, a_ppp);
1538 #else
1539  pp = g_pest->SupplyPesticide(a_polyref, a_ppp);
1540 #endif
1541  return pp;
1542 }

References g_pest, l_pest_enable_pesticide_engine, Pesticide::SupplyPesticide(), and CfgBool::value().

◆ SupplyPesticideS() [2/2]

double Landscape::SupplyPesticideS ( int  a_x,
int  a_y,
PlantProtectionProducts  a_ppp 
)

Gets soil pesticide for a location.

1432  {
1433  if (!l_pest_enable_pesticide_engine.value()) return 0.0;
1434  double pp;
1435 #ifdef __DETAILED_PESTICIDE_FATE
1436  pp = g_pest->SupplyPesticideS(a_x, a_y, a_ppp);
1437 #else
1438  pp = g_pest->SupplyPesticide(a_x, a_y, a_ppp);
1439 #endif
1440  return pp;
1441 }

References g_pest, l_pest_enable_pesticide_engine, Pesticide::SupplyPesticide(), and CfgBool::value().

◆ SupplyPesticideType()

◆ SupplyPestIncidenceFactor()

◆ SupplyPolDD()

double Landscape::SupplyPolDD ( int  a_polyref)
inline

Returns the current day degree sum for pollen production of the vegetation using the polygon reference number a_polyref.

681 { return m_elems[a_polyref]->supplyPolDD(); }

References m_elems.

◆ SupplyPollen() [1/2]

PollenNectarData Landscape::SupplyPollen ( int  a_polyref)
inline

Returns information on the pollen produced by the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y.

641 { return m_elems[a_polyref]->GetPollen(); }

References m_elems.

Referenced by SupplyPollenAtLocInPoly().

◆ SupplyPollen() [2/2]

PollenNectarData Landscape::SupplyPollen ( int  a_x,
int  a_y 
)
inline

Returns information on the pollen produced by the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y.

643 { return m_elems[m_land->Get(a_x, a_y)]->GetPollen(); }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyPollenAtLocInPoly()

double Landscape::SupplyPollenAtLocInPoly ( int  a_poly_id,
APoint  a_start_loc,
double  a_required_amount,
vector< APoint > *  a_locs,
vector< double > *  a_pest_vec 
)
inline

The function to get the given pollen in the give location in the polygon ID, the locations for the required amount of pollen are stored in a_locs, the pesticide residue are stored in a_pest_vet, the foraged amount of pollen are returned.

271  {
272  double temp_pollen = SupplyResourceAtLocInPoly(a_poly_id, a_start_loc, a_required_amount, a_locs, a_pest_vec, m_pollen_map, m_index_locs_pollen[a_poly_id], SupplyPollen(a_poly_id), true);
273  RemovePollenFromTotal(a_poly_id, temp_pollen);
274  return temp_pollen;
275  }

References m_index_locs_pollen, m_pollen_map, RemovePollenFromTotal(), SupplyPollen(), and SupplyResourceAtLocInPoly().

Referenced by Osmia_Female::st_ReproductiveBehaviour().

◆ SupplyPollenHabitatType()

PollenNectarData Landscape::SupplyPollenHabitatType ( int  a_habitat_type)
inline

Supply the pollen of the current day for the given habitat type.

287 {return m_habitat_pollen[a_habitat_type];}

References m_habitat_pollen.

Referenced by VegElement::PollenNectarPhenologyCalculation().

◆ SupplyPollenMapPtr()

Eigen::MatrixXf* Landscape::SupplyPollenMapPtr ( )
inline

Returns pointer to the Eigen matrix for pollen.

337 { return &m_pollen_map; }

References m_pollen_map.

Referenced by Pesticide::TwinMapDiffusionMatrix().

◆ SupplyPollenQuantity() [1/2]

double Landscape::SupplyPollenQuantity ( int  a_polyref)
inline

Returns the pollen quantity produced by the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

657 { return m_elems[a_polyref]->GetPollenQuantity(); }

References m_elems.

Referenced by Osmia_Female::Forage(), Osmia_Female::GetPollenInPolygon(), Pesticide::MainMapDecay(), and Pesticide::RecordAllPesticideCompartments().

◆ SupplyPollenQuantity() [2/2]

double Landscape::SupplyPollenQuantity ( int  a_x,
int  a_y 
)
inline

Returns the pollen quantity produced by the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

659 { return m_pollen_map(a_y,a_x); }

References m_pollen_map.

◆ SupplyPolygonArea()

double Landscape::SupplyPolygonArea ( int  a_polyref)
inline

Returns the polygon area of a particular polygon referenced by polygon.

1058 { return m_elems[m_polymapping[a_polyref]]->GetArea(); }

References m_elems, and m_polymapping.

◆ SupplyPolygonAreaVector()

double Landscape::SupplyPolygonAreaVector ( int  a_polyref)
inline

Returns the polygon area of a particular polygon using an index to m_elems.

Returns the area of a polygon using the vector index as a reference.

1821 {
1822  return m_elems[ a_polyref ]->GetArea();
1823 }

References m_elems.

Referenced by Osmia_Nest_Manager::InitOsmiaBeeNesting().

◆ SupplyPolyIdMapPtr()

Eigen::ArrayXXi* Landscape::SupplyPolyIdMapPtr ( )
inline

Returns pointer to the Eigen Array for poly id map.

333 { return &m_polyid_map; }

References m_polyid_map.

Referenced by Pesticide::MainMapDecay(), Pesticide::ReducePlantPesticide(), and Pesticide::RemovePlantPesticide().

◆ SupplyPolyLEptr() [1/2]

LE * Landscape::SupplyPolyLEptr ( int  a_polyref)
inline

Get the pointer to the LE object associated with the polygon at x,y location or by using the polygon reference.

2148 {
2149  return m_elems[m_polymapping[a_polyref]];
2150 }

References m_elems, and m_polymapping.

◆ SupplyPolyLEptr() [2/2]

LE * Landscape::SupplyPolyLEptr ( int  a_x,
int  a_y 
)
inline

Get the pointer to the LE object associated with the polygon at x,y location or by using the polygon reference.

2153 {
2154  return m_elems[m_land->Get(a_x, a_y)];
2155 }

References RasterMap::Get(), m_elems, and m_land.

Referenced by Pesticide::DiffusionMatrixInit(), Pesticide::MainMapDecay(), and Pesticide::RecordAllPesticideCompartments().

◆ SupplyPolyListPtr()

vector<LE*>* Landscape::SupplyPolyListPtr ( )
inline

Returns the pointer to m_elemns.

1327 { return &m_elems; }

References m_elems.

◆ SupplyPolymapping()

int Landscape::SupplyPolymapping ( int  a_index)
inline

Returns the value of the m_polymapping array indexed by a_index.

329 { return m_polymapping[a_index]; }

References m_polymapping.

◆ SupplyPolyRef()

◆ SupplyPolyRefCC()

int Landscape::SupplyPolyRefCC ( int  a_x,
int  a_y 
)
inline

Get the in map polygon reference number from the x,y location, and correcting for possible wrap around coordinates.

2178 {
2179  a_x = (a_x + m_width10) % m_width;
2180  a_y = (a_y + m_height10) % m_height;
2181  return m_elems[ m_land->Get( a_x, a_y )]->GetPoly();
2182 }

References RasterMap::Get(), m_elems, m_height, m_height10, m_land, m_width, and m_width10.

◆ SupplyPolyRefIndex()

int Landscape::SupplyPolyRefIndex ( int  a_x,
int  a_y 
)
inline

Get the index to the m_elems array for a polygon at location x,y.

2173 {
2174  return m_land->Get( a_x, a_y );
2175 }

References RasterMap::Get(), and m_land.

Referenced by Vole_Base::CalculateCarryingCapacity(), Osmia_Female::FindNestLocation(), SubPopulation_Population_Manager::initialisePopulation(), Aphid_Population_Manager::initialiseSimWithEggs(), and vole_tole_move_quality().

◆ SupplyPolyRefVector()

int Landscape::SupplyPolyRefVector ( unsigned int  a_index)
inline

Gets the polygon reference number from the index to m_elems.

2122 {
2123  return m_elems[ a_index ]->GetPoly();
2124 }

References m_elems.

◆ SupplyPolyWithFlowers()

vector<int> Landscape::SupplyPolyWithFlowers ( void  )
inline

Returns m_poly_with_flowers, a list of polygons with flowering modelled.

872 { return m_poly_with_flowers; }

References m_poly_with_flowers.

◆ SupplyPondIndex()

int Landscape::SupplyPondIndex ( int  a_pondref) const
inline

Returns the index of a pond based on pondref or -1 if not found.

561  {
562  for (int i = 0; i < static_cast<int>(m_PondIndexList.size()); i++) {
563  if (m_PondRefsList[i] == a_pondref) return m_PondIndexList[i];
564  }
565  return -1;
566  }

References m_PondIndexList, and m_PondRefsList.

◆ 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)

1362 { return dynamic_cast<Pond*>(m_elems[a_poly_index])->SupplyPondPesticide(); }

References m_elems.

◆ SupplyRadiationHour()

double Landscape::SupplyRadiationHour ( int  hour)
inline

Returns the amount of sunshine in a given hour (0 to 23)

2117 {
2118  return g_weather->GetRadiationHour(hour);
2119 }

References g_weather, and Weather::GetRadiationHour().

◆ SupplyRain() [1/2]

double Landscape::SupplyRain ( long  a_date)
inline

Passes a request on to the associated Weather class function, the amount of rain for all dates.

1967 {
1968  return g_weather->GetRain( a_date );
1969 }

References g_weather, and Weather::GetRain().

◆ SupplyRain() [2/2]

double Landscape::SupplyRain ( void  )
inline

Passes a request on to the associated Weather class function, the amount of rain for the current day.

1972 {
1973  return g_weather->GetRain();
1974 }

References g_weather, and Weather::GetRain().

Referenced by Skylark_Female::FeedYoung(), THare_Population_Manager::GetRMR(), Skylark_Adult::GetWeatherHindrance(), Skylark_Male::st_CaringForYoung(), Skylark_Female::st_Incubating(), and Pesticide::Tick().

◆ SupplyRainHour()

double Landscape::SupplyRainHour ( int  hour)
inline

Returns the amount of rain in a given hour (0 to 23)

2113 {
2114  return g_weather->GetRainHour(hour);
2115 }

References g_weather, and Weather::GetRainHour().

◆ SupplyRainPeriod()

double Landscape::SupplyRainPeriod ( long  a_date,
int  a_period 
)
inline

Passes a request on to the associated Weather class function, the total amount of rain from a_date and a_period of days.

1962 {
1963  return g_weather->GetRainPeriod( a_date, a_period );
1964 }

References g_weather, and Weather::GetRainPeriod().

◆ SupplyRandomPondIndex()

int Landscape::SupplyRandomPondIndex ( )

Returns random pond index.

4583  {
4584  return m_PondIndexList[int(g_rand_uni_fnc()*m_PondIndexList.size())];
4585 }

References g_rand_uni_fnc().

◆ SupplyRandomPondRef()

int Landscape::SupplyRandomPondRef ( )

Returns random pond polyref.

4587  {
4588  if (m_PondIndexList.size()>0) return m_PondRefsList[int(g_rand_uni_fnc()*m_PondIndexList.size())];
4589  return -1;
4590 }

References g_rand_uni_fnc().

◆ SupplyRasterMap()

RasterMap* Landscape::SupplyRasterMap ( )
inline

Returns m_land, the pointer to the raster map instance.

576 { return m_land; }

References m_land.

Referenced by Pesticide::Pesticide().

◆ SupplyResourceAtLocInPoly()

double Landscape::SupplyResourceAtLocInPoly ( int  a_poly_id,
APoint  a_start_loc,
double  a_required_amount,
vector< APoint > *  a_locs,
vector< double > *  a_pest_vec,
Eigen::MatrixXf &  a_resource_map,
int  a_num_avail_cell,
PollenNectarData  a_resource_data,
bool  a_is_pollen 
)

The function to get the given amount of the required resource for the given location, the function returns the foraged amount.

3894  {
3895  a_pest_vec->clear();
3896  a_locs->clear();
3897  //cout<<"a_required_amount: "<<a_required_amount<<endl;
3898  int temp_cell_num = ceil(a_required_amount/a_resource_data.m_quantity); // get the number of cells needed to get the required amount
3899  //cout<<"temp_cell_num: "<<temp_cell_num<<endl;
3900  if (temp_cell_num > a_num_avail_cell){ //if the number of cells needed is more than the available cells, we return 0
3901  return 0;
3902  }
3903  if(temp_cell_num<=1){
3904  a_resource_map(a_start_loc.m_y, a_start_loc.m_x) -= a_required_amount;
3905  return a_required_amount;
3906  }
3907 
3908  double temp_foraged = 0;
3909  //take the resource in the start location first
3911  temp_foraged += a_resource_map(a_start_loc.m_y, a_start_loc.m_x);
3912  a_required_amount -= a_resource_map(a_start_loc.m_y, a_start_loc.m_x);
3913  a_resource_map(a_start_loc.m_y, a_start_loc.m_x) = 0;
3914 
3915  //get the eigth neighbours to see if we have enough cells to get the required amount
3916  if(a_required_amount>0){
3917  for (int i=0; i<8; i++){
3918  int temp_x = a_start_loc.m_x + g_vector_x[i];
3919  int temp_y = a_start_loc.m_y + g_vector_y[i];
3920  CorrectCoords(temp_x, temp_y);
3921  if(SupplyPolyRef(temp_x, temp_y)==a_poly_id){
3922  //used to calculate the pesticide taken with the resource
3923  float taken_ratio = a_required_amount/a_resource_map(temp_y, temp_x);
3924  if (taken_ratio > 1) taken_ratio = 1;
3925  if(a_resource_map(temp_y, temp_x)<=a_required_amount){
3926  temp_foraged += a_resource_map(temp_y, temp_x);
3927  a_required_amount -= a_resource_map(temp_y, temp_x);
3928  a_resource_map(temp_y, temp_x) = 0;
3929  }
3930  else{
3931  temp_foraged += a_required_amount;
3932  a_resource_map(temp_y, temp_x) -= a_required_amount;
3933  if(a_resource_map(temp_y, temp_x)<0.001)//too small
3934  a_resource_map(temp_y, temp_x) = 0;
3935  a_required_amount = 0;
3936  }
3937 
3938 
3939  //get the pesticide with the resource
3940  // if(l_pest_enable_pesticide_engine.value()){
3941  // for(int pest_idx = 0; pest_idx < l_pest_NoPPPs.value(); pest_idx++){
3942  // double temp_pest_amount = 0;
3943  // if(a_is_pollen){
3944  // temp_pest_amount = SupplyPesticidePollen(temp_x, temp_y, PlantProtectionProducts(pest_idx));
3945  // /** \todo Add pesticide removal code here.*/
3946  // }
3947  // else{
3948  // temp_pest_amount = SupplyPesticideNectar(temp_x, temp_y, PlantProtectionProducts(pest_idx));
3949  // /** \todo Add pesticide removal code here.*/
3950  // }
3951  // (*a_pest_vec)[pest_idx] += temp_pest_amount*taken_ratio;
3952  // }
3953  // }
3954 
3955  if(a_required_amount<=0){
3956  break;
3957  }
3958  }
3959  }
3960  }
3961 
3962  //get the 16 further neighbours to see if we have enough cells to get the required amount
3963  if(a_required_amount>0){
3964  for (int i=0; i<16; i++){
3965  int temp_x = a_start_loc.m_x + g_vector16_x[i];
3966  int temp_y = a_start_loc.m_y + g_vector16_y[i];
3967  CorrectCoords(temp_x, temp_y);
3968  if(SupplyPolyRef(temp_x, temp_y)==a_poly_id){
3969  //used to calculate the pesticide taken with the resource
3970  float taken_ratio = a_required_amount/a_resource_map(temp_y, temp_x);
3971  if(a_resource_map(temp_y, temp_x)<=a_required_amount){
3972  temp_foraged += a_resource_map(temp_y, temp_x);
3973  a_required_amount -= a_resource_map(temp_y, temp_x);
3974  a_resource_map(temp_y, temp_x) = 0;
3975  }
3976  else{
3977  temp_foraged += a_required_amount;
3978  a_resource_map(temp_y, temp_x) -= a_required_amount;
3979  if(a_resource_map(temp_y, temp_x)<0.001) //too small
3980  a_resource_map(temp_y, temp_x) = 0;
3981  a_required_amount = 0;
3982  }
3983 
3984  //get the pesticide with the resource
3985  // if(l_pest_enable_pesticide_engine.value()){
3986  // for(int pest_idx = 0; pest_idx < l_pest_NoPPPs.value(); pest_idx++){
3987  // double temp_pest_amount = 0;
3988  // if(a_is_pollen){
3989  // temp_pest_amount = SupplyPesticidePollen(temp_x, temp_y, PlantProtectionProducts(pest_idx));
3990  // /** \todo Add pesticide removal code here.*/
3991  // }
3992  // else{
3993  // temp_pest_amount = SupplyPesticideNectar(temp_x, temp_y, PlantProtectionProducts(pest_idx));
3994  // /** \todo Add pesticide removal code here.*/
3995  // }
3996  // (*a_pest_vec)[pest_idx] += temp_pest_amount*taken_ratio;
3997  // }
3998  // }
3999 
4000  if(a_required_amount<=0){
4001  break;
4002  }
4003  }
4004  }
4005  }
4006  /* //not used
4007  //get a sqaure to search
4008  int half_search_width = sqrt(temp_cell_num)/2;
4009  int temp_x_min = a_start_loc.m_x-half_search_width;
4010  int temp_x_max = temp_x_min + half_search_width*2;
4011  if(temp_x_min<0){
4012  temp_x_min = 0;
4013  }
4014  if(temp_x_max>=m_width){
4015  temp_x_max = m_width-1;
4016  }
4017  int temp_y_min = a_start_loc.m_y-half_search_width;
4018  int temp_y_max = temp_y_min + half_search_width*2;
4019  if(temp_y_min<0){
4020  temp_y_min = 0;
4021  }
4022  if(temp_y_max>=m_height){
4023  temp_y_max = m_height-1;
4024  }
4025 
4026  double temp_foraged = a_resource_map(Eigen::seq(temp_y_min, temp_y_max), Eigen::seq(temp_x_min, temp_x_max)).sum();
4027  //cout<<a_resource_map(Eigen::seq(temp_y_min, temp_y_max), Eigen::seq(temp_x_min, temp_x_max))<<endl;
4028  //remove the foraged amount from the resource map
4029  a_resource_map(Eigen::seq(temp_y_min, temp_y_max), Eigen::seq(temp_x_min, temp_x_max)).array() = 0;
4030  */
4031 
4032  return temp_foraged;
4033 }

References PollenNectarData::m_quantity, APoint::m_x, and APoint::m_y.

Referenced by SupplyNectarAtLocInPoly(), and SupplyPollenAtLocInPoly().

◆ SupplyRoadWidth()

int Landscape::SupplyRoadWidth ( int  a_x,
int  a_y 
)
inline

Returns the width of roads.

1912 {
1913  TTypesOfLandscapeElement tole = m_elems[m_land->Get(a_x, a_y)]->GetElementType();
1914  if (tole == tole_LargeRoad) return 12;
1915  else if (tole == tole_SmallRoad) return 6;
1916  return 0;
1917 }

References RasterMap::Get(), m_elems, m_land, tole_LargeRoad, and tole_SmallRoad.

◆ SupplyRodenticide()

double Landscape::SupplyRodenticide ( int  a_x,
int  a_y 
)

Gets total rodenticide for a location.

586  {
588  {
589  double pp;
590  pp = m_RodenticideManager->GetRodenticide(a_x, a_y);
591  return pp;
592  }
593  return 0;
594 }

References cfg_rodenticide_enable, and CfgBool::value().

Referenced by Vole_Base::RodenticideIngestion().

◆ SupplyRodenticidePredatoryManager()

RodenticidePredators_Population_Manager* Landscape::SupplyRodenticidePredatoryManager ( )
inline
786 { return m_RodenticidePreds; }

References m_RodenticidePreds.

◆ SupplySeedCoating()

double Landscape::SupplySeedCoating ( int  a_polyref,
PlantProtectionProducts  a_ppp 
)

Gets total seed coating for the centorid of a polygen.

1399  {
1400  if (!l_pest_enable_pesticide_engine.value()) return 0.0;
1401 #ifdef __DETAILED_PESTICIDE_FATE
1402 #ifdef __FLOWER_PESTICIDE
1403  return g_pest->SupplyPesticideSeed(a_polyref, a_ppp);
1404 #endif
1405  return 0.0;
1406 #else
1407  return 0.0;
1408 #endif
1409 }

References g_pest, l_pest_enable_pesticide_engine, Pesticide::SupplyPesticideSeed(), and CfgBool::value().

◆ SupplyShouldSpray()

bool Landscape::SupplyShouldSpray ( )
inline

Returns m_toxShouldSpray, a flag indicating whether pesticide should be sprayed.

580 { return m_toxShouldSpray; }

References m_toxShouldSpray.

Referenced by Orchard::DoDevelopment(), and OrchardBand::DoDevelopment().

◆ SupplySimAreaHeight()

int Landscape::SupplySimAreaHeight ( void  )
inline

◆ SupplySimAreaMaxExtent()

int Landscape::SupplySimAreaMaxExtent ( void  )
inline

Returns which ever is larger, height or width of simulation landscape.

2308 {
2309  return m_maxextent;
2310 }

References m_maxextent.

◆ SupplySimAreaMinExtent()

int Landscape::SupplySimAreaMinExtent ( void  )

Returns which ever is smaller, height or width of simulation landscape LKM - used??

◆ SupplySimAreaWidth()

int Landscape::SupplySimAreaWidth ( void  )
inline

Gets the simulation landscape width.

2298 {
2299  return m_width;
2300 }

References m_width.

Referenced by Beetle_Base::Beetle_1M_Move(), Bembidion_Population_Manager::Bembidion_Population_Manager(), TAnimal::CorrectWrapRound(), SkTerritories::DumpMapGraphics(), THare::ForageSquare(), THare::ForageSquareP(), Vole_Population_Manager::GeneticsOutputFile(), IDMap< TAnimal * >::IDMap(), IDMapScaled::IDMapScaled(), Erigone_Population_Manager::Init(), Oedothorax_Population_Manager::Init(), MovementMapUnsigned::Init(), MovementMap::Init(), MovementMap16::Init(), Skylark_Population_Manager::Init(), Ladybird_Population_Manager::Ladybird_Population_Manager(), Vole_Population_Manager::LandscapeQuadrantOutputProbe(), MovementMap::MovementMap(), MovementMap16::MovementMap16(), MovementMapUnsigned::MovementMapUnsigned(), OsmiaParasitoid_Population_Manager::OsmiaParasitoid_Population_Manager(), PesticideOutput::PesticideOutput(), PoecilusCupreus_Population_Manager::PoecilusCupreus_Population_Manager(), PositionMap::PositionMap(), TPredator_Population_Manager::PredSampleFile(), ScalablePositionMap::ScalablePositionMap(), SimplePositionMap::SimplePositionMap(), SimplePositionMapInt::SimplePositionMapInt(), SimplePositionMapPointers< AnimalTypes >::SimplePositionMapPointers(), SkTerritories::SkTerritories(), Skylark_Female::st_Arriving(), skTTerritory::TestNestPossibility(), Beetle_Population_Manager::TheReallyBigOutputProbe(), Erigone_Population_Manager::TheRipleysOutputProbe(), Oedothorax_Population_Manager::TheRipleysOutputProbe(), Vole_Population_Manager::TheRipleysOutputProbe(), Skylark_Population_Manager::TheRipleysOutputProbe(), THare_Population_Manager::TheRipleysOutputProbe(), Beetle_Population_Manager::TheRipleysOutputProbe(), and TPredator::TPredator().

◆ SupplySkScrapes()

bool Landscape::SupplySkScrapes ( int  a_polyref)
inline

Returns the presence of skylark scrapes in the vegetation using the polygon reference number a_polyref.

1568 {
1569  return m_elems[ m_polymapping[ a_polyref ]]->GetSkScrapes();
1570 }

References m_elems, and m_polymapping.

Referenced by Skylark_Adult::GetVegHindrance(), and SkTerritories::PrePolyNQual().

◆ SupplySnowcover() [1/2]

bool Landscape::SupplySnowcover ( long  a_date)
inline

Passes a request on to the associated Weather class function, the snow cover for the current day.

2085 {
2086  return g_weather->GetSnow( a_date );
2087 }

References g_weather, and Weather::GetSnow().

◆ SupplySnowcover() [2/2]

bool Landscape::SupplySnowcover ( void  )
inline

Passes a request on to the associated Weather class function, the snow cover for the current day.

2092 {
2093  return g_weather->GetSnow();
2094 }

References g_weather, and Weather::GetSnow().

Referenced by Skylark_Female::st_PreparingForBreeding().

◆ SupplySnowDepth()

double Landscape::SupplySnowDepth ( void  )
inline

Passes a request on to the associated Weather class function, the snow depth for the current day.

2099 {
2100  return g_weather->GetSnowDepth();
2101 }

References g_weather, and Weather::GetSnowDepth().

◆ SupplySoilTemp() [1/2]

double Landscape::SupplySoilTemp ( long  a_date)
inline

Passes a request on to the associated Weather class function, the soil temperature for all dates.

1989 {
1990  return g_weather->GetSoilTemp(a_date);
1991 }

References g_weather, and Weather::GetSoilTemp().

◆ SupplySoilTemp() [2/2]

double Landscape::SupplySoilTemp ( void  )
inline

Passes a request on to the associated Weather class function, the soil temperature for the current day.

2029 {
2030  return g_weather->GetSoilTemp();
2031 }

References g_weather, and Weather::GetSoilTemp().

Referenced by Beetle_Population_Manager::DayDegreeCalculations(), and Beetle_Adult::IncNegDegrees().

◆ SupplySoilTempHour()

double Landscape::SupplySoilTempHour ( int  hour)
inline

Returns the soil temperature in a given hour (0 to 23)

2034 {
2035  return g_weather->GetSoilTempHour(hour);
2036 }

References g_weather, and Weather::GetSoilTempHour().

Referenced by Beetle_Population_Manager::DayDegreeCalculations().

◆ SupplySoilType()

int Landscape::SupplySoilType ( int  a_x,
int  a_y 
)
inline

Returns the soil type in ALMaSS types reference numbers.

814  {
815  return m_elems[m_land->Get(a_x, a_y)]->GetSoilType();
816  }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplySoilTypeR()

int Landscape::SupplySoilTypeR ( int  a_x,
int  a_y 
)
inline

Returns the soil type in rabbit warren reference numbers.

818  {
819  return m_elems[m_land->Get(a_x, a_y)]->GetSoilTypeR();
820  }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplySprayPesticideRate() [1/2]

double Landscape::SupplySprayPesticideRate ( int  a_polyref)

Gets the sprayed pesticide rate in the given field.

1516  {
1517  return m_elems[m_polymapping[a_polyref]]->GetSprayPPPRate();
1518 }

References m_polymapping.

◆ SupplySprayPesticideRate() [2/2]

double Landscape::SupplySprayPesticideRate ( int  a_x,
int  a_y 
)

Gets the sprayed pesticide rate in the given location.

1512  {
1513  return m_elems[ m_land->Get( a_x, a_y ) ]->GetSprayPPPRate();
1514 }

Referenced by PesticideToxicity::doOverspray().

◆ SupplySprayPesticideType() [1/2]

PlantProtectionProducts Landscape::SupplySprayPesticideType ( int  a_polyref)

Gets the sprayed pesticide type in the given field.

1508  {
1509  return m_elems[m_polymapping[a_polyref]]->GetSprayPPPType();
1510 }

References m_polymapping.

◆ SupplySprayPesticideType() [2/2]

PlantProtectionProducts Landscape::SupplySprayPesticideType ( int  a_x,
int  a_y 
)

Gets the sprayed pesticide type in the given location.

1504  {
1505  return m_elems[ m_land->Get( a_x, a_y ) ]->GetSprayPPPType();
1506 }

Referenced by PesticideToxicity::doOverspray().

◆ SupplySugar() [1/2]

double Landscape::SupplySugar ( int  a_polyref)
inline

Returns information on the sugar produced by the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

653 { return m_elems[a_polyref]->GetSugar(); }

References m_elems.

◆ SupplySugar() [2/2]

double Landscape::SupplySugar ( int  a_x,
int  a_y 
)
inline

Returns information on the sugar produced by the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

655 { return m_elems[m_land->Get(a_x, a_y)]->GetSugar(); }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplySugDD()

double Landscape::SupplySugDD ( int  a_polyref)
inline

Returns the current day degree sum for sugar production of the vegetation using the polygon reference number a_polyref.

679 { return m_elems[a_polyref]->supplySugDD(); }

References m_elems.

◆ SupplyTemp() [1/2]

double Landscape::SupplyTemp ( long  a_date)
inline

Passes a request on to the associated Weather class function, the temperature for all dates.

1984 {
1985  return g_weather->GetTemp(a_date);
1986 }

References g_weather, and Weather::GetTemp().

◆ SupplyTemp() [2/2]

◆ SupplyTempHour()

double Landscape::SupplyTempHour ( int  hour)
inline

Returns the temperature in a given hour (0 to 23)

2104 {
2105  return g_weather->GetTempHour(hour);
2106 }

References g_weather, and Weather::GetTempHour().

Referenced by Ladybird_Population_Manager::DayDegreeCalculations(), and Aphid_Population_Manager::updateMortalityArrayShared().

◆ SupplyTempPeriod()

double Landscape::SupplyTempPeriod ( long  a_date,
int  a_period 
)
inline

Passes a request on to the associated Weather class function, the total temperature from a_date and a_period of days.

2055 {
2056  return g_weather->GetTempPeriod( a_date, a_period );
2057 }

References g_weather, and Weather::GetTempPeriod().

Referenced by Osmia_Population_Manager::DoLast().

◆ SupplyThePopManagerList()

PopulationManagerList* Landscape::SupplyThePopManagerList ( )
inline

Set the pointer to the list of active population managers.

313 { return m_ThePopManagerList; }

References m_ThePopManagerList.

Referenced by Osmia_Population_Manager::Init().

◆ SupplyTimezone()

int Landscape::SupplyTimezone ( )
inline
583  {
584  if (m_countryCode == "FI")
585  return 2;
586  if (m_countryCode == "PT")
587  return 0;
588  if (m_countryCode == "UK")
589  return 0;
590  return 1; // default Central European Time +1
591  }

References m_countryCode.

Referenced by main().

◆ SupplyTotalNectar() [1/2]

double Landscape::SupplyTotalNectar ( int  a_polyref)
inline

Returns the nectar quantity produced by the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

665 { return m_elems[a_polyref]->GetTotalNectar(); }

References m_elems.

◆ SupplyTotalNectar() [2/2]

double Landscape::SupplyTotalNectar ( int  a_x,
int  a_y 
)
inline

Returns the nectar quantity produced by the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

667 { return m_elems[m_land->Get(a_x, a_y)]->GetTotalNectar(); }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyTotalPollen() [1/2]

double Landscape::SupplyTotalPollen ( int  a_polyref)
inline

Returns the sugar quantity produced by of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

671 { return m_elems[a_polyref]->GetTotalPollen(); };

References m_elems.

◆ SupplyTotalPollen() [2/2]

double Landscape::SupplyTotalPollen ( int  a_x,
int  a_y 
)
inline

Returns the sugar quantity produced by of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

673 { return m_elems[m_land->Get(a_x, a_y)]->GetTotalPollen(); };

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyTrafficLoad() [1/2]

double Landscape::SupplyTrafficLoad ( int  a_polyref)
inline

Returns the traffic load.

1901 {
1902  return m_elems[ m_polymapping[ a_polyref ] ]->GetTrafficLoad();
1903 }

References m_elems, and m_polymapping.

◆ SupplyTrafficLoad() [2/2]

double Landscape::SupplyTrafficLoad ( int  a_x,
int  a_y 
)
inline

Returns the traffic load.

1907 {
1908  return m_elems[m_land->Get(a_x, a_y)]->GetTrafficLoad();
1909 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyTreeAge() [1/2]

int Landscape::SupplyTreeAge ( int  a_Polyref)
inline

Returns the tree age for the polygon referenced by a_polyref or a_x, a_y.

1920 {
1921  return 1;
1922 }

◆ SupplyTreeAge() [2/2]

int Landscape::SupplyTreeAge ( int  ,
int   
)
inline

Returns the tree age for the polygon referenced by a_polyref or a_x, a_y.

1027 { return 0; }

◆ SupplyTreeHeight() [1/2]

int Landscape::SupplyTreeHeight ( int  )
inline

Returns the height of trees.

1436 { return 0; }

◆ SupplyTreeHeight() [2/2]

int Landscape::SupplyTreeHeight ( int  ,
int   
)
inline

Returns the height of trees.

1432 { return 0; }

◆ SupplyUMRef()

int Landscape::SupplyUMRef ( int  a_x,
int  a_y 
)
inline

Get the unsprayed margin reference number from the polygon at x,y.

2168 {
2169  return m_elems[m_land->Get(a_x, a_y)]->GetUnsprayedMarginPolyRef();
2170 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyUnderGrowthWidth() [1/2]

int Landscape::SupplyUnderGrowthWidth ( int  )
inline

Returns the width of undergrowth.

1438 { return 0; }

◆ SupplyUnderGrowthWidth() [2/2]

int Landscape::SupplyUnderGrowthWidth ( int  ,
int   
)
inline

Returns the width of undergrowth.

1434 { return 0; }

◆ SupplyValidX()

int Landscape::SupplyValidX ( int  a_polyref)
inline

Returns an x-coordinate guaranteed to be within the polygon referenced.

2138 {
2139  return m_elems[ m_polymapping[ a_polyref ] ]->GetValidX();
2140 }

References m_elems, and m_polymapping.

◆ SupplyValidY()

int Landscape::SupplyValidY ( int  a_polyref)
inline

Returns an y-coordinate guaranteed to be within the polygon referenced.

2143 {
2144  return m_elems[ m_polymapping[ a_polyref ] ]->GetValidY();
2145 }

References m_elems, and m_polymapping.

◆ SupplyVegAge() [1/2]

int Landscape::SupplyVegAge ( int  a_Polyref)
inline

Returns the vegetation age for the polygon referenced by a_polyref or a_x, a_y.

1703 {
1704  return m_elems[ m_polymapping[ a_polyref ]]->GetVegAge();
1705 }

References m_elems, and m_polymapping.

◆ SupplyVegAge() [2/2]

int Landscape::SupplyVegAge ( int  a_x,
int  a_y 
)
inline

Returns the vegetation age for the polygon referenced by a_polyref or a_x, a_y.

1708 {
1709  return m_elems[m_land->Get(a_x, a_y)]->GetVegAge();
1710 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyVegArea()

double Landscape::SupplyVegArea ( int  v)
inline

Records all area vegetation types and transform it into a table.

305 { return l_vegtype_areas[v]; }

References l_vegtype_areas.

Referenced by Skylark_Population_Manager::FledgelingProbeOutput().

◆ SupplyVegBiomass() [1/2]

double Landscape::SupplyVegBiomass ( int  a_polyref)
inline

Returns the biomass of the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y.

1543 {
1544  return m_elems[ m_polymapping[ a_polyref ]]->GetVegBiomass();
1545 }

References m_elems, and m_polymapping.

Referenced by Erigone_Juvenile::CalcDrought(), Oedothorax_Juvenile::CalcDrought(), Oedothorax_Female::CalcDrought(), Erigone_Female::CalcDrought(), SubPopulation_Population_Manager::initialisePopulation(), Pesticide::RecordAllPesticideCompartments(), and SubPopulation_Population_Manager::Run().

◆ SupplyVegBiomass() [2/2]

double Landscape::SupplyVegBiomass ( int  a_x,
int  a_y 
)
inline

Returns the biomass of the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y.

1548 {
1549  return m_elems[ m_land->Get( a_x, a_y ) ]->GetVegBiomass();
1550 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyVegBiomassVector()

double Landscape::SupplyVegBiomassVector ( unsigned int  a_index)
inline

Returns the biomass of the vegetation using the index a_index to Landscape::m_elems.

1538 {
1539  return m_elems[ a_index ]->GetVegBiomass();
1540 }

References m_elems.

◆ SupplyVegCover() [1/2]

double Landscape::SupplyVegCover ( int  a_polyref)
inline

Returns the vegetation cover proportion of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

1668 {
1669  return m_elems[m_polymapping[a_polyref]]->GetVegCover();
1670 }

References m_elems, and m_polymapping.

Referenced by Pesticide::MainMapDecay(), and PoecilusCupreus_Adult::MoveTo_Quality_Assess().

◆ SupplyVegCover() [2/2]

double Landscape::SupplyVegCover ( int  a_x,
int  a_y 
)
inline

Returns the vegetation cover proportion of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

1683 {
1684  return m_elems[ m_land->Get( a_x, a_y ) ]->GetVegCover();
1685 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyVegCoverVector()

double Landscape::SupplyVegCoverVector ( unsigned int  a_index)
inline

Returns the vegetation cover proportion of the vegetation using the polygon index to Landscape::m_elems.

1678 {
1679  return m_elems[ a_index ]->GetVegCover();
1680 }

References m_elems.

Referenced by vole_tole_move_quality(), and vole_toletoc_asses_habitat_score().

◆ SupplyVegDensity() [1/2]

int Landscape::SupplyVegDensity ( int  a_polyref)
inline

Returns the density of the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y.

1563 {
1564  return m_elems[ m_polymapping[ a_polyref ]]->GetVegDensity();
1565 }

References m_elems, and m_polymapping.

Referenced by Skylark_Adult::GetVegHindrance(), and SkTerritories::PrePolyNQual().

◆ SupplyVegDensity() [2/2]

int Landscape::SupplyVegDensity ( int  a_x,
int  a_y 
)
inline

Returns the density of the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y.

1573 {
1574  return m_elems[ m_land->Get( a_x, a_y ) ]->GetVegDensity();
1575 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyVegDigestibility() [1/2]

double Landscape::SupplyVegDigestibility ( int  a_polyref)
inline

Gets the digestibility of the vegetation for a polygon given by a_polyref or based on the x, y coordinates given by a_x, a_y.

1513 {
1514  return m_elems[ m_polymapping[ a_polyref ]]->GetDigestibility();
1515 }

References m_elems, and m_polymapping.

◆ SupplyVegDigestibility() [2/2]

double Landscape::SupplyVegDigestibility ( int  a_x,
int  a_y 
)
inline

Gets the digestibility of the vegetation for a polygon given by a_polyref or based on the x, y coordinates given by a_x, a_y.

1518 {
1519  return m_elems[ m_land->Get( a_x, a_y ) ]->GetDigestibility();
1520 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyVegDigestibilityVector()

double Landscape::SupplyVegDigestibilityVector ( unsigned int  a_index)
inline

Gets the digestibility of the vegetation based on an index to the Landscape::m_elems array.

1508 {
1509  return m_elems[ a_index ]->GetDigestibility();
1510 }

References m_elems.

◆ SupplyVegGrowthStage() [1/2]

double Landscape::SupplyVegGrowthStage ( int  a_polyref)
inline

Returns the vegetation growth stage of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

1643 {
1644  return m_elems[ m_polymapping[ a_polyref ]]->GetVegGrowthStage();
1645 }

References m_elems, and m_polymapping.

Referenced by Aphid::doReproduction().

◆ SupplyVegGrowthStage() [2/2]

double Landscape::SupplyVegGrowthStage ( int  a_x,
int  a_y 
)
inline

Returns the vegetation growth stage of the vegetation using the polygon reference number a_polyref or based on the x,y coordinates given by a_x, a_y.

1648 {
1649  return m_elems[ m_land->Get( a_x, a_y ) ]->GetVegGrowthStage();
1650 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyVegHeight() [1/2]

double Landscape::SupplyVegHeight ( int  a_polyref)
inline

Returns the height of the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y.

1528 {
1529  return m_elems[ m_polymapping[ a_polyref ]]->GetVegHeight();
1530 }

References m_elems, and m_polymapping.

Referenced by Skylark_Female::CheckForFields(), Aphid::doReproduction(), SkTerritories::DumpMapGraphics(), Skylark_Adult::GetVegHindrance(), Hare_Female::PlaceYoung(), SkTerritories::PrePoly2Qual(), SkTerritories::PrePolyNQual(), and Pesticide::RecordAllPesticideCompartments().

◆ SupplyVegHeight() [2/2]

double Landscape::SupplyVegHeight ( int  a_x,
int  a_y 
)
inline

Returns the height of the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y.

1533 {
1534  return m_elems[ m_land->Get( a_x, a_y ) ]->GetVegHeight();
1535 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyVegHeightVector()

double Landscape::SupplyVegHeightVector ( unsigned int  a_index)
inline

Returns the height of the vegetation using the index to Landscape::m_elems.

1523 {
1524  return m_elems[ a_index ]->GetVegHeight();
1525 }

References m_elems.

Referenced by vole_tole_move_quality(), and vole_toletoc_asses_habitat_score().

◆ SupplyVegPatchy() [1/2]

bool Landscape::SupplyVegPatchy ( int  a_polyref)
inline

Returns whether the polygon referenced by a_polyref or a_x, a_y has a vegetation type designated as patchy.

1004 { return SupplyAttIsVegPatchy(a_polyref); }

References SupplyAttIsVegPatchy().

Referenced by Skylark_Adult::GetVegHindrance(), SkTerritories::PrePoly2Qual(), and SkTerritories::PrePolyNQual().

◆ SupplyVegPatchy() [2/2]

bool Landscape::SupplyVegPatchy ( int  a_x,
int  a_y 
)
inline

Returns whether the polygon referenced by a_polyref or a_x, a_y has a vegetation type designated as patchy.

1006 { return SupplyAttIsVegPatchy(a_x, a_y); }

References SupplyAttIsVegPatchy().

◆ SupplyVegPhase()

int Landscape::SupplyVegPhase ( int  a_poly)
inline

Returns the current vegetation growth phase for a polygon.

321  {
322  return m_elems[m_polymapping[a_poly]]->GetVegPhase();
323  }

References m_elems, and m_polymapping.

◆ SupplyVegType() [1/2]

◆ SupplyVegType() [2/2]

TTypesOfVegetation Landscape::SupplyVegType ( int  polyref)
inline

Returns the vegetation type of the polygon using the polygon reference number a_polyref or coordinates a_x, a_y. Returns the value as a # TTypesOfVegetation.

1832 {
1833  return m_elems[ m_polymapping[ a_polyref ] ]->GetVegType();
1834 }

References m_elems, and m_polymapping.

◆ SupplyVegTypeVector()

TTypesOfVegetation Landscape::SupplyVegTypeVector ( unsigned int  a_index)
inline

Returns the vegetation type of the polygon using the polygon index to m_elems. Returns the value as a # TTypesOfVegetation.

1838 {
1839  return m_elems[ a_index ]->GetVegType();
1840 }

References m_elems.

◆ SupplyVersion()

const char* Landscape::SupplyVersion ( void  )
inline

Returns version info LKM.

1386 { return m_versioninfo; }

References m_versioninfo.

◆ SupplyWeedBiomass() [1/2]

double Landscape::SupplyWeedBiomass ( int  a_polyref)
inline

Returns the weed biomass of the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y.

1553 {
1554  return m_elems[ m_polymapping[ a_polyref ]]->GetWeedBiomass();
1555 }

References m_elems, and m_polymapping.

◆ SupplyWeedBiomass() [2/2]

double Landscape::SupplyWeedBiomass ( int  a_x,
int  a_y 
)
inline

Returns the weed biomass of the vegetation using the polygon reference number a_polyref or based on the x, y coordinates given by a_x, a_y.

1558 {
1559  return m_elems[ m_land->Get( a_x, a_y ) ]->GetWeedBiomass();
1560 }

References RasterMap::Get(), m_elems, and m_land.

◆ SupplyWind() [1/2]

double Landscape::SupplyWind ( long  a_date)
inline

Passes a request on to the associated Weather class function, the wind speed for all dates.

2045 {
2046  return g_weather->GetWind( a_date );
2047 }

References g_weather, and Weather::GetWind().

◆ SupplyWind() [2/2]

double Landscape::SupplyWind ( void  )
inline

Passes a request on to the associated Weather class function, the wind speed for the current day.

2062 {
2063  return g_weather->GetWind();
2064 }

References g_weather, and Weather::GetWind().

Referenced by Oedothorax_Population_Manager::DoFirst(), SubPopulation_Population_Manager::DoFirst(), SubPopulation_Population_Manager::doFlying(), and Ladybird_Population_Manager::GetFlyingWeather().

◆ SupplyWindDirection()

int Landscape::SupplyWindDirection ( void  )
inline

Passes a request on to the associated Weather class function, the wind direction in 4 directions for the current day.

2068 {
2069  return g_weather->GetWindDirection();
2070 }

References g_weather, and Weather::GetWindDirection().

Referenced by SubPopulation_Population_Manager::doFlying(), and Pesticide::Tick().

◆ SupplyWindDirection8()

int Landscape::SupplyWindDirection8 ( void  )
inline

Passes a request on to the associated Weather class function, the wind direction in 8 directions for the current day.

2073 {
2074  return g_weather->GetWindDirection8();
2075 }

References g_weather, and Weather::GetWindDirection8().

Referenced by Erigone_Population_Manager::DoFirst(), and Oedothorax_Population_Manager::DoFirst().

◆ SupplyWindDirectionRadians()

double Landscape::SupplyWindDirectionRadians ( void  )
inline

Passes a request on to the associated Weather class function, the wind direction in radians for the current day.

2079 {
2081 }

References g_weather, and Weather::GetWindDirectionRadians().

◆ SupplyWindHour()

double Landscape::SupplyWindHour ( int  hour)
inline

Returns the wind speed in a given hour (0 to 23)

2109 {
2110  return g_weather->GetWindHour(hour);
2111 }

References g_weather, and Weather::GetWindHour().

◆ SupplyWindPeriod()

double Landscape::SupplyWindPeriod ( long  a_date,
int  a_period 
)
inline

Passes a request on to the associated Weather class function, the total wind speed from a_date and a_period of days.

2050 {
2051  return g_weather->GetWindPeriod( a_date, a_period );
2052 }

References g_weather, and Weather::GetWindPeriod().

◆ SupplyYear()

int Landscape::SupplyYear ( void  )
inline

Passes a request on to the associated Calendar class function, returns m_year.

2283 {
2284  return g_date->GetYear();
2285 }

References g_date, and Calendar::GetYear().

Referenced by Vole_Population_Manager::GeneticsResultsOutput().

◆ SupplyYearNumber()

int Landscape::SupplyYearNumber ( void  )
inline

◆ 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.

To get some habitat specific data

2943  {
2952  g_date->Tick();
2953  g_weather->Tick();
2954 
2955 
2956  // Remember todays LAItotal for veg elements
2957  for (unsigned int i = 0; i < m_elems.size(); i++) {
2958  m_elems[i]->StoreLAItotal();
2959  }
2960 
2961  if (g_date->JanFirst()) {
2962  // Update the growth curve phases if needed.
2963  if (g_rand_uni_fnc() > 0.5) {
2965  SetGrainDist(1);
2966  }
2967  else {
2969  SetGrainDist(0);
2970  }
2971  for (unsigned int i = 0; i < m_elems.size(); i++) {
2972  m_elems[i]->SetGrowthPhase(janfirst);
2973  }
2974  // Update the pest incidene for this year
2977  }
2978  else if (g_date->MarchFirst()) {
2979  for (unsigned int i = 0; i < m_elems.size(); i++) {
2980  m_elems[i]->SetGrowthPhase(marchfirst);
2981  m_elems[i]->SetStubble(false);
2982  }
2983  // Check and see if the pesticide engine flag should be set
2985  m_toxShouldSpray = true;
2986  else m_toxShouldSpray = false;
2987  }
2988 
2989  //Get ready for updating the flower info
2990  if(g_date->JanFirst()){
2992  }
2993 
2995  // update flower resource for the habitat
2997  //Reset the left proportion for every cell everyday
2998  m_nectar_map.fill(0);
2999  m_pollen_map.fill(0);
3002  // Reset the biomass map
3003  m_biomass_map.setZero();
3004  }
3005  }
3006  // Grow the green stuff and let the bugs have some too.
3007  #pragma omp parallel for
3008  for (int i = 0; i < m_elems.size(); i++) {
3009  m_elems[i]->Tick();
3010  m_elems[i]->DoDevelopment();
3011  }
3012 
3013  /* Testing removal - may cause issues with increasing or decreasing permanent vegetation
3014  if ( g_date->DayInYear() == g_date->DayInYear( 1, 11 ) ) {
3015  // Set all elements to smooth curve transition mode at November 1st.
3016  for ( unsigned int i = 0; i < m_elems.size(); i++ ) {
3017  m_elems[ i ]->ForceGrowthInitialize();
3018  }
3019  //save the day degrees - used for crops that are not harvested instead of biomass to determine yield; done on Nov 1st
3020  //m_FarmManager->SetDD (SupplyTempPeriod( g_date->Date(), 245)); // from Nov 1 - 245 days back till March 1;
3021  //DegreesDump();
3022  }
3023  */
3024 
3025  // Put the farmers to work.
3027 
3028  if (!m_firstyear) {
3032  if (g_date->GetDayInMonth() == 1)
3033  //if (g_date->DayInYear() == cfg_pesticidemapdayinyear.value())
3034  if (cfg_pesticidemapon.value())
3035  {
3037  else {
3041  }
3042 
3043  }
3044  else {
3046  }
3047  // Update pesticide information.
3049  g_pest->Tick();
3050  // Update rodenticide information if we are using this
3051  if (cfg_rodenticide_enable.value()) {
3052  m_RodenticideManager->Tick();
3053  m_RodenticidePreds->Tick();
3054  }
3055 
3056  // Dump event information if necessary
3061  //EventDumpPesticides( l_map_dump_event_x1.value(), l_map_dump_event_y1.value() );
3062 
3064  GrainDump();
3065  }
3066  }
3067 
3068  //debug pollen nectar model
3069 
3070  #ifdef __FLOWERTESTING
3071 
3072  fstream ofilepn(cfg_habitat_polnek_file.value(), ios::app);
3073  //ofilepn << SupplyDayInYear() << '\t';
3074  int temp_i = -1;
3075  for (auto [key, value] : m_polyid_habitat)
3076  {
3077  if(value != -1){
3078  temp_i ++;
3079  if(temp_i != 0) ofilepn << ',';
3080  ofilepn << PolytypeToString(SupplyElementType(value))+"-"+std::to_string(key)<< ','<< SupplySugar(value) << ',' << SupplyNectar(value).m_quantity << ','<<SupplyPollen(value).m_quality << ','<<SupplyPollen(value).m_quantity;
3081  }
3082 
3083  }
3084  ofilepn<< endl;
3085  ofilepn.close();
3086 
3087  fstream ofilepntov(cfg_tov_polnek_file.value(), ios::app);
3088  std::string veg_name = VegtypeToString(SupplyVegType(m_polyid_farm));
3089  size_t start_pos = veg_name.find(",");
3090  if(start_pos != std::string::npos)
3091  veg_name = veg_name.replace(start_pos, 1, "_");
3092  start_pos = veg_name.find(",");
3093  if(start_pos != std::string::npos)
3094  veg_name = veg_name.replace(start_pos, 1, "_");
3095  ofilepntov << veg_name << ','<< SupplySugar(m_polyid_farm) << ',' << SupplyNectar(m_polyid_farm).m_quantity << ','<<SupplyPollen(m_polyid_farm).m_quality << ','<<SupplyPollen(m_polyid_farm).m_quantity << endl;
3096  ofilepntov.close();
3097 
3098 
3102  fstream ofilepntotal(cfg_total_polnek_file.value(), ios::app);
3103  double nectar=0;
3104  double sugar=0;
3105  double pollen=0;
3106 
3107  for (int i= 0; i<m_poly_with_flowers.size(); i++){
3108  int temp_poly_id = m_poly_with_flowers.at(i);
3109  nectar += SupplyTotalNectar(temp_poly_id);
3110  double temp_nectar_quality = SupplySugar(temp_poly_id);
3111  sugar += SupplyPolygonArea(temp_poly_id) * temp_nectar_quality;
3112  pollen += SupplyTotalPollen(temp_poly_id);
3113  }
3114  ofilepntotal << nectar << ','<< sugar<< ','<< pollen<<','<< g_date->DayInYear() <<','<<SupplyTemp()<<endl;
3115  ofilepntotal.close();
3116  #endif
3117 
3118 }

References cfg_habitat_polnek_file, cfg_pesticidemapnoyears, cfg_pesticidemapon, cfg_pesticidemapstartyear, cfg_pesticidemaptype, cfg_pesticidetableon, cfg_pollen_nectar_on, cfg_productapplicendyear, cfg_productapplicstartyear, cfg_rodenticide_enable, cfg_total_polnek_file, cfg_tov_polnek_file, Calendar::Date(), Calendar::DayInYear(), g_date, g_nectarpollen, g_pest, g_rand_uni_fnc(), g_weather, Calendar::GetDayInMonth(), Calendar::GetYearNumber(), janfirst, Calendar::JanFirst(), 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_grain_each_x_days, l_map_dump_grain_enable, l_map_dump_veg_enable, l_map_dump_veg_x, l_map_dump_veg_y, l_pest_enable_pesticide_engine, marchfirst, Calendar::MarchFirst(), PollenNectarDevelopmentData::RecalculatePollenNectarCurvesForYear(), Calendar::Tick(), Pesticide::Tick(), Weather::Tick(), CfgInt::value(), CfgBool::value(), and CfgStr::value().

Referenced by TurnTheWorld().

◆ TranslateEleTypes()

TTypesOfLandscapeElement Landscape::TranslateEleTypes ( int  EleReference)
inline

Returns element type translated from the ALMaSS reference number.

2314 {
2315  return g_letype->TranslateEleTypes( EleReference );
2316 }

References g_letype, and LE_TypeClass::TranslateEleTypes().

Referenced by Osmia_Nest_Manager::InitOsmiaBeeNesting(), and Population_Manager_Base::ProbeFileInput().

◆ TranslateEleTypesFromString()

TTypesOfLandscapeElement Landscape::TranslateEleTypesFromString ( string  EleReference)
inline

Returns element type translated from the ALMaSS reference string.

2320 {
2321  return g_letype->TranslateEleTypesFromString( EleReference );
2322 }

References g_letype, and LE_TypeClass::TranslateEleTypesFromString().

◆ TranslateVegTypes()

TTypesOfVegetation Landscape::TranslateVegTypes ( int  VegReference)
inline

◆ TurnTheWorld()

void Landscape::TurnTheWorld ( void  )
inline
1499 {
1500  Tick();
1501 }

References Tick().

Referenced by RunTheSim().

◆ VegDump()

void Landscape::VegDump ( int  x,
int  y 
)
protected

Records vegetation charateristics for the x, y location.

Records vegetation charateristics for the x,y location. Information is dumped to VegDump.txt

3209  {
3213  FILE * vfile=fopen("VegDump.txt", "a" );
3214  if (!vfile) {
3215  g_msg->Warn( WARN_FILE, "Landscape::VegDump(): Unable to open file", "VegDump.txt" );
3216  exit( 1 );
3217  }
3218  //int year = SupplyYearNumber();
3219  int year = g_date->GetYear();
3220  int day = SupplyDayInYear();
3221  std::string monthname = SupplyMonthName();
3222  int day_month = SupplyDayInMonth();
3223  double hei = SupplyVegHeight( x, y );
3224  double bio = SupplyVegBiomass( x, y );
3225  double cover = SupplyVegCover( x, y );
3226  double density = bio / ( hei + 1 );
3227  double weeds = SupplyWeedBiomass( x, y );
3228  double insects = SupplyInsects( x, y );
3229  double LATotal = SupplyLATotal(x, y);
3230  double LAGreen = SupplyLAGreen(x, y);
3231  double digest = SupplyVegDigestibility(x, y);
3232  double GreenBiomass = SupplyGreenBiomass(x,y);
3233  double DeadBiomass = SupplyDeadBiomass(x,y);
3234  int grazed = SupplyGrazingPressure(x, y);
3235  double ggraze = GetActualGooseGrazingForage(m_land->Get(x, y), gs_Pinkfoot);
3236  //int VegType = BackTranslateVegTypes(SupplyVegType(x, y));
3237  int VegType = SupplyVegType(x, y);
3238  double grain = SupplyBirdSeedForage(x, y);
3239  double pollen = -1;
3240  double nectar = -1;
3241  if (cfg_pollen_nectar_on.value()){
3242  pollen = SupplyPollenQuantity(x, y);
3243  nectar = SupplyNectarQuantity(x, y);
3244  }
3245 
3246  fprintf( vfile, "%4d\t%4d\t%10s\t%3d\t%3.2f\t%3.2f\t%3d\t%3.2f\t%3.2f\t%3.2f\t%3i=%s\t%3.2f\t%3.2f\t%3.2f\t%3.2f\t%3.2f\t%3.2f\t%3.2f\t%3.2f\t%3.2f\t%3.2f\n", year, day, monthname.c_str(), day_month, hei, bio, grazed, density, cover, weeds, VegType, VegtypeToString((TTypesOfVegetation)VegType).c_str(), insects, LATotal, LAGreen, digest, GreenBiomass, DeadBiomass, ggraze, grain, pollen, nectar );
3247  fclose( vfile );
3248 }

References cfg_pollen_nectar_on, g_date, g_msg, Calendar::GetYear(), CfgBool::value(), MapErrorMsg::Warn(), and WARN_FILE.

◆ VegtypeToString()

std::string Landscape::VegtypeToString ( TTypesOfVegetation  a_veg)

Returns the text representation of a TTypesOfVegetation type.

6518  {
6519 
6520  switch (a_veg) {
6521  case tov_None:
6522  return "None ";
6523  case tov_NoGrowth:
6524  return "NoGrowth ";
6525  case tov_NaturalGrass:
6526  return "NaturalGrass ";
6527  case tov_FlowerStrip1:
6528  return "Flower Strip Type 1 ";
6529  case tov_FlowerStrip2:
6530  return "Flower Strip Type 2 ";
6531  case tov_FlowerStrip3:
6532  return "Flower Strip Type 3 ";
6533  case tov_Carrots:
6534  return "Carrots ";
6535  case tov_BroadBeans:
6536  return "BroadBeans ";
6537  case tov_FodderGrass:
6538  return "FodderGrass ";
6540  return "CloverGrassGrazed1 ";
6542  return "CloverGrassGrazed2 ";
6543  case tov_FieldPeas:
6544  return "FieldPeas ";
6545  case tov_FieldPeasSilage:
6546  return "FieldPeasSilage ";
6547  case tov_FodderBeet:
6548  return "FodderBeet ";
6549  case tov_GenericCatchCrop:
6550  return "GenericCatchCrop ";
6551  case tov_SugarBeet:
6552  return "SugarBeet ";
6553  case tov_OFodderBeet:
6554  return "OFodderBeet ";
6555  case tov_Lawn:
6556  return "Lawn ";
6557  case tov_Maize:
6558  return "Maize ";
6559  case tov_MaizeSilage:
6560  return "MaizeSilage ";
6561  case tov_OMaizeSilage:
6562  return "OMaizeSilage ";
6563  case tov_OrchardCrop:
6564  return "OrchardCrop ";
6565  case tov_Oats:
6566  return "Oats ";
6568  return "OBarleyPeaCloverGrass";
6569  case tov_OCarrots:
6570  return "OCarrots ";
6572  return "OCloverGrassGrazed1 ";
6574  return "OCloverGrassGrazed2 ";
6576  return "OCloverGrassSilage1 ";
6577  case tov_OFieldPeas:
6578  return "OFieldPeas ";
6579  case tov_OFieldPeasSilage:
6580  return "OFieldPeasSilage ";
6581  case tov_OFirstYearDanger:
6582  return "OFirstYearDanger ";
6583  case tov_OGrazingPigs:
6584  return "OGrazingPigs ";
6585  case tov_OOats:
6586  return "OOats ";
6588  return "OPermanentGrassGrazed";
6589  case tov_OPotatoes:
6590  return "OPotatoes ";
6591  case tov_OSBarleySilage:
6592  return "OSBarleySilage ";
6593  case tov_OSeedGrass1:
6594  return "OSeedGrass1 ";
6595  case tov_OSeedGrass2:
6596  return "OSeedGrass2 ";
6597  case tov_OSetAside:
6598  return "OSetAside ";
6599  case tov_OSpringBarley:
6600  return "OSpringBarley ";
6601  case tov_OSpringBarleyExt:
6602  return "OSpringBarleyExt ";
6604  return "OSpringBarleyClover ";
6606  return "OSpringBarleyGrass ";
6607  case tov_OSpringBarleyPigs:
6608  return "OSpringBarleyPigs ";
6609  case tov_OTriticale:
6610  return "OTriticale ";
6611  case tov_OWinterBarley:
6612  return "OWinterBarley ";
6613  case tov_OWinterBarleyExt:
6614  return "OWinterBarleyExt ";
6615  case tov_OWinterRape:
6616  return "OWinterRape ";
6617  case tov_OWinterRye:
6618  return "OWinterRye ";
6620  return "OWinterWheatUndersown";
6621  case tov_OWinterWheat:
6622  return "OWinterWheat";
6624  return "OWinterWheatUsowExt ";
6626  return "PermanentGrassGrazed ";
6628  return "PermanentGrassLowYield";
6630  return "PermanentGrassTussocky";
6631  case tov_PermanentSetAside:
6632  return "PermanentSetAside ";
6633  case tov_Potatoes:
6634  return "PotatoesEat ";
6635  case tov_PotatoesIndustry:
6636  return "PotatoesIndustry ";
6637  case tov_SeedGrass1:
6638  return "SeedGrass1 ";
6639  case tov_SeedGrass2:
6640  return "SeedGrass2 ";
6641  case tov_SetAside:
6642  return "SetAside ";
6643  case tov_SpringBarley:
6644  return "SpringBarley ";
6645  case tov_SpringBarleySpr:
6646  return "SpringBarleySpr ";
6648  return "SpringBarleyPTreat ";
6650  return "SpringBarleySKMan ";
6652  return "SprBarleyCloverGrass ";
6653  case tov_SpringBarleyGrass:
6654  return "SpringBarleyGrass ";
6655  case tov_SpringBarleySeed:
6656  return "SpringBarleySeed ";
6658  return "SpringBarleySilage ";
6659  case tov_SpringRape:
6660  return "SpringRape ";
6661  case tov_SpringWheat:
6662  return "SpringWheat ";
6664  return "AgroChemIndustry Cereal ";
6665  case tov_Triticale:
6666  return "Triticale ";
6667  case tov_WinterBarley:
6668  return "WinterBarley ";
6669  case tov_WinterRape:
6670  return "WinterRape ";
6671  case tov_WinterRye:
6672  return "WinterRye ";
6673  case tov_WinterWheat:
6674  return "WinterWheat ";
6675  case tov_WinterWheatShort:
6676  return "WinterWheatShort ";
6677  case tov_WWheatPControl:
6678  return "P Trial Control ";
6680  return "P Trial Toxic Control";
6681  case tov_WWheatPTreatment:
6682  return "P Trial Treatment ";
6683  case tov_Undefined:
6684  return "Undefined ";
6686  return "WWStrigling ";
6688  return "WWStriglingSingle ";
6690  return "WWStriglingCulm ";
6692  return "SBPCGStrigling ";
6694  return "SBarleyStrigling ";
6696  return "SBarleyStriglingSgl ";
6698  return "SBarleyStriglingCulm ";
6699  case tov_MaizeStrigling:
6700  return "MaizseStrigling ";
6702  return "WRapeStrigling ";
6704  return "WRyeStrigling ";
6706  return "WBStrigling ";
6708  return "FieldPeasStrigling ";
6710  return "SBPeaCloverGrassStr ";
6711  case tov_YoungForest:
6712  return "Young Forest ";
6713  case tov_Wasteland:
6714  return "Wasteland ";
6715  case tov_Heath:
6716  return "Heath/Grass ";
6717  case tov_PlantNursery:
6718  return "Plant Nursery ";
6719  case tov_NorwegianPotatoes:
6720  return "Norwegian Potatoes ";
6721  case tov_NorwegianOats:
6722  return "Norwegian Oats ";
6724  return "Norwegian Spr. Barley";
6725  case tov_WaterBufferZone:
6726  return "Unsprayed buffer zone around water";
6727  case tov_PLWinterWheat:
6728  return "Polish Winter Wheat ";
6729  case tov_PLWinterRape:
6730  return "Polish Winter Rape ";
6731  case tov_PLWinterBarley:
6732  return "Polish Winter Barley ";
6733  case tov_PLWinterTriticale:
6734  return "Polish Winter Triticale ";
6735  case tov_PLWinterRye:
6736  return "Polish Winter Rye ";
6737  case tov_PLSpringWheat:
6738  return "Polish Spring Wheat ";
6739  case tov_PLSpringBarley:
6740  return "Polish Spring Barley ";
6741  case tov_PLMaize:
6742  return "Polish Maize ";
6743  case tov_PLMaizeSilage:
6744  return "Polish Maize Silage ";
6745  case tov_PLPotatoes:
6746  return "Polish Potatoes ";
6747  case tov_PLBeet:
6748  return "Polish Beet ";
6749  case tov_PLFodderLucerne1:
6750  return "Polish Fodder Lucerne first year ";
6751  case tov_PLFodderLucerne2:
6752  return "Polish Fodder Lucerne second/third year ";
6753  case tov_PLCarrots:
6754  return "Polish Carrots ";
6755  case tov_PLSpringBarleySpr:
6756  return "Polish Spring Barley with Spring Plough ";
6757  case tov_PLWinterWheatLate:
6758  return "Polish Winter Wheat late sown ";
6759  case tov_PLBeetSpr:
6760  return "Polish Beet with Spring Plough ";
6761  case tov_PLBeans:
6762  return "Polish Beans ";
6763 
6765  return "Portugese OliveGrove Traditional";
6767  return "Portugese OliveGrove Traditional Organic";
6769  return "Portugese OliveGrove Intensive";
6771  return "Portugese OliveGrove Super intensive";
6772 
6773  case tov_NLBeet:
6774  return "Dutch Beet ";
6775  case tov_NLCarrots:
6776  return "Dutch Carrots ";
6777  case tov_NLMaize:
6778  return "Dutch Maize ";
6779  case tov_NLPotatoes:
6780  return "Dutch Potatoes ";
6781  case tov_NLSpringBarley:
6782  return "Dutch Spring Barley ";
6783  case tov_NLWinterWheat:
6784  return "Dutch Winter Wheat ";
6785  case tov_NLCabbage:
6786  return "Dutch Cabbage ";
6787  case tov_NLTulips:
6788  return "Dutch Tulips ";
6789  case tov_NLGrassGrazed1:
6790  return "Dutch TemporalGrassGrazed1 ";
6792  return "Dutch TemporalGrassGrazed1 after catch crop ";
6793  case tov_NLGrassGrazed2:
6794  return "Dutch TemporalGrassGrazed2 ";
6795  case tov_NLGrassGrazedLast:
6796  return "Dutch TemporalGrassGrazedLast ";
6798  return "Dutch PermanentGrassGrazed ";
6799  case tov_NLBeetSpring:
6800  return "Dutch Beet after catch crop ";
6801  case tov_NLCarrotsSpring:
6802  return "Dutch Carrots after catch crop ";
6803  case tov_NLMaizeSpring:
6804  return "Dutch Maize after catch crop ";
6805  case tov_NLPotatoesSpring:
6806  return "Dutch Potatoes after catch crop ";
6808  return "Dutch Spring Barley after catch crop ";
6809  case tov_NLCabbageSpring:
6810  return "Dutch Cabbage after catch crop ";
6811  case tov_NLCatchCropPea:
6812  return "Dutch Catch Pea Crop ";
6813  case tov_NLOrchardCrop:
6814  return "Dutch Orchard Crop ";
6816  return "Dutch PermanentGrassGrazedExtensive ";
6818  return "Dutch TemporalGrassGrazedExtensive1 ";
6820  return "Dutch TemporalGrassGrazedExtensive1 after catch crop ";
6822  return "Dutch TemporalGrassGrazedExtensive2 ";
6824  return "Dutch TemporalGrassGrazedExtensiveLast ";
6825 
6826  case tov_UKBeans:
6827  return "UK Beans ";
6828  case tov_UKBeet:
6829  return "UK Beet ";
6830  case tov_UKMaize:
6831  return "UK Maize ";
6832  case tov_UKPermanentGrass:
6833  return "UK Permanent Grass ";
6834  case tov_UKPotatoes:
6835  return "UK Potatoes ";
6836  case tov_UKSpringBarley:
6837  return "UK Spring Barley ";
6838  case tov_UKTempGrass:
6839  return "UK Temp Grass ";
6840  case tov_UKWinterBarley:
6841  return "UK Winter Barley ";
6842  case tov_UKWinterRape:
6843  return "UK Winter Rape ";
6844  case tov_UKWinterWheat:
6845  return "UK Winter Wheat ";
6846 
6847  case tov_BEBeet:
6848  return "Belgium Beet ";
6849  case tov_BEBeetSpring:
6850  return "Belgium Beet after catch crop ";
6851  case tov_BECatchPeaCrop:
6852  return "Belgium Catch Pea Crop ";
6853  case tov_BEGrassGrazed1:
6854  return "Belgium TemporalGrassGrazed1 ";
6856  return "Belgium TemporalGrassGrazed1 after catch crop ";
6857  case tov_BEGrassGrazed2:
6858  return "Belgium TemporalGrassGrazed2 ";
6859  case tov_BEGrassGrazedLast:
6860  return "Belgium TemporalGrassGrazedLast ";
6861  case tov_BEMaize:
6862  case tov_BEMaizeCC:
6863  return "Belgium Maize ";
6864  case tov_BEMaizeSpring:
6865  return "Belgium Maize after catch crop ";
6866  case tov_BEOrchardCrop:
6867  return "Belgium Orchard Crop ";
6868  case tov_BEPotatoes:
6869  return "Belgium Potatoes ";
6870  case tov_BEPotatoesSpring:
6871  return "Belgium PotatoesSpring ";
6872  case tov_BEWinterBarley:
6873  case tov_BEWinterBarleyCC:
6874  return "Belgium Winter Barley ";
6875  case tov_BEWinterWheat:
6876  case tov_BEWinterWheatCC:
6877  return "Belgium Winter Wheat ";
6878 
6880  return "Portuguese PermanentGrassGrazed";
6881  case tov_PTWinterWheat:
6882  return "Portuguese Winter Wheat";
6883  case tov_PTGrassGrazed:
6884  return "Portuguese TemporalGrassGrazed";
6885  case tov_PTSorghum:
6886  return "Portuguese Sorghum";
6887  case tov_PTFodderMix:
6888  return "Portuguese Fodder Mix";
6889  case tov_PTTurnipGrazed:
6890  return "Portuguese TurnipGrazed";
6892  return "Portuguese CloverGrassGrazed1";
6894  return "Portuguese CloverGrassGrazed2";
6895  case tov_PTTriticale:
6896  return "Portuguese Triticale";
6897  case tov_PTOtherDryBeans:
6898  return "Portuguese OtherDryBeans";
6899  case tov_PTShrubPastures:
6900  return "Portuguese ShrubPastures";
6901  case tov_PTCorkOak:
6902  return "Portuguese CorkOak";
6903  case tov_PTVineyards:
6904  return "Portuguese Vineyards";
6905  case tov_PTWinterBarley:
6906  return "Portuguese Winter Barley";
6907  case tov_PTBeans:
6908  return "Portuguese Beans";
6909  case tov_PTWinterRye:
6910  return "Portuguese Winter Rye";
6911  case tov_PTRyegrass:
6912  return "Portuguese Ryegrass";
6913  case tov_PTYellowLupin:
6914  return "Portuguese Yellow Lupin";
6915  case tov_PTMaize:
6916  return "Portuguese Maize";
6917  case tov_PTOats:
6918  return "Portuguese Oats";
6919  case tov_PTPotatoes:
6920  return "Portuguese Potatoes";
6921  case tov_PTHorticulture:
6922  return "Portuguese Horticulture";
6923  case tov_PTCabbage:
6924  return "Portuguese Cabbage";
6925  case tov_PTCabbage_Hort:
6926  return "Portuguese Cabbage followed by Horticulture";
6927  case tov_PTMaize_Hort:
6928  return "Portuguese Maize followed by Horticulture";
6929  case tov_PTSetAside:
6930  return "Portuguese Set Aside";
6931 
6932  case tov_DESugarBeet: return "German Sugar Beet";
6933  case tov_DECabbage: return "German Cabbage";
6934  case tov_DECarrots: return "German Carrots";
6935  case tov_DEGrasslandSilageAnnual: return "German GrasslandSilageAnnual";
6936  case tov_DEGreenFallow_1year: return "German Green Fallow";
6937  case tov_DELegumes: return "German Legumes";
6938  case tov_DEMaize: return "German Maize";
6939  case tov_DEMaizeSilage: return "German Maise Silage";
6940  case tov_DEOats: return "German Oats";
6941  case tov_DEOCabbages: return "German Org Cabbage";
6942  case tov_DEOCarrots: return "German Org Carrots";
6943  case tov_DEOGrasslandSilageAnnual: return "German Org Grass Silage";
6944  case tov_DEOGreenFallow_1year: return "German Org Grass Fallow";
6945  case tov_DEOLegume: return "German Org Legume";
6946  case tov_DEOMaize: return "German Org Maise";
6947  case tov_DEOMaizeSilage: return "German Org Mail Silage";
6948  case tov_DEOOats: return "German Org Oats";
6949  case tov_DEOPeas: return "German Org Peas";
6950  case tov_DEOPermanentGrassGrazed: return "DE Org Perm Pasture Grazed";
6951  case tov_DEOPotatoes: return "German Org Potatoes";
6952  case tov_DEOSpringRye: return "German Org Spring Rye";
6953  case tov_DEOSugarBeet: return "German Org Sugar Beet";
6954  case tov_DEOTriticale: return "German Org Tricale";
6955  case tov_DEOWinterBarley: return "German Org Winter Barley";
6956  case tov_DEOWinterRape: return "German Org Winter Rape";
6957  case tov_DEOWinterRye: return "German Org Winter Rye";
6958  case tov_DEOWinterWheat: return "German Org Winter Wheat";
6959  case tov_DEPeas: return "German Peas";
6960  case tov_DEPermanentGrassGrazed: return "German Perm Grass Grazed";
6961  case tov_DEPermanentGrassLowYield: return "German Perm Grass Low Yield";
6962  case tov_DEOPermanentGrassLowYield: return "German Organic Perm Grass Low Yield";
6963  case tov_DEPotatoes: return "German Potaotes";
6964  case tov_DEPotatoesIndustry: return "German Potaotes Industry";
6965  case tov_DESpringRye: return "German Spring Rye";
6966  case tov_DETriticale: return "German Triticale";
6967  case tov_DEWinterRye: return "German Winter Rye";
6968  case tov_DEWinterBarley: return "German Winter Barley";
6969  case tov_DEWinterRape: return "German Winter Rape";
6970  case tov_DEWinterWheat: return "German Winter Wheat";
6971  case tov_DEWinterWheatLate: return "German Winter Wheat Late";
6972  case tov_DEAsparagusEstablishedPlantation: return "German Asparagus Established Plantation";
6973  case tov_DEOAsparagusEstablishedPlantation: return "German Organic Asparagus Established Plantation";
6974  case tov_DEHerbsPerennial_1year: return "German Perennial Herbs 1 year cultivation";
6975  case tov_DEHerbsPerennial_after1year: return "German Perennial Herbs aftter 1 year cultivation";
6976  case tov_DEOHerbsPerennial_1year: return "German Organic Perennial Herbs 1 year cultivation";
6977  case tov_DEOHerbsPerennial_after1year: return "German Organic Perennial Herbs aftter 1 year cultivation";
6978  case tov_DESpringBarley: return "German Spring Barley";
6979  case tov_DEOrchard: return "German Orchard Crop";
6980  case tov_DEOOrchard: return "German Organic Orchard Crop";
6981  case tov_DEBushFruitPerm: return "German Fruit Bushes, Strawberries, harvest years";
6982  case tov_DEOBushFruitPerm: return "German Organic Fruit Bushes, Strawberries, harvest years";
6984  return "Dummy Crop for Testing of Pesticide Sparying Distribution ";
6985 
6987  return "Danish Ecological Orchard Crop, Permanent";
6988  case tov_DKBushFruit_Perm1:
6989  return "Danish Fruit Bushes, strawberries";
6990  case tov_DKBushFruit_Perm2:
6991  return "Danish Fruit Bushes, blackcurrant";
6993  return "Danish Ecological strawberries";
6995  return "Danish Ecological Fruit Bushes blackcurrant";
6997  return "Danish Christmas Trees, 10+ years in total";
6999  return "Danish Ecological Christmas Trees, 10+ years in total";
7000  case tov_DKEnergyCrop_Perm:
7001  return "Danish Energy Crop";
7003  return "Danish Ecological Energy Crop";
7004  case tov_DKFarmForest_Perm:
7005  return "Danish Farm Forest";
7007  return "Danish Ecological Farm Forest";
7009  return "Danish Grazing Pasture for Pigs";
7011  return "Danish Ecological Grazing Pasture for Pigs";
7013  return "Danish Ecological Grazing Pasture";
7015  return "Danish Ecological Grazing Pasture Low Yield";
7017  return "Danish Farm Young Forest";
7019  return "Danish Ecological Farm Young Forest";
7020  case tov_DKOLegume_Peas:
7021  return "Danish Ecolological Legumes, Peas";
7022  case tov_DKOLegume_Beans:
7023  return "Danish Ecolological Legumes, Beans";
7024  case tov_DKOLegume_Whole:
7025  return "Danish Ecolological Legumes Whole";
7026  case tov_DKOLegume_Peas_CC:
7027  return "Danish Ecolological Legumes, Peas, followed by catch crop";
7029  return "Danish Ecolological Legumes, Beans, followed by catch crop";
7031  return "Danish Ecolological Legumes Whole, followed by catch crop";
7032  case tov_DKOLentils:
7033  return "Danish Ecological Lentils w. Oats";
7034  case tov_DKOLupines:
7035  return "Danish Ecological Lupines";
7036  case tov_DKSugarBeets:
7037  return "Danish Sugar Beet";
7038  case tov_DKOSugarBeets:
7039  return "Danish Ecological Sugar Beet";
7040  case tov_DKCabbages:
7041  return "Danish Cabbages";
7042  case tov_DKCatchCrop:
7043  return "Danish Catch Crop";
7044  case tov_DKOCabbages:
7045  return "Danish Ecological Cabbages";
7046  case tov_DKCarrots:
7047  return "Danish Carrots";
7049  return "Danish Ecological Legume W. Grass Undersown, Whole";
7050  case tov_DKOCarrots:
7051  return "Danish Ecological Carrots";
7052  case tov_DKLegume_Whole:
7053  return "Danish Legume Whole";
7054  case tov_DKLegume_Peas:
7055  return "Danish Legume Peas";
7056  case tov_DKLegume_Beans:
7057  return "Danish Legume Beans";
7058  case tov_DKWinterWheat:
7059  return "Danish Winter Wheat";
7060  case tov_DKOWinterWheat:
7061  return "Danish Ecological Winter Wheat";
7062  case tov_DKSpringBarley:
7063  return "Danish Spring Barley";
7064  case tov_DKOSpringBarley:
7065  return "Danish Ecological Spring Barley";
7066  case tov_DKWinterWheat_CC:
7067  return "Danish Winter Wheat, followed by catch crop";
7068  case tov_DKOWinterWheat_CC:
7069  return "Danish Ecological Winter Wheat, followed by catch crop";
7070  case tov_DKSpringBarley_CC:
7071  return "Danish Spring Barley, followed by catch crop";
7073  return "Danish Ecological Spring Barley, followed by catch crop";
7075  return "Danish Spring Barley w. Undersown Clover Grass";
7077  return "Danish Ecological Spring Barley w. Undersown Clover Grass";
7078  case tov_DKOCatchCrop:
7079  return "Danish Ecological Catch Crop";
7080  case tov_DKCerealLegume:
7081  return "Danish Cereal and Legume";
7082  case tov_DKOCerealLegume:
7083  return "Danish Ecological Cereal and Legume";
7085  return "Danish Cereal and Legume, Whole crop";
7087  return "Danish Ecological Cereal and Legume, Whole crop";
7089  return "Danish Clover Grass Grazed 1st year, autumn sow";
7091  return "Danish Clover Grass Grazed 1st year, sown in cover crop earlier";
7093  return "Danish Clover Grass Grazed next years";
7095  return "Danish Clover Grass Grazed last year, followed by winter crop";
7097  return "Danish Ecological Clover Grass Grazed 1st year, autumn sow";
7099  return "Danish Ecological Clover Grass Grazed 1st year, sown in cover crop earlier";
7101  return "Danish Ecological Clover Grass Grazed next years";
7103  return "Danish Ecological Clover Grass Grazed last year, followed by winter crop";
7105  return "Danish Fodder Grass, established in spring";
7107  return "Danish Fodder Grass, established in autumn";
7109  return "Danish Ecological Fodder Grass in autumn";
7111  return "Danish Ecological Fodder Grass in spring";
7112  case tov_DKGrazingPigs:
7113  return "Danish Grazing Pigs";
7114  case tov_DKMaize:
7115  return "Danish Maize";
7116  case tov_DKMaizeSilage:
7117  return "Danish Maize for Silage";
7118  case tov_DKMixedVeg:
7119  return "Danish Mixed Vegetables";
7120  case tov_DKOGrazingPigs:
7121  return "Danish Ecological Grazing Pigs";
7122  case tov_DKOMaize :
7123  return "Danish Ecological Maize";
7124  case tov_DKOMaizeSilage:
7125  return "Danish Ecological Maize for Silage";
7126  case tov_DKOMixedVeg:
7127  return "Danish Ecological Mixed Vegetables";
7128  case tov_DKOPotato:
7129  return "Danish Ecological Potatoes";
7130  case tov_DKOPotatoIndustry:
7131  return "Danish Ecological Potatoes for Industry";
7132  case tov_DKOPotatoSeed:
7133  return "Danish Ecological Potatoes for Seeds";
7135  return "Danish Ecological Rye Seed Grass, Spring";
7136  case tov_DKOSetAside:
7137  return "Danish Ecological Set Aside, spring mow";
7139  return "Danish Ecological Set Aside, annual flowers";
7141  return "Danish Ecological Set Aside, perennial flowers";
7143  return "Danish Ecological Set Aside, summer mow";
7145  return "Danish Ecological Spring Barley for Silage";
7146  case tov_DKOSpringOats:
7147  return "Danish Ecological Spring Oats";
7148  case tov_DKOSpringWheat:
7149  return "Danish Ecological Spring Wheat";
7150  case tov_DKOVegSeeds:
7151  return "Danish Ecological Vegetable Seeds";
7152  case tov_DKOWinterBarley:
7153  return "Danish Ecological Winter Barley";
7154  case tov_DKOWinterRape:
7155  return "Danish Ecological Winter Rape";
7156  case tov_DKOWinterRye:
7157  return "Danish Ecological Winter Rye";
7158  case tov_DKOWinterRye_CC:
7159  return "Danish Ecological Winter Rye, followed by catch crop";
7160  case tov_DKWinterRye_CC:
7161  return "Danish Winter Rye, followed by catch crop";
7162  case tov_DKPotato:
7163  return "Danish Potatoes";
7164  case tov_DKPotatoIndustry:
7165  return "Danish Potatoes for Industry";
7166  case tov_DKPotatoSeed:
7167  return "Danish Potatoes for Seeds";
7169  return "Danish Fescue Seed Grass, Spring";
7171  return "Danish Rye Seed Grass, Spring";
7172  case tov_DKSetAside:
7173  return "Danish Set Aside";
7175  return "Danish Set Aside, Summer Mow";
7177  return "Danish Spring Barley for Green";
7179  return "Danish Spring Barley for Silage";
7180  case tov_DKSpringOats:
7181  return "Danish Spring Oats";
7182  case tov_DKSpringOats_CC:
7183  return "Danish Spring Oats, followed by catch crop";
7184  case tov_DKOSpringOats_CC:
7185  return "Danish Ecological Spring Oats, followed by catch crop";
7186  case tov_DKSpringWheat:
7187  return "Danish Spring Wheat";
7188  case tov_DKUndefined:
7189  return "Danish Undefined";
7190  case tov_DKVegSeeds:
7191  return "Danish Vegetable Seeds";
7192  case tov_DKWinterBarley:
7193  return "Danish Winter Barley";
7194  case tov_DKWinterRape:
7195  return "Danish Winter Rape";
7196  case tov_DKWinterRye:
7197  return "Danish Winter Rye";
7199  return "Danish Plant Nursery, Permanent";
7201  return "Danish Orchard Crop, Permanent";
7203  return "Danish Grass Grazed, Permanent";
7205  return "Danish Grass Low Yeld, Permanent";
7207  return "Danish Grass Tussocky, Permanent";
7208  case tov_DKOrchApple:
7209  return "Danish Apple Orchard";
7210  case tov_DKOrchPear:
7211  return "Danish Pear Orchard";
7212  case tov_DKOrchCherry:
7213  return "Danish Cherry Orchard";
7214  case tov_DKOrchOther:
7215  return "Danish Other Orchard";
7216  case tov_DKOOrchApple:
7217  return "Danish Ecological Apple Orchard";
7218  case tov_DKOOrchPear:
7219  return "Danish Ecological Pear Orchard";
7220  case tov_DKOOrchCherry:
7221  return "Danish Ecological Cherry Orchard";
7222  case tov_DKOOrchOther:
7223  return "Danish Ecological Other Orchard";
7224  case tov_DKFodderBeets:
7225  return "Danish Fodder Beet";
7226  case tov_DKOFodderBeets:
7227  return "Danish Ecological Fodder Beet";
7229  return "Danish Optimal Flower Mix 1st year - est. annual flowers";
7231  return "Danish Optimal Flower Mix 2nd year - perennial flowers";
7233  return "Danish Optimal Flower Mix 3rd year - ryegrass";
7234 
7235  case tov_FIWinterWheat:
7236  return "Finnish Winter Wheat";
7237  case tov_FIOWinterWheat:
7238  return "Finnish Ecological Winter Wheat";
7239  case tov_FISugarBeet:
7240  return "Finnish Sugar Beet";
7242  return "Finnish Starch Potato North";
7244  return "Finnish Starch Potato South";
7246  return "Finnish Ecological Starch Potato North";
7248  return "Finnish Ecological Starch Potato South";
7249  case tov_FISpringWheat:
7250  return "Finnish Spring Wheat";
7251  case tov_FIOSpringWheat:
7252  return "Finnish Ecological Spring Wheat";
7253  case tov_FITurnipRape:
7254  return "Finnish Turnip Rape";
7255  case tov_FIOTurnipRape:
7256  return "Finnish Ecological Turnip Rape";
7257  case tov_FISpringRape:
7258  return "Finnish Spring Rape";
7259  case tov_FIOSpringRape:
7260  return "Finnish Ecological Spring Rape";
7261  case tov_FIWinterRye:
7262  return "Finnish Winter Rye";
7263  case tov_FIOWinterRye:
7264  return "Finnish Ecological Winter Rye";
7265  case tov_FIPotato_North:
7266  return "Finnish Potato North";
7267  case tov_FIPotato_South:
7268  return "Finnish Potato South";
7269  case tov_FIOPotato_North:
7270  return "Finnish Ecological Potato North";
7271  case tov_FIOPotato_South:
7272  return "Finnish Ecological Potato South";
7274  return "Finnish Potato Industry North";
7276  return "Finnish Potato Industry South";
7278  return "Finnish Ecological Potato Industry North";
7280  return "Finnish Ecological Potato Industry South";
7281  case tov_FISpringOats:
7282  return "Finnish Spring Oats";
7283  case tov_FIOSpringOats:
7284  return "Finnish Ecological Spring Oats";
7286  return "Finnish Spring Barley Malt";
7288  return "Finnish Ecological Spring Barley Malt";
7289  case tov_FIFabaBean:
7290  return "Finnish Faba Bean";
7291  case tov_FIOFabaBean:
7292  return "Finnish Ecological Faba Bean";
7294  return "Finnish Spring Barley Fodder";
7296  return "Finnish Spr Spring Barley Fodder";
7298  return "Finnish Ecological Spring Barley Fodder";
7300  return "Finnish Grassland Pasture Perennial first year";
7302  return "Finnish Grassland Pasture Perennial next years";
7304  return "Finnish Grassland Silage Perennial first year";
7306  return "Finnish Grassland Silage Perennial next years";
7308  return "Finnish Natural Grassland";
7310  return "Finnish Permanent Natural Grassland";
7311  case tov_FIFeedingGround:
7312  return "Finnish Feeding Ground";
7313  case tov_FIBufferZone:
7314  return "Finnish Buffer Zone";
7315  case tov_FIBufferZone_Perm:
7316  return "Finnish Permanent Buffer Zone";
7318  return "Finnish Green Fallow for one season only";
7320  return "Finnish Permanent Green Fallow";
7322  return "Finnish Grassland Silage Annual";
7323  case tov_FICaraway1:
7324  return "Finnish Caraway first year";
7325  case tov_FICaraway2:
7326  return "Finnish Caraway next years";
7327  case tov_FIOCaraway1:
7328  return "Finnish Ecological Caraway first year";
7329  case tov_FIOCaraway2:
7330  return "Finnish Ecological Caraway next years";
7331  case tov_SESpringBarley:
7332  return "Swedish Spring Barley";
7333  case tov_SEWinterRape_Seed:
7334  return "Swedish Winter Rape Seed";
7335  case tov_SEWinterWheat:
7336  return "Swedish Winter Wheat";
7337  case tov_IRSpringWheat:
7338  return "Irish Spring Wheat";
7339  case tov_IRSpringBarley:
7340  return "Irish Spring Barley";
7341  case tov_IRSpringOats:
7342  return "Irish Spring Oats";
7344  return "Irish Grassland, no reseeding";
7346  return "Irish Grassland, reseeding";
7347  case tov_IRWinterWheat:
7348  return "Irish Winter Wheat";
7349  case tov_IRWinterBarley:
7350  return "Irish Winter Barley";
7351  case tov_IRWinterOats:
7352  return "Irish Winter Oats";
7353  case tov_FRWinterWheat:
7354  return "French Winter Wheat";
7355  case tov_FRWinterBarley:
7356  return "French Winter Barley";
7357  case tov_FRWinterTriticale:
7358  return "French Winter Triticale";
7359  case tov_FRWinterRape:
7360  return "French Winter Rape";
7361  case tov_FRMaize:
7362  return "French Maize";
7363  case tov_FRMaize_Silage:
7364  return "French Maize Silage";
7365  case tov_FRSpringBarley:
7366  return "French Spring Barley";
7367  case tov_FRGrassland:
7368  return "French Grassland";
7369  case tov_FRGrassland_Perm:
7370  return "French Permanent Grassland";
7371  case tov_FRSpringOats:
7372  return "French Spring Oats";
7373  case tov_FRSunflower:
7374  return "French Sunflower";
7375  case tov_FRSpringWheat:
7376  return "French Spring Wheat";
7377  case tov_FRPotatoes:
7378  return "French Potatoes";
7379  case tov_FRSorghum:
7380  return "French Sorghum";
7381  case tov_ITGrassland:
7382  return "Italian Grassland";
7383  case tov_ITOrchard:
7384  return "Italian Orchard, apple";
7385  case tov_ITOOrchard:
7386  return "Italian Organic Orchard, apple";
7387  default:
7388  g_msg->Warn(WARN_FILE, "Landscape::VegtypeToString(): Unknown event type:", int(a_veg));
7389  exit(1);
7390  }
7391 }

References g_msg, tov_AgroChemIndustryCereal, tov_BEBeet, tov_BEBeetSpring, tov_BECatchPeaCrop, tov_BEGrassGrazed1, tov_BEGrassGrazed1Spring, tov_BEGrassGrazed2, tov_BEGrassGrazedLast, tov_BEMaize, tov_BEMaizeCC, tov_BEMaizeSpring, tov_BEOrchardCrop, tov_BEPotatoes, tov_BEPotatoesSpring, tov_BEWinterBarley, tov_BEWinterBarleyCC, tov_BEWinterWheat, tov_BEWinterWheatCC, tov_BroadBeans, tov_Carrots, tov_CloverGrassGrazed1, tov_CloverGrassGrazed2, tov_DEAsparagusEstablishedPlantation, tov_DEBushFruitPerm, tov_DECabbage, tov_DECarrots, tov_DEGrasslandSilageAnnual, tov_DEGreenFallow_1year, tov_DEHerbsPerennial_1year, tov_DEHerbsPerennial_after1year, tov_DELegumes, tov_DEMaize, tov_DEMaizeSilage, tov_DEOAsparagusEstablishedPlantation, tov_DEOats, tov_DEOBushFruitPerm, tov_DEOCabbages, tov_DEOCarrots, tov_DEOGrasslandSilageAnnual, tov_DEOGreenFallow_1year, tov_DEOHerbsPerennial_1year, tov_DEOHerbsPerennial_after1year, tov_DEOLegume, tov_DEOMaize, tov_DEOMaizeSilage, tov_DEOOats, tov_DEOOrchard, tov_DEOPeas, tov_DEOPermanentGrassGrazed, tov_DEOPermanentGrassLowYield, tov_DEOPotatoes, tov_DEOrchard, tov_DEOSpringRye, tov_DEOSugarBeet, tov_DEOTriticale, tov_DEOWinterBarley, tov_DEOWinterRape, tov_DEOWinterRye, tov_DEOWinterWheat, tov_DEPeas, tov_DEPermanentGrassGrazed, tov_DEPermanentGrassLowYield, tov_DEPotatoes, tov_DEPotatoesIndustry, tov_DESpringBarley, tov_DESpringRye, tov_DESugarBeet, tov_DETriticale, tov_DEWinterBarley, tov_DEWinterRape, tov_DEWinterRye, tov_DEWinterWheat, tov_DEWinterWheatLate, tov_DKBushFruit_Perm1, tov_DKBushFruit_Perm2, tov_DKCabbages, tov_DKCarrots, tov_DKCatchCrop, tov_DKCerealLegume, tov_DKCerealLegume_Whole, tov_DKChristmasTrees_Perm, tov_DKCloverGrassGrazed1, tov_DKCloverGrassGrazed2, tov_DKCloverGrassGrazed3, tov_DKEnergyCrop_Perm, tov_DKFarmForest_Perm, tov_DKFarmYoungForest_Perm, tov_DKFodderBeets, tov_DKGrassGrazed_Perm, tov_DKGrassLowYield_Perm, tov_DKGrassTussocky_Perm, tov_DKGrazingPigs, tov_DKGrazingPigs_Perm, tov_DKLegume_Beans, tov_DKLegume_Peas, tov_DKLegume_Whole, tov_DKMaize, tov_DKMaizeSilage, tov_DKMixedVeg, tov_DKOBushFruit_Perm1, tov_DKOBushFruit_Perm2, tov_DKOCabbages, tov_DKOCarrots, tov_DKOCatchCrop, tov_DKOCerealLegume, tov_DKOCerealLegume_Whole, tov_DKOChristmasTrees_Perm, tov_DKOCloverGrassGrazed1, tov_DKOCloverGrassGrazed2, tov_DKOCloverGrassGrazed3, tov_DKOEnergyCrop_Perm, tov_DKOFarmForest_Perm, tov_DKOFarmYoungForest_Perm, tov_DKOFodderBeets, tov_DKOGrassGrazed_Perm, tov_DKOGrassLowYield_Perm, tov_DKOGrazingPigs, tov_DKOGrazingPigs_Perm, tov_DKOLegume_Beans, tov_DKOLegume_Beans_CC, tov_DKOLegume_Peas, tov_DKOLegume_Peas_CC, tov_DKOLegume_Whole, tov_DKOLegume_Whole_CC, tov_DKOLegumeCloverGrass_Whole, tov_DKOLentils, tov_DKOLupines, tov_DKOMaize, tov_DKOMaizeSilage, tov_DKOMixedVeg, tov_DKOOrchApple, tov_DKOOrchardCrop_Perm, tov_DKOOrchCherry, tov_DKOOrchOther, tov_DKOOrchPear, tov_DKOPotato, tov_DKOPotatoIndustry, tov_DKOPotatoSeed, tov_DKOptimalFlowerMix1, tov_DKOptimalFlowerMix2, tov_DKOptimalFlowerMix3, tov_DKOrchApple, tov_DKOrchardCrop_Perm, tov_DKOrchCherry, tov_DKOrchOther, tov_DKOrchPear, tov_DKOSeedGrassRye_Spring, tov_DKOSetAside, tov_DKOSetAside_AnnualFlower, tov_DKOSetAside_PerennialFlower, tov_DKOSetAside_SummerMow, tov_DKOSpringBarley, tov_DKOSpringBarley_CC, tov_DKOSpringBarleyCloverGrass, tov_DKOSpringBarleySilage, tov_DKOSpringFodderGrass, tov_DKOSpringOats, tov_DKOSpringOats_CC, tov_DKOSpringWheat, tov_DKOSugarBeets, tov_DKOVegSeeds, tov_DKOWinterBarley, tov_DKOWinterCloverGrassGrazedSown, tov_DKOWinterFodderGrass, tov_DKOWinterRape, tov_DKOWinterRye, tov_DKOWinterRye_CC, tov_DKOWinterWheat, tov_DKOWinterWheat_CC, tov_DKPlantNursery_Perm, tov_DKPotato, tov_DKPotatoIndustry, tov_DKPotatoSeed, tov_DKSeedGrassFescue_Spring, tov_DKSeedGrassRye_Spring, tov_DKSetAside, tov_DKSetAside_SummerMow, tov_DKSpringBarley, tov_DKSpringBarley_CC, tov_DKSpringBarley_Green, tov_DKSpringBarleyCloverGrass, tov_DKSpringBarleySilage, tov_DKSpringFodderGrass, tov_DKSpringOats, tov_DKSpringOats_CC, tov_DKSpringWheat, tov_DKSugarBeets, tov_DKUndefined, tov_DKVegSeeds, tov_DKWinterBarley, tov_DKWinterCloverGrassGrazedSown, tov_DKWinterFodderGrass, tov_DKWinterRape, tov_DKWinterRye, tov_DKWinterRye_CC, tov_DKWinterWheat, tov_DKWinterWheat_CC, tov_DummyCropPestTesting, tov_FIBufferZone, tov_FIBufferZone_Perm, tov_FICaraway1, tov_FICaraway2, tov_FieldPeas, tov_FieldPeasSilage, tov_FieldPeasStrigling, tov_FIFabaBean, tov_FIFeedingGround, tov_FIGrasslandPasturePerennial1, tov_FIGrasslandPasturePerennial2, tov_FIGrasslandSilageAnnual, tov_FIGrasslandSilagePerennial1, tov_FIGrasslandSilagePerennial2, tov_FIGreenFallow_1year, tov_FIGreenFallow_Perm, tov_FINaturalGrassland, tov_FINaturalGrassland_Perm, tov_FIOCaraway1, tov_FIOCaraway2, tov_FIOFabaBean, tov_FIOPotato_North, tov_FIOPotato_South, tov_FIOPotatoIndustry_North, tov_FIOPotatoIndustry_South, tov_FIOSpringBarley_Fodder, tov_FIOSpringBarley_Malt, tov_FIOSpringOats, tov_FIOSpringRape, tov_FIOSpringWheat, tov_FIOStarchPotato_North, tov_FIOStarchPotato_South, tov_FIOTurnipRape, tov_FIOWinterRye, tov_FIOWinterWheat, tov_FIPotato_North, tov_FIPotato_South, tov_FIPotatoIndustry_North, tov_FIPotatoIndustry_South, tov_FISpringBarley_Fodder, tov_FISpringBarley_Malt, tov_FISpringOats, tov_FISpringRape, tov_FISpringWheat, tov_FISprSpringBarley_Fodder, tov_FIStarchPotato_North, tov_FIStarchPotato_South, tov_FISugarBeet, tov_FITurnipRape, tov_FIWinterRye, tov_FIWinterWheat, tov_FlowerStrip1, tov_FlowerStrip2, tov_FlowerStrip3, tov_FodderBeet, tov_FodderGrass, tov_FRGrassland, tov_FRGrassland_Perm, tov_FRMaize, tov_FRMaize_Silage, tov_FRPotatoes, tov_FRSorghum, tov_FRSpringBarley, tov_FRSpringOats, tov_FRSpringWheat, tov_FRSunflower, tov_FRWinterBarley, tov_FRWinterRape, tov_FRWinterTriticale, tov_FRWinterWheat, tov_GenericCatchCrop, tov_Heath, tov_IRGrassland_no_reseed, tov_IRGrassland_reseed, tov_IRSpringBarley, tov_IRSpringOats, tov_IRSpringWheat, tov_IRWinterBarley, tov_IRWinterOats, tov_IRWinterWheat, tov_ITGrassland, tov_ITOOrchard, tov_ITOrchard, tov_Lawn, tov_Maize, tov_MaizeSilage, tov_MaizeStrigling, tov_NaturalGrass, tov_NLBeet, tov_NLBeetSpring, tov_NLCabbage, tov_NLCabbageSpring, tov_NLCarrots, tov_NLCarrotsSpring, tov_NLCatchCropPea, tov_NLGrassGrazed1, tov_NLGrassGrazed1Spring, tov_NLGrassGrazed2, tov_NLGrassGrazedExtensive1, tov_NLGrassGrazedExtensive1Spring, tov_NLGrassGrazedExtensive2, tov_NLGrassGrazedExtensiveLast, tov_NLGrassGrazedLast, tov_NLMaize, tov_NLMaizeSpring, tov_NLOrchardCrop, tov_NLPermanentGrassGrazed, tov_NLPermanentGrassGrazedExtensive, 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_PTBeans, tov_PTCabbage, tov_PTCabbage_Hort, tov_PTCloverGrassGrazed1, tov_PTCloverGrassGrazed2, tov_PTCorkOak, tov_PTFodderMix, tov_PTGrassGrazed, tov_PTHorticulture, tov_PTMaize, tov_PTMaize_Hort, tov_PTOats, tov_PTOliveGroveIntensive, tov_PTOliveGroveSuperIntensive, tov_PTOliveGroveTraditional, tov_PTOliveGroveTradOrganic, tov_PTOtherDryBeans, tov_PTPermanentGrassGrazed, tov_PTPotatoes, tov_PTRyegrass, tov_PTSetAside, tov_PTShrubPastures, tov_PTSorghum, tov_PTTriticale, tov_PTTurnipGrazed, tov_PTVineyards, tov_PTWinterBarley, tov_PTWinterRye, tov_PTWinterWheat, tov_PTYellowLupin, tov_SeedGrass1, tov_SeedGrass2, tov_SESpringBarley, tov_SetAside, tov_SEWinterRape_Seed, tov_SEWinterWheat, 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_UKBeans, tov_UKBeet, tov_UKMaize, tov_UKPermanentGrass, tov_UKPotatoes, tov_UKSpringBarley, tov_UKTempGrass, tov_UKWinterBarley, tov_UKWinterRape, tov_UKWinterWheat, 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, tov_YoungForest, MapErrorMsg::Warn(), and WARN_FILE.

Referenced by Skylark_Population_Manager::OpenTheFledgelingProbe(), and Crop::StartUpCrop().

◆ Warn()

void Landscape::Warn ( std::string  a_msg1,
std::string  a_msg2 
)
inline

Wrapper for the g_msg Warn function.

2251 {
2252  g_msg->Warn( WARN_MSG, a_msg1, a_msg2 );
2253 }

References g_msg, MapErrorMsg::Warn(), and WARN_MSG.

Referenced by Hare_Female::AllYoungKilled(), Hare_Female::AllYoungMatured(), Spider_Juvenile::AssessHabitat(), Vole_Population_Manager::DoFirst(), Skylark_Nestling::EndStep(), Skylark_PreFledgeling::EndStep(), THare::EnergyBalance(), SkTerritories::EvaluateHabitatN(), Vole_Population_Manager::GeneticsOutputFile(), THare_Population_Manager::GetGrowthEfficiency(), THare_Population_Manager::GetGrowthEfficiencyF(), THare_Population_Manager::GetGrowthEfficiencyP(), THare_Population_Manager::GetKJperM(), THare_Population_Manager::GetLitterSize(), THare_Population_Manager::GetMaxDailyGrowthEnergy(), THare_Population_Manager::GetMaxDailyGrowthEnergyF(), THare_Population_Manager::GetMaxDailyGrowthEnergyP(), GetProbeInput_ini(), THare_Population_Manager::GetRMR(), Vole_Population_Manager::ImpactedProbe(), Vole_Population_Manager::Init(), THare_Population_Manager::Init(), Population_Manager::LOG(), THare::ON_MumDead(), Hare_Female::ON_RemoveYoung(), Hare_Female::ON_YoungKilled(), Skylark_Male::OnAddPreFledgeling(), Skylark_Female::OnClutchDeath(), Skylark_Male::OnEggHatch(), Skylark_Female::OnEggsHatch(), Bembidion_Population_Manager::OnFarmEvent(), Ladybird_Population_Manager::OnFarmEvent(), Skylark_Clutch::OnFarmEvent(), Skylark_Nestling::OnFarmEvent(), Skylark_PreFledgeling::OnFarmEvent(), Skylark_Female::OnFarmEvent(), Skylark_Male::OnFarmEvent(), Hare_Infant::OnFarmEvent(), Hare_Young::OnFarmEvent(), Skylark_Male::OnNestlingDeath(), Skylark_Male::OnPreFledgelingDeath(), Vole_Population_Manager::OpenResistanceOutput(), MRR_Data::OutputToFile(), THare_Population_Manager::POMOutputs(), TPredator_Population_Manager::PredAutumnSample(), TPredator_Population_Manager::PredSampleFile(), TPredator_Population_Manager::PredSpringAutumnSample(), TPredator_Population_Manager::PredSpringSample(), SkTerritories::PrePoly2Qual(), SkTerritories::PrePolyNQual(), SkTerritories::PreProcessLandscape2(), Population_Manager_Base::ProbeFileInput(), TPredator_Population_Manager::Run(), Vole_Population_Manager::SendMessage(), Population_Manager::Shuffle_or_Sort(), Skylark_Female::st_Dying(), Skylark_Male::st_Dying(), Skylark_Clutch::st_Hatching(), Hare_Female::st_ReproBehaviour(), Weasel::Step(), Owl::Step(), Spider_Egg::Step(), Beetle_Egg_List::Step(), Osmia_Egg::Step(), Spider_Juvenile::Step(), Osmia_Larva::Step(), Osmia_Prepupa::Step(), Vole_JuvenileMale::Step(), Osmia_Pupa::Step(), Spider_Female::Step(), Osmia_InCocoon::Step(), Vole_Male::Step(), Vole_JuvenileFemale::Step(), Beetle_Larvae::Step(), Skylark_Clutch::Step(), Vole_Female::Step(), Skylark_Nestling::Step(), Skylark_PreFledgeling::Step(), Osmia_Female::Step(), Beetle_Pupae::Step(), Skylark_Female::Step(), Beetle_Adult::Step(), Skylark_Male::Step(), Hare_Infant::Step(), Hare_Young::Step(), Hare_Juvenile::Step(), Hare_Male::Step(), Hare_Female::Step(), SupplyGooseGrazingForageH(), THare::TimeBudget(), vole_tole_move_quality(), and vole_toletoc_asses_habitat_score().

◆ WriteOpenness()

void Landscape::WriteOpenness ( void  )

Stores openness for all polygons to a standard file LKM - used??

Member Data Documentation

◆ hb_border_pixels

int Landscape::hb_border_pixels
protected

Referenced by hb_Add(), and hb_PaintBorder().

◆ hb_core_pixels

int Landscape::hb_core_pixels
protected

Referenced by hb_Add(), and hb_PaintBorder().

◆ hb_first_free_poly_num

int Landscape::hb_first_free_poly_num
protected

Referenced by hb_GenerateHBPolys().

◆ hb_hedges

vector<int> Landscape::hb_hedges
protected

Declaration of attributes for hedgebanks.

Referenced by hb_Add(), and hb_FindHedges().

◆ hb_height

int Landscape::hb_height
protected

◆ 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

int Landscape::hb_size
protected

◆ hb_width

◆ l_vegtype_areas

double* Landscape::l_vegtype_areas
private

For veg area dumps.

Referenced by SupplyVegArea().

◆ LandscapeName

string Landscape::LandscapeName
protected

A holder for the landscape name for output if needed.

Referenced by SupplyLandscapeName().

◆ le_signal_index

int Landscape::le_signal_index
protected

Index for the LE signal loop.

◆ m_area

int Landscape::m_area
private

Area of the whole landscape.

◆ m_biomass_map

Eigen::ArrayXXf Landscape::m_biomass_map
private

This is the array to store the green biomass for each cell.

Referenced by SupplyGreenBiomassMapPtr().

◆ m_countryCode

std::string Landscape::m_countryCode = "None"
protected

Declaration of attributes for country and coordinates.

Referenced by SetCountryCode(), SupplyCountryCode(), and SupplyTimezone().

◆ m_DoMissingPolygonsManipulations

bool Landscape::m_DoMissingPolygonsManipulations
private

A flag to signal that missing polygons exist.

◆ m_elems

vector<LE*> Landscape::m_elems
private

List of all landscape elements. The index is a sequential number, to get the polynum look this number up in m_polymapping.

Referenced by GetActualGooseGrazingForage(), GetOwner_tole(), GrazeVegetation(), GrazeVegetationTotal(), hb_Add(), hb_FindHedges(), hb_GenerateHBPolys(), MagicMapP2PolyRef(), RebuildPolyMapping(), RemoveNectarFromTotal(), RemovePollenFromTotal(), Set_all_Att_UserDefinedBool(), Set_all_Att_UserDefinedInt(), SetAttUserDefinedBool(), SetAttUserDefinedInt(), SetBirdMaizeForage(), SetBirdSeedForage(), SetMaleNewtPresent(), SupplyAllVegPolys(), SupplyAttIsForest(), SupplyAttIsHigh(), SupplyAttIsUrbanNoVeg(), SupplyAttIsVegCereal(), SupplyAttIsVegGooseGrass(), SupplyAttIsVegGrass(), SupplyAttIsVegMaize(), SupplyAttIsVegMatureCereal(), SupplyAttIsVegPatchy(), SupplyAttIsWater(), SupplyAttIsWoody(), SupplyAttUserDefinedBool(), SupplyAttUserDefinedInt(), SupplyBirdMaizeForage(), SupplyBirdSeedForage(), SupplyCentroidX(), SupplyCentroidY(), SupplyCountryDesig(), SupplyCropType(), SupplyDayDegrees(), SupplyDeadBiomass(), SupplyElementSubType(), SupplyElementType(), SupplyElementTypeCC(), SupplyElementTypeFromVector(), SupplyFarmArea(), SupplyFarmOwner(), SupplyFarmOwnerIndex(), SupplyFarmRotFilename(), SupplyFarmType(), SupplyGooseGrazingForageH(), SupplyGrazingPressure(), SupplyGrazingPressureVector(), SupplyGreenBiomass(), SupplyGreenBiomassProp(), SupplyGreenBiomassTotal(), SupplyHasTramlines(), SupplyInsects(), SupplyInStubble(), SupplyInterestedGreenBiomass(), SupplyInterestedGreenBiomassTotal(), SupplyIsVeg(), SupplyJustMown(), SupplyJustMownVector(), SupplyJustSprayed(), SupplyJustSprayedVector(), SupplyLAGreen(), SupplyLastSownVeg(), SupplyLastSownVegVector(), SupplyLastTreatment(), SupplyLATotal(), SupplyLEPointer(), SupplyMaleNewtPresent(), SupplyMaxPoly(), SupplyNecDD(), SupplyNectar(), SupplyNectarQuantity(), SupplyNumberOfPolygons(), SupplyOpenness(), SupplyOwner_tole(), SupplyPesticideCell(), SupplyPolDD(), SupplyPollen(), SupplyPollenQuantity(), SupplyPolygonArea(), SupplyPolygonAreaVector(), SupplyPolyLEptr(), SupplyPolyListPtr(), SupplyPolyRef(), SupplyPolyRefCC(), SupplyPolyRefVector(), SupplyPondPesticide(), SupplyRoadWidth(), SupplySkScrapes(), SupplySoilType(), SupplySoilTypeR(), SupplySugar(), SupplySugDD(), SupplyTotalNectar(), SupplyTotalPollen(), SupplyTrafficLoad(), SupplyUMRef(), SupplyValidX(), SupplyValidY(), SupplyVegAge(), SupplyVegBiomass(), SupplyVegBiomassVector(), SupplyVegCover(), SupplyVegCoverVector(), SupplyVegDensity(), SupplyVegDigestibility(), SupplyVegDigestibilityVector(), SupplyVegGrowthStage(), SupplyVegHeight(), SupplyVegHeightVector(), SupplyVegPhase(), SupplyVegType(), SupplyVegTypeVector(), and SupplyWeedBiomass().

◆ m_FarmManager

FarmManager* Landscape::m_FarmManager
private

List of all the farms.

Referenced by SupplyFarmManagerPtr(), SupplyFarmPtr(), and SupplyNumberOfFarms().

◆ m_firstyear

bool Landscape::m_firstyear
protected

Flag to indicate the that the first year is run (i.e. before simulation starts)

Referenced by IsHiddenYear().

◆ m_GooseIntakeRateVSVegetationHeight_BG

Polynomial2CurveClass* Landscape::m_GooseIntakeRateVSVegetationHeight_BG
private

A curve relating goose intake rates in KJ/min to vegetation height for Barnacle Goose (BG)

Referenced by SupplyGooseGrazingForageH().

◆ m_GooseIntakeRateVSVegetationHeight_GL

Polynomial2CurveClass* Landscape::m_GooseIntakeRateVSVegetationHeight_GL
private

A curve relating goose intake rates in KJ/min to vegetation height for Greylag Goose (GL)

Referenced by SupplyGooseGrazingForageH().

◆ m_GooseIntakeRateVSVegetationHeight_PF

Polynomial2CurveClass* Landscape::m_GooseIntakeRateVSVegetationHeight_PF
private

A curve relating goose intake rates in KJ/min to vegetation height for Pink-footed Goose (PF)

Referenced by SupplyGooseGrazingForageH().

◆ m_grain_dist

int Landscape::m_grain_dist

Declaration of attribute, m_grain_dist, a binary condition for good or bad years of spilled grain.

Referenced by SetGrainDist(), and SupplyGrainDist().

◆ m_habitat_flower_num

std::map<int, vector<double> > Landscape::m_habitat_flower_num
private

This is the dictionary to store the proportion of each composition for every habitat.

◆ m_habitat_nectar

std::map<int, PollenNectarData> Landscape::m_habitat_nectar
private

This is the dictionary to store the nectar data of each habitat type fo the given day.

Referenced by SupplyNectarHabitatType().

◆ m_habitat_pollen

std::map<int, PollenNectarData> Landscape::m_habitat_pollen
private

This is the dictionary to store the pollen data of each habitat type for the given day.

Referenced by SupplyPollenHabitatType().

◆ m_habitat_species

std::map<int, vector<int> > Landscape::m_habitat_species
private

This the dictionary to store the composition of species for every habitat type.

◆ m_height

◆ m_height10

int Landscape::m_height10
private

◆ m_index_locs_nectar

std::map<int, int> Landscape::m_index_locs_nectar
private

This is the dictionary to store all the index in m_poly_cell_locs_nectar start from which there is no nectar available.

Referenced by SupplyARandomLocNectarPoly(), and SupplyNectarAtLocInPoly().

◆ m_index_locs_pollen

std::map<int, int> Landscape::m_index_locs_pollen
private

This is the dictionary to store all the index in m_poly_cell_locs_pollen start from which there is no pollen available.

Referenced by SupplyARandomLocPollenPoly(), and SupplyPollenAtLocInPoly().

◆ m_land

◆ m_LargestPolyNumUsed

int Landscape::m_LargestPolyNumUsed
protected

The largest polygon number used.

Referenced by SupplyLargestPolyNumUsed().

◆ m_latitude

double Landscape::m_latitude = -1
protected

Referenced by SetLatitude(), and SupplyLatitude().

◆ m_longitude

double Landscape::m_longitude = -1
protected

Referenced by SetLongitude(), and SupplyLongitude().

◆ m_map_polyid_within_dist

std::vector<std::vector<std::vector<int> > > Landscape::m_map_polyid_within_dist
private

This is the vector to store all the polygon IDs within a certain distance to each location in a landscape.

◆ m_maxextent

int Landscape::m_maxextent
private

Area maximum extent, the largest value of m_width or m_height

Referenced by SupplySimAreaMaxExtent().

◆ m_minmaxextent

int Landscape::m_minmaxextent
private

Area minimum extent, the smallest value of m_width or m_height

◆ m_nectar_map

Eigen::MatrixXf Landscape::m_nectar_map
private

This is the matrix to store the nectar proportion (0-1) left for each cell.

Referenced by SupplyARandomLocNectarPoly(), SupplyNectarAtLocInPoly(), SupplyNectarMapPtr(), and SupplyNectarQuantity().

◆ m_NeedCentroidCalculation

bool Landscape::m_NeedCentroidCalculation
private

A flag to ensure centroid calculation on object construction.

◆ m_NeedOpennessCalculation

bool Landscape::m_NeedOpennessCalculation
private

A flag to ensure openness calculation on object construction.

◆ m_PesticideMap

PesticideMap* Landscape::m_PesticideMap = nullptr
private

For specialised pesticide recording.

◆ m_PesticideTable

PesticideTable* Landscape::m_PesticideTable = nullptr
private

For specialised pesticide recording.

◆ m_PesticideType

TTypesOfPesticide Landscape::m_PesticideType
protected

An attribute to hold the pesticide type being tested, if there is one, if not default is -1.

Referenced by SupplyPesticideType().

◆ m_pestincidencefactor

double Landscape::m_pestincidencefactor
private

◆ m_PestIncidenceManager

PestIncidenceManager* Landscape::m_PestIncidenceManager
private

A pest incidence manager.

◆ m_pollen_map

Eigen::MatrixXf Landscape::m_pollen_map
private

This is the matrix to store the pollen proportion (0-1) left for each cell.

Referenced by SupplyARandomLocPollenPoly(), SupplyPollenAtLocInPoly(), SupplyPollenMapPtr(), and SupplyPollenQuantity().

◆ m_poly_cell_locs

std::map<int, vector<APoint> > Landscape::m_poly_cell_locs
private

This is the dictionary to store all the locations for each polygon.

Referenced by SupplyARandomLocPoly(), and SupplyLocsVectorPoly().

◆ m_poly_cell_locs_nectar

std::map<int, vector<APoint> > Landscape::m_poly_cell_locs_nectar
private

This is the dictionary to store all the locations used for quick access to nectar.

Referenced by SupplyARandomLocNectarPoly().

◆ m_poly_cell_locs_pollen

std::map<int, vector<APoint> > Landscape::m_poly_cell_locs_pollen
private

This is the dictionary to store all the locations used for quick access to pollen.

Referenced by SupplyARandomLocPollenPoly().

◆ m_poly_omp_locks

std::vector<omp_nest_lock_t*> Landscape::m_poly_omp_locks
private

The locks for all the polygon.

Referenced by ReleasePolygonLock(), and SetPolygonLock().

◆ m_poly_with_flowers

vector<int> Landscape::m_poly_with_flowers
private

Vector to store the poly IDs with flower resource.

Referenced by SupplyPolyWithFlowers().

◆ m_polyid_map

Eigen::ArrayXXi Landscape::m_polyid_map
private

This is the array to store the polygon ID for each cell.

Referenced by SupplyPolyIdMapPtr().

◆ m_polymapping

vector<int> Landscape::m_polymapping
private

m_polymapping is a mapping from polygon numbers into the list of landscape elements, m_elems. When using this it is important that it is the poly num and not the map index that is used.

Referenced by GetActualGooseGrazingForage(), GrazeVegetation(), GrazeVegetationTotal(), hb_Add(), hb_GenerateHBPolys(), RebuildPolyMapping(), SetAttUserDefinedBool(), SetAttUserDefinedInt(), SetBirdMaizeForage(), SetBirdSeedForage(), SetPolymapping(), SupplyAttIsForest(), SupplyAttIsUrbanNoVeg(), SupplyAttIsVegCereal(), SupplyAttIsVegGooseGrass(), SupplyAttIsVegGrass(), SupplyAttIsVegMaize(), SupplyAttIsVegMatureCereal(), SupplyAttIsVegPatchy(), SupplyAttUserDefinedBool(), SupplyAttUserDefinedInt(), SupplyBirdMaizeForage(), SupplyBirdSeedForage(), SupplyCentroidX(), SupplyCentroidY(), SupplyCropType(), SupplyDayDegrees(), SupplyDeadBiomass(), SupplyElementSubType(), SupplyElementType(), SupplyFarmArea(), SupplyFarmOwner(), SupplyFarmOwnerIndex(), SupplyFarmRotFilename(), SupplyFarmType(), SupplyGooseGrazingForageH(), SupplyGrazingPressure(), SupplyGreenBiomass(), SupplyGreenBiomassProp(), SupplyGreenBiomassTotal(), SupplyHasTramlines(), SupplyInsects(), SupplyInStubble(), SupplyInterestedGreenBiomass(), SupplyInterestedGreenBiomassTotal(), SupplyJustMown(), SupplyJustSprayed(), SupplyLAGreen(), SupplyLastSownVeg(), SupplyLastTreatment(), SupplyLATotal(), SupplyLEPointer(), SupplyOpenness(), SupplyPesticideCell(), SupplyPolygonArea(), SupplyPolyLEptr(), SupplyPolymapping(), SupplySkScrapes(), SupplyTrafficLoad(), SupplyValidX(), SupplyValidY(), SupplyVegAge(), SupplyVegBiomass(), SupplyVegCover(), SupplyVegDensity(), SupplyVegDigestibility(), SupplyVegGrowthStage(), SupplyVegHeight(), SupplyVegPhase(), SupplyVegType(), and SupplyWeedBiomass().

◆ m_PondIndexList

vector<int> Landscape::m_PondIndexList
protected

List of pond indexes.

Referenced by HowManyPonds(), and SupplyPondIndex().

◆ m_PondRefsList

vector<int> Landscape::m_PondRefsList
protected

List of pond polyrefs.

Referenced by SupplyPondIndex().

◆ m_RodenticideManager

RodenticideManager* Landscape::m_RodenticideManager
private

A pointer to the rodenticide manager.

◆ m_RodenticidePreds

RodenticidePredators_Population_Manager* Landscape::m_RodenticidePreds
private

A pointer to the Rodenticide predators population´manager.

Referenced by SupplyRodenticidePredatoryManager().

◆ m_ThePopManagerList

PopulationManagerList* Landscape::m_ThePopManagerList
private

A pointer to the current main population manager.

Referenced by SetThePopManagerList(), and SupplyThePopManagerList().

◆ m_toxShouldSpray

bool Landscape::m_toxShouldSpray
protected

A flag indicating whether pesticide should be sprayed.

Referenced by SupplyShouldSpray().

◆ m_treatment_counts

int Landscape::m_treatment_counts[last_treatment]
protected

Array for containing the treatment counts.

◆ m_versioninfo

char Landscape::m_versioninfo[30]
private

Version info. Initialized by the constructor.

Referenced by SupplyVersion().

◆ m_width

int Landscape::m_width
private

Declaration of attributes for correcting coordinates before modulus operations, saves an indirection when doing inline function calls.

Area width

Referenced by CorrectCoords(), CorrectCoordsPointNoWrap(), CorrectCoordsPt(), CorrectWidth(), SupplyElementTypeCC(), SupplyPolyRefCC(), and SupplySimAreaWidth().

◆ m_width10

int Landscape::m_width10
private

◆ m_x_add

int Landscape::m_x_add[16]
protected

◆ m_y_add

int Landscape::m_y_add[16]
protected

The documentation for this class was generated from the following files:
version_major
static const int version_major
Definition: Landscape.cpp:39
Calendar::Reset2
void Reset2(void)
Definition: Calendar.cpp:54
LE_TypeClass::BackTranslateEleTypes
int BackTranslateEleTypes(TTypesOfLandscapeElement EleReference)
Definition: Elements.cpp:5529
toc_None
Definition: LandscapeFarmingEnums.h:925
tole_SolarPanel
Definition: LandscapeFarmingEnums.h:151
cfg_BeetleBankType
static CfgInt cfg_BeetleBankType("BBANK_TYPE", CFG_CUSTOM,(int) tole_BeetleBank)
g_map_le_borderremoval
CfgBool g_map_le_borderremoval("MAP_LE_BORDERREMOVAL", CFG_CUSTOM, false)
Landscape::CalculateCentroids
void CalculateCentroids(void)
Calculate centroid for each polygon found.
Definition: Landscape.cpp:5110
tov_DKOLegume_Beans
Definition: LandscapeFarmingEnums.h:345
Landscape::m_x_add
int m_x_add[16]
Definition: Landscape.h:457
Landscape::SetCountryCode
void SetCountryCode(std::string country_code)
Sets m_countryCode, e.g. "DK" for Denmark.
Definition: Landscape.h:593
tov_SpringBarleySeed
Definition: LandscapeFarmingEnums.h:214
cfg_PestIncidenceMin
static CfgFloat cfg_PestIncidenceMin("PESTINCIDENCEMIN", CFG_CUSTOM, 0.0)
toc_Potatoes
Definition: LandscapeFarmingEnums.h:891
Landscape::GenerateCellLocDict
void GenerateCellLocDict()
The function to create the dictionary of cell locations for every polygon.
Definition: Landscape.cpp:2524
toc_OFodderGrass
Definition: LandscapeFarmingEnums.h:835
cfg_B6B
CfgFloat cfg_B6B
Coefficient B in a second order polynomial function.
Definition: Landscape.cpp:311
tole_OtherOakForest
Definition: LandscapeFarmingEnums.h:142
toc_Oats
Definition: LandscapeFarmingEnums.h:819
tole_SandDune
Definition: LandscapeFarmingEnums.h:103
LE::GetAspect
double GetAspect(void)
Definition: Elements.h:418
tov_FIWinterWheat
Definition: LandscapeFarmingEnums.h:524
tov_DEOGrasslandSilageAnnual
Definition: LandscapeFarmingEnums.h:482
toc_Cabbage
Definition: LandscapeFarmingEnums.h:787
Landscape::m_PondRefsList
vector< int > m_PondRefsList
List of pond polyrefs.
Definition: Landscape.h:373
Landscape::hb_max_x
int hb_max_x
Definition: Landscape.h:463
tov_DKOChristmasTrees_Perm
Definition: LandscapeFarmingEnums.h:447
LE::GetMinX
int GetMinX(void)
Definition: Elements.h:399
tof_UserDefinedFarm3
Definition: LandscapeFarmingEnums.h:662
Landscape::m_versioninfo
char m_versioninfo[30]
Version info. Initialized by the constructor.
Definition: Landscape.h:148
Landscape::hb_width
int hb_width
Definition: Landscape.h:460
Landscape::hb_MarkTopFromLocalMax
void hb_MarkTopFromLocalMax(int a_color)
Used to identify the distance a cell is from the centre of a hedge.
Definition: Hedgebanks.cpp:676
tov_FIBufferZone
Definition: LandscapeFarmingEnums.h:563
toc_OSetAside
Definition: LandscapeFarmingEnums.h:863
cfg_dumpvegjan
CfgBool cfg_dumpvegjan("G_VEGAREASJAN_ON", CFG_CUSTOM, false)
fiber_removal
Definition: Treatment.h:129
fp_rsm
Definition: Treatment.h:64
polylist
vector< unsigned > polylist
Definition: Farm.h:332
FarmManager::GetRenumberedFarmRef
int GetRenumberedFarmRef(int a_farmref)
Returns the farm ref index for a farmref.
Definition: Farm.h:1624
LE::Set_Att_Water
void Set_Att_Water(bool a_water)
Definition: Elements.h:202
org_insecticide
Definition: Treatment.h:84
toc_OWinterBarleyExtensive
Definition: LandscapeFarmingEnums.h:879
tov_DEOWinterWheat
Definition: LandscapeFarmingEnums.h:497
tof_UserDefinedFarm19
Definition: LandscapeFarmingEnums.h:678
cfg_B6F
CfgFloat cfg_B6F
Max x-value - at this point the curve tends to 0, must stop here to avoid negative values.
Definition: Landscape.cpp:320
GooseFieldListItem::grass
double grass[gs_foobar]
Definition: Landscape.h:96
Landscape::DumpMapInfoByArea
void DumpMapInfoByArea(const char *a_filename, bool a_append, bool a_dump_zero_areas, bool a_write_veg_names)
Dumps landscape information by area LKM.
Definition: Landscape.cpp:5723
PesticideTable::Spray
virtual void Spray(LE *a_element_sprayed, TTypesOfPesticideCategory a_type)
Definition: Pesticide.cpp:1918
tov_WinterWheatStrigling
Definition: LandscapeFarmingEnums.h:221
fa_sk
Definition: Treatment.h:71
tov_DKGrazingPigs_Perm
Definition: LandscapeFarmingEnums.h:452
cfg_farm_cattle_grazing_lvl_pasture
CfgInt cfg_farm_cattle_grazing_lvl_pasture
tole_Pylon
Definition: LandscapeFarmingEnums.h:118
toc_OPotatoesIndustry
Definition: LandscapeFarmingEnums.h:852
row_cultivation
Definition: Treatment.h:88
tov_DKOSetAside_AnnualFlower
Definition: LandscapeFarmingEnums.h:394
tov_NorwegianOats
Definition: LandscapeFarmingEnums.h:230
fa_pk
Definition: Treatment.h:68
LE::SetOwner
void SetOwner(Farm *a_owner, int a_owner_num, int a_owner_index)
Definition: Elements.h:282
WARN_FILE
Definition: MapErrorMsg.h:37
tov_DKOCerealLegume
Definition: LandscapeFarmingEnums.h:366
tov_DEOSpringRye
Definition: LandscapeFarmingEnums.h:491
tole_OtherPermCrop
Definition: LandscapeFarmingEnums.h:177
tole_SwampForest
Definition: LandscapeFarmingEnums.h:135
tov_DKOLegume_Peas
Definition: LandscapeFarmingEnums.h:344
GooseFieldListItem::lastsownveg
std::string lastsownveg
Definition: Landscape.h:103
tov_SpringBarleySKManagement
Definition: LandscapeFarmingEnums.h:227
winter_harrow
Definition: Treatment.h:144
Landscape::m_y_add
int m_y_add[16]
Definition: Landscape.h:458
toc_OrchardCrop
Definition: LandscapeFarmingEnums.h:855
tov_DKWinterRape
Definition: LandscapeFarmingEnums.h:418
tov_OCloverGrassGrazed2
Definition: LandscapeFarmingEnums.h:205
tov_DKOptimalFlowerMix3
Definition: LandscapeFarmingEnums.h:438
fp_npk
Definition: Treatment.h:52
tof_UserDefinedFarm13
Definition: LandscapeFarmingEnums.h:672
strigling
Definition: Treatment.h:89
g_rand_uni_fnc
double g_rand_uni_fnc()
Definition: ALMaSS_Random.cpp:56
tov_BEBeetSpring
Definition: LandscapeFarmingEnums.h:290
Landscape::SupplyGreenBiomass
double SupplyGreenBiomass(int a_polyref)
Returns the green biomass of the vegetation using the polygon reference number a_polyref.
Definition: Landscape.h:1612
tov_FRSorghum
Definition: LandscapeFarmingEnums.h:594
Landscape::SupplyAttIsVegPatchy
bool SupplyAttIsVegPatchy(int a_polyref)
Returns whether a polygon at coordinates a_x, a_y, or by a_polyref has the attribute Is Patchy set.
Definition: Landscape.h:891
harvest
Definition: Treatment.h:94
tov_PLSpringWheat
Definition: LandscapeFarmingEnums.h:237
WARN_MSG
Definition: MapErrorMsg.h:38
toc_FodderGrass
Definition: LandscapeFarmingEnums.h:803
Calendar::GetYear
int GetYear(void)
Definition: Calendar.h:71
toc_OCloverGrassGrazed1
Definition: LandscapeFarmingEnums.h:826
fa_nk
Definition: Treatment.h:142
tov_PTCabbage_Hort
Definition: LandscapeFarmingEnums.h:331
tov_NLPermanentGrassGrazedExtensive
Definition: LandscapeFarmingEnums.h:272
VegElement::SetBiomassScalers
static void SetBiomassScalers(TTypesOfVegetation a_tov)
Definition: Elements.cpp:344
tov_DEOSugarBeet
Definition: LandscapeFarmingEnums.h:492
tov_IRWinterBarley
Definition: LandscapeFarmingEnums.h:601
marchfirst
Definition: Plants.h:54
tole_Portarea
Definition: LandscapeFarmingEnums.h:132
l_map_dump_event_x2
static CfgInt l_map_dump_event_x2("MAP_DUMP_EVENT_XB", CFG_CUSTOM, 4333)
GooseFieldList
std::vector< GooseFieldListItem > GooseFieldList
A list of GooseFieldListItem s.
Definition: Landscape.h:108
g_speedy_Divides
double g_speedy_Divides[2001]
A generally useful array of fast divide calculators by multiplication.
Definition: Landscape.cpp:344
PollenNectarDevelopmentData::supplyPollenHabitatSpeciesGivenDay
PollenNectarData supplyPollenHabitatSpeciesGivenDay(int a_curve_num, int a_given_day)
Supply the pollen for the given species for the given day after today.
Definition: PollenNectar.cpp:345
toc_WinterTriticale
Definition: LandscapeFarmingEnums.h:921
Landscape::LandscapeName
string LandscapeName
A holder for the landscape name for output if needed.
Definition: Landscape.h:539
Landscape::m_RodenticidePreds
RodenticidePredators_Population_Manager * m_RodenticidePreds
A pointer to the Rodenticide predators population´manager.
Definition: Landscape.h:207
Landscape::SupplyTemp
double SupplyTemp(void)
Passes a request on to the associated Weather class function, the temperature for the current day.
Definition: Landscape.h:1993
l_map_dump_treatcounts_file
static CfgStr l_map_dump_treatcounts_file("MAP_DUMP_TREATCOUNTS_FILE", CFG_CUSTOM, "treatment_counts.txt")
toc_OOrchPear
Definition: LandscapeFarmingEnums.h:848
cfg_BeetleBankMinY
CfgInt cfg_BeetleBankMinY("BBANK_MINY", CFG_CUSTOM, 0)
toc_SpringBarleySeed
Definition: LandscapeFarmingEnums.h:904
Landscape::DumpMap
void DumpMap(const char *a_filename)
Called if the landscape is manipulated to save the new version of the.lsb input file(i....
Definition: Landscape.cpp:2852
cfg_P1H
CfgStr cfg_P1H
File name for grass functional response for pinkfeet.
Definition: Landscape.cpp:288
tov_DKOCabbages
Definition: LandscapeFarmingEnums.h:352
tov_PTCloverGrassGrazed1
Definition: LandscapeFarmingEnums.h:314
Landscape::hb_new_hbs
vector< LE * > hb_new_hbs
Definition: Landscape.h:455
tole_InvasiveForest
Definition: LandscapeFarmingEnums.h:145
toc_OMaizeSilage
Definition: LandscapeFarmingEnums.h:841
insecticide_treat
Definition: Treatment.h:83
tov_DEOMaizeSilage
Definition: LandscapeFarmingEnums.h:486
GooseFieldListItem::vegheight
double vegheight
Definition: Landscape.h:99
toc_OPotatoes
Definition: LandscapeFarmingEnums.h:851
Landscape::hb_MapBorder
bool hb_MapBorder(int a_x, int a_y)
Checks for out of bounds hedgebank coordinates.
Definition: Hedgebanks.cpp:322
straw_chopping
Definition: Treatment.h:99
toc_OSeedGrass2
Definition: LandscapeFarmingEnums.h:862
LE::GetArea
double GetArea(void)
Definition: Elements.h:257
toc_CarrotsSpring
Definition: LandscapeFarmingEnums.h:790
toc_PermanentGrassLowYield
Definition: LandscapeFarmingEnums.h:887
l_map_dump_event_x1
static CfgInt l_map_dump_event_x1("MAP_DUMP_EVENT_XA", CFG_CUSTOM, 4287)
tov_DKOSugarBeets
Definition: LandscapeFarmingEnums.h:350
l_map_umargin_width
static CfgInt l_map_umargin_width("MAP_UMARGINWIDTH", CFG_CUSTOM, 10)
tov_DEOats
Definition: LandscapeFarmingEnums.h:479
Landscape::SupplyVegType
TTypesOfVegetation SupplyVegType(int a_x, int a_y)
Returns the vegetation type of the polygon using the polygon reference number a_polyref or coordinate...
Definition: Landscape.h:1925
tov_DKSpringOats_CC
Definition: LandscapeFarmingEnums.h:429
Landscape::hb_PaintBorder
void hb_PaintBorder(int a_color)
Identifies all border hedge pixels.
Definition: Hedgebanks.cpp:426
toc_OrchOther
Definition: LandscapeFarmingEnums.h:857
l_map_dump_veg_enable
static CfgBool l_map_dump_veg_enable("MAP_DUMP_VEG_ENABLE", CFG_CUSTOM, false)
tov_DKSpringOats
Definition: LandscapeFarmingEnums.h:413
Orchard
Definition: Elements.h:1108
fa_greenmanure
Definition: Treatment.h:76
toc_OWinterWheatUndersownExtensive
Definition: LandscapeFarmingEnums.h:884
NaturalGrass
Definition: Elements.h:1068
toc_OFirstYearDanger
Definition: LandscapeFarmingEnums.h:833
tov_WWheatPToxicControl
Definition: LandscapeFarmingEnums.h:217
tov_PTCloverGrassGrazed2
Definition: LandscapeFarmingEnums.h:315
Landscape::SupplyElementType
TTypesOfLandscapeElement SupplyElementType(int a_polyref)
Returns the landscape type of the polygon using the polygon reference number a_polyref or coordinates...
Definition: Landscape.h:1732
tov_IRWinterOats
Definition: LandscapeFarmingEnums.h:603
stubble_plough
Definition: Treatment.h:35
tov_SetAside
Definition: LandscapeFarmingEnums.h:212
Weather::GetWindDirectionRadians
double GetWindDirectionRadians(void)
East is 0, anticlockwise.
Definition: Weather.h:515
tov_DKOWinterRye_CC
Definition: LandscapeFarmingEnums.h:425
toc_OYoungForestCrop
Definition: LandscapeFarmingEnums.h:885
growth_regulator
Definition: Treatment.h:81
tole_Churchyard
Definition: LandscapeFarmingEnums.h:108
tole_UnsprayedFieldMargin
Definition: LandscapeFarmingEnums.h:94
tov_PLBeet
Definition: LandscapeFarmingEnums.h:242
Landscape::PolysDump
void PolysDump(const char *a_filename)
Called if the landscape is manipulated to save the new version of the polyref input file.
Definition: Landscape.cpp:3368
tof_UserDefinedFarm2
Definition: LandscapeFarmingEnums.h:661
toc_SpringRape
Definition: LandscapeFarmingEnums.h:906
cfg_pesticidemapstartyear
CfgInt cfg_pesticidemapstartyear("PEST_MAP_STARTYEAR", CFG_CUSTOM, 0)
The first simulation year the pesticide is mapped.
tof_UserDefinedFarm21
Definition: LandscapeFarmingEnums.h:680
tov_DKOWinterFodderGrass
Definition: LandscapeFarmingEnums.h:379
toc_WinterRye
Definition: LandscapeFarmingEnums.h:920
tole_Missing
Definition: LandscapeFarmingEnums.h:181
tov_DEOCarrots
Definition: LandscapeFarmingEnums.h:481
tov_FIOPotatoIndustry_South
Definition: LandscapeFarmingEnums.h:546
tov_DKMixedVeg
Definition: LandscapeFarmingEnums.h:384
Landscape::ClassificationFieldType
bool ClassificationFieldType(TTypesOfLandscapeElement a_tole)
Returns whether the polygon is classfied as a field.
Definition: Landscape.cpp:1182
g_map_le_umargin_min_field_size
CfgInt g_map_le_umargin_min_field_size("MAP_LE_UMARGIN_MIN_FIELD_SIZE", CFG_CUSTOM, 20000)
GooseFieldListItem::geeseTimed
int geeseTimed
Definition: Landscape.h:90
tov_DKSpringBarley_CC
Definition: LandscapeFarmingEnums.h:431
tov_SpringBarleyStriglingCulm
Definition: LandscapeFarmingEnums.h:224
Landscape::VegtypeToString
std::string VegtypeToString(TTypesOfVegetation a_veg)
Returns the text representation of a TTypesOfVegetation type.
Definition: Landscape.cpp:6518
deep_ploughing
Definition: Treatment.h:43
hilling_up
Definition: Treatment.h:91
tov_OWinterWheatUndersownExt
Definition: LandscapeFarmingEnums.h:225
Landscape::SupplyVegDigestibility
double SupplyVegDigestibility(int a_polyref)
Gets the digestibility of the vegetation for a polygon given by a_polyref or based on the x,...
Definition: Landscape.h:1512
tov_OCloverGrassSilage1
Definition: LandscapeFarmingEnums.h:205
Landscape::RemoveSmallPolygons
int RemoveSmallPolygons(void)
Removes small polygons from the map.
Definition: Landscape.cpp:4242
RasterMap::MapHeight
int MapHeight(void)
Definition: Rastermap.h:56
tov_DKOOrchApple
Definition: LandscapeFarmingEnums.h:466
green_harvest
Definition: Treatment.h:127
tov_DEWinterWheatLate
Definition: LandscapeFarmingEnums.h:510
tov_FIPotato_North
Definition: LandscapeFarmingEnums.h:539
autumn_or_spring_plough
Definition: Treatment.h:103
tole_AmenityGrass
Definition: LandscapeFarmingEnums.h:98
toc_OSpringBarleySilage
Definition: LandscapeFarmingEnums.h:870
Landscape::SupplyLECount
int SupplyLECount(void)
Returns number of all landscape elements.
Definition: Landscape.cpp:5633
LE::GetCentroidY
virtual int GetCentroidY()
Definition: Elements.h:151
cfg_B6H
CfgStr cfg_B6H
File name for grass functional response for barnacles.
Definition: Landscape.cpp:324
Pesticide::SupplyPesticide
double SupplyPesticide(int a_x, int a_y, PlantProtectionProducts a_ppp)
Supplies the pesticide amount in cell.
Definition: Pesticide.h:704
tov_FITurnipRape
Definition: LandscapeFarmingEnums.h:533
cfg_pesticidemapon
CfgBool cfg_pesticidemapon("PEST_MAP_ON", CFG_CUSTOM, false)
Flag determining whether we are using the pesticide map.
Landscape::ClassificationVegMatureCereal
bool ClassificationVegMatureCereal(TTypesOfVegetation a_vege_type)
Returns whether a vegetation type is classified as cereal grown to maturity.
Definition: Landscape.cpp:785
tov_BEOrchardCrop
Definition: LandscapeFarmingEnums.h:298
flower_cutting
Definition: Treatment.h:121
toc_OSetAside_Flower
Definition: LandscapeFarmingEnums.h:864
tov_IRSpringOats
Definition: LandscapeFarmingEnums.h:598
cfg_PatchesType
static CfgInt cfg_PatchesType("PATCHES_TYPE", CFG_CUSTOM,(int) tole_BeetleBank)
tole_CorkOakForest
Definition: LandscapeFarmingEnums.h:140
toc_OOrchOther
Definition: LandscapeFarmingEnums.h:847
Calendar::GetYearNumber
int GetYearNumber(void)
Definition: Calendar.h:72
toc_OAsparagusEstablishedPlantation
Definition: LandscapeFarmingEnums.h:818
toc_OCloverGrassSilage1
Definition: LandscapeFarmingEnums.h:829
tole_Foobar
Definition: LandscapeFarmingEnums.h:183
tov_DKOWinterBarley
Definition: LandscapeFarmingEnums.h:401
tov_PLWinterRape
Definition: LandscapeFarmingEnums.h:233
Landscape::hb_FindBoundingBox
bool hb_FindBoundingBox(int a_poly_num)
Finds a rectangle that encloses the hedge to be manipulated.
Definition: Hedgebanks.cpp:240
LE::Set_Att_VegGooseGrass
virtual void Set_Att_VegGooseGrass(bool)
Definition: Elements.h:226
CfgStr::value
char * value() const
Definition: Configurator.h:182
Landscape::m_height
int m_height
Area length.
Definition: Landscape.h:181
Landscape::m_ThePopManagerList
PopulationManagerList * m_ThePopManagerList
A pointer to the current main population manager.
Definition: Landscape.h:203
Landscape::SupplyLAGreen
double SupplyLAGreen(int a_polyref)
Returns the green leaf area of the vegetation using the polygon reference number a_polyref or based o...
Definition: Landscape.h:1662
Landscape::m_poly_cell_locs_nectar
std::map< int, vector< APoint > > m_poly_cell_locs_nectar
This is the dictionary to store all the locations used for quick access to nectar.
Definition: Landscape.h:229
toc_GrassGrazed1
Definition: LandscapeFarmingEnums.h:807
tole_FarmBufferZone
Definition: LandscapeFarmingEnums.h:170
toc_YellowLupin
Definition: LandscapeFarmingEnums.h:923
tov_NLSpringBarley
Definition: LandscapeFarmingEnums.h:255
tole_StoneWall
Definition: LandscapeFarmingEnums.h:78
SkTerritories::PreCachePoly
void PreCachePoly(int a_poly)
Definition: skylarks_all.cpp:1493
Calendar::GetHour
int GetHour(void)
Definition: Calendar.h:76
cfg_G6H
CfgStr cfg_G6H
File name for grass functional response for greylags.
Definition: Landscape.cpp:306
LE::GetMaxX
int GetMaxX(void)
Definition: Elements.h:397
tov_FlowerStrip2
Definition: LandscapeFarmingEnums.h:199
toc_OFarmForest
Definition: LandscapeFarmingEnums.h:830
Landscape::hb_AddNewHedgebanks
void hb_AddNewHedgebanks(int a_orig_poly_num)
Adds new hedgebanks.
Definition: Hedgebanks.cpp:195
tov_PTBeans
Definition: LandscapeFarmingEnums.h:322
toc_VegSeeds
Definition: LandscapeFarmingEnums.h:917
spring_plough
Definition: Treatment.h:44
Weather::GetSoilTempHour
double GetSoilTempHour(int hour)
Definition: Weather.h:468
tov_OMaizeSilage
Definition: LandscapeFarmingEnums.h:227
Landscape::ClassificationHigh
bool ClassificationHigh(TTypesOfLandscapeElement tole)
Returns whether the polygon is classfied as high.
Definition: Landscape.cpp:1251
tov_PTMaize
Definition: LandscapeFarmingEnums.h:326
tov_DKOCloverGrassGrazed1
Definition: LandscapeFarmingEnums.h:374
fp_sk
Definition: Treatment.h:56
pruning
Definition: Treatment.h:125
cfg_BeetleBankChance
static CfgInt cfg_BeetleBankChance("BBANK_CHANCE", CFG_CUSTOM, 100)
Landscape::m_PestIncidenceManager
PestIncidenceManager * m_PestIncidenceManager
A pest incidence manager.
Definition: Landscape.h:174
Landscape::hb_MaxUnpaintedNegNeighbour
int hb_MaxUnpaintedNegNeighbour(int a_x, int a_y)
Determines the width from centre to edge of hedge.
Definition: Hedgebanks.cpp:545
tov_DEOTriticale
Definition: LandscapeFarmingEnums.h:493
MapErrorMsg::WarnAddInfo
void WarnAddInfo(MapErrorState a_level, std::string a_add1, std::string a_add2)
Definition: MapErrorMsg.cpp:160
Landscape::RemoveMissingValues
void RemoveMissingValues()
A method for replacing missing values in the map with corrected ones.
Definition: Landscape.cpp:4148
toc_OWinterWheat
Definition: LandscapeFarmingEnums.h:882
Landscape::GrainDump
void GrainDump()
Records total amount of grain / seed / maize available as forage for each polygon.
Definition: Landscape.cpp:3181
cfg_WriteCurve
CfgBool cfg_WriteCurve
Controlling whether the functional response curves used are written to disk.
Definition: Landscape.cpp:260
tole_Hedges
Definition: LandscapeFarmingEnums.h:59
tov_FIOWinterWheat
Definition: LandscapeFarmingEnums.h:525
tov_PTTriticale
Definition: LandscapeFarmingEnums.h:316
FarmManager::GetFarmTotalSize
int GetFarmTotalSize(int a_farmref)
Returns the total farm area from the farm ref num.
Definition: Farm.h:1498
GooseFieldListItem::previouscrop
std::string previouscrop
Definition: Landscape.h:102
Landscape::ClassificationUrbanNoVeg
bool ClassificationUrbanNoVeg(TTypesOfLandscapeElement a_tole)
Returns whether the polygon is classfied as urban with no vegetation.
Definition: Landscape.cpp:1302
Landscape::SupplyLongitude
double SupplyLongitude()
Returns m_longitude of the landscape location.
Definition: Landscape.h:607
tov_PLSpringBarleySpr
Definition: LandscapeFarmingEnums.h:246
Landscape::VegDump
void VegDump(int x, int y)
Records vegetation charateristics for the x, y location.
Definition: Landscape.cpp:3209
tov_WinterWheatStriglingCulm
Definition: LandscapeFarmingEnums.h:224
Landscape::GISASCII_Output
void GISASCII_Output(string outpfile, int UTMX, int UTMY)
Write ASCII file of the ALMaSS map.
Definition: Landscape.cpp:5579
Pond
Ponds are defined as freshwater bodies between 25m2 and 5000m2. For newts the effective size is limit...
Definition: Elements.h:1155
LE::GetPoly
int GetPoly(void)
Returns the polyref number for this polygon.
Definition: Elements.h:238
tov_DKOSetAside
Definition: LandscapeFarmingEnums.h:393
Landscape::m_habitat_nectar
std::map< int, PollenNectarData > m_habitat_nectar
This is the dictionary to store the nectar data of each habitat type fo the given day.
Definition: Landscape.h:221
tov_DEOHerbsPerennial_after1year
Definition: LandscapeFarmingEnums.h:516
RasterMap::Get
int Get(int a_x, int a_y)
Definition: Rastermap.h:82
UnsprayedFieldMargin
Definition: Elements.h:1075
tof_UserDefinedFarm20
Definition: LandscapeFarmingEnums.h:679
tole_BareRock
Definition: LandscapeFarmingEnums.h:97
toc_ORyegrass
Definition: LandscapeFarmingEnums.h:896
tov_DKOEnergyCrop_Perm
Definition: LandscapeFarmingEnums.h:449
Landscape::ReadPolys2
void ReadPolys2(const char *a_polyfile, int a_format)
Based on the format of the file (since multiple formats are allowed), this reads the polygon informat...
Definition: Landscape.cpp:3584
Landscape::CorrectCoords
void CorrectCoords(int &x, int &y)
Function to prevent wrap around errors with co-ordinates using x/y pair.
Definition: Landscape.h:2206
toc_OOrchApple
Definition: LandscapeFarmingEnums.h:844
tov_FIGrasslandPasturePerennial2
Definition: LandscapeFarmingEnums.h:557
tov_IRSpringWheat
Definition: LandscapeFarmingEnums.h:596
tole_Carpark
Definition: LandscapeFarmingEnums.h:107
toc_OOrchCherry
Definition: LandscapeFarmingEnums.h:846
tole_IndividualTree
Definition: LandscapeFarmingEnums.h:115
tov_BECatchPeaCrop
Definition: LandscapeFarmingEnums.h:291
tov_DKOWinterRape
Definition: LandscapeFarmingEnums.h:402
Landscape::SupplyGrazingPressure
int SupplyGrazingPressure(int a_polyref)
Returns the grazing pressure of the polygon using the polygon reference number a_polyref or coordinat...
Definition: Landscape.h:1848
tof_UserDefinedFarm29
Definition: LandscapeFarmingEnums.h:688
tof_UserDefinedFarm36
Definition: LandscapeFarmingEnums.h:695
tov_NLCabbageSpring
Definition: LandscapeFarmingEnums.h:267
Landscape::SetLongitude
void SetLongitude(double longitude)
Sets the longitude of the landscape location.
Definition: Landscape.h:611
toc_SpringWheat
Definition: LandscapeFarmingEnums.h:908
cfg_HedgeSubtypeMaximum
CfgInt cfg_HedgeSubtypeMaximum("HEDGE_SUBTYPEMAXIMUM", CFG_CUSTOM, 3)
Weather::GetMaxTempYesterday
double GetMaxTempYesterday(void)
Get the max temperature yesterday.
Definition: Weather.h:492
fp_manure
Definition: Treatment.h:61
herbicide_treat
Definition: Treatment.h:80
fp_ammoniumsulphate
Definition: Treatment.h:60
g_date
class Calendar * g_date
Definition: Calendar.cpp:37
toc_Maize
Definition: LandscapeFarmingEnums.h:813
flammebehandling
Definition: Treatment.h:90
tov_DKSpringBarley_Green
Definition: LandscapeFarmingEnums.h:411
straw_covering
Definition: Treatment.h:123
LE::SetSoilType
void SetSoilType(int a_st)
Definition: Elements.h:351
Landscape::m_width
int m_width
Declaration of attributes for correcting coordinates before modulus operations, saves an indirection ...
Definition: Landscape.h:179
LE::SetBorder
void SetBorder(LE *a_border)
Definition: Elements.h:384
Landscape::SetGrainDist
void SetGrainDist(int a_dist)
Sets m_grain_dist, a binary condition for good or bad years of spilled grain.
Definition: Landscape.h:1064
tov_PLCarrots
Definition: LandscapeFarmingEnums.h:245
Landscape::hb_core_pixels
int hb_core_pixels
Definition: Landscape.h:466
Landscape::SupplyLatitude
double SupplyLatitude()
Returns m_latitude of the landscape location.
Definition: Landscape.h:605
LE::SetCountryDesignation
void SetCountryDesignation(int a_designation)
Definition: Elements.h:280
tov_Carrots
Definition: LandscapeFarmingEnums.h:203
cfg_P1F
CfgFloat cfg_P1F
Max x-value - at this point the curve tends to 0, must stop here to avoid negative values.
Definition: Landscape.cpp:284
tov_PTOliveGroveTradOrganic
Definition: LandscapeFarmingEnums.h:334
fp_boron
Definition: Treatment.h:131
tole_OrchardBand
Definition: LandscapeFarmingEnums.h:95
toc_CorkOak
Definition: LandscapeFarmingEnums.h:795
tov_BEWinterWheat
Definition: LandscapeFarmingEnums.h:302
tov_WinterRape
Definition: LandscapeFarmingEnums.h:215
l_map_dump_event_y2
static CfgInt l_map_dump_event_y2("MAP_DUMP_EVENT_YB", CFG_CUSTOM, 2889)
PesticideTable::Clear
void Clear()
Definition: Pesticide.h:790
Weather::GetWindDirection8
int GetWindDirection8(void)
Eight wind directions N = 0, NE = 1, ..., clockwise.
Definition: Weather.h:513
toc_CabbageSpring
Definition: LandscapeFarmingEnums.h:788
toc_SpringBarleyPeaCloverGrass
Definition: LandscapeFarmingEnums.h:903
tole_NaturalGrassWet
Definition: LandscapeFarmingEnums.h:109
toc_Beans
Definition: LandscapeFarmingEnums.h:783
Landscape::hb_DownPolyNumbers
void hb_DownPolyNumbers(void)
Reverses the process carried out by Landscape::hb_UpPolyNumbers.
Definition: Hedgebanks.cpp:712
tov_OSpringBarleyClover
Definition: LandscapeFarmingEnums.h:208
toc_OCarrots
Definition: LandscapeFarmingEnums.h:825
LE_TypeClass::TranslateEleTypesFromString
TTypesOfLandscapeElement TranslateEleTypesFromString(string aEleReferenceStr)
Definition: Elements.cpp:3446
HB_MAGIC
#define HB_MAGIC
Definition: Hedgebanks.cpp:38
tov_DEWinterBarley
Definition: LandscapeFarmingEnums.h:507
tole_PermPastureTussockyWet
Definition: LandscapeFarmingEnums.h:122
tole_MetalledPath
Definition: LandscapeFarmingEnums.h:106
g_VegHeightForageReduction
double g_VegHeightForageReduction
Used to scale access to crops for modern day farm intensiveness.
Definition: Hare_All.cpp:299
tov_FIOSpringBarley_Fodder
Definition: LandscapeFarmingEnums.h:555
fp_cu
Definition: Treatment.h:138
tov_DKOMaizeSilage
Definition: LandscapeFarmingEnums.h:387
CurveClass::WriteDataFile
virtual void WriteDataFile(int a_step)
Definition: CurveClasses.cpp:87
tole_Wasteland
Definition: LandscapeFarmingEnums.h:114
bulb_harvest
Definition: Treatment.h:122
tov_NaturalGrass
Definition: LandscapeFarmingEnums.h:196
toc_Turnip
Definition: LandscapeFarmingEnums.h:914
preseeding_cultivator
Definition: Treatment.h:39
tov_DKOSetAside_PerennialFlower
Definition: LandscapeFarmingEnums.h:395
tov_DKOGrassLowYield_Perm
Definition: LandscapeFarmingEnums.h:455
trial_control
Definition: Treatment.h:110
tov_DKSpringFodderGrass
Definition: LandscapeFarmingEnums.h:377
LE::SetPollenNectarCurveRef
void SetPollenNectarCurveRef(int a_PollenNectarCurve)
Sets the pollen/nectar curve number.
Definition: Elements.h:475
PollenNectarDevelopmentData::supplyNectarHabitatSpeciesCurrentDay
PollenNectarData supplyNectarHabitatSpeciesCurrentDay(int a_curve_num)
Supply the current nectar for the given species.
Definition: PollenNectar.cpp:338
Landscape::FindBestRectangle
int FindBestRectangle(int a_polyindex, int *a_x, int *a_y, int *a_width, int *a_x_start, int *a_y_start)
From a central location finds the biggest rectangle that fits inside the field.
Definition: Landscape.cpp:4814
tof_ConventionalPig
Definition: LandscapeFarmingEnums.h:646
tov_ITGrassland
Definition: LandscapeFarmingEnums.h:606
HedgeBank
Definition: Elements.h:971
Landscape::SetLatitude
void SetLatitude(double latitude)
Sets the latitude of the landscape location.
Definition: Landscape.h:609
tof_UserDefinedFarm35
Definition: LandscapeFarmingEnums.h:694
l_map_dump_event_y1
static CfgInt l_map_dump_event_y1("MAP_DUMP_EVENT_YA", CFG_CUSTOM, 2909)
tole_OOrchard
Definition: LandscapeFarmingEnums.h:153
GooseFieldListItem::polyref
int polyref
Definition: Landscape.h:87
g_cfg
std::shared_ptr< Configurator > g_cfg
Definition: Configurator.cpp:56
tole_WindTurbine
Definition: LandscapeFarmingEnums.h:119
fp_npks
Definition: Treatment.h:51
tov_DKOSpringOats
Definition: LandscapeFarmingEnums.h:398
tov_FISpringBarley_Fodder
Definition: LandscapeFarmingEnums.h:553
CfgFloat::value
double value() const
Definition: Configurator.h:142
tole_WalnutPlantation
Definition: LandscapeFarmingEnums.h:169
l_map_map_file
static CfgStr l_map_map_file("MAP_MAP_FILE", CFG_CUSTOM, "map.lsb")
g_map_le_borderstype
CfgInt g_map_le_borderstype("MAP_LE_BORDERSTYPE", CFG_CUSTOM, 160)
tov_DKOLegume_Beans_CC
Definition: LandscapeFarmingEnums.h:426
burn_top
Definition: Treatment.h:143
tov_DEOAsparagusEstablishedPlantation
Definition: LandscapeFarmingEnums.h:512
Calendar::GetMonth
int GetMonth(void)
Definition: Calendar.h:73
tole_MixedForest
Definition: LandscapeFarmingEnums.h:75
toc_SeedGrass2
Definition: LandscapeFarmingEnums.h:898
FarmToDo
FarmToDo
Definition: Treatment.h:31
tov_NLWinterWheat
Definition: LandscapeFarmingEnums.h:256
tole_OChristmasTrees
Definition: LandscapeFarmingEnums.h:157
Landscape::m_nectar_map
Eigen::MatrixXf m_nectar_map
This is the matrix to store the nectar proportion (0-1) left for each cell.
Definition: Landscape.h:235
toc_ORyeGrass
Definition: LandscapeFarmingEnums.h:859
tov_DKOrchPear
Definition: LandscapeFarmingEnums.h:463
fp_nk
Definition: Treatment.h:133
Landscape::DistanceToP
int DistanceToP(APoint a_Here, APoint a_There)
Distance to the current main population manager, calculates distance from 2 coordinates to other 2 co...
Definition: Landscape.cpp:1708
Landscape::SupplyTotalPollen
double SupplyTotalPollen(int a_polyref)
Returns the sugar quantity produced by of the vegetation using the polygon reference number a_polyref...
Definition: Landscape.h:671
tov_OWinterWheatUndersown
Definition: LandscapeFarmingEnums.h:211
tov_OPermanentGrassGrazed
Definition: LandscapeFarmingEnums.h:206
Landscape::ClassificationWater
bool ClassificationWater(TTypesOfLandscapeElement tole)
Returns whether the polygon is classfied as water.
Definition: Landscape.cpp:1284
tov_UKWinterRape
Definition: LandscapeFarmingEnums.h:286
tof_UserDefinedFarm6
Definition: LandscapeFarmingEnums.h:665
cfg_P1D
CfgFloat cfg_P1D
Scaler for assimilation of energy from grass for pinkfeet. Madsen 1985 Vol 16 p. 222 - 228 Ornis Scan...
Definition: Landscape.cpp:280
Calendar::GetDayInMonth
int GetDayInMonth(void)
Definition: Calendar.h:77
Landscape::SupplyPollen
PollenNectarData SupplyPollen(int a_polyref)
Returns information on the pollen produced by the vegetation using the polygon reference number a_pol...
Definition: Landscape.h:641
Calendar::DayLength
int DayLength(void)
Definition: Calendar.h:63
burn_straw_stubble
Definition: Treatment.h:104
tov_DEGrasslandSilageAnnual
Definition: LandscapeFarmingEnums.h:474
toc_YoungForestCrop
Definition: LandscapeFarmingEnums.h:924
tov_PTWinterBarley
Definition: LandscapeFarmingEnums.h:321
tole_Saltmarsh
Definition: LandscapeFarmingEnums.h:110
org_herbicide
Definition: Treatment.h:85
tov_NLGrassGrazed1Spring
Definition: LandscapeFarmingEnums.h:269
tole_MontadoCorkOak
Definition: LandscapeFarmingEnums.h:136
toc_PermanentGrassTussocky
Definition: LandscapeFarmingEnums.h:888
toc_CloverGrassGrazed3
Definition: LandscapeFarmingEnums.h:794
tov_ITOOrchard
Definition: LandscapeFarmingEnums.h:608
tole_WaterBufferZone
Definition: LandscapeFarmingEnums.h:130
FarmManager::DumpFarmrefs
void DumpFarmrefs(const char *a_filename)
dumps the farmrefs file to a standard named file
Definition: Farm.cpp:5614
l_map_dump_event_enable
static CfgBool l_map_dump_event_enable("MAP_DUMP_EVENT_ENABLE", CFG_CUSTOM, false)
GooseFieldListItem::geesesp
int geesesp[gs_foobar]
Definition: Landscape.h:89
toc_OWinterRye
Definition: LandscapeFarmingEnums.h:881
RasterMap::Put
void Put(int a_x, int a_y, int a_elem)
Definition: Rastermap.h:60
tov_DKOPotatoIndustry
Definition: LandscapeFarmingEnums.h:390
toc_OLentils
Definition: LandscapeFarmingEnums.h:838
tov_DKFarmYoungForest_Perm
Definition: LandscapeFarmingEnums.h:456
PesticideMap::DumpPMapF
bool DumpPMapF()
Definition: Pesticide.h:819
tov_DKCloverGrassGrazed2
Definition: LandscapeFarmingEnums.h:371
Landscape::SupplySugar
double SupplySugar(int a_polyref)
Returns information on the sugar produced by the vegetation using the polygon reference number a_poly...
Definition: Landscape.h:653
l_map_dump_veg_x
CfgInt l_map_dump_veg_x("MAP_DUMP_VEG_X", CFG_CUSTOM, 100)
tof_UserDefinedFarm7
Definition: LandscapeFarmingEnums.h:666
LE::SetUnsprayedMarginPolyRef
void SetUnsprayedMarginPolyRef(int a_unsprayedmargin)
Definition: Elements.h:386
tole_OEnergyCrop
Definition: LandscapeFarmingEnums.h:159
g_map_le_unsprayedmargins_chance
CfgInt g_map_le_unsprayedmargins_chance("MAP_LE_UMARGIN_CHANCE", CFG_CUSTOM, 25)
fa_cu
Definition: Treatment.h:140
tov_DKOptimalFlowerMix2
Definition: LandscapeFarmingEnums.h:437
Landscape::FillVegAreaData
void FillVegAreaData()
Runs through all polygons and records the area of each vegetation type.
Definition: Landscape.cpp:5712
tov_WinterWheatShort
Definition: LandscapeFarmingEnums.h:218
cfg_G6B
CfgFloat cfg_G6B
Coefficient B in a second order polynomial function.
Definition: Landscape.cpp:293
LE::GetMinY
int GetMinY(void)
Definition: Elements.h:400
tov_DKFarmForest_Perm
Definition: LandscapeFarmingEnums.h:450
tov_DKMaize
Definition: LandscapeFarmingEnums.h:382
autumn_roll
Definition: Treatment.h:38
strigling_hill
Definition: Treatment.h:117
tov_PTMaize_Hort
Definition: LandscapeFarmingEnums.h:332
toc_Beet
Definition: LandscapeFarmingEnums.h:785
tov_DKOGrassGrazed_Perm
Definition: LandscapeFarmingEnums.h:454
heavy_cultivator_aggregate
Definition: Treatment.h:120
PesticideTable
Definition: Pesticide.h:776
Landscape::m_polymapping
vector< int > m_polymapping
Definition: Landscape.h:163
cfg_pesticidemapnoyears
CfgInt cfg_pesticidemapnoyears("PEST_MAP_NOYEARS", CFG_CUSTOM, 1)
The numer of years of pesticide mapping.
tole_SmallRoad
Definition: LandscapeFarmingEnums.h:82
cfg_pesticidetesttype
CfgInt cfg_pesticidetesttype("PESTICIDETESTYPE", CFG_CUSTOM, -1)
tov_DKWinterRye
Definition: LandscapeFarmingEnums.h:419
tov_WinterBarleyStrigling
Definition: LandscapeFarmingEnums.h:221
fp_manganesesulphate
Definition: Treatment.h:59
tov_FIGreenFallow_Perm
Definition: LandscapeFarmingEnums.h:572
Landscape::hb_FindHedges
void hb_FindHedges(void)
Generate a list of polygon numbers for new hedgebank addition.
Definition: Hedgebanks.cpp:273
g_nectarpollen
class PollenNectarDevelopmentData * g_nectarpollen
Definition: Plants.cpp:41
tov_PotatoesIndustry
Definition: LandscapeFarmingEnums.h:212
Landscape::RemoveNectarFromTotal
void RemoveNectarFromTotal(int a_polyref, double a_removed_amount)
Remove the given amount of nectar from the total amount in the given polygon.
Definition: Landscape.h:669
tov_DECabbage
Definition: LandscapeFarmingEnums.h:472
Landscape::PolytypeToString
std::string PolytypeToString(TTypesOfLandscapeElement a_le_type)
Returns the text representation of a TTypesOfLandscapeElement type.
Definition: Landscape.cpp:6268
tov_DKPlantNursery_Perm
Definition: LandscapeFarmingEnums.h:458
Pesticide::Tick
void Tick(void)
Main pesticide method that is called every day.
Definition: Pesticide.cpp:226
janfirst
Definition: Plants.h:52
tov_DKOOrchCherry
Definition: LandscapeFarmingEnums.h:468
tov_UKWinterWheat
Definition: LandscapeFarmingEnums.h:287
tov_FRGrassland_Perm
Definition: LandscapeFarmingEnums.h:589
hay_turning
Definition: Treatment.h:100
tov_DEWinterRye
Definition: LandscapeFarmingEnums.h:506
PEST_GRIDSIZE
#define PEST_GRIDSIZE
Definition: Pesticide.h:53
PesticideMap::Spray
virtual void Spray(LE *a_element_sprayed, TTypesOfPesticideCategory a_type)
Definition: Pesticide.cpp:1863
tole_Airport
Definition: LandscapeFarmingEnums.h:131
toc_GrazingPigs
Definition: LandscapeFarmingEnums.h:811
tov_BEWinterBarley
Definition: LandscapeFarmingEnums.h:301
Weather::GetWind
double GetWind(long a_date)
Definition: Weather.h:508
tov_DKGrassTussocky_Perm
Definition: LandscapeFarmingEnums.h:435
tole_BuiltUpWithParkland
Definition: LandscapeFarmingEnums.h:102
cfg_mintownbuildingnumber
static CfgInt cfg_mintownbuildingnumber("MAP_MINTOWNBUILDINGNUMBER", CFG_CUSTOM, 6)
tov_DETriticale
Definition: LandscapeFarmingEnums.h:505
Landscape::m_PesticideMap
PesticideMap * m_PesticideMap
For specialised pesticide recording.
Definition: Landscape.h:169
last_treatment
Definition: Treatment.h:150
tole_ChestnutForest
Definition: LandscapeFarmingEnums.h:143
cfg_DumpFarmAreas
CfgBool cfg_DumpFarmAreas
If set to true, an output file with farm areas is produced.
tov_DKOSpringBarley
Definition: LandscapeFarmingEnums.h:363
straw_removal
Definition: Treatment.h:124
tole_ChristmasTrees
Definition: LandscapeFarmingEnums.h:156
toc_OCloverGrassGrazed2
Definition: LandscapeFarmingEnums.h:827
Landscape::SupplyWeedBiomass
double SupplyWeedBiomass(int a_polyref)
Returns the weed biomass of the vegetation using the polygon reference number a_polyref or based on t...
Definition: Landscape.h:1552
tov_PermanentGrassLowYield
Definition: LandscapeFarmingEnums.h:225
toc_PotatoesSeed
Definition: LandscapeFarmingEnums.h:893
cfg_habitat_polnek_file
static CfgStr cfg_habitat_polnek_file("HABITAT_POLNEK_FILENAME", CFG_CUSTOM, "PollenNectarResourcesHabitat.txt")
tov_FIOStarchPotato_North
Definition: LandscapeFarmingEnums.h:529
l_map_art_hb_width
static CfgFloat l_map_art_hb_width("MAP_ART_HB_WIDTH", CFG_CUSTOM, 0.3)
tov_PLFodderLucerne1
Definition: LandscapeFarmingEnums.h:243
tov_DKWinterFodderGrass
Definition: LandscapeFarmingEnums.h:378
fa_n
Definition: Treatment.h:139
FarmManager::GetFarmPtr
Farm * GetFarmPtr(int a_owner)
Returns the pointer to a farm with a specific number.
Definition: Farm.h:1536
l_map_consolidatepolys
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.
FlowerStripWithRotation
Element class for flower strips.
Definition: Elements.h:1013
shredding
Definition: Treatment.h:126
LE::SetOpenness
void SetOpenness(int a_openness)
Records the openness statistic for this polygon.
Definition: Elements.h:448
toc_OTriticale
Definition: LandscapeFarmingEnums.h:876
l_map_dump_veg_y
CfgInt l_map_dump_veg_y("MAP_DUMP_VEG_Y", CFG_CUSTOM, 100)
LE::Set_Att_Woody
void Set_Att_Woody(bool a_woody)
Definition: Elements.h:206
tov_FieldPeasStrigling
Definition: LandscapeFarmingEnums.h:218
tov_FIOCaraway2
Definition: LandscapeFarmingEnums.h:568
Weather::Tick
void Tick(void)
Definition: Weather.cpp:66
Landscape::ClassificationVegGooseGrass
bool ClassificationVegGooseGrass(TTypesOfVegetation a_vege_type)
Returns whether a vegetation type is classified as Goose Grass.
Definition: Landscape.cpp:718
cfg_AddBeetleBanks
static CfgBool cfg_AddBeetleBanks("BBANKS_ADD", CFG_CUSTOM, false)
Landscape::SupplyDeadBiomass
double SupplyDeadBiomass(int a_polyref)
Returns the dead biomass of the vegetation using the polygon reference number a_polyref or based on t...
Definition: Landscape.h:1652
toc_Horticulture
Definition: LandscapeFarmingEnums.h:812
PollenNectarDevelopmentData::RecalculatePollenNectarCurvesForYear
void RecalculatePollenNectarCurvesForYear(void)
Recalculate the pollen and nectar curves for a year for the habitat species. This function only be ca...
Definition: PollenNectar.cpp:396
tole_PermanentSetaside
Definition: LandscapeFarmingEnums.h:68
l_map_art_hb_core_thres
static CfgFloat l_map_art_hb_core_thres("MAP_ART_HB_STRIPE_THRES", CFG_CUSTOM, 0.4)
tov_DELegumes
Definition: LandscapeFarmingEnums.h:476
tov_FISprSpringBarley_Fodder
Definition: LandscapeFarmingEnums.h:554
PestIncidenceManager
A small class to generate pest incidence information.
Definition: Landscape.h:113
tov_DEWinterRape
Definition: LandscapeFarmingEnums.h:508
pheromone
Definition: Treatment.h:149
toc_FodderLucerne1
Definition: LandscapeFarmingEnums.h:804
toc_WinterRape
Definition: LandscapeFarmingEnums.h:919
tov_PLMaizeSilage
Definition: LandscapeFarmingEnums.h:240
LE::SetVegGrowthScalerRand
virtual void SetVegGrowthScalerRand()
Definition: Elements.h:156
tov_OrchardCrop
Definition: LandscapeFarmingEnums.h:227
fp_n
Definition: Treatment.h:132
tov_UKPermanentGrass
Definition: LandscapeFarmingEnums.h:281
PollenNectarData::m_quantity
double m_quantity
Definition: PollenNectar.h:167
RasterMap::GetMagicP
int * GetMagicP(int a_x, int a_y)
Definition: Rastermap.h:75
manual_weeding
Definition: Treatment.h:148
tov_PTShrubPastures
Definition: LandscapeFarmingEnums.h:318
tof_UserDefinedFarm8
Definition: LandscapeFarmingEnums.h:667
tov_PLWinterTriticale
Definition: LandscapeFarmingEnums.h:235
CfgBool::value
bool value() const
Definition: Configurator.h:164
tov_DKPotato
Definition: LandscapeFarmingEnums.h:404
l_map_calc_openness
static CfgBool l_map_calc_openness("MAP_CALC_OPENNESS", CFG_CUSTOM, false)
tov_DKSetAside_SummerMow
Definition: LandscapeFarmingEnums.h:410
fa_npk
Definition: Treatment.h:67
Calendar::Tick
void Tick(void)
Definition: Calendar.cpp:191
tof_UserDefinedFarm12
Definition: LandscapeFarmingEnums.h:671
toc_OFieldPeasSilage
Definition: LandscapeFarmingEnums.h:832
toc_OSBarleySilage
Definition: LandscapeFarmingEnums.h:860
tov_DEHerbsPerennial_after1year
Definition: LandscapeFarmingEnums.h:514
tov_DEOBushFruitPerm
Definition: LandscapeFarmingEnums.h:521
tole_UrbanNoVeg
Definition: LandscapeFarmingEnums.h:100
toc_OSpringBarleyCloverGrass
Definition: LandscapeFarmingEnums.h:866
toc_Triticale
Definition: LandscapeFarmingEnums.h:912
tov_PLSpringBarley
Definition: LandscapeFarmingEnums.h:238
tole_Chameleon
Definition: LandscapeFarmingEnums.h:182
tole_OAsparagusPerm
Definition: LandscapeFarmingEnums.h:178
cfg_tov_polnek_file
static CfgStr cfg_tov_polnek_file("TOV_POLNEK_FILENAME", CFG_CUSTOM, "PollenNectarResourcesTOV.txt")
tov_BEPotatoes
Definition: LandscapeFarmingEnums.h:299
tov_FIFabaBean
Definition: LandscapeFarmingEnums.h:551
l_map_art_hb_seg_len
static CfgFloat l_map_art_hb_seg_len("MAP_ART_HB_SEG_LEN", CFG_CUSTOM, 100.0)
tof_UserDefinedFarm16
Definition: LandscapeFarmingEnums.h:675
Landscape::ClassificationForest
bool ClassificationForest(TTypesOfLandscapeElement a_tole)
Returns whether the polygon is classfied as woodland.
Definition: Landscape.cpp:1323
Landscape::m_FarmManager
FarmManager * m_FarmManager
List of all the farms.
Definition: Landscape.h:152
tov_DKOSpringBarley_CC
Definition: LandscapeFarmingEnums.h:432
Landscape::SetPolyMaxMinExtents
void SetPolyMaxMinExtents(void)
Sets MapValid as true for each polygon found.
Definition: Landscape.cpp:3121
winter_plough
Definition: Treatment.h:42
tov_DKOCloverGrassGrazed2
Definition: LandscapeFarmingEnums.h:375
g_map_olivetree_borders
CfgBool g_map_olivetree_borders("MAP_OLIVETREE_BORDERS", CFG_CUSTOM, false)
PestIncidenceManager::RecalculateIncidence
void RecalculateIncidence()
Assigns a random number between 0 and 1.0 as the current incidence level.
Definition: Landscape.cpp:7837
toc_PlantNursery
Definition: LandscapeFarmingEnums.h:890
tov_DKOLentils
Definition: LandscapeFarmingEnums.h:434
tole_MontadoHolmOak
Definition: LandscapeFarmingEnums.h:137
Calendar::GetDaylightProportion
double GetDaylightProportion(void)
Definition: Calendar.h:78
tov_FIOTurnipRape
Definition: LandscapeFarmingEnums.h:534
fp_calcium
Definition: Treatment.h:65
tov_BroadBeans
Definition: LandscapeFarmingEnums.h:228
tov_DKCloverGrassGrazed3
Definition: LandscapeFarmingEnums.h:372
tov_FRWinterBarley
Definition: LandscapeFarmingEnums.h:582
tole_UnknownGrass
Definition: LandscapeFarmingEnums.h:113
cfg_G6F
CfgFloat cfg_G6F
Max x-value - at this point the curve tends to 0, must stop here to avoid negative values.
Definition: Landscape.cpp:302
tov_PTCabbage
Definition: LandscapeFarmingEnums.h:330
tov_DKOSpringFodderGrass
Definition: LandscapeFarmingEnums.h:380
tov_FIPotatoIndustry_South
Definition: LandscapeFarmingEnums.h:544
cfg_B6D
CfgFloat cfg_B6D
Scaler for assimilation of energy from grass for pinkfeet. Madsen 1985 Vol 16 p. 222 - 228 Ornis Scan...
Definition: Landscape.cpp:316
spring_harrow
Definition: Treatment.h:45
tov_DKSetAside
Definition: LandscapeFarmingEnums.h:409
cut_to_silage
Definition: Treatment.h:98
toc_GenericCatchCrop
Definition: LandscapeFarmingEnums.h:806
GooseFieldListItem::vegtype
TTypesOfVegetation vegtype
Definition: Landscape.h:97
LE::Set_Att_VegCereal
virtual void Set_Att_VegCereal(bool)
Definition: Elements.h:218
toc_SpringBarley
Definition: LandscapeFarmingEnums.h:901
tov_UKTempGrass
Definition: LandscapeFarmingEnums.h:284
tov_PTVineyards
Definition: LandscapeFarmingEnums.h:320
toc_Fallow
Definition: LandscapeFarmingEnums.h:797
Landscape::RebuildPolyMapping
void RebuildPolyMapping()
Called if there is any change in the polygons and loops through all polygons resetting the Landscape:...
Definition: Landscape.h:395
GooseFieldListItem::roostdists
int roostdists[gs_foobar]
Definition: Landscape.h:92
tole_AlmondPlantation
Definition: LandscapeFarmingEnums.h:168
tov_DKPotatoSeed
Definition: LandscapeFarmingEnums.h:406
tov_DKWinterCloverGrassGrazedSown
Definition: LandscapeFarmingEnums.h:369
Weather::GetWindHour
double GetWindHour(int hour)
Definition: Weather.h:469
toc_OWinterWheatUndersown
Definition: LandscapeFarmingEnums.h:883
tof_UserDefinedFarm10
Definition: LandscapeFarmingEnums.h:669
tov_NLPermanentGrassGrazed
Definition: LandscapeFarmingEnums.h:261
toc_MaizeSpring
Definition: LandscapeFarmingEnums.h:815
tov_PLWinterRye
Definition: LandscapeFarmingEnums.h:236
tov_DKSpringBarley
Definition: LandscapeFarmingEnums.h:361
tov_OSBarleySilage
Definition: LandscapeFarmingEnums.h:218
LE_TypeClass::TranslateEleTypes
TTypesOfLandscapeElement TranslateEleTypes(int EleReference)
Definition: Elements.cpp:3582
MownGrassStrip
Definition: Elements.h:1131
Landscape::Tick
void Tick(void)
Definition: Landscape.cpp:2943
l_map_poly_file
static CfgStr l_map_poly_file("MAP_POLY_FILE", CFG_CUSTOM, "polygonrefs.txt")
tole_FishFarm
Definition: LandscapeFarmingEnums.h:124
cfg_BeetleBankInvert
CfgBool cfg_BeetleBankInvert("BBANK_INVERT", CFG_CUSTOM, false)
tov_FieldPeas
Definition: LandscapeFarmingEnums.h:203
TTypesOfLandscapeElement
TTypesOfLandscapeElement
Values that represent the types of landscape polygon that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:57
tov_DKOCatchCrop
Definition: LandscapeFarmingEnums.h:421
tole_Railway
Definition: LandscapeFarmingEnums.h:61
tole_Parkland
Definition: LandscapeFarmingEnums.h:99
cfg_pesticidemapcellsize
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...
cfg_B6G
CfgFloat cfg_B6G
Min x-value.
Definition: Landscape.cpp:322
tov_PTPotatoes
Definition: LandscapeFarmingEnums.h:328
tov_FIGrasslandSilagePerennial2
Definition: LandscapeFarmingEnums.h:559
LE::AddArea
void AddArea(double a_area_diff)
Definition: Elements.h:380
tov_DKLegume_Beans
Definition: LandscapeFarmingEnums.h:358
Weather::GetSnowDepth
double GetSnowDepth(void)
Get the current snow depth.
Definition: Weather.h:519
tof_UserDefinedFarm18
Definition: LandscapeFarmingEnums.h:677
toc_OMixedVeg
Definition: LandscapeFarmingEnums.h:842
fa_sludge
Definition: Treatment.h:77
pigs_out
Definition: Treatment.h:96
toc_SetAside
Definition: LandscapeFarmingEnums.h:899
tov_DKWinterRye_CC
Definition: LandscapeFarmingEnums.h:424
Landscape::m_maxextent
int m_maxextent
Area maximum extent, the largest value of m_width or m_height
Definition: Landscape.h:189
Pesticide::GetAnythingToDecay
bool GetAnythingToDecay(PlantProtectionProducts a_ppp)
Checks if there are any pesticides to decay.
Definition: Pesticide.h:356
PastureElement
Definition: Elements.h:1102
tov_FIOFabaBean
Definition: LandscapeFarmingEnums.h:552
toc_OSpringBarleyExtensive
Definition: LandscapeFarmingEnums.h:867
toc_WinterBarley
Definition: LandscapeFarmingEnums.h:918
tov_DKCarrots
Definition: LandscapeFarmingEnums.h:353
Landscape::m_RodenticideManager
RodenticideManager * m_RodenticideManager
A pointer to the rodenticide manager.
Definition: Landscape.h:205
Landscape::GetActualGooseGrazingForage
double GetActualGooseGrazingForage(int a_x, int a_y, GooseSpecies a_goose)
Returns the leaf forage resource as seen from a goose standpoint at a polygon referenced by x,...
Definition: Landscape.h:1130
tov_NLPotatoesSpring
Definition: LandscapeFarmingEnums.h:265
tov_NLOrchardCrop
Definition: LandscapeFarmingEnums.h:271
Weather::GetTemp
double GetTemp(long a_date)
Get the temperature on a particular date.
Definition: Weather.h:476
tov_DKOSpringBarleyCloverGrass
Definition: LandscapeFarmingEnums.h:364
tov_WinterBarley
Definition: LandscapeFarmingEnums.h:215
tov_DKOGrazingPigs
Definition: LandscapeFarmingEnums.h:385
LE::SetAspect
void SetAspect(double a_aspect)
Definition: Elements.h:452
VegElement
Definition: Elements.h:686
tole_OliveGrove
Definition: LandscapeFarmingEnums.h:149
l_map_dump_grain_enable
static CfgBool l_map_dump_grain_enable("MAP_DUMP_GRAIN_ENABLE", CFG_CUSTOM, false)
tov_FRSpringBarley
Definition: LandscapeFarmingEnums.h:587
tov_UKPotatoes
Definition: LandscapeFarmingEnums.h:282
fp_p
Definition: Treatment.h:54
tole_Coast
Definition: LandscapeFarmingEnums.h:89
Landscape::ReadPolys1
int ReadPolys1(const char *a_polyfile)
Is used to take a look in the input file for polygons to figure out what the format is (since multipl...
Definition: Landscape.cpp:3404
PesticideMap::DumpPMapI
bool DumpPMapI()
Definition: Pesticide.h:817
tov_IRGrassland_no_reseed
Definition: LandscapeFarmingEnums.h:599
CurveClass::GetY
virtual double GetY(double a_X)
Definition: CurveClasses.cpp:73
cfg_G6G
CfgFloat cfg_G6G
Min x-value.
Definition: Landscape.cpp:304
PesticideMap::DumpPMapH
bool DumpPMapH()
Definition: Pesticide.h:818
Farm::GetFarmNumber
int GetFarmNumber(void)
Definition: Farm.h:775
tov_NLGrassGrazedExtensive1Spring
Definition: LandscapeFarmingEnums.h:275
Landscape::PolysRenumber
void PolysRenumber(void)
Renumbers the polygons from 0 to the number of LE instances - 1. This saves space,...
Definition: Landscape.cpp:4074
tov_OPotatoes
Definition: LandscapeFarmingEnums.h:206
cut_to_hay
Definition: Treatment.h:97
tov_BEWinterBarleyCC
Definition: LandscapeFarmingEnums.h:305
fa_boron
Definition: Treatment.h:141
toc_GrassGrazedExtensive
Definition: LandscapeFarmingEnums.h:809
toc_DummyCropPestTesting
Definition: LandscapeFarmingEnums.h:796
tof_UserDefinedFarm33
Definition: LandscapeFarmingEnums.h:692
tof_UserDefinedFarm17
Definition: LandscapeFarmingEnums.h:676
Landscape::AddPatches
void AddPatches(TTypesOfLandscapeElement a_tole)
The starting point for adding patches to a field (can be used to add patches of any tole_type)
Definition: Landscape.cpp:4977
tov_FINaturalGrassland
Definition: LandscapeFarmingEnums.h:560
LE::Set_Att_VegGrass
virtual void Set_Att_VegGrass(bool)
Definition: Elements.h:220
tov_WWheatPTreatment
Definition: LandscapeFarmingEnums.h:217
cfg_farm_cattle_grazing_lvl_tussocky
CfgInt cfg_farm_cattle_grazing_lvl_tussocky
tov_OWinterBarleyExt
Definition: LandscapeFarmingEnums.h:227
tov_WinterRapeStrigling
Definition: LandscapeFarmingEnums.h:221
tov_FISpringRape
Definition: LandscapeFarmingEnums.h:535
Landscape::SupplyDayInMonth
int SupplyDayInMonth(void)
Passes a request on to the associated Calendar class function, returns m_day_in_month
Definition: Landscape.h:2277
tov_PTOliveGroveTraditional
Definition: LandscapeFarmingEnums.h:333
toc_StarchPotato
Definition: LandscapeFarmingEnums.h:909
tov_DECarrots
Definition: LandscapeFarmingEnums.h:473
Landscape::m_polyid_map
Eigen::ArrayXXi m_polyid_map
This is the array to store the polygon ID for each cell.
Definition: Landscape.h:239
tov_FICaraway1
Definition: LandscapeFarmingEnums.h:565
BeetleBank
Definition: Elements.h:982
tov_OCloverGrassGrazed1
Definition: LandscapeFarmingEnums.h:205
tov_SeedGrass1
Definition: LandscapeFarmingEnums.h:212
Calendar::Date
long Date(void)
Definition: Calendar.h:57
tov_FIStarchPotato_South
Definition: LandscapeFarmingEnums.h:528
Calendar::Reset
void Reset(void)
Definition: Calendar.cpp:39
tole_Pond
Definition: LandscapeFarmingEnums.h:123
tov_SpringBarleySilage
Definition: LandscapeFarmingEnums.h:214
toc_Ryegrass
Definition: LandscapeFarmingEnums.h:895
Weather::GetSoilTemp
double GetSoilTemp(void)
Get the current soil temperature.
Definition: Weather.h:478
Landscape::m_GooseIntakeRateVSVegetationHeight_GL
Polynomial2CurveClass * m_GooseIntakeRateVSVegetationHeight_GL
A curve relating goose intake rates in KJ/min to vegetation height for Greylag Goose (GL)
Definition: Landscape.h:213
cfg_G6A
CfgFloat cfg_G6A
Coefficient A in a second order polynomial function.
Definition: Landscape.cpp:291
tov_IRWinterWheat
Definition: LandscapeFarmingEnums.h:602
tole_Building
Definition: LandscapeFarmingEnums.h:84
tof_ConvMarginalJord
Definition: LandscapeFarmingEnums.h:654
tov_SpringBarleyPTreatment
Definition: LandscapeFarmingEnums.h:225
toc_OStarchPotato
Definition: LandscapeFarmingEnums.h:874
tov_FRPotatoes
Definition: LandscapeFarmingEnums.h:593
tov_UKBeet
Definition: LandscapeFarmingEnums.h:279
fa_k
Definition: Treatment.h:70
Landscape::CalculateMaskCorners
vector< vector< int > > CalculateMaskCorners(int a_centroid_x, int a_centroid_y, int a_half_width)
The function to calculate the corners of mask(s) for the given centroid and half-width with wrapping ...
Definition: Landscape.cpp:2540
APoint
A simple class defining an x,y coordinate set.
Definition: ALMaSS_Setup.h:52
Landscape::m_DoMissingPolygonsManipulations
bool m_DoMissingPolygonsManipulations
A flag to signal that missing polygons exist.
Definition: Landscape.h:198
spring_roll
Definition: Treatment.h:46
tov_DKOSpringWheat
Definition: LandscapeFarmingEnums.h:399
tov_DKOrchCherry
Definition: LandscapeFarmingEnums.h:464
tov_DEPermanentGrassLowYield
Definition: LandscapeFarmingEnums.h:500
toc_OBarleyPeaCloverGrass
Definition: LandscapeFarmingEnums.h:820
tov_DKLegume_Whole
Definition: LandscapeFarmingEnums.h:356
tov_PTOliveGroveSuperIntensive
Definition: LandscapeFarmingEnums.h:336
tov_PTFodderMix
Definition: LandscapeFarmingEnums.h:312
cfg_P1A
CfgFloat cfg_P1A
Coefficient A in a second order polynomial function.
Definition: Landscape.cpp:273
Weather::GetHumidity
double GetHumidity(void)
Get the humidity score today.
Definition: Weather.h:502
Landscape::ClassificationVegMaize
bool ClassificationVegMaize(TTypesOfVegetation a_vege_type)
Returns whether a vegetation type is classified as maize.
Definition: Landscape.cpp:687
Landscape::Set_TOV_Att
void Set_TOV_Att(LE *elem)
Uses a point to an LE instance and sets all the attributes based on its tov type.
Definition: Landscape.h:980
tole_Vineyard
Definition: LandscapeFarmingEnums.h:148
toc_Carrots
Definition: LandscapeFarmingEnums.h:789
tof_ConventionalPlant
Definition: LandscapeFarmingEnums.h:647
tov_DKOLegume_Whole_CC
Definition: LandscapeFarmingEnums.h:428
tov_Triticale
Definition: LandscapeFarmingEnums.h:215
tole_ForestAisle
Definition: LandscapeFarmingEnums.h:152
Landscape::hb_first_free_poly_num
int hb_first_free_poly_num
Definition: Landscape.h:465
WaterBufferZone
Definition: Elements.h:1058
tof_ConventionalCattle
Definition: LandscapeFarmingEnums.h:645
tov_IRSpringBarley
Definition: LandscapeFarmingEnums.h:597
tov_DKOOrchPear
Definition: LandscapeFarmingEnums.h:467
tov_FRSpringOats
Definition: LandscapeFarmingEnums.h:590
cfg_PatchesFreeMargin
static CfgInt cfg_PatchesFreeMargin("PATCHES_FREE_MARGIN", CFG_CUSTOM, 6)
tov_PLWinterBarley
Definition: LandscapeFarmingEnums.h:234
tof_UserDefinedFarm5
Definition: LandscapeFarmingEnums.h:664
tov_DKOFarmYoungForest_Perm
Definition: LandscapeFarmingEnums.h:457
tov_DKMaizeSilage
Definition: LandscapeFarmingEnums.h:383
tov_DEOPeas
Definition: LandscapeFarmingEnums.h:488
tole_OFarmYoungForest
Definition: LandscapeFarmingEnums.h:167
tov_NLMaize
Definition: LandscapeFarmingEnums.h:253
tov_AgroChemIndustryCereal
Definition: LandscapeFarmingEnums.h:217
Landscape::m_PondIndexList
vector< int > m_PondIndexList
List of pond indexes.
Definition: Landscape.h:371
tov_DEGreenFallow_1year
Definition: LandscapeFarmingEnums.h:475
Landscape::AddBeetleBanks
void AddBeetleBanks(TTypesOfLandscapeElement a_tole)
The starting point for adding beetlebanks to a field (can be used to add ‘banks’ of any tole_type.
Definition: Landscape.cpp:4593
Weather::GetMeanTemp
double GetMeanTemp(long a_date, unsigned int a_period)
Definition: Weather.cpp:170
tov_NorwegianPotatoes
Definition: LandscapeFarmingEnums.h:230
tov_DKOMaize
Definition: LandscapeFarmingEnums.h:386
Weather::GetMinTempYesterday
double GetMinTempYesterday(void)
Get the min temperature yesterday.
Definition: Weather.h:490
tov_OSeedGrass2
Definition: LandscapeFarmingEnums.h:208
tov_FIOPotato_North
Definition: LandscapeFarmingEnums.h:541
FarmManager::FarmManagement
void FarmManagement()
Runs the daily farm management for each farm, but also calculates annual spilled grain and maize.
Definition: Farm.cpp:3921
tov_DKGrassLowYield_Perm
Definition: LandscapeFarmingEnums.h:461
tof_AgroChemIndustryCerealFarm2
Definition: LandscapeFarmingEnums.h:656
toc_FieldPeas
Definition: LandscapeFarmingEnums.h:799
tof_UserDefinedFarm15
Definition: LandscapeFarmingEnums.h:674
tov_FIPotato_South
Definition: LandscapeFarmingEnums.h:540
Landscape::SupplyTotalNectar
double SupplyTotalNectar(int a_polyref)
Returns the nectar quantity produced by the vegetation using the polygon reference number a_polyref o...
Definition: Landscape.h:665
LE::SetVegPatchy
void SetVegPatchy(bool p)
Definition: Elements.h:229
g_map_orchards_borders
CfgBool g_map_orchards_borders("MAP_ORCHARDS_BORDERS", CFG_CUSTOM, false)
Landscape::SupplyNectarQuantity
double SupplyNectarQuantity(int a_polyref)
Returns the XXX of the vegetation using the polygon reference number a_polyref or based on the x,...
Definition: Landscape.h:661
tof_PTrialControl
Definition: LandscapeFarmingEnums.h:651
toc_MixedVeg
Definition: LandscapeFarmingEnums.h:817
syninsecticide_treat
Definition: Treatment.h:111
toc_OVegSeeds
Definition: LandscapeFarmingEnums.h:877
tov_DEOWinterRape
Definition: LandscapeFarmingEnums.h:495
tov_DEOOats
Definition: LandscapeFarmingEnums.h:487
Landscape::SupplyAttIsHigh
bool SupplyAttIsHigh(int a_x, int a_y)
Tests whether the polygon at a_x,a_y is designated as xxx.
Definition: Landscape.h:877
toc_FieldPeasSilage
Definition: LandscapeFarmingEnums.h:800
toc_OOrchardCrop
Definition: LandscapeFarmingEnums.h:845
tole_PermPastureLowYield
Definition: LandscapeFarmingEnums.h:66
cfg_B6A
CfgFloat cfg_B6A
Coefficient A in a second order polynomial function.
Definition: Landscape.cpp:309
tole_RiversidePlants
Definition: LandscapeFarmingEnums.h:71
cfg_B6E
CfgBool cfg_B6E
Logical config to control if the curve should be reversed (i.e. 1 - value)
Definition: Landscape.cpp:318
fp_nc
Definition: Treatment.h:135
tov_Wasteland
Definition: LandscapeFarmingEnums.h:228
tov_DEBushFruitPerm
Definition: LandscapeFarmingEnums.h:520
tov_NLGrassGrazedExtensive1
Definition: LandscapeFarmingEnums.h:273
Landscape::FindLongestAxis
int FindLongestAxis(int *x, int *y)
From a central location finds the longest axis of a field.
Definition: Landscape.cpp:4889
tov_PTSorghum
Definition: LandscapeFarmingEnums.h:311
fungicide_treat
Definition: Treatment.h:82
LE::GetSlope
double GetSlope(void)
Definition: Elements.h:417
tov_DEHerbsPerennial_1year
Definition: LandscapeFarmingEnums.h:513
Hedges
Definition: Elements.h:960
Landscape::SupplyLESignal
LE_Signal SupplyLESignal(int a_polyref)
Returns current signal mask for polygon.
Definition: Landscape.cpp:5637
tov_DKUndefined
Definition: LandscapeFarmingEnums.h:415
l_map_print_version_info
static CfgBool l_map_print_version_info("MAP_PRINT_VERSION_INFO", CFG_CUSTOM, true)
Landscape::m_grain_dist
int m_grain_dist
Declaration of attribute, m_grain_dist, a binary condition for good or bad years of spilled grain.
Definition: Landscape.h:1060
tof_NoPesticideNoP
Definition: LandscapeFarmingEnums.h:659
tov_DKOOrchOther
Definition: LandscapeFarmingEnums.h:469
Landscape::SupplyVegPatchy
bool SupplyVegPatchy(int a_polyref)
Returns whether the polygon referenced by a_polyref or a_x, a_y has a vegetation type designated as p...
Definition: Landscape.h:1004
toc_OFieldPeas
Definition: LandscapeFarmingEnums.h:831
tov_DEOMaize
Definition: LandscapeFarmingEnums.h:485
tov_FRWinterWheat
Definition: LandscapeFarmingEnums.h:581
FarmManager::AddField
void AddField(int a_OwnerIndex, LE *a_newland, int a_Owner)
Definition: Farm.cpp:3978
fp_sludge
Definition: Treatment.h:63
tole_HolmOakForest
Definition: LandscapeFarmingEnums.h:141
GooseFieldListItem::maize
double maize
Definition: Landscape.h:95
tov_PermanentSetAside
Definition: LandscapeFarmingEnums.h:211
cfg_AddPatches
static CfgBool cfg_AddPatches("PATCHES_ADD", CFG_CUSTOM, false)
Weather::GetMinTempTomorrow
double GetMinTempTomorrow(void)
Get the min temperature tomorrow.
Definition: Weather.h:494
tov_DEPotatoes
Definition: LandscapeFarmingEnums.h:502
fp_greenmanure
Definition: Treatment.h:62
tole_Saltpans
Definition: LandscapeFarmingEnums.h:133
LE_Signal
unsigned int LE_Signal
Definition: Elements.h:34
Landscape::hb_StripingDist
int hb_StripingDist(void)
Striping distribution function for the new hedgebanks LKM.
Definition: Hedgebanks.cpp:222
shallow_harrow
Definition: Treatment.h:119
tole_UrbanPark
Definition: LandscapeFarmingEnums.h:101
tov_PLBeans
Definition: LandscapeFarmingEnums.h:249
tole_ActivePit
Definition: LandscapeFarmingEnums.h:85
Calendar::OldDays
long OldDays(void)
Definition: Calendar.h:60
fa_slurry
Definition: Treatment.h:72
tov_FIGrasslandSilageAnnual
Definition: LandscapeFarmingEnums.h:564
tole_NaturalFarmGrass
Definition: LandscapeFarmingEnums.h:171
toc_PotatoesIndustry
Definition: LandscapeFarmingEnums.h:892
Polynomial2CurveClass
A polynomial curve class.
Definition: CurveClasses.h:89
tov_WinterRyeStrigling
Definition: LandscapeFarmingEnums.h:221
tov_DEOGreenFallow_1year
Definition: LandscapeFarmingEnums.h:483
tof_UserDefinedFarm24
Definition: LandscapeFarmingEnums.h:683
Landscape::LineHighTest
int LineHighTest(int a_cx, int a_cy, double a_offsetx, double a_offsety)
Provides a measure of the shortest distance in using a vector from a_cx,a_cy unitl tall obstacles are...
Definition: Landscape.cpp:555
cattle_out_low
Definition: Treatment.h:112
Landscape::m_treatment_counts
int m_treatment_counts[last_treatment]
Array for containing the treatment counts.
Definition: Landscape.h:367
cfg_MaxPondSize
static CfgInt cfg_MaxPondSize("MAP_MAXPONDSIZE", CFG_CUSTOM, 5000)
If freshwater area is below this it is designated a pond.
harvest_bushfruit
Definition: Treatment.h:137
LE::SetPoly
void SetPoly(int a_poly)
Definition: Elements.h:288
Landscape::hb_RestoreHedgeCore
void hb_RestoreHedgeCore(int a_orig_poly_number)
LKM.
Definition: Hedgebanks.cpp:308
preseeding_cultivator_sow
Definition: Treatment.h:40
Landscape::m_PesticideType
TTypesOfPesticide m_PesticideType
An attribute to hold the pesticide type being tested, if there is one, if not default is -1.
Definition: Landscape.h:469
tov_SpringBarleyCloverGrassStrigling
Definition: LandscapeFarmingEnums.h:220
cfg_farmeventfile
static CfgStr cfg_farmeventfile("FARMEVENT_FILENAME", CFG_CUSTOM, "FarmEvents.txt")
tole_OFarmForest
Definition: LandscapeFarmingEnums.h:161
Landscape::m_toxShouldSpray
bool m_toxShouldSpray
A flag indicating whether pesticide should be sprayed.
Definition: Landscape.h:526
fp_pk
Definition: Treatment.h:53
tof_NoPesticideBase
Definition: LandscapeFarmingEnums.h:658
tole_NaturalGrassDry
Definition: LandscapeFarmingEnums.h:70
Landscape::hb_HasNeighbourColor
bool hb_HasNeighbourColor(int a_x, int a_y, int a_neighbour_color)
Tests for an already process neighbour cell.
Definition: Hedgebanks.cpp:449
tov_DKOptimalFlowerMix1
Definition: LandscapeFarmingEnums.h:436
Landscape::m_pestincidencefactor
double m_pestincidencefactor
Definition: Landscape.h:175
FarmManager::GetNoFarms
int GetNoFarms()
Definition: Farm.h:1636
tov_FISpringBarley_Malt
Definition: LandscapeFarmingEnums.h:549
tov_DKWinterBarley
Definition: LandscapeFarmingEnums.h:417
toc_FodderLucerne2
Definition: LandscapeFarmingEnums.h:805
tov_UKBeans
Definition: LandscapeFarmingEnums.h:278
Landscape::CountMapSquares
void CountMapSquares(void)
Calculates the area for each polygon in the mapand stores it in LE::m_squares_in_map.
Definition: Landscape.cpp:4052
tov_DESugarBeet
Definition: LandscapeFarmingEnums.h:471
tov_DEOOrchard
Definition: LandscapeFarmingEnums.h:519
Landscape::BorderTest
bool BorderTest(int a_fieldindex, int a_borderindex, int a_x, int a_y)
Used to decide if a coordinate location should become a border/unsprayed margin.
Definition: Landscape.cpp:4555
tov_NLBeet
Definition: LandscapeFarmingEnums.h:251
cfg_productapplicendyear
CfgInt cfg_productapplicendyear("PEST_PROCTAPPLICENDYEAR", CFG_CUSTOM,-1)
tov_OCarrots
Definition: LandscapeFarmingEnums.h:205
MapErrorMsg::Warn
void Warn(MapErrorState a_level, std::string a_msg1, std::string a_msg2)
Definition: MapErrorMsg.cpp:69
RoadsideVerge
Definition: Elements.h:1045
Landscape::hb_PaintWhoHasNeighbourColor
bool hb_PaintWhoHasNeighbourColor(int a_neighbour_color, int a_new_color)
Pushes a value to a pixel cell that denotes that is has a neighbour that is not hedge.
Definition: Hedgebanks.cpp:523
tov_OFirstYearDanger
Definition: LandscapeFarmingEnums.h:206
tov_NLBeetSpring
Definition: LandscapeFarmingEnums.h:262
RasterMap::MissingCellReplace
bool MissingCellReplace(int a_x, int a_y, bool a_fieldsonly)
A method for removing missing polygons.
Definition: Rastermap.cpp:201
Landscape::m_map_polyid_within_dist
std::vector< std::vector< std::vector< int > > > m_map_polyid_within_dist
This is the vector to store all the polygon IDs within a certain distance to each location in a lands...
Definition: Landscape.h:241
fa_pks
Definition: Treatment.h:145
Landscape::SupplyMonthName
std::string SupplyMonthName(void)
Passes a request on to the associated Calendar class function, returns the month name (e....
Definition: Landscape.cpp:3143
Landscape::m_latitude
double m_latitude
Definition: Landscape.h:534
Landscape::SupplyPolygonArea
double SupplyPolygonArea(int a_polyref)
Returns the polygon area of a particular polygon referenced by polygon.
Definition: Landscape.h:1058
tov_FIOSpringBarley_Malt
Definition: LandscapeFarmingEnums.h:550
Landscape::hb_height
int hb_height
Definition: Landscape.h:461
tov_PlantNursery
Definition: LandscapeFarmingEnums.h:228
tov_IRGrassland_reseed
Definition: LandscapeFarmingEnums.h:600
Landscape::m_width10
int m_width10
Area width times 10.
Definition: Landscape.h:183
tov_SpringBarley
Definition: LandscapeFarmingEnums.h:214
tole_MownGrassStrip
Definition: LandscapeFarmingEnums.h:96
org_fungicide
Definition: Treatment.h:86
tov_FIGrasslandSilagePerennial1
Definition: LandscapeFarmingEnums.h:558
summer_harrow
Definition: Treatment.h:49
tov_WinterWheatStriglingSingle
Definition: LandscapeFarmingEnums.h:224
Weather::GetWindPeriod
double GetWindPeriod(long a_date, unsigned int a_period)
Definition: Weather.cpp:697
tov_DKGrassGrazed_Perm
Definition: LandscapeFarmingEnums.h:460
tov_FIStarchPotato_North
Definition: LandscapeFarmingEnums.h:527
Landscape::SupplyDayInYear
int SupplyDayInYear(void)
Passes a request on to the associated Calendar class function, the day in the year.
Definition: Landscape.h:2267
Landscape::hb_UpPolyNumbers
void hb_UpPolyNumbers(void)
Adds a big number to all polygon refs in the map to create space to safely manipulate the hedge pixel...
Definition: Hedgebanks.cpp:286
cfg_G6C
CfgFloat cfg_G6C
The constant C in a second order polynomial function.
Definition: Landscape.cpp:295
tov_PTOats
Definition: LandscapeFarmingEnums.h:327
Landscape::hb_MarkTheBresenhamWay
void hb_MarkTheBresenhamWay(void)
‘Paints’ the core of a hedge with a negative number for use in deciding what becomes hedgebank later
Definition: Hedgebanks.cpp:626
tov_OSetAside
Definition: LandscapeFarmingEnums.h:208
cfg_farm_cattle_grazing_lvl_lowyield
CfgInt cfg_farm_cattle_grazing_lvl_lowyield
Landscape::SupplyVegBiomass
double SupplyVegBiomass(int a_polyref)
Returns the biomass of the vegetation using the polygon reference number a_polyref or based on the x,...
Definition: Landscape.h:1542
cfg_rodenticide_enable
CfgBool cfg_rodenticide_enable("RODENTICIDE_ENABLE", CFG_CUSTOM, false)
Landscape::DumpTreatCounters
void DumpTreatCounters(const char *a_filename)
When the simulation is closed this method saves the number of each farm management that has been carr...
Definition: Landscape.cpp:5657
HB_MAGIC_PAINTER_BIT
#define HB_MAGIC_PAINTER_BIT
Definition: Hedgebanks.cpp:40
cattle_out
Definition: Treatment.h:95
harvestshoots
Definition: Treatment.h:147
LE::SetGrazingLevel
virtual void SetGrazingLevel(int)
Definition: Elements.h:180
Weather::GetMinTemp
double GetMinTemp(void)
Get the min temperature today.
Definition: Weather.h:486
tov_FISpringWheat
Definition: LandscapeFarmingEnums.h:531
toc_OSpringRye
Definition: LandscapeFarmingEnums.h:872
tov_PTWinterWheat
Definition: LandscapeFarmingEnums.h:309
tov_SpringWheat
Definition: LandscapeFarmingEnums.h:215
tov_FlowerStrip3
Definition: LandscapeFarmingEnums.h:200
stubble_cultivator_heavy
Definition: Treatment.h:36
tole_RefuseSite
Definition: LandscapeFarmingEnums.h:129
tov_FIOSpringWheat
Definition: LandscapeFarmingEnums.h:532
Landscape::m_PesticideTable
PesticideTable * m_PesticideTable
For specialised pesticide recording.
Definition: Landscape.h:171
tov_DKOWinterWheat_CC
Definition: LandscapeFarmingEnums.h:423
Landscape::hb_max_y
int hb_max_y
Definition: Landscape.h:464
tov_DKBushFruit_Perm1
Definition: LandscapeFarmingEnums.h:442
LE::GetElevation
double GetElevation(void)
Get elevation data.
Definition: Elements.h:416
tov_DKPotatoIndustry
Definition: LandscapeFarmingEnums.h:405
tov_DEPermanentGrassGrazed
Definition: LandscapeFarmingEnums.h:499
tole_FarmYoungForest
Definition: LandscapeFarmingEnums.h:166
cfg_pollen_nectar_on
CfgBool cfg_pollen_nectar_on
Flag to determine whether nectar and pollen models are used - should be set to true for pollinator mo...
tov_NLSpringBarleySpring
Definition: LandscapeFarmingEnums.h:266
APoint::m_x
int m_x
Definition: ALMaSS_Setup.h:55
toc_OOats
Definition: LandscapeFarmingEnums.h:843
biocide
Definition: Treatment.h:116
tole_DeciduousForest
Definition: LandscapeFarmingEnums.h:74
SmallRoad
Definition: Elements.h:1196
Landscape::SupplyBirdSeedForage
double SupplyBirdSeedForage(int a_polyref)
Returns the grain forage resource.
Definition: Landscape.h:1148
tov_DKCerealLegume
Definition: LandscapeFarmingEnums.h:365
tole_FlowerStrip
Definition: LandscapeFarmingEnums.h:179
tov_UKMaize
Definition: LandscapeFarmingEnums.h:280
tole_GreenFallow
Definition: LandscapeFarmingEnums.h:172
l_map_no_pesticide_fields
static CfgInt l_map_no_pesticide_fields("MAP_NO_PESTICIDE_FIELDS", CFG_CUSTOM, 0)
tov_OWinterRape
Definition: LandscapeFarmingEnums.h:209
tole_Track
Definition: LandscapeFarmingEnums.h:81
swathing
Definition: Treatment.h:93
tov_DKOBushFruit_Perm1
Definition: LandscapeFarmingEnums.h:444
tole_PermPastureTussocky
Definition: LandscapeFarmingEnums.h:67
tole_HeritageSite
Definition: LandscapeFarmingEnums.h:112
tov_SESpringBarley
Definition: LandscapeFarmingEnums.h:576
cfg_PatchesMinWidth
static CfgInt cfg_PatchesMinWidth("PATCHES_MIN_WIDTH", CFG_CUSTOM, 10)
tole_MaritimePineForest
Definition: LandscapeFarmingEnums.h:146
Landscape::SupplyYearNumber
int SupplyYearNumber(void)
Passes a request on to the associated Calendar class function, returns m_simulationyear
Definition: Landscape.h:2287
glyphosate
Definition: Treatment.h:114
tov_DKOLegume_Peas_CC
Definition: LandscapeFarmingEnums.h:427
Landscape::m_habitat_species
std::map< int, vector< int > > m_habitat_species
This the dictionary to store the composition of species for every habitat type.
Definition: Landscape.h:215
tole_FieldBoundary
Definition: LandscapeFarmingEnums.h:62
tole_OBushFruit
Definition: LandscapeFarmingEnums.h:155
Landscape::hb_GenerateHBPolys
void hb_GenerateHBPolys(void)
Creates the necessary new hedgebank polygons in Landscape::m_elems.
Definition: Hedgebanks.cpp:177
tov_PermanentGrassTussocky
Definition: LandscapeFarmingEnums.h:211
g_map_le_borders_min_field_size
CfgInt g_map_le_borders_min_field_size("MAP_LE_BORDERS_MIN_FIELD_SIZE", CFG_CUSTOM, 10000)
tov_FRSunflower
Definition: LandscapeFarmingEnums.h:591
Field
Definition: Elements.h:933
tof_PTrialToxicControl
Definition: LandscapeFarmingEnums.h:653
toc_PermanentSetAside
Definition: LandscapeFarmingEnums.h:889
tov_BEGrassGrazed2
Definition: LandscapeFarmingEnums.h:294
tov_BEGrassGrazed1
Definition: LandscapeFarmingEnums.h:292
Landscape::RemovePollenFromTotal
void RemovePollenFromTotal(int a_polyref, double a_removed_amount)
Remove the given amount of pollen from the total amount in the given polygon.
Definition: Landscape.h:675
Landscape::SupplyVegCover
double SupplyVegCover(int a_polyref)
Returns the vegetation cover proportion of the vegetation using the polygon reference number a_polyre...
Definition: Landscape.h:1667
l_map_write_ascii
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.
tov_DKOSpringOats_CC
Definition: LandscapeFarmingEnums.h:430
tov_SpringBarleySpr
Definition: LandscapeFarmingEnums.h:228
CfgInt::value
int value() const
Definition: Configurator.h:116
Weather::GetRadiationHour
double GetRadiationHour(int hour)
Definition: Weather.h:471
tov_DEOPermanentGrassLowYield
Definition: LandscapeFarmingEnums.h:501
tov_FIFeedingGround
Definition: LandscapeFarmingEnums.h:561
Landscape::hb_hedges
vector< int > hb_hedges
Declaration of attributes for hedgebanks.
Definition: Landscape.h:454
l_pest_enable_pesticide_engine
CfgBool l_pest_enable_pesticide_engine
Used to turn on or off the PPP functionality of ALMaSS.
tov_DKOVegSeeds
Definition: LandscapeFarmingEnums.h:400
tov_FIOPotato_South
Definition: LandscapeFarmingEnums.h:542
toc_CloverGrassGrazed2
Definition: LandscapeFarmingEnums.h:793
NonVegElement
Definition: Elements.h:1144
tole_Copse
Definition: LandscapeFarmingEnums.h:104
tov_PLPotatoes
Definition: LandscapeFarmingEnums.h:241
tov_PLWinterWheatLate
Definition: LandscapeFarmingEnums.h:247
tole_EnergyCrop
Definition: LandscapeFarmingEnums.h:158
tof_UserDefinedFarm34
Definition: LandscapeFarmingEnums.h:693
PestIncidenceManager::GetIncidenceLevel
double GetIncidenceLevel()
Returns the current pesticide incidence level, the mean of minimum and maximum incidence level.
Definition: Landscape.h:123
toc_OBushFruit
Definition: LandscapeFarmingEnums.h:823
g_map_le_borders
CfgBool g_map_le_borders("MAP_LE_BORDERS", CFG_CUSTOM, false)
Landscape::ChangeMapMapping
void ChangeMapMapping(void)
Maps the polygon numbers directly to the indices in m_elems.
Definition: Landscape.cpp:4188
toc_OrchApple
Definition: LandscapeFarmingEnums.h:854
tole_FlowerStripWithRotation
Definition: LandscapeFarmingEnums.h:180
tov_NoGrowth
Definition: LandscapeFarmingEnums.h:197
fa_manure
Definition: Treatment.h:75
tov_NLGrassGrazedExtensive2
Definition: LandscapeFarmingEnums.h:274
l_map_ascii_utm_x
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.
Farm::GetIntensity
double GetIntensity(void)
Definition: Farm.h:963
tole_DrainageDitch
Definition: LandscapeFarmingEnums.h:127
toc_SpringBarleySilage
Definition: LandscapeFarmingEnums.h:905
tov_DummyCropPestTesting
Definition: LandscapeFarmingEnums.h:341
toc_Tulips
Definition: LandscapeFarmingEnums.h:913
tole_MontadoMixed
Definition: LandscapeFarmingEnums.h:138
spring_sow
Definition: Treatment.h:47
Landscape::SupplyCountryCode
std::string SupplyCountryCode()
Returns m_countryCode, e.g. "DK" for Denmark.
Definition: Landscape.h:582
tov_NLGrassGrazed1
Definition: LandscapeFarmingEnums.h:259
tov_OTriticale
Definition: LandscapeFarmingEnums.h:209
cfg_PestIncidenceMax
static CfgFloat cfg_PestIncidenceMax("PESTINCIDENCEMAX", CFG_CUSTOM, 1.0)
cfg_P1B
CfgFloat cfg_P1B
Coefficient B in a second order polynomial function.
Definition: Landscape.cpp:275
Landscape::hb_ClearPolygon
void hb_ClearPolygon(int a_poly_num)
Replaces all values in the map for a polygon with a temporary value ready for manipulation.
Definition: Hedgebanks.cpp:410
cut_weeds
Definition: Treatment.h:106
tov_OWinterBarley
Definition: LandscapeFarmingEnums.h:209
PollenNectarDevelopmentData::supplyNectarHabitatSpeciesGivenDay
PollenNectarData supplyNectarHabitatSpeciesGivenDay(int a_curve_num, int a_given_day)
Supply the current nectar for the given species for the given day after today.
Definition: PollenNectar.cpp:354
trial_toxiccontrol
Definition: Treatment.h:109
tov_DKOrchOther
Definition: LandscapeFarmingEnums.h:465
LE::SetValidXY
void SetValidXY(int a_valid_x, int a_valid_y)
Definition: Elements.h:389
Weather::GetSnow
bool GetSnow(long a_date)
Definition: Weather.cpp:182
tov_Undefined
Definition: LandscapeFarmingEnums.h:610
cfg_mintownbuildingdistance
static CfgInt cfg_mintownbuildingdistance("MAP_MINTOWNBUILDINGDISTANCE", CFG_CUSTOM, 100)
PermanentSetaside
Definition: Elements.h:953
tof_OrganicPlant
Definition: LandscapeFarmingEnums.h:650
g_map_le_border_chance
CfgInt g_map_le_border_chance("MAP_LE_BORDER_CHANCE", CFG_CUSTOM, 25)
summer_plough
Definition: Treatment.h:48
Landscape::m_land
RasterMap * m_land
The big map.
Definition: Landscape.h:158
Landscape::FindFieldCenter
bool FindFieldCenter(LE *a_field, int *x, int *y)
Finds a location in the middle of a field to ‘seed a beetlebank’
Definition: Landscape.cpp:4763
LE::SetMapValid
void SetMapValid(bool a_valid)
Definition: Elements.h:289
tov_OSpringBarleyPigs
Definition: LandscapeFarmingEnums.h:209
tole_Scrub
Definition: LandscapeFarmingEnums.h:64
tov_PTOtherDryBeans
Definition: LandscapeFarmingEnums.h:317
LE_TypeClass::TranslateVegTypes
TTypesOfVegetation TranslateVegTypes(int VegReference)
Definition: Elements.cpp:3724
Landscape::ResetFlowerLocIndex
void ResetFlowerLocIndex(void)
The function to reset the index for the indices of the locations with flower resource.
Definition: Landscape.cpp:3822
tov_CloverGrassGrazed1
Definition: LandscapeFarmingEnums.h:203
tov_DKChristmasTrees_Perm
Definition: LandscapeFarmingEnums.h:446
LargeRoad
Definition: Elements.h:1187
Landscape::SupplyElementTypeFromVector
TTypesOfLandscapeElement SupplyElementTypeFromVector(unsigned int a_index)
Gets the TTypesOfVegetation type of a polygon using the m_elems.
Definition: Landscape.h:1727
LE::SetVegType
virtual void SetVegType(TTypesOfVegetation)
Definition: Elements.h:175
Landscape::EventtypeToString
std::string EventtypeToString(int a_event)
Returns the text representation of a treatment type.
Definition: Landscape.cpp:6024
TTypesOfPesticide
TTypesOfPesticide
Values that represent types of pesticide actions.
Definition: LandscapeFarmingEnums.h:1057
tole_RoadsideSlope
Definition: LandscapeFarmingEnums.h:105
GooseFieldListItem
A list item entry of field polygon reference numbers with associated openness and goose food scores.
Definition: Landscape.h:85
Landscape::m_NeedCentroidCalculation
bool m_NeedCentroidCalculation
A flag to ensure centroid calculation on object construction.
Definition: Landscape.h:194
cfg_distance_to_select_nearby_polygons
CfgFloat cfg_distance_to_select_nearby_polygons
The distance to select neary-by polygons for each location in a map.
Definition: Landscape.cpp:332
toc_MaizeStrigling
Definition: LandscapeFarmingEnums.h:816
tov_BEBeet
Definition: LandscapeFarmingEnums.h:289
FarmManager::ConnectFarm
int ConnectFarm(int a_owner)
Definition: Farm.cpp:3989
toc_GrassGrazedLast
Definition: LandscapeFarmingEnums.h:810
tov_FICaraway2
Definition: LandscapeFarmingEnums.h:566
cfg_FlowerStripPollenNectarCurveNum
CfgInt cfg_FlowerStripPollenNectarCurveNum
The pollen and nectar curve number for flower strip.
Definition: Landscape.cpp:327
toc_OliveGrove
Definition: LandscapeFarmingEnums.h:837
Landscape::hb_min_x
int hb_min_x
Definition: Landscape.h:463
Landscape::ForceArea
void ForceArea(void)
Check of polygon areas. Each polygon should be present in the map with the correct area recorded,...
Definition: Landscape.cpp:4130
fp_pks
Definition: Treatment.h:146
tov_DKVegSeeds
Definition: LandscapeFarmingEnums.h:416
cfg_P1E
CfgBool cfg_P1E
Logical config to control if the curve should be reversed (i.e. 1 - value)
Definition: Landscape.cpp:282
toc_MaizeSilage
Definition: LandscapeFarmingEnums.h:814
tov_SEWinterRape_Seed
Definition: LandscapeFarmingEnums.h:577
fp_ns
Definition: Treatment.h:134
tole_Canal
Definition: LandscapeFarmingEnums.h:128
Landscape::CreatePondList
void CreatePondList()
Creates a list of pond polygon refs/indexes for easy look up.
Definition: Landscape.cpp:4571
LE::PollenNectarReset
virtual void PollenNectarReset()
Definition: Elements.h:512
cfg_BeetleBankWidth
static CfgInt cfg_BeetleBankWidth("BBANK_WIDTH", CFG_CUSTOM, 4)
tov_FIOWinterRye
Definition: LandscapeFarmingEnums.h:538
tole_Pipeline
Definition: LandscapeFarmingEnums.h:134
tov_OSpringBarleyExt
Definition: LandscapeFarmingEnums.h:225
Landscape::CalculateFieldOpennessAllCells
int CalculateFieldOpennessAllCells(int a_pref)
Provides a measure of the shortest distance in 360 degree, e-g- looking NE % SW before tall obstacles...
Definition: Landscape.cpp:495
tole_LargeRoad
Definition: LandscapeFarmingEnums.h:83
VegElement::SetVegPatchy
void SetVegPatchy(bool p)
Definition: Elements.h:788
cfg_pesticidemaptype
CfgBool cfg_pesticidemaptype("PEST_MAP_TYPE", CFG_CUSTOM, false)
True for specific pesticide, false for general pesticides.
Landscape::SupplyInsects
double SupplyInsects(int a_polyref)
Returns the insect biomass on a polygon using the polygon reference number a_polyref or based on the ...
Definition: Landscape.h:1712
tof_OptimisingFarm
Definition: LandscapeFarmingEnums.h:696
tov_FIWinterRye
Definition: LandscapeFarmingEnums.h:537
tov_BEGrassGrazedLast
Definition: LandscapeFarmingEnums.h:295
Landscape::m_GooseIntakeRateVSVegetationHeight_BG
Polynomial2CurveClass * m_GooseIntakeRateVSVegetationHeight_BG
A curve relating goose intake rates in KJ/min to vegetation height for Barnacle Goose (BG)
Definition: Landscape.h:211
toc_PotatoesSpring
Definition: LandscapeFarmingEnums.h:894
tov_MaizeStrigling
Definition: LandscapeFarmingEnums.h:220
l_map_ascii_utm_y
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.
Landscape::BorderRemoval
void BorderRemoval(void)
Removes field boundaries, hedgebanks and hedges if they are adjacent to a field.
Definition: Landscape.cpp:4331
LE::SetDigestibility
virtual void SetDigestibility(double)
Definition: Elements.h:178
toc_OWinterBarley
Definition: LandscapeFarmingEnums.h:878
Landscape::hb_size
int hb_size
Definition: Landscape.h:462
tov_PTSetAside
Definition: LandscapeFarmingEnums.h:337
tof_UserDefinedFarm14
Definition: LandscapeFarmingEnums.h:673
bed_forming
Definition: Treatment.h:118
tov_PLWinterWheat
Definition: LandscapeFarmingEnums.h:232
g_map_le_minfieldwidth
CfgInt g_map_le_minfieldwidth("MAP_LE_BORDER_MIN_FIELD_WIDTH", CFG_CUSTOM, 10)
Landscape::AddBeetleBankIfPossible
int AddBeetleBankIfPossible(LE *a_field, TTypesOfLandscapeElement a_tole)
Determines whether a beetlebank can be added to the field depending on physical characteristics and a...
Definition: Landscape.cpp:4651
tov_SpringBarleyGrass
Definition: LandscapeFarmingEnums.h:214
LE
Definition: Elements.h:86
tov_NLGrassGrazedExtensiveLast
Definition: LandscapeFarmingEnums.h:276
Landscape::CalculateOpenness
void CalculateOpenness(bool a_realcalc)
Causes openness to be calulated and stored for all polygons.
Definition: Landscape.cpp:416
PollenNectarData
A data class to store nectar or pollen data.
Definition: PollenNectar.h:163
tole_Freshwater
Definition: LandscapeFarmingEnums.h:86
tov_DEPotatoesIndustry
Definition: LandscapeFarmingEnums.h:503
product_treat
Definition: Treatment.h:113
tov_FIOPotatoIndustry_North
Definition: LandscapeFarmingEnums.h:545
tole_YoungForest
Definition: LandscapeFarmingEnums.h:77
g_weather
class Weather * g_weather
Definition: Weather.cpp:49
tole_Stream
Definition: LandscapeFarmingEnums.h:111
l_map_removesmallpolygons
static CfgBool l_map_removesmallpolygons("MAP_REMOVESMALLPOLYGONS", CFG_CUSTOM, false)
tov_OBarleyPeaCloverGrass
Definition: LandscapeFarmingEnums.h:203
g_map_le_border_limited
CfgBool g_map_le_border_limited("MAP_LE_BORDER_LIMITED", CFG_CUSTOM, false)
tof_OrganicPig
Definition: LandscapeFarmingEnums.h:649
PEST_GRIDSIZE_POW2
#define PEST_GRIDSIZE_POW2
Definition: Pesticide.h:52
tov_SpringBarleyStriglingSingle
Definition: LandscapeFarmingEnums.h:222
tov_OOats
Definition: LandscapeFarmingEnums.h:206
Landscape::SupplyVegHeight
double SupplyVegHeight(int a_polyref)
Returns the height of the vegetation using the polygon reference number a_polyref or based on the x,...
Definition: Landscape.h:1527
tov_FlowerStrip1
Definition: LandscapeFarmingEnums.h:198
tov_DKWinterWheat_CC
Definition: LandscapeFarmingEnums.h:422
tof_UserDefinedFarm23
Definition: LandscapeFarmingEnums.h:682
FarmManager::GetDD
double GetDD(void)
Returnes day degrees for the period March 1st - November 1st. Used for determining yields of crops th...
Definition: Farm.h:1605
g_msg
MapErrorMsg * g_msg
Definition: MapErrorMsg.cpp:41
Landscape::m_area
int m_area
Area of the whole landscape.
Definition: Landscape.h:191
tov_DKOPotatoSeed
Definition: LandscapeFarmingEnums.h:391
tole_Saltwater
Definition: LandscapeFarmingEnums.h:88
Landscape::m_habitat_flower_num
std::map< int, vector< double > > m_habitat_flower_num
This is the dictionary to store the proportion of each composition for every habitat.
Definition: Landscape.h:217
Landscape::m_poly_omp_locks
std::vector< omp_nest_lock_t * > m_poly_omp_locks
The locks for all the polygon.
Definition: Landscape.h:145
tov_PTRyegrass
Definition: LandscapeFarmingEnums.h:324
tov_OGrazingPigs
Definition: LandscapeFarmingEnums.h:206
toc_OSpringRape
Definition: LandscapeFarmingEnums.h:871
cfg_PatchesMaxWidth
static CfgInt cfg_PatchesMaxWidth("PATCHES_MAX_WIDTH", CFG_CUSTOM, 100)
tole_HedgeBank
Definition: LandscapeFarmingEnums.h:90
cfg_BordersNextToFieldBoundary
static CfgBool cfg_BordersNextToFieldBoundary("BORDER_NEXT_TO_FIELD_BOUNDARY", CFG_CUSTOM, true)
ForestElement
Definition: Elements.h:1092
tole_River
Definition: LandscapeFarmingEnums.h:87
tov_DKOMixedVeg
Definition: LandscapeFarmingEnums.h:388
toc_SpringBarleyCloverGrass
Definition: LandscapeFarmingEnums.h:902
tov_DKOWinterCloverGrassGrazedSown
Definition: LandscapeFarmingEnums.h:373
Weather::GetTempHour
double GetTempHour(int hour)
Get today's weather data at the given hour.
Definition: Weather.h:467
Landscape::le_signal_index
int le_signal_index
Index for the LE signal loop.
Definition: Landscape.h:528
GooseFieldListItem::geese
int geese
Definition: Landscape.h:88
tof_UserDefinedFarm27
Definition: LandscapeFarmingEnums.h:686
tov_SpringBarleyCloverGrass
Definition: LandscapeFarmingEnums.h:214
Landscape::SupplyLEHigh
bool SupplyLEHigh(int a_x, int a_y)
Function for backwards code compatibility when Set_Att_High would now be used.
Definition: Landscape.h:996
tov_SpringRape
Definition: LandscapeFarmingEnums.h:215
tov_DKOWinterRye
Definition: LandscapeFarmingEnums.h:403
cfg_BeetleBankMinX
CfgInt cfg_BeetleBankMinX("BBANK_MINX", CFG_CUSTOM, 0)
tov_DEOWinterBarley
Definition: LandscapeFarmingEnums.h:494
tov_DKCabbages
Definition: LandscapeFarmingEnums.h:351
Weather::GetTempPeriod
double GetTempPeriod(long a_date, unsigned int a_period)
Definition: Weather.cpp:707
tole_Heath
Definition: LandscapeFarmingEnums.h:92
GooseFieldListItem::vegtypechr
std::string vegtypechr
Definition: Landscape.h:98
tole_Orchard
Definition: LandscapeFarmingEnums.h:93
l_map_art_hb_nums
static CfgInt l_map_art_hb_nums("MAP_ART_HB_NUMS", CFG_CUSTOM, 3)
autumn_sow
Definition: Treatment.h:41
Landscape::m_firstyear
bool m_firstyear
Flag to indicate the that the first year is run (i.e. before simulation starts)
Definition: Landscape.h:537
tov_FIGreenFallow_1year
Definition: LandscapeFarmingEnums.h:562
GooseFieldListItem::geesespTimed
int geesespTimed[gs_foobar]
Definition: Landscape.h:91
toc_OSugarBeet
Definition: LandscapeFarmingEnums.h:875
tov_DKOLupines
Definition: LandscapeFarmingEnums.h:433
Pesticide::SupplyPesticideSeed
double SupplyPesticideSeed(int a_x, int a_y, PlantProtectionProducts a_ppp)
Supplies the seed coating pesticide amount in cell.
TTypesOfVegetation
TTypesOfVegetation
Values that represent the types of vegetation that are represented in ALMaSS.
Definition: LandscapeFarmingEnums.h:192
Landscape::hb_ResetColorBits
void hb_ResetColorBits(void)
Remove high number colour bits from the map.
Definition: Hedgebanks.cpp:295
tov_DEWinterWheat
Definition: LandscapeFarmingEnums.h:509
Weather::GetGlobalRadiation
double GetGlobalRadiation(long a_date)
Definition: Weather.h:473
tov_BEMaizeCC
Definition: LandscapeFarmingEnums.h:304
l_map_dump_enable
static CfgBool l_map_dump_enable("MAP_DUMP_ENABLE", CFG_CUSTOM, false)
tov_DKOrchardCrop_Perm
Definition: LandscapeFarmingEnums.h:459
tof_AgroChemIndustryCerealFarm1
Definition: LandscapeFarmingEnums.h:655
OrchardBand
Definition: Elements.h:1120
tov_DEOHerbsPerennial_1year
Definition: LandscapeFarmingEnums.h:515
tov_FISpringOats
Definition: LandscapeFarmingEnums.h:547
tov_DEOPermanentGrassGrazed
Definition: LandscapeFarmingEnums.h:489
tov_FRWinterRape
Definition: LandscapeFarmingEnums.h:584
autumn_harrow
Definition: Treatment.h:37
tov_FieldPeasSilage
Definition: LandscapeFarmingEnums.h:227
FarmManager::InitiateManagement
void InitiateManagement(void)
Definition: Farm.cpp:3962
tov_BEMaize
Definition: LandscapeFarmingEnums.h:296
tov_FIGrasslandPasturePerennial1
Definition: LandscapeFarmingEnums.h:556
Farm
The base class for all farm types.
Definition: Farm.h:755
tov_DEOCabbages
Definition: LandscapeFarmingEnums.h:480
tov_DKGrazingPigs
Definition: LandscapeFarmingEnums.h:381
tof_UserDefinedFarm22
Definition: LandscapeFarmingEnums.h:681
version_revision
static const int version_revision
Definition: Landscape.cpp:41
cfg_dumpvegjanfile
CfgStr cfg_dumpvegjanfile("G_VEGAREASJAN_FILENAME", CFG_CUSTOM, "DUMPVEG_JAN.TXT")
tov_DKOFarmForest_Perm
Definition: LandscapeFarmingEnums.h:451
tov_OSeedGrass1
Definition: LandscapeFarmingEnums.h:208
toc_Vineyards
Definition: LandscapeFarmingEnums.h:916
fa_calcium
Definition: Treatment.h:79
tov_SpringBarleyStrigling
Definition: LandscapeFarmingEnums.h:220
tole_ConiferousForest
Definition: LandscapeFarmingEnums.h:76
g_map_le_borderwidth
CfgInt g_map_le_borderwidth("MAP_LE_BORDER_WIDTH", CFG_CUSTOM, 1)
tole_AsparagusPerm
Definition: LandscapeFarmingEnums.h:175
tof_AgroChemIndustryCerealFarm3
Definition: LandscapeFarmingEnums.h:657
Landscape::ClassificationVegGrass
bool ClassificationVegGrass(TTypesOfVegetation a_vege_type)
Returns whether a vegetation type is classified as Grass.
Definition: Landscape.cpp:921
tov_SeedGrass2
Definition: LandscapeFarmingEnums.h:212
tov_NLGrassGrazedLast
Definition: LandscapeFarmingEnums.h:270
Landscape::ReadFlowerSpeciesComp
void ReadFlowerSpeciesComp(const char *a_flower_file)
This function is to read the habitat species composition for flower resource.
Definition: Landscape.cpp:3442
tov_FRGrassland
Definition: LandscapeFarmingEnums.h:588
tov_DKCerealLegume_Whole
Definition: LandscapeFarmingEnums.h:367
l_map_ascii_map_entity
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.
tov_DEOLegume
Definition: LandscapeFarmingEnums.h:484
tov_OFieldPeas
Definition: LandscapeFarmingEnums.h:205
tov_DEOrchard
Definition: LandscapeFarmingEnums.h:518
tov_DEOPotatoes
Definition: LandscapeFarmingEnums.h:490
tov_DKEnergyCrop_Perm
Definition: LandscapeFarmingEnums.h:448
LE::DoCopy
void DoCopy(const LE *a_Le)
a copy function to be used because a copy constuctor won't work
Definition: Elements.cpp:916
tov_FodderBeet
Definition: LandscapeFarmingEnums.h:203
Landscape::BorderAdd
int BorderAdd(LE *a_field, TTypesOfLandscapeElement a_type, int a_allAround=1)
Adds a border of the specified type (could be an unsprayed margin) around a field
Definition: Landscape.cpp:4411
tov_OSpringBarleyGrass
Definition: LandscapeFarmingEnums.h:208
tole_UrbanVeg
Definition: LandscapeFarmingEnums.h:125
l_map_dump_gfx_file
static CfgStr l_map_dump_gfx_file("MAP_DUMP_GFX_FILE", CFG_CUSTOM, "dump.ppm")
FarmManager::DumpFarmAreas
void DumpFarmAreas()
Definition: Farm.cpp:3253
LE::Set_Att_VegMatureCereal
virtual void Set_Att_VegMatureCereal(bool)
Definition: Elements.h:222
tov_WWheatPControl
Definition: LandscapeFarmingEnums.h:217
Landscape::m_countryCode
std::string m_countryCode
Declaration of attributes for country and coordinates.
Definition: Landscape.h:533
tov_DKOOrchardCrop_Perm
Definition: LandscapeFarmingEnums.h:441
fa_ammoniumsulphate
Definition: Treatment.h:74
tov_DKSpringBarleyCloverGrass
Definition: LandscapeFarmingEnums.h:362
tole_RoadsideVerge
Definition: LandscapeFarmingEnums.h:60
tov_BEMaizeSpring
Definition: LandscapeFarmingEnums.h:297
tov_BEPotatoesSpring
Definition: LandscapeFarmingEnums.h:300
Landscape::m_GooseIntakeRateVSVegetationHeight_PF
Polynomial2CurveClass * m_GooseIntakeRateVSVegetationHeight_PF
A curve relating goose intake rates in KJ/min to vegetation height for Pink-footed Goose (PF)
Definition: Landscape.h:209
tole_FarmForest
Definition: LandscapeFarmingEnums.h:160
RasterMap::MissingCellReplaceWrap
bool MissingCellReplaceWrap(int a_x, int a_y, bool a_fieldsonly)
A method for removing missing polygons - tests for edge conditions.
Definition: Rastermap.cpp:230
Landscape::hb_border_pixels
int hb_border_pixels
Definition: Landscape.h:467
toc_OSpringBarleyPigs
Definition: LandscapeFarmingEnums.h:868
toc_BushFruit
Definition: LandscapeFarmingEnums.h:786
tole_Field
Definition: LandscapeFarmingEnums.h:65
toc_OSpringBarley
Definition: LandscapeFarmingEnums.h:865
LE::Set_Att_High
void Set_Att_High(bool a_high)
Definition: Elements.h:200
toc_OLupines
Definition: LandscapeFarmingEnums.h:839
RasterMap::CellReplacementNeighbour
int CellReplacementNeighbour(int a_x, int a_y, int a_polyref)
A method for helping remove tiny polygons.
Definition: Rastermap.cpp:153
tov_CloverGrassGrazed2
Definition: LandscapeFarmingEnums.h:203
tov_UKSpringBarley
Definition: LandscapeFarmingEnums.h:283
toc_Sunflower
Definition: LandscapeFarmingEnums.h:911
tole_PitDisused
Definition: LandscapeFarmingEnums.h:72
autumn_sow_with_ferti
Definition: Treatment.h:136
tole_AgroForestrySystem
Definition: LandscapeFarmingEnums.h:139
toc_OSpringWheat
Definition: LandscapeFarmingEnums.h:873
tov_NLCabbage
Definition: LandscapeFarmingEnums.h:257
tov_WinterWheat
Definition: LandscapeFarmingEnums.h:217
tole_Vildtager
Definition: LandscapeFarmingEnums.h:121
PollenNectarData::m_quality
double m_quality
Definition: PollenNectar.h:168
toc_OrchCherry
Definition: LandscapeFarmingEnums.h:856
toc_OSpringBarleyPeaCloverGrass
Definition: LandscapeFarmingEnums.h:869
toc_OMaize
Definition: LandscapeFarmingEnums.h:840
GooseFieldListItem::digestability
double digestability
Definition: Landscape.h:100
trial_insecticidetreat
Definition: Treatment.h:108
tov_DKOSpringBarleySilage
Definition: LandscapeFarmingEnums.h:397
fa_p
Definition: Treatment.h:69
Landscape::NewElement
LE * NewElement(TTypesOfLandscapeElement a_type)
NewElement Creates a new LE instance and where possible it will create the highest level in the class...
Definition: Landscape.cpp:5760
mow
Definition: Treatment.h:105
tov_DKOCloverGrassGrazed3
Definition: LandscapeFarmingEnums.h:376
Landscape::Set_TOLE_Att
void Set_TOLE_Att(LE *elem)
Uses a point to an LE instance and sets all the attributes based on its tole type.
Definition: Landscape.h:965
l_map_art_hb_tran_prob
static CfgInt l_map_art_hb_tran_prob("MAP_ART_HB_TRAN_PROB", CFG_CUSTOM, 30)
tov_FodderGrass
Definition: LandscapeFarmingEnums.h:224
Weather::GetMaxTemp
double GetMaxTemp(void)
Get the max temperature today.
Definition: Weather.h:488
tole_MushroomPerm
Definition: LandscapeFarmingEnums.h:176
tov_Maize
Definition: LandscapeFarmingEnums.h:203
tole_EucalyptusForest
Definition: LandscapeFarmingEnums.h:144
GooseFieldListItem::openness
double openness
Definition: Landscape.h:93
Landscape::PolysRemoveInvalid
bool PolysRemoveInvalid(void)
Checks whether all polygons are in the map, removing those that are not.
Definition: Landscape.cpp:3336
tof_UserDefinedFarm9
Definition: LandscapeFarmingEnums.h:668
tov_DEPeas
Definition: LandscapeFarmingEnums.h:498
cfg_productapplicstartyear
CfgInt cfg_productapplicstartyear("PEST_PROCTAPPLICSTARTYEAR", CFG_CUSTOM, 9999999)
toc_OSeedGrass1
Definition: LandscapeFarmingEnums.h:861
Landscape::SupplyPollenQuantity
double SupplyPollenQuantity(int a_polyref)
Returns the pollen quantity produced by the vegetation using the polygon reference number a_polyref o...
Definition: Landscape.h:657
tov_DKOWinterWheat
Definition: LandscapeFarmingEnums.h:360
cfg_FlowerStripStartFloweringTimePush
CfgInt cfg_FlowerStripStartFloweringTimePush
The number of days to push the start flowering time for flower strips.
Definition: Landscape.cpp:335
tov_BEGrassGrazed1Spring
Definition: LandscapeFarmingEnums.h:293
Landscape::m_LargestPolyNumUsed
int m_LargestPolyNumUsed
The largest polygon number used.
Definition: Landscape.h:369
Landscape::SupplyLEReset
void SupplyLEReset(void)
Resets internal state for the LE loop generator.
Definition: Landscape.cpp:5622
Landscape::AxisLoop
void AxisLoop(int a_poly, int *a_x, int *a_y, int a_axis)
Tests the length of a vector to find when we step outside a given polygon.
Definition: Landscape.cpp:4940
toc_OPermanentGrassGrazed
Definition: LandscapeFarmingEnums.h:849
FarmManager::GetIsRenumbered
bool GetIsRenumbered()
Returns the flag for renumbering.
Definition: Farm.h:1622
tov_OFieldPeasSilage
Definition: LandscapeFarmingEnums.h:218
LE::Set_Att_Forest
void Set_Att_Forest(bool a_forest)
Definition: Elements.h:204
toc_FodderBeet
Definition: LandscapeFarmingEnums.h:802
cfg_P1C
CfgFloat cfg_P1C
The constant C in a second order polynomial function.
Definition: Landscape.cpp:277
PesticideMap
Definition: Pesticide.h:804
cfg_pesticidetableon
CfgBool cfg_pesticidetableon("PEST_TABLE_ON", CFG_CUSTOM, false)
Flag determining whether we are using the pesticide table.
Landscape::DumpMapGraphics
void DumpMapGraphics(const char *a_filename)
Saves the graphics for the landscape LKM.
Definition: Landscape.cpp:5670
Landscape::CentroidSpiralOut
void CentroidSpiralOut(int a_polyref, int &a_x, int &a_y)
Function to move from midx & midy and outwards in concentric circles until a location that matches th...
Definition: Landscape.cpp:5142
tole_BushFruit
Definition: LandscapeFarmingEnums.h:154
tov_DESpringRye
Definition: LandscapeFarmingEnums.h:504
tole_OPermPasturePigs
Definition: LandscapeFarmingEnums.h:163
tov_DKOrchApple
Definition: LandscapeFarmingEnums.h:462
LE::Set_Att_UrbanNoVeg
void Set_Att_UrbanNoVeg(bool a_unv)
Definition: Elements.h:208
tov_YoungForest
Definition: LandscapeFarmingEnums.h:222
fa_rsm
Definition: Treatment.h:78
tov_FRMaize_Silage
Definition: LandscapeFarmingEnums.h:586
tov_DKCatchCrop
Definition: LandscapeFarmingEnums.h:420
tov_NLGrassGrazed2
Definition: LandscapeFarmingEnums.h:260
toc_PermanentGrassGrazed
Definition: LandscapeFarmingEnums.h:886
FieldBoundary
Element class for field boudaries.
Definition: Elements.h:1034
Landscape::m_poly_cell_locs
std::map< int, vector< APoint > > m_poly_cell_locs
This is the dictionary to store all the locations for each polygon.
Definition: Landscape.h:223
toc_OGrazingPigs
Definition: LandscapeFarmingEnums.h:836
g_random_fnc
int g_random_fnc(const int a_range)
Definition: ALMaSS_Random.cpp:74
tole_FlowersPerm
Definition: LandscapeFarmingEnums.h:174
tov_DKOCarrots
Definition: LandscapeFarmingEnums.h:355
fa_npks
Definition: Treatment.h:66
LE::SetSlope
void SetSlope(double a_slope)
Definition: Elements.h:451
tof_UserDefinedFarm32
Definition: LandscapeFarmingEnums.h:691
water
Definition: Treatment.h:92
tov_Oats
Definition: LandscapeFarmingEnums.h:203
g_map_le_unsprayedmargins
CfgBool g_map_le_unsprayedmargins("MAP_LE_UNSPRAYEDMARGINS", CFG_CUSTOM, false)
tov_DKSeedGrassFescue_Spring
Definition: LandscapeFarmingEnums.h:407
tof_UserDefinedFarm11
Definition: LandscapeFarmingEnums.h:670
toc_Sorghum
Definition: LandscapeFarmingEnums.h:900
LE::SetArea
void SetArea(double a_area)
Definition: Elements.h:291
stubble_harrowing
Definition: Treatment.h:102
testpesticide
Definition: LandscapeFarmingEnums.h:1050
toc_SeedGrass1
Definition: LandscapeFarmingEnums.h:897
RasterMap
Definition: Rastermap.h:40
tov_GenericCatchCrop
Definition: LandscapeFarmingEnums.h:339
LE::GetOwner
Farm * GetOwner(void)
Definition: Elements.h:256
tof_UserDefinedFarm26
Definition: LandscapeFarmingEnums.h:685
Calendar::DayInYear
int DayInYear(void)
Definition: Calendar.h:58
toc_Beans_Whole
Definition: LandscapeFarmingEnums.h:784
l_map_nectarpollencomposition
static CfgStr l_map_nectarpollencomposition("MAP_NECTARPOLLEN_COMPOSITION", CFG_CUSTOM, "habitat_stacks.csv")
PesticideTable::PrintPTable
virtual void PrintPTable()
Definition: Pesticide.cpp:1932
Landscape::m_index_locs_pollen
std::map< int, int > m_index_locs_pollen
This is the dictionary to store all the index in m_poly_cell_locs_pollen start from which there is no...
Definition: Landscape.h:227
cfg_G6E
CfgBool cfg_G6E
Logical config to control if the curve should be reversed (i.e. 1 - value)
Definition: Landscape.cpp:300
tov_Lawn
Definition: LandscapeFarmingEnums.h:225
Landscape::BuildingDesignationCalc
void BuildingDesignationCalc()
used to calculate whether a building as rural or town - for rodenticide use
Definition: Landscape.cpp:5356
FarmManager::SetSpilledGrain
void SetSpilledGrain(bool a_spilledgrain)
Set m_SpilledGrain which is the flag for either 2013 (true) or 2014 (false) spilled grain distributio...
Definition: Farm.h:1601
insecticide
Definition: LandscapeFarmingEnums.h:1050
tov_DKOFodderBeets
Definition: LandscapeFarmingEnums.h:349
LE_TypeClass::BackTranslateVegTypes
int BackTranslateVegTypes(TTypesOfVegetation VegReference)
Definition: Elements.cpp:4624
tov_WinterRye
Definition: LandscapeFarmingEnums.h:217
tov_FIOCaraway1
Definition: LandscapeFarmingEnums.h:567
Landscape::m_minmaxextent
int m_minmaxextent
Area minimum extent, the smallest value of m_width or m_height
Definition: Landscape.h:187
toc_OCloverGrassGrazed3
Definition: LandscapeFarmingEnums.h:828
toc_Unmanaged
Definition: LandscapeFarmingEnums.h:915
tov_DEMaize
Definition: LandscapeFarmingEnums.h:477
g_FarmIntensivenessH
double g_FarmIntensivenessH
Definition: Hare_All.cpp:301
fp_liquidNH3
Definition: Treatment.h:57
tov_FIBufferZone_Perm
Definition: LandscapeFarmingEnums.h:573
molluscicide
Definition: Treatment.h:87
tov_OWinterWheat
Definition: LandscapeFarmingEnums.h:228
Calendar::MarchFirst
bool MarchFirst(void)
Definition: Calendar.h:80
toc_OBeans_Whole
Definition: LandscapeFarmingEnums.h:822
Landscape::SupplyLATotal
double SupplyLATotal(int a_polyref)
Returns leaf area in total of the vegetation using the polygon reference number a_polyref or based on...
Definition: Landscape.h:1582
tov_PTHorticulture
Definition: LandscapeFarmingEnums.h:329
Landscape::hb_map
int * hb_map
Definition: Landscape.h:459
tov_DKCloverGrassGrazed1
Definition: LandscapeFarmingEnums.h:370
tole_WoodlandMargin
Definition: LandscapeFarmingEnums.h:120
Landscape::m_pollen_map
Eigen::MatrixXf m_pollen_map
This is the matrix to store the pollen proportion (0-1) left for each cell.
Definition: Landscape.h:233
tov_DEOWinterRye
Definition: LandscapeFarmingEnums.h:496
tof_UserDefinedFarm28
Definition: LandscapeFarmingEnums.h:687
Landscape::m_biomass_map
Eigen::ArrayXXf m_biomass_map
This is the array to store the green biomass for each cell.
Definition: Landscape.h:237
hay_bailing
Definition: Treatment.h:101
tov_MaizeSilage
Definition: LandscapeFarmingEnums.h:224
LE::GetBorder
LE * GetBorder(void)
Definition: Elements.h:381
version_date
static const char * version_date
Definition: Landscape.cpp:42
tov_SEWinterWheat
Definition: LandscapeFarmingEnums.h:578
tole_PlantNursery
Definition: LandscapeFarmingEnums.h:117
Landscape::hb_Add
void hb_Add(void)
The entry point for adding hedgebanks. Hedgebanks are created by replacing part of hedge polygons wit...
Definition: Hedgebanks.cpp:56
tov_BEWinterWheatCC
Definition: LandscapeFarmingEnums.h:303
LE::SetElevation
void SetElevation(double a_elevation)
Records the elevation of the polygon.
Definition: Elements.h:450
cfg_dumpvegjune
CfgBool cfg_dumpvegjune("G_VEGAREASJUNE_ON", CFG_CUSTOM, false)
Weather::GetRain
double GetRain(long a_date)
Definition: Weather.h:506
tov_Heath
Definition: LandscapeFarmingEnums.h:228
fa_manganesesulphate
Definition: Treatment.h:73
Landscape::SupplyLastTreatment
int SupplyLastTreatment(int a_polyref, int *a_index)
Returns the last treatment recorded for the polygon.
Definition: Landscape.h:1941
tov_DKOLegumeCloverGrass_Whole
Definition: LandscapeFarmingEnums.h:354
Weather::GetMaxTempTomorrow
double GetMaxTempTomorrow(void)
Get the max temperature tomorrow.
Definition: Weather.h:496
l_map_print_git_version_info
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?
tov_DKWinterWheat
Definition: LandscapeFarmingEnums.h:359
start
Definition: Treatment.h:32
Landscape::hb_min_y
int hb_min_y
Definition: Landscape.h:464
tof_UserDefinedFarm25
Definition: LandscapeFarmingEnums.h:684
Landscape::SupplyPolyRefIndex
int SupplyPolyRefIndex(int a_x, int a_y)
Get the index to the m_elems array for a polygon at location x,y.
Definition: Landscape.h:2172
Landscape::m_index_locs_nectar
std::map< int, int > m_index_locs_nectar
This is the dictionary to store all the index in m_poly_cell_locs_nectar start from which there is no...
Definition: Landscape.h:231
tov_DKBushFruit_Perm2
Definition: LandscapeFarmingEnums.h:443
l_map_dump_grain_each_x_days
static CfgInt l_map_dump_grain_each_x_days("MAP_DUMP_GRAIN_EACH_X_DAYS", CFG_CUSTOM, 1)
tole_Garden
Definition: LandscapeFarmingEnums.h:80
g_letype
class LE_TypeClass * g_letype
Definition: Elements.cpp:806
Landscape::CalHaibitatFlowerResource
void CalHaibitatFlowerResource()
Calculate the flower resouce for all the habitat types with flower resource.
Definition: Landscape.cpp:3492
Weather::GetWindDirection
int GetWindDirection(void)
Four wind directions N = 0, clockwise.
Definition: Weather.h:511
tov_DKSugarBeets
Definition: LandscapeFarmingEnums.h:347
Landscape::PolysValidate
void PolysValidate(bool a_exit_on_invalid)
Checks for internal consistency in the polygon information, e.g. being sure that all polygons mention...
Definition: Landscape.cpp:3310
Landscape::m_poly_cell_locs_pollen
std::map< int, vector< APoint > > m_poly_cell_locs_pollen
This is the dictionary to store all the locations used for quick access to pollen.
Definition: Landscape.h:225
toc_SpringRye
Definition: LandscapeFarmingEnums.h:907
l_map_dump_treatcounts_enable
static CfgBool l_map_dump_treatcounts_enable("MAP_DUMP_TREATCOUNTS_ENABLE", CFG_CUSTOM, false)
Landscape::SupplyLENext
int SupplyLENext(void)
Returns -1 at if the end of the list of m_elems is reached, polyref otherwise.
Definition: Landscape.cpp:5626
tov_FIPotatoIndustry_North
Definition: LandscapeFarmingEnums.h:543
tov_FIOStarchPotato_South
Definition: LandscapeFarmingEnums.h:530
tof_UserDefinedFarm30
Definition: LandscapeFarmingEnums.h:689
fp_k
Definition: Treatment.h:55
tov_PTTurnipGrazed
Definition: LandscapeFarmingEnums.h:313
version_minor
static const int version_minor
Definition: Landscape.cpp:40
GooseFieldListItem::grain
double grain
Definition: Landscape.h:94
tov_PTYellowLupin
Definition: LandscapeFarmingEnums.h:325
Landscape::SupplyNectar
PollenNectarData SupplyNectar(int a_polyref)
Returns information on the nectar produced by the vegetation using the polygon reference number a_pol...
Definition: Landscape.h:647
tof_UserDefinedFarm1
Definition: LandscapeFarmingEnums.h:660
RasterMap::MapWidth
int MapWidth(void)
Definition: Rastermap.h:55
tov_ITOrchard
Definition: LandscapeFarmingEnums.h:607
tole_RiversideTrees
Definition: LandscapeFarmingEnums.h:73
toc_WinterWheat
Definition: LandscapeFarmingEnums.h:922
Landscape::Warn
void Warn(std::string a_msg1, std::string a_msg2)
Wrapper for the g_msg Warn function.
Definition: Landscape.h:2250
Calendar::JanFirst
bool JanFirst(void)
Definition: Calendar.h:79
l_map_chameleon_replace_num
static CfgInt l_map_chameleon_replace_num("MAP_CHAMELEON_REPLACE_NUM", CFG_CUSTOM, 58)
LE::GetCentroidX
virtual int GetCentroidX()
Definition: Elements.h:150
cfg_BeetleBankMaxDistance
static CfgInt cfg_BeetleBankMaxDistance("BBANK_MAX_DIST", CFG_CUSTOM, 150)
tof_PTrialTreatment
Definition: LandscapeFarmingEnums.h:652
HB_MAGIC_COLOR
#define HB_MAGIC_COLOR
Definition: Hedgebanks.cpp:39
tov_FRMaize
Definition: LandscapeFarmingEnums.h:585
tov_UKWinterBarley
Definition: LandscapeFarmingEnums.h:285
Landscape::SupplyARandomLocResourcePoly
APoint SupplyARandomLocResourcePoly(int a_poly_id, std::map< int, int > &a_index_locs, std::map< int, vector< APoint >> &a_poly_cell_locs, Eigen::MatrixXf &a_prop_map)
The function to get a random location for the given resource and the given poly ID.
Definition: Landscape.cpp:3844
tov_DKOSetAside_SummerMow
Definition: LandscapeFarmingEnums.h:396
tov_FISugarBeet
Definition: LandscapeFarmingEnums.h:526
tov_PermanentGrassGrazed
Definition: LandscapeFarmingEnums.h:211
FarmManager
The Farm Manager class.
Definition: Farm.h:1461
tole_Fence
Definition: LandscapeFarmingEnums.h:79
tov_PLBeetSpr
Definition: LandscapeFarmingEnums.h:248
tov_DEMaizeSilage
Definition: LandscapeFarmingEnums.h:478
tov_NLTulips
Definition: LandscapeFarmingEnums.h:258
cfg_G6D
CfgFloat cfg_G6D
Scaler for assimilation of energy from grass for pinkfeet. Madsen 1985 Vol 16 p. 222 - 228 Ornis Scan...
Definition: Landscape.cpp:298
tole_WoodyEnergyCrop
Definition: LandscapeFarmingEnums.h:116
toc_FieldPeasStrigling
Definition: LandscapeFarmingEnums.h:801
tov_PLFodderLucerne2
Definition: LandscapeFarmingEnums.h:244
tov_PTGrassGrazed
Definition: LandscapeFarmingEnums.h:310
toc_CloverGrassGrazed1
Definition: LandscapeFarmingEnums.h:792
autumn_plough
Definition: Treatment.h:34
toc_CatchCropPea
Definition: LandscapeFarmingEnums.h:791
Landscape::m_elems
vector< LE * > m_elems
List of all landscape elements. The index is a sequential number, to get the polynum look this number...
Definition: Landscape.h:155
tov_FIOSpringRape
Definition: LandscapeFarmingEnums.h:536
LE::Set_Att_VegMaize
virtual void Set_Att_VegMaize(bool)
Definition: Elements.h:224
tov_DKSpringWheat
Definition: LandscapeFarmingEnums.h:414
tov_DKSpringBarleySilage
Definition: LandscapeFarmingEnums.h:412
Landscape::m_poly_with_flowers
vector< int > m_poly_with_flowers
Definition: Landscape.h:166
toc_AsparagusEstablishedPlantation
Definition: LandscapeFarmingEnums.h:782
GooseFieldListItem::vegphase
int vegphase
Definition: Landscape.h:101
LE::GetMaxY
int GetMaxY(void)
Definition: Elements.h:398
tov_NorwegianSpringBarley
Definition: LandscapeFarmingEnums.h:230
cfg_B6C
CfgFloat cfg_B6C
The constant C in a second order polynomial function.
Definition: Landscape.cpp:313
tole_Marsh
Definition: LandscapeFarmingEnums.h:63
tof_UserDefinedFarm4
Definition: LandscapeFarmingEnums.h:663
tov_OFodderBeet
Definition: LandscapeFarmingEnums.h:227
tov_DKOPotato
Definition: LandscapeFarmingEnums.h:389
tof_UserDefinedFarm31
Definition: LandscapeFarmingEnums.h:690
tole_RiceField
Definition: LandscapeFarmingEnums.h:150
tov_NLCatchCropPea
Definition: LandscapeFarmingEnums.h:268
cfg_BeetleBankMaxX
CfgInt cfg_BeetleBankMaxX("BBANK_MAXX", CFG_CUSTOM, 100000)
tov_FIOSpringOats
Definition: LandscapeFarmingEnums.h:548
tov_DKOSeedGrassRye_Spring
Definition: LandscapeFarmingEnums.h:392
Landscape::AddPatchIfPossible
int AddPatchIfPossible(LE *a_field, TTypesOfLandscapeElement a_tole)
Determines whether a patch can be added to the field depending on physical characteristics and adds i...
Definition: Landscape.cpp:5010
Landscape::ClassificationWoody
bool ClassificationWoody(TTypesOfLandscapeElement a_tole)
Returns whether the polygon is classfied as woody.
Definition: Landscape.cpp:1357
Landscape::m_height10
int m_height10
Area length times 10.
Definition: Landscape.h:185
cfg_PatchesFieldAreaMaxPercentage
static CfgInt cfg_PatchesFieldAreaMaxPercentage("PATCHES_MAX_PERCENTAGE", CFG_CUSTOM, 15)
tov_NLMaizeSpring
Definition: LandscapeFarmingEnums.h:264
tole_StonePineForest
Definition: LandscapeFarmingEnums.h:147
cfg_HedgeSubtypeMinimum
CfgInt cfg_HedgeSubtypeMinimum("HEDGE_SUBTYPEMINIMUM", CFG_CUSTOM, 0)
Landscape::m_NeedOpennessCalculation
bool m_NeedOpennessCalculation
A flag to ensure openness calculation on object construction.
Definition: Landscape.h:196
tov_FINaturalGrassland_Perm
Definition: LandscapeFarmingEnums.h:571
Landscape::SupplyPolyRef
int SupplyPolyRef(int a_x, int a_y)
Get the in map polygon reference number from the x, y location.
Definition: Landscape.h:2157
fp_slurry
Definition: Treatment.h:58
toc_OPotatoesSeed
Definition: LandscapeFarmingEnums.h:853
cfg_dumpvegjunefile
CfgStr cfg_dumpvegjunefile("G_VEGAREASJUNE_FILENAME", CFG_CUSTOM, "DUMPVEG_JUNE.TXT")
Landscape::EventDump
void EventDump(int x, int y, int x2, int y2)
Records farm events carried out on the x, y locations.
Definition: Landscape.cpp:3261
tov_SugarBeet
Definition: LandscapeFarmingEnums.h:228
tole_OPermPasture
Definition: LandscapeFarmingEnums.h:164
tov_DKLegume_Peas
Definition: LandscapeFarmingEnums.h:357
fiber_covering
Definition: Treatment.h:128
FlowerStrip
Element class for flower strips.
Definition: Elements.h:993
tole_OPermPastureLowYield
Definition: LandscapeFarmingEnums.h:165
Landscape::ClassificationVegCereal
bool ClassificationVegCereal(TTypesOfVegetation a_vege_type)
Returns whether a vegetation type is classified as cereal.
Definition: Landscape.cpp:1031
toc_OWinterRape
Definition: LandscapeFarmingEnums.h:880
tov_None
Definition: LandscapeFarmingEnums.h:195
tole_RiverBed
Definition: LandscapeFarmingEnums.h:126
tov_NLPotatoes
Definition: LandscapeFarmingEnums.h:254
tov_PTWinterRye
Definition: LandscapeFarmingEnums.h:323
cfg_total_polnek_file
static CfgStr cfg_total_polnek_file("TOTAL_POLNEK_FILENAME", CFG_CUSTOM, "Total_PollenNectarResources.txt")
toc_OBeans
Definition: LandscapeFarmingEnums.h:821
tov_WaterBufferZone
Definition: LandscapeFarmingEnums.h:201
LE::SetMapIndex
void SetMapIndex(int a_map_index)
Definition: Elements.h:240
WARN_BUG
Definition: MapErrorMsg.h:34
tole_PermPasturePigs
Definition: LandscapeFarmingEnums.h:162
tov_DKOLegume_Whole
Definition: LandscapeFarmingEnums.h:346
toc_OCabbage
Definition: LandscapeFarmingEnums.h:824
tof_OrganicCattle
Definition: LandscapeFarmingEnums.h:648
tov_DKOGrazingPigs_Perm
Definition: LandscapeFarmingEnums.h:453
Landscape::m_longitude
double m_longitude
Definition: Landscape.h:535
tov_DKFodderBeets
Definition: LandscapeFarmingEnums.h:348
toc_OPermanentGrassLowYield
Definition: LandscapeFarmingEnums.h:850
cfg_P1G
CfgFloat cfg_P1G
Min x-value.
Definition: Landscape.cpp:286
tov_PTCorkOak
Definition: LandscapeFarmingEnums.h:319
tov_FRWinterTriticale
Definition: LandscapeFarmingEnums.h:583
tov_PLMaize
Definition: LandscapeFarmingEnums.h:239
tov_SpringBarleyPeaCloverGrassStrigling
Definition: LandscapeFarmingEnums.h:222
toc_GrassGrazed2
Definition: LandscapeFarmingEnums.h:808
Landscape::l_vegtype_areas
double * l_vegtype_areas
For veg area dumps.
Definition: Landscape.h:201
APoint::m_y
int m_y
Definition: ALMaSS_Setup.h:56
cfg_BordersBetweenFields
static CfgBool cfg_BordersBetweenFields("BORDER_BETWEEN_FIELDS", CFG_CUSTOM, true)
cfg_BeetleBankMaxY
CfgInt cfg_BeetleBankMaxY("BBANK_MAXY", CFG_CUSTOM, 100000)
Landscape::SupplyGlobalDate
long SupplyGlobalDate(void)
Passes a request on to the associated Calendar class function, returns the simulation global date for...
Definition: Landscape.h:2292
LE::GetOwnerIndex
int GetOwnerIndex(void)
Definition: Elements.h:242
g_pest
class Pesticide * g_pest
Definition: Pesticide.cpp:219
toc_FarmForest
Definition: LandscapeFarmingEnums.h:798
Landscape::m_habitat_pollen
std::map< int, PollenNectarData > m_habitat_pollen
This is the dictionary to store the pollen data of each habitat type for the given day.
Definition: Landscape.h:219
toc_OFodderBeet
Definition: LandscapeFarmingEnums.h:834
tov_PTPermanentGrassGrazed
Definition: LandscapeFarmingEnums.h:308
summer_sow
Definition: Treatment.h:50
tov_FRSpringWheat
Definition: LandscapeFarmingEnums.h:592
tov_Potatoes
Definition: LandscapeFarmingEnums.h:212
l_map_dump_gfx_enable
static CfgBool l_map_dump_gfx_enable("MAP_DUMP_GFX_ENABLE", CFG_CUSTOM, false)
tov_NLCarrotsSpring
Definition: LandscapeFarmingEnums.h:263
tole_FarmFeedingGround
Definition: LandscapeFarmingEnums.h:173
tov_OSpringBarley
Definition: LandscapeFarmingEnums.h:208
Landscape::hb_HasOtherNeighbour
bool hb_HasOtherNeighbour(int a_x, int a_y)
Checks if a pixel has any non hedge neighbour cell.
Definition: Hedgebanks.cpp:336
tov_DESpringBarley
Definition: LandscapeFarmingEnums.h:517
Landscape::SetLESignal
void SetLESignal(int a_polyref, LE_Signal a_signal)
Writes the mask back out to the polygon.
Definition: Landscape.cpp:5641
PollenNectarDevelopmentData::supplyPollenHabitatSpeciesCurrentDay
PollenNectarData supplyPollenHabitatSpeciesCurrentDay(int a_curve_num)
Supply the current pollen for the given species.
Definition: PollenNectar.cpp:331
spring_sow_with_ferti
Definition: Treatment.h:115
Weather::GetRainPeriod
double GetRainPeriod(long a_date, unsigned int a_period)
Definition: Weather.cpp:688
l_map_art_hedgebanks
static CfgBool l_map_art_hedgebanks("MAP_ART_HEDGEBANKS", CFG_CUSTOM, false)
tole_PermPasture
Definition: LandscapeFarmingEnums.h:69
Weather::GetRainHour
double GetRainHour(int hour)
Definition: Weather.h:470
Landscape::SupplyResourceAtLocInPoly
double SupplyResourceAtLocInPoly(int a_poly_id, APoint a_start_loc, double a_required_amount, vector< APoint > *a_locs, vector< double > *a_pest_vec, Eigen::MatrixXf &a_resource_map, int a_num_avail_cell, PollenNectarData a_resource_data, bool a_is_pollen)
The function to get the given amount of the required resource for the given location,...
Definition: Landscape.cpp:3894
tov_DEAsparagusEstablishedPlantation
Definition: LandscapeFarmingEnums.h:511
toc_OrchPear
Definition: LandscapeFarmingEnums.h:858
tov_PTOliveGroveIntensive
Definition: LandscapeFarmingEnums.h:335
toc_SugarBeet
Definition: LandscapeFarmingEnums.h:910
tov_DKOBushFruit_Perm2
Definition: LandscapeFarmingEnums.h:445
tov_DKOCerealLegume_Whole
Definition: LandscapeFarmingEnums.h:368
cfg_FarmAreaPercentage
static CfgInt cfg_FarmAreaPercentage("FARM_AREA_PERCENTAGE", CFG_CUSTOM, 100)
sleep_all_day
Definition: Treatment.h:33
Landscape::ConsolidatePolys
void ConsolidatePolys(void)
Used to replace polygons or combine them when there is no special management associated with them....
Definition: Landscape.cpp:2795
g_landscape_ptr
Landscape * g_landscape_ptr
Definition: Landscape.cpp:352
tov_NLCarrots
Definition: LandscapeFarmingEnums.h:252
tov_OWinterRye
Definition: LandscapeFarmingEnums.h:211
tole_BeetleBank
Definition: LandscapeFarmingEnums.h:91
strigling_sow
Definition: Treatment.h:107
LE::SetCentroid
virtual void SetCentroid(int x, int y)
Definition: Elements.h:152
Calendar::GetMinute
int GetMinute(void)
Definition: Calendar.h:75
tov_DKSeedGrassRye_Spring
Definition: LandscapeFarmingEnums.h:408