RA2CE feature: Multi-link losses analysis#
Multi-link losses Analysis#
[ ]:
from pathlib import Path
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#
[ ]:
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()