net.sourceforge.jasa.market.auctioneer
Class ContinuousDoubleAuctioneer

java.lang.Object
  extended by net.sourceforge.jasa.market.auctioneer.AbstractAuctioneer
      extended by net.sourceforge.jasa.market.auctioneer.TransparentAuctioneer
          extended by net.sourceforge.jasa.market.auctioneer.ContinuousDoubleAuctioneer
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, MarketEventListener, Auctioneer, QuoteProvider
Direct Known Subclasses:
ContinuousDoubleAuctioneerEE

public class ContinuousDoubleAuctioneer
extends TransparentAuctioneer
implements java.io.Serializable

An auctioneer for a double-market with continuous clearing. The clearing operation is performed every time a shout arrives. Shouts must beat the current quote in order to be accepted.

See Also:
Serialized Form
 

Field Summary
protected  ZeroFundsAccount account
           
protected static NotAnImprovementOverQuoteException askException
          Reusable exceptions for performance
protected static NotAnImprovementOverQuoteException bidException
           
protected static java.lang.String DISCLAIMER
           
 
Fields inherited from class net.sourceforge.jasa.market.auctioneer.TransparentAuctioneer
acceptedShouts, lastAsk, lastBid, lastShout
 
Fields inherited from class net.sourceforge.jasa.market.auctioneer.AbstractAuctioneer
clearingPolicy, clearingQuote, currentQuote, market, orderBook, pricingPolicy
 
Constructor Summary
ContinuousDoubleAuctioneer()
           
ContinuousDoubleAuctioneer(Market auction)
           
 
Method Summary
protected  void askNotAnImprovementException()
           
protected  void bidNotAnImprovementException()
           
protected  void checkImprovement(Order shout)
           
protected  void checkShoutValidity(Order shout)
           
protected  java.lang.Object clone()
           
 void generateQuote()
           
 Account getAccount()
          Get the account which holds any budget surplus or deficit for the auctioneer.
 void newShoutInternal(Order shout)
           
 void onEndOfDay()
           
 void onRoundClosed()
           
 boolean shoutsVisible()
          Return true if the shouts of others are visible.
 
Methods inherited from class net.sourceforge.jasa.market.auctioneer.TransparentAuctioneer
getLastAsk, getLastBid, getLastShout, orderFilled, recordMatch, reset, transactionsOccurred
 
Methods inherited from class net.sourceforge.jasa.market.auctioneer.AbstractAuctioneer
askIterator, askQuote, bidIterator, bidQuote, clear, clear, clear, determineClearingPrice, eventOccurred, getClearingPolicy, getClearingQuote, getMarket, getOrderBook, getPricingPolicy, getQuote, getUnmatchedAsks, getUnmatchedBids, initialise, newOrder, printState, protoClone, removeOrder, setClearingPolicy, setClearingQuote, setMarket, setOrderBook, setPricingPolicy, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

account

protected ZeroFundsAccount account

askException

protected static NotAnImprovementOverQuoteException askException
Reusable exceptions for performance


bidException

protected static NotAnImprovementOverQuoteException bidException

DISCLAIMER

protected static final java.lang.String DISCLAIMER
See Also:
Constant Field Values
Constructor Detail

ContinuousDoubleAuctioneer

public ContinuousDoubleAuctioneer(Market auction)

ContinuousDoubleAuctioneer

public ContinuousDoubleAuctioneer()
Method Detail

generateQuote

public void generateQuote()
Specified by:
generateQuote in class AbstractAuctioneer

onRoundClosed

public void onRoundClosed()
Overrides:
onRoundClosed in class TransparentAuctioneer

onEndOfDay

public void onEndOfDay()
Overrides:
onEndOfDay in class AbstractAuctioneer

clone

protected java.lang.Object clone()
                          throws java.lang.CloneNotSupportedException
Overrides:
clone in class java.lang.Object
Throws:
java.lang.CloneNotSupportedException

shoutsVisible

public boolean shoutsVisible()
Description copied from interface: Auctioneer
Return true if the shouts of others are visible.

Specified by:
shoutsVisible in interface Auctioneer
Overrides:
shoutsVisible in class TransparentAuctioneer

newShoutInternal

public void newShoutInternal(Order shout)
                      throws DuplicateShoutException
Overrides:
newShoutInternal in class TransparentAuctioneer
Throws:
DuplicateShoutException

checkShoutValidity

protected void checkShoutValidity(Order shout)
                           throws IllegalOrderException
Overrides:
checkShoutValidity in class AbstractAuctioneer
Parameters:
shout - The new shout to be processed
Throws:
IllegalOrderException - Thrown if the shout is invalid in some way.

checkImprovement

protected void checkImprovement(Order shout)
                         throws IllegalOrderException
Throws:
IllegalOrderException

getAccount

public Account getAccount()
Description copied from interface: Auctioneer
Get the account which holds any budget surplus or deficit for the auctioneer. This is useful when implementing non-budget-balanced mechanisms.

Specified by:
getAccount in interface Auctioneer

askNotAnImprovementException

protected void askNotAnImprovementException()
                                     throws NotAnImprovementOverQuoteException
Throws:
NotAnImprovementOverQuoteException

bidNotAnImprovementException

protected void bidNotAnImprovementException()
                                     throws NotAnImprovementOverQuoteException
Throws:
NotAnImprovementOverQuoteException