From 9367897e5c6ab9afd22c954de39d1d63950dceb0 Mon Sep 17 00:00:00 2001 From: sime94 Date: Wed, 16 Oct 2024 14:49:43 +0200 Subject: [PATCH] set ride params via matsim-libs method --- .../java/org/matsim/run/scenarios/LausitzScenario.java | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/main/java/org/matsim/run/scenarios/LausitzScenario.java b/src/main/java/org/matsim/run/scenarios/LausitzScenario.java index 53f1ba9..6ed0ddb 100644 --- a/src/main/java/org/matsim/run/scenarios/LausitzScenario.java +++ b/src/main/java/org/matsim/run/scenarios/LausitzScenario.java @@ -22,6 +22,7 @@ import org.matsim.contrib.vsp.pt.fare.PtFareConfigGroup; import org.matsim.contrib.vsp.pt.fare.PtFareModule; import org.matsim.contrib.vsp.scenario.SnzActivities; +import org.matsim.contrib.vsp.scoring.RideScoringParamsFromCarParams; import org.matsim.core.config.Config; import org.matsim.core.config.ConfigUtils; import org.matsim.core.config.groups.ReplanningConfigGroup; @@ -135,15 +136,11 @@ public Config prepareConfig(Config config) { scoringConfigGroup.setPathSizeLogitBeta(0.); // set ride scoring params dependent from car params - ScoringConfigGroup.ModeParams rideParams = scoringConfigGroup.getOrCreateModeParams(TransportMode.ride); - ScoringConfigGroup.ModeParams carParams = scoringConfigGroup.getModes().get(TransportMode.car); // 2.0 + 1.0 = alpha + 1 // ride cost = alpha * car cost // ride marg utility of traveling = (alpha + 1) * marg utility travelling car + alpha * beta perf double alpha = 2; - rideParams.setMarginalUtilityOfTraveling((alpha + 1) * carParams.getMarginalUtilityOfTraveling() - alpha * config.scoring().getPerforming_utils_hr()); - rideParams.setDailyMonetaryConstant(0.); - rideParams.setMonetaryDistanceRate(carParams.getMonetaryDistanceRate() * 2); + RideScoringParamsFromCarParams.setRideScoringParamsBasedOnCarParams(scoringConfigGroup, alpha); config.qsim().setUsingTravelTimeCheckInTeleportation(true); config.qsim().setUsePersonIdForMissingVehicleId(false);