7.1.2. infrarisk.src.physical package

7.1.2.1. Subpackages

7.1.2.2. infrarisk.src.physical.integrated_network module

class infrarisk.src.physical.integrated_network.IntegratedNetwork(name, water_folder=None, power_folder=None, transp_folder=None, power_sim_type=None, water_sim_type=None)

Bases: object

An integrated infrastructure network class

deploy_crews(init_power_crew_locs=None, power_crews_size=None, init_water_crew_locs=None, water_crews_size=None, init_transpo_crew_locs=None, transpo_crews_size=None)

Deploys the infrastructure crews for performing recovery actions.

Parameters:
  • init_power_crew_locs (list of strings) – Initial locations (nearest transportation nodes) of the power crews.

  • power_crews_size (list) – Size of the power crews.

  • init_water_crew_locs (list) – Initial locations (nearest transportation nodes) of the water crews.

  • water_crews_size (list) – Size of the water crews.

  • init_transpo_crew_locs (list of strings) – Initial locations (nearest transportation nodes) of the transportation crews.

  • transpo_crews_size (list) – Size of the transportation crews.

generate_betweenness_centrality()

Generates the betweenness centrality of the integrated graph.

generate_dependency_table(dependency_file)

Generates the dependency table from an input file.

Parameters:

dependency_file (string) – The location of the dependency file in csv format.

generate_integrated_graph(basemap=False)

Generates the integrated network as a Networkx graph.

Parameters:

basemap (bool, optional) – If True, the basemap will be added to the integrated graph, defaults to False

generate_power_networkx_graph(plot=False)

Generates the power network as a networkx object.

Parameters:

plot (bool, optional) – To generate the network plot, defaults to False.

Returns:

The power network as a networkx object.

Return type:

networkx.Graph

generate_transpo_networkx_graph(plot=False)

Generates the transportation network as a networkx object.

Parameters:

plot (bool, optional) – To generate the network plot, defaults to False., defaults to False.

Returns:

The transportation network as a networkx object.

Return type:

networkx.Graph

generate_water_networkx_graph(plot=False)

Generates the water network as a networkx object.

Parameters:

plot (bool, optional) – To generate the network plot, defaults to False., defaults to False.

Returns:

The water network as a networkx object.

Return type:

networkx.Graph

get_disrupted_components()

Returns the list of disrupted components.

Returns:

current list of disrupted components.

Return type:

list

get_disrupted_infra_dict()

Returns the disrupted infrastructure components dictionary.

Returns:

The disrupted infrastructure components dictionary.

Return type:

dictionary

get_disruptive_events()

Returns the disruptive event data

Returns:

The table of disruptive events.

Return type:

pandas.DataFrame

get_idle_crew(crew_type, min_time=None)

Returns the idle crew of the given type.

Parameters:
  • crew_type (string) – Type of the crew.

  • min_time (float) – Earliest time to be considered for the idle crew.

Returns:

The idle crew of the given type.

Return type:

repair_crews.

get_map_extends()

Returns the extents of the map in the format ((xmin, ymin), (xmax, ymax)).

Returns:

The extent of the integrated graph (coordinates)

Return type:

list of tuples

Returns the dictionary of nodes and links in the network.

get_power_crew_loc()

Returns the current power crew location.

Returns:

Power crew location

Return type:

string

get_transpo_crew_loc()

Returns the current transportation crew location.

Returns:

Transportation crew location

Return type:

string

get_water_crew_loc()

Returns the current water crew location.

Returns:

Water crew location

Return type:

string

load_networks(water_folder, power_folder, transp_folder, power_sim_type='1ph', water_sim_type='PDA', sim_step=60, cyber_layer=False)

Loads the water, power and transportation networks.

Parameters:
  • water_folder (pathlib.Path object, optional) – The directory that consists of required water network files, defaults to None

  • power_folder (pathlib.Path object, optional) – The directory that consists of required power network files, defaults to None

  • transp_folder (pathlib.Path object, optional) – The directory that consists of required traffic network files, defaults to None

  • power_sim_type (string, optional) – Power simulation type (“1ph” for single phase networks, “3ph” for three phase networks), defaults to “1ph”

  • water_sim_type (string) – Type of water simulation: ‘PDA’ for pressure-dependent driven analysis, ‘DDA’ for demand driven analysis

  • sim_step (int, optional) – Simulation step in seconds, defaults to 60

  • cyber_layer (bool, optional) – Whether to include cyber layer in the integrated network, defaults to False

load_power_network(power_folder, power_sim_type, cyber_layer=False)

Loads the power network.

Parameters:
  • power_file (string) – The power systems file in json format

  • power_sim_type (string, optional) – Power simulation type (“1ph” for single phase networks, “3ph” for three phase networks), defaults to “1ph”

  • service_area (bool, optional) – If True, the service area will be loaded, defaults to False

load_transpo_network(transp_folder)

Loads the transportation network.

Parameters:

transp_folder (string) – The directory that consists of required transportation network files

load_water_network(water_folder, water_sim_type, initial_sim_step=60, cyber_layer=False)

Loads the water network.

Parameters:
  • water_folder (pathlib.Path object) – The directory that consists of required water network files

  • water_sim_type (string) – Type of water simulation: ‘PDA’ for pressure-dependent driven analysis, ‘DDA’ for demand driven analysis

  • initial_sim_step (int, optional) – The initial simulation step in seconds, defaults to 60

  • cyber_layer (bool, optional) – If True, the cyber layer will be loaded, defaults to False

pipe_leak_node_generator()

