|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jasa.market.auctioneer.AbstractAuctioneer
public abstract class AbstractAuctioneer
An abstract class representing an auctioneer managing shouts in an market. Different market rules should be encapsulated in different Auctioneer classes.
![]() |
![]() |
![]() |
![]() |
Field Summary | |
---|---|
protected ClearingPolicy |
clearingPolicy
|
protected MarketQuote |
clearingQuote
|
protected MarketQuote |
currentQuote
|
protected Market |
market
|
protected OrderBook |
orderBook
|
protected PricingPolicy |
pricingPolicy
|
Constructor Summary | |
---|---|
AbstractAuctioneer()
|
|
AbstractAuctioneer(Market auction)
|
Method Summary | |
---|---|
java.util.Iterator<Order> |
askIterator()
|
double |
askQuote()
|
java.util.Iterator<Order> |
bidIterator()
|
double |
bidQuote()
|
protected void |
checkShoutValidity(Order shout)
|
void |
clear()
Perform the clearing operation for the market; match buyers with sellers and inform the market of any deals. |
void |
clear(Order ask,
Order bid,
double price)
|
void |
clear(Order ask,
Order bid,
double buyerCharge,
double sellerPayment,
int quantity)
|
double |
determineClearingPrice(Order bid,
Order ask)
|
void |
eventOccurred(SimEvent event)
|
abstract void |
generateQuote()
|
ClearingPolicy |
getClearingPolicy()
|
MarketQuote |
getClearingQuote()
|
Market |
getMarket()
Find out which market we are the auctioneer for. |
OrderBook |
getOrderBook()
|
PricingPolicy |
getPricingPolicy()
|
MarketQuote |
getQuote()
|
java.util.List<Order> |
getUnmatchedAsks()
|
java.util.List<Order> |
getUnmatchedBids()
|
protected void |
initialise()
|
void |
newOrder(Order shout)
Code for handling a new shout in the market. |
protected void |
newShoutInternal(Order shout)
|
void |
onEndOfDay()
|
abstract void |
onRoundClosed()
|
void |
printState()
Log the current state of the market. |
java.lang.Object |
protoClone()
|
void |
recordMatch(Order ask,
Order bid)
|
void |
removeOrder(Order shout)
Handle a request to retract a shout. |
void |
reset()
|
void |
setClearingPolicy(ClearingPolicy clearingPolicy)
|
void |
setClearingQuote(MarketQuote clearingQuote)
|
void |
setMarket(Market auction)
Specify which market we are the auctioneer for. |
void |
setOrderBook(OrderBook orderBook)
|
void |
setPricingPolicy(PricingPolicy pricingPolicy)
|
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface net.sourceforge.jasa.market.auctioneer.Auctioneer |
---|
getAccount, getLastAsk, getLastBid, getLastShout, orderFilled, shoutsVisible, transactionsOccurred |
Field Detail |
---|
protected Market market
protected OrderBook orderBook
protected MarketQuote currentQuote
protected MarketQuote clearingQuote
protected PricingPolicy pricingPolicy
protected ClearingPolicy clearingPolicy
Constructor Detail |
---|
public AbstractAuctioneer(Market auction)
public AbstractAuctioneer()
Method Detail |
---|
public java.lang.Object protoClone()
public PricingPolicy getPricingPolicy()
public void setPricingPolicy(PricingPolicy pricingPolicy)
public void newOrder(Order shout) throws IllegalOrderException, DuplicateShoutException
newOrder
in interface Auctioneer
shout
- The new shout to be processed
IllegalOrderException
- Thrown if the shout is invalid in some way.
DuplicateShoutException
protected void newShoutInternal(Order shout) throws DuplicateShoutException
DuplicateShoutException
protected void checkShoutValidity(Order shout) throws IllegalOrderException
shout
- The new shout to be processed
IllegalOrderException
- Thrown if the shout is invalid in some way.public void removeOrder(Order shout)
removeOrder
in interface Auctioneer
public void printState()
printState
in interface Auctioneer
public void reset()
protected void initialise()
public MarketQuote getQuote()
getQuote
in interface QuoteProvider
public java.util.Iterator<Order> askIterator()
askIterator
in interface Auctioneer
public java.util.Iterator<Order> bidIterator()
bidIterator
in interface Auctioneer
public abstract void generateQuote()
public void setMarket(Market auction)
Auctioneer
setMarket
in interface Auctioneer
public Market getMarket()
getMarket
in interface Auctioneer
public void onEndOfDay()
public void clear()
Auctioneer
clear
in interface Auctioneer
public void clear(Order ask, Order bid, double price)
public void clear(Order ask, Order bid, double buyerCharge, double sellerPayment, int quantity)
public double determineClearingPrice(Order bid, Order ask)
public double bidQuote()
public double askQuote()
public void eventOccurred(SimEvent event)
public abstract void onRoundClosed()
public void recordMatch(Order ask, Order bid)
public OrderBook getOrderBook()
public void setOrderBook(OrderBook orderBook)
public java.util.List<Order> getUnmatchedAsks()
getUnmatchedAsks
in interface Auctioneer
public java.util.List<Order> getUnmatchedBids()
getUnmatchedBids
in interface Auctioneer
public MarketQuote getClearingQuote()
public void setClearingQuote(MarketQuote clearingQuote)
public ClearingPolicy getClearingPolicy()
public void setClearingPolicy(ClearingPolicy clearingPolicy)
public java.lang.String toString()
toString
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |