Skip to content

Commit

Permalink
try and satisfy Checkstyle
Browse files Browse the repository at this point in the history
  • Loading branch information
tschlenther committed Nov 23, 2023
1 parent d5fd142 commit 64ca455
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/org/matsim/run/prepare/PreparePopulation.java
Original file line number Diff line number Diff line change
Expand Up @@ -231,11 +231,11 @@ public static void deleteCarAndRideRoutesThatHaveForbiddenLinks(Population popul
.forEach(person -> person.getPlans().stream().flatMap(plan ->
TripStructureUtils.getLegs(plan).stream())
.forEach(leg -> {
if(leg.getMode().equals(TransportMode.car) || leg.getMode().equals(TransportMode.ride)){
if (leg.getMode().equals(TransportMode.car) || leg.getMode().equals(TransportMode.ride)){
Route route = leg.getRoute();
if (route != null){
boolean routeTouchesZone = (route instanceof NetworkRoute && ((NetworkRoute) route).getLinkIds().stream().filter(l -> forbiddenLinks.contains(l)).findAny().isPresent() );
if(routeTouchesZone || forbiddenLinks.contains(route.getStartLinkId()) || forbiddenLinks.contains(route.getEndLinkId()) ){
if (routeTouchesZone || forbiddenLinks.contains(route.getStartLinkId()) || forbiddenLinks.contains(route.getEndLinkId()) ){
leg.setRoute(null);
}
}
Expand Down

0 comments on commit 64ca455

Please sign in to comment.