Skip to content

Commit ef86b74

Browse files
authored
Swiss code cutout (#240)
* adding configuration to prevent vehicles waiting to enter traffic Basically telling qsim to put vehicles directly on the link and not to wait for space in the buffer to enter traffic * update changelog
1 parent 464df6c commit ef86b74

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ included in the (note yet determined) next version number.
88

99
- Emissions tools have been moved to core package (from ile_de_france)
1010
- Switched to MATSim 2025 (PR)
11+
- In switzerland one can now switch off vehicles waiting to enter traffic
1112

1213
**1.5.0**
1314

switzerland/src/main/java/org/eqasim/switzerland/RunSimulation.java

+11-1
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,31 @@
88
import org.matsim.core.config.CommandLine.ConfigurationException;
99
import org.matsim.core.config.Config;
1010
import org.matsim.core.config.ConfigUtils;
11+
import org.matsim.core.config.groups.QSimConfigGroup;
1112
import org.matsim.core.controler.Controler;
1213
import org.matsim.core.scenario.ScenarioUtils;
1314

1415
public class RunSimulation {
1516
static public void main(String[] args) throws ConfigurationException {
17+
// set preventwaitingtoentertraffic to y if you want to to prevent that waiting traffic has to wait for space in the link buffer
18+
// this is especially important to avoid high waiting times when we cutout scenarios from a larger scenario.
1619
CommandLine cmd = new CommandLine.Builder(args) //
1720
.requireOptions("config-path") //
18-
.allowPrefixes("mode-parameter", "cost-parameter") //
21+
.allowPrefixes("mode-parameter", "cost-parameter", "preventwaitingtoentertraffic") //
1922
.build();
2023

2124
SwitzerlandConfigurator configurator = new SwitzerlandConfigurator();
2225
Config config = ConfigUtils.loadConfig(cmd.getOptionStrict("config-path"), configurator.getConfigGroups());
2326
configurator.addOptionalConfigGroups(config);
2427
cmd.applyConfiguration(config);
2528

29+
if (cmd.hasOption("preventwaitingtoentertraffic")) {
30+
if (cmd.getOption("preventwaitingtoentertraffic").get().equals("y")) {
31+
((QSimConfigGroup) config.getModules().get(QSimConfigGroup.GROUP_NAME))
32+
.setPcuThresholdForFlowCapacityEasing(1.0);
33+
}
34+
}
35+
2636
Scenario scenario = ScenarioUtils.createScenario(config);
2737

2838
configurator.configureScenario(scenario);

0 commit comments

Comments
 (0)