|
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
public abstract class Auction
This class represents an auction. This is class has generic attributes common to all auctions
OneSidedAuction,
DoubleAuction,
AuctionTags| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class Thread |
|---|
Thread.State, Thread.UncaughtExceptionHandler |
| Field Summary | |
|---|---|
protected Sim_port |
outputPort
The Auction output port. |
| 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 | |
|---|---|
Auction(String auctionName,
int auctionProtocol)
Constructor |
|
Auction(String auctionName,
int auctioneerID,
int auctionProtocol,
Sim_port output)
Default constructor |
|
| Method Summary | |
|---|---|
void |
body()
|
protected boolean |
broadcastMessage(Message msg)
Brodcasts a message to all bidders engaged in the auction |
Object |
getAttribute(Object key)
Returns a given attribute of the auction |
protected Hashtable |
getAttributes()
Returns a Hashtable with the attributes defined in the auction. |
int |
getAuctioneerID()
Returns the auctioneer ID |
int |
getAuctionID()
Returns the ID of this auction |
protected int |
getAuctionProtocol()
Returns the auction protocol |
LinkedList |
getBidders()
Returns the list of bidders |
protected Sim_port |
getOutputPort()
Returns the output port used by this auction to send messages |
double |
getStartingTime()
Returns the initial time of the auction |
protected abstract void |
processEvent(Sim_event ev)
|
boolean |
setAttribute(Object key,
Object value)
Sets an attribute to this auction. |
boolean |
setAuctioneerID(int auctioneerID)
Sets the id of the auctioneer responsible for this auction |
boolean |
setAuctionID(int id)
Sets the auction's ID manually |
protected boolean |
setAuctionProtocol(int protocol)
Sets the auction protocol used by the auction |
boolean |
setBidders(LinkedList list)
Sets a list of the bidders associated with this auction |
boolean |
setOutputPort(Sim_port output)
Sets the output port to be used by this auction. |
protected boolean |
setStartingTime(double time)
Sets the initial time of the auction |
abstract void |
startAuction()
|
| 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 |
| Field Detail |
|---|
protected Sim_port outputPort
| Constructor Detail |
|---|
public Auction(String auctionName,
int auctioneerID,
int auctionProtocol,
Sim_port output)
throws Exception
auctionName - name for the auctionauctioneerID - the ID of the auctioner because the auction sends messages
on the auctioneer's behalfauctionProtocol - an int representing the auction protocoloutput - the auctioneer's output port
ExceptionGridSim
public Auction(String auctionName,
int auctionProtocol)
throws Exception
auctionName - name for the auction
on the auctioneer's behalfauctionProtocol - an int representing the auction protocol
ExceptionGridSim| Method Detail |
|---|
public int getAuctioneerID()
public boolean setAuctioneerID(int auctioneerID)
auctioneerID - the auctioneer ID
public boolean setOutputPort(Sim_port output)
output - the port to be used
public boolean setAuctionID(int id)
id - the id to be used by the auction
public int getAuctionID()
public boolean setBidders(LinkedList list)
list - of bidders. The IDs must be entities' ids
public LinkedList getBidders()
protected Sim_port getOutputPort()
public boolean setAttribute(Object key,
Object value)
key - the key used to retrieve the value of the attributevalue - the value of the attribute
protected Hashtable getAttributes()
public Object getAttribute(Object key)
key - used to retrieve the attribute
protected boolean setAuctionProtocol(int protocol)
protocol -
protected int getAuctionProtocol()
protected boolean setStartingTime(double time)
time - is the simulation time
public double getStartingTime()
protected boolean broadcastMessage(Message msg)
msg - Message to be broadcast
public void body()
body in class Sim_entityprotected abstract void processEvent(Sim_event ev)
public abstract void startAuction()
|
GridSim 5.0 beta | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||