-
Notifications
You must be signed in to change notification settings - Fork 42
Rolling horizon dsm #804
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
Open
Manish-Khanra
wants to merge
17
commits into
main
Choose a base branch
from
rolling_horizon_dsm
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Rolling horizon dsm #804
Changes from 13 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
87ba266
rolling horision fucntion and forecast first version
Manish-Khanra ffa070b
Merge branch 'main' of https://github.com/assume-framework/assume int…
Manish-Khanra e6043ab
test and documentation
Manish-Khanra b7ca3eb
Merge branch 'main' of https://github.com/assume-framework/assume int…
Manish-Khanra 6e63cb5
changes as per reviewer's remarks
Manish-Khanra d1f3732
Merge branch 'main' of https://github.com/assume-framework/assume int…
Manish-Khanra 6310d09
Unknown DSM component technology fix
Manish-Khanra 7575332
replaced hasattr with is not None
Manish-Khanra b95a4fc
Merge branch 'main' of https://github.com/assume-framework/assume int…
Manish-Khanra fa4365c
Revision 2.0
Manish-Khanra 52da6f6
loader_csv: refactor steelplant registration
maurerle ec47e0a
update changes from todays discussion
maurerle 809bb16
removed all reduncancies
Manish-Khanra 3146b92
Merge branch 'main' of https://github.com/assume-framework/assume int…
Manish-Khanra 4b54d25
Remove dead adaptive-price logic from DSM loader
Manish-Khanra 6ed0de6
Add network notebook execution and pypsa dependency installation for …
Manish-Khanra ae32acd
Add conditional pytest tests for Python 3.14 to skip network requirem…
Manish-Khanra File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -147,6 +147,9 @@ class DsmEnergyOptimizationStrategy(MinMaxStrategy): | |
| """ | ||
| A naive strategy of a Demand Side Management (DSM) unit. The bid volume is the optimal power requirement of | ||
| the unit at the start time of the product. The bid price is the marginal cost of the unit at the start time of the product. | ||
|
|
||
| For rolling-horizon configured units, this strategy triggers re-optimization at each market clearing round, | ||
| ensuring the unit optimizes for the next window using updated state and remaining demand. | ||
| """ | ||
|
|
||
| def calculate_bids( | ||
|
|
@@ -169,8 +172,19 @@ def calculate_bids( | |
| Orderbook: The bids consisting of the start time, end time, only hours, price and volume. | ||
| """ | ||
|
|
||
| # check if unit has opt_power_requirement attribute | ||
| if unit.optimisation_counter == 0: | ||
| if unit.horizon_mode == "rolling_horizon": | ||
| current_market_time = product_tuples[0][0] | ||
| # Hook to refresh runtime forecasts before re-optimising the next window. | ||
| # Currently the configured update algorithms default to no-ops; the hook is | ||
| # kept so price/forecast learning can be plugged in without touching strategies. | ||
| unit.forecaster.update(unit=unit) | ||
| did_reoptimize = unit._check_and_reoptimize_rolling_window( | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be calling But I think that we need to specify this further together with @reinecfi |
||
| current_market_time | ||
| ) | ||
| if not did_reoptimize and unit.optimisation_counter == 0: | ||
| unit.determine_optimal_operation_with_flex() | ||
| unit.optimisation_counter = 1 | ||
| elif unit.optimisation_counter == 0: | ||
| unit.determine_optimal_operation_with_flex() | ||
| unit.optimisation_counter = 1 | ||
|
|
||
|
|
@@ -201,6 +215,8 @@ class DsmEnergyNaiveRedispatchStrategy(MinMaxStrategy): | |
| """ | ||
| A naive strategy of a Demand Side Management (DSM) unit that bids the available flexibility of the unit on the redispatch market. | ||
| The bid volume is the flexible power requirement of the unit at the start time of the product. The bid price is the marginal cost of the unit at the start time of the product. | ||
|
|
||
| For rolling-horizon configured units, this strategy triggers re-optimization at each market clearing round. | ||
| """ | ||
|
|
||
| def calculate_bids( | ||
|
|
@@ -210,6 +226,14 @@ def calculate_bids( | |
| product_tuples: list[Product], | ||
| **kwargs, | ||
| ) -> Orderbook: | ||
| if unit.horizon_mode == "rolling_horizon": | ||
| current_market_time = product_tuples[0][0] | ||
| # Hook to refresh runtime forecasts before re-optimising the next window. | ||
| # Currently the configured update algorithms default to no-ops; the hook is | ||
| # kept so price/forecast learning can be plugged in without touching strategies. | ||
| unit.forecaster.update(unit=unit) | ||
| unit._check_and_reoptimize_rolling_window(current_market_time) | ||
|
Manish-Khanra marked this conversation as resolved.
|
||
|
|
||
| # calculate the optimal operation of the unit according to the objective function | ||
| unit.determine_optimal_operation_with_flex() | ||
|
|
||
|
|
||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.