Class OrderbookRepo

  • All Implemented Interfaces:
    DomainRepo

    @Service
    public class OrderbookRepo
    extends ManagedRepo
    Repository for Orderbooks. Orderbooks are created with makeOrderbook(). Query methods include findByTimeslot().
    Author:
    John Collins
    • Constructor Detail

      • OrderbookRepo

        public OrderbookRepo()
        Standard constructor
    • Method Detail

      • makeOrderbook

        public Orderbook makeOrderbook​(Timeslot timeslot,
                                       Double clearingPrice)
        Creates a new Orderbook, with standard defaults (productType = Future, dateExecuted = now).
      • findByTimeslot

        public Orderbook findByTimeslot​(Timeslot timeslot)
        Returns the most recent Orderbook that has been created for the specified timeslot.
      • findSpotByTimeslot

        public Orderbook findSpotByTimeslot​(Timeslot timeslot)
        Returns the most recent orderbook with a non-null clearing price. Note that this can return null if this timeslot has never cleared.
      • setMinAskPrices

        public void setMinAskPrices​(Double[] values)
        Set the minAskPrices array. This is presumably done by the auctioneer when clearing the market, and so the data reflects the prices for the most recent market clearing.
      • setMaxAskPrices

        public void setMaxAskPrices​(Double[] values)
        Parameters:
        values -
      • getMinAskPrices

        public Double[] getMinAskPrices()
        Returns the minAskPrices array, representing the minimum ask prices for the most recent clearing of the wholesale market.
      • getMaxAskPrices

        public Double[] getMaxAskPrices()
        Returns maxAskPrices array, representing the maximum ask prices for the most recent clearing of the wholesale market.
        Returns:
        maximum ask prices.
      • size

        public int size()
        Returns the count of instances in this repo
      • recycle

        public void recycle()
        Clears the index in preparation for a new simulation
        Specified by:
        recycle in interface DomainRepo
        Overrides:
        recycle in class ManagedRepo