Removed getMaximumSpeed in Data.

This commit is contained in:
Le Botlan Didier 2022-03-01 17:14:58 +01:00
parent 2914df4a37
commit 1f28a33da4
3 changed files with 21 additions and 5 deletions

View File

@ -77,9 +77,13 @@ 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.

View File

@ -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.

View File

@ -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,10 +126,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() {
@ -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,10 +167,12 @@ 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() {