Need help with energy-py?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

150 Stars 29 Forks MIT License 794 Commits 12 Opened issues


Reinforcement learning for energy systems

Services available


Need anything else?

Contributors list

No Data


Build Status

energypy is a framework for running reinforcement learning experiments on energy environments.

energypy is built and maintained by Adam Green - [email protected].


$ git clone

$ pip install --ignore-installed -r requirements.txt

$ python install

Running experiments

energy-py has a high level API to run a specific run of an experiment from a

config file:
$ energypy-experiment energypy/examples/example_config.yaml battery

An example config file (

    name: example

battery: &defaults total_steps: 10000

    env_id: battery
    dataset: example

    agent_id: random

Results (log files for each episode & experiment summaries) are placed into a folder in the users

. The progress of an experiment can be watched with TensorBoard by running a server looking at this results folder:
$ tensorboard --logdir='~/energy-py-results'

Low level API

energypy provides the familiar gym style low-level API for agent and environment initialization and interactions:

import energypy

env = energypy.make_env(env_id='battery')

agent = energypy.make_agent( agent_id='dqn', env=env, total_steps=10000 )

observation = env.reset()

while not done: action = agent.act(observation) next_observation, reward, done, info = env.step(action) training_info = agent.learn() observation = next_observation


energy-py environments follow the design of OpenAI

. energy-py also wraps some classic
environments such as CartPole, Pendulum and MountainCar.

energy-py currently implements:

  • naive agents
  • DQN agent
  • Battery storage environment
  • Demand side flexibility environment
  • Wrappers around the OpenAI gym CartPole, Pendulum and MountainCar environments

Further reading

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.