Skip to content

Commit 0969c35

Browse files
Redispatch v1 (#279)
This commit brings redispatch model into ASSUME. Both cost based and market based redispatch are possible. And clearing can be done using bay as bid or pay as clear mechanisms. This module uses pypsa to model the network, check for congestions, and perform redispatch. --------- Co-authored-by: Florian Maurer <maurer@fh-aachen.de>
1 parent aa6cd9c commit 0969c35

21 files changed

+763
-35086
lines changed

assume/common/market_objects.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ class MarketConfig:
115115
price_tick (float | None): step increments of price (e.g. 0.1)
116116
supports_get_unmatched (bool): whether the market supports get unmatched
117117
eligible_obligations_lambda (eligible_lambda): lambda function which determines if an agent is eligible to trade this product
118+
param_dict (dict): dict which can have additional params for the used clearing_mechanism
118119
addr (str): the address of the market
119120
aid (str): automatic id of the market
120121
"""
@@ -136,7 +137,7 @@ class MarketConfig:
136137
price_tick: float | None = None # steps in which the price can be increased
137138
supports_get_unmatched: bool = False
138139
eligible_obligations_lambda: eligible_lambda = lambda x: True
139-
140+
param_dict: dict = field(default_factory=dict)
140141
addr: str = " "
141142
aid: str = " "
142143

assume/markets/base_market.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -526,8 +526,8 @@ async def clear_market(self, market_products: list[MarketProduct]):
526526
logger.debug(
527527
"clearing price for %s is %.2f, volume: %f",
528528
self.marketconfig.market_id,
529-
meta["price"],
530-
meta["demand_volume"],
529+
meta.get("price", 0.0),
530+
meta.get("demand_volume", 0.0),
531531
)
532532
meta["market_id"] = self.marketconfig.market_id
533533
meta["time"] = meta["product_start"]

assume/markets/clearing_algorithms/__init__.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,11 @@
2020
"pay_as_clear_aon": PayAsClearAonRole,
2121
"nodal_pricing": NodalPyomoMarketRole,
2222
}
23+
24+
# try importing pypsa if it is installed
25+
try:
26+
from .redispatch import RedispatchMarketRole
27+
28+
clearing_mechanisms["redispatch"] = RedispatchMarketRole
29+
except ImportError:
30+
pass

0 commit comments

Comments
 (0)