/** * Re-plans a future route. The route is given by its leg. It is expected that the * leg's route is not null and that the start- and end link Ids are set properly. * * If the start- and or end-location of the leg have changed, use relocateFutureLegRoute(...)! * * @return true when replacing the route worked, false when something went wrong */ public boolean replanFutureLegRoute(Leg leg, Person person ) { // just a pointer to that other method, but this one (which does not change the destination) is still ok also with access/egress // routing return relocateFutureLegRoute( leg, leg.getRoute().getStartLinkId(), leg.getRoute().getEndLinkId(), person ) ; }
assertEquals(true, ed.relocateFutureLegRoute((Leg) plan.getPlanElements().get(firstCarLeg), activityH1.getLinkId(), activityW1.getLinkId(), plan.getPerson() )); assertEquals(true, ed.relocateFutureLegRoute((Leg) plan.getPlanElements().get(scndCarLeg), activityW1.getLinkId(), activityH2.getLinkId(), plan.getPerson() )); legWH.setRoute(null); legWH.setMode(TransportMode.walk); assertEquals(true, ed.relocateFutureLegRoute((Leg) plan.getPlanElements().get(firstCarLeg), activityH1.getLinkId(), activityW1.getLinkId(), plan.getPerson() )); assertEquals(true, ed.relocateFutureLegRoute((Leg) plan.getPlanElements().get(scndCarLeg), activityW1.getLinkId(), activityH2.getLinkId(), plan.getPerson() ));