|
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
This class represents an auction. This is class has generic attributes common to all auctions
OneSidedAuction,
DoubleAuction,
AuctionTags| Field Summary | |
protected Sim_port |
outputPort
The Auction output port. |
| 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 | |
Auction(String auctionName,
int auctionProtocol)
Constructor |
|
Auction(String auctionName,
int auctioneerID,
int auctionProtocol,
Sim_port output)
Default constructor |
|
| Method Summary | |
void |
body()
The method which defines the behaviour of the entity. |
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 |
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 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 |
| 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 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()
Sim_entity
body in class Sim_entityprotected abstract void processEvent(Sim_event ev)
public abstract void startAuction()
|
GridSim v4.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||