net.sourceforge.jasa.market
Interface Market

All Superinterfaces:
QuoteProvider
All Known Implementing Classes:
MarketSimulation

public interface Market
extends QuoteProvider

An order-driven market exchange.

 

Method Summary
 void clear(Order ask, Order bid, double price)
          Handle a single clearing operation between two traders for a single unit.
 void clear(Order ask, Order bid, double buyerCharge, double sellerPayment, int quantity)
          Handle a single clearing operation between two traders specifying the prices paid by each party and the volume of the trade.
 void close()
          Close the market.
 boolean closed()
          Returns true if the market is closed.
 int getAge()
           
 Auctioneer getAuctioneer()
          Return the current auctioneer for this market.
 double getCurrentPrice()
          Return the current price.
 int getDay()
           
 Order getLastOrder()
          Return the most recent order placed in the market.
 double getLastTransactionPrice()
          Return the price of the most transaction that occurred in the market.
 int getNumberOfTraders()
          Get the number of traders known to be trading in the market.
 Population getPopulation()
           
 int getRemainingTime()
          Get the remaining time in the current trading day (period).
 int getRound()
          Get the age of the market in unspecified units
 java.util.Iterator<Agent> getTraderIterator()
           
 boolean orderAccepted(Order shout)
          Find out whether the given shout has resulted in a transaction in the current round of trading.
 void placeOrder(Order shout)
          Place a new order in the market.
 void printState()
          Report the state of the market.
 void remove(AbstractTradingAgent abstractTradingAgent)
           
 void removeOrder(Order shout)
          Remove an order from the market.
 boolean transactionsOccurred()
          Determine whether or not any transactions have occurred in the current round of trading.
 
Methods inherited from interface net.sourceforge.jasa.market.QuoteProvider
getQuote
 

Method Detail

closed

boolean closed()
Returns true if the market is closed.


close

void close()
Close the market.


placeOrder

void placeOrder(Order shout)
                throws AuctionException
Place a new order in the market.

Throws:
AuctionException

removeOrder

void removeOrder(Order shout)
Remove an order from the market.


getLastOrder

Order getLastOrder()
                   throws ShoutsNotVisibleException
Return the most recent order placed in the market.

Throws:
ShoutsNotVisibleException

getAuctioneer

Auctioneer getAuctioneer()
Return the current auctioneer for this market.


printState

void printState()
Report the state of the market.


clear

void clear(Order ask,
           Order bid,
           double price)
Handle a single clearing operation between two traders for a single unit.


clear

void clear(Order ask,
           Order bid,
           double buyerCharge,
           double sellerPayment,
           int quantity)
Handle a single clearing operation between two traders specifying the prices paid by each party and the volume of the trade.


getRound

int getRound()
Get the age of the market in unspecified units


getDay

int getDay()

getAge

int getAge()

getRemainingTime

int getRemainingTime()
Get the remaining time in the current trading day (period).


getNumberOfTraders

int getNumberOfTraders()
Get the number of traders known to be trading in the market.


orderAccepted

boolean orderAccepted(Order shout)
                      throws ShoutsNotVisibleException
Find out whether the given shout has resulted in a transaction in the current round of trading.

Throws:
ShoutsNotVisibleException

transactionsOccurred

boolean transactionsOccurred()
                             throws ShoutsNotVisibleException
Determine whether or not any transactions have occurred in the current round of trading.

Throws:
ShoutsNotVisibleException

getLastTransactionPrice

double getLastTransactionPrice()
Return the price of the most transaction that occurred in the market.

Returns:

getCurrentPrice

double getCurrentPrice()
Return the current price. This is typically a mid-price or a recent transaction price.


getTraderIterator

java.util.Iterator<Agent> getTraderIterator()

remove

void remove(AbstractTradingAgent abstractTradingAgent)

getPopulation

Population getPopulation()