RoadNetworkAssignment

public class RoadNetworkAssignment

Network assignment of origin-destination flows.

Author:Milan Lovric

Fields

alpha

public final double alpha

assignmentFraction

public final double assignmentFraction

averageAccessEgressSpeedCar

public final double averageAccessEgressSpeedCar

averageAccessEgressSpeedFreight

public final double averageAccessEgressSpeedFreight

averageIntersectionDelay

public final double averageIntersectionDelay

baseYear

public final int baseYear

betaARoad

public final double betaARoad

betaMRoad

public final double betaMRoad

flagAStarIfEmptyRouteSet

public final boolean flagAStarIfEmptyRouteSet

flagIncludeAccessEgress

public final boolean flagIncludeAccessEgress

flagIntrazonalAssignmentReplacement

public final boolean flagIntrazonalAssignmentReplacement

flagUseRouteChoiceModel

public final boolean flagUseRouteChoiceModel

interzonalTopNodes

public final int interzonalTopNodes

maximumCapacityARoad

public final int maximumCapacityARoad

maximumCapacityMRoad

public final int maximumCapacityMRoad

nodesProbabilityWeighting

public final double nodesProbabilityWeighting

nodesProbabilityWeightingFreight

public final double nodesProbabilityWeightingFreight

peakHourPercentage

public final double peakHourPercentage

topTemproNodes

public final int topTemproNodes

volumeToFlowFactor

public final double volumeToFlowFactor

Constructors

RoadNetworkAssignment

public RoadNetworkAssignment(RoadNetwork roadNetwork, Zoning zoning, Map<EnergyType, Double> energyUnitCosts, Map<EnergyType, Double> unitCO2Emissions, Map<VehicleType, Map<EngineType, Double>> engineTypeFractions, Map<VehicleType, Double> fractionsAV, Map<VehicleType, Double> vehicleTypeToPCU, Map<VehicleType, Map<EngineType, Map<WebTAG, Double>>> energyConsumptionParams, Map<VehicleType, Map<EngineType, Double>> relativeFuelEfficiencies, Map<TimeOfDay, Double> timeOfDayDistribution, Map<VehicleType, Map<TimeOfDay, Double>> timeOfDayDistributionFreight, Map<TimeOfDay, Map<Integer, Double>> defaultLinkTravelTime, HashMap<String, Double> areaCodeProbabilities, HashMap<String, Double> workplaceZoneProbabilities, List<PricingPolicy> congestionCharges, Properties params)
Parameters:
  • roadNetwork – Road network.
  • zoning – Zoning system.
  • energyUnitCosts – Energy unit costs.
  • unitCO2Emissions – Unit CO2 emissions.
  • engineTypeFractions – Market shares of different engine/fuel types.
  • fractionsAV – Fraction of autonomous vehicles for different vehicle types.
  • vehicleTypeToPCU – Vehicle to PCU conversion.
  • energyConsumptionParams – Base fuel consumption rates.
  • relativeFuelEfficiencies – Relative fuel efficiencies (compared to base year).
  • timeOfDayDistribution – Time of day distribution.
  • timeOfDayDistributionFreight – Time of day distribution for freight.
  • defaultLinkTravelTime – Default link travel times.
  • areaCodeProbabilities – Probabilities of trips starting/ending in each census output area.
  • workplaceZoneProbabilities – Probabilities of freight trips starting/ending in each census output area.
  • congestionCharges – Congestion charges.
  • params – Assignment parameters.

Methods

assignFlowsAndUpdateLinkTravelTimes

public void assignFlowsAndUpdateLinkTravelTimes(AssignableODMatrix passengerODM, FreightMatrix freightODM, RouteSetGenerator rsg, Properties props, double weight)

Assigns passenger and freight origin-destination matrix to the road network using the fastest path based on the current values in the linkTravelTime field. Finally, updates link travel times using weighted averaging.

Parameters:
  • passengerODM – Passenger origin-destination matrix.
  • freightODM – Freight origin-destination matrix.
  • rsg – Route set generator to store fastest routes generated during the assignment (but could be pregenerated too).
  • props – Parameters from the config file.
  • weight – Weighting parameter.

assignFlowsAndUpdateLinkTravelTimes

public void assignFlowsAndUpdateLinkTravelTimes(AssignableODMatrix passengerODM, FreightMatrix freightODM, RouteSetGenerator rsg, Zoning zoning, Properties params, double weight)

Assigns passenger and freight origin-destination matrix to the road network using specification in the config file. Finally, updates link travel times using weighted averaging.

Parameters:
  • passengerODM – Passenger origin-destination matrix.
  • freightODM – Freight origin-destination matrix.
  • rsg – Route set generator object with routes to be used for the assignment (if route choice used) or an object in which to store routes (if routing used).
  • zoning – Zoning system (necessary for ‘tempro’ and ‘combined’ assignment types).
  • params – Parameters from the config file.
  • weight – Weighting parameter.

assignFlowsAndUpdateLinkTravelTimesIterated

public void assignFlowsAndUpdateLinkTravelTimesIterated(AssignableODMatrix passengerODM, FreightMatrix freightODM, RouteSetGenerator rsg, Properties props, double weight, int iterations)

Iterates assignment and travel time update a fixed number of times.

Parameters:
  • passengerODM – Passenger origin-destination matrix.
  • freightODM – Freight origin-destination matrix.
  • rsg – Route set generator object with routes to be used for the assignment (if route choice used) or an object in which to store routes (if routing used).
  • props – Properties.
  • weight – Weighting parameter.
  • iterations – Number of iterations.

assignFlowsAndUpdateLinkTravelTimesIterated

public void assignFlowsAndUpdateLinkTravelTimesIterated(AssignableODMatrix passengerODM, FreightMatrix freightODM, RouteSetGenerator rsg, Zoning zoning, Properties params, double weight, int iterations)

Iterates assignment and travel time update a fixed number of times.

Parameters:
  • passengerODM – Passenger origin-destination matrix.
  • freightODM – Freight origin-destination matrix.
  • rsg – Route set generator object with routes to be used for the assignment (if route choice used) or an object in which to store routes (if routing used).
  • zoning – Zoning system (necessary for ‘tempro’ and ‘combined’ assignment types).
  • params – Parameters from the config file.
  • weight – Weighting parameter.
  • iterations – Number of iterations.

assignFreightFlowsHourlyRouting

public void assignFreightFlowsHourlyRouting(FreightMatrix freightMatrix, Map<TimeOfDay, RouteSetGenerator> routeStorage, Properties props)

Assigns freight origin-destination matrix to the road network using A-star routing. Zone ID ranges from the BYFM DfT model:

  • England: 1 - 867
  • Wales: 901 - 922
  • Scotland: 1001 - 1032
  • Freight airports: 1111 - 1115
  • Major distribution centres: 1201 - 1256
  • Freight ports: 1301 - 1388
Parameters:
  • freightMatrix – Freight origin-destination matrix.
  • routeStorage – Route storage (stores fastest routes separately for each hour of the day).
  • props – Properties.

assignFreightFlowsRouteChoice

public void assignFreightFlowsRouteChoice(FreightMatrix freightMatrix, RouteSetGenerator rsg, Properties routeChoiceParameters)

Assigns freight origin-destination matrix to the road network using a route choice model and pre-generated routes. Zone ID ranges from the BYFM DfT model:

  • England: 1 - 867
  • Wales: 901 - 922
  • Scotland: 1001 - 1032
  • Freight airports: 1111 - 1115
  • Major distribution centres: 1201 - 1256
  • Freight ports: 1301 - 1388
Parameters:
  • freightMatrix – Freight origin-destination matrix.
  • rsg – Route set generator containing the routes.
  • routeChoiceParameters – Route choice parameters.

assignFreightFlowsRouting

public void assignFreightFlowsRouting(FreightMatrix freightMatrix, RouteSetGenerator rsg, Properties props)

Assigns freight origin-destination matrix to the road network using A-star routing. Zone ID ranges from the BYFM DfT model:

  • England: 1 - 867
  • Wales: 901 - 922
  • Scotland: 1001 - 1032
  • Freight airports: 1111 - 1115
  • Major distribution centres: 1201 - 1256
  • Freight ports: 1301 - 1388
Parameters:
  • freightMatrix – Freight origin-destination matrix.
  • rsg – Route storage (reduces the number of routing calls).
  • props – Properties.

assignPassengerFlowsHourlyRouting

public void assignPassengerFlowsHourlyRouting(AssignableODMatrix passengerODM, Map<TimeOfDay, RouteSetGenerator> routeStorage, Properties props)

Assigns passenger origin-destination matrix to the road network using A-star routing algorithm. Calculates the fastest path based on the current values in the linkTravlinkTravelTimePerTimeOfDayelTime instance field, which means different fastest routes may be used in different hours of the day.

Parameters:
  • passengerODM – Passenger origin-destination matrix with flows to be assigned.
  • routeStorage – Stores routes for each hour of the day separately.
  • props – Properties.

assignPassengerFlowsRouteChoice

public void assignPassengerFlowsRouteChoice(AssignableODMatrix passengerODM, RouteSetGenerator rsg, Properties routeChoiceParameters)

Assigns passenger origin-destination matrix to the road network. Uses the route choice and pre-generated paths.

Parameters:
  • passengerODM – Passenger origin-destination matrix.
  • rsg – Route set generator containing the routes.
  • routeChoiceParameters – Route choice parameters.

assignPassengerFlowsRouteChoiceTempro

public void assignPassengerFlowsRouteChoiceTempro(AssignableODMatrix passengerODM, Zoning zoning, RouteSetGenerator rsg, Properties routeChoiceParameters)

Assigns passenger origin-destination matrix to the road network using the Tempro zoning system. Uses the route choice and pre-generated paths.

Parameters:
  • passengerODM – Passenger origin-destination matrix with flows to be assigned.
  • zoning – Contains Tempro zone information.
  • rsg – Route set generator containing the routes.
  • routeChoiceParameters – Route choice parameters.

assignPassengerFlowsRouteChoiceTemproDistanceBased

public void assignPassengerFlowsRouteChoiceTemproDistanceBased(AssignableODMatrix passengerODM, Zoning zoning, RouteSetGenerator rsg, Properties routeChoiceParameters)

