Comments (9)
self.gen_activeprod_t in BasicEnv.py line 379 is completely 0. despite observation.prod_p being
[81.3 80.1 12.6 0. 80.49025102]
I would not expect all gens to be shut off in the forecast/next timestep.
from grid2op.
You are correct, this is a bug that I will work on in the next version.
For now, better not use "redispatch" action in simulate.
Benjamin
from grid2op.
This bug only appear when you simulate correct ?
from grid2op.
No, also in the step
obs, reward, done, info = env.step(act)
print(reward)
-5.0
from grid2op.
After a quick experiment, here is what is happening:
You want to modify the setpoint (by redispatching) of the 3 controlable generators. This is totally fine.
To "fix" your action, because the redispatching action must sum to 0, an "automaton" [imagine something that has the same role as the frequency control automaton in real life] takes care of that. It can act only on dispatchable generators. But you modify all the three.
As your action does not sum to 0:
import numpy as np
import grid2op
env = grid2op.make()
act = env.action_space({"redispatch": [(0, 4.9999784936326535), (1, 4.78524395611872), (4, -9.999591852954794)]})
np.sum(act._redispatch)
# -0.21436940320342046
then the action is not implemented because the constraints "I must have a redispatching summing at 0." can't be met.
You can see that with:
obs, reward, done, info = env.step(act)
print(info["is_dipatching_illegal"])
# it prints True
The error message is completely misleading i agree some work need to be done in this case.
This error is easily "fixed" you need to provide a vector that sums at 0, like this for example:
act2 = env.action_space({"redispatch": np.array([ 4.99997849, 4.78524396, 0. , 0. , -9.78522245])})
obs, reward, done, info = env.step(act2)
print(reward)
# 221.22035009361286
from grid2op.
Hmm that's a bit weird, because the -0.21 in this case are the decrease of system losses. But i understand your idea, so i can just scale the values correctly and it should work.
from grid2op.
This constraint of "redispatch should sum to 0." is to impose the system to always meet "sum Prod = sum Load + losses" and not interfer too much with the slack bus.
This constraints is met (more or less, up to +/- 1MW say) when the chronics have been generated.
If your vector does not sum at 0, then some agent could only decrease the values of one generator, and the slack bus would absorb all. This is only "a reasonable approximation" with a distributed slack bus (where this value is split on different generators), but some powerflows don't support this feature. That's why I added, directly in the environment, this "automaton" that enforce the redispatching vector to sum at 0.
Scaling up your vector would work in this case, but make sure that the ramps and pmin / pmax are met when you do that :-)
from grid2op.
Sure, i have to translate the OPF results correctly, which should be doable. Now i only have the issue in simulate like you already wrote. Thanks!
from grid2op.
Hello,
This issue should be fixed in the latest (0.5.8) grid2op issue, where i check specifically for this case and throw the appropriate error (that should then help debugging much more easily in this case).
Thanks for noticing and suggesting this improvement. If you think the issue has been solved after upgrading, feel free to close it :-)
Benjamin
from grid2op.
Related Issues (20)
- Codalab scoring throws an error when filtering chronics HOT 16
- Wrong total time step when providing "max_step" in ScoreL2RPN2020 HOT 1
- 'h_forecast' bug when creating env without forecast for l2rpn_idf_2023 HOT 4
- Expand Observation + Action to check for game-ending topology changes HOT 4
- Simulation on current state reapply actual_dispatch when a redispatch action has been applied before HOT 7
- Being able to specify position of elements (powerlines, loads, generators, storages directly in the layout)
- Minor Change in Runner to allow for parallel computing with tensorflow models and Pool HOT 2
- Switch problems for maintenance functions in the environment("l2rpn_wcci_2020") HOT 2
- Tutorial 1: Grid2Op integration with existing frameworks HOT 2
- [Feature] Set init state HOT 1
- In reset, also add possibility to change the parameters, forecast parameters, max iter and skip time steps HOT 2
- Improve the handling of "name_chronics_to_backend"
- Optimal Clustering of Substations for Topology Optimization Using the Louvain Algorithm HOT 7
- Can not reproduce Runner or ScoreL2RPN2022's results when used with the MultiFolderWithCache feature HOT 1
- Using a generator as the slack bus in Grid2Op Environment's PandaPower BackEnd HOT 4
- Convert observation to per unit
- Update Introduction.ipynb HOT 2
- Allow loads / generators to be disconnected without a game over
- grid2op.make(...) not threadsafe? HOT 6
- CI issue on windows with lightsim2grid
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from grid2op.