Commit 607f308e authored by Sebastian Hörl's avatar Sebastian Hörl
Browse files

Fix cost bug

parent 73368c4d
......@@ -79,13 +79,6 @@ public class SharedAVConfigurator {
controller.addOverridingModule(new AVModule());
controller.addOverridingModule(new SharedAVModule());
controller.addOverridingModule(new ASTRAQSimModule());
if (sharedConfig.getUseCostCalculator()) {
double scalingFactor = sharedConfig.getCostCalculatorScalingFactor();
int horizon = sharedConfig.getCostCalculatorHorzion();
controller.addOverridingModule(new AVPricingModule(scalingFactor, horizon));
}
}
}
......
......@@ -14,11 +14,11 @@ public class OnlineSharedAVTravelCost implements SharedAVTravelCost {
@Override
public double getTravelCost(double distance_km, boolean isPooled) {
if (isJoint) {
return pricingListener.getPricePerKm(PriceType.JOINT);
return pricingListener.getPricePerKm(PriceType.JOINT) * distance_km;
} else if (isPooled) {
return pricingListener.getPricePerKm(PriceType.POOLED);
return pricingListener.getPricePerKm(PriceType.POOLED) * distance_km;
} else {
return pricingListener.getPricePerKm(PriceType.TAXI);
return pricingListener.getPricePerKm(PriceType.TAXI) * distance_km;
}
}
}
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