NISMOD v2 Transport Model¶
NISMOD v2 Transport Model is a national-scale (Great Britain) transport model developed to support policy making regarding future infrastructure.
Contents¶
Documentation¶
NISMOD v2 Transport Model is a national-scale (Great Britain) transport model developed to support policy making regarding future infrastructure. It forecasts the impact of various endogenous and exogenous factors on transport demand and capacity utilisation, following an elasticity-based simulation methodology. The model consists of three submodels covering the following modes of transport: road (passenger and freight vehicle flows), rail (total station usage), and air (domestic and international passenger movements).
1. Key Features¶
1.1 Road Model¶
- NISMOD v2 Transport Model predicts vehicle demand (inter-zonal flows) for passenger and freight vehicles, and stochastically simulates road traffic on all major UK roads including A-roads and motorways.
- It is currently the only national-scale road traffic model capable of routing-based network assignment and provisioning a national-scale origin-destination matrix (on TEMPRo & LAD spatial zoning levels), while achieving a respectable match with AADF traffic counts, total vehicle kilometres, expected number of car trips, and the observed trip length distribution from the National Travel Survey.
- The freight model has been modelled after the DfT’s 2006 Base-Year Freight Matrices model, which includes traffic flows for freight vehicles (vans, rigid HGVs, and articulated HGVs) between local authority districts (LADs), sea ports, selected airports, and major distribution centres. The accuracy of the freight model is mostly limited by the spatial zoning system (LAD).
- The demand prediction model is elasticity-based and it can predict future vehicle flows from exogenous (scenario-based) changes in population and GVA, and endogenously calculated changes in inter-zonal travel time and travel cost (but also dependent on exogenous interventions such as new road development and congestion charging policies).
- Congested travel times on individual road links have been modelled separately for each hour of the day, using the speed-flow curves estimated on English roads (DfT’s 2005 FORGE model), the overcapacity formula from WebTAG, and the passenger car unit (PCU) concept to capture different vehicle sizes.
- The number of lanes on each road segment has been estimated by map-matching AADF count point locations to the OpenRoads major road network. This has allowed a distinction between single and dual carriageway A-roads, which are then assumed to have 1 and 2 lanes per direction, respectively.
- The network assignment exists in two version and it has been implemented using state-of-the-art routing algorithms. The routing version uses a heuristic search algorithm A* to find the fastest path between two locations using congested link travel times, while the route-choice version uses an advanced discrete-choice model (path-size logit) to choose the optimal path based on distance, travel time, travel cost (fuel and road tolls), and the number of intersections.
- The route-choice version of the network assignment uses a route set pre-generated on the IRIDIS cluster of the University of Southampton. This pre-generated route set consists of more than 90 million different route options which enables the national-scale assignment to run within minutes, despite each individual vehicle trip being simulated separately (including time of day choice, engine type choice, route choice).
- The model can also incorporate scenarios for changes in vehicle fuel efficiency and changes in market shares of different engine types, including internal combustion engines on petrol, diesel, LPG, hydrogen or CNG; hybrid EVs on petrol or diesel; plug-in hybrid EVs on petrol or diesel; fuel cell EVs on hydrogen, and battery EV. This can be used to test policies such as the fossil fuel phase-out.
- Electricity and fuel consumptions are calculated using the four-parameter formula from WebTAG. Behavioural assumptions are made for plug-in hybrid EVs (electricity on urban, fuel on rural road links).
- Interventions such as new road development, road expansion with new lanes, and congestion charging zones can be dynamically implemented in each simulated year.
- The model can output various metrics on the road link level (e.g. road capacity utilisation, peak hour travel times), zonal level (e.g. vehicle kilometres, EV electricity consumption), inter-zonal level (e.g. predicted vehicle flows, average travel times, average travel costs) and national level (e.g. total CO2 emissions, total energy consumptions). The outputs are in csv and shapefile format, allowing them to be visualised with a software of choice.
1.2 Rail Model¶
- NISMOD v2 Transport Model includes a national-scale rail model for predicting future station usage demand.
- It currently uses station usage data for 3054 stations covering National Rail, London Underground, Docklands Light Railway, London Trams (previously Croydon Tramlink), Manchester Metrolink, and Tyne & Wear (Newcastle) Metro.
- Elasticity-based demand model predicts station usage (entry + exit) from changes in exogenous inputs including: population, GVA, rail fare index, generalised journey time (GJT) index and car trip costs.
- Car trip costs can be provided as an input or calculated from the outputs of the NISMOD road model.
- Elasticities of rail fares and GJT vary per elasticity zone (London Travelcard, South-East, PTE, other).
- The model implements a policy intervention for building new rail stations in future years.
1.2 Air Model¶
- NISMOD v2 Transport Model also includes an air model that predicts domestic and international passenger movements.
- Air demand data is inter-nodal, i.e. between individual airports (domestic - between two UK airports, and international - between a UK airport and an international airport).
- Base-year (2015) demand data is obtain from the Civil Aviation Authority (CAA), while information about airports is obtained from CAA, NaPTAN, and ourairports.com.
- Demand files use IATA codes (or ICAO where IATA is unavailable) to identify airports and ISO 3166 Alpha-2 codes to identify countries.
- Elasticity-based demand model predicts passenger movements from changes in exogenous inputs including: population, GVA, domestic and international fare incides, and trip rates.
2. How to run the model¶
2.1 Using Eclipse IDE¶
- Install Java Development Kit version 8 from: http://www.oracle.com.
- Install Eclipse IDE for Java Developers: https://eclipse.org/downloads/.
- Run Eclipse and choose the workspace folder.
- Import the existing Maven project from the local git folder where the code has been cloned. In Eclipse: File -> Import -> Maven -> Existing Maven Projects.
- Wait until all Maven dependencies (specified in the pom.xml file) are downloaded. If the pom.xml file has been changed, the Maven project should be first updated (Alt+F5).
- The classes containing the main method can be run as a Java application. The classes containing the methods annotated with @Test can be run as JUnit tests.
- To run the main model in Eclipse, open the Run Configuration for nismod.transport.App.java and pass the path to the config file as an argument:

2.2 Using Command Prompt (Console)¶
Install Java Development Kit version 8 from: http://www.oracle.com.
Make sure the Java home environment variable is set for the operating system and pointing to the directory where Java Development Kit has been installed.
Download maven, install it and set the environment variables: http://maven.apache.org/.
To build the project type:
mvn clean install
To run the base-year road model (2015) type:
java -cp target/transport-0.0.1-SNAPSHOT.jar nismod.transport.App -c ./path/to/config.properties -b
To predict and run a future year (e.g. 2020) using the results of a previously run year (e.g. 2015), for the road model type:
java -cp target/transport-0.0.1-SNAPSHOT.jar nismod.transport.App -c ./path/to/config.properties -road 2020 2015
To predict and run a future year (e.g. 2020) using the results of a previously run year (e.g. 2015), for the rail model type:
java -cp target/transport-0.0.1-SNAPSHOT.jar nismod.transport.App -c ./path/to/config.properties -rail 2020 2015
To predict and run a future year (e.g. 2020) using the results of a previously run year (e.g. 2015), for the air model type:
java -cp target/transport-0.0.1-SNAPSHOT.jar nismod.transport.App -c ./path/to/config.properties -air 2020 2015
Note
Rail and air model need not be run for the base-year as 2015 demand data is given as an input.
Options:
- To increase the max heap size, run with java -XX:MaxHeapSize=120g …
- To enable debug messages, run with java -Dlog4j2.debug …
2.3 Showcase Demo¶
The model provides an interactive showcase demo with three policy interventions in the case study area of South-East England. The interventions are:
- Road expansion - expanding existing road links with additional lanes.
- Road development - building new road links between two existing intersections.
- Congestion charging - time-based (peak and off-peak) congestion charging in the policy area.
To run the showcase demo type:
java -cp target/transport-0.0.1-SNAPSHOT.jar nismod.transport.App -c ./path/to/config.properties -d




Note
Showcase demo requires a display with a 1920 x 1080 resolution.
3. Cross-sectoral Dependencies¶
The UK transport sector has various links with other infrastructure sectors:
- Energy: energy consumption, fuel price, electrification of vehicles, fuel transport, power outage (rail and air disruption).
- Digital Communications: supporting smart mobility (e.g. mobility as a service, autonomous mobility on demand), coverage and service disruptions.
- Water: floods causing road and rail disruptions.
- Solid Waste: waste transport (e.g. waste exports through seaports).
To enable studies of some of those cross-sectoral interdependencies, the transport model has been integrated into a wider Simulation Modelling Integration Framework (smif): https://github.com/nismod/smif

4. Acknowledgments¶
This work has been undertaken at the University of Southampton, as part of the ITRC consortium, under grant EP/N017064/1 (MISTRAL: Multi-scale InfraSTRucture systems AnaLytics) of the UK Engineering and Physical Science Research Council (EPSRC). https://www.itrc.org.uk/
The test resources contain a sample of data and shapefiles that come with the following licencing and copyright statemens:
- Open Government Licence http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/
- Contains National Statistics data © Crown copyright and database right 2012.
- Contains Ordnance Survey data © Crown copyright and database right 2012.
The authors acknowledge the use of the IRIDIS High Performance Computing Facility, and associated support services at the University of Southampton, in the completion of this work.
The implementation uses an open source library GeoTools for geospatial processing. http://www.geotools.org/about.html
‘transport’¶
nismod.transport¶
nismod.transport.air¶
AirDemandModel¶
-
public class
AirDemandModel
¶ Main air demand prediction model (elasticity-based).
Author: Milan Lovric
Fields¶
Constructors¶
-
public
AirDemandModel
(String domesticAirportsFile, String internationalAirportsFile, String baseYearDomesticPassengerFile, String baseYearInternationalPassengerFile, String populationFile, String GVAFile, String elasticitiesFile, String domesticAirportFareIndexFile, String internationalAirportFareIndexFile, String domesticTripRatesFile, String internationalTripRatesFile, List<Intervention> interventions, Properties props)¶ Constructor for the air demand model.
Parameters: - domesticAirportsFile – List of domestic airports.
- internationalAirportsFile – List of international airports.
- baseYearDomesticPassengerFile – Base year domestic air passenger file (demand).
- baseYearInternationalPassengerFile – Base year international air passenger file (demand).
- populationFile – Population file.
- GVAFile – GVA file.
- elasticitiesFile – Elasticities file.
- domesticAirportFareIndexFile – Domestic airport fare index.
- internationalAirportFareIndexFile – International airport fare index.
- domesticTripRatesFile – Domestic trip rates file.
- internationalTripRatesFile – International trip rates file.
- interventions – List of interventions.
- props – Properties.
Throws: - IOException –
- FileNotFoundException –
Methods¶
-
public InternodalPassengerDemand
getDomesticAirPassengerDemand
(int year)¶ Getter method for the air passenger demand in a given year.
Parameters: - year – Year for which the demand is requested.
Returns: Air passenger demand.
-
public InternodalPassengerDemand
getInternationalAirPassengerDemand
(int year)¶ Getter method for the air passenger demand in a given year.
Parameters: - year – Year for which the demand is requested.
Returns: Air passenger demand.
-
public void
predictAndSaveAirDemands
(int toYear, int fromYear)¶ Predicts air passenger demands (domestic and international) up to toYear (if flag is true, also intermediate years) and saves results.
Parameters: - toYear – The final year for which the demand is predicted.
- fromYear – The year from which the predictions are made.
-
public void
predictDomesticAirDemandUsingResultsOfFromYear
(int predictedYear, int fromYear)¶ Predicts domestic air passenger internodal demand. Uses already existing results of the fromYear, from the output folder.
Parameters: - predictedYear – The year for which the demand is predicted.
- fromYear – The year from which demand the prediction is made.
-
public void
predictInternationalAirDemandUsingResultsOfFromYear
(int predictedYear, int fromYear)¶ Predicts international air passenger internodal demand. Uses already existing results of the fromYear, from the output folder.
Parameters: - predictedYear – The year for which the demand is predicted.
- fromYear – The year from which demand the prediction is made.
-
public void
saveAllResults
(int year)¶ Saves all results into the output folder.
Parameters: - year – Year of the data.
AirDemandModel.ElasticityTypes¶
-
public static enum
ElasticityTypes
¶
Enum Constants¶
-
public static final AirDemandModel.ElasticityTypes
COST_DOMESTIC
¶
-
public static final AirDemandModel.ElasticityTypes
COST_INTERNATIONAL
¶
-
public static final AirDemandModel.ElasticityTypes
GVA
¶
-
public static final AirDemandModel.ElasticityTypes
POPULATION
¶
Airport¶
-
public abstract class
Airport
¶ This class stores information about an airport.
Author: Milan Lovric
Constructors¶
-
public
Airport
(String iataCode, String caaName, String ourAirportsName, double longitude, double latitude, String countryCode, String continentCode, long terminalCapacity, long runwayCapacity)¶ Constructor for the airport.
Parameters: - iataCode – Airport IATA code.
- caaName – Airport name in CAA datasets.
- ourAirportsName – Airport name in ourAirports dataset.
- longitude – Longitude coordinate.
- latitude – Latitude coordinate.
- countryCode – Code of the country in which the airport is located.
- continentCode – Code of the continent in which the airport is located.
- terminalCapacity – Airport terminal capacity (max number of passengers that can be processed).
- runwayCapacity – Airport runway capacity (max number of flights that can be processed).
Methods¶
-
public ContinentCode
getContinent
()¶ Getter method for the continent in which the airport is located.
Returns: ContinentCode continent.
-
public long
getRunwayCapacity
()¶ Getter method for the airport runway capacity.
Returns: Runway capacity.
Airport.AirportGroup¶
-
public static enum
AirportGroup
¶ Airports grouped by DfT.
Enum Constants¶
-
public static final Airport.AirportGroup
DO
¶
-
public static final Airport.AirportGroup
LH
¶
-
public static final Airport.AirportGroup
SH
¶
Airport.AirportGroupCAA¶
-
public static enum
AirportGroupCAA
¶ Airport groups by CAA used in the flight movements dataset.
Enum Constants¶
-
public static final Airport.AirportGroupCAA
EU
¶
-
public static final Airport.AirportGroupCAA
INT
¶
-
public static final Airport.AirportGroupCAA
UK
¶
Airport.ContinentCode¶
-
public static enum
ContinentCode
¶ ISO continent code
Enum Constants¶
-
public static final Airport.ContinentCode
AF
¶
-
public static final Airport.ContinentCode
AN
¶
-
public static final Airport.ContinentCode
AS
¶
-
public static final Airport.ContinentCode
EU
¶
-
public static final Airport.ContinentCode
NA
¶
-
public static final Airport.ContinentCode
OC
¶
-
public static final Airport.ContinentCode
SA
¶
Airport.ForeignRegionCAA¶
-
public static enum
ForeignRegionCAA
¶ These are the foreign region groups used by CAA for international internodal passenger demand. There is 1:1 mapping between a country and a region (this is unlike the OurAirports data where one country could map to multiple regions, e.g. some Russian airports are in Asia, while some are in Europe).
Enum Constants¶
-
public static final Airport.ForeignRegionCAA
ATLANTIC_OCEAN_ISLANDS
¶
-
public static final Airport.ForeignRegionCAA
AUSTRALASIA
¶
-
public static final Airport.ForeignRegionCAA
CANADA
¶
-
public static final Airport.ForeignRegionCAA
CARRIBEAN_AREA
¶
-
public static final Airport.ForeignRegionCAA
CENTRAL_AFRICA
¶
-
public static final Airport.ForeignRegionCAA
CENTRAL_AMERICA
¶
-
public static final Airport.ForeignRegionCAA
EASTERN_EUROPE_EU
¶
-
public static final Airport.ForeignRegionCAA
EASTERN_EUROPE_OTHER
¶
-
public static final Airport.ForeignRegionCAA
EAST_AFRICA
¶
-
public static final Airport.ForeignRegionCAA
FAR_EAST
¶
-
public static final Airport.ForeignRegionCAA
INDIAN_OCEAN_ISLANDS
¶
-
public static final Airport.ForeignRegionCAA
INDIAN_SUB_CONTINENT
¶
-
public static final Airport.ForeignRegionCAA
MIDDLE_EAST
¶
-
public static final Airport.ForeignRegionCAA
NEAR_EAST
¶
-
public static final Airport.ForeignRegionCAA
NORTH_AFRICA
¶
-
public static final Airport.ForeignRegionCAA
OIL_RIGS
¶
-
public static final Airport.ForeignRegionCAA
PACIFIC_OCEAN_ISLANDS
¶
-
public static final Airport.ForeignRegionCAA
SOUTHERN_AFRICA
¶
-
public static final Airport.ForeignRegionCAA
SOUTH_AMERICA
¶
-
public static final Airport.ForeignRegionCAA
UNITED_STATES_OF_AMERICA
¶
-
public static final Airport.ForeignRegionCAA
WESTERN_EUROPE_EU
¶
-
public static final Airport.ForeignRegionCAA
WESTERN_EUROPE_OTHER
¶
-
public static final Airport.ForeignRegionCAA
WEST_AFRICA
¶
DomesticAirport¶
-
public class
DomesticAirport
extends Airport¶ This class stores information about a domestic (UK) airport.
Author: Milan Lovric
Constructors¶
-
public
DomesticAirport
(String iataCode, String atcoCode, String caaName, String naptanName, String ourAirportsName, int easting, int northing, double longitude, double latitude, String ladCode, String ladName, long terminalCapacity, long runwayCapacity)¶ Constructor for the airport.
Parameters: - iataCode – Airport IATA code.
- atcoCode – Airport ATCO code.
- caaName – Airport name in CCA datasets.
- naptanName – Airport name in NaPTAN (for UK airpots).
- ourAirportsName – Airport name in ourAirports dataset.
- easting – Easting coordinate.
- northing – Northing coordinate.
- longitude – Longitude coordinate.
- latitude – Latitude coordinate.
- ladCode – LAD code of the zone in which the airport is located (for UK airports).
- ladName – LAD name of the zone in which the airport is located (for UK airports).
- terminalCapacity – Airport terminal capacity (max number of passengers that can be processed).
- runwayCapacity – Airport runway capacity (max number of flights that can be processed).
-
public
DomesticAirport
(DomesticAirport airport)¶ Constructor for an airport.
Parameters: - airport – Airport which data is going to be copied.
DomesticInternodalPassengerDemand¶
-
public class
DomesticInternodalPassengerDemand
extends InternodalPassengerDemand¶ This class encapsulates domestic internodal (domestic airport to domestic airport) passenger data.
Author: Milan Lovric
Constructors¶
InternationalAirport¶
-
public class
InternationalAirport
extends Airport¶ This class stores information about an international (non-UK) airport.
Author: Milan Lovric
Constructors¶
-
public
InternationalAirport
(String iataCode, String caaName, String ourAirportsName, double longitude, double latitude, String countryCode, String continentCode, long terminalCapacity, long runwayCapacity)¶ Constructor for the airport.
Parameters: - iataCode – Airport IATA code.
- caaName – Airport name in CCA datasets.
- ourAirportsName – Airport name in ourAirports dataset.
- longitude – Longitude coordinate.
- latitude – Latitude coordinate.
- countryCode – Code of the country in which the airport is located.
- countryCode – Code of the continent in which the airport is located.
- terminalCapacity – Airport terminal capacity (max number of passengers that can be processed).
- runwayCapacity – Airport runway capacity (max number of flights that can be processed).
-
public
InternationalAirport
(InternationalAirport airport)¶ Constructor for an airport using an existing airport.
Parameters: - airport – Airport which data is going to be copied.
InternationalInternodalPassengerDemand¶
-
public class
InternationalInternodalPassengerDemand
extends InternodalPassengerDemand¶ This class encapsulates international internodal (domestic airport to international airport) passenger data.
Author: Milan Lovric
Constructors¶
InternodalPassengerDemand¶
-
public abstract class
InternodalPassengerDemand
¶ This class encapsulates internodal (airport to airport) passenger data.
Author: Milan Lovric
Methods¶
InternodalPassengerDemand.Passengers¶
-
public static enum
Passengers
¶
Enum Constants¶
-
public static final InternodalPassengerDemand.Passengers
CHARTER
¶
-
public static final InternodalPassengerDemand.Passengers
SCHEDULED
¶
-
public static final InternodalPassengerDemand.Passengers
TOTAL
¶
nismod.transport.decision¶
CongestionCharging¶
-
public class
CongestionCharging
extends Intervention¶ Intervention that implements link-based congestion charge which depends on the vehicle type and time of day when trip is made.
Author: Milan Lovric
Constructors¶
-
public
CongestionCharging
(Properties props)¶ Constructor.
Parameters: - props – Properties object.
Intervention¶
-
public abstract class
Intervention
¶ Abstract class for policy interventions.
Author: Milan Lovric
Constructors¶
-
protected
Intervention
(Properties props)¶
Intervention.InterventionType¶
-
public static enum
InterventionType
¶
Enum Constants¶
-
public static final Intervention.InterventionType
CongestionCharging
¶
-
public static final Intervention.InterventionType
NewRailStation
¶
-
public static final Intervention.InterventionType
RoadDevelopment
¶
-
public static final Intervention.InterventionType
RoadExpansion
¶
NewRailStation¶
-
public class
NewRailStation
extends Intervention¶ Intervention that builds a new rail station.
Author: Milan Lovric
Constructors¶
-
public
NewRailStation
(Properties props)¶ Constructor.
Parameters: - props – Properties of the intervention.
PricingPolicy¶
-
public class
PricingPolicy
¶ A class that encapsulates the pricing policy for congestion charging intervention.
Author: Milan Lovric
Constructors¶
-
public
PricingPolicy
(String policyName, String fileName, int maxEdgeID, List<Integer> edgeIDs)¶ Reads congestion charge file which contains charges that depend on vehicle type and time of day (hour).
Parameters: - policyName – Name of the policy.
- fileName – File name.
- maxEdgeID – Maximum edge ID.
- edgeIDs – List of edge IDs affected by the policy.
Throws: - IOException – if any.
- FileNotFoundException – if any.
Return: Map with congestion charges.
Methods¶
-
public double[]
getLinkCharges
(VehicleType vht, TimeOfDay time)¶ Get link charges for a particular combination of vehicle type and time of day.
Parameters: - vht – Vehicle type.
- time – Time of day.
Returns: Array with link charges.
RoadDevelopment¶
-
public class
RoadDevelopment
extends Intervention¶ Intervention that creates a new road link between two existing nodes.
Author: Milan Lovric
Constructors¶
-
public
RoadDevelopment
(Properties props)¶ Constructor.
Parameters: - props – Properties of the road development intervention.
RoadExpansion¶
-
public class
RoadExpansion
extends Intervention¶ Intervention that expands a road link with a number of lanes.
Author: Milan Lovric
Constructors¶
-
public
RoadExpansion
(Properties props)¶ Constructor.
Parameters: - props – Properties of the road expansion intervention.
nismod.transport.demand¶
AssignableODMatrix¶
-
public interface
AssignableODMatrix
¶ Origin-destination matrix for passenger vehicles.
Author: Milan Lovric
DemandModel¶
-
public class
DemandModel
¶ Main demand prediction model (elasticity-based).
Author: Milan Lovric
Fields¶
Constructors¶
-
public
DemandModel
(RoadNetwork roadNetwork, String baseYearODMatrixFile, String baseYearFreightMatrixFile, String populationFile, String GVAFile, String elasticitiesFile, String elasticitiesFreightFile, String energyUnitCostsFile, String unitCO2EmissionsFile, String engineTypeFractionsFile, String autonomousVehiclesFractionsFile, List<Intervention> interventions, RouteSetGenerator rsg, Zoning zoning, Properties props)¶ The constructor for the demand prediction model.
Parameters: - roadNetwork – Road network for assignment.
- baseYearODMatrixFile – Base-year origin-destination matrix file name.
- baseYearFreightMatrixFile – Base-year freight matrix file name.
- populationFile – Population file name.
- GVAFile – GVA file name.
- elasticitiesFile – Elasticities file name.
- elasticitiesFreightFile – Elasticities freight file name.
- energyUnitCostsFile – Energy unit costs file name.
- unitCO2EmissionsFile – Unit CO2 emissions file name.
- engineTypeFractionsFile – Engine type fractions file.
- autonomousVehiclesFractionsFile – Autonomous vehicles fractions file.
- interventions – List of interventions.
- rsg – Route Set Generator with routes for both cars and freight.
- zoning – Zoning system (used for ‘tempro’ and ‘combined’ assignment type).
- props – Properties file.
Throws: - IOException – if any.
- FileNotFoundException – if any.
Methods¶
-
public void
addCongestionCharges
(int year, PricingPolicy congestionCharges)¶ Adds congestion charges to the list of the existing ones.
Parameters: - year – Year of the policy.
- congestionCharges – Congestion charges.
-
public List<PricingPolicy>
getCongestionCharges
(int year)¶ Getter method for congestion charges.
Parameters: - year – Year of the congestion charges.
Returns: Congestion charges.
-
public SkimMatrix
getCostSkimMatrix
(int year)¶ Getter method for cost skim matrix in a given year.
Parameters: - year – Year for which the the skim matrix is requested.
Returns: Cost skim matrix.
-
public SkimMatrixFreight
getCostSkimMatrixFreight
(int year)¶ Getter method for freight cost skim matrix in a given year.
Parameters: - year – Year for which the the skim matrix is requested.
Returns: Cost skim matrix.
-
public Map<VehicleType, Map<EngineType, Double>>
getEngineTypeFractions
(int year)¶ Getter method for engine type fractions in a given year.
Parameters: - year – Year of the data.
Returns: Map with engine type fractions.
-
public FreightMatrix
getFreightDemand
(int year)¶ Getter method for the freight demand in a given year.
Parameters: - year – Year for which the demand is requested.
Returns: Origin-destination matrix with freight vehicle flows.
-
public ODMatrixMultiKey
getPassengerDemand
(int year)¶ Getter method for the passenger demand in a given year.
Parameters: - year – Year for which the demand is requested.
Returns: Origin-destination matrix with passenger vehicle flows.
-
public RoadNetwork
getRoadNetwork
()¶ Getter method for the road network.
Returns: Road network.
-
public RoadNetworkAssignment
getRoadNetworkAssignment
(int year)¶ Getter method for the road network assignment in a given year.
Parameters: - year – Year for which the road network assignment is requested.
Returns: Road network assignment.
-
public SkimMatrix
getTimeSkimMatrix
(int year)¶ Getter method for time skim matrix in a given year.
Parameters: - year – Year for which the the skim matrix is requested.
Returns: Time skim matrix.
-
public SkimMatrixFreight
getTimeSkimMatrixFreight
(int year)¶ Getter method for freight time skim matrix in a given year.
Parameters: - year – Year for which the the skim matrix is requested.
Returns: Time skim matrix.
-
public void
predictHighwayDemand
(int predictedYear, int fromYear)¶ Predicts (passenger and freight) highway demand (origin-destination vehicle flows).
Parameters: - predictedYear – The year for which the demand is predicted.
- fromYear – The year from which demand the prediction is made.
-
public void
predictHighwayDemandUsingResultsOfFromYear
(int predictedYear, int fromYear)¶ Predicts (passenger and freight) highway demand (origin-destination vehicle flows). Uses already existing results of the fromYear.
Parameters: - predictedYear – The year for which the demand is predicted.
- fromYear – The year from which demand the prediction is made.
-
public void
predictHighwayDemands
(int toYear, int baseYear)¶ Predicts (passenger and freight) highway demand (origin-destination vehicle flows) for all years from baseYear to toYear
Parameters: - toYear – The final year for which the demand is predicted.
- baseYear – The base year from which the predictions are made.
-
public void
removeCongestionCharges
(int year, PricingPolicy congestionCharges)¶ Removes congestion charges from the list of the existing ones.
Parameters: - year – Year of the congestion charges.
- congestionCharges – Congestion charges.
-
public void
saveAllResults
(int toYear, int baseYear)¶ Saves all results from baseYear to toYear (including intermediate if flat is set)
Parameters: - toYear – The final year for which the demand is predicted.
- baseYear – The base year from which the predictions are made.
-
public void
saveAllResults
(int year)¶ Saves all results into the output folder.
Parameters: - year – Year of the data.
-
public void
setCongestionCharges
(int year, List<PricingPolicy> congestionCharges)¶ Setter method for congestion charges (overrides them completely).
Parameters: - year – Year of the congestion charges.
- congestionCharges – Congestion charges.
-
public void
setEngineTypeFractions
(int year, Map<VehicleType, Map<EngineType, Double>> engineTypeFractions)¶ Setter method for engine type fractions in a given year.
Parameters: - year – Year of the data.
- engineTypeFractions – Map with engine type fractions.
-
public void
setEngineTypeFractions
(int year, VehicleType vht, Map<EngineType, Double> engineTypeFractions)¶ Setter method for engine type fractions in a given year for a specific vehicle type.
Parameters: - year – Year of the data.
- vht – Vehicle type.
- engineTypeFractions – Map with engine type fractions.
DemandModel.ElasticityTypes¶
-
public static enum
ElasticityTypes
¶
Enum Constants¶
-
public static final DemandModel.ElasticityTypes
COST
¶
-
public static final DemandModel.ElasticityTypes
GVA
¶
-
public static final DemandModel.ElasticityTypes
POPULATION
¶
-
public static final DemandModel.ElasticityTypes
TIME
¶
EstimatedODMatrix¶
-
public class
EstimatedODMatrix
extends RealODMatrix¶ Origin-destination matrix created from productions, attractions and observed trip length distribution.
Author: Milan Lovric
Fields¶
Constructors¶
-
public
EstimatedODMatrix
(HashMap<String, Integer> productions, HashMap<String, Integer> attractions, SkimMatrix distanceSkimMatrix, double[] binLimitsKm, double[] observedTripLengthDistribution)¶ Constructor for estimated OD matrix.
Parameters: - productions – Productions
- attractions – Attractions
- distanceSkimMatrix – Distance skim matrix
- binLimitsKm – Bin limits in km
- observedTripLengthDistribution – Observed trip length distribution (normalised).
-
public
EstimatedODMatrix
(String fileName, SkimMatrix distanceSkimMatrix, double[] binLimitsKm, double[] observedTripLengthDistribution)¶ Constructor for estimated OD matrix that reads productions and attractions from an input csv file.
Parameters: - fileName – Path to the input file with productions and attractions
- distanceSkimMatrix – Distance skim matrix
- binLimitsKm – Bin limits in km
- observedTripLengthDistribution – Observed trip length distribution (normalised).
Throws: - IOException – if any.
- FileNotFoundException – if any.
Methods¶
-
public ODMatrixMultiKey
getBinIndexMatrix
()¶ Getter method for the bin index matrix.
Returns: Bin index matrix
-
public double[]
getObservedTripLengthDistribution
()¶ Getter method for the observed trip length distribution.
Returns: Observed trip length distribution
-
public double[]
getTripLengthDistribution
()¶ Getter method for the trip length distribution.
Returns: Trip length distribution
-
public void
iterate
()¶ Iterates scaling to productions, scaling to attractions, rounding and scaling to observed trip length distribution.
-
public void
printMatrixFormatted
(int precision)¶ Prints the matrix as a formatted table.
FreightMatrix¶
-
public class
FreightMatrix
¶ Origin-destination matrix for freight vehicles (following the format of DfT’s BYFM 2006 study).
Author: Milan Lovric
Fields¶
Constructors¶
Methods¶
-
public static FreightMatrix
createUnitBYFMMatrix
()¶ Creates a unit freight matrix for the specific DfT BYFM 2006 zoning system.
Returns: Unit BYFM freight matrix.
-
public void
deleteInterzonalFlows
(int zone)¶ Deletes all inter-zonal flows to/from a particular zone (leaving only intra-zonal flows)
Parameters: - zone – Zone for which inter-zonal flows need to be deleted from the freight matrix.
-
public double
getAbsoluteDifference
(FreightMatrix other)¶ Gets sum of absolute differences between elements of two matrices.
Parameters: - other – The other matrix.
Returns: Sum of absolute differences.
-
public int
getFlow
(int origin, int destination, int vehicleType)¶ Gets the flow for a given origin-destination pair.
Parameters: - origin – Freight origin.
- destination – Freight destination.
- vehicleType – Vehicle type.
Returns: Origin-destination flow.
-
public FreightMatrix
getScaledMatrix
(double scale)¶ Multiplies each value of the matrix with a scaling factor.
Parameters: - scale – Scaling factor.
Returns: Scaled freight matrix.
-
public int
getTotalIntFlow
()¶ Gets sum of all the flows in the matrix.
Returns: Sum of all the flows in the matrix (i.e. number of trips).
-
public void
scaleMatrix
(SkimMatrixFreight scale)¶ Scales matrix flows using a real-valued scaling matrix.
Parameters: - scale – Scaling factors.
ODMatrixArray¶
-
public class
ODMatrixArray
implements AssignableODMatrix¶ Origin-destination matrix for passenger vehicles.
Author: Milan Lovric
Constructors¶
-
public
ODMatrixArray
(RealODMatrix realMatrix, Zoning zoning)¶ Constructor that rounds the flows of a real-valued OD matrix.
Parameters: - realMatrix – Origin-destination matrix with real-valued flows.
- zoning – Zoning system.
Methods¶
-
public static ODMatrixArray
createLadMatrixFromTEMProMatrix
(ODMatrixArrayTempro temproMatrix, Zoning zoning)¶ Creates LAD OD matrix from TEMPro OD matrix.
Parameters: - temproMatrix – TEMPro ODMatrix used as weights to disaggregate LAD matrix.
- zoning – Zoning system with mapping between TEMPro and LAD zones.
Returns: LAD based OD matrix.
-
public static ODMatrixArrayTempro
createTEMProFromLadMatrix
(ODMatrixArray ladODMatrix, ODMatrixArrayTempro baseTempro, Zoning zoning)¶ Creates tempro OD matrix from LAD OD matrix.
Parameters: - ladODMatrix – LAD to LAD OD matrix.
- baseTempro – TEMPro ODMatrix used as weights to disaggregate LAD matrix.
- zoning – Zoning system with mapping between TEMPro and LAD zones.
Returns: TEMPro based OD matrix.
-
public static ODMatrixArray
createUnitMatrix
(List<String> origins, List<String> destinations, Zoning zoning)¶ Creates a unit OD matrix for given lists of origin and destination zones.
Parameters: - origins – List of origin zones.
- destinations – List of destination zones.
- zoning – Zoning system.
Returns: Unit OD matrix.
-
public static ODMatrixArray
createUnitMatrix
(List<String> zones, Zoning zoning)¶ Creates a quadratic unit OD matrix for a given lists of zones.
Parameters: - zones – List of origin zones.
- zoning – Zoning system.
Returns: Unit OD matrix.
-
public static ODMatrixArray
createUnitMatrix
(Set<String> zones, Zoning zoning)¶ Creates a quadratic unit OD matrix for a given lists of zones.
Parameters: - zones – Set of origin zones.
- zoning – Zoning system.
Returns: Unit OD matrix.
-
public int
getAbsoluteDifference
(ODMatrixArray other)¶ Gets sum of absolute differences between elements of two matrices.
Parameters: - other – The other matrix.
Returns: Sum of absolute differences.
-
public int
getFlow
(int originZoneID, int destinationZoneID)¶ Gets the flow for a given origin-destination pair.
Parameters: - originZoneID – Origin zone ID.
- destinationZoneID – Destination zone ID.
Returns: Origin-destination flow.
-
public int
getIntFlow
(int originZoneID, int destinationZoneID)¶ Gets the flow for a given origin-destination pair as a whole number.
Parameters: - originZoneID – Origin zone ID.
- destinationZoneID – Destination zone ID.
Returns: Origin-destination flow.
-
public int
getTotalFlow
()¶ Gets sum of all the flows in the matrix.
Returns: Sum of all the flows in the matrix (i.e. number of trips).
-
public int
getTotalIntFlow
()¶ Gets sum of all the flows in the matrix.
Returns: Sum of all the flows in the matrix (i.e. number of trips).
-
public void
scaleMatrixValue
(double factor)¶ Scales (and rounds) matrix values with a scaling factor.
Parameters: - factor – Scaling factor.
ODMatrixArrayTempro¶
-
public class
ODMatrixArrayTempro
implements AssignableODMatrix¶ Origin-destination matrix with real values, memory use optimised for Tempro.
Author: Milan Lovric
Methods¶
-
public ODMatrixArrayTempro
clone
()¶
-
public static RealODMatrix
createLadMatrixFromTEMProMatrix
(ODMatrixArrayTempro temproMatrix, Zoning zoning)¶ Creates real-valued LAD OD matrix from real-valued TEMPro OD matrix.
Parameters: - temproMatrix – TEMPro ODMatrix which should be aggregated to LAD matrix.
- zoning – Zoning system with mapping between TEMPro and LAD zones.
Returns: LAD based real-valued OD matrix.
-
public static ODMatrixArrayTempro
createTEMProFromLadMatrix
(ODMatrixArray ladODMatrix, ODMatrixArrayTempro baseTempro, Zoning zoning)¶ Creates tempro OD matrix from LAD OD matrix.
Parameters: - ladODMatrix – LAD to LAD OD matrix.
- baseTempro – TEMPro ODMatrix used as weights to disaggregate LAD matrix.
- zoning – Zoning system with mapping between TEMPro and LAD zones.
Returns: TEMPro based OD matrix.
-
public static ODMatrixArrayTempro
createTEMProFromLadMatrix
(ODMatrixMultiKey ladODMatrix, ODMatrixArrayTempro baseTempro, Zoning zoning)¶ Creates tempro OD matrix from LAD OD matrix.
Parameters: - ladODMatrix – LAD to LAD OD matrix.
- baseTempro – TEMPro ODMatrix used as weights to disaggregate LAD matrix.
- zoning – Zoning system with mapping between TEMPro and LAD zones.
Returns: TEMPro based OD matrix.
-
public static ODMatrixArrayTempro
createUnitMatrix
(List<String> origins, List<String> destinations, Zoning zoning)¶ Creates a unit OD matrix for given lists of origin and destination zones.
Parameters: - origins – List of origin zones.
- destinations – List of destination zones.
- zoning – Zoning system.
Returns: Unit OD matrix.
-
public static ODMatrixArrayTempro
createUnitMatrix
(List<String> zones, Zoning zoning)¶ Creates a quadratic unit OD matrix for a given lists of zones.
Parameters: - zones – List of zones.
Returns: Unit OD matrix.
-
public static ODMatrixArrayTempro
createUnitMatrix
(Set<String> zones, Zoning zoning)¶ Creates a quadratic unit OD matrix for a given lists of zones.
Parameters: - zones – Set of zones.
- zoning – Zoning system.
Returns: Unit OD matrix.
-
public static ODMatrixArrayTempro
createUnitMatrix
(Zoning zoning)¶ Creates a quadratic unit OD matrix.
Parameters: - zoning – Zoning system.
Returns: Unit OD matrix.
-
public int
getAbsoluteDifference
(ODMatrixArrayTempro other)¶ Gets sum of absolute differences between elements of two matrices.
Parameters: - other – The other matrix.
Returns: Sum of absolute differences.
-
public int
getTotalIntFlow
()¶ Gets sum of all the (rounded) flows in the matrix.
Returns: Sum of all the (rounded) flows in the matrix (i.e. number of trips).
-
public void
scaleMatrixValue
(double factor)¶ Scales matrix values with a scaling factor.
Parameters: - factor – Scaling factor.
-
public void
scaleMatrixValue
(ODMatrixArrayTempro scalingMatrix)¶ Scales matrix values with another matrix (element-wise multiplication).
Parameters: - scalingMatrix – Scaling matrix.
-
public void
setFlow
(int originCode, int destinationCode, int flow)¶ Sets the flow for a given origin-destination pair.
Parameters: - originCode – Origin zone integer code.
- destinationCode – Destination zone integer code.
- flow – Origin-destination flow.
-
public int
sumMatrixSubset
(List<String> origins, List<String> destinations)¶ Sums the elements of a matrix subset (provided as two lists of origins and destinations).
Parameters: - origins – List of origin zones (a subset).
- destinations – List of destination zones (a subset).
Returns: Sum of the subset.
ODMatrixMultiKey¶
-
public class
ODMatrixMultiKey
implements AssignableODMatrix¶ Origin-destination matrix for passenger vehicles.
Author: Milan Lovric
Constructors¶
-
public
ODMatrixMultiKey
(RealODMatrix realMatrix)¶ Constructor that rounds the flows of a real-valued OD matrix.
Parameters: - realMatrix – Origin-destination matrix with real-valued flows.
Methods¶
-
public ODMatrixMultiKey
clone
()¶
-
public static ODMatrixMultiKey
createLadMatrixFromTEMProMatrix
(ODMatrixMultiKey temproMatrix, Zoning zoning)¶ Creates LAD OD matrix from TEMPro OD matrix.
Parameters: - temproMatrix – TEMPro ODMatrix used as weights to disaggregate LAD matrix.
- zoning – Zoning system with mapping between TEMPro and LAD zones.
Returns: LAD based OD matrix.
-
public static ODMatrixMultiKey
createSparseUnitMatrix
(Set<String> zones, HashMap<String, Point> centroids, double threshold)¶ Creates a unit OD matrix for a given lists of zones with a distance threshold. If straight line distance between origin and destination zone centroids is larger than threshold that flow is zero.
Parameters: - zones – Set of origin zones.
- centroids – List of zone centroids.
- threshold – Distance threshold in [m].
Returns: Unit OD matrix.
-
public static ODMatrixMultiKey
createTEMProFromLadMatrix
(ODMatrixMultiKey ladODMatrix, ODMatrixMultiKey baseTempro, Zoning zoning)¶ Creates tempro OD matrix from LAD OD matrix.
Parameters: - ladODMatrix – LAD to LAD OD matrix.
- baseTempro – TEMPro ODMatrix used as weights to disaggregate LAD matrix.
- zoning – Zoning system with mapping between TEMPro and LAD zones.
Returns: TEMPro based OD matrix.
-
public static ODMatrixMultiKey
createUnitMatrix
(List<String> zones)¶ Creates a quadratic unit OD matrix for a given lists of zones.
Parameters: - zones – List of origin zones.
Returns: Unit OD matrix.
-
public static ODMatrixMultiKey
createUnitMatrix
(Set<String> zones)¶ Creates a quadratic unit OD matrix for a given lists of zones.
Parameters: - zones – Set of origin zones.
Returns: Unit OD matrix.
-
public double
getAbsoluteDifference
(ODMatrixMultiKey other)¶ Gets sum of absolute differences between elements of two matrices.
Parameters: - other – The other matrix.
Returns: Sum of absolute differences.
-
public int
getTotalFlow
()¶ Gets sum of all the flows in the matrix.
Returns: Sum of all the flows in the matrix (i.e. number of trips).
-
public int
getTotalIntFlow
()¶ Gets sum of all the flows in the matrix.
Returns: Sum of all the flows in the matrix (i.e. number of trips).
-
public void
scaleMatrixValue
(double factor)¶ Scales (and rounds) matrix values with a scaling factor.
Parameters: - factor – Scaling factor.
-
public int
sumMatrixSubset
(List<String> origins, List<String> destinations)¶ Sums the elements of a matrix subset (provided as two lists of origins and destinations).
Parameters: - origins – List of origin zones (a subset).
- destinations – List of destination zones (a subset).
Returns: Sum of the subset.
RealODMatrix¶
-
public class
RealODMatrix
implements AssignableODMatrix¶ Origin-destination matrix with real values.
Author: Milan Lovric
Constructors¶
Methods¶
-
public RealODMatrix
clone
()¶
-
public static RealODMatrix
createLadMatrixFromTEMProMatrix
(RealODMatrix temproMatrix, Zoning zoning)¶ Creates LAD OD matrix from Tempro OD matrix.
Parameters: - temproMatrix – TEMPro ODMatrix used as weights to disaggregate LAD matrix.
- zoning – Zoning system with mapping between TEMPro and LAD zones.
Returns: LAD based OD matrix.
-
public static RealODMatrix
createTEMProFromLadMatrix
(RealODMatrix ladODMatrix, RealODMatrix baseTempro, Zoning zoning)¶ Creates tempro OD matrix from LAD OD matrix.
Parameters: - ladODMatrix – LAD to LAD OD matrix.
- baseTempro – TEMPro ODMatrix used as weights to disaggregate LAD matrix.
- zoning – Zoning system with mapping between TEMPro and LAD zones.
Returns: TEMPro based OD matrix.
-
public static RealODMatrix
createUnitMatrix
(List<String> zones)¶ Creates a quadratic unit OD matrix for a given lists of zones.
Parameters: - zones – List of zones.
Returns: Unit OD matrix.
-
public static RealODMatrix
createUnitMatrix
(Set<String> zones)¶ Creates a quadratic unit OD matrix for a given lists of zones.
Parameters: - zones – Set of zones.
Returns: Unit OD matrix.
-
public double
getAbsoluteDifference
(RealODMatrix other)¶ Gets sum of absolute differences between elements of two matrices.
Parameters: - other – The other matrix.
Returns: Sum of absolute differences.
-
public int
getTotalIntFlow
()¶ Gets sum of all the (rounded) flows in the matrix.
Returns: Sum of all the (rounded) flows in the matrix (i.e. number of trips).
-
public void
printMatrixFormatted
(int precision)¶ Prints the matrix as a formatted table.
Parameters: - precision – Number of decimal places for the matrix value.
-
public void
scaleMatrixValue
(double factor)¶ Scales matrix values with a scaling factor.
Parameters: - factor – Scaling factor.
-
public void
scaleMatrixValue
(RealODMatrix scalingMatrix)¶ Scales matrix values with another matrix (element-wise multiplication).
Parameters: - scalingMatrix – Scaling matrix.
-
public double
sumMatrixSubset
(List<String> origins, List<String> destinations)¶ Sums the elements of a matrix subset (provided as two lists of origins and destinations).
Parameters: - origins – List of origin zones (a subset).
- destinations – List of destination zones (a subset).
Returns: Sum of the subset.
RealODMatrixTempro¶
-
public class
RealODMatrixTempro
implements AssignableODMatrix¶ Origin-destination matrix with real values, memory use optimised for Tempro.
Author: Milan Lovric
Methods¶
-
public RealODMatrixTempro
clone
()¶
-
public static RealODMatrix
createLadMatrixFromTEMProMatrix
(RealODMatrixTempro temproMatrix, Zoning zoning)¶ Creates real-valued LAD OD matrix from real-valued TEMPro OD matrix.
Parameters: - temproMatrix – TEMPro ODMatrix which should be aggregated to LAD matrix.
- zoning – Zoning system with mapping between TEMPro and LAD zones.
Returns: LAD based real-valued OD matrix.
-
public static RealODMatrixTempro
createTEMProFromLadMatrix
(RealODMatrix ladODMatrix, RealODMatrixTempro baseTempro, Zoning zoning)¶ Creates tempro OD matrix from LAD OD matrix.
Parameters: - ladODMatrix – LAD to LAD OD matrix.
- baseTempro – TEMPro ODMatrix used as weights to disaggregate LAD matrix.
- zoning – Zoning system with mapping between TEMPro and LAD zones.
Returns: TEMPro based OD matrix.
-
public static RealODMatrixTempro
createTEMProFromLadMatrix
(ODMatrixMultiKey ladODMatrix, RealODMatrixTempro baseTempro, Zoning zoning)¶ Creates tempro OD matrix from LAD OD matrix.
Parameters: - ladODMatrix – LAD to LAD OD matrix.
- baseTempro – TEMPro ODMatrix used as weights to disaggregate LAD matrix.
- zoning – Zoning system with mapping between TEMPro and LAD zones.
Returns: TEMPro based OD matrix.
-
public static RealODMatrixTempro
createUnitMatrix
(List<String> origins, List<String> destinations, Zoning zoning)¶ Creates a unit OD matrix for given lists of origin and destination zones.
Parameters: - origins – List of origin zones.
- destinations – List of destination zones.
- zoning – Zoning system.
Returns: Unit OD matrix.
-
public static RealODMatrixTempro
createUnitMatrix
(List<String> zones, Zoning zoning)¶ Creates a quadratic unit OD matrix for a given lists of zones.
Parameters: - zones – List of zones.
Returns: Unit OD matrix.
-
public static RealODMatrixTempro
createUnitMatrix
(Set<String> zones, Zoning zoning)¶ Creates a quadratic unit OD matrix for a given lists of zones.
Parameters: - zones – Set of zones.
- zoning – Zoning system.
Returns: Unit OD matrix.
-
public static RealODMatrixTempro
createUnitMatrix
(Zoning zoning)¶ Creates a quadratic unit OD matrix.
Parameters: - zoning – Zoning system.
Returns: Unit OD matrix.
-
public double
getAbsoluteDifference
(RealODMatrixTempro other)¶ Gets sum of absolute differences between elements of two matrices.
Parameters: - other – The other matrix.
Returns: Sum of absolute differences.
-
public int
getTotalIntFlow
()¶ Gets sum of all the (rounded) flows in the matrix.
Returns: Sum of all the (rounded) flows in the matrix (i.e. number of trips).
-
public void
printMatrixFormatted
(int precision)¶ Prints the matrix as a formatted table.
Parameters: - precision – Number of decimal places for the matrix value.
-
public void
scaleMatrixValue
(double factor)¶ Scales matrix values with a scaling factor.
Parameters: - factor – Scaling factor.
-
public void
scaleMatrixValue
(RealODMatrixTempro scalingMatrix)¶ Scales matrix values with another matrix (element-wise multiplication).
Parameters: - scalingMatrix – Scaling matrix.
-
public void
setFlow
(int originCode, int destinationCode, double flow)¶ Sets the flow for a given origin-destination pair.
Parameters: - originCode – Origin zone integer code.
- destinationCode – Destination zone integer code.
- flow – Origin-destination flow.
-
public double
sumMatrixSubset
(List<String> origins, List<String> destinations)¶ Sums the elements of a matrix subset (provided as two lists of origins and destinations).
Parameters: - origins – List of origin zones (a subset).
- destinations – List of destination zones (a subset).
Returns: Sum of the subset.
RebalancedFreightMatrix¶
-
public class
RebalancedFreightMatrix
extends FreightMatrix¶ Freight matrix created by directly scaling flows using traffic counts. Base on DfT’s BYFM 2006 zoning system (LAD + distribution centres + seaports + airports).
Author: Milan Lovric
Constructors¶
-
public
RebalancedFreightMatrix
(RoadNetworkAssignment rna, RouteSetGenerator rsg, Properties params)¶ Constructor for a rebalanced freight matrix that uses network assignment and traffic counts for matrix rebalancing.
Parameters: - origins – List of origin zones.
- destinations – List of destination zones.
- rna – Road network assignment.
- rsg – Route set generator.
- params – Properties.
-
public
RebalancedFreightMatrix
(String fileName, RoadNetworkAssignment rna, RouteSetGenerator rsg, Properties params)¶ Constructor for a rebalanced freight matrix that uses network assignment and traffic counts for matrix rebalancing.
Parameters: - fileName – Path to the file with the initial OD matrix.
- origins – List of origin zones.
- destinations – List of destination zones.
- rna – Road network assignment.
- rsg – Route set generator.
- params – Properties.
Throws: - IOException – if any.
- FileNotFoundException – if any.
Methods¶
-
public void
assignAndCalculateRMSN
()¶ Assigns OD matrix and calculates RMSN with traffic counts.
-
public Map<VehicleType, List<Double>>
getRMSNvalues
()¶ Gets the list of RMSN values over all performed rebalancing iterations.
Returns: List of RMSN values.
-
public SkimMatrixFreightArray
getScalingFactors
()¶ Calculates scaling factors for OD pairs.
Returns: Scaling factors.
RebalancedODMatrix¶
-
public class
RebalancedODMatrix
extends RealODMatrix¶ Origin-destination matrix (LAD based) created by directly scaling flows using traffic counts.
Author: Milan Lovric
Constructors¶
-
public
RebalancedODMatrix
(List<String> origins, List<String> destinations, RoadNetworkAssignment rna, RouteSetGenerator rsg, Properties params)¶ Constructor for a rebalanced OD matrix that uses network assignment and traffic counts for matrix rebalancing.
Parameters: - origins – List of origin zones.
- destinations – List of destination zones.
- rna – Road network assignment.
- rsg – Route set generator.
- params – Properties.
Methods¶
-
public void
assignAndCalculateRMSN
()¶ Assigns OD matrix and calculates RMSN with traffic counts.
-
public RealODMatrix
getScalingFactors
()¶ Calculates scaling factors for OD pairs.
Returns: Scaling factors.
RebalancedTemproODMatrix¶
-
public class
RebalancedTemproODMatrix
extends RealODMatrixTempro¶ Origin-destination matrix (Tempro based) created by directly scaling flows using traffic counts.
Author: Milan Lovric
Constructors¶
-
public
RebalancedTemproODMatrix
(List<String> origins, List<String> destinations, RoadNetworkAssignment rna, RouteSetGenerator rsg, Zoning zoning, Properties params)¶ Constructor for a rebalanced OD matrix that uses network assignment and traffic counts for matrix rebalancing.
Parameters: - origins – List of origin zones.
- destinations – List of destination zones.
- rna – Road network assignment.
- rsg – Route set generator.
- zoning – Zoning system.
- params – Properties.
-
public
RebalancedTemproODMatrix
(String fileName, RoadNetworkAssignment rna, RouteSetGenerator rsg, Zoning zoning, Properties params)¶ Constructor for a rebalanced OD matrix that uses network assignment and traffic counts for matrix rebalancing.
Parameters: - fileName – Path to the file with the initial OD matrix.
- rna – Road network assignment.
- rsg – Route set generator.
- zoning – Zoning system.
Throws: - IOException – if any.
- FileNotFoundException – if any.
Methods¶
-
public void
assignAndCalculateRMSN
()¶ Assigns OD matrix and calculates RMSN with traffic counts.
-
public RealODMatrixTempro
getScalingFactors
()¶ Calculates scaling factors for OD pairs.
Returns: Scaling factors.
SkimMatrix¶
-
public interface
SkimMatrix
¶ Skim matrix for storing inter-zonal travel times or costs (for passenger vehicles).
Author: Milan Lovric
Methods¶
-
public double
getAbsoluteDifference
(SkimMatrix other)¶ Gets sum of absolute differences between elements of two matrices.
Parameters: - other – The other matrix.
Returns: Sum of absolute differences.
-
public double
getCost
(int originZoneID, int destinationZoneID)¶ Gets cost for a given origin-destination pair using int zone IDs.
Parameters: - originZone – Origin zone ID.
- destinationZone – Destination zone ID.
Returns: Origin-destination cost.
SkimMatrixArray¶
-
public class
SkimMatrixArray
implements SkimMatrix¶ Skim matrix for storing inter-zonal travel times or costs (for passenger vehicles).
Author: Milan Lovric
Methods¶
-
public double
getAbsoluteDifference
(SkimMatrix other)¶ Gets sum of absolute differences between elements of two matrices.
Parameters: - other – The other matrix.
Returns: Sum of absolute differences.
-
public double
getAverageCost
(ODMatrixMultiKey flows)¶ Gets average OD cost weighted by demand.
Parameters: - flows – The demand as an origin-destination matrix.
Returns: Average cost.
-
public double
getCost
(int originZoneID, int destinationZoneID)¶ Gets cost for a given origin-destination pair.
Parameters: - originZoneID – Origin zone ID.
- destinationZoneID – Destination zone ID.
Returns: Origin-destination cost.
-
public double
getSumOfCosts
(ODMatrixMultiKey flows)¶ Gets sum of costs multiplied by demand flows.
Parameters: - flows – The demand as an origin-destination matrix.
Returns: Sum of costs.
SkimMatrixArrayTempro¶
-
public class
SkimMatrixArrayTempro
implements SkimMatrix¶ Skim matrix for storing inter-zonal travel times or costs (for passenger vehicles).
Author: Milan Lovric
Methods¶
-
public double
getAbsoluteDifference
(SkimMatrix other)¶ Gets sum of absolute differences between elements of two matrices.
Parameters: - other – The other matrix.
Returns: Sum of absolute differences.
-
public double
getAverageCost
(ODMatrixMultiKey flows)¶ Gets average OD cost weighted by demand.
Parameters: - flows – The demand as an origin-destination matrix.
Returns: Average cost.
-
public double
getCost
(int originZoneID, int destinationZoneID)¶ Gets cost for a given origin-destination pair.
Parameters: - originZoneID – Origin zone ID.
- destinationZoneID – Destination zone ID.
Returns: Origin-destination cost.
-
public double
getSumOfCosts
(ODMatrixMultiKey flows)¶ Gets sum of costs multiplied by demand flows.
Parameters: - flows – The demand as an origin-destination matrix.
Returns: Sum of costs.
SkimMatrixFreight¶
-
public interface
SkimMatrixFreight
¶ Skim matrix for storing inter-zonal travel times or costs (for freight vehicles).
Author: Milan Lovric
Fields¶
Methods¶
-
public double
getAbsoluteDifference
(SkimMatrixFreight other)¶ Gets sum of absolute differences between elements of two matrices.
Parameters: - other – The other matrix.
Returns: Sum of absolute differences.
-
public double
getAverageCost
(FreightMatrix demand)¶ Gets average cost weighted by the freight demand.
Parameters: - demand – Freight OD matrix.
Returns: Average cost weighted by freight matrix.
-
public double
getCost
(int originZone, int destinationZone, int vehicleType)¶ Gets cost for a given origin-destination pair and a vehicle type.
Parameters: - originZone – Origin zone.
- destinationZone – Destination zone.
- vehicleType – Vehicle type.
Returns: Origin-destination cost.
SkimMatrixFreightArray¶
-
public class
SkimMatrixFreightArray
implements SkimMatrixFreight¶ Skim matrix for storing inter-zonal travel times or costs (for freight vehicles).
Author: Milan Lovric
Constructors¶
Methods¶
-
public double
getAbsoluteDifference
(SkimMatrixFreight other)¶ Gets sum of absolute differences between elements of two matrices.
Parameters: - other – The other matrix.
Returns: Sum of absolute differences.
-
public double
getAverageCost
()¶ Gets average OD cost (ignores empty matrix cells).
Returns: Average cost.
-
public double
getAverageCost
(FreightMatrix flows)¶ Gets average OD cost weighted by demand.
Parameters: - flows – The demand as an origin-destination matrix.
Returns: Average cost.
-
public double
getCost
(int originZone, int destinationZone, int vehicleType)¶ Gets cost for a given origin-destination pair and a vehicle type.
Parameters: - originZone – Origin zone.
- destinationZone – Destination zone.
- vehicleType – Vehicle type.
Returns: Origin-destination cost.
SkimMatrixFreightMultiKey¶
-
public class
SkimMatrixFreightMultiKey
implements SkimMatrixFreight¶ Skim matrix for storing inter-zonal travel times or costs (for freight vehicles).
Author: Milan Lovric
Constructors¶
Methods¶
-
public double
getAbsoluteDifference
(SkimMatrixFreight other)¶ Gets sum of absolute differences between elements of two matrices.
Parameters: - other – The other matrix.
Returns: Sum of absolute differences.
-
public double
getAverageCost
()¶ Gets average OD cost (ignores empty matrix cells).
Returns: Average cost.
-
public double
getAverageCost
(FreightMatrix flows)¶ Gets average OD cost weighted by demand.
Parameters: - flows – The demand as an origin-destination matrix.
Returns: Average cost.
-
public double
getCost
(int originZone, int destinationZone, int vehicleType)¶ Gets cost for a given origin-destination pair and a vehicle type.
Parameters: - originZone – Origin zone.
- destinationZone – Destination zone.
- vehicleType – Vehicle type.
Returns: Origin-destination cost.
SkimMatrixMultiKey¶
-
public class
SkimMatrixMultiKey
implements SkimMatrix¶ Skim matrix for storing inter-zonal travel times or costs (for passenger vehicles).
Author: Milan Lovric
Methods¶
-
public double
getAbsoluteDifference
(SkimMatrix other)¶ Gets sum of absolute differences between elements of two matrices.
Parameters: - other – The other matrix.
Returns: Sum of absolute differences.
-
public double
getAverageCost
(ODMatrixMultiKey flows)¶ Gets average OD cost weighted by demand.
Parameters: - flows – The demand as an origin-destination matrix.
Returns: Average cost.
-
public HashMap<String, Double>
getAverageZonalCosts
(List<String> zones, ODMatrixMultiKey flows)¶ Gets average zonal cost weighted by demand (used for the rail model).
Parameters: - zones – Zones for which zonal costs are required.
- flows – The demand as an origin-destination matrix.
Returns: Map of average zonal costs.
-
public double
getCost
(int originZoneID, int destinationZoneID)¶ Gets cost for a given origin-destination pair.
Parameters: - originZone – Origin zone ID.
- destinationZone – Destination zone ID.
Returns: Origin-destination cost.
-
public double
getSumOfCosts
(ODMatrixMultiKey flows)¶ Gets sum of costs multiplied by demand flows.
Parameters: - flows – The demand as an origin-destination matrix.
Returns: Sum of costs.
nismod.transport.disruption¶
Disruption¶
-
public abstract class
Disruption
¶ Abstract class for a disruption.
Author: Milan Lovric
Constructors¶
-
protected
Disruption
(Properties props)¶
RoadDisruption¶
-
public class
RoadDisruption
extends Disruption¶ Disruption on road links.
Author: Milan Lovric
Constructors¶
-
public
RoadDisruption
(Properties props)¶ Constructor.
Parameters: - props – Properties of the road development intervention.
nismod.transport.network.road¶
RoadNetwork¶
-
public class
RoadNetwork
¶ Routable road network built from the shapefiles.
Author: Milan Lovric
Fields¶
Constructors¶
-
public
RoadNetwork
(URL zonesUrl, URL networkUrl, URL nodesUrl, URL AADFurl, String areaCodeFileName, String areaCodeNearestNodeFile, String workplaceZoneFileName, String workplaceZoneNearestNodeFile, String freightZoneToLADfile, String freightZoneNearestNodeFile, Properties params)¶ Parameters: - zonesUrl – Url for the shapefile with zone polygons.
- networkUrl – Url for the shapefile with road network.
- nodesUrl – Url for the shapefile with nodes.
- AADFurl – Url for the shapefile with AADF counts.
- areaCodeFileName – Path to the file with census output areas.
- areaCodeNearestNodeFile – Path to the file with nearest nodes to output area centroids.
- workplaceZoneFileName – Path to the file with workplace zones.
- workplaceZoneNearestNodeFile – Path to the file with nearest nodes to workplace zone centroids.
- freightZoneToLADfile – Path to the file with freight zone to LAD mapping.
- freightZoneNearestNodeFile – Path to the file with nearest nodes to freight zones that are points.
- params – Properties with parameters from the config file.
Throws: - IOException – if any.
Methods¶
-
public void
addRoadLink
(Edge edge)¶ This adds edge (including its object) to the network - useful for restoring from a list of removed edges (e.g. during disruption).
Parameters: - edge – Edge to be added to the network.
-
public SimpleFeatureCollection
createNetworkFeatureCollection
(Map<Integer, Double> linkData, String linkDataLabel, String shapefilePath)¶ Creates a custom feature collection for the network.
Parameters: - linkData – Data assigned to network links.
- linkDataLabel – The label of the link data.
- shapefilePath – The path to the shapefile into which data will be stored.
Throws: - IOException – if any.
Returns: Feature collection.
-
public Edge
createNewRoadLink
(Node fromNode, Node toNode, int numberOfLanes, char roadCategory, double length, int edgeID)¶ Creates a new (unidirectional) road link (edge) between existing intersections (nodes).
Parameters: - fromNode – Start node of the new road link.
- toNode – End node of the new road link.
- numberOfLanes – Number of lanes in the road link.
- roadCategory – Road category.
- length – Length of the road link.
Returns: Newly created edge.
-
public Map<VehicleType, Integer[]>
getAADFFreightTrafficCounts
()¶ Get car traffic counts data for each link (for combined counts return 1/2 of the count per direction).
Returns: AADF traffic counts per freight vehicle type and per link.
-
public AStarIterator.AStarFunctions
getAstarFunctions
(Node destinationNode)¶ Getter method for the AStar functions (edge cost and heuristic function) based on distance.
Parameters: - destinationNode – Destination node.
Returns: AStar functions.
-
public AStarIterator.AStarFunctions
getAstarFunctionsTime
(Node destinationNode, double[] linkTravelTime)¶ Getter method for the AStar functions (edge cost and heuristic function) based on travel time.
Parameters: - destinationNode – Destination node.
- linkTravelTime – Link travel times to use for edge weighting.
Returns: AStar functions.
-
public double
getAverageAcessEgressDistance
(int node)¶ Average access/egress distance to access a node that has gravitating population.
Parameters: - node – Node to which
Returns: Gravitating population.
-
public double
getAverageAcessEgressDistanceFreight
(int node)¶ Average access/egress distance to access a node that has gravitating population.
Parameters: - node – Node to which
Returns: Gravitating population.
-
public DijkstraIterator.EdgeWeighter
getDijkstraTimeWeighter
(double[] linkTravelTime)¶ Getter method for the Dijkstra edge weighter with time.
Parameters: - linkTravelTime – Link travel times to use for edge weighting.
Returns: Dijkstra edge weighter with time.
-
public DijkstraIterator.EdgeWeighter
getDijkstraWeighter
()¶ Getter method for the Dijkstra edge weighter.
Returns: Dijkstra edge weighter.
-
public Edge[]
getEdgeIDtoEdge
()¶ Getter method for edgeID to edge mapping.
Returns: Edge ID to edge mapping.
-
public double
getEdgeLength
(int edgeID)¶ Gets edge length for a given edge ID.
Parameters: - edgeID – Edge ID.
Returns: Edge length.
-
public RoadPath
getFastestPath
(DirectedNode from, DirectedNode to, double[] linkTravelTime)¶ Gets the fastest path between two nodes using astar algorithm and provided link travel times. Links which have no travel time provided will use free flow travel times.
Parameters: - from – Origin node.
- to – Destination node.
- linkTravelTime – The map with link travel times.
Returns: Fastest path.
-
public RoadPath
getFastestPathDijkstra
(DirectedNode from, DirectedNode to, double[] linkTravelTime)¶ Gets the fastest path between two nodes using Dijkstra’s algorithm and provided link travel times. Links which have no travel time provided will use free flow travel times.
Parameters: - from – Origin node.
- to – Destination node.
- linkTravelTime – The map with link travel times.
Returns: Fastest path.
-
public double[]
getFreeFlowTravelTime
()¶ Getter method for free flow travel time.
Returns: Free flow travel time.
-
public int
getGravitatingPopulation
(int node)¶ Population gravitating to a node.
Parameters: - node – Node to which the population gravitates.
Returns: Gravitating population.
-
public int
getGravitatingWorkplacePopulation
(int node)¶ Workplace population gravitating to a node.
Parameters: - node – Node to which the workplace population gravitates.
Returns: Gravitating workplace population.
-
public int
getMaximumEdgeID
()¶ Getter method for maximum edge ID.
Returns: Maximum edge ID.
-
public int
getMaximumNodeID
()¶ Getter method for maximum node ID.
Returns: Maximum node ID.
-
public DirectedGraph
getNetwork
()¶ Getter method for the road network.
Returns: Directed graph representation of the road network.
-
public Node[]
getNodeIDtoNode
()¶ Getter method for nodeID to node mapping.
Returns: Node ID to node mapping.
-
public double[]
getNodeToAverageAccessEgressDistance
()¶ Getter method for the node to average access/egress distance mapping [in metres].
Returns: Node ID to average access/egress distance mapping.
-
public double[]
getNodeToAverageAccessEgressDistanceFreight
()¶ Getter method for the node to average access/egress distance mapping for freight [in metres].
Returns: Node ID to average access/egress distance mapping for freight.
-
public int[]
getNodeToGravitatingPopulation
()¶ Getter method for the node to gravitating population mapping.
Returns: Node to gravitating population mapping.
-
public int[]
getNumberOfLanes
()¶ Getter method for the number of lanes for each link.
Returns: Link id to number of lanes mapping.
-
public boolean
isBlacklistedAsEndNode
(int nodeId)¶ Finds out if the node is blacklisted as a path end node.
Parameters: - nodeId – Node ID.
Returns: Whether nodes is blacklisted or not.
-
public boolean
isBlacklistedAsStartNode
(int nodeId)¶ Finds out if the node is blacklisted as a path start node.
Parameters: - nodeId – Node ID.
Returns: Whether nodes is blacklisted or not.
-
public void
makeEdgesAdmissible
()¶ Overrides actual edge lengths with straight line distances, when they are smaller than straight line distances.
-
public void
removeRoadLink
(Edge edge)¶ Removes an edge from the road network.
Parameters: - edge – Edge to remove from the road network.
-
public void
sortGravityNodes
()¶ For each zone (LAD) sorts the list of contained nodes based on the gravitating population.
RoadNetwork.EdgeType¶
-
public static enum
EdgeType
¶
Enum Constants¶
-
public static final RoadNetwork.EdgeType
AROAD
¶
-
public static final RoadNetwork.EdgeType
FERRY
¶
-
public static final RoadNetwork.EdgeType
MOTORWAY
¶
RoadNetworkAssignment¶
-
public class
RoadNetworkAssignment
¶ Network assignment of origin-destination flows.
Author: Milan Lovric
Fields¶
Constructors¶
-
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¶
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
public FreightMatrix
calculateAssignedFreightMatrix
()¶ Calculate freight OD matrix from trip list.
Returns: Freight matrix.
-
public ODMatrixMultiKey
calculateAssignedODMatrix
()¶ Calculate assigned OD matrix from trip list.
Returns: ODMatrixMultiKey OD matrix.
-
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.
-
public SkimMatrix
calculateCostSkimMatrix
()¶ Calculates cost skim matrix (zone-to-zone financial costs).
Returns: Inter-zonal skim matrix (cost).
-
public SkimMatrixFreight
calculateCostSkimMatrixFreight
()¶ Calculates cost skim matrix (zone-to-zone financial costs) for freight.
Returns: Inter-zonal skim matrix (cost).
-
public SkimMatrix
calculateDistanceSkimMatrix
()¶ Updates cost skim matrix (zone-to-zone distances).
Returns: Inter-zonal skim matrix (distance).
-
public SkimMatrixFreight
calculateDistanceSkimMatrixFreight
()¶ Updates cost skim matrix (zone-to-zone distances) for freight.
Returns: Inter-zonal skim matrix (distance).
-
public SkimMatrix
calculateDistanceSkimMatrixTempro
()¶ Updates cost skim matrix (zone-to-zone distances).
Parameters: - zoning – Zoning system.
Returns: Inter-zonal skim matrix (distance).
-
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.
-
public Map<VehicleType, Map<EnergyType, Double>>
calculateEnergyConsumptionsPerVehicleType
()¶ Calculates total energy consumptions per vehicle type.
Returns: Total consumption for each energy type.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
public double[]
calculatePeakLinkCapacityUtilisation
()¶ Calculate peak-hour link capacity utilisation (capacity / max. capacity).
Returns: Peak-hour link capacity utilisation [%].
-
public double[]
calculatePeakLinkDensities
()¶ Calculate peak-hour link densities (PCU/lane/km/hr).
Returns: Peak-hour link densities.
-
public double[]
calculatePeakLinkPointCapacities
()¶ Calculate peak-hour link point capacities (PCU/lane/hr).
Returns: Peak-hour link point capacities.
-
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.
-
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.
-
public double
calculateRMSNforSimulatedVolumes
()¶ Calculate prediction error (RMSN for simulated volumes and observed traffic counts).
Returns: Normalised root mean square error.
-
public SkimMatrix
calculateTimeSkimMatrix
()¶ Calculated travel time skim matrix (zone-to-zone travel times).
Returns: Inter-zonal skim matrix (time).
-
public SkimMatrixFreight
calculateTimeSkimMatrixFreight
()¶ Calculated travel time skim matrix (zone-to-zone travel times) for freight.
Returns: Inter-zonal skim matrix (time).
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
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.
-
public Map<VehicleType, Integer[]>
getAADFFreightTrafficCounts
()¶ Getter method for AADF freight traffic counts.
Returns: Freight traffic counts.
-
public Map<VehicleType, Map<EngineType, Map<WebTAG, Double>>>
getEnergyConsumptionParameters
()¶ Getter method for energy consumption WebTAG parameters.
Returns: Energy consumption parameters.
-
public Map<EnergyType, Double>
getEnergyUnitCosts
()¶ Getter method for energy unit costs.
Returns: Energy unit costs.
-
public Map<VehicleType, Map<EngineType, Double>>
getEngineTypeFractions
()¶ Getter method for engine type fractions.
Returns: Engine type fractions.
-
public boolean
getFlagUseRouteChoiceModel
()¶ Getter method for the use route choice model flag.
Returns: Flag.
-
public double[]
getLinkFreeFlowTravelTimes
()¶ Getter method for the link free-flow travel times.
Returns: Link volumes
-
public double[]
getLinkVolumeInPCU
()¶ Getter method for daily link volumes in PCU.
Returns: Link volumes in PCU.
-
public Map<VehicleType, int[]>
getLinkVolumePerVehicleType
()¶ Getter method for daily link volumes per vehicle type.
Returns: Link volumes in PCU per time of day.
-
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.
-
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.
-
public RoadNetwork
getRoadNetwork
()¶ Getter method for the road network.
Returns: Road network.
-
public double
getVolumeToFlowFactor
()¶ Getter method for the volume to flow factor.
Returns: Volume to flow factor.
-
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.
-
public void
printGEHstatistic
()¶ Prints GEH statistics for comparison between simulated and observed hourly car flows.
-
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)
-
public void
printGEHstatisticFreight
()¶ Prints GEH statistics for comparison between simulated and observed hourly freight vehicle flows.
-
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)
-
public void
printHourlyGEHstatistic
()¶ Prints GEH statistics for comparison between simulated and observed hourly car flows.
-
public void
printRMSNstatistic
()¶ Prints RMSN statistic for comparison between simulated daily car volumes and observed daily traffic counts.
-
public void
printRMSNstatisticFreight
()¶ Prints RMSN statistic for comparison between simulated daily freight volumes and observed daily freight traffic counts.
-
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).
-
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).
-
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).
-
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).
-
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).
-
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).
-
public void
setElectricityUnitCost
(double electricityUnitCost)¶ Setter method for the electricity unit cost.
Parameters: - electricityUnitCost – The cost of 1 kWh in £.
-
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)
-
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 £.
-
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.
-
public void
updateCostSkimMatrix
(SkimMatrix costSkimMatrix)¶ Updates cost skim matrix (zone-to-zone financial costs).
Parameters: - costSkimMatrix – Inter-zonal skim matrix (cost).
-
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.
-
public void
updateLinkTravelTimes
()¶ Updates link travel times per time of day.
-
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.
-
public void
updateLinkVolumeInPCU
()¶ Updates daily link volumes in PCU from the trip list and stores it into instance variable.
-
public void
updateLinkVolumeInPCUPerTimeOfDay
()¶ Updates link volumes in PCU per time of day from object’s trip list and stores into instance variable.
-
public void
updateLinkVolumePerVehicleType
()¶ Updates daily link volumes per vehicle type from trip list and stores into instance variable.
-
public void
updateTimeSkimMatrix
(SkimMatrix timeSkimMatrix)¶ Updates travel time skim matrix (zone-to-zone travel times).
Parameters: - timeSkimMatrix – Inter-zonal skim matrix (time).
-
public void
updateTimeSkimMatrixFreight
(SkimMatrixFreight timeSkimMatrixFreight)¶ Updates travel time skim matrix (zone-to-zone travel times) for freight.
Parameters: - timeSkimMatrixFreight – Inter-zonal skim matrix (time).
RoadNetworkAssignment.EnergyType¶
-
public static enum
EnergyType
¶
Enum Constants¶
-
public static final RoadNetworkAssignment.EnergyType
CNG
¶
-
public static final RoadNetworkAssignment.EnergyType
DIESEL
¶
-
public static final RoadNetworkAssignment.EnergyType
ELECTRICITY
¶
-
public static final RoadNetworkAssignment.EnergyType
HYDROGEN
¶
-
public static final RoadNetworkAssignment.EnergyType
LPG
¶
-
public static final RoadNetworkAssignment.EnergyType
PETROL
¶
RoadNetworkAssignment.EngineType¶
-
public static enum
EngineType
¶
Enum Constants¶
-
public static final RoadNetworkAssignment.EngineType
BEV
¶
-
public static final RoadNetworkAssignment.EngineType
FCEV_H2
¶
-
public static final RoadNetworkAssignment.EngineType
HEV_DIESEL
¶
-
public static final RoadNetworkAssignment.EngineType
HEV_PETROL
¶
-
public static final RoadNetworkAssignment.EngineType
ICE_CNG
¶
-
public static final RoadNetworkAssignment.EngineType
ICE_DIESEL
¶
-
public static final RoadNetworkAssignment.EngineType
ICE_H2
¶
-
public static final RoadNetworkAssignment.EngineType
ICE_LPG
¶
-
public static final RoadNetworkAssignment.EngineType
ICE_PETROL
¶
-
public static final RoadNetworkAssignment.EngineType
PHEV_DIESEL
¶
-
public static final RoadNetworkAssignment.EngineType
PHEV_PETROL
¶
RoadNetworkAssignment.TimeOfDay¶
-
public static enum
TimeOfDay
¶
Enum Constants¶
-
public static final RoadNetworkAssignment.TimeOfDay
EIGHTAM
¶
-
public static final RoadNetworkAssignment.TimeOfDay
EIGHTPM
¶
-
public static final RoadNetworkAssignment.TimeOfDay
ELEVENAM
¶
-
public static final RoadNetworkAssignment.TimeOfDay
ELEVENPM
¶
-
public static final RoadNetworkAssignment.TimeOfDay
FIVEAM
¶
-
public static final RoadNetworkAssignment.TimeOfDay
FIVEPM
¶
-
public static final RoadNetworkAssignment.TimeOfDay
FOURAM
¶
-
public static final RoadNetworkAssignment.TimeOfDay
FOURPM
¶
-
public static final RoadNetworkAssignment.TimeOfDay
MIDNIGHT
¶
-
public static final RoadNetworkAssignment.TimeOfDay
NINEAM
¶
-
public static final RoadNetworkAssignment.TimeOfDay
NINEPM
¶
-
public static final RoadNetworkAssignment.TimeOfDay
NOON
¶
-
public static final RoadNetworkAssignment.TimeOfDay
ONEAM
¶
-
public static final RoadNetworkAssignment.TimeOfDay
ONEPM
¶
-
public static final RoadNetworkAssignment.TimeOfDay
SEVENAM
¶
-
public static final RoadNetworkAssignment.TimeOfDay
SEVENPM
¶
-
public static final RoadNetworkAssignment.TimeOfDay
SIXAM
¶
-
public static final RoadNetworkAssignment.TimeOfDay
SIXPM
¶
-
public static final RoadNetworkAssignment.TimeOfDay
TENAM
¶
-
public static final RoadNetworkAssignment.TimeOfDay
TENPM
¶
-
public static final RoadNetworkAssignment.TimeOfDay
THREEAM
¶
-
public static final RoadNetworkAssignment.TimeOfDay
THREEPM
¶
-
public static final RoadNetworkAssignment.TimeOfDay
TWOAM
¶
-
public static final RoadNetworkAssignment.TimeOfDay
TWOPM
¶
RoadNetworkAssignment.VehicleType¶
-
public static enum
VehicleType
¶
Enum Constants¶
-
public static final RoadNetworkAssignment.VehicleType
ARTIC
¶
-
public static final RoadNetworkAssignment.VehicleType
ARTIC_AV
¶
-
public static final RoadNetworkAssignment.VehicleType
CAR
¶
-
public static final RoadNetworkAssignment.VehicleType
CAR_AV
¶
-
public static final RoadNetworkAssignment.VehicleType
RIGID
¶
-
public static final RoadNetworkAssignment.VehicleType
RIGID_AV
¶
-
public static final RoadNetworkAssignment.VehicleType
VAN
¶
-
public static final RoadNetworkAssignment.VehicleType
VAN_AV
¶
RoadPath¶
-
public class
RoadPath
extends Path¶ Directed path (a list of directed nodes).
Author: Milan Lovric
Route¶
-
public class
Route
¶ Route is a sequence of directed edges with a choice utility.
Author: Milan Lovric
Constructors¶
-
public
Route
(RoadNetwork roadNetwork)¶
-
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¶
-
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.
-
public void
addEdgeWithoutValidityCheck
(DirectedEdge edge)¶ Adds a directed edge to the end of the current route.
Parameters: - edge – Directed edge to be added.
-
public void
addEdgeWithoutValidityCheck
(int edgeID)¶ Adds a directed edge to the end of the current route.
Parameters: - edgeID – Directed edge to be added.
-
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.
-
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.
-
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).
-
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.
-
public boolean
contains
(Edge edge)¶ Checks if route contains the edge.
Parameters: - edge – Edge object.
Returns: True if route contains the edge.
-
public boolean
contains
(int edgeID)¶ Checks if route contains the edge.
Parameters: - edgeID – Edge id.
Returns: True if route contains the edge.
-
public DirectedNode
getDestinationNode
()¶ Getter method for destination node.
Returns: Destination node.
-
public TIntArrayList
getEdges
()¶ Getter method for the list of edges.
Returns: List of edge IDs.
-
public int
getNumberOfIntersections
()¶ Getter method for number of intersections.
Returns: Number of intersections.
-
public DirectedNode
getOriginNode
()¶ Getter method for route origin node.
Returns: Origin node.
-
public RoadNetwork
getRoadNetwork
()¶ Getter method for the road network.
Returns: Road network.
-
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.
RouteSet¶
-
public class
RouteSet
¶ RouteSet is a choice set of possible routes between an origin and a destination node.
Author: Milan Lovric
Constructors¶
-
public
RouteSet
(RoadNetwork roadNetwork)¶ Constructor.
Parameters: - roadNetwork – Road network.
Methods¶
-
public void
calculatePathsizes
()¶ Calculate path sizes (also calculates route lengths if they had not been calculated before).
-
public void
calculateProbabilities
()¶ Calculates choice probabilities using logit formula.
-
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.
-
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
-
public DirectedNode
getDestinationNode
()¶ Returns: Destination node of the choice set.
-
public double[]
getPathsizes
()¶ Getter method for pathsizes.
Returns: Choice pathsizes.
-
public double[]
getProbabilities
()¶ Getter method for choice probabilities.
Returns: Choice probabilities.
RouteSet.RouteChoiceParams¶
-
public static enum
RouteChoiceParams
¶
Enum Constants¶
-
public static final RouteSet.RouteChoiceParams
COST
¶
-
public static final RouteSet.RouteChoiceParams
DELAY
¶
-
public static final RouteSet.RouteChoiceParams
INTERSEC
¶
-
public static final RouteSet.RouteChoiceParams
LENGTH
¶
-
public static final RouteSet.RouteChoiceParams
TIME
¶
RouteSetGenerator¶
-
public class
RouteSetGenerator
¶ RouteSetGenerator can generate, save and read route sets for the route choice.
Author: Milan Lovric
Fields¶
Constructors¶
-
public
RouteSetGenerator
(RoadNetwork roadNetwork, Properties props)¶ Constructor for the route set generator.
Parameters: - roadNetwork – Road network.
- props – Parameters from the config file.
Methods¶
-
public void
calculateAllPathsizes
()¶ Calculates all pathsizes for all the route sets (expensive operation).
-
public void
generateRouteSetBetweenFreightZones
(int originFreightZone, int destinationFreightZone)¶ Generates routes between two freight zones. A freight zone can be either an LAD (<= 1032) or a point. 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: - originFreightZone – Origin freight zone.
- destinationFreightZone – Destination freight zone.
-
public void
generateRouteSetBetweenFreightZones
(int originFreightZone, int destinationFreightZone, int topNodes)¶ Generates routes between two freight zones. A freight zone can be either an LAD (<= 1032) or a point. 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: - originFreightZone – Origin freight zone.
- destinationFreightZone – Destination freight zone.
- topNodes – Number of topNodes to consider for inter-zonal routes.
-
public void
generateRouteSetForFreightMatrix
(FreightMatrix freightMatrix, int topNodes)¶ Generates routes for all non-zero OD flows in the freight OD matrix. Zone ID ranges from the BYFM DfT model:
Parameters: - freightMatrix – Freight matrix.
- topNodes – Number of topNodes to consider for inter-zonal routes.
-
public void
generateRouteSetForFreightMatrix
(FreightMatrix freightMatrix, int sliceIndex, int sliceNumber)¶ Generates routes for a slice of the OD matrix (useful for cluster computing), for topNodes only. There might still be some overlap between the slices as some nodes (to which point freight zones are assigned appear again in LAD freight zones).
Parameters: - freightMatrix – Freight matrix.
- sliceIndex – Index of the OD matrix slice for which to generate routes [1..N].
- sliceNumber – Number of slices to divide matrix into (N).
-
public void
generateRouteSetForFreightMatrix
(FreightMatrix freightMatrix, int sliceIndex, int sliceNumber, int topNodes)¶ Generates routes for a slice of the OD matrix (useful for cluster computing), for topNodes only. There might still be some overlap between the slices as some nodes (to which point freight zones are assigned appear again in LAD freight zones).
Parameters: - freightMatrix – Freight matrix.
- sliceIndex – Index of the OD matrix slice for which to generate routes [1..N].
- sliceNumber – Number of slices to divide matrix into (N).
- topNodes – Number of topNodes to consider for inter-zonal routes.
-
public void
generateRouteSetForODMatrix
(ODMatrixMultiKey matrix, int topNodes)¶ Generates routes for all non-zero OD flows in the OD matrix. For inter-zonal flows generates routes only between top N nodes.
Parameters: - matrix – Origin-destination matrix.
- topNodes – Number of topNodes to consider for inter-zonal routes.
-
public void
generateRouteSetForODMatrix
(ODMatrixMultiKey matrix)¶ Generates routes for all non-zero OD flows in the OD matrix.
Parameters: - matrix – Origin-destination matrix.
-
public void
generateRouteSetForODMatrix
(ODMatrixMultiKey matrix, int sliceIndex, int sliceNumber, int topNodes)¶ Generates routes for a slice of the OD matrix (useful for cluster computing), for topNodes only
Parameters: - matrix – Origin-destination matrix.
- sliceIndex – Index of the OD matrix slice for which to generate routes [1..N].
- sliceNumber – Number of slices to divide matrix into (N).
- topNodes – Number of topNodes to consider for inter-zonal routes.
-
public void
generateRouteSetForODMatrix
(ODMatrixMultiKey matrix, int sliceIndex, int sliceNumber)¶ Generates routes for a slice of the Tempro OD matrix (useful for cluster computing).
Parameters: - matrix – Origin-destination matrix.
- sliceIndex – Index of the OD matrix slice for which to generate routes [1..N].
- sliceNumber – Number of slices to divide matrix into (N).
-
public void
generateRouteSetForODMatrixTempro
(ODMatrixMultiKey matrix, Zoning zoning)¶ Generates routes for all non-zero OD flows in the OD matrix.
Parameters: - matrix – Origin-destination matrix.
- zoning – Tempro zoning system.
-
public void
generateRouteSetForODMatrixTempro
(RealODMatrixTempro matrix, Zoning zoning, int sliceIndex, int sliceNumber)¶ Generates routes for a slice of the OD matrix (useful for cluster computing).
Parameters: - matrix – Origin-destination matrix.
- zoning – Tempro zoning system.
- sliceIndex – Index of the OD matrix slice for which to generate routes [1..N].
- sliceNumber – Number of slices to divide matrix into (N).
-
public void
generateRouteSetForODMatrixTemproDistanceBased
(RealODMatrixTempro matrix, Zoning zoning, int sliceIndex, int sliceNumber)¶ Generates routes for a slice of the OD matrix (useful for cluster computing). The number of routes increases the smaller the distance between two Tempro zones.
Parameters: - matrix – Origin-destination matrix.
- zoning – Tempro zoning system.
- sliceIndex – Index of the OD matrix slice for which to generate routes [1..N].
- sliceNumber – Number of slices to divide matrix into (N).
-
public void
generateRouteSetNodeToNode
(int origin, int destination)¶ Generates a route set between two nodes (if it does not already exist in the route set).
Parameters: - origin – Origin node ID.
- destination – Destination node ID.
-
public void
generateRouteSetWithLinkElimination
(int origin, int destination)¶ Generates a route set between two nodes using the link elimination method - It first finds the fastest path and then blocks each of its links and tries to find an alternative path.
Parameters: - origin – Origin node ID.
- destination – Destination node ID.
-
public void
generateRouteSetWithRandomLinkEliminationRestricted
(int origin, int destination)¶ Generates a route set between two nodes using the random link elimination method - It first finds the fastest path and then blocks random links within the fastest path and tries to find an alternative path. The search is limited by the total number of path finding calls and the required number of generated paths.
Parameters: - origin – Origin node ID.
- destination – Destination node ID.
-
public void
generateRouteSetWithRandomLinkEliminationRestricted
(int origin, int destination, int routeLimit, int generationLimit)¶ Generates a route set between two nodes using the random link elimination method - It first finds the fastest path and then blocks random links within the fastest path and tries to find an alternative path. The search is limited by the total number of path finding calls and the required number of generated paths.
Parameters: - origin – Origin node ID.
- destination – Destination node ID.
- routeLimit – Maximum allowed number of generated routes.
- generationLimit – Number of generation trials to get a potentially new route.
-
public void
generateRouteSetZoneToZone
(String originLAD, String destinationLAD, int topNodes)¶ Generates routes between top N nodes (sorted by gravitating population) from two LAD zones. If origin and destination LAD are the same (i.e., intra-zonal), then use all the nodes
Parameters: - originLAD – Origin LAD.
- destinationLAD – Destination LAD.
- topNodes – Number of top nodes within LAD to consider.
-
public int
getNumberOfRouteSets
()¶ Gets the numbers of route sets (OD pairs).
Returns: Number of route sets.
-
public int
getNumberOfRoutes
()¶ Gets the total number of routes.
Returns: Number of routes.
-
public RoadNetwork
getRoadNetwork
()¶ Getter method for the road network.
Returns: Road network.
-
public void
removeRoutesWithEdge
(int edgeID)¶ Removes all the routes that contain a given edge (used for disruption).
Parameters: - edgeID – Edge ID.
Trip¶
-
public class
Trip
¶ This class stores information about a performed trip.
Author: Milan Lovric
Constructors¶
-
public
Trip
(VehicleType vehicle, EngineType engine, Route route, TimeOfDay hour, Integer origin, Integer destination)¶ Constructor for an LAD-based trip. Origin and destination fields are used for freight trips (according to DfT’s BYFM zonal coding). Origin and destination for passenger car/AV trips are 0 as their correct origin and destination LAD zone can be obtained using the first and the last node of the route.
Parameters: - vehicle – Vehicle type.
- engine – Engine type.
- route – Route.
- hour – Time of day.
- origin – Origin zone for freight trips (null for passenger trips).
- destination – Destination zone for freight trips (null for passenger trips).
-
public
Trip
(VehicleType vehicle, EngineType engine, Route route, TimeOfDay hour, Integer origin, Integer destination, int multiplier)¶ Constructor for a trip. Origin and destination are used for freight trips (according to DfT’s BYFM zonal coding). Origin and destination for passenger car/AV trips are 0 as their correct origin and destination LAD zone can be obtained using the first and the last node of the route. Multiplier is used to store multiple instances of the same trip (vs creating multiple objects), thus reducing the memory footprint.
Parameters: - vehicle – Vehicle type.
- engine – Engine type.
- route – Route.
- hour – Time of day.
- origin – Origin zone for freight trips (null for passenger trips).
- destination – Destination zone for freight trips (null for passenger trips).
- multiplier – Multiplies the same trip.
Methods¶
-
protected Map<EnergyType, Double>
getAccessEgressConsumption
(double[] linkTravelTime, double[] averageAccessEgressMap, double averageAccessEgressSpeed, Map<VehicleType, Map<EngineType, Map<WebTAG, Double>>> energyConsumptionParameters, Map<VehicleType, Map<EngineType, Double>> relativeFuelEfficiency)¶ Calculate trip consumption only on access and egress.
Parameters: - linkTravelTime –
- averageAccessEgressMap –
- averageAccessEgressSpeed –
- energyConsumptions –
- relativeFuelEfficiency –
Returns: Trip consumptions.
-
public Double
getCO2emission
(double[] linkTravelTime, double[] averageAccessEgressMap, double averageAccessEgressSpeed, Map<VehicleType, Map<EngineType, Map<WebTAG, Double>>> energyConsumptionParameters, Map<VehicleType, Map<EngineType, Double>> relativeFuelEfficiency, Map<EnergyType, Double> unitCO2Emissions, boolean flagIncludeAccessEgress)¶ Calculates total CO2 emission for the trip.
Parameters: - linkTravelTime – Link travel time.
- averageAccessEgressMap – Average access/egress distance to a node for LAD-based trips.
- averageAccessEgressSpeed – Average accces/egress speed.
- energyConsumptionParameters – Energy consumption parameters.
- relativeFuelEfficiency – Relative fuel efficiency.
- unitCO2Emissions – Unit CO2 emissions.
- boolean – flagIncludeAccessEgress Whether to include access/egress.
Returns: CO2 emissions per energy type.
-
public Map<EnergyType, Double>
getConsumption
(double[] linkTravelTime, double[] averageAccessEgressMap, double averageAccessEgressSpeed, Map<VehicleType, Map<EngineType, Map<WebTAG, Double>>> energyConsumptionParameters, Map<VehicleType, Map<EngineType, Double>> relativeFuelEfficiency, boolean flagIncludeAccessEgress)¶ Calculate trip consumption including access and egress.
Parameters: - linkTravelTime – Link travel time.
- averageAccessEgressMap – Average access/egress distance to a node for LAD-based trips.
- averageAccessEgressSpeed – Average acess/egress speed.
- energyConsumptionParameters – Energy consumption parameters.
- relativeFuelEfficiency – Relative fuel efficiency.
- boolean – flagIncludeAccessEgress Whether to include access/egress.
Returns: Trip consumptions.
-
public double
getCost
(double[] linkTravelTime, double[] averageAccessEgressMap, double averageAccessEgressSpeed, Map<EnergyType, Double> energyUnitCosts, Map<VehicleType, Map<EngineType, Map<WebTAG, Double>>> energyConsumptionParameters, Map<VehicleType, Map<EngineType, Double>> relativeFuelEfficiency, List<PricingPolicy> congestionCharges, boolean flagIncludeAccessEgress)¶ Calculate cost of the trip (fuel cost + congestion charge, if any).
Parameters: - linkTravelTime – Link travel time.
- averageAccessEgressMap – Average access/egress distance to a node for LAD-based trips.
- averageAccessEgressSpeed – Average access/egress speed.
- energyUnitCosts – Energy unit costs.
- energyConsumptionParameters – Energy consumption parameters.
- relativeFuelEfficiency – Relative fuel efficiency.
- congestionCharges – Congestion charges.
- boolean – flagIncludeAccessEgress Whether to include access/egress.
Returns: Total trip cost.
-
public int
getDestination
()¶ Gets freight trip destination zone (using DfT BYFM zone coding).
Returns: Freight trip destination zone.
-
public int
getDestinationLadID
()¶ Gets trip destination LAD zone ID.
Returns: Trip destination zone LAD ID.
-
public DirectedNode
getDestinationNode
()¶ Gets the trip destination node.
Returns: Destination node.
-
public EngineType
getEngine
()¶ Getter method for engine type.
Returns: Vehicle engine type.
-
public double
getLength
(double[] averageAccessEgressMap)¶ Get trip length including access/egress.
Parameters: - averageAccessEgressMap – Mapping between nodeID and average access/egress for that node.
Returns: Trip length including access/egress [in km]
-
public int
getOrigin
()¶ Gets freight trip origin zone (using DfT BYFM zone coding).
Returns: Freight trip origin zone.
-
public int
getOriginLadID
()¶ Gets trip origin LAD zone ID.
Returns: Origin zone LAD ID.
-
public double
getTravelTime
(double[] linkTravelTime, double avgIntersectionDelay, double[] averageAccessEgressMap, double averageAccessEgressSpeed, boolean flagIncludeAccessEgress)¶ Calculates travel time including access/egress.
Parameters: - linkTravelTime – Link-based travel time (should be for the same hour as the trip’s time of day).
- avgIntersectionDelay – Average intersection delay.
- averageAccessEgressMap – Mapping between nodeID and average access/egress for that node.
- averageAccessEgressSpeed – Average access/egress speed.
- flagIncludeAccessEgress – Whether to include access/egress travel time.
Returns: Trip travel time including access/egress [in min].
-
public VehicleType
getVehicle
()¶ Getter method for vehicle type.
Returns: Vehicle type.
-
public boolean
isTripGoingThroughCongestionChargingZone
(String policyName, List<PricingPolicy> congestionCharges)¶ Check whether trip is going through a congestion charging zone for a particular policy.
Parameters: - policyName – Policy name.
- congestionCharges – Congestion charges.
Returns: True if it is going through the congestion charging zone.
TripMinor¶
-
public class
TripMinor
extends Trip¶ This class stores information about a performed trip on minor roads (for which the network is not modelled).
Author: Milan Lovric
Constructors¶
-
public
TripMinor
(VehicleType vehicle, EngineType engine, TimeOfDay hour, Integer originTemproZoneID, Integer destinationTemproZoneID, double length, Zoning zoning)¶ Constructor for a trip. Origin and destination are used for freight trips (according to DfT’s BYFM zonal coding). Origin and destination for passenger car/AV trips are 0 as their correct origin and destination zone can be obtained using the first and the last node of the route.
Parameters: - vehicle – Vehicle type.
- engine – Engine type.
- route – Route.
- hour – Time of day.
- originTemproZoneID – Origin tempro zone ID.
- destinationTemproZoneID – Destination tempro zone ID.
- length – Trip length;
- zoning – Zoning system.
-
public
TripMinor
(VehicleType vehicle, EngineType engine, TimeOfDay hour, Integer originTemproZoneID, Integer destinationTemproZoneID, double length, Zoning zoning, int multiplier)¶ Constructor for a trip. Origin and destination are used for freight trips (according to DfT’s BYFM zonal coding). Origin and destination for passenger car/AV trips are 0 as their correct origin and destination zone can be obtained using the first and the last node of the route.
Parameters: - vehicle – Vehicle type.
- engine – Engine type.
- route – Route.
- hour – Time of day.
- originTemproZoneID – Origin tempro zone ID.
- destinationTemproZoneID – Destination tempro zone ID.
- length – Trip length;
- zoning – Zoning system.
- multiplier – Multiplies the same trip.
Methods¶
-
protected Map<EnergyType, Double>
getAccessEgressConsumption
(double[] linkTravelTime, double[] distanceFromTemproZoneToNearestNode, double averageAccessEgressSpeed, Map<VehicleType, Map<EngineType, Map<WebTAG, Double>>> energyConsumptionParameters, Map<VehicleType, Map<EngineType, Double>> relativeFuelEfficiency)¶
-
public double
getCO2emission
(double averageSpeed, Map<VehicleType, Map<EngineType, Map<WebTAG, Double>>> energyConsumptionParameters, Map<VehicleType, Map<EngineType, Double>> relativeFuelEfficiency, Map<EnergyType, Double> unitCO2Emissions)¶ Gets CO2 emission for the minor trip.
Parameters: - averageSpeed – Average speed for a minor trip.
- energyConsumptionParameters – Energy consumption parameters.
- relativeFuelEfficiency – Relative fuel efficiency.
Returns: CO2 emission for the trip.
-
public Double
getCO2emission
(double[] linkTravelTime, double[] distanceFromTemproZoneToNearestNode, double averageAccessEgressSpeed, Map<VehicleType, Map<EngineType, Map<WebTAG, Double>>> energyConsumptionParameters, Map<VehicleType, Map<EngineType, Double>> relativeFuelEfficiency, Map<EnergyType, Double> unitCO2Emissions, boolean flagIncludeAccessEgress)¶
-
public Map<EnergyType, Double>
getConsumption
(double averageSpeed, Map<VehicleType, Map<EngineType, Map<WebTAG, Double>>> energyConsumptionParameters, Map<VehicleType, Map<EngineType, Double>> relativeFuelEfficiency)¶ Gets energy consumptions for the minor trip.
Parameters: - averageSpeed – Average speed for a minor trip.
- energyConsumptionParameters – Energy consumption parameters.
- relativeFuelEfficiency – Relative fuel efficiency.
Returns: Energy consumptions for the trip.
-
public Map<EnergyType, Double>
getConsumption
(double[] linkTravelTime, double[] distanceFromTemproZoneToNearestNode, double averageAccessEgressSpeed, Map<VehicleType, Map<EngineType, Map<WebTAG, Double>>> energyConsumptionParameters, Map<VehicleType, Map<EngineType, Double>> relativeFuelEfficiency, boolean flagIncludeAccessEgress)¶
-
public double
getCost
(double averageSpeed, Map<EnergyType, Double> energyUnitCosts, Map<VehicleType, Map<EngineType, Map<WebTAG, Double>>> energyConsumptionParameters, Map<VehicleType, Map<EngineType, Double>> relativeFuelEfficiency)¶ Gets fuel cost for the minor trip.
Parameters: - averageSpeed – Average speed for a minor trip.
- energyUnitCosts – Energy unit costs.
- energyConsumptionParameters – Energy consumption parameters.
- relativeFuelEfficiency – Relative fuel efficiency.
Returns: Energy consumptions for the trip.
-
public double
getCost
(double[] linkTravelTime, double[] distanceFromTemproZoneToNearestNode, double averageAccessEgressSpeed, Map<EnergyType, Double> energyUnitCosts, Map<VehicleType, Map<EngineType, Map<WebTAG, Double>>> energyConsumptionParameters, Map<VehicleType, Map<EngineType, Double>> relativeFuelEfficiency, List<PricingPolicy> congestionCharges, boolean flagIncludeAccessEgress)¶
-
public int
getDestinationLadID
()¶ Gets trip destination LAD zone ID.
Returns: Trip destination zone LAD ID.
-
public double
getLength
()¶ Gets trip length (no separate access/egress for minor road trips).
Returns: Trip length [in km].
-
public int
getOriginLadID
()¶ Gets trip origin LAD zone ID.
Returns: Origin zone LAD ID.
-
public double
getTravelTime
(double averageSpeed)¶ Gets travel time for the minor trip.
Parameters: - averageSpeed – Average speed for a minor trip.
Returns: Travel time.
TripTempro¶
-
public class
TripTempro
extends Trip¶ This class stores information about a performed trip (when using the Tempro zoning system).
Author: Milan Lovric
Constructors¶
-
public
TripTempro
(VehicleType vehicle, EngineType engine, Route route, TimeOfDay hour, Integer originTemproZoneID, Integer destinationTemproZoneID, Zoning zoning)¶ Constructor for a passenger car trip using the Tempro zoning system. Origin and destination are integer IDs of Tempro zones.
Parameters: - vehicle – Vehicle type.
- engine – Engine type.
- route – Route.
- hour – Time of day.
- originTemproZoneID – Origin tempro zone ID.
- destinationTemproZoneID – Destination tempro zone ID.
- zoning – Zoning system.
-
public
TripTempro
(VehicleType vehicle, EngineType engine, Route route, TimeOfDay hour, Integer originTemproZoneID, Integer destinationTemproZoneID, Zoning zoning, int multiplier)¶ Constructor for a passenger car trip using the Tempro zoning system. Origin and destination are integer IDs of Tempro zones. Multiplier is used to store multiple instances of the same trip (vs creating multiple objects), thus reducing the memory footprint.
Parameters: - vehicle – Vehicle type.
- engine – Engine type.
- route – Route.
- hour – Time of day.
- originTemproZoneID – Origin tempro zone ID.
- destinationTemproZoneID – Destination tempro zone ID.
- zoning – Zoning system.
- multiplier – Multiplies the same trip.
Methods¶
-
protected Map<EnergyType, Double>
getAccessEgressConsumption
(double[] linkTravelTime, double[] distanceFromTemproZoneToNearestNode, double averageAccessEgressSpeed, Map<VehicleType, Map<EngineType, Map<WebTAG, Double>>> energyConsumptionParameters, Map<VehicleType, Map<EngineType, Double>> relativeFuelEfficiency)¶
-
public Double
getCO2emission
(double[] linkTravelTime, double[] distanceFromTemproZoneToNearestNode, double averageAccessEgressSpeed, Map<VehicleType, Map<EngineType, Map<WebTAG, Double>>> energyConsumptionParameters, Map<VehicleType, Map<EngineType, Double>> relativeFuelEfficiency, Map<EnergyType, Double> unitCO2Emissions, boolean flagIncludeAccessEgress)¶
-
public Map<EnergyType, Double>
getConsumption
(double[] linkTravelTime, double[] distanceFromTemproZoneToNearestNode, double averageAccessEgressSpeed, Map<VehicleType, Map<EngineType, Map<WebTAG, Double>>> energyConsumptionParameters, Map<VehicleType, Map<EngineType, Double>> relativeFuelEfficiency, boolean flagIncludeAccessEgress)¶
-
public double
getCost
(double[] linkTravelTime, double[] distanceFromTemproZoneToNearestNode, double averageAccessEgressSpeed, Map<EnergyType, Double> energyUnitCosts, Map<VehicleType, Map<EngineType, Map<WebTAG, Double>>> energyConsumptionParameters, Map<VehicleType, Map<EngineType, Double>> relativeFuelEfficiency, List<PricingPolicy> congestionCharges, boolean flagIncludeAccessEgress)¶
-
public int
getDestinationLadID
()¶ Gets trip destination LAD zone ID.
Returns: Trip destination zone LAD ID.
-
public double
getLength
()¶ Gets trip length including access/egress (from Tempro centroid to node).
Returns: Trip length [in km].
-
public int
getOriginLadID
()¶ Gets trip origin LAD zone ID.
Returns: Origin zone LAD ID.
nismod.transport.optimisation¶
SPSA¶
-
public class
SPSA
¶ Implements SPSA optimisation algorithm (Simultaneous Perturbation Stochastic Approximation). This version optimises the cells of the OD matrix. http://www.jhuapl.edu/SPSA/
Author: Milan Lovric
Fields¶
Methods¶
-
public RealODMatrix
getThetaEstimate
()¶ Getter function for the optimisation result (OD matrix).
Returns: Estimated OD matrix.
-
public void
initialise
(RoadNetworkAssignment rna, Properties props, RealODMatrix initialTheta, double a, double A, double c, double alpha, double gamma)¶ Initialise the SPSA algorithm with starting values.
Parameters: - rna – Road network assignment.
- props – Parameters from the config file.
- initialTheta – Initial OD matrix.
- a – SPSA parameter.
- A – SPSA parameter.
- c – SPSA parameter.
- alpha – SPSA parameter.
- gamma – SPSA parameter.
SPSA2¶
-
public class
SPSA2
¶ Implements SPSA optimisation algorithm (Simultaneous Perturbation Stochastic Approximation). This version of the algorithm keeps OD matrix constant, but optimises start and end node probabilities (the probability of a trip starting/ending at a particular node within LAD). http://www.jhuapl.edu/SPSA/
Author: Milan Lovric
Fields¶
Methods¶
-
public void
initialise
(RoadNetworkAssignment rna, Properties props, ODMatrixMultiKey odm, HashMap<Integer, Double> initialThetaStart, HashMap<Integer, Double> initialThetaEnd, double a, double A, double c, double alpha, double gamma)¶ Initialise the SPSA algorithm with starting values.
Parameters: - rna – Road network assignment
- props – Parameters from the config file.
- odm – Origin-destination matrix.
- initialThetaStart – Initial start node probabilities.
- initialThetaEnd – Initial end node probabilities.
- a – SPSA parameter.
- A – SPSA parameter.
- c – SPSA parameter.
- alpha – SPSA parameter.
- gamma – SPSA parameter.
SPSA3¶
-
public class
SPSA3
¶ Implements SPSA optimisation algorithm (Simultaneous Perturbation Stochastic Approximation). This version optimises OD matrix and start/end node probabilities simultaneously. http://www.jhuapl.edu/SPSA/
Author: Milan Lovric
Fields¶
Methods¶
-
public RealODMatrix
getThetaEstimate
()¶ Getter function for the optimisation result (OD matrix).
Returns: Estimated OD matrix.
-
public void
initialise
(RoadNetworkAssignment rna, RouteSetGenerator rsg, Properties routeChoiceParams, RealODMatrix initialTheta, HashMap<Integer, Double> initialThetaStart, HashMap<Integer, Double> initialThetaEnd, double a1, double A1, double c1, double a2, double A2, double c2, double alpha, double gamma)¶ Initialise the SPSA algorithm with starting values.
Parameters: - rna – Road network assignment.
- rsg – Route set generator.
- routeChoiceParams – Route choice parameters.
- initialTheta – Initial OD matrix.
- initialThetaStart – Initial start node probabilities.
- initialThetaEnd – Initial end node probabilities.
- a1 – SPSA parameter for OD estimation.
- A1 – SPSA parameter for OD estimation.
- c1 – SPSA parameter for OD estimation.
- a2 – SPSA parameter for nodes probability estimation.
- A2 – SPSA parameter for nodes probability estimation.
- c2 – SPSA parameter for nodes probability estimation.
- alpha – SPSA parameter.
- gamma – SPSA parameter.
-
public double
lossFunction
()¶ Calculate the loss function of the latest theta estimate (OD matrix).
Returns: RMSN for the difference between volumes and traffic counts.
SPSA4¶
-
public class
SPSA4
¶ Implements SPSA optimisation algorithm (Simultaneous Perturbation Stochastic Approximation). This version optimises Tempro level OD matrix. http://www.jhuapl.edu/SPSA/
Author: Milan Lovric
Fields¶
Constructors¶
-
public
SPSA4
(Properties props)¶
Methods¶
-
public RealODMatrixTempro
getThetaEstimate
()¶ Getter function for the optimisation result (OD matrix).
Returns: Estimated OD matrix.
-
public void
initialise
(RoadNetworkAssignment rna, Zoning zoning, RouteSetGenerator rsg, RealODMatrixTempro initialTheta, double a, double A, double c, double alpha, double gamma)¶ Initialise the SPSA algorithm with starting values.
Parameters: - rna – Road network assignment.
- zoning – Zoning system for tempro zones.
- rsg – Route set generator with routes to be used in assignment.
- initialTheta – Initial OD matrix.
- a – SPSA parameter.
- A – SPSA parameter.
- c – SPSA parameter.
- alpha – SPSA parameter.
- gamma – SPSA parameter.
SPSA5¶
-
public class
SPSA5
¶ Implements SPSA optimisation algorithm (Simultaneous Perturbation Stochastic Approximation). This version optimises Tempro level OD matrix. http://www.jhuapl.edu/SPSA/
Author: Milan Lovric
Fields¶
Constructors¶
-
public
SPSA5
(Properties props)¶
Methods¶
-
public RealODMatrixTempro
getThetaEstimate
()¶ Getter function for the optimisation result (OD matrix).
Returns: Estimated OD matrix.
-
public void
initialise
(RoadNetworkAssignment rna, Zoning zoning, RouteSetGenerator rsg, RealODMatrixTempro initialTheta, double a, double A, double c, double alpha, double gamma)¶ Initialise the SPSA algorithm with starting values.
Parameters: - rna – Road network assignment.
- zoning – Zoning system for tempro zones.
- rsg – Route set generator with routes to be used in assignment.
- initialTheta – Initial OD matrix.
- a – SPSA parameter.
- A – SPSA parameter.
- c – SPSA parameter.
- alpha – SPSA parameter.
- gamma – SPSA parameter.
nismod.transport.rail¶
RailDemandModel¶
-
public class
RailDemandModel
¶
Constructors¶
-
public
RailDemandModel
(String baseYearRailStationUsageFile, String populationFile, String GVAFile, String elasticitiesFile, String railStationJourneyFaresFile, String railStationGeneralisedJourneyTimesFile, String carZonalJourneyCostsFile, String railTripRatesFile, List<Intervention> interventions, Properties props)¶ Constructor for the rail demand model.
Parameters: - baseYearRailStationUsageFile – Base year rail station usage file (demand).
- populationFile – Population file.
- GVAFile – GVA file.
- elasticitiesFile – Elasticites file.
- railStationJourneyFaresFile – Rail fares file.
- railStationGeneralisedJourneyTimesFile – GJT file.
- carZonalJourneyCostsFile – Zonal car journey costs file.
- railTripRatesFile – Rail trip rates file.
- interventions – List of interventions.
- props – Properties.
Throws: - IOException –
- FileNotFoundException –
Methods¶
-
public void
addNLCofDevelopedStation
(int NLC)¶ Adds NLC of a newly built rail station.
Parameters: - NLC – Id of a newly built rail station.
-
public void
addYearOfDevelopment
(int year)¶ Adds a year in which a new rail station is built.
Parameters: - year – Year in which a new rail station is built.
-
public RailStationDemand
getRailStationDemand
(int year)¶ Getter method for the passenger rail station demand in a given year.
Parameters: - year – Year for which the demand is requested.
Returns: Rail station demand with total passenger counts (entry + exit).
-
public void
predictAndSaveRailwayDemands
(int toYear, int fromYear)¶ Predicts rail station demand (total passenger counts at each station) up to toYear (if flag is true, also intermediate years) and saves results.
Parameters: - toYear – The final year for which the demand is predicted.
- fromYear – The year from which the predictions are made.
-
public void
predictRailwayDemand
(int predictedYear, int fromYear)¶ Predicts passenger railway demand (passenger counts at each station). Rail station demand for fromYear needs to be contained in the memory.
Parameters: - predictedYear – The year for which the demand is predicted.
- fromYear – The year from which demand the prediction is made.
-
public void
predictRailwayDemandUsingResultsOfFromYear
(int predictedYear, int fromYear)¶ Predicts passenger railway demand (passenger counts at each station). Uses already existing results of the fromYear, from the output folder.
Parameters: - predictedYear – The year for which the demand is predicted.
- fromYear – The year from which demand the prediction is made.
-
public void
predictRailwayDemands
(int toYear, int baseYear)¶ Predicts rail station demand (total passenger counts at each station) for all years from baseYear to toYear.
Parameters: - toYear – The final year for which the demand is predicted.
- baseYear – The base year from which the predictions are made.
-
public void
printYearsOfNewStations
()¶ Prints years in which development of new rail stations takes place.
-
public void
saveAllResults
(int year)¶ Saves all results into the output folder.
Parameters: - year – Year of the data.
-
public void
setRailStationDemand
(int year, RailStationDemand demand)¶ Setter method for the passenger rail station demand in a given year.
Parameters: - year – Year for which the demand is set.
- demand – Rail station demand.
RailDemandModel.ElasticityArea¶
-
public static enum
ElasticityArea
¶
Enum Constants¶
-
public static final RailDemandModel.ElasticityArea
LT
¶
-
public static final RailDemandModel.ElasticityArea
OTHER
¶
-
public static final RailDemandModel.ElasticityArea
PTE
¶
-
public static final RailDemandModel.ElasticityArea
SE
¶
RailDemandModel.ElasticityTypes¶
-
public static enum
ElasticityTypes
¶
Enum Constants¶
-
public static final RailDemandModel.ElasticityTypes
COST_CAR
¶
-
public static final RailDemandModel.ElasticityTypes
COST_RAIL
¶
-
public static final RailDemandModel.ElasticityTypes
GVA
¶
-
public static final RailDemandModel.ElasticityTypes
POPULATION
¶
-
public static final RailDemandModel.ElasticityTypes
TIME
¶
RailStation¶
-
public class
RailStation
¶ This class stores information about a rail station.
Author: Milan Lovric
Constructors¶
-
public
RailStation
(int nlc, RailModeType mode, String stationName, String naptanName, int easting, int northing, int yearUsage, double dayUsage, int runDays, String ladCode, String ladName, ElasticityArea area)¶ Constructor for a station.
Parameters: - nlc – National Location Code.
- mode – Which mode is served by this station.
- stationName – Station name.
- naptanName – Longer name from NaPTAN.
- easting – Easting coordinate.
- northing – Northing coordinate.
- yearUsage – Yearly station usage (entries and exits combined).
- dayUsage – Daily station usage (yearly usage divided by the number of operational days in a year).
- runDays – The number of operational days in a year.
- ladCode – LAD code of the zone in which the station is located.
- ladName – LAD name of the zone in which the station is located.
- area – Elasticity area in which the station is located.
-
public
RailStation
(RailStation station)¶ Constructor for a station.
Parameters: - station – Rail station which data is going to be copied.
Methods¶
-
public ElasticityArea
getArea
()¶ Getter method for the elasticity area in which station is located.
Returns: LAD name.
-
public RailModeType
getMode
()¶ Getter method for the rail mode type.
Returns: Rail mode type.
-
public int
getNLC
()¶ Getter method for the NLC (National Location Code) of the station.
Returns: NLC.
-
public int
getRunDays
()¶ Getter method for number of operational days.
Returns: Number of operaiontal days.
-
public void
setDailyUsage
(double usage)¶ Setter method for daily usage.
Parameters: - usage – Daily usage.
RailStation.RailModeType¶
-
public static enum
RailModeType
¶
Enum Constants¶
-
public static final RailStation.RailModeType
DLR
¶
-
public static final RailStation.RailModeType
LRAIL
¶
-
public static final RailStation.RailModeType
NRAIL
¶
-
public static final RailStation.RailModeType
TUBE
¶
RailStationDemand¶
-
public class
RailStationDemand
¶ This class stores passenger rail demand = station usage data (entries + exists).
Author: Milan Lovric
Constructors¶
Methods¶
-
public void
addStation
(RailStation station)¶ Add a rail station data to the rail demand (overwrites existing one).
Parameters: - station –
-
public HashMap<String, List<RailStation>>
createListOfStationsWithinEachLAD
()¶ Creates a list of stations within each LAD.
Returns: List of stations within each LAD.
-
public List<RailStation>
getRailDemandList
()¶ Getter method for the rail demand list.
Returns: Rail demand list
-
public Map<Integer, RailStation>
getRailDemandMap
()¶ Getter method for the rail demand map.
Returns: Rail demand map.
-
public boolean
removeStation
(int NLC)¶ Remove station with a given NLC code.
Parameters: - NLC – Station code.
Returns: true if station existed in demand and was successfully removed.
nismod.transport.scripts¶
nismod.transport.showcase¶
CapacityUtilisationLegend¶
CongestionChargingDashboard¶
-
public class
CongestionChargingDashboard
extends JFrame¶ Dashboard for the road expansion policy intervention.
Author: Milan Lovric
Fields¶
Constructors¶
NetworkVisualiserDemo¶
-
public class
NetworkVisualiserDemo
¶ For visualising the road network.
Author: Milan Lovric
Methods¶
-
public static JFrame
getMap
(URL zonesUrl, URL networkUrl, URL nodesUrl, URL AADFurl, String mapTitle, String linkDataLabel)¶ Visualises the road network with link data.
Parameters: - zonesUrl – Url for the zones shapefile.
- networkUrl – Url for the road network shapefile.
- nodesUrl – Url for the nodes shapefile.
- AADFurl – Url for the traffic counts shapefile.
- mapTitle – Map title for the window.
- linkDataLabel – Label describing the link data used.
Throws: - IOException – if any.
Returns: JFrame with the map.
-
public static void
visualise
(RoadNetwork roadNetwork, String mapTitle)¶ Visualises the road network as loaded from the shapefiles.
Parameters: - roadNetwork – Road network.
- mapTitle – Map title for the window.
Throws: - IOException – if any.
-
public static JFrame
visualise
(URL zonesUrl, URL networkUrl, URL nodesUrl, URL AADFurl, String mapTitle, String linkDataLabel)¶ Visualises the road network with link data.
Parameters: - zonesUrl – Url for the zones shapefile.
- networkUrl – Url for the road network shapefile.
- nodesUrl – Url for the nodes shapefile.
- AADFurl – Url for the traffic counts shapefile.
- mapTitle – Map title for the window.
- linkDataLabel – Label describing the link data used.
Throws: - IOException – if any.
Returns: JFrame with the map.
-
public static JFrame
visualise
(RoadNetwork roadNetwork, String mapTitle, Map<Integer, Double> linkData, String linkDataLabel, String shapefilePath)¶ Visualises the road network with dailyVolume.
Parameters: - roadNetwork – Road network.
- mapTitle – Map title for the window.
- linkData – Data used to classify and colour road links.
- linkDataLabel – Label describing the link data used.
- shapefilePath – The path to the shapefile into which data will be stored.
Throws: - IOException – if any.
Returns: JFrame with the map.
-
public static JFrame
visualise
(RoadNetwork roadNetwork, String mapTitle, Map<Integer, Double> linkData, String linkDataLabel, String shapefilePath, URL congestionChargeZoneUrl)¶ Visualises the road network with link data and congestion charging zone.
Parameters: - roadNetwork – Road network.
- mapTitle – Map title for the window.
- linkData – Data used to classify and colour road links.
- linkDataLabel – Label describing the link data used.
- shapefilePath – The path to the shapefile into which data will be stored.
- congestionChargeZoneUrl – The path to the shapefile with the congestion charge zone boundary.
Throws: - IOException – if any.
Returns: JFrame with the map.
RoadDevelopmentDashboard¶
-
public class
RoadDevelopmentDashboard
extends JFrame¶ Dashboard for the road development policy intervention.
Author: Milan Lovric
Fields¶
Constructors¶
RoadExpansionDashboard¶
-
public class
RoadExpansionDashboard
extends JFrame¶ Dashboard for the road expansion policy intervention.
Author: Milan Lovric
Fields¶
Constructors¶
TableChangeLegend¶
TableChangeLegendHorizontal¶
nismod.transport.utility¶
ConfigReader¶
-
public class
ConfigReader
¶ Configuration file reader.
Author: Milan Lovric
Methods¶
-
public static Properties
getProperties
(String configFile)¶ Reads properties from the configuration file.
Parameters: - configFile – Path to the configuration file.
Returns: Loaded properties.
InputFileReader¶
-
public class
InputFileReader
¶ InputFileReader reads input files and provides them as various data structures required by other classes.
Author: Milan Lovric
Methods¶
-
public static Map<AirDemandModel.ElasticityTypes, Double>
readAirElasticitiesFile
(String fileName)¶ Reads air elasticities file.
Parameters: - fileName – File name.
Returns: Map with elasticity parameters.
-
public static Map<ElasticityTypes, Double>
readElasticitiesFile
(String fileName)¶ Reads elasticities file.
Parameters: - fileName – File name.
Returns: Map with elasticity parameters.
-
public static Map<VehicleType, Map<EngineType, Map<WebTAG, Double>>>
readEnergyConsumptionParamsFile
(String fileName)¶ Reads engine type fractions file.
Parameters: - fileName – File name.
Returns: Map with engine type fractions.
-
public static HashMap<Integer, Map<VehicleType, Map<EngineType, Double>>>
readEngineTypeFractionsFile
(String fileName)¶ Reads engine type fractions file.
Parameters: - fileName – File name.
Returns: Map with engine type fractions.
-
public static Map<RailDemandModel.ElasticityTypes, Map<RailDemandModel.ElasticityArea, Double>>
readRailElasticitiesFile
(String fileName)¶ Reads rail elasticities file.
Parameters: - fileName – File name.
Returns: Map with elasticity parameters.
-
public static HashMap<Integer, Map<VehicleType, Map<EngineType, Double>>>
readRelativeFuelEfficiencyFile
(String fileName)¶ Reads relative fuel efficiency file.
Parameters: - fileName – File name.
Returns: Map with relative fuel efficiency.
-
public static Map<VehicleType, Double>
readVehicleTypeToPCUFile
(String fileName)¶ Reads vehicle type to PCU conversion file.
Parameters: - fileName – File name.
Returns: Map with PCU equivalents.
PropertiesReader¶
-
public class
PropertiesReader
¶ Properties file reader.
Author: Milan Lovric
Methods¶
-
public static Properties
getProperties
(String configFile)¶ Reads properties from the configuration file.
Parameters: - configFile – Path to the configuration file.
Returns: Loaded properties.
RandomSingleton¶
-
public class
RandomSingleton
¶ Creates only one instance of the random number generator that can be used throughout the whole model. Simulation results can then be reproduced by using the same seed.
Author: Milan Lovric
Methods¶
-
public static RandomSingleton
getInstance
()¶ Getter for the singleton instance of the random number generator.
Returns: Random number generator.
-
public double
nextDouble
()¶ Generates a pseudorandom real number between 0 and 1.
Returns: Pseudorandom real double.
nismod.transport.visualisation¶
BarVisualiser¶
-
public class
BarVisualiser
extends JFrame¶ For visualising bar charts using JFreeChart.
Author: Milan Lovric
Constructors¶
LineVisualiser¶
NetworkVisualiser¶
-
public class
NetworkVisualiser
¶ For visualising the road network.
Author: Milan Lovric
Methods¶
-
public static void
visualise
(RoadNetwork roadNetwork, String mapTitle)¶ Visualises the road network as loaded from the shapefiles.
Parameters: - roadNetwork – Road network.
- mapTitle – Map title for the window.
Throws: - IOException – if any.
-
public static void
visualise
(RoadNetwork roadNetwork, String mapTitle, Map<Integer, Double> linkData, String linkDataLabel, String shapefilePath)¶ Visualises the road network with dailyVolume.
Parameters: - roadNetwork – Road network.
- mapTitle – Map title for the window.
- linkData – Data used to classify and colour road links.
- linkDataLabel – Label describing the link data used.
- shapefilePath – The path to the shapefile into which data will be stored.
Throws: - IOException – if any.
-
public static void
visualise
(RoadNetwork roadNetwork, String mapTitle, Map<Integer, Double> linkData, String linkDataLabel, String shapefilePath, URL congestionChargeZoneUrl)¶ Visualises the road network with dailyVolume.
Parameters: - roadNetwork – Road network.
- mapTitle – Map title for the window.
- linkData – Data used to classify and colour road links.
- linkDataLabel – Label describing the link data used.
- shapefilePath – The path to the shapefile into which data will be stored.
- congestionChargeZoneUrl – The path to the shapefile with the congestion charge zone boundary.
Throws: - IOException – if any.
nismod.transport.zone¶
Zoning¶
-
public class
Zoning
¶ For mapping Tempro zones to the nodes of the road network.
Author: Milan Lovric
Fields¶
Constructors¶
-
public
Zoning
(URL zonesUrl, URL nodesUrl, RoadNetwork rn, Properties params)¶ Constructor for the zoning system.
Parameters: - zonesUrl – Url for the zones shapefile.
- nodesUrl – Url for the nodes shapefile.
- rn – Road network.
- paramas – Properties file with parameters.
Throws: - IOException – if any.
Methods¶
-
public double
getAccessEgressFactor
()¶ Getter for access/egress scaling factor.
Returns: Access/egress scaling factor.
-
public int[]
getZoneIDToLadID
()¶ Getter for Tempro zone ID to LAD zone ID mapping.
Returns: Tempro zone ID to LAD zone ID array.
-
public double[]
getZoneIDToNearestNodeDistanceMap
()¶ Getter for zone ID to nearest node distance mapping (in meters).
Returns: Zone to distance map.
-
public int[]
getZoneIDToNearestNodeIDFromLADTopNodesMap
()¶ Getter for zone ID to nearest node ID among top LAD nodes mapping.
Returns: Zone to node map.
-
public int[]
getZoneIDToNearestNodeIDMap
()¶ Getter for Tempro zone ID to nearest node ID mapping.
Returns: Zone to node map.
-
public double[][]
getZoneToMinMaxDimension
()¶ Getter for Tempro zone ID to min [0] and max [1] dimension of the zone bounding box (envelope) [in km].
Returns: Zone min and max dimension (width or height).
-
public double[][]
getZoneToNodeDistanceMatrix
()¶ Getter for Tempro zone to all nodes distance matrix [in metres].
Returns: Zone to node distance matrix.
Authors¶
Development¶
- Milan Lovric <M.Lovric@soton.ac.uk>
Integration¶
- Will Usher <william.usher@ouce.ox.ac.uk>
- Tom Russell <tom.russell@ouce.ox.ac.uk>
- Roald Schoenmakers <roald.schoenmakers@ouce.ox.ac.uk>
- Thibault Lestang <thibault.lestang@cs.ox.ac.uk>
Management¶
- Simon Blainey <S.P.Blainey@soton.ac.uk>
- John Preston <J.M.Preston@soton.ac.uk>
License¶
MIT License
Copyright (c) 2018 National Infrastructure Systems Model
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.