Package com.graphhopper.routing.lm
Class LandmarkStorage
java.lang.Object
com.graphhopper.routing.lm.LandmarkStorage
This class stores the landmark nodes and the weights from and to all other nodes in every
subnetwork. This data is created to apply a speed-up for path calculation but at the same times
stays flexible to per-request changes. The class is safe for usage from multiple reading threads
across algorithms.
- Author:
- Peter Karich
-
Constructor Summary
ConstructorsConstructorDescriptionLandmarkStorage
(BaseGraph graph, EncodedValueLookup encodedValueLookup, Directory dir, LMConfig lmConfig, int landmarks) -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
void
This method calculates the landmarks and initial weightings to & from them.protected com.carrotsearch.hppc.IntHashSet
findBorderEdgeIds
(AreaIndex<SplitArea> areaIndex) This method makes edges crossing the specified border inaccessible to split a bigger area into smaller subnetworks.void
flush()
long
int
int[]
getLandmarks
(int subnetwork) int
int
This method returns the weighting for which the landmarks are originally createdboolean
isClosed()
boolean
isEmpty()
boolean
void
setAreaIndex
(AreaIndex<SplitArea> areaIndex) This method specifies the polygons which should be used to split the world wide area to improve performance and quality in this scenario.setLandmarkSuggestions
(List<LandmarkSuggestion> landmarkSuggestions) This method forces the landmark preparation to skip the landmark search and uses the specified landmark list instead.void
setLMSelectionWeighting
(Weighting lmSelectionWeighting) This weighting is used for the selection heuristic and is per default not the weighting specified in the constructor.void
setLogDetails
(boolean logDetails) By default do not log many details.setMaximumWeight
(double maxWeight) Specify the maximum possible value for your used area.void
setMinimumNodes
(int minimumNodes) This method sets the required number of nodes of a subnetwork for which landmarks should be calculated.toString()
-
Constructor Details
-
LandmarkStorage
public LandmarkStorage(BaseGraph graph, EncodedValueLookup encodedValueLookup, Directory dir, LMConfig lmConfig, int landmarks)
-
-
Method Details
-
setMaximumWeight
Specify the maximum possible value for your used area. With this maximum weight value you can influence the storage precision for your weights that help A* finding its way to the goal. The same value is used for all subnetworks. Note, if you pick this value too big then too similar weights are stored (some bits of the storage capability will be left unused). If too low then far away values will have the same maximum value associated ("maxed out"). Both will lead to bad performance.- Parameters:
maxWeight
- use a negative value to automatically determine this value.
-
setLogDetails
public void setLogDetails(boolean logDetails) By default do not log many details. -
setLandmarkSuggestions
This method forces the landmark preparation to skip the landmark search and uses the specified landmark list instead. Useful for manual tuning of larger areas to safe import time or improve quality. -
setMinimumNodes
public void setMinimumNodes(int minimumNodes) This method sets the required number of nodes of a subnetwork for which landmarks should be calculated. Every subnetwork below this count will be ignored. -
getMinimumNodes
public int getMinimumNodes()- See Also:
-
setLMSelectionWeighting
This weighting is used for the selection heuristic and is per default not the weighting specified in the constructor. The special weighting leads to a much better distribution of the landmarks and results in better response times. -
getLmSelectionWeighting
-
getWeighting
This method returns the weighting for which the landmarks are originally created -
getLMConfig
-
createLandmarks
public void createLandmarks()This method calculates the landmarks and initial weightings to & from them. -
setAreaIndex
This method specifies the polygons which should be used to split the world wide area to improve performance and quality in this scenario. -
findBorderEdgeIds
This method makes edges crossing the specified border inaccessible to split a bigger area into smaller subnetworks. This is important for the world wide use case to limit the maximum distance and also to detect unreasonable routes faster. -
getLandmarkCount
public int getLandmarkCount() -
getLandmarks
public int[] getLandmarks(int subnetwork) -
getSubnetworksWithLandmarks
public int getSubnetworksWithLandmarks()- Returns:
- the number of subnetworks that have landmarks
-
isEmpty
public boolean isEmpty() -
toString
-
loadExisting
public boolean loadExisting() -
flush
public void flush() -
close
public void close() -
isClosed
public boolean isClosed() -
getCapacity
public long getCapacity()
-