public class QueryGraphWeighting extends Object implements Weighting
QueryGraph
is used for shortest path calculations including turn costs we need to wrap the
Weighting
we want to use with this class. Otherwise turn costs at virtual nodes and/or including virtual
edges will not be calculated correctly.INFINITE_U_TURN_COSTS
Constructor and Description |
---|
QueryGraphWeighting(Weighting weighting,
int firstVirtualNodeId,
int firstVirtualEdgeId,
com.carrotsearch.hppc.IntArrayList closestEdges) |
Modifier and Type | Method and Description |
---|---|
long |
calcEdgeMillis(EdgeIteratorState edgeState,
boolean reverse)
This method calculates the time taken (in milli seconds) to travel along the specified edgeState.
|
double |
calcEdgeWeight(EdgeIteratorState edgeState,
boolean reverse)
This method calculates the weight of a given
EdgeIteratorState . |
long |
calcTurnMillis(int inEdge,
int viaNode,
int outEdge) |
double |
calcTurnWeight(int inEdge,
int viaNode,
int outEdge) |
FlagEncoder |
getFlagEncoder() |
double |
getMinWeight(double distance)
Used only for the heuristic estimation in A*
|
String |
getName() |
boolean |
hasTurnCosts()
This method can be used to check whether or not this weighting returns turn costs (or if they are all zero).
|
public QueryGraphWeighting(Weighting weighting, int firstVirtualNodeId, int firstVirtualEdgeId, com.carrotsearch.hppc.IntArrayList closestEdges)
public double getMinWeight(double distance)
Weighting
getMinWeight
in interface Weighting
public double calcEdgeWeight(EdgeIteratorState edgeState, boolean reverse)
Weighting
EdgeIteratorState
. E.g. a high value indicates that the edge
should be avoided during shortest path search. Make sure that this method is very fast and optimized as this is
called potentially millions of times for one route or a lot more for nearly any preprocessing phase.calcEdgeWeight
in interface Weighting
edgeState
- the edge for which the weight should be calculatedreverse
- if the specified edge is specified in reverse direction e.g. from the reverse
case of a bidirectional search.public double calcTurnWeight(int inEdge, int viaNode, int outEdge)
calcTurnWeight
in interface Weighting
public long calcEdgeMillis(EdgeIteratorState edgeState, boolean reverse)
Weighting
calcEdgeMillis
in interface Weighting
public long calcTurnMillis(int inEdge, int viaNode, int outEdge)
calcTurnMillis
in interface Weighting
public boolean hasTurnCosts()
Weighting
hasTurnCosts
in interface Weighting
public FlagEncoder getFlagEncoder()
getFlagEncoder
in interface Weighting
Copyright © 2012–2020. All rights reserved.