Skip to content

IRT-SystemX/Grid2Bench

Repository files navigation

Grid2Bench

The benchmarking framework allows to evaluate the performances of power grid based agents, from various point of views. The scheme of the framework is shown in Figure below. Different power grid episodes could be imported for the analysis purpose alongside the evaluation results of various agents. The KPIs (discussed here) are computed which form a evaluation matrix or table. Finally, in order to facilitate the analysis and decision-making task, a series of visualization tools can be used to compare the performances.

Scheme

Installation

Requirements:

  • Python >= 3.7

Setup a Virtualenv (optional)

Create a virtual environment

mkdir my-project-folder
cd my-project-folder
pip3 install -U virtualenv
python3 -m virtualenv venv_grid2bench

Enter virtual environment

source venv_grid2bench/bin/activate

Install using poetry

git clone https://github.com/seifou23i/Grid2Bench.git
cd RLBenchPlot
pip install poetry
poetry install

Install from PyPI

In future

pip3 install grid2bench

Main features of Grid2Bench

This package allows to evaluate the performance of power grid agents from various point of views. Hereafter, we introduce the main feeatures included in this package:

  • Cumulative rewards:
  • Agent's alive time:
  • Action impacts
    • Lines:
      • frequency per substation:
      • frequency per overloaded lines:
      • frequency per disconnected lines:
    • Reference topology:
    • Substations:
  • Action Execution Time
  • Action Sequence length
  • Agents bahaviour analysis

Usage

An example of how to use the library is provided below:

from grid2bench.AgentsAnalytics import AgentsAnalytics

# parent directory for agents log files
input_data_path = os.path.abspath("../data/input")

# Loading agents and required episodes
agents = AgentsAnalytics(
        data_path=input_data_path,
        agents_names= ["PPO_Agent", "MazeRL_Agent"],
    )

# Visualize the cumulative reward for all agents
agents.plot_cumulative_reward(agents_results)

A more complete example of all the functionalities could be seen in documentation: Example

KPI

A dedicated KPI page is provided at: KPI page

Getting Started

Some Jupyter notebook are provided as tutorials for the Grid2Bench package. They are located in the getting_started directories.

Getting_Started notebook contains simple examples to show how we use the functions defined in the framework:

Documentation

The documentation is accessible from here.

To generate locally the documentation:

pip install sphinx
pip install sphinx-rtd-theme
cd docs
make clean
make html

To contribute

  • Supplementary features could be requested using github issues.
  • Other contributions are welcomed and can be integrated using pull requests.

License information

Copyright 2022-2023 IRT SystemX & RTE

IRT SystemX: https://www.irt-systemx.fr/
RTE: https://www.rte-france.com/

This Source Code is subject to the terms of the Mozilla Public License (MPL) v2 also available here

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 3

  •  
  •  
  •