Home

Awesome

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:

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:

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:

<!-- * Loading agent results- fot this part there are 2 options: * First option: you can load agent's resulsts separately [using EpisodeData class] * Second Option: you can load all the agents' results at onece [using AgentsAnalytics class] * Action Frequency * Impact of actions on objects * Action Execution Time * Action Sequence length * Agents bahaviour analysis -->

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

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