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
When obs.target_dispatch is 0 and obs.actual_dispatch is not 0 at time t, the obs.actual_dispatch will be added to obs.target_dispatch given an redispatch action at the next step.
How to reproduce
from grid2op import make
from lightsim2grid import LightSimBackend
backend = LightSimBackend()
env = make(".../L2RPN_wcci2022_starting_kit/input_data_local", backend=backend)
env.set_id(0)
obs = env.reset()
env.fast_forward_chronics(10)
obs = env.get_obs()
gen_id = 2
# Step 11
act = env.action_space()
act.redispatch = [(gen_id, -3.5)]
obs, reward, done, info = env.step(act)
print('step {}: id {}, gen {:.1f}, actual {:.1f}, target {:.1f}, forecast {:.1f}'.format(
obs.current_step, gen_id, obs.gen_p[gen_id], obs.actual_dispatch[gen_id], obs.target_dispatch[gen_id], obs.get_forecasted_inj()[0][gen_id]))
# Step 12
act = env.action_space()
act.redispatch = [(gen_id, +3.5)]
obs, reward, done, info = env.step(act)
print('step {}: id {}, gen {:.1f}, actual {:.1f}, target {:.1f}, forecast {:.1f}'.format(
obs.current_step, gen_id, obs.gen_p[gen_id], obs.actual_dispatch[gen_id], obs.target_dispatch[gen_id], obs.get_forecasted_inj()[0][gen_id]))
# Step 13
act = env.action_space()
act.redispatch = [(gen_id, +1.5)]
obs, reward, done, info = env.step(act)
print('step {}: id {}, gen {:.1f}, actual {:.1f}, target {:.1f}, forecast {:.1f}'.format(
obs.current_step, gen_id, obs.gen_p[gen_id], obs.actual_dispatch[gen_id], obs.target_dispatch[gen_id], obs.get_forecasted_inj()[0][gen_id]))
Current output
step 11: id 2, gen 342.7, actual -3.5, target -3.5, forecast 348.6
step 12: id 2, gen 346.2, actual -2.5, target 0.0, forecast 353.8
step 13: id 2, gen 349.7, actual -1.4, target -1.0, forecast 355.7
Expected output
step 11: id 2, gen 342.7, actual -3.5, target -3.5, forecast 348.6
step 12: id 2, gen 346.2, actual -2.5, target 0.0, forecast 353.8
step 13: id 2, gen 349.7, actual -1.4, target 1.5, forecast 355.7
The text was updated successfully, but these errors were encountered:
This is indeed an incorrect behaviour and the setpoint should indeed be +1.5 (as you mentionned) after the third action here. I'll see where the bug occurs and try to fix it "asap" (though i'm not sure when)
Benjamin
BDonnot
added a commit
to BDonnot/Grid2Op
that referenced
this issue
Dec 2, 2022
Environment
1.7.2
ubuntu18.04
Bug description
When
obs.target_dispatch
is 0 andobs.actual_dispatch
is not 0 at timet
, theobs.actual_dispatch
will be added toobs.target_dispatch
given an redispatch action at the next step.How to reproduce
Current output
Expected output
The text was updated successfully, but these errors were encountered: