Class MeritOrderKernel


  • public class MeritOrderKernel
    extends Object
    Clears the energy market by matching demand and supply curves
    Author:
    Martin Klein, Christoph Schimeczek, A. Achraf El Ghazi
    • Constructor Detail

      • MeritOrderKernel

        public MeritOrderKernel()
    • Method Detail

      • clearMarketSimple

        public static ClearingDetails clearMarketSimple​(SupplyOrderBook supply,
                                                        DemandOrderBook demand)
                                                 throws MeritOrderKernel.MeritOrderClearingException
        The function takes two sorted (ascending by cumulatedPower) OrderBooks for demand (descending by offerPrice) and supply (ascending by offerPrice). It is assumed that the price of the first element from demand exceeds that of the first supply element. Additionally, the OrderBooks need to contain a final bid reaching towards (minus) infinity for supply (demand) to ensure the cut of the curves. Sorting and bid structure is enforced in the OrderBook class. The algorithm begins with the lowermost element from demand and supply. It compares the demand and supply price from these elements. In case the demand price is lower than the supply price, the condition for a cut of the discrete functions is met. If no cut is found, the next element from demand and/or supply is selected, whichever has the lower cumulatedPower. Then the cut condition is evaluated again.
        Parameters:
        supply - sorted supply orders
        demand - sorted demand orders
        Returns:
        market clearing data, i.e. awarded power and price
        Throws:
        MeritOrderKernel.MeritOrderClearingException - in case the order books resemble no valid market