org.powertac.common
Class Orderbook

java.lang.Object
  extended by org.powertac.common.Orderbook

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 im 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

Constructor Summary
Orderbook(Timeslot timeslot, Double clearingPrice, org.joda.time.Instant dateExecuted)
          Constructor with default product type.
 
Method Summary
 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()
          The timeslot in which energy commitments represented by cleared trades are due.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Orderbook

public Orderbook(Timeslot timeslot,
                 Double clearingPrice,
                 org.joda.time.Instant dateExecuted)
Constructor with default product type.

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.


getTimeslot

public Timeslot getTimeslot()
The timeslot in which energy commitments represented by cleared trades are due.


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

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

public Orderbook addAsk(OrderbookOrder ask)


Copyright © 2012. All Rights Reserved.