@@ -324,12 +324,13 @@ inline auto get_edge_weights(TransformerGraph const& graph) -> TrafoGraphEdgePro
324
324
// In two winding trafo, the edge is always pointing to the control side; in three winding trafo edges, the
325
325
// edges are always pointing parallel to the control side: meaning that for delta configuration ABC, the above
326
326
// situations can happen.
327
+ // The logic still holds in meshed grids, albeit operating a more complex graph.
327
328
if (edge_src_rank != edge_tgt_rank - 1 ) {
328
- throw AutomaticTapInputError (
329
- " Control side of a transformer should be the relatively further side to a source.\n " );
329
+ throw AutomaticTapInputError (" The control side of a transformer regulator should be relatively further "
330
+ " away from the source than the tap side .\n " );
330
331
}
331
332
if (!is_unreachable (edge_res)) {
332
- result.emplace_back (graph[e].regulated_idx , edge_tgt_rank);
333
+ result.emplace_back (TrafoGraphEdge{ graph[e].regulated_idx , edge_tgt_rank}); // NOLINT
333
334
}
334
335
}
335
336
@@ -745,8 +746,7 @@ class TapPositionOptimizerImpl<std::tuple<TransformerTypes...>, StateCalculator,
745
746
// Lower bound should be updated to the current tap position if following is the case:
746
747
// - tap_max > tap_min && strategy_max == true
747
748
// - tap_max < tap_min && strategy_max == false
748
- // Upper bound should be updated to the current tap position if the rest is the case.
749
- bool const invert_strategy = control_at_tap_side_ ? !strategy_max : strategy_max;
749
+ bool const invert_strategy = control_at_tap_side_ != strategy_max;
750
750
if (tap_reverse_ == invert_strategy) {
751
751
lower_bound_ = current_;
752
752
last_down_ = false ;
0 commit comments