ra2ce.analysis.analysis_config_data.enums package#

Submodules#

ra2ce.analysis.analysis_config_data.enums.analysis_damages_enum module#

class AnalysisDamagesEnum(value)[source]#

Bases: Ra2ceEnumBase

DAMAGES = 1#
INVALID = 99#
classmethod get_enum(input_str)[source]#

Create an enum from a given input string.

Return type:

AnalysisDamagesEnum

Parameters:

input_str (str | None)

Args:

input (str): Value from config.

Returns:

Ra2ceEnumBase: Enumeration instance. NONE: This entry is used if the config is missing. INVALID: This entry is used if the config value is invalid.

ra2ce.analysis.analysis_config_data.enums.analysis_enum module#

class AnalysisEnum(value)[source]#

Bases: Ra2ceEnumBase

ADAPTATION = 2#
INVALID = 99#
classmethod get_enum(input_str)[source]#

Create an enum from a given input string.

Return type:

AnalysisEnum

Parameters:

input_str (str | None)

Args:

input (str): Value from config.

Returns:

Ra2ceEnumBase: Enumeration instance. NONE: This entry is used if the config is missing. INVALID: This entry is used if the config value is invalid.

ra2ce.analysis.analysis_config_data.enums.analysis_losses_enum module#

class AnalysisLossesEnum(value)[source]#

Bases: Ra2ceEnumBase

INVALID = 99#
OPTIMAL_ROUTE_ORIGIN_CLOSEST_DESTINATION = 5#
OPTIMAL_ROUTE_ORIGIN_DESTINATION = 3#
classmethod get_enum(input_str)[source]#

Create an enum from a given input string.

Return type:

AnalysisLossesEnum

Parameters:

input_str (str | None)

Args:

input (str): Value from config.

Returns:

Ra2ceEnumBase: Enumeration instance. NONE: This entry is used if the config is missing. INVALID: This entry is used if the config value is invalid.

ra2ce.analysis.analysis_config_data.enums.damage_curve_enum module#

class DamageCurveEnum(value)[source]#

Bases: Ra2ceEnumBase

Enumeration of damage curve types for vulnerability assessment.

This enum defines the types of damage curves that can be applied when estimating damages to roads or infrastructure. Each type represents a different model or methodology for translating an event magnitude into expected damage.

HZ#

Huizinga damage curve (1).

Type:

int

OSD#

OpenStreetMap-derived damage curve (2).

Type:

int

MAN#

Manually defined damage curve (3).

Type:

int

INVALID#

Invalid or unsupported damage curve type (99).

Type:

int

HZ = 1#
INVALID = 99#
MAN = 3#
OSD = 2#
property config_value: str | None#

Reconstruct the name as it is known in the config. This could entail replacement of “ “ by “_” and lower() operations.

Returns:

str: Value as known in the config.

classmethod get_enum(input_str)[source]#

Create an enum from a given input string.

Return type:

DamageCurveEnum

Parameters:

input_str (str | None)

Args:

input (str): Value from config.

Returns:

Ra2ceEnumBase: Enumeration instance. NONE: This entry is used if the config is missing. INVALID: This entry is used if the config value is invalid.

ra2ce.analysis.analysis_config_data.enums.event_type_enum module#

class EventTypeEnum(value)[source]#

Bases: Ra2ceEnumBase

Enumeration of event types for damage or risk analysis.

This enum classifies the types of events that can be considered when analyzing road damages or risks. It is commonly used in conjunction with damage and risk calculations.

NONE#

No event specified (0).

Type:

int

EVENT#

Calculate damages for separate events (1).

Type:

int

RETURN_PERIOD#

Calculate damages for as risk taking into account return periods (2).

Type:

int

INVALID#

Invalid or unsupported event type (99).

Type:

int

EVENT = 1#
INVALID = 99#
NONE = 0#
RETURN_PERIOD = 2#
classmethod get_enum(input_str)[source]#

Create an enum from a given input string.

Return type:

EventTypeEnum

Parameters:

input_str (str | None)

Args:

input (str): Value from config.

Returns:

Ra2ceEnumBase: Enumeration instance. NONE: This entry is used if the config is missing. INVALID: This entry is used if the config value is invalid.

ra2ce.analysis.analysis_config_data.enums.loss_type_enum module#

class LossTypeEnum(value)[source]#

