Package org.powertac.common
Class Orderbook
- java.lang.Object
-
- org.powertac.common.Orderbook
-
@Domain(fields={"timeslot","clearingPrice","dateExecuted"}) public class Orderbook extends Object
An orderbook instance captures a snapshot of the PowerTAC wholesale market's orderbook (the un-cleared bids and asks remaining after the market is cleared). Each OrderbookEntry contained in the orderbook contains a limit price and total un-cleared buy / sell quantity in MWh at that price. Each time the market clears, one orderbook is created and sent to brokers for each timeslot being traded during that clearing event.- Version:
- 1.2 , 05/02/2011
- Author:
- Daniel Schnurr, John Collins
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Orderbook
addAsk(OrderbookOrder ask)
Orderbook
addBid(OrderbookOrder bid)
SortedSet<OrderbookOrder>
getAsks()
The set of asks (negative energy quantities) that were submitted and did not clear, ascending sort.SortedSet<OrderbookOrder>
getBids()
The set of bids (positive energy quantities) that were submitted and did not clear, ascending sort.Double
getClearingPrice()
Returns the positive price at which the market cleared.org.joda.time.Instant
getDateExecuted()
The date when the market cleared.long
getId()
Timeslot
getTimeslot()
int
getTimeslotIndex()
The timeslot in which energy commitments represented by cleared trades are due.
-
-
-
Constructor Detail
-
Orderbook
public Orderbook(int timeslot, Double clearingPrice, org.joda.time.Instant dateExecuted)
Constructor with default product type.
-
Orderbook
@ChainedConstructor public Orderbook(Timeslot timeslot, Double clearingPrice, org.joda.time.Instant dateExecuted)
-
-
Method Detail
-
getId
public long getId()
-
getClearingPrice
public Double getClearingPrice()
Returns the positive price at which the market cleared. This is the price paid to sellers, the negative of the price paid by buyers. Null if no trades were cleared.
-
getDateExecuted
public org.joda.time.Instant getDateExecuted()
The date when the market cleared.
-
getTimeslotIndex
public int getTimeslotIndex()
The timeslot in which energy commitments represented by cleared trades are due.
-
getTimeslot
public Timeslot getTimeslot()
-
getBids
public SortedSet<OrderbookOrder> getBids()
The set of bids (positive energy quantities) that were submitted and did not clear, ascending sort. Because bid prices are normally negative, the first element is the highest (most negative) price that did not clear. Null prices (market orders) sort ahead of non-null prices (limit orders).
-
addBid
@StateChange public Orderbook addBid(OrderbookOrder bid)
-
getAsks
public SortedSet<OrderbookOrder> getAsks()
The set of asks (negative energy quantities) that were submitted and did not clear, ascending sort. Null prices (market orders) sort ahead of non-null prices (limit orders).
-
addAsk
@StateChange public Orderbook addAsk(OrderbookOrder ask)
-
-