Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introducing Learning for Storages #464

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

kim-mskw
Copy link
Contributor

Pull Request

Related Issue

Closes #457

Description

This PR introduces two learning strategies for storages.
One is based on the work of @ModdyLP, and the other is based on the original flexRL implementation by @nick-harder.
The former introduces bidding of storage with a two-stage bidding curve. Yet the convergence does not look promising. Needs to be debugged potentially?
The latter is implemented in accordance with the published strategy by @nick-harder, where the storage decides on the direction and the price height. Here the convergence looks way better!

Changes Proposed

  • added two new bidding strategies
  • prepared example 02e with a learning storage unit

Testing

So far, only general runablility was tested. No convergeence analysis was made!

Checklist

Please check all applicable items:

  • Code changes are sufficiently documented (docstrings, inline comments, doc folder updates)
  • New unit tests added for new features or bug fixes
  • Existing tests pass with the changes
  • Reinforcement learning examples are operational (for DRL-related changes)
  • Code tested with both local and Docker databases
  • Code follows project style guidelines and best practices
  • Changes are backwards compatible, or deprecation notices added
  • New dependencies added to pyproject.toml
  • A note for the release notes doc/release_notes.rst of the upcoming release is included
  • Consent to release this PR's code under the GNU Affero General Public License v3.0

Additional Notes (if applicable)

[Any additional information, concerns, or areas you want reviewers to focus on]

Screenshots (if applicable)

@nick-harder
image

@ModdyLP
image

@kim-mskw kim-mskw linked an issue Oct 29, 2024 that may be closed by this pull request
@kim-mskw kim-mskw self-assigned this Oct 29, 2024
Copy link

codecov bot commented Oct 30, 2024

Codecov Report

Attention: Patch coverage is 6.35838% with 162 lines in your changes missing coverage. Please review.

Project coverage is 74.85%. Comparing base (0a9aeb5) to head (a44acce).

Files with missing lines Patch % Lines
assume/strategies/learning_strategies.py 5.81% 162 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #464      +/-   ##
==========================================
- Coverage   76.86%   74.85%   -2.02%     
==========================================
  Files          50       50              
  Lines        6229     6411     +182     
==========================================
+ Hits         4788     4799      +11     
- Misses       1441     1612     +171     
Flag Coverage Δ
pytest 74.85% <6.35%> (-2.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@nick-harder
Copy link
Member

@kim-mskw thanks a lot for the work! Maybe we should start the process with only one strategy from the paper and introduce the second one in a seperate PR? It might be a bit too much to have both in a single PR, since it will be hard to test both properly.

Copy link
Member

@maurerle maurerle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be very good to have a test for the initialization of the Bidding Strategies.

I think it is fine to include both, as long as there is also code which somehow tests the functionality of it.

data_format = "local_db" # "local_db" or "timescale"
example = "small"
data_format = "timescale" # "local_db" or "timescale"
example = "small_learning_storage"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please do not adjust the default values of the examples file

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nick wanted to continue working on both startegies, so I pushed the example I used, but yes indeed it should be changed back!

assume/strategies/learning_strategies.py Outdated Show resolved Hide resolved
nick-harder and others added 2 commits October 31, 2024 10:56
-switch max_volume and min_volume in storages to max_soc and min_soc
-move load_actor_params to base LearningStrategy
-refine drl storage reward function
-add energy cost calculation to DRL storage strategy
-adjust input data in Example_02e to generate better price profile for storage tests
-adjust storage tests to new soc notion
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add DRL storage units strategy
3 participants