Package org.powertac.common.repo
Class OrderbookRepo
- java.lang.Object
- 
- org.powertac.common.repo.ManagedRepo
- 
- org.powertac.common.repo.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
 
- 
- 
Field Summary- 
Fields inherited from class org.powertac.common.repo.ManagedRepointerval, offset, timeService
 
- 
 - 
Constructor SummaryConstructors Constructor Description OrderbookRepo()Standard constructor
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description protected voiddoCleanup()List<Orderbook>findAllByTimeslot(Timeslot timeslot)OrderbookfindByTimeslot(Timeslot timeslot)Returns the most recent Orderbook that has been created for the specified timeslot.OrderbookfindSpotByTimeslot(Timeslot timeslot)Returns the most recent orderbook with a non-null clearing price.Double[]getMaxAskPrices()Returns maxAskPrices array, representing the maximum ask prices for the most recent clearing of the wholesale market.Double[]getMinAskPrices()Returns the minAskPrices array, representing the minimum ask prices for the most recent clearing of the wholesale market.OrderbookmakeOrderbook(Timeslot timeslot, Double clearingPrice)Creates a new Orderbook, with standard defaults (productType = Future, dateExecuted = now).voidrecycle()Clears the index in preparation for a new simulationvoidsetMaxAskPrices(Double[] values)voidsetMinAskPrices(Double[] values)Set the minAskPrices array.intsize()Returns the count of instances in this repo- 
Methods inherited from class org.powertac.common.repo.ManagedReposetup
 
- 
 
- 
- 
- 
Method Detail- 
makeOrderbookpublic Orderbook makeOrderbook(Timeslot timeslot, Double clearingPrice) Creates a new Orderbook, with standard defaults (productType = Future, dateExecuted = now).
 - 
findByTimeslotpublic Orderbook findByTimeslot(Timeslot timeslot) Returns the most recent Orderbook that has been created for the specified timeslot.
 - 
findSpotByTimeslotpublic 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.
 - 
setMinAskPricespublic 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.
 - 
setMaxAskPricespublic void setMaxAskPrices(Double[] values) - Parameters:
- values-
 
 - 
getMinAskPricespublic Double[] getMinAskPrices() Returns the minAskPrices array, representing the minimum ask prices for the most recent clearing of the wholesale market.
 - 
getMaxAskPricespublic Double[] getMaxAskPrices() Returns maxAskPrices array, representing the maximum ask prices for the most recent clearing of the wholesale market.- Returns:
- maximum ask prices.
 
 - 
sizepublic int size() Returns the count of instances in this repo
 - 
recyclepublic void recycle() Clears the index in preparation for a new simulation- Specified by:
- recyclein interface- DomainRepo
- Overrides:
- recyclein class- ManagedRepo
 
 - 
doCleanupprotected void doCleanup() - Specified by:
- doCleanupin class- ManagedRepo
 
 
- 
 
-