Skip to content

Commit

Permalink
update to latest code base
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhoerl committed Dec 5, 2023
1 parent 97417bc commit a04e26c
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.matsim.facilities.ActivityFacilities;
import org.matsim.facilities.FacilitiesUtils;
import org.matsim.facilities.Facility;
import org.matsim.utils.objectattributes.attributable.Attributes;

import com.google.inject.Inject;

Expand Down Expand Up @@ -59,7 +60,7 @@ public void run(Plan plan, boolean replaceExistingRoutes, Set<String> modes) {

// Fix in case we have a transit trip that is only walk
newElements = fixOnlyWalk(mainMode, fromFacility, toFacility, departureTime.seconds(),
plan.getPerson(), newElements);
plan.getPerson(), newElements, trip.getTripAttributes());

TripRouter.insertTrip(plan, trip.getOriginActivity(), newElements, trip.getDestinationActivity());
}
Expand All @@ -68,7 +69,7 @@ public void run(Plan plan, boolean replaceExistingRoutes, Set<String> modes) {
}

private List<? extends PlanElement> fixOnlyWalk(String mainMode, Facility fromFacility, Facility toFacility,
double departureTime, Person person, List<? extends PlanElement> elements) {
double departureTime, Person person, List<? extends PlanElement> elements, Attributes attributes) {
// No need to fix if already walk
if (mainMode.equals(TransportMode.walk)) {
return elements;
Expand All @@ -82,6 +83,6 @@ private List<? extends PlanElement> fixOnlyWalk(String mainMode, Facility fromFa
}

// We have only walk legs
return tripRouter.calcRoute(TransportMode.walk, fromFacility, toFacility, departureTime, person);
return tripRouter.calcRoute(TransportMode.walk, fromFacility, toFacility, departureTime, person, attributes);
}
}

0 comments on commit a04e26c

Please sign in to comment.