dss-simpy-rl

This repository is an Reinforcement Learning Platform for learning agents to control cyber-physical Power Distribution Systems resiliently. The cyber environment in based on SimPy Discrete Event Simulator, while the distribution system is backened by Open-DSS.

https://github.com/nrel/dss-simpy-rl

Science Score: 44.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (10.9%) to scientific vocabulary
Last synced: 6 months ago · JSON representation ·

Repository

This repository is an Reinforcement Learning Platform for learning agents to control cyber-physical Power Distribution Systems resiliently. The cyber environment in based on SimPy Discrete Event Simulator, while the distribution system is backened by Open-DSS.

Basic Info
  • Host: GitHub
  • Owner: NREL
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 12.3 MB
Statistics
  • Stars: 29
  • Watchers: 3
  • Forks: 11
  • Open Issues: 0
  • Releases: 0
Created almost 3 years ago · Last pushed almost 3 years ago
Metadata Files
Readme License Citation

README.md

DSS-SimPy-RL

Open-DSS and SimPy based Cyber-Physical RL environment

Use the environment.yaml file to create the conda environment for installing the python packages required in this repository. Commad: conda env create --file environment.yaml

Description of the files within agents folder - dqn.py : Given the Reward model, training the RL agent using Deep Q Learning. - per_dqn.py : Implementation of the Prioritized Experience Replay based-Deep Q Learning

Description of the files within cases folder - 123Bus_DER : This folder consists of the Open DSS files for the 123-bus feeder with DER integrated. - 123Bus_Simple : The folder consists of the Open DSS 123-bus files for the 123-bus feeder base model. - 123Bus_SimpleMod : Some minor modification from the Simple model.

Description of the files within powergym folder - It contains the OpenDSS based RL environment for volt var control. Adopted from PowerGym

Description of the files within docs folder - Figures : Contains all the figures used in user documentation. - html : Contains all the html file for the user documentation. - All the .rst files are the files generated using the sphinx python package.

Description of the files within envs folder - simpy_env : All the SimPy-based communication RL environments. - simpy_dss : All the fused Cyber-Physical RL environments for network reconfiguration and also volt var control. - openDSSenv.py: This environment is created for episodic interaction of the OpenDSS simulator for training RL agent, similar to an Open AI Gym environment. Implements the N-1 and N-2 contingencies. - openDSSenvSB_DiscreteSpace.py: Have a discrete space model for the OpenDSS environment. - generate_scenario.py: This generates unique scenarios for the distribution feeder contingencies. - resilience_graphtheory.py: Contains the topological resilience functions.

Description of the files within Figures folder - Contains all the figure used in the environment and ARM-IRL paper.

Description of the files gurobi folder - MATLAB implementation of network reconfiguration - Examples of OPF using gurobi solver in python (with QC relaxation).

Description of the files mininet folder - generate_mininet_ieee123_network.py: Linux router based implementation of the communication network of IEEE-123 bus feeder using static routes. - mininet_backend_HC_new_network.py: An open vswitch based router implementation of the communication network of IEEE-123 bus feeder case. - generate_network.py: Creates the adjacency matrix of the communication network

Description of the files pyomo_test folder - folder consist some simple examples for running ACOPF using Pyomo

Description of the files rewards folder - It containing some trained discriminator network.

Description of the files tests folder - This includes test of forward RL agents (from stable-baselines and some developed from scratch: refer to agents folder) for the proposed MDP models incorporated in the RL environment.

Description of the files utils folder - Contains codes for plotting the graphs for the purpose of research papers.

Description of the files validation folder - Contains codes for the RL environment validation work.

  • visuals: This folder is a visualization app for visualizing the simulation and observing the resilience metric in real-time as the episodes and their steps are executed. The OpenDssEnvVisual.py is the application implementation for the Open DSS physical RL environment.

Sample Visualization for the open-DSS RL environment

CyberEnvVisual.py is the application implementation for the Simpy based Cyber RL environment. The IEEE 123 bus case is divided into 7 zones. Within each zones there is a data concentrator shown in red node, the green node is the DSO, while all the blue nodes are the Routers represent the hybrid topology.

Sample Visualization for the Simpy-based RL environment

