Metadata-Version: 2.1
Name: commonpower
Version: 0.0.4
Summary: A package for the exploration of safe single/multi-agent reinforcement learning in smart grids.
Author-email: Michael Eichelbeck <michael.eichelbeck@tum.de>, Hannah Markgraf <hannah.markgraf@tum.de>
License: MIT
Project-URL: Homepage, https://github.com/TUMcps/commonpower
Project-URL: Documentation, https://commonpower.readthedocs.io
Keywords: Power System,Smart Grid,Control,Safety,Simulation,Reinforcement learning,Mutli-Agent Systems
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: wandb
Requires-Dist: tensorboard
Requires-Dist: matplotlib
Requires-Dist: gurobipy
Requires-Dist: pyomo
Requires-Dist: randomtimestamp
Requires-Dist: prettytable
Requires-Dist: stable-baselines3
Requires-Dist: pandapower
Requires-Dist: tqdm
Requires-Dist: ipython>=8.12.3
Provides-Extra: ci
Requires-Dist: pytest; extra == "ci"
Requires-Dist: pandapower; extra == "ci"
Provides-Extra: full
Requires-Dist: jupyter; extra == "full"
Requires-Dist: pandapower; extra == "full"
Provides-Extra: docs
Requires-Dist: myst_parser; extra == "docs"
Requires-Dist: sphinx_autodoc_typehints; extra == "docs"
Requires-Dist: nbsphinx; extra == "docs"
Requires-Dist: sphinx_rtd_theme; extra == "docs"
Requires-Dist: sphinx_autorun; extra == "docs"

CommonPower
===========

Introduction
-------------

CommonPower provides a flexible framework to model power systems, interface to single-agent and multi-agent RL controllers,
and maintain safety based on a symbolic representation of the system equations.
Alternatively, the system model can directly be used to solve a given use case via the built-in model predictive controller.
Following a modular design philosophy, CommonPower is an easily extendable tool for the development and benchmarking
of RL controllers in the context of smart grids. The initial focus is on energy management and economic dispatch.
Additionally, CommonPower readily allows the influence of forecast quality to be studied.
The primary features are

- an object-oriented approach to modelling power system entities,

- a Pyomo-based symbolic math representation of entities to obtain all relevant system equations in the background,

- interfaces for single/multi-agent reinforcement learning and optimal control,

- a flexible interface to make use of diverse data sources and forecasting models.

Documentation
--------------

Our documentation is available on [ReadtheDocs](https://commonpower.readthedocs.io).

Reference
----------

CommonPower was developed and is maintained by the Cyber-Physical Systems Group at the Chair for Robotics and Embedded Systems at Technical University of Munich.

If you use CommonPower, please cite it as: 
```
@article{eichelbeck2023commonpower,
  title={CommonPower: Supercharging machine learning for smart grids},
  author={Eichelbeck, Michael and Markgraf, Hannah and Althoff, Matthias},
  year={2023}
}
```

Installing CommonPower
----------------------

You will need [Python](https://www.python.org/downloads/) >= 3.8 installed on your system.

We recommend using a [virtual environment](https://docs.python.org/3/library/venv.html) to work with CommonPower. 
To create a virtual environment run
```bash
python -m venv </path/to/new/virtual/environment>
```
You can then activate the virtual environment.

Linux: 
```bash
source <path/to/venv>/bin/activate
```

Windows:
```bash
<path/to/venv>\Scripts\activate.bat
```

You can then proceed to install CommonPower.
For local development, install the library in editable mode:
```bash
cd <your/working/directory>
git clone "https://github.com/TUMcps/commonpower.git"
pip install -e <absolute/path/to/the/commonpower/directory>
```

Otherwise, install CommonPower via PyPI:
```bash
pip install commonpower
```

Multi-agent reinforcement learning
----------------------------------

At the moment, CommonPower supports multi-agent reinforcement learning using the IPPO/MAPPO implementation detailed in this [paper](https://arxiv.org/abs/2103.01955). 
Since we had to make a few adjustments, we forked the original repository. Please clone our [fork](https://github.com/TUMcps/on-policy), cd into the repository and install the package to your virtual environment using
`pip install -e .`.

Gurobi
------

We use Gurobi as a default solver for our optimization problems. As a student, you can obtain an [academic license](https://www.gurobi.com/academia/academic-program-and-licenses/). 
There are two options: If you want to run CommonPower on you laptop, you can use the named-user license. To run it on a server, you need the WLS license.
After obtaining a license, follow the Gurobi [quickstart guide](https://www.gurobi.com/documentation/quickstart.html) (choose the appropriate one for your system) to install Gurobi and retrieve your license. 
If you use Gurobi on a server (with the WLS license) and receive the error that it requires two many cores, you can just [submit a ticket](https://support.gurobi.com/hc/en-us/requests/new?ticket_form_id=360000629792) with the error message and your WLS license will be upgraded.

Get started
------------

Have a look at the Introduction tutorial to learn more about how CommonPower is structured.
