From 3559fee0e0851c2ab60b388aa635a0d0ac200954 Mon Sep 17 00:00:00 2001 From: tschlenther Date: Tue, 29 Aug 2023 17:37:34 +0200 Subject: [PATCH] fix: do not create ptOnly plan for only-inner-trips-plans --- .../org/matsim/run/replaceCarByDRT/ReplaceCarByDRT.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main/java/org/matsim/run/replaceCarByDRT/ReplaceCarByDRT.java b/src/main/java/org/matsim/run/replaceCarByDRT/ReplaceCarByDRT.java index 2810f86..15ccd29 100644 --- a/src/main/java/org/matsim/run/replaceCarByDRT/ReplaceCarByDRT.java +++ b/src/main/java/org/matsim/run/replaceCarByDRT/ReplaceCarByDRT.java @@ -184,7 +184,11 @@ static void prepareInputPlansForCarProhibitionWithPRLogic(Scenario scenario, //create and add a plan, where all the trips to replace are NOT split up with P+R logic but are just replaced by a pt trip if(extraPTPlan){ - plansToAdd.add(createPTOnlyPlan(plan, enforceMassConservation, mainModeIdentifier, fac)); + if(nrOfBorderCrossingCarTrips != 0){ +// we have checked whether the plan contains only external trips, above. So if we have no border-crossing trips, here, the plan only consists of inner trips. +// if we have only inner trips, we do not want to create ptOnly plan because it will be the same as a pt plan (when pt is configured as replacing mode) and thus increase the chance of choosing pt naturally. + plansToAdd.add(createPTOnlyPlan(plan, enforceMassConservation, mainModeIdentifier, fac)); + } } plan.setType(replacingMode);