00_Introduction
substation:变电站
powerline:电线
load:?
busbar:汇流排
A “bus” is a fancy word from the power system community meaning that: if two objects are on the same bus, then there exist a direct electrical path in the substation connecting them.
- learn to control the switches
- for each object, decide on which busbar (a or b) it should be connected
substations:
powerlines:
connection or disconnection, that is a question.
constraint: Parameters class
- NB_TIMESTAMP_COOLDOWN_LINE: how many timestamps you have to wait before redoing an action.
- NB_TIMESTAMP_COOLDOWN_SUB: how many timestamps you have to wait before making an action on the same substation again.
01_The most basic use of Grid2Op
creating an environment
To define/create it, we can call:
env = grid2op.make("rte_case14_redisp", test=True)
ln this example we will use the rte case14 redisp environment, in test mode.
The make function is highly customizable.
grid2op.runner API
与从头构建en环境(见上一节)相反,这需要更少的工作:我们不需要初始化实例化)任何东西。所有的事情都在runner内部进行,由main函数调用。
from grid2op.Runner import Runner
runner = Runner(**env.get_params_for_runner(), agentClass=DoNothingAgent)
res = runner.run(nb_episode=1, max_iter=max_iter)
A call of the single 2 lines above will:
- Create a valid environment.
- Create a valid agent.
- Assess how well an agent performs on one episode.
02_How to build an Agent and assess its performance
expert agents that take actions based on fixed rules
the observation class
-
obtaining an observation
env = grid2op.make(test=True) obs = env.reset()
-
information contained
- calendar data:year/month/day/hour_of_day/day_of_week
- powergrid generic information: static in the same environment
- about the generators
- about the loads
- about the powerlines
- connectivity matrix
- etc…
taking actions based on the observation
03_Action class
2 concepts that will affect the objects differently:
- change:
- powerline: connected<->disconnected
- object: connected to bus 1<->bus 2
- set: (regardless of its previous status)
- connect/disconnect a powerline
- assign the object to a specific bus
ambiguous action: 看起来不合理的动作。
curtailment: limiting the production of renewable generator
storage units: 正数吸收,负数释放。
Actions can be combined.
input:
action_space.get_obj_connect_to(substation_id=1)
output:
{'loads_id': array([0], dtype=int64),
'generators_id': array([0], dtype=int64),
'lines_or_id': array([2, 3, 4], dtype=int64),
'lines_ex_id': array([0], dtype=int64),
'storages_id': array([], dtype=int64),
'nb_elements': 6}