|
GridSim v4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
ObjectThread
eduni.simjava.Sim_entity
gridsim.GridSimCore
gridsim.GridSim
gridsim.auction.Auction
gridsim.auction.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| Field Summary |
| Fields inherited from class gridsim.auction.Auction |
outputPort |
| Fields inherited from class gridsim.GridSim |
PAUSE, rand, SimulationStartDate |
| Fields inherited from class gridsim.GridSimCore |
input, output |
| Fields inherited from class eduni.simjava.Sim_entity |
|
| 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 gridsim.auction.Auction |
body, broadcastMessage, getAttribute, getAttributes, getAuctioneerID, getAuctionID, getAuctionProtocol, getBidders, getOutputPort, getStartingTime, setAttribute, setAuctioneerID, setAuctionProtocol, setBidders, setOutputPort, setStartingTime |
| Methods inherited from class gridsim.GridSimCore |
finalize, finalizeGridSimulation, getLink, getPingResult, isNetworked, IsNetworked, ping, ping, ping, ping, pingBlockingCall, pingBlockingCall, pingBlockingCall, pingBlockingCall, send, Send, send, Send, send, Send, send, Send, send, Send, send, Send, setBackgroundTraffic, setBackgroundTraffic, TerminateInputOutputEntities, terminateIOEntities |
| Methods inherited from class eduni.simjava.Sim_entity |
add_generator, add_param, add_port, clone, get_id, get_name, get_port, get_port, get_stat, run, send_on, set_invisible, set_stat, sim_cancel, sim_completed, sim_current, sim_get_next, sim_get_next, sim_hold_for, sim_hold, sim_pause_for, sim_pause_for, sim_pause_until, sim_pause_until, sim_pause, sim_process_for, sim_process_for, sim_process_until, sim_process_until, sim_process, sim_putback, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_schedule, sim_select, sim_trace, sim_wait_for, sim_wait_for, sim_wait_for, sim_wait, sim_waiting, sim_waiting |
| Methods inherited from class Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class Object |
equals, 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 v4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||