public class GenericWeighting extends AbstractWeighting
| Modifier and Type | Field and Description |
|---|---|
protected int |
accessType |
protected DataFlagEncoder |
gEncoder |
protected double |
headingPenalty |
protected long |
headingPenaltyMillis |
protected double |
height |
static String |
HEIGHT_LIMIT |
protected double |
maxSpeed |
protected static double |
SPEED_CONV
Convert to milliseconds for correct calcMillis.
|
protected int |
uncertainAccessiblePenalty |
protected double |
weight |
static String |
WEIGHT_LIMIT |
protected DataFlagEncoder.WeightingConfig |
weightingConfig |
protected double |
width |
static String |
WIDTH_LIMIT |
flagEncoder| Constructor and Description |
|---|
GenericWeighting(DataFlagEncoder encoder,
PMap hintsMap) |
| 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 edgeState,
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, weightingToFileNamepublic static final String HEIGHT_LIMIT
public static final String WEIGHT_LIMIT
public static final String WIDTH_LIMIT
protected static final double SPEED_CONV
protected final double headingPenalty
protected final long headingPenaltyMillis
protected final double maxSpeed
protected final DataFlagEncoder gEncoder
protected final DataFlagEncoder.WeightingConfig weightingConfig
protected final int accessType
protected final int uncertainAccessiblePenalty
protected final double height
protected final double weight
protected final double width
public GenericWeighting(DataFlagEncoder encoder, PMap hintsMap)
public double getMinWeight(double distance)
Weightingpublic double calcWeight(EdgeIteratorState edgeState, boolean reverse, int prevOrNextEdgeId)
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.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.