Skip to content

Commit

Permalink
set drt fares to 0, since pt/drt fares are already implemented using …
Browse files Browse the repository at this point in the history
…scoring parameters, rename variable
  • Loading branch information
vsp-gleich committed May 21, 2024
1 parent 4d58a48 commit 696caa3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions input/v6.1/berlin-v6.1.drt-config.xml
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,11 @@
<!-- Basefare per Trip (fare = positive value) -->
<param name="basefare" value="0.0"/>
<!-- Minimum fare per trip (paid instead of the sum of base, time and distance fare if that sum would be lower than the minimum fare, fee = positive value). -->
<param name="minFarePerTrip" value="2.0"/>
<param name="minFarePerTrip" value="0.0"/>
<!-- Daily subscription fee (fee = positive value) -->
<param name="dailySubscriptionFee" value="0.0"/>
<!-- drt fare per meter (fee = positive value) -->
<param name="distanceFare_m" value="0.00035"/>
<param name="distanceFare_m" value="0.0"/>
<!-- drt fare per hour (fee = positive value) -->
<param name="timeFare_h" value="0.0"/>
</parameterset>
Expand Down
10 changes: 5 additions & 5 deletions src/main/java/org/matsim/run/OpenBerlinDrtScenario.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,13 @@ protected Config prepareConfig(Config config) {
MultiModeDrtConfigGroup multiModeDrtCfg = MultiModeDrtConfigGroup.get(config);
DrtConfigs.adjustMultiModeDrtConfig(multiModeDrtCfg, config.scoring(), config.routing());

Set<String> modes = new HashSet<>();
Set<String> drtModes = new HashSet<>();

ScoringConfigGroup.ModeParams ptParams = config.scoring().getModes().get(TransportMode.pt);
IntermodalTripFareCompensatorsConfigGroup compensatorsConfig = ConfigUtils.addOrGetModule(config, IntermodalTripFareCompensatorsConfigGroup.class);

for (DrtConfigGroup drtCfg : multiModeDrtCfg.getModalElements()) {
modes.add(drtCfg.getMode());
drtModes.add(drtCfg.getMode());

//copy all scoring params from pt
ScoringConfigGroup.ModeParams modeParams = new ScoringConfigGroup.ModeParams(drtCfg.getMode());
Expand All @@ -145,14 +145,14 @@ protected Config prepareConfig(Config config) {
drtCompensationCfg.setCompensationMoneyPerDay(ptParams.getDailyMonetaryConstant());
drtCompensationCfg.setNonPtModes(ImmutableSet
.<String>builder()
.addAll(modes)
.addAll(drtModes)
.build());
compensatorsConfig.addParameterSet(drtCompensationCfg);

//include drt in mode-choice and add mode params.
//by using a Set, it should be assured that they aren't included twice.
modes.addAll(Arrays.asList(config.subtourModeChoice().getModes()));
config.subtourModeChoice().setModes(modes.toArray(String[]::new));
drtModes.addAll(Arrays.asList(config.subtourModeChoice().getModes()));
config.subtourModeChoice().setModes(drtModes.toArray(String[]::new));

//Here (or when extending this class), you can configure the dvrp and the drt config groups.
//Of course you can configure on the xml (config) level, alternatively.
Expand Down

0 comments on commit 696caa3

Please sign in to comment.