Assigns passenger origin-destination matrix to the road network using the combined Tempro/LAD zoning system. When Tempro zones a farther than a distance threshold, it seeks for the nodes within LAD zones that have a route set. Uses the route choice and pre-generated paths (after a distance threshold, there will be less inter-zonal routes).

Parameters:
  • passengerODM – Passenger origin-destination matrix with flows to be assigned.
  • zoning – Contains Tempro zone information.
  • rsg – Route set generator containing the routes.
  • routeChoiceParameters – Route choice parameters.

assignPassengerFlowsRouting

public void assignPassengerFlowsRouting(AssignableODMatrix passengerODM, RouteSetGenerator rsg, Properties props)

Assigns passenger origin-destination matrix to the road network using A-star routing algorithm. Calculates the fastest path based on the current values in the linkTravlinkTravelTimePerTimeOfDayelTime instance field, however only one route will be used for the same OD pair (the route that was calculated first).

Parameters:
  • passengerODM – Passenger origin-destination matrix with flows to be assigned.
  • rsg – To store routes during the assignment (reduces the number of routing calls).
  • props – Routing parameters.

assignPassengerFlowsTempro

public void assignPassengerFlowsTempro(AssignableODMatrix passengerODM, Zoning zoning, RouteSetGenerator rsg, Properties props)

Assigns passenger origin-destination matrix to the road network using the Tempro zoning system. Calculates the fastest path based on the current values in the linkTravelTime instance field.

Parameters:
  • passengerODM – Passenger origin-destination matrix with flows to be assigned.
  • zoning – Contains Tempro zone information.
  • rsg – Route set (here new routes will be stored).
  • props – Properties.

calculateAbsDifferenceCarCounts

public HashMap<Integer, Integer> calculateAbsDifferenceCarCounts()

Calculates absolute differences between car volumes and traffic counts. For combined counts, takes the average of two absolute differences.

Returns:Absolute differences between car volumes and traffic counts.

calculateAssignedFreightMatrix

public FreightMatrix calculateAssignedFreightMatrix()

Calculate freight OD matrix from trip list.

Returns:Freight matrix.

calculateAssignedODMatrix

public ODMatrixMultiKey calculateAssignedODMatrix()

Calculate assigned OD matrix from trip list.

Returns:ODMatrixMultiKey OD matrix.

calculateCO2Emissions

public HashMap<String, Double> calculateCO2Emissions()

Calculates total CO2 emissions (in kg) for each type of passenger and freight vehicle.

Returns:Total consumption for each engine type.

calculateCarEnergyConsumptions

public Map<EnergyType, Double> calculateCarEnergyConsumptions()

Calculates total energy consumption for each car/AV energy type (in litres for fuels and in kWh for electricity).

Returns:Total consumption for each energy type.

calculateCostSkimMatrix

public SkimMatrix calculateCostSkimMatrix()

Calculates cost skim matrix (zone-to-zone financial costs).

Returns:Inter-zonal skim matrix (cost).

calculateCostSkimMatrixFreight

public SkimMatrixFreight calculateCostSkimMatrixFreight()

Calculates cost skim matrix (zone-to-zone financial costs) for freight.

Returns:Inter-zonal skim matrix (cost).

calculateDifferenceCarCounts

public HashMap<Integer, Integer> calculateDifferenceCarCounts()

Calculates differences between car volumes and traffic counts. For combined counts, takes the average of the two differences.

Returns:Differences between car volumes and traffic counts.

calculateDirectionAveragedAbsoluteDifferenceCarCounts

public HashMap<Integer, Double> calculateDirectionAveragedAbsoluteDifferenceCarCounts()

Calculates absolute differences between car volumes and traffic counts averaged for both directions. For combined counts, takes the average of two absolute differences.

Returns:Direction averaged absolute differences between car volumes and traffic counts.

calculateDirectionAveragedPeakLinkCapacityUtilisation

public double[] calculateDirectionAveragedPeakLinkCapacityUtilisation()

Calculate peak-hour link capacity utilisation (%) averaged by two directions.

Returns:Peak-hour link capacity utilisation.

calculateDistanceSkimMatrix

public SkimMatrix calculateDistanceSkimMatrix()

Updates cost skim matrix (zone-to-zone distances).

Returns:Inter-zonal skim matrix (distance).

calculateDistanceSkimMatrixFreight

public SkimMatrixFreight calculateDistanceSkimMatrixFreight()

Updates cost skim matrix (zone-to-zone distances) for freight.

Returns:Inter-zonal skim matrix (distance).

calculateDistanceSkimMatrixTempro

public SkimMatrix calculateDistanceSkimMatrixTempro()

Updates cost skim matrix (zone-to-zone distances).

Parameters:
  • zoning – Zoning system.
Returns:

Inter-zonal skim matrix (distance).

calculateEnergyConsumptions

public Map<EnergyType, Double> calculateEnergyConsumptions()

Calculates total energy consumption for each energy type of passenger cars and freight vehicles (in litres for fuels and in kWh for electricity).

Returns:Total consumption for each engine type.

calculateEnergyConsumptionsPerVehicleType

