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). | 
| String | toString() | 
public QueryGraphWeighting(Weighting weighting, int firstVirtualNodeId, int firstVirtualEdgeId, com.carrotsearch.hppc.IntArrayList closestEdges)
public double getMinWeight(double distance)
WeightinggetMinWeight in interface Weightingpublic double calcEdgeWeight(EdgeIteratorState edgeState, boolean reverse)
WeightingEdgeIteratorState. 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 WeightingedgeState - 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 Weightingpublic long calcEdgeMillis(EdgeIteratorState edgeState, boolean reverse)
WeightingcalcEdgeMillis in interface Weightingpublic long calcTurnMillis(int inEdge,
                           int viaNode,
                           int outEdge)
calcTurnMillis in interface Weightingpublic boolean hasTurnCosts()
WeightinghasTurnCosts in interface Weightingpublic FlagEncoder getFlagEncoder()
getFlagEncoder in interface WeightingCopyright © 2012–2020. All rights reserved.