Skip to content

Commit

Permalink
update RunKelheimScenario to allow pt to work
Browse files Browse the repository at this point in the history
  • Loading branch information
jakobrehmann committed May 23, 2024
1 parent 48ca6e7 commit 95133fd
Showing 1 changed file with 13 additions and 10 deletions.
23 changes: 13 additions & 10 deletions src/main/java/org/matsim/run/RunKelheimScenario.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 ch.sbb.matsim.routing.pt.raptor.SwissRailRaptorModule;
import com.google.common.collect.Sets;
import com.google.inject.Inject;
Expand Down Expand Up @@ -167,9 +168,6 @@ protected Config prepareConfig(Config config) {
config.controller().setLastIteration(0);

// stuff needed for accessibility



SnzActivities.addScoringParams(config);

config.controller().setOutputDirectory(sample.adjustName(config.controller().getOutputDirectory()));
Expand Down Expand Up @@ -198,9 +196,6 @@ protected Config prepareConfig(Config config) {

if (drt) {

// yyyyyyy added to avoid following error "java.lang.RuntimeException: DynAgents require simulation to start from the very beginning. Set 'QSim.simStarttimeInterpretation' to onlyUseStarttime" -JR May'24
config.qsim().setSimStarttimeInterpretation(QSimConfigGroup.StarttimeInterpretation.onlyUseStarttime);

config.addModule(new MultiModeDrtConfigGroup(DrtWithExtensionsConfigGroup::new));

MultiModeDrtConfigGroup multiModeDrtConfig = ConfigUtils.addOrGetModule(config, MultiModeDrtConfigGroup.class);
Expand All @@ -219,6 +214,14 @@ protected Config prepareConfig(Config config) {

if (acc) {

// yyyyyyy TODO: added to avoid following error "java.lang.RuntimeException: DynAgents require simulation to start from the very beginning. Set 'QSim.simStarttimeInterpretation' to onlyUseStarttime" -JR May'24
config.qsim().setSimStarttimeInterpretation(QSimConfigGroup.StarttimeInterpretation.onlyUseStarttime);


// yyyyyyy TODO: had to turn off intermodal pt access/egress because "= this.routingModules.get(mode) = null" in DefaultRaptorStopFinder. No drt router present...
SwissRailRaptorConfigGroup swissRailRaptorConfigGroup = ConfigUtils.addOrGetModule(config, SwissRailRaptorConfigGroup.class);
swissRailRaptorConfigGroup.setUseIntermodalAccessEgress(false);

MultiModeDrtConfigGroup multiModeDrtConfig = ConfigUtils.addOrGetModule(config, MultiModeDrtConfigGroup.class);
for (DrtConfigGroup drtConfigGroup : multiModeDrtConfig.getModalElements()) {
//TODO: temp, allow accessibility computations to occur more than 1.5km away from drt stops.
Expand Down Expand Up @@ -249,11 +252,11 @@ protected Config prepareConfig(Config config) {
accConfig.setBoundingBoxBottom(mapCenterY - num_rows*tileSize - tileSize/2);
accConfig.setBoundingBoxTop(mapCenterY + num_rows*tileSize + tileSize/2);
accConfig.setTileSize_m((int) tileSize);
accConfig.setTimeOfDay(14 * 60 * 60.);
accConfig.setComputingAccessibilityForMode(Modes4Accessibility.freespeed, true); // works
accConfig.setComputingAccessibilityForMode(Modes4Accessibility.car, true); // works
accConfig.setTimeOfDay(15.5 * 60 * 60.);
accConfig.setComputingAccessibilityForMode(Modes4Accessibility.freespeed, false); // works
accConfig.setComputingAccessibilityForMode(Modes4Accessibility.car, false); // works
// accConfig.setComputingAccessibilityForMode(Modes4Accessibility.bike, false); // ??
// accConfig.setComputingAccessibilityForMode(Modes4Accessibility.pt, true); // doesn't work
accConfig.setComputingAccessibilityForMode(Modes4Accessibility.pt, true); // works
accConfig.setComputingAccessibilityForMode(Modes4Accessibility.estimatedDrt, true); // works
}

Expand Down

0 comments on commit 95133fd

Please sign in to comment.