This repository is the official implementation of Winning the L2RPN Challenge: Power Grid Management via Semi-Markov Afterstate Actor-Critic.
ubuntu /linux 下载anaconda https://repo.anaconda.com/archive/Anaconda3-2021.05-Linux-x86_64.sh
conda env create -f install.yml
conda activate smaacgit clone https://github.com/scalaboy/lightsim2grid
cd lightsim2grid
git submodule init
git submodule update
make clean
make
pip install -U pybind11
pip install -U .Since chronic data is required to train or evaluate, please Download.
Then, replace data/ with it.
cd SMAAC
rm -rf data
tar -zxvf data.tar.gzThe detail of arguments is provided in test.py.
python test.py -n=[experiment_name] -s=[seed] -c=[environment_name (5, sand, wcci)]
# Example
python test.py -n=5_run -s=0 -c=5
get result
[ 98] Valid: score 97.79145444923583 | step 864.0
[Test Ch 17( 0)] 864/864 ( 96) Score: 98.7509
[Test Ch 17( 1)] 864/864 ( 8) Score: 98.5088
[Test Ch 17( 2)] 864/864 (122) Score: 98.3613
[Test Ch 17( 3)] 864/864 (100) Score: 97.5027
[Test Ch 17( 4)] 864/864 ( 8) Score: 95.8336
[ 99] Valid: score 97.79145444923583 | step 864.0
[Test Ch 17( 0)] 864/864 ( 96) Score: 98.7509
[Test Ch 17( 1)] 864/864 ( 8) Score: 98.5088
[Test Ch 17( 2)] 864/864 (122) Score: 98.3613
[Test Ch 17( 3)] 864/864 (100) Score: 97.5027
[Test Ch 17( 4)] 864/864 ( 8) Score: 95.8336
[ 100] Valid: score 97.79145444923583 | step 864.0
or
python test.py -n=wcci_run -s=0 -c=wcciThe detail of arguments is provided in evaluate.py.
python evaluate.py -n=[experiment_dirname] -c=[environment_name]
# Example
python evaluate.py -n=wcci_run_0 -c=wcci
# If you want to evaluate an example trained model on WCCI, execute as below
python evaluate.py -n=example@inproceedings{yoon2021winning,
title={Winning the L2{\{}RPN{\}} Challenge: Power Grid Management via Semi-Markov Afterstate Actor-Critic},
author={Deunsol Yoon and Sunghoon Hong and Byung-Jun Lee and Kee-Eung Kim},
booktitle={International Conference on Learning Representations},
year={2021},
url={https://openreview.net/forum?id=LmUJqB1Cz8}
}Our code is based on rte-france's Grid2Op (https://github.com/rte-france/Grid2Op)
Copyright (c) 2020 KAIST-AILab
This source code is subject to the terms of the Mozilla Public License (MPL) v2 also available here