diff --git a/src/main/java/org/matsim/run/MetropoleRuhrScenario.java b/src/main/java/org/matsim/run/MetropoleRuhrScenario.java index 30e8cd2..b342fb6 100644 --- a/src/main/java/org/matsim/run/MetropoleRuhrScenario.java +++ b/src/main/java/org/matsim/run/MetropoleRuhrScenario.java @@ -270,22 +270,26 @@ protected Config prepareConfig(Config config) { // alpha can be calibrated double alpha = 2.0; - //gamma must stay one - double gamma = 0.0; + double monetaryDistanceRateRide = config.scoring().getOrCreateModeParams(TransportMode.car).getMonetaryDistanceRate() * alpha; - double marginalUtilityOfTravllingRide = config.scoring().getOrCreateModeParams(TransportMode.car).getMarginalUtilityOfTraveling(); //marginal disutility of passenger - marginalUtilityOfTravllingRide += alpha * (-config.scoring().getPerforming_utils_hr() + config.scoring().getOrCreateModeParams(TransportMode.car).getMarginalUtilityOfTraveling()); // Zeitverbrauch des Fahrers - //marginalUtilityOfTravllingRide += gamma * -config.scoring().getPerforming_utils_hr(); //we prefer not using this term + double marginalUtilityOfTravelingRide = config.scoring().getOrCreateModeParams(TransportMode.car).getMarginalUtilityOfTraveling(); //marginal disutility of passenger + + marginalUtilityOfTravelingRide += alpha * (-config.scoring().getPerforming_utils_hr() + config.scoring().getOrCreateModeParams(TransportMode.car).getMarginalUtilityOfTraveling()); // Zeitverbrauch des Fahrers - double tmp = (alpha + gamma) * -(config.scoring().getPerforming_utils_hr()) + config.scoring().getOrCreateModeParams(TransportMode.car).getMarginalUtilityOfTraveling() * (1.0 + alpha) ; + //marginalUtilityOfTravelingRide += gamma * -config.scoring().getPerforming_utils_hr(); //we prefer not using this term - Assert.isTrue(tmp==marginalUtilityOfTravllingRide); + double tmp = alpha * -(config.scoring().getPerforming_utils_hr()) + config.scoring().getOrCreateModeParams(TransportMode.car).getMarginalUtilityOfTraveling() * (1.0 + alpha) ; + Assert.isTrue(tmp==marginalUtilityOfTravelingRide); + // I think that the two lines above were left behind after that refactoring to ensure that the new way to compute this results in the + // same result as the old way. If this assessment is correct, then those two lines can be removed as soon as this has been run a + // couple of times. Since I do not know if this is the case, I leave these two lines in place for the time being, but am adding this + // comment here. kai, aug'24 double marginalUtilityOfDistanceRide = (alpha + 1.0) * config.scoring().getOrCreateModeParams(TransportMode.car).getMarginalUtilityOfDistance(); config.scoring().getOrCreateModeParams(TransportMode.ride).setMonetaryDistanceRate(monetaryDistanceRateRide); config.scoring().getOrCreateModeParams(TransportMode.ride).setMarginalUtilityOfDistance(marginalUtilityOfDistanceRide); - config.scoring().getOrCreateModeParams(TransportMode.ride).setMarginalUtilityOfTraveling(marginalUtilityOfTravllingRide); + config.scoring().getOrCreateModeParams(TransportMode.ride).setMarginalUtilityOfTraveling(marginalUtilityOfTravelingRide); prepareCommercialTrafficConfig(config);