infrastructure_interface_recovery_model

class pyrecodes.component_recovery_model.infrastructure_interface_recovery_model.InfrastructureInterfaceRecoveryModel(recovery_model_parameters: dict)

Bases: AbstractRecoveryModel

Component recovery model for infrastructure interfaces to simulate their pre-defined post-disaster supply/demand dynamics.

RECOVERY_ACTIVITY_NAME = 'Recovery'
get_damage_level() float

Get the damage level of the infrastructure interface.

Returns:

float: The damage level.

get_demand() dict

Get the demand for the infrastructure interface.

Returns:

dict: An empty dictionary, as it assumed that there is no recovery demand for infrastructure interfaces.

get_functionality_level() float

Get the functionality level of the infrastructure interface.

Note: input to the damage functionality relation is 1 - damage level due to the way in which the Multistep Relation is defined.

Returns:

float: The functionality level.

recover(time_step: int) None
Perform recovery for a time step. Recovery here means simulating the pre-defined post-disaster supply/demand dynamics.
Recovery happens at each time step. Recovery time steps are not considered for Infrastructure Interfaces as the supply/dynamic is predefined.
Args:

time_step (int): The time step for which recovery is performed.

set_activities_demand_to_met() None
set_damage_functionality() None

Set damage functionality relation. For this model it’s always a multiple step relation.

set_initial_damage_level(damage_level: float) None

Set the initial damage level for infrastructure interfaces. The damage level is always 1 to triger the pre-defined supply/demand dynamics.

Args:

damage_level (float): The initial damage level. For this model, it must be 1.

Notes:
  • This method sets both the damage level and the initial state of the recovery activity.

set_parameters(parameters: dict, default_duration=0) None

Set model parameters. These include setting the post-disaster functionality levels and the time steps at which they change as multiple steps to achieve the predefined supply/demand dynamics as set in the system configuration file.

Args:

parameters (dict): Parameters for the recovery model. default_duration (list, optional): Default duration for recovery activities (default is zero).

Notes:
  • This method sets step durations and demands for the recovery activity.

  • RestoredIn is the time it takes for the infrastructure interface to be restored to full functionality. It is sampled before passed to this method. That’s why it’s a deterministic value here.

  • The implementation should be improved in the future.

TODO:
  • Improve the method. See if StepLimits are redundant as RestoredIn is already defined.