lanl-ansi / PowerModelsRestoration.jl

A PowerModels Extension for Optimization of Power Network Restoration
https://lanl-ansi.github.io/PowerModelsRestoration.jl/stable/
Other
22 stars 9 forks source link

Update data functions #60

Closed noahrhodes closed 2 years ago

noahrhodes commented 2 years ago

New data functions necessary for the implementation of restoration heuristics.

codecov[bot] commented 2 years ago

Codecov Report

Merging #60 (5a10c93) into master (f978eed) will decrease coverage by 0.71%. The diff coverage is 89.20%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #60      +/-   ##
==========================================
- Coverage   90.71%   90.00%   -0.72%     
==========================================
  Files          19       19              
  Lines        1561     1570       +9     
==========================================
- Hits         1416     1413       -3     
- Misses        145      157      +12     
Impacted Files Coverage Δ
src/core/constraint_template.jl 92.10% <ø> (ø)
src/prob/mrsp.jl 95.83% <ø> (ø)
src/util/restoration_redispatch.jl 71.15% <ø> (ø)
src/core/data.jl 80.36% <88.97%> (-3.18%) :arrow_down:
src/core/constraint.jl 86.81% <100.00%> (ø)
src/core/ref.jl 100.00% <100.00%> (ø)
src/prob/rop.jl 94.93% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f978eed...5a10c93. Read the comment docs.

noahrhodes commented 2 years ago

The three terms related to the status of components are 1) active (inactive) 2) damaged 3) repairable

The component status value, e.g. gen["gen_status"]==1 determines if 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 (build_ref I believe?). 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 items that are active, i.e. a component that is damaged but not active is for future restoration, but not in this problem.

The name active/inactive does conflict with its meaning in these restoration problems. An inactive branch does not participate in restoration, but is reads as "a branch that is not yet repaired".

Do you have a suggestion for a different name than inactive?

noahrhodes commented 2 years ago

The term items is less specific, I like the use of components in these function names more.

There are two additional functions with items in their names. Should these also be changed?

ref_add_damaged_items! -> ref_add_damaged_components! constraint_restore_all_items -> constraint_restore_all_components

ccoffrin commented 2 years ago

Regarding items vs components, it like we are in agreement all can be updated to components.

Looking into the second point.

ccoffrin commented 2 years ago

I am currently thinking the use and definition of active, inactive, damaged, restorable makes sense. But we should probably add the definitions, as you mention here, to the docs. :-)

noahrhodes commented 2 years ago

@ccoffrin Changes are finished, should be ready after you verify the documentation changes!

noahrhodes commented 2 years ago

@ccoffrin a few changes made. should be ready.

ccoffrin commented 2 years ago

Great, tests are passing so merging!