You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the case 14 if I disconnect the line 6_7_18 it will also disconnect the generator gen_7_4 (only connected to the grid through this line).
If the backend does check_isolated_and_disconnected_injections then nothing surprising is happening: the episode is over because a generator is alone (one case of game over)
But if we deactivate the check_isolated_and_disconnected_injections then the backend will not throw a game over. And actually in this case it will not even tell grid2op it has disconnected an element (topo_vect is not updated correctly)
importosimportnumpyasnpimportgrid2opfrompypowsybl2gridimportPyPowSyBlBackendimportpypowsyblasppenv_no_auto_disco=grid2op.make("l2rpn_case14_sandbox", test=True, backend=PyPowSyBlBackend(check_isolated_and_disconnected_injections=True), allow_detachment=True)
env_auto_disco=grid2op.make("l2rpn_case14_sandbox", test=True, backend=PyPowSyBlBackend(check_isolated_and_disconnected_injections=False), allow_detachment=True)
obs_no_auto_disco=env_no_auto_disco.reset()
obs_auto_disco=env_auto_disco.reset()
line_name="6_7_18"gen_name="gen_7_4"l_id, *_=type(env_no_auto_disco).get_line_info(line_name=line_name)
gen_id, *_=type(env_no_auto_disco).get_gen_info(gen_name=gen_name)
act_isolate_gen=env_no_auto_disco.action_space({"set_line_status": [(line_name, -1)]})
obs1_no_auto_disco, reward_no_auto_disco, done_no_auto_disco, info_no_auto_disco=env_no_auto_disco.step(act_isolate_gen)
obs1_auto_disco, reward_auto_disco, done_auto_disco, info_auto_disco=env_auto_disco.step(act_isolate_gen)
assertdone_no_auto_disco# we prevent to disconnect load and generators, so it's normalassertnotdone_auto_disco# we allow to disconnect load and generators, so it's normal in this caseassertobs1_auto_disco.topo_vect[obs1_auto_disco.line_or_pos_topo_vect[l_id]] ==-1# line is correctly disconnected (or side)assertobs1_auto_disco.topo_vect[obs1_auto_disco.line_ex_pos_topo_vect[l_id]] ==-1# line is correctly disconnected (ex side)assertnotobs1_auto_disco.line_status[l_id] # line is correctly marked as disconnectedassertnp.abs(obs1_auto_disco.gen_p[gen_id]) <=1e-7# gen p is 0 because gen has been deactivatedassertnp.abs(obs1_auto_disco.gen_v[gen_id]) <=1e-7# gen v is 0 because gen has been deactivatedassertobs1_auto_disco.topo_vect[obs1_auto_disco.gen_pos_topo_vect[gen_id]] ==-1# gen should be to bus "-1" because it's disconnectedassertobs1_auto_disco.gen_detached[gen_id] # gen should be marked as detached (grid2op does that based on topo_vect of generator)
The text was updated successfully, but these errors were encountered:
@BDonnot I wonder what is expected for bus num in the topo vect when an element is connected to a bus but not anymore a bus beloning to main connected component
is it expected to have a bus num to -1 just to mention that it is not connected to a bus of main connected component
or should we set a bus num even if this bus is not in main connected component ?
Here is a reproducible example.
On the case 14 if I disconnect the line
6_7_18
it will also disconnect the generatorgen_7_4
(only connected to the grid through this line).If the backend does
check_isolated_and_disconnected_injections
then nothing surprising is happening: the episode is over because a generator is alone (one case of game over)But if we deactivate the
check_isolated_and_disconnected_injections
then the backend will not throw a game over. And actually in this case it will not even tell grid2op it has disconnected an element (topo_vect is not updated correctly)The text was updated successfully, but these errors were encountered: