Commit 096c7c95 authored by Sebastian Hörl's avatar Sebastian Hörl
Browse files

Fix cost elasticity

parent 4cfe724f
...@@ -252,7 +252,7 @@ public abstract class BaseUtilityEstimator extends AbstractTripRouterEstimator { ...@@ -252,7 +252,7 @@ public abstract class BaseUtilityEstimator extends AbstractTripRouterEstimator {
tripVariables.travelDistance_km = totalTravelDistance / 1000.0; tripVariables.travelDistance_km = totalTravelDistance / 1000.0;
tripVariables.crowflyDistance_km = CoordUtils.calcEuclideanDistance(trip.getOriginActivity().getCoord(), tripVariables.crowflyDistance_km = CoordUtils.calcEuclideanDistance(trip.getOriginActivity().getCoord(),
trip.getDestinationActivity().getCoord()); trip.getDestinationActivity().getCoord()) * 1e-3;
tripVariables.originHomeDistance_km = CoordUtils.calcEuclideanDistance(personVariables.homeLocation, tripVariables.originHomeDistance_km = CoordUtils.calcEuclideanDistance(personVariables.homeLocation,
trip.getOriginActivity().getCoord()) * 1e-3; trip.getOriginActivity().getCoord()) * 1e-3;
...@@ -322,7 +322,7 @@ public abstract class BaseUtilityEstimator extends AbstractTripRouterEstimator { ...@@ -322,7 +322,7 @@ public abstract class BaseUtilityEstimator extends AbstractTripRouterEstimator {
tripVariables.travelDistance_km = travelDistance_km; tripVariables.travelDistance_km = travelDistance_km;
tripVariables.crowflyDistance_km = CoordUtils.calcEuclideanDistance(trip.getOriginActivity().getCoord(), tripVariables.crowflyDistance_km = CoordUtils.calcEuclideanDistance(trip.getOriginActivity().getCoord(),
trip.getDestinationActivity().getCoord()); trip.getDestinationActivity().getCoord()) * 1e-3;
return estimateCarTrip(trip, personVariables, tripVariables); return estimateCarTrip(trip, personVariables, tripVariables);
} }
......
...@@ -11,11 +11,11 @@ public class CostModel { ...@@ -11,11 +11,11 @@ public class CostModel {
} }
public double calculateCarTravelCost(double distance_km) { public double calculateCarTravelCost(double distance_km) {
return parameters.carCostPerKm * distance_km; return parameters.carCostPerKm_CHF * distance_km;
} }
public double calculateAvTravelCost(double distance_km) { public double calculateAvTravelCost(double distance_km) {
return parameters.avCostPerKm * distance_km; return parameters.avCostPerKm_CHF * distance_km;
} }
public double calculatePtTravelCost(PersonVariables personVariables, TripVariablesPt tripVariables) { public double calculatePtTravelCost(PersonVariables personVariables, TripVariablesPt tripVariables) {
...@@ -34,9 +34,13 @@ public class CostModel { ...@@ -34,9 +34,13 @@ public class CostModel {
} }
} }
double fullCost = Math.max(parameters.ptCostMinimum, double fullCost = Math.max(parameters.ptCostMinimum_CHF,
parameters.ptCostPerKm * tripVariables.inVehicleDistance_km); parameters.ptCostPerKm_CHF * tripVariables.inVehicleDistance_km);
return personVariables.hasHalbtaxSubscription ? 0.5 * fullCost : fullCost; if (personVariables.hasHalbtaxSubscription) {
return fullCost * 0.5;
} else {
return fullCost;
}
} }
} }
package ch.ethz.matsim.projects.astra_2018_002.mode_choice.cost; package ch.ethz.matsim.projects.astra_2018_002.mode_choice.cost;
public class CostParameters { public class CostParameters {
public double carCostPerKm = 0.26; public double carCostPerKm_CHF = 0.26;
public double avCostPerKm = 0.4; public double avCostPerKm_CHF = 0.4;
public double ptCostPerKm = 0.8; public double ptCostPerKm_CHF = 0.6;
public double ptCostMinimum = 2.7; public double ptCostMinimum_CHF = 2.7;
public double ptRegionalRadius_km = 15.0; public double ptRegionalRadius_km = 15.0;
} }
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment