|
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
OneSidedAuction
public abstract class OneSidedAuction
This class represents an one-sided auction. One-sided auctions send announcements of a good to be sold and receive bids from bidders. It can have several rounds.
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 | |
|---|---|
OneSidedAuction(String auctionName,
int auctionProtocol,
double durationOfRounds,
int totalRound)
Default constructor |
|
OneSidedAuction(String auctionName,
int auctioneerID,
int auctionProtocol,
double durationOfRounds,
int totalRound,
Sim_port output)
Default constructor |
|
| Method Summary | |
|---|---|
protected void |
closeAuction()
This method sets the auction as closed |
int |
currentRound()
Returns the current round of the auction |
double |
getCurrentPrice()
Returns the current price of this auction |
protected double |
getDurationOfRounds()
Returns the duration of a round |
double |
getFinalPrice()
Returns the final price achieved by the auction |
double |
getMaxPrice()
Returns the maximum price of the auction |
double |
getMinPrice()
Returns the minimun price of the auction |
int |
getNumberOfRounds()
Returns the number of rounds of the auction |
double |
getReservePrice()
Returns the reserve price |
int |
getWinner()
Returns the winner's ID |
abstract void |
onClose(int round)
Called when a round finishes |
abstract void |
onReceiveBid(MessageBid bid)
Called when a bid is received. |
abstract void |
onReceiveRejectCallForBid(MessageRejectCallForBid mrej)
Called when a reject bid is received. |
abstract void |
onStart(int round)
Called when a round 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. |
boolean |
setCurrentPrice(double price)
Sets the current price in the auction |
boolean |
setFinalPrice(double price)
Sets the final price achieved in the auction |
boolean |
setMaxPrice(double price)
Sets the maximum price for the auction |
boolean |
setMinPrice(double price)
Sets the minimum price for the auction |
boolean |
setReservePrice(double price)
Set the reserve price. |
protected boolean |
setWinner(int winnerID)
Sets the winner ID |
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 OneSidedAuction(String auctionName,
int auctioneerID,
int auctionProtocol,
double durationOfRounds,
int totalRound,
Sim_port output)
throws Exception
auctionName - A name for the auctionauctioneerID - the ID of the auctioneerauctionProtocol - the auction protocoldurationOfRounds - duration in simulation time of each roundtotalRound - the number of roundsoutput - the auctioneer's output port
Exception
public OneSidedAuction(String auctionName,
int auctionProtocol,
double durationOfRounds,
int totalRound)
throws Exception
auctionName - A name for the auctionauctionProtocol - the auction protocoldurationOfRounds - duration in simulation time of each roundtotalRound - the number of rounds
Exception| Method Detail |
|---|
protected boolean setWinner(int winnerID)
winnerID -
public int getWinner()
protected double getDurationOfRounds()
public boolean setReservePrice(double price)
price -
public double getReservePrice()
public boolean setFinalPrice(double price)
price -
public double getFinalPrice()
public int currentRound()
public int getNumberOfRounds()
public boolean setCurrentPrice(double price)
price -
public double getCurrentPrice()
public boolean setMinPrice(double price)
price - the minimun price for the auction
public double getMinPrice()
public boolean setMaxPrice(double price)
price - the maximum price for the auction
public double getMaxPrice()
public 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(int round)
round - the number of the round that has startedpublic abstract void onClose(int round)
round - the round that has finishedpublic abstract void onStop()
public abstract void onReceiveBid(MessageBid bid)
bid - the bid received by the auctioneerpublic abstract void onReceiveRejectCallForBid(MessageRejectCallForBid mrej)
mrej - the reject received by the auctioneer
|
GridSim 5.0 beta | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||