Comments (3)
Hello @Medha710 i am not witnessing any unusual behaviour in the grid2op 0.5.2 version on my machine.
The outcome of your script, for the load_v part look like this to me:
We notice everything is fine, until there is a game over (at time step around 90-100).
This change of behaviour (sending a game over when a load is disconnected) has been added in version 0.5.0 I believe.
Can you confirm you get the same results as me on this exact script please (this is a copy paste of your program that sets the scenario tested to the bugy scenario) ?
import numpy as np
import pandas as pd
import grid2op
import matplotlib.pyplot as plt
def obs_to_df(obs, reward):
""" Extract relevant information from observation and put it into dataframe. """
# create dataframe from observations
num_load=obs.n_load
num_line=obs.n_line
data = [[pd.Timestamp(obs.year, obs.month, obs.day, obs.hour_of_day, obs.minute_of_hour),reward]]
df = pd.DataFrame(data, columns = ['Date','reward'])
load_v=pd.DataFrame([obs.load_v[2]], columns=["Load 3(V)"])
df=pd.concat([df,load_v],axis=1)
# Adding line related data
for i in range(0, num_line):
str_line_or=("Line Origin %d" % (i+1))
or_v=pd.DataFrame([obs.v_or[i]], columns=[(str_line_or+"(V)")])
str_line_ex=("Line Extremity %d" % (i+1))
ex_v=pd.DataFrame([obs.v_ex[i]], columns=[(str_line_ex+"(V)")])
df=pd.concat([df,or_v,ex_v],axis=1)
return df
# RUN THE AGENT:
env = grid2op.make("case5_example") # create environment: power grid, injections, reward function, observation space, action space
env.chronics_handler.tell_id(0) # force the environement to use scenario 1 (set it to scenario 0, but calling env.reset will make it go to scenario 01)
total_reward = 0.0 # initialize reward accumulator
total_steps = int(0) # initialize the counter of steps
obs = env.reset() # obtain first observation
print("Chronics used: {}".format(env.chronics_handler.get_id()))
df_obs = obs_to_df(obs, 0.0) # put relevant observations into dataframe
do_nothing_action = env.helper_action_player({}) # specify the "do-nothing action"
load_v=[]
while True:
obs, reward, done, info = env.step(do_nothing_action) # run the power grid with the do-nothing action
df_obs = df_obs.append(obs_to_df(obs, reward), ignore_index=True) # append relevant observations to dataframe
total_reward += reward
total_steps += 1
if np.any(~np.isfinite(obs.load_v)):
print("I found a nan in load voltages")
if done:
break
print("Episode done in %d steps, total reward %.2f" % (total_steps, total_reward))
#Issue here: Load 3 becomes NaN after some timestamps
plt.plot(df_obs.index, df_obs['Load 3(V)'],label="Load 3(V)")
plt.show()
Also, note that version of pandapower 2.2.0 make the environment really really slow (10 fold increase in the computation of a time step). The pandapower team was made aware of this issue and they fixed it in version 2.2.1. I would recommend using either pandapower 2.1.0 or pandapower 2.2.1 for grid2op related computation, but not 2.2.0.
from grid2op.
Hello @BDonnot
Yes, you are correct. I had not checked if the game over signal was true or false. As in the previous version, the game would not be over even though the load was disconnected.
Yes, I confirm that I get the same response.
Thank you for the clarification!
Also, thank you for your comment about the pandapower version; will take it into account.
from grid2op.
Hello Medha,
I am closing this issue as the problem seems to have been solved. Don't hesitate to reach out if this issue arises again.
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.