Skip to content

Commit

Permalink
fix drt scenario loading
Browse files Browse the repository at this point in the history
  • Loading branch information
rakow committed Jan 2, 2025
1 parent dc9aeb6 commit 40c4bc7
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/main/java/org/matsim/run/OpenBerlinDrtScenario.java
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.matsim.core.population.routes.RouteFactories;
import org.matsim.core.router.AnalysisMainModeIdentifier;
import org.matsim.core.router.MainModeIdentifier;
import org.matsim.core.scenario.ScenarioUtils;
import org.matsim.extensions.pt.fare.intermodalTripFareCompensator.IntermodalTripFareCompensatorConfigGroup;
import org.matsim.extensions.pt.fare.intermodalTripFareCompensator.IntermodalTripFareCompensatorsConfigGroup;
import org.matsim.extensions.pt.fare.intermodalTripFareCompensator.IntermodalTripFareCompensatorsModule;
Expand Down Expand Up @@ -218,14 +219,22 @@ protected Config prepareConfig(Config config) {
}

@Override
protected void prepareScenario(Scenario scenario) {
super.prepareScenario(scenario);
protected Scenario createScenario(Config config) {
Scenario scenario = ScenarioUtils.createScenario(config);

//if the input plans contain DrtRoutes, this will cause problems later in the DrtRouteFactory
//to avoid this, the DrtRouteFactory would have to get set before loading the scenario, just like in Open Berlin v5.x
RouteFactories routeFactories = scenario.getPopulation().getFactory().getRouteFactories();
routeFactories.setRouteFactory(DrtRoute.class, new DrtRouteFactory());

ScenarioUtils.loadScenario(scenario);
return scenario;
}

@Override
protected void prepareScenario(Scenario scenario) {
super.prepareScenario(scenario);

//if the drt mode is configured as a dvrp network mode and if it has a service area
//the drt mode is added to the links in the service area with a buffer of +2000 meter (per default or otherwise configured in BerlinExperimentalConfigGroup)
//and transit stops 200m around the service area are tagged to be be served by the corresponding drt.
Expand Down

0 comments on commit 40c4bc7

Please sign in to comment.