@@ -24,11 +24,12 @@ using TestComponentContainer =
24
24
ThreeWindingTransformer, TransformerTapRegulator, Source>;
25
25
using TestState = main_core::MainModelState<TestComponentContainer>;
26
26
27
- TransformerInput get_transformer (ID id, ID from, ID to, BranchSide tap_side, IntS tap_pos = na_IntS) {
27
+ TransformerInput get_transformer (ID id, ID from, ID to, BranchSide tap_side, IntS tap_pos = na_IntS,
28
+ IntS from_status = 1 ) {
28
29
return TransformerInput{.id = id,
29
30
.from_node = from,
30
31
.to_node = to,
31
- .from_status = 1 ,
32
+ .from_status = from_status ,
32
33
.to_status = 1 ,
33
34
.u1 = nan,
34
35
.u2 = nan,
@@ -267,7 +268,7 @@ TEST_CASE("Test Transformer ranking") {
267
268
std::vector<TransformerInput> transformers{
268
269
get_transformer (11 , 0 , 1 , BranchSide::from), get_transformer (12 , 0 , 1 , BranchSide::from),
269
270
get_transformer (13 , 5 , 7 , BranchSide::from), get_transformer (14 , 2 , 3 , BranchSide::from),
270
- get_transformer (15 , 8 , 9 , BranchSide::from), get_transformer (103 , 9 , 100 , BranchSide::from),
271
+ get_transformer (15 , 8 , 9 , BranchSide::from), get_transformer (103 , 9 , 100 , BranchSide::from, na_IntS, 0 ),
271
272
get_transformer (104 , 101 , 102 , BranchSide::from)};
272
273
main_core::add_component<Transformer>(state, transformers.begin (), transformers.end (), 50.0 );
273
274
@@ -285,9 +286,10 @@ TEST_CASE("Test Transformer ranking") {
285
286
main_core::add_component<Source>(state, sources.begin (), sources.end (), 50.0 );
286
287
287
288
std::vector<TransformerTapRegulatorInput> regulators{
288
- get_regulator (23 , 11 , ControlSide::to), get_regulator (24 , 12 , ControlSide::to),
289
- get_regulator (25 , 13 , ControlSide::to), get_regulator (26 , 14 , ControlSide::to),
290
- get_regulator (27 , 15 , ControlSide::to), get_regulator (28 , 16 , ControlSide::side_2)};
289
+ get_regulator (23 , 11 , ControlSide::to), get_regulator (24 , 12 , ControlSide::to),
290
+ get_regulator (25 , 13 , ControlSide::to), get_regulator (26 , 14 , ControlSide::to),
291
+ get_regulator (27 , 15 , ControlSide::to), get_regulator (28 , 16 , ControlSide::side_2),
292
+ get_regulator (105 , 103 , ControlSide::from), get_regulator (106 , 104 , ControlSide::from)};
291
293
main_core::add_component<TransformerTapRegulator>(state, regulators.begin (), regulators.end (), 50.0 );
292
294
293
295
state.components .set_construction_complete ();
@@ -300,10 +302,10 @@ TEST_CASE("Test Transformer ranking") {
300
302
// reference graph creation
301
303
pgm_tap::TrafoGraphEdgeProperties expected_edges_prop;
302
304
expected_edges_prop.insert (expected_edges_prop.end (),
303
- {{{3 , 0 }, 1 }, {{3 , 1 }, 1 }, {{3 , 2 }, 1 }, {{3 , 3 }, 1 }, {{3 , 4 }, 1 }});
305
+ {{{3 , 0 }, 1 }, {{3 , 1 }, 1 }, {{3 , 2 }, 1 }, {{3 , 3 }, 1 }, {{3 , 4 }, 1 }, {{ 3 , 6 }, 1 } });
304
306
expected_edges_prop.insert (expected_edges_prop.end (),
305
307
{{{4 , 0 }, 1 }, {{4 , 0 }, 1 }, {unregulated_idx, 0 }, {unregulated_idx, 0 }});
306
- expected_edges_prop.insert (expected_edges_prop.end (), 14 , {unregulated_idx, 0 });
308
+ expected_edges_prop.insert (expected_edges_prop.end (), 10 , {unregulated_idx, 0 });
307
309
308
310
std::vector<pgm_tap::TrafoGraphVertex> const expected_vertex_props{
309
311
{true }, {false }, {false }, {false }, {false }, {false }, {false },
@@ -353,11 +355,14 @@ TEST_CASE("Test Transformer ranking") {
353
355
{10 , 10e3 }, {100 , 10e3 }, {101 , 10e3 }, {102 , 10e3 }};
354
356
main_core::add_component<Node>(state, nodes.begin (), nodes.end (), 50.0 );
355
357
356
- std::vector<TransformerInput> transformers{
357
- get_transformer (11 , 0 , 1 , BranchSide::to), get_transformer (12 , 0 , 1 , BranchSide::from),
358
- get_transformer (13 , 2 , 3 , BranchSide::from), get_transformer (14 , 6 , 7 , BranchSide::from),
359
- get_transformer (15 , 5 , 8 , BranchSide::from), get_transformer (16 , 9 , 10 , BranchSide::from),
360
- get_transformer (103 , 9 , 100 , BranchSide::from), get_transformer (104 , 101 , 102 , BranchSide::from)};
358
+ std::vector<TransformerInput> transformers{get_transformer (11 , 0 , 1 , BranchSide::to),
359
+ get_transformer (12 , 0 , 1 , BranchSide::from),
360
+ get_transformer (13 , 2 , 3 , BranchSide::from),
361
+ get_transformer (14 , 6 , 7 , BranchSide::from),
362
+ get_transformer (15 , 5 , 8 , BranchSide::from),
363
+ get_transformer (16 , 9 , 10 , BranchSide::from),
364
+ get_transformer (103 , 9 , 100 , BranchSide::from, na_IntS, 0 ),
365
+ get_transformer (104 , 101 , 102 , BranchSide::from)};
361
366
main_core::add_component<Transformer>(state, transformers.begin (), transformers.end (), 50.0 );
362
367
363
368
std::vector<ThreeWindingTransformerInput> transformers3w{
@@ -374,10 +379,11 @@ TEST_CASE("Test Transformer ranking") {
374
379
main_core::add_component<Source>(state, sources.begin (), sources.end (), 50.0 );
375
380
376
381
std::vector<TransformerTapRegulatorInput> regulators{
377
- get_regulator (24 , 11 , ControlSide::to), get_regulator (25 , 12 , ControlSide::to),
378
- get_regulator (26 , 13 , ControlSide::to), get_regulator (27 , 14 , ControlSide::to),
379
- get_regulator (28 , 15 , ControlSide::to), get_regulator (29 , 16 , ControlSide::to),
380
- get_regulator (30 , 17 , ControlSide::side_2)};
382
+ get_regulator (24 , 11 , ControlSide::to), get_regulator (25 , 12 , ControlSide::to),
383
+ get_regulator (26 , 13 , ControlSide::to), get_regulator (27 , 14 , ControlSide::to),
384
+ get_regulator (28 , 15 , ControlSide::to), get_regulator (29 , 16 , ControlSide::to),
385
+ get_regulator (30 , 17 , ControlSide::side_2), get_regulator (105 , 103 , ControlSide::from),
386
+ get_regulator (106 , 104 , ControlSide::from)};
381
387
main_core::add_component<TransformerTapRegulator>(state, regulators.begin (), regulators.end (), 50.0 );
382
388
383
389
state.components .set_construction_complete ();
0 commit comments