building_with_emergency_calls

class pyrecodes.component.building_with_emergency_calls.BuildingWithEmergencyCalls

Bases: StandardiReCoDeSComponent

Subclass of the StandardiReCoDeSComponent class that simulates the performance of a building with increased post-disaster demand for communication services due to emergency calls.

Attributes

(only subclass specific)

COMMUNICATION_RESOURCE_NAMEstr
The demand for this resource will increase after a disaster.
This name should be defined in the component library file by adding the ‘PostDisasterIncreaseDueToEmergencyCalls’ key with a ‘True’ value.
COMMUNICATION_DEMAND_MULTIPLIERfloat

Defines by how much the pre-disaster demand for the communication resource is increased after a disaster.

COMMUNICATION_DEMAND_INCREASE_TIME_STEPint
Define at which time step of the recovery simulation will the demand for communication resource increase.
Note: this time step should be at or after the DISASTER_TIME_STEP defined in the system configuration file.
COMMUNICATION_DEMAND_EXP_DECREASE_COEFFfloat

Define the parameter of the exponential function that simulates the post-disaster decrease of the demand for communication resource following the initial demand surge.

# TODO: Write a decorator to increase/decrease the demand of any resource of any component based on the time step, not functionality. # This class is then the standard component with a decorator.

COMMUNICATION_DEMAND_EXP_DECREASE_COEFF = -0.3
COMMUNICATION_DEMAND_INCREASE_TIME_STEP = 1
COMMUNICATION_DEMAND_MULTIPLIER = 10.0
COMMUNICATION_RESOURCE_NAME = ''
add_resources(supply_or_demand: str, type: str, resource_dict: dict) None
override parent method
While adding resources check if a resource is a communication resource.
If yes, set the COMMUNICATION_RESOURCE_NAME attribute.
Note: only one resource can be a communication resource that has increased demand following a disaster.
TODO: Implement a check for multiple communication resources. Future work.
check_if_demand_increase_considered(resource_name: str, resource_parameters: dict) None
Check if the resource demand should be increased following the disaster for the resource resource_name.
Communication resource parameters dict in ComponentLibrary should have the ‘PostDisasterIncreaseDueToEmergencyCalls’ key with a ‘True’ value.
modify_emergency_calls_demand(initial_communication_demand: float, time_step: int) float
Modify communication demand based on the current time step, the exponential function parameters and initial communication demand.
The modified communication demand cannot be smaller than the initial, pre-disaster, demand.
update(time_step: int) None
extend parent method
Update the demand for communication services conditioned on the current time step.
update_communication_demand(time_step: int) None
Calculate the communication resource demand at the current time step
and update in component’s operation demand.