Grid2Operate

Try it yourself in your navigator with Binder

What is Grid2Operate ?

It is a testbed platform used in competitions to model real-time operations, run & benchmark control algorithms github.com/rte-france/Grid2Op

The open-source simulation environment is based on the Grid2Operate platform, runs with pandapower power grid simulator backend, and implements the OpenAI Gym API. Grid2Operate models realistic concepts found in real-world operations used to test advanced control algorithms.

A Snapshot of Grid2Operate runner

Even though the addressed problem of controlling power systems is novel for the AI community, a lot of care have been taken to ensure that users can interact with it in a familiar way. The Grid2Operate framework (detailed in Figures below) allows easy manipulation of the power grid using the reinforcement learning framework “OpenAI Gym”. The Grid2Operate framework comes with multiple environments already available for testing and training at the time of writing. These environments vary in size (from a 5 substations system as a tutorial, to systems with 118 substations on which they will be tested) and difficulty. Another capability of grid2op is to render the power grid represent an observation for the “case5 example” environment which helps demonstrate how to use the platform and quickly analyze the environment. In addition to all this material, some baselines will also be made available to users. The baseline code will be open-source, easily importable and usable by participants. Some explanations on the nature of these baselines will also be made available

The architecture illustrated

At time t, the agent receive a reward [scalar] and an observation [object convertible to vector] from the environment (1). The Agent then produces an action (2). This action is sent int turn to the environment (3). The environment is further updated with new chronic values (4). The pandapower backend start its computation (5)

The powerflow solver (pandapower) is run (6). It allows the environment to retrieve grid state information through an API (7). Is also checked whether an action is valid or not, hence considered or ignored. New Observations and reward signal from the environment are sent to the agent at time t+1 (8). In case of a game over, it terminates.

How to get started

First you would need to install grid2op. As most python package, grid2op can be installed using pip. For example, a command like

> pip install grid2op

is likely to install it. Grid2op is a pure python code so you likely won't have too much trouble installing it.


Powergrid operations is a real life issue that is rather difficult to understand. You might not know a lot about it. This is why we tried to help you in understanding the problem we are adressing with grid2op with a few jupyter notebook. Thy are available at this address: https://github.com/rte-france/Grid2Op/tree/master/getting_started actually you don't even need to install grid2op to run them.

Thanks to mybinder, you can have a look at them interactively at this address: https://mybinder.org/v2/gh/rte-france/Grid2Op/master.

Grid2op fully support the open AI Gym interface. This means there is an Environment that you can do "env.step" or "env.render". There is also the concept of Agent with their method "agent.act". For example:

We also provide support for grid2op or for the participating in the competitions we organized around it at https://discord.gg/cYsYrPT