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