ra2ce.analysis.losses.resilience_curves package#

Submodules#

ra2ce.analysis.losses.resilience_curves.resilience_curves module#

GNU GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

Risk Assessment and Adaptation for Critical Infrastructure (RA2CE). Copyright (C) 2023 Stichting Deltares This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class ResilienceCurves(*, resilience_curves=<factory>)[source]#

Bases: object

Class to store the resilience curves for different link types.

Parameters:

resilience_curves (dict[tuple[RoadTypeEnum, tuple[float, float]], list[tuple[float, float]]])

calculate_disruption(link_type, hazard_range)[source]#

Calculate the disruption for a given link type and hazard range. It is guaranteed that the duration steps and functionality loss ratio have the same dimensions.

Return type:

float

Parameters:
  • link_type (RoadTypeEnum)

  • hazard_range (tuple[float, float])

Args:

link_type (RoadTypeEnum): The type of the link. hazard_range (tuple[float, float]): The range of the hazard.

Returns:

float: The calculated disruption.

get_duration_steps(link_type, hazard_range)[source]#

Get the duration steps for a given link type and hazard range.

Return type:

list[float]

Parameters:
  • link_type (RoadTypeEnum)

  • hazard_range (tuple[float, float])

Args:

link_type (RoadTypeEnum): The type of the link. hazard_range (tuple[float, float]): The range of the hazard.

Returns:

list[float]: The duration steps.

get_functionality_loss_ratio(link_type, hazard_range)[source]#

Get the functionality loss ratio for a given link type and hazard range.

Return type:

list[float]

Parameters:
  • link_type (RoadTypeEnum)

  • hazard_range (tuple[float, float])

Args:

link_type (RoadTypeEnum): The type of the link. hazard_range (tuple[float, float]): The range of the hazard.

Returns:

list[float]: The functionality loss ratio.

get_resilience_curve(link_type, hazard_range)[source]#

Get the resilience curve for a given link type and hazard range.

Return type:

list[tuple[float, float]] | None

Parameters:
  • link_type (RoadTypeEnum)

  • hazard_range (tuple[float, float])

Args:

link_type (RoadTypeEnum): The type of the link. hazard_range (tuple[float, float]): The range of the hazard.

Returns:

list[tuple[float, float]]: The resilience curve.

has_resilience_curve(link_type, hazard_range)[source]#

Check if a resilience curve exists for a given link type and hazard range.

Return type:

bool

Parameters:
  • link_type (RoadTypeEnum)

  • hazard_range (tuple[float, float])

Args:

link_type (RoadTypeEnum): The type of the link. hazard_range (tuple[float, float]): The range of the hazard.

Returns:

bool: True if the resilience curve exists.

property ranges: list[tuple[float, float]]#
resilience_curves: dict[tuple[RoadTypeEnum, tuple[float, float]], list[tuple[float, float]]]#

ra2ce.analysis.losses.resilience_curves.resilience_curves_reader module#

GNU GENERAL PUBLIC LICENSE

Version 3, 29 June 2007

Risk Assessment and Adaptation for Critical Infrastructure (RA2CE). Copyright (C) 2023 Stichting Deltares This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see <http://www.gnu.org/licenses/>.

class ResilienceCurvesReader(*args, **kwargs)[source]#

Bases: LossesInputDataReaderBase

Class to read the resilience curves from a csv file.

csv_columns: list[str] = ['link_type_hazard_intensity', 'duration_steps', 'functionality_loss_ratio']#
object_type#

alias of ResilienceCurves

read(file_path)[source]#

Reads from a given file and converts the data into Any type.

Return type:

ResilienceCurves

Parameters:

file_path (Path | None)

Args:

file_path (Path): Path to a file containing data to be read.

Returns:

Any: Object mapped from the data in the file.

Module contents#