Route¶
-
public class
Route
¶ Route is a sequence of directed edges with a choice utility.
Author: Milan Lovric
Constructors¶
Route¶
-
public
Route
(RoadNetwork roadNetwork)¶
Route¶
-
public
Route
(RoadPath path, RoadNetwork roadNetwork)¶ Construtor from a given path.
Parameters: - path – A path from which to construct a route.
- roadNetwork – Road network.
Methods¶
addEdge¶
-
public boolean
addEdge
(DirectedEdge edge)¶ Adds a directed edge to the end of the current route.
Parameters: - edge – Directed edge to be added.
Returns: true if edge addition was successful, false otherwise.
addEdgeWithoutValidityCheck¶
-
public void
addEdgeWithoutValidityCheck
(DirectedEdge edge)¶ Adds a directed edge to the end of the current route.
Parameters: - edge – Directed edge to be added.
addEdgeWithoutValidityCheck¶
-
public void
addEdgeWithoutValidityCheck
(int edgeID)¶ Adds a directed edge to the end of the current route.
Parameters: - edgeID – Directed edge to be added.
calculateConsumption¶
-
public Map<EnergyType, Double>
calculateConsumption
(VehicleType vht, EngineType et, double[] linkTravelTime, Map<VehicleType, Map<EngineType, Map<WebTAG, Double>>> energyConsumptionParameters, Map<VehicleType, Map<EngineType, Double>> relativeFuelEfficiency)¶ Calculates energy consumption of the route.
Parameters: - vht – Vehicle type.
- et – Energy type.
- linkTravelTime – Link travel time.
- energyConsumptionParameters – Base year energy consumption parameters.
- relativeFuelEfficiency – Relative fuel efficiency compared to base year.
Returns: Consumption for each type.
calculateCost¶
-
public void
calculateCost
(VehicleType vht, EngineType et, TimeOfDay tod, double[] linkTravelTime, Map<VehicleType, Map<EngineType, Map<WebTAG, Double>>> energyConsumptionParameters, Map<VehicleType, Map<EngineType, Double>> relativeFuelEfficiency, Map<EnergyType, Double> energyUnitCosts, List<PricingPolicy> congestionCharges)¶ Calculates the cost of the route.
Parameters: - vht – Vehicle type.
- et – Engine type.
- tod – Time of day.
- linkTravelTime – Link travel times.
- energyConsumptionParameters – Base year energy consumption parameters.
- relativeFuelEfficiency – Relative fuel efficiency (compared to base year).
- energyUnitCosts – Energy unit costs.
- congestionCharges – Congestion charges.
calculateTravelTime¶
-
public void
calculateTravelTime
(double[] linkTravelTime, double avgIntersectionDelay)¶ Calculates the route travel time based on link travel times.
Parameters: - linkTravelTime – Link travel times.
- avgIntersectionDelay – Average intersection delay (in minutes).
calculateUtility¶
-
public void
calculateUtility
(VehicleType vht, EngineType et, TimeOfDay tod, double[] linkTravelTime, Map<VehicleType, Map<EngineType, Map<WebTAG, Double>>> energyConsumptionParameters, Map<VehicleType, Map<EngineType, Double>> relativeFuelEfficiency, Map<EnergyType, Double> energyUnitCosts, List<PricingPolicy> congestionCharges, Map<RouteChoiceParams, Double> params)¶ Calculates the utility of the route.
Parameters: - vht – Vehicle type.
- et – Engine type.
- tod – Time of day.
- linkTravelTime – Link travel times.
- energyConsumptionParameters – Energy consumption parameters (A, B, C, D) for a combination of vehicle type and engine type.
- relativeFuelEfficiency – Relative fuel efficiency compared to the base year.
- energyUnitCosts – Energy unit costs.
- congestionCharges – Congestion charges.
- params – Route choice parameters.
contains¶
-
public boolean
contains
(Edge edge)¶ Checks if route contains the edge.
Parameters: - edge – Edge object.
Returns: True if route contains the edge.
contains¶
-
public boolean
contains
(int edgeID)¶ Checks if route contains the edge.
Parameters: - edgeID – Edge id.
Returns: True if route contains the edge.
getDestinationNode¶
-
public DirectedNode
getDestinationNode
()¶ Getter method for destination node.
Returns: Destination node.
getEdges¶
-
public TIntArrayList
getEdges
()¶ Getter method for the list of edges.
Returns: List of edge IDs.
getFormattedString¶
getFormattedStringEdgeIDsOnly¶
getNumberOfIntersections¶
-
public int
getNumberOfIntersections
()¶ Getter method for number of intersections.
Returns: Number of intersections.
getOriginNode¶
-
public DirectedNode
getOriginNode
()¶ Getter method for route origin node.
Returns: Origin node.
getRoadNetwork¶
-
public RoadNetwork
getRoadNetwork
()¶ Getter method for the road network.
Returns: Road network.
isValid¶
-
public boolean
isValid
()¶ Checks if route is valid (successive edges in the route are connected in a directional way).
Returns: True if route is valid.