r2d_damage_input¶
- class pyrecodes.damage_input.r2d_damage_input.R2DDamageInput(parameters, system)¶
Bases:
DamageInput
Class that sets the initial damage of components from an R2D output file.
- DAMAGE_STATE_ID_POSITION_IN_COMPONENT_NAME = 2¶
- component_is_damaged(component: Component) bool ¶
- Method that checks if the component is damaged.Note that the R2D Damage Input only assigns damage to R2D components.
- configure_damage_file(r2d_dict) dict ¶
Method that configures the damage file to only take components which are considered in pyrecodes model. Some components might be in the R2D damage file but not considered in the pyrecodes model.
- set_damage_in_the_distribution_model() None ¶
- Method that provides initial damage information to third-party infrastructure simulators through the API.TODO: Generalize this method to other infrastructure systems. At the moment, it is specific to the water system defined in REWET.
- set_initial_component_damage_level() None ¶
- Method sets the initial damage of components.Component damage state is defined when components are constructed, since components in different damage states have different component templates in the component library when using R2D outputs.Initial damage level of 1 is set for all components that are damaged (i.e., damage state above 0) or are infrastructure interfaces, since those components have predefined supply/demand dynamics triggered once the initial damage is set.
- set_initial_damage() None ¶
Method sets the initial damage of components and third-party infrastructure simulators.
- set_water_system_component_damage_information(pipe_damage: dict) None ¶