net.sourceforge.jasa.market.auctioneer
Class GenericAuctioneer

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.GenericAuctioneer
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Observer, MarketEventListener, Auctioneer, QuoteProvider

public class GenericAuctioneer
extends TransparentAuctioneer
implements java.io.Serializable, java.util.Observer

An modular auctioneer for a double market.

See Also:
Serialized Form
 

Field Summary
protected  OrderAcceptancePolicy acceptingPolicy
           
protected  ZeroFundsAccount account
           
protected  MarketClearingCondition clearingCondition
           
 
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
GenericAuctioneer()
           
GenericAuctioneer(Market auction)
           
 
Method Summary
protected  void checkShoutValidity(Order shout)
           
protected  void clearMarket()
           
 void eventOccurred(MarketEvent event)
          TODO: temporarily put here, clearingCondition and acceptingPolicy should listen to the market directly
 void generateQuote()
           
 OrderAcceptancePolicy getAcceptingPolicy()
           
 Account getAccount()
          Get the account which holds any budget surplus or deficit for the auctioneer.
 MarketClearingCondition getClearingCondition()
           
protected  void initialise()
           
 void reset()
           
 void setAcceptingPolicy(OrderAcceptancePolicy acceptingPolicy)
           
 void setClearingCondition(MarketClearingCondition clearingCondition)
           
 java.lang.String toString()
           
 void update(java.util.Observable source, java.lang.Object arg)
           
 
Methods inherited from class net.sourceforge.jasa.market.auctioneer.TransparentAuctioneer
getLastAsk, getLastBid, getLastShout, newShoutInternal, onRoundClosed, orderFilled, recordMatch, shoutsVisible, transactionsOccurred
 
Methods inherited from class net.sourceforge.jasa.market.auctioneer.AbstractAuctioneer
askIterator, askQuote, bidIterator, bidQuote, clear, clear, clear, determineClearingPrice, getClearingPolicy, getClearingQuote, getMarket, getOrderBook, getPricingPolicy, getQuote, getUnmatchedAsks, getUnmatchedBids, newOrder, onEndOfDay, printState, protoClone, removeOrder, setClearingPolicy, setClearingQuote, setMarket, setOrderBook, setPricingPolicy
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

account

protected ZeroFundsAccount account

clearingCondition

protected MarketClearingCondition clearingCondition

acceptingPolicy

protected OrderAcceptancePolicy acceptingPolicy
Constructor Detail

GenericAuctioneer

public GenericAuctioneer()

GenericAuctioneer

public GenericAuctioneer(Market auction)
Method Detail

initialise

protected void initialise()
Overrides:
initialise in class AbstractAuctioneer

reset

public void reset()
Overrides:
reset in class TransparentAuctioneer

setClearingCondition

public void setClearingCondition(MarketClearingCondition clearingCondition)

getClearingCondition

public MarketClearingCondition getClearingCondition()

setAcceptingPolicy

public void setAcceptingPolicy(OrderAcceptancePolicy acceptingPolicy)

getAcceptingPolicy

public OrderAcceptancePolicy getAcceptingPolicy()

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

clearMarket

protected void clearMarket()

generateQuote

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

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.

update

public void update(java.util.Observable source,
                   java.lang.Object arg)
Specified by:
update in interface java.util.Observer

eventOccurred

public void eventOccurred(MarketEvent event)
TODO: temporarily put here, clearingCondition and acceptingPolicy should listen to the market directly

Overrides:
eventOccurred in class AbstractAuctioneer

toString

public java.lang.String toString()
Overrides:
toString in class AbstractAuctioneer