Data

PowerModelsRestoration extends the base PowerModels data format by supporting a damaged key to components that need to be repaired. Currently supported components for restoration are:

PowerModelsRestoration.restoration_components
1×4 Matrix{String}:
 "bus"  "gen"  "storage"  "branch"

To specify a damaged component, sets its damaged value to 1.

case["gen"]["1"]["damaged"]==1

Terminology

There are three terms related to the status of components:

  • active (inactive)
  • damaged
  • repairable

The component status value, e.g. gen["gen_status"]=1 determines that a component is active. The damaged status is determined by gen["damaged"]=1. A component is repairable if is it active and damaged, gen["gen_status"]==1 && gen["damaged"]==1.

Why? if a component is not active, it is filtered out of the network by the powermodels functions that create an optimization problem. When determining how many repairs can be done, this must be accounted for.

In addition, this allows heuristic problems like RAD to only consider repairing subsets of items that are active, i.e. a component that is damaged but not active is for future restoration problems.

Data Functions

The following functions are responsible for handling the data dictionary used in PowerModelsRestoration:

PowerModelsRestoration.add_load_weights!Method
add_load_weights!(data::Dict{String,<:Any})

Add load weights to network data. Only supports pti files. Takes the load_ckt key ('l', 'm', 'h') and assigns a load weight key (1.0, 10.0, 100.0).

source
PowerModelsRestoration.apply_restoration_sequence!Method
`apply_restoration_sequence!(data::Dict{String,<:Any}, repair_order::Dict{String,<:Any})`

Update devices status and damaged indicator based on the repair order.

E.g. if a device is repaired in network id 3, then before network 3 its status is `0`
and its `damaged` indicator is `1`.  In network 3, its status is `1` and its damaged status is `1`.
After network 3, its status is `1` and its damaged indicator is `0`.

Before:
| nw_id   |  1  |  2  |  3  |  4  |
| ------- | --- | --- | --- | --- |
| status  |  1  |  1  |  1  |  1  |
| damaged |  1  |  1  |  1  |  1  |

Applying repair in network 3:
| nw_id   |  1  |  2  |  3  |  4  |
| ------- | --- | --- | --- | --- |
| status  |  0  |  0  |  1  |  1  |
| damaged |  1  |  1  |  1  |  0  |
source
PowerModelsRestoration.clean_status!Method
clean_status!(data::Dict{String,<:Any})

Replace near integer status values with integers (tol=1e-4) and set bus_type according to the status value.

Non-integer statuses may occur for due to numerical tolerance, where a component status may be reported as 1e-9 by a solver.

source
PowerModelsRestoration.damage_components!Method
damage_components!(nw_data::Dict{String,<:Any}, comp_list::Dict{String, Set{String}})

Set the damage indicator to 1 for components in the comp_list.

    julia> damage_components!(network, Dict("bus"=>["1","3"]))
source
PowerModelsRestoration.get_active_componentsMethod
get_active_components(network::Dict{String, <:Any})

Return a dictionary of the active component indices. A component is inactive if its status value is 1.

    julia> get_active_components(network)
    Dict{String, Set{String}} with 4 entries:
        "gen"     => Set(["4", "1", "2"])
        "branch"  => Set(["4", "1", "5", "2", "6", "7", "3"])
        "storage" => Set(["1"])
        "bus"     => Set(["4"])
source
PowerModelsRestoration.get_damaged_componentsMethod
get_damaged_components(network::Dict{String, <:Any})

Return a dictionary of the damaged component indices. A component is damaged if "damaged"==1.

    julia> get_damaged_components(network)
    Dict{String, Set{String}} with 4 entries:
        "gen"     => Set(["4", "1", "2"])
        "branch"  => Set(["4", "1", "5", "2", "6", "7", "3"])
        "storage" => Set(["1"])
        "bus"     => Set(["4"])
source
PowerModelsRestoration.get_inactive_componentsMethod
get_inactive_components(network::Dict{String, <:Any})

Return a dictionary of the inactive component indices. A component is inactive if its status value is 0.

    julia> get_inactive_components(network)
    Dict{String, Set{String}} with 4 entries:
        "gen"     => Set(["4", "1", "2"])
        "branch"  => Set(["4", "1", "5", "2", "6", "7", "3"])
        "storage" => Set(["1"])
        "bus"     => Set(["4"])
source
PowerModelsRestoration.get_repairable_componentsMethod
get_repairable_components(network::Dict{String, <:Any})

Return a dictionary of the repairable component indices. A component is repairable if "damaged"==1 and "status"=1

    julia> get_repairable_components(network)
    Dict{String, Set{String}} with 4 entries:
        "gen"     => Set(["4", "1", "2"])
        "branch"  => Set(["4", "1", "5", "2", "6", "7", "3"])
        "storage" => Set(["1"])
        "bus"     => Set(["4"])
source
PowerModelsRestoration.make_inactive!Method
make_inactive!(nw_data::Dict{String,<:Any}, comp_list::Dict{String, Set{String}})

Set the status indicator to 0 for components in the comp_list.

    julia> make_inactive!(network, Dict("bus"=>["1","3"]))
source
PowerModelsRestoration.replicate_restoration_networkMethod
replicate_restoration_network(sn_data::Dict{String,<:Any}; count::Int=1, global_keys::Set{String}=Set{String}())

Transforms a single network into a multinetwork with several deepcopies of the original network. Start with nwid "0" before repairs are conducted, then count number of preriods where repairs are performed. Add network keys for repairs, the number of repairs that are allowed in each period, and repaired_total, the cumulative repairs in the network. Also add time_elapsed based on the number of repairs that occur in the following period.

source
PowerModelsRestoration.replicate_restoration_networkMethod
replicate_restoration_network(sn_data::Dict{String,<:Any}; count::Int=1, global_keys::Set{String}=Set{String}())

Transforms a single network into a multinetwork with several deepcopies of the original network. Start with nwid "0" before repairs are conducted, then count number of preriods where repairs are performed. Add network keys for repairs, the number of repairs that are allowed in each period, and repaired_total, the cumulative repairs in the network. Also add time_elapsed based on the number of repairs that occur in the following period.

source
PowerModelsRestoration.replicate_restoration_networkMethod
replicate_restoration_network(sn_data::Dict{String,<:Any}; count::Int=1, global_keys::Set{String}=Set{String}())

Transforms a single network into a multinetwork with several deepcopies of the original network. Start with nwid "0" before repairs are conducted, then count number of preriods where repairs are performed. Add network keys for repairs, the number of repairs that are allowed in each period, and repaired_total, the cumulative repairs in the network. Also add time_elapsed based on the number of repairs that occur in the following period.

source
PowerModelsRestoration.update_status!Method
update_status!(network_1::Dict{String, <:Any}, network_2::Dict{String, <:Any})

Update the status values in network1 with values from network2. Supports sparse networks.

source