Removed getMaximumSpeed in Data.
This commit is contained in:
parent
2914df4a37
commit
1f28a33da4
@ -77,10 +77,14 @@ public abstract class AbstractInputData {
|
|||||||
* @return The maximum speed for this inspector, or
|
* @return The maximum speed for this inspector, or
|
||||||
* {@link GraphStatistics#NO_MAXIMUM_SPEED} if none is set.
|
* {@link GraphStatistics#NO_MAXIMUM_SPEED} if none is set.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Apparently, getMaximumSpeed is never initialized in arcInspectors.
|
||||||
|
* => Do not use.
|
||||||
public int getMaximumSpeed() {
|
public int getMaximumSpeed() {
|
||||||
return this.arcInspector.getMaximumSpeed();
|
return this.arcInspector.getMaximumSpeed();
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Check if the given arc is allowed for the filter corresponding to this input.
|
* Check if the given arc is allowed for the filter corresponding to this input.
|
||||||
*
|
*
|
||||||
|
@ -33,7 +33,7 @@ public interface ArcInspector {
|
|||||||
* @return The maximum speed for this inspector, or
|
* @return The maximum speed for this inspector, or
|
||||||
* {@link GraphStatistics#NO_MAXIMUM_SPEED} if none is set.
|
* {@link GraphStatistics#NO_MAXIMUM_SPEED} if none is set.
|
||||||
*/
|
*/
|
||||||
public int getMaximumSpeed();
|
/* public int getMaximumSpeed(); */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Mode for this arc inspector.
|
* @return Mode for this arc inspector.
|
||||||
|
@ -32,10 +32,12 @@ public class ArcInspectorFactory {
|
|||||||
return arc.getLength();
|
return arc.getLength();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
@Override
|
@Override
|
||||||
public int getMaximumSpeed() {
|
public int getMaximumSpeed() {
|
||||||
return GraphStatistics.NO_MAXIMUM_SPEED;
|
return GraphStatistics.NO_MAXIMUM_SPEED;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Mode getMode() {
|
public Mode getMode() {
|
||||||
@ -62,10 +64,12 @@ public class ArcInspectorFactory {
|
|||||||
return arc.getLength();
|
return arc.getLength();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
@Override
|
@Override
|
||||||
public int getMaximumSpeed() {
|
public int getMaximumSpeed() {
|
||||||
return GraphStatistics.NO_MAXIMUM_SPEED;
|
return GraphStatistics.NO_MAXIMUM_SPEED;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Mode getMode() {
|
public Mode getMode() {
|
||||||
@ -91,10 +95,12 @@ public class ArcInspectorFactory {
|
|||||||
return arc.getMinimumTravelTime();
|
return arc.getMinimumTravelTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
@Override
|
@Override
|
||||||
public int getMaximumSpeed() {
|
public int getMaximumSpeed() {
|
||||||
return GraphStatistics.NO_MAXIMUM_SPEED;
|
return GraphStatistics.NO_MAXIMUM_SPEED;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Mode getMode() {
|
public Mode getMode() {
|
||||||
@ -120,11 +126,13 @@ public class ArcInspectorFactory {
|
|||||||
return arc.getMinimumTravelTime();
|
return arc.getMinimumTravelTime();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
@Override
|
@Override
|
||||||
public int getMaximumSpeed() {
|
public int getMaximumSpeed() {
|
||||||
return GraphStatistics.NO_MAXIMUM_SPEED;
|
return GraphStatistics.NO_MAXIMUM_SPEED;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Mode getMode() {
|
public Mode getMode() {
|
||||||
return Mode.TIME;
|
return Mode.TIME;
|
||||||
@ -139,6 +147,8 @@ public class ArcInspectorFactory {
|
|||||||
// Non-private roads for pedestrian and bicycle:
|
// Non-private roads for pedestrian and bicycle:
|
||||||
filters.add(new ArcInspector() {
|
filters.add(new ArcInspector() {
|
||||||
|
|
||||||
|
static final int maxPedestrianSpeed = 5 ;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean isAllowed(Arc arc) {
|
public boolean isAllowed(Arc arc) {
|
||||||
return arc.getRoadInformation().getAccessRestrictions()
|
return arc.getRoadInformation().getAccessRestrictions()
|
||||||
@ -149,7 +159,7 @@ public class ArcInspectorFactory {
|
|||||||
@Override
|
@Override
|
||||||
public double getCost(Arc arc) {
|
public double getCost(Arc arc) {
|
||||||
return arc.getTravelTime(
|
return arc.getTravelTime(
|
||||||
Math.min(getMaximumSpeed(), arc.getRoadInformation().getMaximumSpeed()));
|
Math.min(maxPedestrianSpeed, arc.getRoadInformation().getMaximumSpeed()));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -157,11 +167,13 @@ public class ArcInspectorFactory {
|
|||||||
return "Fastest path for pedestrian";
|
return "Fastest path for pedestrian";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
@Override
|
@Override
|
||||||
public int getMaximumSpeed() {
|
public int getMaximumSpeed() {
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Mode getMode() {
|
public Mode getMode() {
|
||||||
return Mode.TIME;
|
return Mode.TIME;
|
||||||
|
Loading…
Reference in New Issue
Block a user