CyberPhysicalEnvVisual.py is the application implementation for the Simpy based and OpenDSS based CyberPhysical combined RL environment.

User Documentation for the Dss-SimPy-RL alongwith the utilization of this RL environment for Adaptive resilience Metric learning using Inverse Reinforcement Learning (ARM_IRL).

Owner

  • Name: National Renewable Energy Laboratory
  • Login: NREL
  • Kind: organization
  • Location: Golden, CO

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you use this software, please cite it as below."
authors:
  - family-names: Sahu
    given-names: Abhijeet
    orcid: https://orcid.org/0000-0002-7647-3758
title: "Open-DSS and SimPy based Cyber-Physical RL environment"
version: 1.0.0
date-released: 2023-03-23

GitHub Events

Total
  • Watch event: 9
  • Fork event: 9
Last Year
  • Watch event: 9
  • Fork event: 9

Dependencies

environment.yaml pypi
  • absl-py ==0.15.0
  • astor ==0.8.1
  • astunparse ==1.6.3
  • cached-property ==1.5.2
  • cachetools ==4.2.4
  • cffi ==1.15.0
  • charset-normalizer ==2.0.12
  • clang ==5.0
  • cloudpickle ==1.2.2
  • colorama ==0.4.5
  • cvxopt ==1.2.1
  • cycler ==0.11.0
  • dataclasses ==0.8
  • decorator ==4.4.2
  • docopt ==0.6.2
  • dss-python ==0.10.7.post1
  • flatbuffers ==1.12
  • gast ==0.2.2
  • google-auth ==1.35.0
  • google-auth-oauthlib ==0.4.6
  • google-pasta ==0.2.0
  • grpcio ==1.47.0
  • gym ==0.19.0
  • h5py ==3.1.0
  • importlib-metadata ==4.8.3
  • importlib-resources ==5.4.0
  • intel-openmp ==2022.1.0
  • keras ==2.2.4
  • keras-applications ==1.0.8
  • keras-preprocessing ==1.1.2
  • kiwisolver ==1.3.1
  • markdown ==3.3.7
  • matplotlib ==2.2.3
  • mkl ==2022.1.0
  • networkx ==2.3
  • numpy ==1.19.5
  • oauthlib ==3.2.0
  • opendssdirect-py ==0.6.1
  • opt-einsum ==3.3.0
  • pandas ==0.25.0
  • pillow ==8.4.0
  • pipreqs ==0.4.11
  • protobuf ==3.19.4
  • pyasn1 ==0.4.8
  • pyasn1-modules ==0.2.8
  • pyparsing ==3.0.9
  • pyqt5 ==5.12.3
  • pyqt5-sip ==12.9.1
  • pyqtgraph ==0.11.1
  • pyyaml ==6.0
  • requests-oauthlib ==1.3.1
  • rsa ==4.8
  • sb3-contrib ==1.3.0
  • scipy ==1.4.0
  • seaborn ==0.11.0
  • six ==1.15.0
  • stable-baselines3 ==1.3.0
  • tbb ==2021.6.0
  • tensorboard ==1.15.0
  • tensorboard-data-server ==0.6.1
  • tensorboard-plugin-wit ==1.8.1
  • tensorflow ==1.15.0
  • tensorflow-estimator ==1.15.1
  • termcolor ==1.1.0
  • torch ==1.10.2
  • torchvision ==0.4.1
  • tqdm ==4.64.0
  • typing-extensions ==3.7.4.3
  • urllib3 ==1.26.10
  • werkzeug ==2.0.3
  • wrapt ==1.12.1
  • yarg ==0.1.9
requirements.txt pypi
  • Keras ==2.2.4
  • OpenDSSDirect.py ==0.6.1
  • PyQt5 ==5.15.7
  • cvxopt ==1.2.1
  • gym ==0.19.0
  • matplotlib ==2.2.3
  • networkx ==2.3
  • numpy ==1.19.5
  • pandas ==0.25.0
  • pyomo ==6.4.1
  • pyqtgraph ==0.11.1
  • seaborn ==0.11.0
  • simpy ==4.0.1
  • six ==1.15.0
  • stable_baselines3 ==1.3.0
  • tensorflow ==1.15.0
  • torch ==1.10.2
  • tqdm ==4.64.0
  • wandb ==0.12.21