org.powertac.common
Class Order

java.lang.Object
  extended by org.powertac.common.state.XStreamStateLoggable
      extended by org.powertac.common.Order

public class Order
extends XStreamStateLoggable

A Order instance represents a market (no price specified) or a limit (min/max price specified) order in the PowerTAC wholesale market. Each Order specifies an amount of energy in MWh, and a price in units. The quantities represent the broker's view of the proposed transaction in terms of the broker's energy and money accounts: positive quantities of energy represent a proposal to buy power from another party and transfer it to the broker. A positive quantity of energy is almost always accompanied by a negative price, which in turn represents money to be transfered out of the broker's account to the other party in the transaction. So a buy order is indicated by a positive energy quantity, and a sell order is indicated by a negative energy quantity. State log fields for readResolve():
new(long brokerId, long timeslotId, double mwh, Double limitPrice)

Author:
Carsten Block, John Collins

Constructor Summary
protected Order()
           
  Order(Broker broker, int timeslot, double mWh, Double limitPrice)
          Creates a new Order for Broker to buy or sell a quantity of energy in Timeslot.
  Order(Broker broker, Timeslot timeslot, double mWh, Double limitPrice)
          Deprecated. 
 
Method Summary
 Broker getBroker()
           
 long getId()
           
 Double getLimitPrice()
          Setter for logtool access; do not use otherwise
 Double getMWh()
           
 Timeslot getTimeslot()
           
 int getTimeslotIndex()
           
 String toString()
           
 
Methods inherited from class org.powertac.common.state.XStreamStateLoggable
readResolve
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Order

public Order(Broker broker,
             int timeslot,
             double mWh,
             Double limitPrice)
Creates a new Order for Broker to buy or sell a quantity of energy in Timeslot. A positive value for mWh indicates a buy order (because the broker's energy account will increase), and a negative value for mWh indicates an offer to sell. Similarly, a negative value for limitPrice indicates a willingness to pay the given amount, while a positive value indicates a demand to be paid at least that amount. A null value for limitPrice indicates an unlimited price. In the clearing process, null values will be considered last for both buy and sell orders, and the price-setting algorithm may not be advantageous for the broker in this case.


Order

@Deprecated
public Order(Broker broker,
                        Timeslot timeslot,
                        double mWh,
                        Double limitPrice)
Deprecated. 

Creates a new order using a Timeslot rather than a timeslot index value. New code should not use this method.


Order

protected Order()
Method Detail

getId

public long getId()

getBroker

public Broker getBroker()

getTimeslotIndex

public int getTimeslotIndex()

getTimeslot

public Timeslot getTimeslot()

getMWh

public Double getMWh()

getLimitPrice

public Double getLimitPrice()
Setter for logtool access; do not use otherwise


toString

public String toString()
Overrides:
toString in class Object


Copyright © 2013. All Rights Reserved.