Comments (10)
Hello, thanks for reaching out. Indeed this behavior is pretty weird.
Can you share me the code to reproduce this behavior?
I am especially interested in:
- How were the powerline disconnected? Was it from the environment because of an overflow, or the result of the action of an Agent?
- How do you try to reconnect the power line? Have you tried the "reconnect_powerline" method of the action space?
- Have you made sure you reconnected powerline by specifying both bused to which you reconnect if at both ends (extremity and origin)
Thanks
from grid2op.
Hi,
Thanks for the reply.
The powerline should be disconnected due to an overflow.
My codes are as follows:
next_state, reward, done, infos = self.env.step(action_transf_dict)
next_state_dict = next_state.to_dict()
# print("next state dict", next_state_dict)
ts_list = next_state_dict["timestep_overflow"]
lines_status_list_bool = next_state_dict["line_status"]
lines_status_list = []
for line_status in lines_status_list_bool:
if line_status:
lines_status_list.append(0)
else:
lines_status_list.append(1)
topo_list = next_state_dict["topo_vect"]
load_p_list = next_state_dict["loads"]["p"]
load_q_list = next_state_dict["loads"]["q"]
load_v_list = next_state_dict["loads"]["v"]
prods_p_list = next_state_dict["prods"]["p"]
prods_q_list = next_state_dict["prods"]["q"]
prods_v_list = next_state_dict["prods"]["v"]
lines_or_p_list = next_state_dict["lines_or"]["p"]
lines_or_q_list = next_state_dict["lines_or"]["q"]
lines_or_v_list = next_state_dict["lines_or"]["v"]
lines_or_a_list = next_state_dict["lines_or"]["a"]
lines_ex_p_list = next_state_dict["lines_ex"]["p"]
lines_ex_q_list = next_state_dict["lines_ex"]["q"]
lines_ex_v_list = next_state_dict["lines_ex"]["v"]
lines_ex_a_list = next_state_dict["lines_ex"]["a"]
lines_rho_list = next_state_dict["rho"]
maintenance_time_list = next_state_dict["maintenance"]["time_next_maintenance"]
maintenance_duration_list = next_state_dict["maintenance"]["duration_next_maintenance"]
cd_line_list = next_state_dict["cooldown"]["line"]
cd_substation_list = next_state_dict["cooldown"]["substation"]
time_before_line_reconnect_list = next_state_dict["time_before_line_reconnectable"]
print(lines_status_list_bool, time_before_line_reconnect_list)
The way I am trying to reconnect the line is using below commend after 10 steps cooling down
action_transf_dict = self.agent_action_space.reconnect_powerline(line_id=i,bus_or=line_map[str(i)][0],bus_ex=line_map[str(i)][-1])
where line_map is defined as
line_map = {'0': [0,1], '1': [0,4], '15': [8,9], '16': [8,13],
'17': [9,10], '18': [11,12], '19': [12,13],
'2': [1,2], '3': [1,3], '4': [1,4], '5': [2,3],
'6': [3,4], '10': [5,10], '11': [5,11],
'12': [5,12], '7': [3,6], '8': [3,8], '9': [4,5],
'13': [6,7], '14': [6,8]}
Thanks,
from grid2op.
I think there is a misconception of what buses means here.
In each substations you have 2 busbars. This function requires you to enter a number 1 or 2 saying at which busbar you want to reconnect the power line.
The code, notebooks and documentation are probably not explicit enough about this. I will try to improve it.
I will also add a method of action that test if it's ambiguous or not in the next version. The way I understand it is that your action is not valid because ambiguous and that's why it has no effect on the grid.
from grid2op.
Thanks, you are right. Now I have figured it out and the line can be connected.
One more question is that if I want to change the line status, do I need to specify the busbar id?
It seems this line does not work:
the_same_act = action_space({"change_line_status": [0,1,2]})
from grid2op.
There are 4 ways to reconnect a disconnected powerline:
- connect origin to busbar 1 and extremity to busbar 1
- connect origin to busbar 1 and extremity to busbar 2
- connect origin to busbar 2 and extremity to busbar 1
- connect origin to busbar 2 and extremity to busbar 2
As for now, you have then to specify the bus bar of both ends of the powerline even if you use "switch". I'm not sure how to do otherwise. Maybe connect it to the previous bused as was suggested on issues #27 or #31
from grid2op.
Got it. Thanks a lot!
from grid2op.
Hi,
I have another quick question. If I want to use the Simulate function in Observation.py, what command should I use in Runner.py file?
Thanks,
from grid2op.
I am not quite sure I get the question correctly.
The runner is basically an helper that standardize the evaluation of an agent in multiple scenarios, possibly in parallel.
It basically executes the "gym" loop
while not done:
act = agent.act(obs,reward, done)
obs, reward, done, info = env.step(act)
For a given agent, a given number of times.
If you want your agent to simulate the effect of an action, you are free to implement it in the definition of the act
method.
For example
class MyAgent(Agent):
def __init__(self, action_space):
Agent. __init__(self, action_space)
def act(obs, reward, done):
# simulate do nothing action... Why not?
sim_obs, sim_reward, sim_done, _ = obs.simulate(self.action_space())
# return the do nothing action
return self.action_space()
Of course the above agent is just really stupid. It does nothing. But you are free to do smarter thing with this simulate function.
from grid2op.
Thanks for your reply, I think I understand your meaning. BTW, there might be a bug in the current version. In the previous Obseration.py, there is one line "self.backend = tmp_backend" to reset the backend after simulation. But I did not see this line in the current version. Is it alright?
from grid2op.
Hello, it's because i changed the way the code is working. Now, instead of resetting the "simulated" environment to its old value (the one it should be) after performing the simulate, i do i before. This leads to better performances in most cases and avoid copying backend.
from grid2op.
Related Issues (20)
- Prevent the environment from disconnecting a chosen set of lines even in case of overflow HOT 3
- Wrong importation when importing a file named "utils.py" after grid2op HOT 2
- In 1.9.9
- Write the grid2op Markov Decision Process in the documentation
- Work on the reward module
- Bug when no gen redispatching but some storage units on the grid
- Do not start with ref topo == everything to busbar 1 HOT 1
- 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
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.