From: Marcos D. de A. <ma...@cs...> - 2008-07-17 06:52:06
|
Hi Mehtab, I am sorry for the delay. I guess you want to specify a maximum period of time over which participants will send asks and bids. After that time, the auctioneer will clear the auction. To do that, you don't set this time at the auctioneer, but at the auction. You set this time in the constructor. For example: /** * Default constructor * @param auctionName A name for the auction * @param auctionProtocol the auction protocol * @param durationOfAuction duration of the auction in simulation time * @throws Exception */ public DoubleAuction(String auctionName, int auctionProtocol, double durationOfAuction)throws Exception { super(auctionName, auctionProtocol); this.durationOfAuction = durationOfAuction; } One event will be scheduled to be received by the Auction entity after the duration provided. When that event is received, the DoubleAuction, for example, calls the closeAuction() method. You can extend DoubleAuction and implement the closeAuction() method that suits you. I am attaching an example of double auction that only receives asks and bids, puts them in lists and implements the closeAuction() method. It does nothing at the moment, but you can see where your code should be inserted. Please let me know if you face any other problem. Regards, Marcos  On 15/07/2008, at 5:45 PM, Mehtab Arif wrote: > Hi, Marcos > > i have a problem ,if you help me. " i sends bids and asks to > auctioneer,then i recieved bids and asks from onRecieve funtions > and satisfy some conditions. and get the results, but i want to > set time on auctioneer like 100 sec to recieve ask and bid and > send final price. and start the auction again". > > > > thanx > Mehtab > > Get news, entertainment and everything you care about at Live.com. > Check it out! Marcos Dias de Assuncao Grid Computing and Distributed Systems (GRIDS) Laboratory Department of Computer Science and Software Engineering The University of Melbourne, Australia Email: ma...@cs... ------------- "I sincerely believe the banking institutions having the issuing power of money are more dangerous to liberty than standing armies" Thomas Jefferson |