Total-RD/pymgrid

microgrid generated with m_env.load(...) yields not usable env for RLLIB

Closed this issue · 4 comments

This bug is not blocking for me because we can use" generate_microgrid" instead and everything works well. I do not see the difference between both way to generate microgrid.

from pymgrid import MicrogridGenerator as mg
from pymgrid.Environments.pymgrid_cspla import MicroGridEnv
from ray.rllib.agents import dqn
m_env = mg.MicrogridGenerator(nb_microgrid=25)
pymgrid25 = m_env.load('pymgrid25')
microgrids = pymgrid25.microgrids
mgi=microgrids[1]
mgi.set_horizon(24*30)
default_config={}
default_config["env_config"] = {"microgrid": mgi}
trainer=dqn.DQNTrainer(env=MicroGridEnv,config=default_config) # AttributeError: 'NoneType' object has no attribute 'copy'

I don't have an error when I run this code

My version of Pymgrid is up to date. "mgi.parameters" lead to a DataFrame error, DQN cannot handle it (for example copy it).

We can use m.generate_microgrid() instead and does not yield error. Does "generate_microgrid" and "load('pymgrid25')" building ways are equivalent ?

I am not sure about the error, I cannot reproduce it. But if you don't change the random seed the 25 first microgrids generated by pymgrid should be the same as in pymgrid25.

Closing this issue for lack of activity