|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Object Thread Sim_entity GridSimCore GridSim Auction DoubleAuction ContinuousDoubleAuction
public class ContinuousDoubleAuction
This class represents a Continuos Double Auction. In Continuous double auctions, the auctioneer matches asks and bids. The auctioneer maintains a list of asks ordered in a increasing order and a list of bids ordered in an decreasing order. When the auctioneer receives an ask it proceeds as follows: 1. It compares it with the first bid of the list. If the price in the ask is lower than or equal to the bid's value, it informs that seller and bidder can trade at the price (price ask + price bid) / 2) 2. Otherwise, the auctioneer adds the ask in the list. If the auctioneer receives a bid, it does the following: 1. It compares it with the first ask of the list. If the price in the ask is lower than or equal to the bid's value, it informs that seller and bidder can trade at the price (price ask + price bid) / 2). 2. Otherwise, the auctioneer adds the bid in the list.
Auction
,
DoubleAuction
,
AuctionTags
Nested Class Summary | |
---|---|
(package private) class |
ContinuousDoubleAuction.OrderAsksByPriceAsc
|
(package private) class |
ContinuousDoubleAuction.OrderBidsByPriceDesc
|
Nested classes/interfaces inherited from class Thread |
---|
Thread.State, Thread.UncaughtExceptionHandler |
Field Summary |
---|
Fields inherited from class Auction |
---|
outputPort |
Fields inherited from class GridSim |
---|
GRIDSIM_VERSION_STRING, PAUSE |
Fields inherited from class GridSimCore |
---|
input, NETWORK_TYPE, output |
Fields inherited from class Thread |
---|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
Constructor Summary | |
---|---|
ContinuousDoubleAuction(String auctionName,
double durationOfAuction)
Constructor |
|
ContinuousDoubleAuction(String auctionName,
int auctioneerID,
double durationOfAuction,
Sim_port output)
Constructor |
Method Summary | |
---|---|
void |
onReceiveAsk(MessageAsk ask)
Called when a ask is sent by a provider. |
void |
onReceiveBid(MessageBid bid)
Called when a bid is received. |
void |
onStart()
This method is called when the auction is started |
void |
onStop()
Called when the auction finishes |
Methods inherited from class DoubleAuction |
---|
closeAuction, getDurationOfAuction, match, processEvent, processOtherEvent, startAuction |
Methods inherited from class Auction |
---|
body, broadcastMessage, getAttribute, getAttributes, getAuctioneerID, getAuctionID, getAuctionProtocol, getBidders, getOutputPort, getStartingTime, setAttribute, setAuctioneerID, setAuctionID, setAuctionProtocol, setBidders, setOutputPort, setStartingTime |
Methods inherited from class GridSimCore |
---|
finalizeGridSimulation, getLink, getPingResult, isNetworked, ping, ping, ping, ping, pingBlockingCall, pingBlockingCall, pingBlockingCall, pingBlockingCall, send, send, send, send, send, send, setBackgroundTraffic, setBackgroundTraffic, terminateIOEntities |
Methods inherited from class Thread |
---|
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
Methods inherited from class Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public ContinuousDoubleAuction(String auctionName, int auctioneerID, double durationOfAuction, Sim_port output) throws Exception
auctionName
- name for the auctionauctioneerID
- auctioneer's IDdurationOfAuction
- time duration of auctionoutput
- the output port to be used by this auction
Exception
public ContinuousDoubleAuction(String auctionName, double durationOfAuction) throws Exception
auctionName
- name for the auctiondurationOfAuction
- time duration of auction
Exception
Method Detail |
---|
public void onStart()
onStart
in class DoubleAuction
public void onStop()
onStop
in class DoubleAuction
public void onReceiveAsk(MessageAsk ask)
onReceiveAsk
in class DoubleAuction
ask
- the ask sent by the providerpublic void onReceiveBid(MessageBid bid)
onReceiveBid
in class DoubleAuction
bid
- the bid received by the auctioneer
|
GridSim 5.0 beta | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |