public class FastestWeighting extends AbstractWeighting
| Modifier and Type | Field and Description |
|---|---|
protected static double |
SPEED_CONV
Converting to seconds is not necessary but makes adding other penalties easier (e.g.
|
flagEncoder| Constructor and Description |
|---|
FastestWeighting(FlagEncoder encoder) |
FastestWeighting(FlagEncoder encoder,
PMap map) |
| Modifier and Type | Method and Description |
|---|---|
long |
calcMillis(EdgeIteratorState edgeState,
boolean reverse,
int prevOrNextEdgeId)
This method calculates the time taken (in milli seconds) for the specified edgeState and
optionally include the turn costs (in seconds) of the previous (or next) edgeId via
prevOrNextEdgeId.
|
double |
calcWeight(EdgeIteratorState edge,
boolean reverse,
int prevOrNextEdgeId)
This method calculates the weighting a certain edgeState should be associated.
|
double |
getMinWeight(double distance)
Used only for the heuristic estimation in A*
|
String |
getName() |
equals, getFlagEncoder, hashCode, matches, toString, weightingToFileNameprotected static final double SPEED_CONV
public FastestWeighting(FlagEncoder encoder, PMap map)
public FastestWeighting(FlagEncoder encoder)
public double getMinWeight(double distance)
Weightingpublic double calcWeight(EdgeIteratorState edge, boolean reverse, int prevOrNextEdgeId)
Weightingedge - 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.prevOrNextEdgeId - if reverse is false this has to be the previous edgeId, if true it
has to be the next edgeId in the direction from start to end.public long calcMillis(EdgeIteratorState edgeState, boolean reverse, int prevOrNextEdgeId)
WeightingcalcMillis in interface WeightingcalcMillis in class AbstractWeightingpublic String getName()
Copyright © 2012–2018. All rights reserved.