@Override public double calculateTravelTime(Graph<?> graph, Point from, Point to, Unit<Length> distanceUnit, Measure<Double, Velocity> speed, Unit<Duration> outputTimeUnit) { final Measure<Double, Length> distance = Measure.valueOf(graph.connectionLength(from, to), distanceUnit); return Math.max(doCalculateTravelTime(speed, distance, outputTimeUnit), doCalculateTravelTime( Measure.valueOf(getSpeed(graph, from, to), speed.getUnit()), distance, outputTimeUnit)); }
@Override public double calculateTravelTime(Graph<?> graph, Point from, Point to, Unit<Length> distanceUnit, Measure<Double, Velocity> speed, Unit<Duration> outputTimeUnit) { final Measure<Double, Length> distance = Measure.valueOf(graph.connectionLength(from, to), distanceUnit); return Math.max(doCalculateTravelTime(speed, distance, outputTimeUnit), doCalculateTravelTime( Measure.valueOf(getSpeed(graph, from, to), speed.getUnit()), distance, outputTimeUnit)); }
@Override public double calculateCost(Graph<?> graph, Point from, Point to) { final double speed = getSpeed(graph, from, to); final double length = graph.connectionLength(from, to); // Potential metric conflict, shouldn't affect relative outcome return length / speed; }
@Override public double estimateCost(Graph<?> graph, Point from, Point to) { final double speed = getSpeed(graph, from, to); final double length = Point.distance(from, to); // // Potential metric conflict, shouldn't affect relative outcome return length / speed; }
@Override public double estimateCost(Graph<?> graph, Point from, Point to) { final double speed = getSpeed(graph, from, to); final double length = Point.distance(from, to); // // Potential metric conflict, shouldn't affect relative outcome return length / speed; }
@Override public double calculateCost(Graph<?> graph, Point from, Point to) { final double speed = getSpeed(graph, from, to); final double length = graph.connectionLength(from, to); // Potential metric conflict, shouldn't affect relative outcome return length / speed; }