vtra.failure package¶
Submodules¶
vtra.failure.economic_failure_combine_national module¶
Combine national-scale macroeconomic loss estimates with rerouting losses
vtra.failure.failure_estimation_national module¶
Failure analysis of national-scale networks For transport modes at national scale:
- road
- rail
Input data requirements¶
Correct paths to all files and correct input parameters
Excel sheets with results of flow mapping based on MIN-MAX generalised costs estimates:
- origin - String node ID of Origin
- destination - String node ID of Destination
- o_region - String name of Province of Origin node ID
- d_region - String name of Province of Destination node ID
- min_edge_path - List of string of edge ID’s for paths with minimum generalised cost flows
- max_edge_path - List of string of edge ID’s for paths with maximum generalised cost flows
- min_distance - Float values of estimated distance for paths with minimum generalised cost flows
- max_distance - Float values of estimated distance for paths with maximum generalised cost flows
- min_time - Float values of estimated time for paths with minimum generalised cost flows
- max_time - Float values of estimated time for paths with maximum generalised cost flows
- min_gcost - Float values of estimated generalised cost for paths with minimum generalised cost flows
- max_gcost - Float values of estimated generalised cost for paths with maximum generalised cost flows
- min_vehicle_nums - Float values of estimated vehicle numbers for paths with minimum generalised cost flows
- max_vehicle_nums - Float values of estimated vehicle numbers for paths with maximum generalised cost flows
- industry_columns - All daily tonnages of industry columns given in the OD matrix data
Shapefiles
- edge_id - String/Integer/Float Edge ID
- geometry - Shapely LineString geomtry of edges
Results¶
Csv sheets with results of failure analysis:
All failure scenarios
- edge_id - String name or list of failed edges
- origin - String node ID of Origin of disrupted OD flow
- destination - String node ID of Destination of disrupted OD flow
- o_region - String name of Province of Origin node ID of disrupted OD flow
- d_region - String name of Province of Destination node ID of disrupted OD flow
- no_access - Boolean 1 (no reroutng) or 0 (rerouting)
- min/max_distance - Float value of estimated distance of OD journey before disruption
- min/max_time - Float value of estimated time of OD journey before disruption
- min/max_gcost - Float value of estimated travel cost of OD journey before disruption
- min/max_vehicle_nums - Float value of estimated vehicles of OD journey before disruption
- new_cost - Float value of estimated cost of OD journey after disruption
- new_distance - Float value of estimated distance of OD journey after disruption
- new_path - List of string edge ID’s of estimated new route of OD journey after disruption
- new_time - Float value of estimated time of OD journey after disruption
- dist_diff - Float value of Post disruption minus per-disruption distance
- time_diff - Float value Post disruption minus per-disruption timee
- min/max_tr_loss - Float value of estimated change in rerouting cost
- industry_columns - Float values of all daily tonnages of industry columns along disrupted OD pairs
- min/max_tons - Float values of total daily tonnages along disrupted OD pairs
Isolated OD scenarios - OD flows with no rerouting options
- edge_id - String name or list of failed edges
- o_region - String name of Province of Origin node ID of disrupted OD flow
- d_region - String name of Province of Destination node ID of disrupted OD flow
- industry_columns - Float values of all daily tonnages of industry columns along disrupted OD pairs
- min/max_tons - Float values of total daily tonnages along disrupted OD pairs
Rerouting scenarios - OD flows with rerouting options
- edge_id - String name or list of failed edges
- o_region - String name of Province of Origin node ID of disrupted OD flow
- d_region - String name of Province of Destination node ID of disrupted OD flow
- min/max_tr_loss - Float value of change in rerouting cost
- min/max_tons - Float values of total daily tonnages along disrupted OD pairs
Min-max combined scenarios - Combined min-max results along each edge
- edge_id - String name or list of failed edges
- no_access - Boolean 1 (no reroutng) or 0 (rerouting)
- min/max_tr_loss - Float values of change in rerouting cost
- min/max_tons - Float values of total daily tonnages affted by disrupted edge
- Shapefile Min-max combined scenarios - Combined min-max reults along each edge
- edge_id - String name or list of failed edges
- no_access - Boolean 1 (no reroutng) or 0 (rerouting)
- min/max_tr_loss - Float values of change in rerouting cost
- min/max_tons - Float values of total daily tonnages affted by disrupted edge
- geometry - Shapely LineString geomtry of edges
-
main
()[source]¶ Estimate failures
Specify the paths from where you want to read and write:
- Input data
- Intermediate calcuations data
- Output results
Supply input data and parameters
- Names of modes
- List of strings
- Unit weight of vehicle assumed for each mode
- List of float types
- Range of usage factors for each mode to represent uncertainty in cost estimations
- List of tuples of float types
- Min-max names of names of different types of attributes - paths, distance, time, cost, vehicles, tons
- List of string types
- Names of commodity/industry columns for which min-max tonnage column names already exist
- List of string types
- Percentage of OD flows that are assumed disrupted
- List of float type
- Condition on whether analysis is single failure or multiple failure
- Boolean condition True or False
Give the paths to the input data files:
- Network edges Excel and shapefiles
- OD flows Excel file
- Costs of modes Excel file
- Road properties Excel file
- Failure scenarios Excel file
Specify the output files and paths to be created
vtra.failure.failure_estimation_provinces module¶
Failure analysis of province-scale road networks To estimate changing accessibility to commune points
Input data requirements¶
Correct paths to all files and correct input parameters
Excel sheets with results of flow mapping based on MIN-MAX generalised costs estimates
- origin - String node ID of Origin
- destination - String node ID of Destination
- min_edge_path - List of string of edge ID’s for paths with minimum generalised cost flows
- max_edge_path - List of string of edge ID’s for paths with maximum generalised cost flows
- min_distance - Float values of estimated distance for paths with minimum generalised cost flows
- max_distance - Float values of estimated distance for paths with maximum generalised cost flows
- min_time - Float values of estimated time for paths with minimum generalised cost flows
- max_time - Float values of estimated time for paths with maximum generalised cost flows
- min_gcost - Float values of estimated generalised cost for paths with minimum generalised cost flows
- max_gcost - Float values of estimated generalised cost for paths with maximum generalised cost flows
- min_vehicle_nums - Float values of estimated vehicle numbers for paths with minimum generalised cost flows
- max_vehicle_nums - Float values of estimated vehicle numbers for paths with maximum generalised cost flows
- industry_columns - All daily tonnages of industry columns given in the OD matrix data
Shapefiles
- edge_id - String/Integer/Float Edge ID
- geometry - Shapely LineString geomtry of edges
Results¶
Csv sheets with results of failure analysis
All failure scenarios
- edge_id - String name or list of failed edges
- origin - String node ID of Origin of disrupted OD flow
- destination - String node ID of Destination of disrupted OD flow
- o_region - String name of Province of Origin node ID of disrupted OD flow
- d_region - String name of Province of Destination node ID of disrupted OD flow
- no_access - Boolean 1 (no reroutng) or 0 (rerouting)
- min/max_distance - Float value of estimated distance of OD journey before disruption
- min/max_time - Float value of estimated time of OD journey before disruption
- min/max_gcost - Float value of estimated travel cost of OD journey before disruption
- min/max_vehicle_nums - Float value of estimated vehicles of OD journey before disruption
- new_cost - Float value of estimated cost of OD journey after disruption
- new_distance - Float value of estimated distance of OD journey after disruption
- new_path - List of string edge ID’s of estimated new route of OD journey after disruption
- new_time - Float value of estimated time of OD journey after disruption
- dist_diff - Float value of Post disruption minus per-disruption distance
- time_diff - Float value Post disruption minus per-disruption timee
- min/max_tr_loss - Float value of estimated change in rerouting cost
- min/max_netrev - Float values of total daily net revenues along disrupted OD pairs
- min/max_tons - Float values of total daily crop tonnages along disrupted OD pairs
- min_max_econ_impact - Float values of total daily economic impact of disrupted OD pairs
Min-max combined scenarios - Combined min-max results of total network impacts of each edge
- edge_id - String name or list of failed edges
- no_access - Boolean 1 (no reroutng) or 0 (rerouting)
- min/max_tr_loss - Float values of estimated change in rerouting cost
- min/max_tons - Float values of total daily tonnages along edge
- min/max_netrev - Float values of total daily net revenues along edge
- min/max_econ_impact - Float value of total daily economic impact of edge
Shapefiles - Combined min-max reults of total network impacts of each edge
- edge_id - String name or list of failed edges
- no_access - Boolean 1 (no reroutng) or 0 (rerouting)
- min/max_tr_loss - Float values of estimated change in rerouting cost
- min/max_tons - Float values of total daily tonnages along edge
- min/max_netrev - Float values of total daily net revenues along edge
- min/max_econ_impact - Float value of total daily economic impact of edge
- geometry - Shapely LineString geomtry of edges
-
main
()[source]¶ Estimate provincial road failures
Specify the paths from where you want to read and write:
- Input data
- Intermediate calcuations data
- Output results
Supply input data and parameters
- Names of Provinces
- List of strings
- Unit weight of vehicle assumed for each mode
- List of float types
- Min-max names of names of different types of attributes - paths, distance, time, cost, vehicles, tons, revenue
- List of string types
- Percentage of OD flows that are assumed disrupted
- List of float type
- Condition on whether analysis is single failure or multiple failure
- Boolean condition True or False
Give the paths to the input data files: 1. Network edges Excel and shapefiles 2. OD flows Excel file 3. Failure scenarios Excel file
Specify the output files and paths to be created
vtra.failure.failure_multi_modal_options module¶
Failure analysis of national-scale networks For transport modes at national scale:
- road
- rail
Input data requirements¶
- Correct paths to all files and correct input parameters
- Excel sheets with results of flow mapping based on MIN-MAX generalised costs estimates:
- origin - String node ID of Origin
- destination - String node ID of Destination
- o_region - String name of Province of Origin node ID
- d_region - String name of Province of Destination node ID
- min_edge_path - List of string of edge ID’s for paths with minimum generalised cost flows
- max_edge_path - List of string of edge ID’s for paths with maximum generalised cost flows
- min_distance - Float values of estimated distance for paths with minimum generalised cost flows
- max_distance - Float values of estimated distance for paths with maximum generalised cost flows
- min_time - Float values of estimated time for paths with minimum generalised cost flows
- max_time - Float values of estimated time for paths with maximum generalised cost flows
- min_gcost - Float values of estimated generalised cost for paths with minimum generalised cost flows
- max_gcost - Float values of estimated generalised cost for paths with maximum generalised cost flows
- min_vehicle_nums - Float values of estimated vehicle numbers for paths with minimum generalised cost flows
- max_vehicle_nums - Float values of estimated vehicle numbers for paths with maximum generalised cost flows
- industry_columns - All daily tonnages of industry columns given in the OD matrix data
- Shapefiles
- edge_id - String/Integer/Float Edge ID
- geometry - Shapely LineString geomtry of edges
Results¶
Csv sheets with results of failure analysis:
- All failure scenarios
- edge_id - String name or list of failed edges
- origin - String node ID of Origin of disrupted OD flow
- destination - String node ID of Destination of disrupted OD flow
- o_region - String name of Province of Origin node ID of disrupted OD flow
- d_region - String name of Province of Destination node ID of disrupted OD flow
- no_access - Boolean 1 (no reroutng) or 0 (rerouting)
- min/max_distance - Float value of estimated distance of OD journey before disruption
- min/max_time - Float value of estimated time of OD journey before disruption
- min/max_gcost - Float value of estimated travel cost of OD journey before disruption
- min/max_vehicle_nums - Float value of estimated vehicles of OD journey before disruption
- new_cost - Float value of estimated cost of OD journey after disruption
- new_distance - Float value of estimated distance of OD journey after disruption
- new_path - List of string edge ID’s of estimated new route of OD journey after disruption
- new_time - Float value of estimated time of OD journey after disruption
- dist_diff - Float value of Post disruption minus per-disruption distance
- time_diff - Float value Post disruption minus per-disruption timee
- min/max_tr_loss - Float value of estimated change in rerouting cost
- industry_columns - Float values of all daily tonnages of industry columns along disrupted OD pairs
- min/max_tons - Float values of total daily tonnages along disrupted OD pairs
- Isolated OD scenarios - OD flows with no rerouting options
- edge_id - String name or list of failed edges
- o_region - String name of Province of Origin node ID of disrupted OD flow
- d_region - String name of Province of Destination node ID of disrupted OD flow
- industry_columns - Float values of all daily tonnages of industry columns along disrupted OD pairs
- min/max_tons - Float values of total daily tonnages along disrupted OD pairs
- Rerouting scenarios - OD flows with rerouting options
- edge_id - String name or list of failed edges
- o_region - String name of Province of Origin node ID of disrupted OD flow
- d_region - String name of Province of Destination node ID of disrupted OD flow
- min/max_tr_loss - Float value of change in rerouting cost
- min/max_tons - Float values of total daily tonnages along disrupted OD pairs
- Min-max combined scenarios - Combined min-max results along each edge
- edge_id - String name or list of failed edges
- no_access - Boolean 1 (no reroutng) or 0 (rerouting)
- min/max_tr_loss - Float values of change in rerouting cost
- min/max_tons - Float values of total daily tonnages affted by disrupted edge
- Shapefile Min-max combined scenarios - Combined min-max reults along each edge
- edge_id - String name or list of failed edges
- no_access - Boolean 1 (no reroutng) or 0 (rerouting)
- min/max_tr_loss - Float values of change in rerouting cost
- min/max_tons - Float values of total daily tonnages affted by disrupted edge
- geometry - Shapely LineString geomtry of edges
-
main
()[source]¶ Estimate multi-model failures
Specify the paths from where you want to read and write:
- Input data
- Intermediate calcuations data
- Output results
Supply input data and parameters
- Names of modes
- List of strings
- Unit weight of vehicle assumed for each mode
- List of float types
- Range of usage factors for each mode to represent uncertainty in cost estimations
- List of tuples of float types
- Min-max names of names of different types of attributes - paths, distance, time, cost, vehicles, tons
- List of string types
- Names of commodity/industry columns for which min-max tonnage column names already exist
- List of string types
- Percentage of OD flows that are assumed disrupted
- List of float type
- Condition on whether analysis is single failure or multiple failure
- Boolean condition True or False
Give the paths to the input data files:
- Network edges Excel and shapefiles
- OD flows Excel file
- Costs of modes Excel file
- Road properties Excel file
- Failure scenarios Excel file
vtra.failure.national_failure_transfers module¶
Estimate tonnage shifts from one mode onto others
-
main
()[source]¶ Estimate modal shifts
Specify the paths from where you want to read and write:
- Input data
- Intermediate calcuations data
- Output results
Supply input data and parameters
- Names of modes
- List of strings
- Unit weight of vehicle assumed for each mode
- List of float types
- Range of usage factors for each mode to represent uncertainty in cost estimations
- List of tuples of float types
- Min-max names of names of different types of attributes - paths, distance, time, cost, vehicles, tons
- List of string types
- Names of commodity/industry columns for which min-max tonnage column names already exist
- List of string types
- Percentage of OD flows that are assumed disrupted
- List of float type
- Condition on whether analysis is single failure or multiple failure
- Boolean condition True or False
Give the paths to the input data files:
- Network edges Excel and shapefiles
- OD flows Excel file
- Costs of modes Excel file
- Road properties Excel file
- Failure scenarios Excel file