Commit 1717b4a7 authored by Sebastian Hörl's avatar Sebastian Hörl
Browse files

Add parameter for cost reduction

parent fbd2c1a8
......@@ -28,7 +28,7 @@ public class RunASTRA2018002 {
CommandLine cmd = new CommandLine.Builder(args) //
.requireOptions("config-path", "year", "ASTRA_Scenario") //
.allowOptions("use-route-choice", "use-only-significant", "utility-parameters", "crossing-penalty",
"model") //
"model", "pt-cost-reduction") //
.allowPrefixes(SwissDiscreteModeChoiceModule.COMMAND_LINE_PREFIX) //
.build();
......
......@@ -95,7 +95,8 @@ public class SwissDiscreteModeChoiceModule extends AbstractDiscreteModeChoiceExt
@Provides
@Singleton
public CostModel provideCostModel(SwissUtilityParameters parameters, SharedAVTravelCost sharedCost) {
return new CostModel(parameters.costs, sharedCost, year);
boolean usePtCostReduction = cmd.getOption("pt-cost-reduction").map(Boolean::parseBoolean).orElse(true);
return new CostModel(parameters.costs, sharedCost, year, usePtCostReduction);
}
@Provides
......
......@@ -8,11 +8,13 @@ public class CostModel {
private final CostParameters parameters;
private final SharedAVTravelCost shared;
private final int year;
private final boolean usePtCostReduction;
public CostModel(CostParameters parameters, SharedAVTravelCost shared, int year) {
public CostModel(CostParameters parameters, SharedAVTravelCost shared, int year, boolean usePtCostReduction) {
this.parameters = parameters;
this.shared = shared;
this.year = year;
this.usePtCostReduction = usePtCostReduction;
}
public double calculateCarTravelCost(double distance_km) {
......@@ -46,7 +48,7 @@ public class CostModel {
double fullCost = Math.max(parameters.ptCostMinimum_CHF,
parameters.ptCostPerKm_CHF * tripVariables.inVehicleDistance_km);
if (year >= 2050) {
if (year >= 2050 && usePtCostReduction) {
fullCost *= 0.6; // Scaling for automation
}
......
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