Commit 18ff9f48 authored by Sebastian Hörl's avatar Sebastian Hörl
Browse files

Add reduced PT prices for >= 2050

parent d1d1ce95
......@@ -72,7 +72,7 @@ public class RunASTRA2018002 {
boolean useOnlySignificant = cmd.getOption("use-only-significant").map(Boolean::parseBoolean).orElse(false);
controller.addOverridingModule(new DiscreteModeChoiceModule());
controller.addOverridingModule(
new SwissDiscreteModeChoiceModule(utilitySet, useRouteChoice, useOnlySignificant, cmd));
new SwissDiscreteModeChoiceModule(utilitySet, useRouteChoice, useOnlySignificant, cmd, year));
SharedAVConfigurator.configurePricing(controller);
// Run
......
......@@ -43,13 +43,15 @@ public class SwissDiscreteModeChoiceModule extends AbstractDiscreteModeChoiceExt
private final boolean onlySignificant;
private final CommandLine cmd;
private final int year;
public SwissDiscreteModeChoiceModule(UtilitySet utilitySet, boolean useRouteChoice, boolean onlySignificant,
CommandLine cmd) {
CommandLine cmd, int year) {
this.utilitySet = utilitySet;
this.useRouteChoice = useRouteChoice;
this.onlySignificant = onlySignificant;
this.cmd = cmd;
this.year = year;
}
@Override
......@@ -93,7 +95,7 @@ public class SwissDiscreteModeChoiceModule extends AbstractDiscreteModeChoiceExt
@Provides
@Singleton
public CostModel provideCostModel(SwissUtilityParameters parameters, SharedAVTravelCost sharedCost) {
return new CostModel(parameters.costs, sharedCost);
return new CostModel(parameters.costs, sharedCost, year);
}
@Provides
......
......@@ -7,10 +7,12 @@ import ch.ethz.matsim.projects.astra_2018_002.shared_av.pricing.SharedAVTravelCo
public class CostModel {
private final CostParameters parameters;
private final SharedAVTravelCost shared;
private final int year;
public CostModel(CostParameters parameters, SharedAVTravelCost shared) {
public CostModel(CostParameters parameters, SharedAVTravelCost shared, int year) {
this.parameters = parameters;
this.shared = shared;
this.year = year;
}
public double calculateCarTravelCost(double distance_km) {
......@@ -43,6 +45,10 @@ public class CostModel {
double fullCost = Math.max(parameters.ptCostMinimum_CHF,
parameters.ptCostPerKm_CHF * tripVariables.inVehicleDistance_km);
if (year >= 2050) {
fullCost *= 0.6; // Scaling for automation
}
if (personVariables.hasHalbtaxSubscription) {
return fullCost * 0.5;
......
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