GridSim 5.0 beta

gridsim.auction
Class MessageInformOutcome

Object
  extended by Message
      extended by MessageInformOutcome

public class MessageInformOutcome
extends Message

This class represents an message that informs the outcome of an auction

Since:
GridSim Toolkit 4.0
Author:
Marcos Dias de Assuncao
See Also:
AuctionTags

Field Summary
 
Fields inherited from class Message
TO_ALL_BIDDERS
 
Constructor Summary
MessageInformOutcome(int auctionID, int protocol, int winner, double price)
          Constructor
 
Method Summary
 int getAuctioneer()
          Returns the auctioneer that sent the message
 double getPrice()
          Returns the price of the outcome
 int getWinnerID()
          Returns the winner's ID
 boolean setAuctioneer(int auctioneer)
          Sets the auctioneer that sent the message
 boolean setPrice(float price)
          Sets the price of the outcome
 String toString()
          Converts message to String
 
Methods inherited from class Message
getAttribute, getAttributes, getAuctionID, getDestinationID, getMessageID, getProtocol, getScheduleTime, getSourceID, scheduleToBeSent, setAttribute, setAttributes, setAuctionID, setDestinationID, setMessageID, setProtocol, setSourceID
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MessageInformOutcome

public MessageInformOutcome(int auctionID,
                            int protocol,
                            int winner,
                            double price)
Constructor

Parameters:
auctionID - the auction this message belongs to
protocol - the auction protocol in use
winner - the winner of the auction
price - the price paid
Method Detail

setPrice

public boolean setPrice(float price)
Sets the price of the outcome

Parameters:
price - the price
Returns:
true if the price was properly set
Pre Condition:
price >= 0.0

getPrice

public double getPrice()
Returns the price of the outcome

Returns:
the price

getWinnerID

public int getWinnerID()
Returns the winner's ID

Returns:
the winner's ID

setAuctioneer

public boolean setAuctioneer(int auctioneer)
Sets the auctioneer that sent the message

Parameters:
auctioneer - the auctioneer ID
Returns:
true if the auctioneer is properly set
Pre Condition:
bidder == some GridSim entity's id

getAuctioneer

public int getAuctioneer()
Returns the auctioneer that sent the message

Returns:
the auctioneer's ID

toString

public String toString()
Converts message to String

Overrides:
toString in class Message
Returns:
the string representation of the message

GridSim 5.0 beta

The University of Melbourne, Australia, 2009