@Override public void run(Plan plan) { PlanImpl copyPlan = new PlanImpl(person); for (PlanElement pe : plan.getPlanElements()) { if (pe instanceof Activity) { copyPlan.addActivity((ActivityImpl) pe); } else if (pe instanceof Leg) { LegImpl leg = (LegImpl) pe; LegImpl ptLeg = new LegImpl(leg); ptLeg.setMode(TransportMode.pt); ptLeg.setRoute(null); // ----------------------------------------------- // WITHOUT routeSetting!! traveltime of PT can be // calculated automaticly!! // ----------------------------------------------- copyPlan.addLeg(ptLeg); // Leg walkLeg = new org.matsim.core.population.LegImpl(leg); // walkLeg.setMode(TransportMode.walk); // walkLeg.setRoute(null); // walkPlan.addLeg(walkLeg); if (!leg.getMode().equals(TransportMode.car)) { leg.setRoute(null); leg.setMode(TransportMode.car); } } } copyPlans.add(copyPlan); // copyPlans.add(walkPlan); }