2
2
irreducible_buses:: Set{Int} = Set {Int} () # Buses that are not reduced in the network reduction
3
3
bus_reduction_map:: Dict{Int, Set{Int}} = Dict {Int, Set{Int}} () # Maps reduced bus to the set of buses it was reduced to
4
4
reverse_bus_search_map:: Dict{Int, Int} = Dict {Int, Int} ()
5
- direct_branch_map:: Dict{Tuple{Int, Int}, PSY.Branch } =
6
- Dict {Tuple{Int, Int}, PSY.Branch } ()
7
- reverse_direct_branch_map:: Dict{PSY.Branch , Tuple{Int, Int}} =
8
- Dict {PSY.Branch , Tuple{Int, Int}} ()
9
- parallel_branch_map:: Dict{Tuple{Int, Int}, Set{PSY.Branch }} =
10
- Dict {Tuple{Int, Int}, Set{PSY.Branch }} ()
11
- reverse_parallel_branch_map:: Dict{PSY.Branch , Tuple{Int, Int}} =
12
- Dict {PSY.Branch , Tuple{Int, Int}} ()
5
+ direct_branch_map:: Dict{Tuple{Int, Int}, PSY.ACTransmission } =
6
+ Dict {Tuple{Int, Int}, PSY.ACTransmission } ()
7
+ reverse_direct_branch_map:: Dict{PSY.ACTransmission , Tuple{Int, Int}} =
8
+ Dict {PSY.ACTransmission , Tuple{Int, Int}} ()
9
+ parallel_branch_map:: Dict{Tuple{Int, Int}, Set{PSY.ACTransmission }} =
10
+ Dict {Tuple{Int, Int}, Set{PSY.ACTransmission }} ()
11
+ reverse_parallel_branch_map:: Dict{PSY.ACTransmission , Tuple{Int, Int}} =
12
+ Dict {PSY.ACTransmission , Tuple{Int, Int}} ()
13
13
series_branch_map:: Dict{Tuple{Int, Int}, Vector{Any}} =
14
14
Dict {Tuple{Int, Int}, Vector{Any}} ()
15
15
reverse_series_branch_map:: Dict{Any, Tuple{Int, Int}} =
34
34
function populate_branch_maps_by_type! (nrd:: NetworkReductionData )
35
35
all_branch_maps_by_type = Dict (
36
36
" direct_branch_map" =>
37
- Dict {Type{<:PSY.Branch }, Dict{Tuple{Int, Int}, PSY.Branch }} (),
37
+ Dict {Type{<:PSY.ACTransmission }, Dict{Tuple{Int, Int}, PSY.ACTransmission }} (),
38
38
" reverse_direct_branch_map" =>
39
- Dict {Type{<:PSY.Branch }, Dict{PSY.Branch , Tuple{Int, Int}}} (),
39
+ Dict {Type{<:PSY.ACTransmission }, Dict{PSY.ACTransmission , Tuple{Int, Int}}} (),
40
40
" parallel_branch_map" =>
41
- Dict {Type{<:PSY.Branch}, Dict{Tuple{Int, Int}, Set{PSY.Branch}}} (),
41
+ Dict{
42
+ Type{<: PSY.ACTransmission },
43
+ Dict{Tuple{Int, Int}, Set{PSY. ACTransmission}},
44
+ }(),
42
45
" reverse_parallel_branch_map" =>
43
- Dict {Type{<:PSY.Branch }, Dict{PSY.Branch , Tuple{Int, Int}}} (),
46
+ Dict {Type{<:PSY.ACTransmission }, Dict{PSY.ACTransmission , Tuple{Int, Int}}} (),
44
47
" series_branch_map" =>
45
- Dict {Type{<:PSY.Branch }, Dict{Tuple{Int, Int}, Vector{Any}}} (),
48
+ Dict {Type{<:PSY.ACTransmission }, Dict{Tuple{Int, Int}, Vector{Any}}} (),
46
49
" reverse_series_branch_map" =>
47
- Dict {Type{<:PSY.Branch }, Dict{Any, Tuple{Int, Int}}} (),
50
+ Dict {Type{<:PSY.ACTransmission }, Dict{Any, Tuple{Int, Int}}} (),
48
51
" transformer3W_map" => Dict{
49
52
Type{<: PSY.ThreeWindingTransformer },
50
53
Dict{
@@ -64,31 +67,31 @@ function populate_branch_maps_by_type!(nrd::NetworkReductionData)
64
67
map_by_type = get! (
65
68
all_branch_maps_by_type[" direct_branch_map" ],
66
69
_get_segment_type (v),
67
- Dict {Tuple{Int, Int}, PSY.Branch } (),
70
+ Dict {Tuple{Int, Int}, PSY.ACTransmission } (),
68
71
)
69
72
map_by_type[k] = v
70
73
end
71
74
for (k, v) in nrd. reverse_direct_branch_map
72
75
map_by_type = get! (
73
76
all_branch_maps_by_type[" reverse_direct_branch_map" ],
74
77
_get_segment_type (k),
75
- Dict {PSY.Branch , Tuple{Int, Int}} (),
78
+ Dict {PSY.ACTransmission , Tuple{Int, Int}} (),
76
79
)
77
80
map_by_type[k] = v
78
81
end
79
82
for (k, v) in nrd. parallel_branch_map
80
83
map_by_type = get! (
81
84
all_branch_maps_by_type[" parallel_branch_map" ],
82
85
_get_segment_type (v),
83
- Dict {Tuple{Int, Int}, Set{PSY.Branch }} (),
86
+ Dict {Tuple{Int, Int}, Set{PSY.ACTransmission }} (),
84
87
)
85
88
map_by_type[k] = v
86
89
end
87
90
for (k, v) in nrd. reverse_parallel_branch_map
88
91
map_by_type = get! (
89
92
all_branch_maps_by_type[" reverse_parallel_branch_map" ],
90
93
_get_segment_type (k),
91
- Dict {PSY.Branch , Tuple{Int, Int}} (),
94
+ Dict {PSY.ACTransmission , Tuple{Int, Int}} (),
92
95
)
93
96
map_by_type[k] = v
94
97
end
@@ -133,7 +136,7 @@ function populate_branch_maps_by_type!(nrd::NetworkReductionData)
133
136
end
134
137
135
138
_get_segment_type (:: T ) where {T <: PSY.ACBranch } = T
136
- _get_segment_type (x:: Set{PSY.Branch } ) = typeof (first (x))
139
+ _get_segment_type (x:: Set{PSY.ACTransmission } ) = typeof (first (x))
137
140
_get_segment_type (x:: Tuple{PSY.ThreeWindingTransformer, Int} ) = typeof (first (x))
138
141
139
142
get_irreducible_buses (rb:: NetworkReductionData ) = rb. irreducible_buses
0 commit comments