public Map<VehicleType, Map<EnergyType, Double>> calculateEnergyConsumptionsPerVehicleType()

Calculates total energy consumptions per vehicle type.

Returns:Total consumption for each energy type.

calculateFreightEnergyConsumptions

public Map<EnergyType, Double> calculateFreightEnergyConsumptions()

Calculates total energy consumption for each freight vehicle engine type (in litres for fuels and in kWh for electricity).

Returns:Total consumption for each energy type.

calculateFreightLADTripEnds

public HashMap<String, Integer> calculateFreightLADTripEnds()

Calculates the number of freight trips ending in a LAD.

Returns:Number of trips.

calculateFreightLADTripStarts

public HashMap<String, Integer> calculateFreightLADTripStarts()

Calculates the number of freight trips starting in a LAD.

Returns:Number of trips.

calculateGEHStatisticForCarCounts

public Double[] calculateGEHStatisticForCarCounts(double volumeToFlowFactor)

Calculates GEH statistic for simulated and observed hourly car flows. For combined counts, combines the volumes on two road directions. Two obtain hourly flows, multiplies daily link volumes (and traffic counts) with volumeToFlowFactor. The formula is taken from WebTAG Unit M3.1.

Parameters:
  • volumeToFlowFactor – Converts daily vehicle volume to hourly flow (e.g. 0.1 for peak flow; 1/24.0 for daily average)
Returns:

GEH statistic for simulated and observed hourly car flows.

calculateGEHStatisticForFreightCounts

public Map<VehicleType, Double[]> calculateGEHStatisticForFreightCounts(double volumeToFlowFactor)

Calculates GEH statistic for simulated and observed hourly freight vehicle flows. For combined counts, combines the volumes on two road directions. Two obtain hourly flows, multiplies daily link volumes (and traffic counts) with volumeToFlowFactor. The formula is taken from WebTAG Unit M3.1.

Parameters:
  • volumeToFlowFactor – Converts daily vehicle volume to hourly flow (e.g. 0.1 for peak flow; 1/24.0 for daily average)
Returns:

GEH statistic for simulated and observed hourly freight vehicle flows, per vehicle type.

calculateGEHStatisticPerTimeOfDay

public Double[] calculateGEHStatisticPerTimeOfDay(TimeOfDay hour)

Calculates GEH statistic for simulated and observed hourly flow. It uses linkVolumesInPCUPerTimeOfDay, so make sure only car flows have been assigned. For combined counts, takes the average of the two differences. The formula is taken from WebTAG Unit M3.1.

Parameters:
  • hour – Hour for which to calculate GEH statistics.
Returns:

GEH statistic for simulated and observed hourly car flows.

calculateLADTripEnds

public HashMap<String, Integer> calculateLADTripEnds()

Calculates the number of passenger (car/AV) trips ending in a LAD.

Returns:Number of trips.

calculateLADTripStarts

public HashMap<String, Integer> calculateLADTripStarts()

Calculates the number of passenger (car/AV) trips starting in a LAD.

Returns:Number of trips.

calculateLinkVolumeInPCU

public double[] calculateLinkVolumeInPCU(List<Trip> tripList)

Calculates daily link volumes in PCU.

Parameters:
  • tripList – Trip list.
Returns:

Map of link volumes in PCU.

calculateLinkVolumeInPCUPerTimeOfDay

public Map<TimeOfDay, double[]> calculateLinkVolumeInPCUPerTimeOfDay(List<Trip> tripList)

Calculates link volumes in PCU per time of day.

Parameters:
  • tripList – Trip list.
Returns:

Link volumes in PCU per time of day

calculateLinkVolumePerVehicleType

public Map<VehicleType, int[]> calculateLinkVolumePerVehicleType(List<Trip> tripList)

Calculates daily link volumes per vehicle type.

Parameters:
  • tripList – Trip list.
Returns:

Map of link volumes per vehicle type.

calculateMADforExpandedSimulatedVolumes

public double calculateMADforExpandedSimulatedVolumes(double expansionFactor)

Calculate prediction error (mean absolute deviation for expanded simulated volumes and observed traffic counts).

Parameters:
  • expansionFactor – Expansion factor expands simulated volumes.
Returns:

Mean absolute deviation.

calculateODCarEnergyConsumptions

public Map<EnergyType, SkimMatrix> calculateODCarEnergyConsumptions()

Calculates origin-destination energy consumption for car vehicles for each energy type (in litres/kg for fuels and in kWh for electricity).

Returns:Zonal consumption for each energy type.

calculatePeakLinkCapacityUtilisation

public double[] calculatePeakLinkCapacityUtilisation()

Calculate peak-hour link capacity utilisation (capacity / max. capacity).

Returns:Peak-hour link capacity utilisation [%].

calculatePeakLinkDensities

public double[] calculatePeakLinkDensities()

Calculate peak-hour link densities (PCU/lane/km/hr).

Returns:Peak-hour link densities.

calculatePeakLinkPointCapacities

public double[] calculatePeakLinkPointCapacities()

Calculate peak-hour link point capacities (PCU/lane/hr).

Returns:Peak-hour link point capacities.

calculateRMSNforExpandedSimulatedVolumes

public double calculateRMSNforExpandedSimulatedVolumes(double expansionFactor)

Calculate prediction error (RMSN for expanded simulated volumes and observed traffic counts).

Parameters:
  • expansionFactor – Expansion factor expands simulated volumes.
Returns:

Normalised root mean square error.

calculateRMSNforFreightCounts

public Map<VehicleType, Double> calculateRMSNforFreightCounts()

Calculate prediction error (RMSN for for simulated freight volumes and observed traffic counts).

Returns:Normalised root mean square errors for each freight vehicle separately.

calculateRMSNforSimulatedVolumes

public double calculateRMSNforSimulatedVolumes()

Calculate prediction error (RMSN for simulated volumes and observed traffic counts).

Returns:Normalised root mean square error.

calculateTimeSkimMatrix

public SkimMatrix calculateTimeSkimMatrix()

Calculated travel time skim matrix (zone-to-zone travel times).

Returns:Inter-zonal skim matrix (time).

calculateTimeSkimMatrixFreight

public SkimMatrixFreight calculateTimeSkimMatrixFreight()

Calculated travel time skim matrix (zone-to-zone travel times) for freight.

Returns:Inter-zonal skim matrix (time).

calculateZonalCarEnergyConsumptions

public Map<EnergyType, HashMap<String, Double>> calculateZonalCarEnergyConsumptions(double originZoneEnergyWeight)

Calculates spatial energy consumption for car vehicles for each energy type (in litres/kg for fuels and in kWh for electricity).

Parameters:
  • originZoneEnergyWeight – Percentage of energy consumption assigned to origin zone (the rest assigned to destination zone).
Returns:

Zonal consumption for each energy type.

calculateZonalTemporalTripStartsForElectricVehicles

public HashMap<String, Map<TimeOfDay, Integer>> calculateZonalTemporalTripStartsForElectricVehicles(VehicleType vht)

Calculates the number of electric vehicles (BEV, PHEV) of a given type (CAR, VAN, RIGID, ARTIC), starting in each LAD in each hour.

Parameters:
  • vht – Vehicle type (calculation will include the autonomous version of the same vehicle type too).
Returns:

Number of trips.

calculateZonalTemporalTripStartsForHydrogenVehicles

public HashMap<String, Map<TimeOfDay, Integer>> calculateZonalTemporalTripStartsForHydrogenVehicles(VehicleType vht)

Calculates the number of hydrogen vehicles (ICE_H2, FCEV_H2) of a given type (CAR, VAN, RIGID, ARTIC), starting in each LAD in each hour.

Parameters:
  • vht – Vehicle type (calculation will include the autonomous version of the same vehicle type too).
Returns:

Number of trips.

calculateZonalTemporalVehicleElectricityConsumptions

public HashMap<String, Map<TimeOfDay, Double>> calculateZonalTemporalVehicleElectricityConsumptions(VehicleType vht, double originZoneEnergyWeight)

Calculates zonal (per LAD) and temporal (per hour) electricity consumption for a given vehicle type (in kWh).

Parameters:
  • vht – Vehicle type (e.g., if CAR provided, CAR_AV consumption will be added too).
  • originZoneEnergyWeight – Percentage of energy consumption assigned to origin zone (the rest assigned to destination zone).
Returns:

Electricity consumption per zone and time of day.

calculateZonalTemporalVehicleHydrogenConsumptions

public HashMap<String, Map<TimeOfDay, Double>> calculateZonalTemporalVehicleHydrogenConsumptions(VehicleType vht, double originZoneEnergyWeight)

Calculates zonal (per LAD) and temporal (per hour) hydrogen consumption for a given vehicle type (in kg).

Parameters:
  • vht – Vehicle type (e.g., if CAR provided, CAR_AV consumption will be added too).
  • originZoneEnergyWeight – Percentage of energy consumption assigned to origin zone (the rest assigned to destination zone).
Returns:

Electricity consumption per zone and time of day.

calculateZonalVehicleCO2Emissions

public Map<VehicleType, HashMap<String, Double>> calculateZonalVehicleCO2Emissions(double originZoneEnergyWeight)

Calculates zonal CO2 emissions (in kg) for each vehicle type (sum across all engine types).

Parameters:
  • originZoneEnergyWeight – Percentage of CO2 emission assigned to origin zone (the rest assigned to destination zone).
Returns:

Zonal CO2 emissions for each vehicle type.

calculateZonalVehicleKilometresPerVehicleType

public Map<String, Map<VehicleType, Double>> calculateZonalVehicleKilometresPerVehicleType()

Calculates vehicle kilometres in each LAD and for each vehicle type. Ignores access and egress to major roads. Ignores minor roads.

Returns:Vehicle kilometres.

calculateZonalVehicleKilometresPerVehicleTypeFromTemproTripList

public Map<String, Map<VehicleType, Double>> calculateZonalVehicleKilometresPerVehicleTypeFromTemproTripList(boolean includeAccessEgress, boolean includeMinorTrips)

Calculates vehicle kilometres in each LAD using Tempro-based trips. Optionally includes access and egress (for Tempro-based model). Optionally includes minor trips (Tempro intra-zonal).

