diff --git a/Makefile b/Makefile index 6482aeb1..45056218 100644 --- a/Makefile +++ b/Makefile @@ -135,8 +135,8 @@ $p/berlin-$V-network-with-pt.xml.gz: $p/berlin-$V-network.xml.gz --network $p/berlin-$V-network-with-pt.xml.gz\ --transit-schedule $p/berlin-$V-transitSchedule.xml.gz\ --transit-vehicles $p/berlin-$V-transitVehicles.xml.gz\ - --output-transit-schedule $p/berlin-$V-transitSchedule-endless-circle-line.xml.gz\ - --output-transit-vehicles $p/berlin-$V-transitVehicles-endless-circle-line.xml.gz + --output-transit-schedule $p/berlin-$V-transitSchedule.xml.gz\ + --output-transit-vehicles $p/berlin-$V-transitVehicles.xml.gz $p/berlin-$V-counts-vmz.xml.gz: $p/berlin-$V-network.xml.gz $(sc) prepare counts-from-vmz\ @@ -356,6 +356,4 @@ prepare-drt: $p/berlin-$V.drt-by-rndLocations-10000vehicles-4seats.xml.gz echo "Done" prepare: $p/berlin-$V-10pct.plans.xml.gz - echo "Done" - -prepare-schedule: $p/berlin-$V-network-with-pt.xml.gz \ No newline at end of file + echo "Done" \ No newline at end of file diff --git a/src/main/java/org/matsim/run/OpenBerlinScenario.java b/src/main/java/org/matsim/run/OpenBerlinScenario.java index 8fdf8b5a..4e057963 100644 --- a/src/main/java/org/matsim/run/OpenBerlinScenario.java +++ b/src/main/java/org/matsim/run/OpenBerlinScenario.java @@ -6,6 +6,9 @@ import org.matsim.analysis.pt.stop2stop.PtStop2StopAnalysisModule; import org.matsim.api.core.v01.Scenario; import org.matsim.api.core.v01.TransportMode; +import org.matsim.api.core.v01.population.Leg; +import org.matsim.api.core.v01.population.Person; +import org.matsim.api.core.v01.population.Plan; import org.matsim.application.MATSimApplication; import org.matsim.application.options.SampleOptions; import org.matsim.contrib.bicycle.BicycleConfigGroup; @@ -22,6 +25,7 @@ import org.matsim.core.controler.AbstractModule; import org.matsim.core.controler.Controler; import org.matsim.core.replanning.strategies.DefaultPlanStrategiesModule; +import org.matsim.core.router.TripStructureUtils; import org.matsim.core.router.costcalculators.OnlyTimeDependentTravelDisutilityFactory; import org.matsim.core.router.costcalculators.TravelDisutilityFactory; import org.matsim.core.router.util.TravelTime; @@ -144,6 +148,19 @@ protected void prepareScenario(Scenario scenario) { HbefaRoadTypeMapping roadTypeMapping = OsmHbefaMapping.build(); roadTypeMapping.addHbefaMappings(scenario.getNetwork()); + // XXX: yyyyyyyy TODO Remove before merging. This is just for intermediate runs to update the PT schedules + for (Person person : scenario.getPopulation().getPersons().values()) { + for (Plan plan : person.getPlans()) { + List legs = TripStructureUtils.getLegs(plan); + for (Leg leg : legs) { + if (leg.getMode().equals(TransportMode.pt)) { + leg.setRoute(null); + leg.setTravelTimeUndefined(); + } + } + } + } + } @Override