Skip to content
Snippets Groups Projects
Commit 8a9d7fb8 authored by Julian Stürmer's avatar Julian Stürmer
Browse files

Add function that deactivates connected components

parent 35d6c9fd
No related branches found
No related tags found
No related merge requests found
Pipeline #487 canceled
......@@ -272,4 +272,29 @@ function destroy_tl!(
end
return network_data
end
#=
Deactivates all components (generator, loads, etc.) in a connected component.
=#
function _deactivate_cc!(
network_data::Dict{String,<:Any},
active_cc_gens::Array{Int64,1},
active_cc_loads::Array{Int64,1}
)
### Deactivate all active generators in connected component
for g in active_cc_gens
network_data["gen"]["$g"]["gen_status"] = 0
end
### Deactivate all active loads in connected component
for l in active_cc_loads
network_data["load"]["$g"]["status"] = 0
end
### Deactivate rest of connected component (branches, dangling buses etc.)
simplify_network!(network_data)
return nothing
end
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment