Skip to content

Commit

Permalink
Redispatch v1 (#279)
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
nick-harder and maurerle authored Feb 14, 2024
1 parent aa6cd9c commit 0969c35
Show file tree
Hide file tree
Showing 21 changed files with 763 additions and 35,086 deletions.
3 changes: 2 additions & 1 deletion assume/common/market_objects.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ class MarketConfig:
price_tick (float | None): step increments of price (e.g. 0.1)
supports_get_unmatched (bool): whether the market supports get unmatched
eligible_obligations_lambda (eligible_lambda): lambda function which determines if an agent is eligible to trade this product
param_dict (dict): dict which can have additional params for the used clearing_mechanism
addr (str): the address of the market
aid (str): automatic id of the market
"""
Expand All @@ -136,7 +137,7 @@ class MarketConfig:
price_tick: float | None = None # steps in which the price can be increased
supports_get_unmatched: bool = False
eligible_obligations_lambda: eligible_lambda = lambda x: True

param_dict: dict = field(default_factory=dict)
addr: str = " "
aid: str = " "

Expand Down
4 changes: 2 additions & 2 deletions assume/markets/base_market.py
Original file line number Diff line number Diff line change
Expand Up @@ -526,8 +526,8 @@ async def clear_market(self, market_products: list[MarketProduct]):
logger.debug(
"clearing price for %s is %.2f, volume: %f",
self.marketconfig.market_id,
meta["price"],
meta["demand_volume"],
meta.get("price", 0.0),
meta.get("demand_volume", 0.0),
)
meta["market_id"] = self.marketconfig.market_id
meta["time"] = meta["product_start"]
Expand Down
8 changes: 8 additions & 0 deletions assume/markets/clearing_algorithms/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,3 +20,11 @@
"pay_as_clear_aon": PayAsClearAonRole,
"nodal_pricing": NodalPyomoMarketRole,
}

# try importing pypsa if it is installed
try:
from .redispatch import RedispatchMarketRole

clearing_mechanisms["redispatch"] = RedispatchMarketRole
except ImportError:
pass
Loading

0 comments on commit 0969c35

Please sign in to comment.