Skip to content

Commit

Permalink
Update DrtOptions.java
Browse files Browse the repository at this point in the history
  • Loading branch information
luchengqi7 committed Sep 18, 2024
1 parent e26c8b1 commit 617d47d
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/main/java/org/matsim/run/DrtOptions.java
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package org.matsim.run;

import ch.sbb.matsim.config.SwissRailRaptorConfigGroup;
import org.matsim.api.core.v01.Id;
import org.matsim.api.core.v01.Scenario;
import org.matsim.api.core.v01.TransportMode;
Expand Down Expand Up @@ -103,7 +104,22 @@ void configureDrtConfig(Config config) {
DrtConfigs.adjustMultiModeDrtConfig(multiModeDrtConfigGroup, config.scoring(), config.routing());

if (intermodal) {
ConfigUtils.addOrGetModule(config, PtIntermodalRoutingModesConfigGroup.class);
SwissRailRaptorConfigGroup srrConfig = ConfigUtils.addOrGetModule(config, SwissRailRaptorConfigGroup.class);
srrConfig.setUseIntermodalAccessEgress(true);
srrConfig.setIntermodalAccessEgressModeSelection(SwissRailRaptorConfigGroup.IntermodalAccessEgressModeSelection.CalcLeastCostModePerStop);

SwissRailRaptorConfigGroup.IntermodalAccessEgressParameterSet accessEgressDrtParam = new SwissRailRaptorConfigGroup.IntermodalAccessEgressParameterSet();
accessEgressDrtParam.setMode(TransportMode.drt);
// Euclidean distance from Hoyerswerda to Ruhland: 20-30 km
accessEgressDrtParam.setInitialSearchRadius(20000);
accessEgressDrtParam.setMaxRadius(30000);
accessEgressDrtParam.setSearchExtensionRadius(1000);
accessEgressDrtParam.setStopFilterAttribute("allowDrtAccessEgress");
accessEgressDrtParam.setStopFilterValue("true");
srrConfig.addIntermodalAccessEgress(accessEgressDrtParam);

// Note: I do not include "walk" as access/egress for intermodal trips, as it should be already taken care of in the transit router.
// If it complains, we can add it back here
}
}

Expand Down

0 comments on commit 617d47d

Please sign in to comment.