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
Draft
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion assume/strategies/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,11 @@
from assume.strategies.learning_advanced_orders import (
RLAdvancedOrderStrategy,
)
from assume.strategies.learning_strategies import RLStrategy
from assume.strategies.learning_strategies import RLStrategy, BatteryRLStrategy, BatteryRLStrategy_Curve

bidding_strategies["pp_learning"] = RLStrategy
bidding_strategies["storage_learning"] = BatteryRLStrategy
bidding_strategies["storage_learning_curve"] = BatteryRLStrategy_Curve
bidding_strategies["learning_advanced_orders"] = RLAdvancedOrderStrategy

except ImportError:
Expand Down
549 changes: 548 additions & 1 deletion assume/strategies/learning_strategies.py

Large diffs are not rendered by default.

6 changes: 4 additions & 2 deletions examples/examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@
"small_learning_2_lstm": {"scenario": "example_02b", "study_case": "base_lstm"},
# Further DRL example simulation showcasing learning features
"learning_with_complex_bids": {"scenario": "example_02d", "study_case": "dam"},
"small_learning_storage": {"scenario": "example_02e", "study_case": "base"},

#
# full year examples to show real-world scenarios
"large_2019_eom": {"scenario": "example_03", "study_case": "base_case_2019"},
Expand Down Expand Up @@ -100,8 +102,8 @@
- local_db: without database and grafana
- timescale: with database and grafana (note: you need docker installed)
"""
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!


if data_format == "local_db":
db_uri = f"sqlite:///./examples/local_db/assume_db_{example}.db"
Expand Down
93 changes: 93 additions & 0 deletions examples/inputs/example_02e/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# SPDX-FileCopyrightText: ASSUME Developers
#
# SPDX-License-Identifier: AGPL-3.0-or-later

tiny:
start_date: 2019-01-01 00:00
end_date: 2019-01-05 00:00
time_step: 1h
save_frequency_hours: null
learning_mode: True

learning_config:
continue_learning: False
trained_policies_save_path: null
max_bid_price: 100
algorithm: matd3
actor_architecture: mlp
learning_rate: 0.001
training_episodes: 10
episodes_collecting_initial_experience: 3
train_freq: 24h
gradient_steps: -1
batch_size: 64
gamma: 0.99
device: cpu
noise_sigma: 0.1
noise_scale: 1
noise_dt: 1
validation_episodes_interval: 5

markets_config:
EOM:
operator: EOM_operator
product_type: energy
products:
- duration: 1h
count: 1
first_delivery: 1h
opening_frequency: 1h
opening_duration: 1h
volume_unit: MWh
maximum_bid_volume: 100000
maximum_bid_price: 3000
minimum_bid_price: -500
price_unit: EUR/MWh
market_mechanism: pay_as_clear


base:
start_date: 2019-03-01 00:00
end_date: 2019-03-31 00:00
time_step: 1h
save_frequency_hours: null
learning_mode: True

learning_config:
continue_learning: False
trained_policies_save_path: null
max_bid_price: 100
algorithm: matd3
actor_architecture: mlp
learning_rate: 0.001
training_episodes: 50
episodes_collecting_initial_experience: 5
train_freq: 24h
gradient_steps: -1
batch_size: 256
gamma: 0.99
device: cpu
noise_sigma: 0.1
noise_scale: 1
noise_dt: 1
validation_episodes_interval: 5
early_stopping_steps: 10
early_stopping_threshold: 0.05

markets_config:
EOM:
operator: EOM_operator
product_type: energy
products:
- duration: 1h
count: 1
first_delivery: 1h
opening_frequency: 1h
opening_duration: 1h
volume_unit: MWh
maximum_bid_volume: 100000
maximum_bid_price: 3000
minimum_bid_price: -500
price_unit: EUR/MWh
market_mechanism: pay_as_clear

Loading