Skip to content

Instantly share code, notes, and snippets.

@gbip
Created May 14, 2018 10:06
Show Gist options
  • Save gbip/44caa6e0c19e0f7555f46791e61ea9bd to your computer and use it in GitHub Desktop.
Save gbip/44caa6e0c19e0f7555f46791e61ea9bd to your computer and use it in GitHub Desktop.
// 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