Commit 675afc3a authored by clivings's avatar clivings
Browse files

started creating the AvFlowEfficiencyCalculator. Lot's of TODOs left.

parent e6abffff
package ch.ethz.matsim.projects.astra_2018_002.flow_efficiency;
import org.matsim.api.core.v01.network.Link;
import org.matsim.vehicles.Vehicle;
import org.matsim.vehicles.VehicleType;
public class AvFlowEfficiencyCalculator implements FlowEfficiencyCalculator{
private double flowEfficiency;
public AvFlowEfficiencyCalculator(double flowEfficiency) {
this.flowEfficiency = flowEfficiency;
}
@Override
public double calculateFlowEfficiency(Vehicle vehicle, Link link) {
VehicleType vehicletype = vehicle.getType();
String linktype = (String) link.getAttributes().getAttribute("osm.way.highway");
// define the pcu for each vehicle type and link type.
// TODO: make the code look for these pcus in the config file, to improve usability
final Double pcu_car = 1.00;
if(vehicletype.equals("carVehicleType")) {
flowEfficiency = pcu_car;
}
else if (vehicletype.equals("prav3VehicleType")) {
if (linktype.equals("motorway")){
//TODO: put all the else ifs to cover the different road categories
}
}
else if (vehicletype.equals("prav4VehicleType")){
//TODO: put all the else ifs to cover the different road categories
}
else {vehicletype.equals("prav5VehicleType");
//TODO: put all the else ifs to cover the different road categories
}//TODO: eventually include freight and small busses and taxis (since we are defining vehicle type by mode, correct?)
return flowEfficiency;
}
}
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