Class MarketClearing


  • public class MarketClearing
    extends Object
    Performs market clearing of day-ahead market based on provided Bid-messages
    Author:
    Farzad Sarfarazi, Christoph Schimeczek
    • Field Detail

      • EMPTY_MARKET_RESULT

        public static final ClearingDetails EMPTY_MARKET_RESULT
        Market clearing result if a market is empty: TradedEnergy: 0 MWh, MarketPrice = NaN
      • parameters

        public static final de.dlr.gitlab.fame.agent.input.Tree parameters
        Input parameters of MarketClearing
      • logger

        protected static org.slf4j.Logger logger
        Logs errors of MarketClearing
    • Constructor Detail

      • MarketClearing

        public MarketClearing​(de.dlr.gitlab.fame.agent.input.ParameterData input)
                       throws de.dlr.gitlab.fame.agent.input.ParameterData.MissingDataException
        Creates a MarketClearing
        Parameters:
        input - group holding all parameters
        Throws:
        de.dlr.gitlab.fame.agent.input.ParameterData.MissingDataException - if any required parameters are missing
    • Method Detail

      • clear

        public MarketClearingResult clear​(ArrayList<de.dlr.gitlab.fame.communication.message.Message> input,
                                          String clearingEventId)
        Clears the market based on all the bids provided in form of messages
        Parameters:
        input - unsorted messages containing demand and supply bids
        clearingEventId - string identifying the clearing event
        Returns:
        result of market clearing
        Throws:
        RuntimeException - if the market clearing failed
      • fillOrderBooksWithTraderBids

        public void fillOrderBooksWithTraderBids​(ArrayList<de.dlr.gitlab.fame.communication.message.Message> input,
                                                 SupplyOrderBook supplyBook,
                                                 DemandOrderBook demandBook)
        Fills received Bids into provided demand or supply OrderBook
        Parameters:
        input - unsorted messages containing demand and supply bids
        supplyBook - to be filled with supply bids
        demandBook - to be filled with demand bids
      • clear

        public MarketClearingResult clear​(SupplyOrderBook supplyBook,
                                          DemandOrderBook demandBook,
                                          String clearingEventId)
        Clears the market based on a SupplyOrderBook and a DemandOrderBook
        Parameters:
        supplyBook - book of all supply bids
        demandBook - book of all demand bids
        clearingEventId - string identifying the clearing event
        Returns:
        result of market clearing
        Throws:
        RuntimeException - if the market clearing failed