代码拉取完成,页面将自动刷新
from grid2op.Parameters import Parameters
from grid2op.Runner import Runner
from grid2op import make
from grid2op.PlotGrid import PlotMatplot
import grid2op
# Method fast_forward_chronics doesnt work properly
path_dataset='rte_case14_realistic'#None
env=make(path_dataset,param=param,backend=backend,test=True)
param = Parameters()
param.init_from_dict({"NO_OVERFLOW_DISCONNECTION": True})
scenario_name='000'#None
timestep=0#None
#catch the id of your scenario
for id, sp in enumerate(env.chronics_handler.real_data.subpaths):
env.set_id(id)
env.reset()
current_name = os.path.basename(env.chronics_handler.get_id())
assert current_name == os.path.basename(sp)
#jump to your timestep
if timestep >0:
env.fast_forward_chronics(nb_timestep= timestep)
obs = env.get_obs()
#do-nothiong action to simulate and get an observation
action_def={}#do-nothing
action=env.action_space(action_def)
new_obs,_reward,_done,_info=obs.step(action)
#plot observation
plot_helper = PlotMatplot(env.observation_space)
fig_obs = plot_helper.plot_obs(new_obs)
fig_obs.show()
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。