Skip to content

Commit

Permalink
Update power_grid_model_c/power_grid_model/include/power_grid_model/m…
Browse files Browse the repository at this point in the history
…ath_solver/observability.hpp

Co-authored-by: Martijn Govers <martijn.govers@alliander.com>
Signed-off-by: Tony Xiang <19280867+TonyXiang8787@users.noreply.github.com>
  • Loading branch information
TonyXiang8787 and mgovers authored Dec 19, 2024
1 parent 2372f2c commit 33bf4b6
Showing 1 changed file with 2 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -88,12 +88,10 @@ inline void assign_injection_sensor_radial(YBusStructure const& y_bus_structure,
if (flow_sensors[branch_entry_upstream] == 0) {
if (flow_sensors[bus_entry_current] == 1) {
// try to steal from current bus
flow_sensors[bus_entry_current] = 0;
flow_sensors[branch_entry_upstream] = 1;
std::swap(flow_sensors[branch_entry_upstream], flow_sensors[bus_entry_current]);
} else if (flow_sensors[bus_entry_upstream] == 1) {
// if not possible, steal from upstream bus
flow_sensors[bus_entry_upstream] = 0;
flow_sensors[branch_entry_upstream] = 1;
std::swap(flow_sensors[branch_entry_upstream], flow_sensors[bus_entry_upstream]);
}
}
// remove the current bus injection regardless of the original state
Expand Down

0 comments on commit 33bf4b6

Please sign in to comment.