Bases: Ra2ceEnumBase

CATEGORIZED = 2#
INVALID = 99#
NONE = 0#
UNIFORM = 1#
classmethod get_enum(input_str)[source]#

Create an enum from a given input string.

Return type:

LossTypeEnum

Parameters:

input_str (str | None)

Args:

input (str): Value from config.

Returns:

Ra2ceEnumBase: Enumeration instance. NONE: This entry is used if the config is missing. INVALID: This entry is used if the config value is invalid.

ra2ce.analysis.analysis_config_data.enums.risk_calculation_mode_enum module#

class RiskCalculationModeEnum(value)[source]#

Bases: Ra2ceEnumBase

Enumeration of risk calculation modes.

This enum defines strategies for computing risk from damage curves and event probabilities. The modes differ in how they treat return periods (RPs) outside of the known range and whether cutoff years are applied.

Risk calculation modes Risk calculation modes Risk calculation modes
NONE#

No risk calculation mode specified (0).

Type:

int

DEFAULT#

Standard or default risk calculation mode (1).

Type:

int

CUT_FROM_YEAR#

Cut-from mode (2).

  • For all RPs larger than the largest known RP, assume that the damage equals the damage of the largest known RP.

  • No risk for all events with a return period smaller than the smallest known RP.

  • All damage caused by events with RP > risk_calculation_year does not contribute to risk.

Type:

int

TRIANGLE_TO_NULL_YEAR#

Triangle-to-null mode (3).

  • For all RPs larger than the largest known RP, assume that the damage equals the damage of the largest known RP.

  • From the lowest return period, draw a triangle to a certain value (given by risk_calculation_year), and add the area of this triangle to the risk.

Type:

int

INVALID#

Invalid or unsupported risk calculation mode (99).

Type:

int

CUT_FROM_YEAR = 2#
DEFAULT = 1#
INVALID = 99#
NONE = 0#
TRIANGLE_TO_NULL_YEAR = 3#
classmethod get_enum(input_str)[source]#

Create an enum from a given input string.

Return type:

RiskCalculationModeEnum

Parameters:

input_str (str | None)

Args:

input (str): Value from config.

Returns:

Ra2ceEnumBase: Enumeration instance. NONE: This entry is used if the config is missing. INVALID: This entry is used if the config value is invalid.

ra2ce.analysis.analysis_config_data.enums.traffic_period_enum module#

class TrafficPeriodEnum(value)[source]#

Bases: Ra2ceEnumBase

CUSTOM = 9#
DAY = 1#
EVENING_PEAK = 6#
INVALID = 99#
MONTH = 3#
MORNING_PEAK = 5#
NIGHT = 8#
NONE = 0#
OFF_PEAK = 7#
WEEK = 2#
YEAR = 4#
classmethod get_enum(input_str)[source]#

Create an enum from a given input string.

Return type:

TrafficPeriodEnum

Parameters:

input_str (str | None)

Args:

input (str): Value from config.

Returns:

Ra2ceEnumBase: Enumeration instance. NONE: This entry is used if the config is missing. INVALID: This entry is used if the config value is invalid.

ra2ce.analysis.analysis_config_data.enums.trip_purpose_enum module#

class TripPurposeEnum(value)[source]#

Bases: Ra2ceEnumBase

BUSINESS = 1#
COMMUTE = 2#
FREIGHT = 3#
INVALID = 99#
NONE = 0#
OTHER = 4#
classmethod get_enum(input_str)[source]#

Create an enum from a given input string.

Return type:

TripPurposeEnum

Parameters:

input_str (str | None)

Args:

input (str): Value from config.

Returns:

Ra2ceEnumBase: Enumeration instance. NONE: This entry is used if the config is missing. INVALID: This entry is used if the config value is invalid.

ra2ce.analysis.analysis_config_data.enums.weighing_enum module#

class WeighingEnum(value)[source]#

Bases: Ra2ceEnumBase

INVALID = 99#
LENGTH = 1#
NONE = 0#
TIME = 2#
classmethod get_enum(input_str)[source]#

Create an enum from a given input string.

Return type:

WeighingEnum

Parameters:

input_str (str | None)

Args:

input (str): Value from config.

Returns:

Ra2ceEnumBase: Enumeration instance. NONE: This entry is used if the config is missing. INVALID: This entry is used if the config value is invalid.

Module contents#