|
GridSim 5.0 beta | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectThread
Sim_entity
GridSimCore
GridSim
Auction
DoubleAuction
public abstract class DoubleAuction
This class represents a double auction. Double auction are two-sided auctions in which both buyers and sellers can submit bids and asks respectivelly
Auction,
AuctionTags| Nested Class Summary |
|---|
| 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 | |
|---|---|
DoubleAuction(String auctionName,
int auctionProtocol,
double durationOfAuction)
Default constructor |
|
DoubleAuction(String auctionName,
int auctioneerID,
int auctionProtocol,
double durationOfAuction,
Sim_port output)
Default constructor |
|
| Method Summary | |
|---|---|
protected void |
closeAuction()
This method sets the auction as closed |
protected double |
getDurationOfAuction()
Returns the duration of the auction |
protected void |
match(MessageAsk ask,
MessageBid bid,
double price)
Invoked by the subclasses when a match of an ask and a bid is found. |
abstract void |
onReceiveAsk(MessageAsk ask)
Called when a ask is sent by a provider. |
abstract void |
onReceiveBid(MessageBid bid)
Called when a bid is received. |
abstract void |
onStart()
Called when the auction is started |
abstract void |
onStop()
Called when the auction finishes |
protected void |
processEvent(Sim_event ev)
Processes events or services that are available for this Auctioneer |
protected void |
processOtherEvent(Sim_event ev)
Overrides this method when making a new and different policy. |
void |
startAuction()
This method is called to start the auction and initialize the necessary paramenters |
| 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 DoubleAuction(String auctionName,
int auctioneerID,
int auctionProtocol,
double durationOfAuction,
Sim_port output)
throws Exception
auctionName - A name for the auctionauctioneerID - the ID of the auctioneerauctionProtocol - the auction protocoldurationOfAuction - duration of the auction in simulation timeoutput - the port to be used as output of messages
Exception
public DoubleAuction(String auctionName,
int auctionProtocol,
double durationOfAuction)
throws Exception
auctionName - A name for the auctionauctionProtocol - the auction protocoldurationOfAuction - duration of the auction in simulation time
Exception| Method Detail |
|---|
protected double getDurationOfAuction()
protected void match(MessageAsk ask,
MessageBid bid,
double price)
ask - the ask that was matchedbid - the bid that was matchedprice - the trade pricepublic void startAuction()
startAuction in class Auctionprotected void closeAuction()
protected void processEvent(Sim_event ev)
processEvent in class Auctionev - a Sim_event objectprotected void processOtherEvent(Sim_event ev)
Auction.body() for incoming unknown tags.
ev - a Sim_event objectpublic abstract void onStart()
public abstract void onStop()
public abstract void onReceiveAsk(MessageAsk ask)
ask - the ask sent by the providerpublic abstract void onReceiveBid(MessageBid bid)
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 | |||||||||