r2d_component_configurator

class pyrecodes.component_configurator.r2d_component_configurator.R2DBridgeConfigurator(system_level_data: dict, recovery_time_stepping: list)

Bases: R2DTransportationComponentConfigurator

Class that sets parameters of a Bridge as provided in the R2D output files.

Not clear how the class should look like at the moment. Future work.

SYSTEM_LEVEL_DATA = ['START_TIME_STEP', 'MAX_TIME_STEP', 'DEFAULT_REPAIR_DURATION_DICT', 'REPAIR_CREW_DEMAND_PER_MILE_BRIDGE']
set_geometry(component, component_data: dict)

Implemented by subclasses.

set_repair_configurator(component: Component) None

Implemented by subclasses.

set_supply_parameters(component: Component, component_data: dict) None

Implemented by subclasses.

class pyrecodes.component_configurator.r2d_component_configurator.R2DBuildingConfigurator(system_level_data: dict, recovery_time_stepping: list)

Bases: R2DComponentConfigurator

Class that configures parameters of building components as provided in the R2D output files.

SYSTEM_LEVEL_DATA = ['START_TIME_STEP', 'MAX_TIME_STEP', 'MAX_REPAIR_CREW_DEMAND_PER_BUILDING', 'REPAIR_CREW_DEMAND_PER_SQFT', 'DEFAULT_REPAIR_DURATION_DICT', 'DEMAND_PER_PERSON', 'HOUSING_RESOURCES']
get_building_housing_capacity(building_data: dict) int
get_total_building_area(building_data: dict) float
set_building_area(component: Component, building_data: dict) None
set_building_footprint(component: Component, building_data: dict) None
set_building_num_stories(component: Component, building_data: dict) None
set_geometry(component, building_data: dict)

Implemented by subclasses.

set_housing_demand_parameters(component: Component, building_data: dict) None
set_infrastructure_demand_parameters(component: Component, building_data: dict) None
Method sets the infrastructure demand for a building component based on two sources:
1. Based on the number of people living in the building.
2. Based on the demand data provided in the building data dictionary.
Note that the demand provided in the building data dictionary overwrites the demand based on the number of people.
set_infrastructure_demand_parameters_based_on_number_of_people(component: Component, building_data: dict) None
Method sets the infrastructure demand for a building component based on the number of people living in the building (i.e., housing capacity).
Note that only the resources defined in the “DEMAND_PER_PERSON” attribute in the system configuration file are considered.
set_infrastructure_demand_parameters_directly_based_on_building_data(component: Component, building_data: dict) None
Method sets the infrastructure demand for a building component based on the demand data provided in the building data dictionary.
This allows to overwrite the demand based on the number of people living in the building in case building’s demand is not correlated to the number of people living in the building (e.g., a commercial or industrial building).
set_operation_demand_parameters(component: Component, building_data: dict) None
set_parameters(component: Component, locality: list, component_data: dict, component_DS: int)

Method to set component parameters based on the data provided in the R2D output files.

set_repair_configurator(component: Component) None

Implemented by subclasses.

set_supply_parameters(component: Component, building_data: dict)

Implemented by subclasses.

class pyrecodes.component_configurator.r2d_component_configurator.R2DComponentConfigurator(system_level_data: dict, recovery_time_stepping: list)

Bases: ComponentConfigurator

Abstract class for R2D component configurators.

get_damage_state(damage_info: dict) int
Method to get the damage state of an R2D component based on the damage information provided in the R2D output files.
If building collapsed, damage state 4 is returned.
If not collapsed, maximum damage state of all damage states provided in the R2D output files is used.
set_asset_ids(component, component_data: dict)
set_general_information(component: Component, component_data: dict)
abstract set_geometry(component, component_data: dict)

Implemented by subclasses.

set_parameters(component: Component, locality: list, component_data: dict, component_damage_state: int)

Method to set component parameters based on the data provided in the R2D output files.

set_r2d_dict_getter(component: Component)
abstract set_repair_configurator(component: Component) None

Implemented by subclasses.

abstract set_supply_parameters(component, component_data: dict)

Implemented by subclasses.

class pyrecodes.component_configurator.r2d_component_configurator.R2DPipeConfigurator(system_level_data: dict, recovery_time_stepping: list)

Bases: R2DComponentConfigurator

Class that sets parameters of a Pipe as provided in the R2D output files.

SYSTEM_LEVEL_DATA = ['START_TIME_STEP', 'MAX_TIME_STEP', 'DEFAULT_REPAIR_DURATION_DICT', 'REPAIR_CREW_DEMAND_PER_MILE_PIPE']
get_damage_state(damage_info: dict) int
Method to get the damage state of R2D pipes based on the damage information provided in the R2D output files.
Aggreggate dmage states are considered. Leak = 1. Break = 2.
set_geometry(component, component_data: dict)

Implemented by subclasses.

set_r2d_dict_getter(component: Component)
set_repair_configurator(component: Component) None

Implemented by subclasses.

set_supply_parameters(component: Component, component_data: dict) None

At the moment, pipe supply is not defined. Pipe’s ability to transfer water is based on its functionality level and defined in the r2d_dict attribute.

class pyrecodes.component_configurator.r2d_component_configurator.R2DRoadwayConfigurator(system_level_data: dict, recovery_time_stepping: list)

Bases: R2DTransportationComponentConfigurator

Class that sets parameters of a Roadway as provided in the R2D output files.

SYSTEM_LEVEL_DATA = ['START_TIME_STEP', 'MAX_TIME_STEP', 'DEFAULT_REPAIR_DURATION_DICT', 'REPAIR_CREW_DEMAND_PER_MILE_ROADWAY']
get_road_length(component) float
set_geometry(component, component_data: dict)

Implemented by subclasses.

set_repair_configurator(component: Component) None

Implemented by subclasses.

set_supply_parameters(component: Component, component_data: dict) None

Implemented by subclasses.

class pyrecodes.component_configurator.r2d_component_configurator.R2DTransportationComponentConfigurator(system_level_data: dict, recovery_time_stepping: list)

Bases: R2DComponentConfigurator

set_general_information(component: Component, component_data: dict)
class pyrecodes.component_configurator.r2d_component_configurator.R2DTunnelConfigurator(system_level_data: dict, recovery_time_stepping: list)

Bases: R2DTransportationComponentConfigurator

Class that sets parameters of a Tunnel as provided in the R2D output files.

Not clear how the class should look like at the moment. Future work.

SYSTEM_LEVEL_DATA = ['START_TIME_STEP', 'MAX_TIME_STEP', 'DEFAULT_REPAIR_DURATION_DICT', 'REPAIR_CREW_DEMAND_PER_MILE_TUNNEL']
set_geometry(component, component_data: dict)

Implemented by subclasses.

set_repair_configurator(component: Component) None

Implemented by subclasses.

set_supply_parameters(component: Component, component_data: dict) None

Implemented by subclasses.