20 package org.matsim.core.router;
22 import org.apache.logging.log4j.LogManager;
23 import org.apache.logging.log4j.Logger;
39 import java.util.List;
49 private static final Logger
log = LogManager.getLogger(
PlanRouter.class ) ;
79 for (
Trip oldTrip : trips) {
81 timeTracker.
addActivity(oldTrip.getOriginActivity());
83 if (log.isDebugEnabled()) log.debug(
"about to call TripRouter with routingMode=" + routingMode);
84 final List<? extends PlanElement> newTripElements = tripRouter.
calcRoute(
90 oldTrip.getTripAttributes()
95 TripRouter.
insertTrip( plan, oldTrip.getOriginActivity(), newTripElements, oldTrip.getDestinationActivity());
110 if (oldVehicleId != null) {
113 if (((
NetworkRoute) leg.getRoute()).getVehicleId() == null) {
114 ((
NetworkRoute) leg.getRoute()).setVehicleId(oldVehicleId);
125 if (vehicleId != null && (!vehicleId.
equals(((
NetworkRoute) leg.getRoute()).getVehicleId()))) {
128 vehicleId = ((
NetworkRoute) leg.getRoute()).getVehicleId();
synchronized List<? extends PlanElement > calcRoute(final String mainMode, final Facility fromFacility, final Facility toFacility, final double departureTime, final Person person, final Attributes routingAttributes)
PlanRouter(final TripRouter tripRouter, final ActivityFacilities facilities, final TimeInterpretation timeInterpretation)
static String identifyMainMode(final List<? extends PlanElement > tripElements)
List< Leg > getLegsOnly()
final ActivityFacilities facilities
static List< PlanElement > insertTrip(final Plan plan, final Activity origin, final List<? extends PlanElement > trip, final Activity destination)
static void putVehicleFromOldTripIntoNewTripIfMeaningful(Trip oldTrip, List<? extends PlanElement > newTrip)
void run(final Person person)
final TripRouter tripRouter
static List< Trip > getTrips(final Plan plan)
static Id< Vehicle > getUniqueVehicleId(Trip trip)
PlanRouter(final TripRouter routingHandler, final TimeInterpretation timeInterpretation)
final TimeInterpretation timeInterpretation
OptionalTime addActivity(Activity activity)
void run(final Plan plan)
boolean equals(Object obj)
static Facility toFacility(final Activity toWrap, ActivityFacilities activityFacilities)
static List< Leg > getLegs(final Plan plan)
OptionalTime addElements(List<? extends PlanElement > elements)
abstract List<? extends T > getPlans()