Commit 15915f22 authored by clivings's avatar clivings
Browse files

I made the change so that the if-loops assigning the pcus of the

different pravs and cars use the vehicle typs created in
FlowEfficiencyConfigurator. 
parent 4cfe724f
......@@ -23,6 +23,8 @@ public class AvFlowEfficiencyCalculator implements FlowEfficiencyCalculator{
// first get vehicle type and link type.
VehicleType vehicletype = vehicle.getType();
String linktype = (String) link.getAttributes().getAttribute("osm.way.highway");
//we discovered through an error message when testing this code that the Switzerland scenario has links that have no osm.way.highway classification.
//Thus we need to give them one to avoid a null error.
if (linktype == null){
linktype = "unclassified";
}
......@@ -82,11 +84,11 @@ public class AvFlowEfficiencyCalculator implements FlowEfficiencyCalculator{
// the PCU for car is our reference.
if(vehicletype.equals("carVehicleType")) {
if(vehicletype.equals(FlowEfficiencyConfigurator.CONVENTIONAL_VEHICLE_TYPE_ID)) {
flowEfficiency = pcu_car;
}
else if (vehicletype.equals("prav3VehicleType")) {
else if (vehicletype.equals(FlowEfficiencyConfigurator.PRAV3_ID)) {
if (linktype.equals("motorway")){
flowEfficiency = one/pcu_prav3_motorway;
......@@ -102,7 +104,7 @@ public class AvFlowEfficiencyCalculator implements FlowEfficiencyCalculator{
}
}
else if (vehicletype.equals("prav4VehicleType")){
else if (vehicletype.equals(FlowEfficiencyConfigurator.PRAV4_ID)){
if (linktype.equals("motorway")){
flowEfficiency = one/pcu_prav4_motorway;
......@@ -117,7 +119,7 @@ public class AvFlowEfficiencyCalculator implements FlowEfficiencyCalculator{
flowEfficiency = one/pcu_prav4_secondaryslow;
}
}
else {vehicletype.equals("prav5VehicleType");
else {vehicletype.equals(FlowEfficiencyConfigurator.PRAV5_ID);
if (linktype.equals("motorway")){
flowEfficiency = one/pcu_prav5_motorway;
......
Markdown is supported
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