File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -1455,7 +1455,7 @@ def next_grid_state(self,
14551455 infos = []
14561456 disconnected_during_cf = np .full (type (self ).n_line , fill_value = - 1 , dtype = dt_int )
14571457 conv_ = self ._runpf_with_diverging_exception (is_dc )
1458- if env ._no_overflow_disconnection or env . _called_from_reset or conv_ is not None :
1458+ if env ._no_overflow_disconnection or conv_ is not None :
14591459 return disconnected_during_cf , infos , conv_
14601460
14611461 # the environment disconnect some powerlines
@@ -1474,8 +1474,12 @@ def next_grid_state(self,
14741474 ) & lines_status
14751475
14761476 # b) deals with soft overflow (disconnect them if lines still connected)
1477- mask_inc = (lines_flows >= thermal_limits ) & lines_status
1478- mask_inc [counter_increased ] = False
1477+ if env ._called_from_reset :
1478+ # no soft overflow after a reset
1479+ mask_inc = np .zeros_like (thermal_limits , dtype = dt_bool )
1480+ else :
1481+ mask_inc = (lines_flows >= thermal_limits ) & lines_status
1482+ mask_inc [counter_increased ] = False
14791483 init_time_step_overflow [mask_inc ] += 1
14801484 counter_increased [mask_inc ] = True
14811485 to_disc [
You can’t perform that action at this time.
0 commit comments