Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/endlessCircleLine' into endlessC…
Browse files Browse the repository at this point in the history
…ircleLine
  • Loading branch information
vsp-gleich committed Dec 16, 2024
2 parents cf9f88d + a3254ed commit 1575922
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 5 deletions.
8 changes: 3 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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\
Expand Down Expand Up @@ -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
echo "Done"
17 changes: 17 additions & 0 deletions src/main/java/org/matsim/run/OpenBerlinScenario.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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<Leg> legs = TripStructureUtils.getLegs(plan);
for (Leg leg : legs) {
if (leg.getMode().equals(TransportMode.pt)) {
leg.setRoute(null);
leg.setTravelTimeUndefined();
}
}
}
}

}

@Override
Expand Down

0 comments on commit 1575922

Please sign in to comment.