Code Monkey home page Code Monkey logo

energy_arbitrage_via_rl's Introduction

Energy Arbitrage Reinforcement Learning

This repository contains a reinforcement learning (RL) model to optimize energy arbitrage in a storage system. The model is built using the TensorFlow Agents library and is designed to help an agent make decisions on when to buy, sell, or hold energy based on the energy prices.

Environment

The environment simulates an energy market with a storage system. The agent interacts with the environment by choosing actions from a discrete action space:

  1. Buy energy
  2. Sell energy
  3. Hold (do nothing)

The agent receives a reward based on the difference between the energy prices when buying and selling, as well as the storage level and efficiency.

Model

The RL agent used in this model is a DQN (Deep Q-Network) agent, which employs a neural network to approximate the Q-function. The Q-function represents the expected cumulative reward the agent can obtain by taking a specific action in a given state and following the optimal policy thereafter. The DQN agent learns from experience by interacting with the environment and optimizing the neural network to minimize the difference between the predicted and actual Q-values.

Getting Started

Prerequisites

  • Python 3.7+
  • TensorFlow 2.5+
  • TensorFlow Agents

Running the Model

  1. Clone the repository:

git clone https://github.com/your_username/energy-arbitrage-rl.git

  1. Install the required packages:

pip install tensorflow tensorflow-agents

  1. Update the energy_prices variable in main.py with your own energy price data.

  2. Run the main.py file to train the RL agent:

python main.py

  1. Observe the training progress and the performance of the trained agent during testing.

Customization

You can customize the storage capacity of the environment by modifying the storage_capacity variable in main.py. The default storage capacity is set to 10.

To customize the DQN model architecture or training parameters, you can modify the respective sections in main.py.

energy_arbitrage_via_rl's People

Contributors

alexfias avatar

Stargazers

 avatar Xianbang avatar

Watchers

Kostas Georgiou avatar  avatar

Forkers

asxadf

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.