RouteSet

public class RouteSet

RouteSet is a choice set of possible routes between an origin and a destination node.

Author:Milan Lovric

Constructors

RouteSet

public RouteSet(RoadNetwork roadNetwork)

Constructor.

Parameters:
  • roadNetwork – Road network.

Methods

addRoute

public void addRoute(Route route)

Adds a route to the choice set.

Parameters:
  • route – Route to be added.

addRouteWithoutAnyChecks

public void addRouteWithoutAnyChecks(Route route)

Adds a route to the choice set.

Parameters:
  • route – Route to be added.

addRouteWithoutValidityAndEndNodesCheck

public void addRouteWithoutValidityAndEndNodesCheck(Route route)

Adds a route to the choice set.

Parameters:
  • route – Route to be added.

addRouteWithoutValidityCheck

public void addRouteWithoutValidityCheck(Route route)

Adds a route to the choice set.

Parameters:
  • route – Route to be added.

calculatePathsizes

public void calculatePathsizes()

Calculate path sizes (also calculates route lengths if they had not been calculated before).

calculateProbabilities

public void calculateProbabilities()

Calculates choice probabilities using logit formula.

calculateUtilities

public void calculateUtilities(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)

Re-calculates utilities for all the routes.

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 the base year.
  • energyUnitCosts – Energy unit costs.
  • congestionCharges – Congestion charges.
  • params – Route choice parameters.

choose

public Route choose()

Chooses a route based on the probabilities.

Returns:Chosen route.

correctUtilityWithPathSize

public void correctUtilityWithPathSize(int routeIndex)

Corrects utility with path size for a particular route within the choice set.

Parameters:
  • routeIndex – index of the route (list element) within the choice set

getChoiceSet

public List<Route> getChoiceSet()

Getter method for the choice set.

Returns:Choice set (list of routes).

getDestinationNode

public DirectedNode getDestinationNode()
Returns:Destination node of the choice set.

getIndexOfRoute

public int getIndexOfRoute(Route route)

Gets the index of a route in the choice set.

Parameters:
  • route – The route which index is sought for.
Returns:

Route index.

getOriginNode

public DirectedNode getOriginNode()
Returns:Origin node of the choice set.

getPathsizes

public double[] getPathsizes()

Getter method for pathsizes.

Returns:Choice pathsizes.

getProbabilities

public double[] getProbabilities()

Getter method for choice probabilities.

Returns:Choice probabilities.

getProbabilitiesAsList

public ArrayList<Double> getProbabilitiesAsList()

Getter method for choice probabilities.

Returns:Choice probabilities.

getSize

public int getSize()
Returns:Size of the choice set (number of routes).

getUtilities

public ArrayList<Double> getUtilities()

Getter method for choice utilities.

Returns:Choice utilities.

printChoiceSet

public void printChoiceSet()

Prints the entire choice set.

printPathsizes

public void printPathsizes()

Prints pathsizes for the route set.

printProbabilities

public void printProbabilities()

Prints probabilities for the route set.

printStatistics

public void printStatistics()

Prints statistic for the route set (choice set size for each node pair).

printUtilities

public void printUtilities()

Prints utilities for the route set.