Parameters:
  • includeAccessEgress – True if access and egress should be included in the calculation.
  • includeMinorTrips – True if minor trips should be included in the calculation.
Returns:

Vehicle kilometres.

calculateZonalVehicleKilometresPerVehicleTypeFromTripList

public Map<String, Map<VehicleType, Double>> calculateZonalVehicleKilometresPerVehicleTypeFromTripList(boolean includeAccessEgress)

Calculates vehicle kilometres in each LAD and per vehicle type. Optionally includes access and egress (for LAD-based model).

Parameters:
  • includeAccessEgress – True if access and egress should be included in the calculation.
Returns:

Vehicle kilometres.

getAADFCarTrafficCounts

public Integer[] getAADFCarTrafficCounts()

Getter method for AADF car traffic counts.

Returns:Car traffic counts.

getAADFFreightTrafficCounts

public Map<VehicleType, Integer[]> getAADFFreightTrafficCounts()

Getter method for AADF freight traffic counts.

Returns:Freight traffic counts.

getAreaCodeProbabilities

public HashMap<String, Double> getAreaCodeProbabilities()

Getter method for output area probabilities.

Returns:Output area probabilities.

getCopyOfLinkTravelTimes

public Map<TimeOfDay, double[]> getCopyOfLinkTravelTimes()
Returns:The copy of all link travel times.

getCopyOfLinkTravelTimesAsMap

public Map<TimeOfDay, Map<Integer, Double>> getCopyOfLinkTravelTimesAsMap()
Returns:The copy of all link travel times as map.

getEndNodeProbabilities

public HashMap<Integer, Double> getEndNodeProbabilities()

Getter method for node probabilities.

Returns:Node probabilities.

getEnergyConsumptionParameters

public Map<VehicleType, Map<EngineType, Map<WebTAG, Double>>> getEnergyConsumptionParameters()

Getter method for energy consumption WebTAG parameters.

Returns:Energy consumption parameters.

getEnergyUnitCosts

public Map<EnergyType, Double> getEnergyUnitCosts()

Getter method for energy unit costs.

Returns:Energy unit costs.

getEngineTypeFractions

public Map<VehicleType, Map<EngineType, Double>> getEngineTypeFractions()

Getter method for engine type fractions.

Returns:Engine type fractions.

getFlagUseRouteChoiceModel

public boolean getFlagUseRouteChoiceModel()

Getter method for the use route choice model flag.

Returns:Flag.

getLinkFreeFlowTravelTimes

public double[] getLinkFreeFlowTravelTimes()

Getter method for the link free-flow travel times.

Returns:Link volumes

getLinkTravelTimes

public Map<TimeOfDay, double[]> getLinkTravelTimes()

Getter method for the link travel times per time of day.

Returns:Link travel times per time of day.

getLinkVolumeInPCU

public double[] getLinkVolumeInPCU()

Getter method for daily link volumes in PCU.

Returns:Link volumes in PCU.

getLinkVolumeInPCUPerTimeOfDay

public Map<TimeOfDay, double[]> getLinkVolumeInPCUPerTimeOfDay()

Getter method for link volumes in PCU per time of day.

Returns:Link volumes in PCU per time of day.

getLinkVolumePerVehicleType

public Map<VehicleType, int[]> getLinkVolumePerVehicleType()

Getter method for daily link volumes per vehicle type.

Returns:Link volumes in PCU per time of day.

getObservedTripLengthDistribution

public double[] getObservedTripLengthDistribution(double[] binLimitsInKm, boolean flagIncludeAccessEgress, boolean flagIncludeMinorTrips)

Calculates observed trip length distribution.

Parameters:
  • binLimitsInKm – Bin limits in kilometres.
  • flagIncludeAccessEgress – If true include access and eggress into trip distance calculation. * @param flagIncludeMinorTrips If true include minor road trips into trip distance calculation.
Returns:

Observed trip length distribution.

getObservedTripLengthFrequencies

public double[] getObservedTripLengthFrequencies(double[] binLimitsInKm, boolean flagIncludeAccessEgress, boolean flagIncludeMinorTrips)

Calculates observed trip length frequencies.

Parameters:
  • binLimitsInKm – Bin limits in kilometres.
  • flagIncludeAccessEgress – If true include access and egress into trip distance calculation.
  • flagIncludeMinorTrips – If true include minor road trips into trip distance calculation.
Returns:

Observed trip length distribution.

getRoadNetwork

public RoadNetwork getRoadNetwork()

Getter method for the road network.

Returns:Road network.

getStartNodeProbabilities

public HashMap<Integer, Double> getStartNodeProbabilities()

Getter method for node probabilities.

Returns:Node probabilities.

getTripList

public ArrayList<Trip> getTripList()

Getter method for the trip list.

Returns:Trip list.

getVolumeToFlowFactor

public double getVolumeToFlowFactor()

Getter method for the volume to flow factor.

Returns:Volume to flow factor.

getWorkplaceZoneProbabilities

public HashMap<String, Double> getWorkplaceZoneProbabilities()

Getter method for workplace zones probabilities.

Returns:Workplace zones probabilities.

initialiseTripList

public void initialiseTripList(int initialCapacity)

Initialise trip list for passengers and freight (e.g. expected total sum or passenger and freight flows).

Parameters:
  • initialCapacity – Initial capacity of the trip list.

loadLinkTravelTimes

public void loadLinkTravelTimes(int year, String fileName)

Loads link travel times from a file.

Parameters:
  • year – Year of the assignment.
  • fileName – Input file name (with path).

printGEHstatistic

public void printGEHstatistic()

Prints GEH statistics for comparison between simulated and observed hourly car flows.

printGEHstatistic

public void printGEHstatistic(double volumeToFlowFactor)

Prints GEH statistics for comparison between simulated and observed hourly car flows.

Parameters:
  • volumeToFlowFactor – Converts daily vehicle volume to hourly flow (e.g. 0.1 for peak flow; 1/24.0 for daily average)

printGEHstatisticFreight

public void printGEHstatisticFreight()

Prints GEH statistics for comparison between simulated and observed hourly freight vehicle flows.

printGEHstatisticFreight

public void printGEHstatisticFreight(double volumeToFlowFactor)

Prints GEH statistics for comparison between simulated and observed hourly freight vehicle flows.

Parameters:
  • volumeToFlowFactor – Converts daily vehicle volume to hourly flow (e.g. 0.1 for peak flow; 1/24.0 for daily average)

printHourlyGEHstatistic

public void printHourlyGEHstatistic()

Prints GEH statistics for comparison between simulated and observed hourly car flows.

printRMSNstatistic

public void printRMSNstatistic()

Prints RMSN statistic for comparison between simulated daily car volumes and observed daily traffic counts.

printRMSNstatisticFreight

public void printRMSNstatisticFreight()

Prints RMSN statistic for comparison between simulated daily freight volumes and observed daily freight traffic counts.

resetLinkVolumes

public void resetLinkVolumes()

Resets link volumes to zero.

resetTripList

public void resetTripList()

Reset trip list for passengers and freight.

saveAssignmentResults

public void saveAssignmentResults(int year, String outputFile)

Saves assignment results to output file.

Parameters:
  • year – Year of the assignment.
  • outputFile – Output file name (with path).

saveEnergyConsumptionsPerVehicleType

public void saveEnergyConsumptionsPerVehicleType(int year, String outputFile)

Saves energy consumptions per vehicle type to an output file.

Parameters:
  • year – Assignment year.
  • outputFile – Output file name (with path).

saveHourlyCarVolumes

public void saveHourlyCarVolumes(int year, String outputFile)

Saves hourly car volumes to output file.

Parameters:
  • year – Year of the assignment.
  • outputFile – Output file name (with path).

saveLinkTravelTimes

public void saveLinkTravelTimes(int year, String outputFile)

Saves travel times into a file.

Parameters:
  • year – Year of the assignment.
  • outputFile – Output file name (with path).

saveOriginDestinationCarElectricityConsumption

public void saveOriginDestinationCarElectricityConsumption(String outputFile)

Saves origin-destination matrix of car electricity consumption.

Parameters:
  • outputFile – Output file name (with path).

savePeakLinkPointCapacities

public void savePeakLinkPointCapacities(int year, String outputFile)

Saves peak link point capacities into a file.

Parameters:
  • year – Year of the assignment.
  • outputFile – Output file name (with path).

saveTotalCO2Emissions

public void saveTotalCO2Emissions(int year, String outputFile)

Saves total CO2 emissions to an output file.

Parameters:
  • year – Year of the assignment.
  • outputFile – Output file name (with path).

saveTotalEnergyConsumptions

public void saveTotalEnergyConsumptions(int year, String outputFile)

Saves total electricity consumption to an output file.

Parameters:
  • year – Year of the assignment.
  • outputFile – Output file name (with path).

saveZonalCarEnergyConsumptions

public void saveZonalCarEnergyConsumptions(int year, double originZoneEnergyWeight, String outputFile)

Saves zonal car energy consumptions to an output file.

Parameters:
  • year – Assignment year.
  • originZoneEnergyWeight – Percentage of energy consumption assigned to origin zone (the rest assigned to destination zone).
  • outputFile – Output file name (with path).

saveZonalTemporalTripStartsForEVs

public void saveZonalTemporalTripStartsForEVs(int year, VehicleType vht, String outputFile)

Saves zonal (LAD) and temporal (hourly) number of EV trips to an output file.

Parameters:
  • year – Assignment year.
  • vht – Vehicle Type.
  • outputFile – Output file name (with path).

saveZonalTemporalTripStartsForH2

public void saveZonalTemporalTripStartsForH2(int year, VehicleType vht, String outputFile)

Saves zonal (LAD) and temporal (hourly) number of H2 fuelled trips to an output file.

Parameters:
  • year – Assignment year.
  • vht – Vehicle Type.
  • outputFile – Output file name (with path).

saveZonalTemporalVehicleElectricity

public void saveZonalTemporalVehicleElectricity(int year, VehicleType vht, double originZoneEnergyWeight, String outputFile)

Saves zonal (LAD) and temporal (hourly) vehicle electricity consumptions to an output file.

