GridSim 5.0 beta

gridsim.auction
Class MessageBid

Object
  extended by Message
      extended by MessageBid

public class MessageBid
extends Message

This class represents a bid made by a bidder to the auctioneer

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
MessageBid(int auctionID, int protocol, int cfpID, int bidder)
          Constructor
MessageBid(int auctionID, int protocol, int cfpID, int bidder, int round)
          Constructor
 
Method Summary
 int getBidder()
          Returns the bidder or source of this bid
 int getCfpID()
          Returns the Call for Proposal's ID the bid refers to
 double getPrice()
          Returns the price offered in the bid
 int getRound()
          Returns the round the bid refers to
 boolean setBidder(int bidder)
          Set the bidder or source of this bid
 boolean setPrice(double price)
          Sets the price offered in the bid
 boolean setRound(int round)
          Sets the round the bid refers to
 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

MessageBid

public MessageBid(int auctionID,
                  int protocol,
                  int cfpID,
                  int bidder,
                  int round)
Constructor

Parameters:
auctionID - the auction to which this bid belongs
protocol - the protocol used
cfpID - the call for proposal to which this bid is a response
bidder - the bidder that is making this bid
round - the round the bid refers to

MessageBid

public MessageBid(int auctionID,
                  int protocol,
                  int cfpID,
                  int bidder)
Constructor

Parameters:
auctionID - the auction to which this bid belongs
protocol - the protocol used
cfpID - the call for proposal to which this bid is a response
bidder - the bidder that is making this bid
Method Detail

setPrice

public boolean setPrice(double price)
Sets the price offered in the bid

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

getPrice

public double getPrice()
Returns the price offered in the bid

Returns:
the price

getCfpID

public int getCfpID()
Returns the Call for Proposal's ID the bid refers to

Returns:
the CFP's ID

setRound

public boolean setRound(int round)
Sets the round the bid refers to

Parameters:
round - the round
Returns:
true if the round is properly set
Pre Condition:
round >= 1

getRound

public int getRound()
Returns the round the bid refers to

Returns:
the round

setBidder

public boolean setBidder(int bidder)
Set the bidder or source of this bid

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

getBidder

public int getBidder()
Returns the bidder or source of this bid

Returns:
the GridSim entity

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