Market clearing algorithms#
Submodules#
assume.markets.clearing_algorithms.all_or_nothing module#
- class assume.markets.clearing_algorithms.all_or_nothing.PayAsBidAonRole(marketconfig: MarketConfig)#
Bases:
MarketRole
- clear(orderbook: list[assume.common.market_objects.Order], market_products: list[assume.common.market_objects.MarketProduct])#
This implements pay-as-bid where each bids volume needs an exactly matching order with the same volume. Partial clearing is not allowed here.
- Parameters:
market_agent (MarketRole) – The market agent
market_products (list[MarketProduct]) – The products to be traded
- class assume.markets.clearing_algorithms.all_or_nothing.PayAsClearAonRole(marketconfig: MarketConfig)#
Bases:
MarketRole
- clear(orderbook: list[assume.common.market_objects.Order], market_products: list[assume.common.market_objects.MarketProduct])#
This implements pay-as-clear where each bids volume needs an exactly matching order with the same volume. Partial clearing is not allowed here. This has the side effect, that the cleared price can be much higher if bids with different volume are accepted
- Parameters:
market_agent (MarketRole) – The market agent
market_products (list[MarketProduct]) – The products to be traded
- assume.markets.clearing_algorithms.all_or_nothing.cumsum(orderbook: list[assume.common.market_objects.Order])#
This function adds a cumsum field to the orderbook.
assume.markets.clearing_algorithms.complex_clearing module#
- class assume.markets.clearing_algorithms.complex_clearing.ComplexClearingRole(marketconfig: MarketConfig)#
Bases:
MarketRole
- clear(orderbook: list[assume.common.market_objects.Order], market_products)#
This implements pay-as-clear with more complex bid structures, including acceptance ratios, bid types, and profiled volumes.
- Parameters:
market_products (list[MarketProduct]) – The products to be traded
:return extract_results(model=model, eps=eps, orders=orders, market_products=market_products, market_clearing_prices=market_clearing_prices) :rtype: tuple[Orderbook, Orderbook, list[dict]]
- validate_orderbook(orderbook: list[assume.common.market_objects.Order], agent_tuple) None #
method to validate a given orderbook This is needed to check if all required fields for this mechanism are present
- assume.markets.clearing_algorithms.complex_clearing.extract_results(model, orders, rejected_orders, market_products, market_clearing_prices)#
- assume.markets.clearing_algorithms.complex_clearing.market_clearing_opt(orders, market_products, mode)#
assume.markets.clearing_algorithms.nodal_pricing module#
- class assume.markets.clearing_algorithms.nodal_pricing.NodalPyomoMarketRole(marketconfig: MarketConfig, nodes=[0, 1, 2], network={'Line_0': (0, 1, 100), 'Line_1': (1, 2, 100), 'Line_2': (2, 0, 100)})#
Bases:
MarketRole
- clear(orderbook: list[assume.common.market_objects.Order], market_products: list[assume.common.market_objects.MarketProduct])#
Performs a nodal pricing optimization using the Pyomo library. It takes market orders, simulates network congestion, and computes optimal power generation and consumption at different nodes while considering constraints and objectives. The results are used to update order information and collect meta-information for reporting.
- Parameters:
market_products (list[MarketProduct]) – The products to be traded
- Returns:
accepted_orders, [], meta
- Return type:
assume.markets.clearing_algorithms.simple module#
- class assume.markets.clearing_algorithms.simple.PayAsBidRole(marketconfig: MarketConfig)#
Bases:
MarketRole
- clear(orderbook: list[assume.common.market_objects.Order], market_products: list[assume.common.market_objects.MarketProduct])#
Simulates electricity market clearing using a pay-as-bid mechanism.
- Parameters:
market_products (list[MarketProduct]) – The products to be traded
- Returns:
accepted_orders, rejected_orders, meta
- Return type:
- class assume.markets.clearing_algorithms.simple.PayAsClearRole(marketconfig: MarketConfig)#
Bases:
MarketRole
- clear(orderbook: list[assume.common.market_objects.Order], market_products)#
Performs electricity market clearing using a pay-as-clear mechanism. This means that the clearing price is the highest price that is still accepted. The clearing price is the same for all accepted orders.
- Parameters:
market_products (list[MarketProduct]) – The products to be traded
- Returns:
accepted_orders, rejected_orders, meta
- Return type:
- assume.markets.clearing_algorithms.simple.calculate_meta(accepted_supply_orders, accepted_demand_orders, product)#