Splits the directly affected pipes to induce leak during simulations.

reset_crew_locs()

Resets the location of infrastructure crews.

set_disrupted_components(disruption_file)

Sets the disrupted components in the network.

Parameters:

scenario_file (string) – The location of the physical disruption scenario file in the list.

set_disrupted_cyber_components(cyber_disruption_file)

Sets the disrupted components in the network.

Parameters:

cyber_disruption_file – The location of the disruption scenario file in the list.

set_disrupted_cyber_dict()

Sets the disrupted infrastructure components dictionary with infrastructure type as keys.

set_disrupted_infra_dict()

Sets the disrupted infrastructure components dictionary with infrastructure type as keys.

set_map_extends()

Sets the extents of the map in the format ((xmin, ymin), (xmax, ymax)).

set_power_crew_loc(power_crew_loc)

Sets the location of the power crew.

Parameters:

power_crew_loc (string) – The name of the location (transportation node)

set_transpo_crew_loc(transpo_crew_loc)

Sets the location of the transportation crew.

Parameters:

transpo_crew_loc (string) – The name of the location (transportation node)

set_water_crew_loc(water_crew_loc)

Sets the location of the water crew.

Parameters:

water_crew_loc (string) – The name of the location (transportation node)

7.1.2.3. infrarisk.src.physical.interdependencies module

Classes and functions to manage dependencies in the integrated infrastructure network.

class infrarisk.src.physical.interdependencies.DependencyTable

Bases: object

A class to store information related to dependencies among power, water and transportation networks.

add_gen_reserv_coupling(water_id, power_id)

Creates a generator-on-reservoir dependency entry in the dependency table.

Parameters:
  • water_id (string) – The name of the reservoir in the water network model.

  • power_id (string) – The name of the generator in the power systems model.

add_pump_loadmotor_coupling(water_id, power_id)

Creates a pump-on-motor dependency entry in the dependency table when motor is modled as a load.

Parameters:
  • water_id (string) – The name of the pump in the water network model.

  • power_id (string) – The name of the motor (modeled as load in three phase pandapower networks) in the power systems model.

add_pump_motor_coupling(water_id, power_id)

Creates a pump-on-motor dependency entry in the dependency table.

Parameters:
  • water_id (string) – The name of the pump in the water network model.

  • power_id (string) – The name of the motor in the power systems model.

add_transpo_access(integrated_graph)

Creates a mapping to nearest road link from every water/power network component.

Parameters:

integrated_graph (networkx.Graph) – The integrated network as networkx object.

build_power_water_dependencies(dependency_file)

Adds the power-water dependency table to the DependencyTable object.

Parameters:

dependency_file (string) – The location of the dependency file containing dependency information.

build_transportation_access(integrated_graph)

Adds the transportatio naccess table to the DependencyTable object.

Parameters:

integrated_graph (networkx.Graph) – The integrated network as Networkx object.

update_dependencies(network, time_stamp, next_time_stamp)

Updates the operational performance of all the dependent components in the integrated network.

Parameters:
  • network (networkx.Graph) – The integrated infrastructure network object.

  • time_stamp (integer) – The start time of the current iteration in seconds.

  • next_time_stamp (integer) – The end tiem of the iteration.

infrarisk.src.physical.interdependencies.find_connected_nodes(component, integrated_network)

Finds the nodes to which the given component is connected to.

Parameters:
  • component (string) – Name of the component.

  • integrated_network (networkx.Graph) – The integrated network in networkx format.

Returns:

List of connected nodes.

Return type:

list

infrarisk.src.physical.interdependencies.find_connected_power_node(component, pn)

Finds the bus to which the given power systems component is connected to. For elements which are connected to two buses, the start bus is returned.

Parameters:
  • component (string) – Name of the power systems component.

  • pn (pandaPowerNet) – The power network the origin node belongs to.

Returns:

Name of the connected bus.

Return type:

string

infrarisk.src.physical.interdependencies.find_connected_transpo_node(component, tn)

Finds the bus to which the given power systems component is connected to. For elements which are connected to two buses, the start bus is returned.

Parameters:
  • component (string) – Name of the power systems component.

  • pn (pandaPowerNet) – The power network the origin node belongs to.

Returns:

Name of the connected bus.

Return type:

string

infrarisk.src.physical.interdependencies.find_connected_water_node(component, wn)

Finds the water network node to which the water component is connected to.

Parameters:
  • component (string) – Name of the water network component.

  • wn (wntr.network.WaterNetworkModel) – The water distribution network the origin node belongs to.

Returns:

Name of the water network node.

Return type:

string

infrarisk.src.physical.interdependencies.get_compon_details(compon_name)

Fetches the infrastructure type, component type, component code and component actual name.

Parameters:

compon_name (string) – Name of the component.

Returns:

Infrastructure type, component type, component code and component actual name.

Return type:

list

infrarisk.src.physical.interdependencies.get_compon_repair_time(component)

Returns the repair time of the given component.

Parameters:

component (string) – Name of the component.

Returns:

Repair time of the component in hours.

Return type:

float

infrarisk.src.physical.interdependencies.get_nearest_node(integrated_graph, connected_node, target_type)

Finds the nearest node belonging to a specific family from a given node and the distance between the two.

Parameters:
  • integrated_graph (netwrokx.Graph) – The integrated network in networkx format.

  • connected_node (string/integer) – Name of the node for which the nearest node has to be identified.

  • target_type (string) – The type of the target node (power, transpo, water)

Returns:

Nearest node belonging to target type and the distance in meters.

Return type:

list