|
8 | 8 | import org.matsim.core.config.CommandLine.ConfigurationException;
|
9 | 9 | import org.matsim.core.config.Config;
|
10 | 10 | import org.matsim.core.config.ConfigUtils;
|
| 11 | +import org.matsim.core.config.groups.QSimConfigGroup; |
11 | 12 | import org.matsim.core.controler.Controler;
|
12 | 13 | import org.matsim.core.scenario.ScenarioUtils;
|
13 | 14 |
|
14 | 15 | public class RunSimulation {
|
15 | 16 | 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. |
16 | 19 | CommandLine cmd = new CommandLine.Builder(args) //
|
17 | 20 | .requireOptions("config-path") //
|
18 |
| - .allowPrefixes("mode-parameter", "cost-parameter") // |
| 21 | + .allowPrefixes("mode-parameter", "cost-parameter", "preventwaitingtoentertraffic") // |
19 | 22 | .build();
|
20 | 23 |
|
21 | 24 | SwitzerlandConfigurator configurator = new SwitzerlandConfigurator();
|
22 | 25 | Config config = ConfigUtils.loadConfig(cmd.getOptionStrict("config-path"), configurator.getConfigGroups());
|
23 | 26 | configurator.addOptionalConfigGroups(config);
|
24 | 27 | cmd.applyConfiguration(config);
|
25 | 28 |
|
| 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 | + |
26 | 36 | Scenario scenario = ScenarioUtils.createScenario(config);
|
27 | 37 |
|
28 | 38 | configurator.configureScenario(scenario);
|
|
0 commit comments