Created
May 14, 2018 10:06
-
-
Save gbip/44caa6e0c19e0f7555f46791e61ea9bd to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Vélo | |
filters.add(new ArcInspector() { | |
@Override | |
public boolean isAllowed(Arc arc) { | |
return arc.getRoadInformation().getAccessRestrictions() | |
.isAllowedForAny(AccessMode.BICYCLE, EnumSet.complementOf(EnumSet | |
.of(AccessRestriction.FORBIDDEN, AccessRestriction.PRIVATE))); | |
} | |
@Override | |
public double getCost(Arc arc) { | |
return arc.getTravelTime( | |
Math.min(getMaximumSpeed(), arc.getRoadInformation().getMaximumSpeed())); | |
} | |
@Override | |
public String toString() { | |
return "Fastest path for bicycles"; | |
} | |
@Override | |
public int getMaximumSpeed() { | |
return 35; | |
} | |
@Override | |
public Mode getMode() { | |
return Mode.LENGTH; | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment