Skip to main content
Ctrl+K

RA2CE

  • Overview
  • Installation
  • Examples
  • Contributing
  • Technical Documentation
    • Changelog
  • GitHub
  • Deltares
  • Overview
  • Installation
  • Examples
  • Contributing
  • Technical Documentation
  • Changelog
  • GitHub
  • Deltares

Section Navigation

Table of Contents

  • RA2CE
  • Installation
  • Examples
    • Basic examples
      • RA2CE basics: set up RA2CE and configure a road network
      • RA2CE feature: Equity analysis
      • RA2CE feature: single link redundancy without the example data
      • RA2CE feature: Single link losses analysis
      • RA2CE feature: Multi-link losses analysis
      • RA2CE feature: Origin-destination analysis
      • RA2CE feature: Damages analysis (Huizinga)
      • RA2CE feature: Damages analysis (manual)
      • RA2CE feature: Damages analysis (OSdaMage)
      • RA2CE feature: Hazard overlay
      • RA2CE feature: Isolated locations
      • RA2CE feature: Optimal routes between origins and destinations
      • RA2CE basics: set up RA2CE and configure a road network from a pre-defined shapefile
      • Download a Network using a polygon
      • RA2CE basics: setting up an origin-destination analysis
      • RA2CE: Do It Yourself
    • Hackathon sessions
      • Hackathon Q1 - 2024
    • Technical meetings
      • Tech Meeting 2024 Q1 - Run with(out) ini files
      • Tech Meeting 2024 Q1 - Enumerations
  • Network Module
  • Analysis module
  • Contributing
    • Design principles
    • Implementation decisions
  • Technical Documentation
    • Network
    • Analysis
  • Frequently Asked Questions
  • Publications
  • Overview
  • Examples
  • Basic examples
  • RA2CE feature: Multi-link losses analysis

RA2CE feature: Multi-link losses analysis#

Multi-link losses Analysis#

[ ]:
from pathlib import Path
import geopandas as gpd
from ra2ce.ra2ce_handler import Ra2ceHandler

# Import config data
root_dir_multi = Path("data", "multi_link_losses")
assert root_dir_multi.exists()

# Load network data.
from ra2ce.network.network_config_data.network_config_data_reader import NetworkConfigDataReader
_network_config_data = NetworkConfigDataReader().read(root_dir_multi.joinpath("network.ini"))

# Load analysis data.
from ra2ce.analysis.analysis_config_data.analysis_config_data_reader import AnalysisConfigDataReader
_analysis_config_data = AnalysisConfigDataReader().read(root_dir_multi.joinpath("analysis.ini"))

Modify the analysis config data with custom properties#

[2]:
from ra2ce.analysis.analysis_config_data.analysis_config_data import AnalysisSectionLosses

# Modify the first analysis (assuming it's the only one)
_found_analysis: AnalysisSectionLosses = _analysis_config_data.analyses[0]
_input_analysis_path = root_dir_multi.joinpath("input_analysis_data")
_found_analysis.traffic_intensities_file = _input_analysis_path.joinpath("traffic_intensities.csv")
_found_analysis.resilience_curves_file = _input_analysis_path.joinpath("resilience_curve.csv")
_found_analysis.values_of_time_file = _input_analysis_path.joinpath("values_of_time.csv")

Run the analysis#

[ ]:
handler = Ra2ceHandler.from_config(_network_config_data, _analysis_config_data)

handler.configure()
handler.run_analysis()

Let’s inspect the results of the analysis. For every segment in the network, the losses are expressed in vehicle loss hour (vlh) for all the types of trip defined in the input files: business, commute, freight and other.

[ ]:
analysis_output_folder = root_dir_multi / "output" / "multi_link_losses" # specify path to output folder

losses_gdf = gpd.read_file(analysis_output_folder/"beira_multi_link_losses.gpkg") #specify the name of the geopackage holding your results (can be found in the analysis output folder)
losses_gdf.head() #display the attributes of the file

losses_roads_map = losses_gdf.explore(column='vlh_EV1_ma_total', tiles="CartoDB positron",)
display(losses_roads_map)

previous

RA2CE feature: Single link losses analysis

next

RA2CE feature: Origin-destination analysis

On this page
  • Multi-link losses Analysis
    • Modify the analysis config data with custom properties
    • Run the analysis
Edit on GitHub
Show Source

© Copyright 2024, Deltares.

Created using Sphinx 6.2.1.

Built with the PyData Sphinx Theme 0.16.0.