Parameters:
  • year – Assignment year.
  • vht – Vehicle Type (it will include consumption of autonomous vehicles too).
  • originZoneEnergyWeight – Percentage of energy consumption assigned to origin zone (the rest assigned to destination zone).
  • outputFile – Output file name (with path).

saveZonalTemporalVehicleHydrogen

public void saveZonalTemporalVehicleHydrogen(int year, VehicleType vht, double originZoneEnergyWeight, String outputFile)

Saves zonal (LAD) and temporal (hourly) vehicle hydrogen consumptions to an output file.

Parameters:
  • year – Assignment year.
  • vht – Vehicle Type (it will include consumption of autonomous vehicles too).
  • originZoneEnergyWeight – Percentage of energy consumption assigned to origin zone (the rest assigned to destination zone).
  • outputFile – Output file name (with path).

saveZonalVehicleCO2Emissions

public void saveZonalVehicleCO2Emissions(int year, double originZoneEnergyWeight, String outputFile)

Saves zonal vehicle CO2 emissions to an output file.

Parameters:
  • year – Assignment year.
  • originZoneEnergyWeight – Percentage of CO2 emission assigned to origin zone (the rest assigned to destination zone).
  • outputFile – Output file name (with path).

saveZonalVehicleKilometres

public void saveZonalVehicleKilometres(int year, String outputFile)

Saves zonal vehicle-kilometres.

Parameters:
  • year – Assignment year.
  • outputFile – Output file name (with path).

saveZonalVehicleKilometresWithAccessEgress

public void saveZonalVehicleKilometresWithAccessEgress(int year, String outputFile)

Saves zonal vehicle-kilometres that include access/egress and minor trips

Parameters:
  • year – Assignment year.
  • outputFile – Output file name (with path).

setElectricityUnitCost

public void setElectricityUnitCost(double electricityUnitCost)

Setter method for the electricity unit cost.

Parameters:
  • electricityUnitCost – The cost of 1 kWh in £.

setEndNodeProbabilities

public void setEndNodeProbabilities(HashMap<Integer, Double> endNodeProbabilities)

Setter method for node probabilities.

Parameters:
  • endNodeProbabilities – Node probabilities.

setEnergyConsumptionParameters

public void setEnergyConsumptionParameters(VehicleType vehicleType, EngineType engineType, Map<WebTAG, Double> parameters)

Setter method for the energy consumption parameters.

Parameters:
  • vehicleType – Vehicle type
  • engineType – Engine type
  • parameters – Energy consumptions parameters (A, B, C, D)

setEnergyUnitCost

public void setEnergyUnitCost(EnergyType energyType, double energyUnitCost)

Setter method for the energy unit cost.

Parameters:
  • energyType – The type of a car engine.
  • energyUnitCost – The cost of 1 L (of fuel) or 1 kWh (of electricity) in £.

setEngineTypeFractions

public void setEngineTypeFractions(VehicleType vht, Map<EngineType, Double> engineTypeFractions)

Setter method for energy type fractions.

Parameters:
  • vht – Vehicle type
  • engineTypeFractions – Map with engine type fractions.

setStartNodeProbabilities

public void setStartNodeProbabilities(HashMap<Integer, Double> startNodeProbabilities)

Setter method for node probabilities.

Parameters:
  • startNodeProbabilities – Node probabilities.

updateCostSkimMatrix

public void updateCostSkimMatrix(SkimMatrix costSkimMatrix)

Updates cost skim matrix (zone-to-zone financial costs).

Parameters:
  • costSkimMatrix – Inter-zonal skim matrix (cost).

updateCostSkimMatrixFreight

public void updateCostSkimMatrixFreight(SkimMatrixFreight costSkimMatrixFreight)

Updates cost skim matrix (zone-to-zone financial costs) for freight.

Parameters:
  • costSkimMatrixFreight – Inter-zonal skim matrix (cost) for freight.

updateLinkTravelTimes

public void updateLinkTravelTimes()

Updates link travel times per time of day.

updateLinkTravelTimes

public void updateLinkTravelTimes(double weight)

Updates link travel times using weighted averaging between new values (calculated from link volumes) and older values (stored in the instance field).

Parameters:
  • weight – Parameter for weighted averaging.

updateLinkVolumeInPCU

public void updateLinkVolumeInPCU()

Updates daily link volumes in PCU from the trip list and stores it into instance variable.

updateLinkVolumeInPCUPerTimeOfDay

public void updateLinkVolumeInPCUPerTimeOfDay()

Updates link volumes in PCU per time of day from object’s trip list and stores into instance variable.

updateLinkVolumePerVehicleType

public void updateLinkVolumePerVehicleType()

Updates daily link volumes per vehicle type from trip list and stores into instance variable.

updateTimeSkimMatrix

public void updateTimeSkimMatrix(SkimMatrix timeSkimMatrix)

Updates travel time skim matrix (zone-to-zone travel times).

Parameters:
  • timeSkimMatrix – Inter-zonal skim matrix (time).

updateTimeSkimMatrixFreight

public void updateTimeSkimMatrixFreight(SkimMatrixFreight timeSkimMatrixFreight)

Updates travel time skim matrix (zone-to-zone travel times) for freight.

Parameters:
  • timeSkimMatrixFreight – Inter-zonal skim matrix (time).