GridSim
v4.0

gridsim.auction
Class ContinuousDoubleAuction

Object
  extended byThread
      extended byeduni.simjava.Sim_entity
          extended bygridsim.GridSimCore
              extended bygridsim.GridSim
                  extended bygridsim.auction.Auction
                      extended bygridsim.auction.DoubleAuction
                          extended bygridsim.auction.ContinuousDoubleAuction
All Implemented Interfaces:
Cloneable, Runnable

public class ContinuousDoubleAuction
extends DoubleAuction

This class represents a Continuos Double Auction. In Continuous double auctions, the auctioneer matches asks and bids. The auctioneer maintains a list of asks ordered in a increasing order and a list of bids ordered in an decreasing order. When the auctioneer receives an ask it proceeds as follows: 1. It compares it with the first bid of the list. If the price in the ask is lower than or equal to the bid’s value, it informs that seller and bidder can trade at the price (price ask + price bid) / 2) 2. Otherwise, the auctioneer adds the ask in the list. If the auctioneer receives a bid, it does the following: 1. It compares it with the first ask of the list. If the price in the ask is lower than or equal to the bid’s value, it informs that seller and bidder can trade at the price (price ask + price bid) / 2). 2. Otherwise, the auctioneer adds the bid in the list.

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

Nested Class Summary
(package private)  class ContinuousDoubleAuction.OrderAsksByPriceAsc
           
(package private)  class ContinuousDoubleAuction.OrderBidsByPriceDesc
           
 
Field Summary
 
Fields inherited from class gridsim.auction.Auction
outputPort
 
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
ContinuousDoubleAuction(String auctionName, double durationOfAuction)
          Constructor
ContinuousDoubleAuction(String auctionName, int auctioneerID, double durationOfAuction, Sim_port output)
          Constructor
 
Method Summary
 void onReceiveAsk(MessageAsk ask)
          Called when a ask is sent by a provider.
 void onReceiveBid(MessageBid bid)
          Called when a bid is received.
 void onStart()
          This method is called when the auction is started
 void onStop()
          Called when the auction finishes
 
Methods inherited from class gridsim.auction.DoubleAuction
closeAuction, getDurationOfAuction, match, processEvent, processOtherEvent, startAuction
 
Methods inherited from class gridsim.auction.Auction
body, broadcastMessage, getAttribute, getAttributes, getAuctioneerID, getAuctionID, getAuctionProtocol, getBidders, getOutputPort, getStartingTime, setAttribute, setAuctioneerID, setAuctionProtocol, setBidders, setOutputPort, setStartingTime
 
Methods inherited from class gridsim.GridSim
clock, Clock, getAdvancedReservationList, getEntityId, GetEntityId, getEntityName, GetEntityName, getEntityName, GetEntityName, getEntityName, getGISId, getGridInfoServiceEntityId, getGridResourceList, GetGridResourceList, getGridSimShutdownEntityId, getGridStatisticsEntityId, getNumFreePE, getNumFreePE, getNumPE, getNumPE, getResourceCharacteristics, GetResourceCharacteristics, getResourceDynamicInfo, GetResourceDynamicInformation, getSimulationCalendar, getSimulationStartDate, GetSimulationStartDate, GridInformationServiceEntityId, gridletCancel, gridletCancel, gridletMove, gridletMove, gridletPause, gridletPause, gridletReceive, GridletReceive, gridletReceive, gridletReceive, gridletResume, gridletResume, gridletStatus, gridletStatus, gridletSubmit, GridletSubmit, gridletSubmit, gridletSubmit, gridSimHold, GridSimHold, GridSimShutdownEntityId, GridStatisticsEntityId, init, init, init, Init, isResourceExist, isResourceExist, receiveEventObject, ReceiveEventObject, receiveEventObject, ReceiveEventObject, recordStatistics, RecordStatistics, recordStatistics, RecordStatistics, recordStatistics, RecordStatistics, recordStatistics, RecordStatistics, resourceSupportAR, resourceSupportAR, setGIS, shutdownGridStatisticsEntity, ShutdownGridStatisticsEntity, shutdownUserEntity, ShutdownUserEntity, Start, startGridSimulation, Stop, stopGridSimulation
 
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
 

Constructor Detail

ContinuousDoubleAuction

public ContinuousDoubleAuction(String auctionName,
                               int auctioneerID,
                               double durationOfAuction,
                               Sim_port output)
                        throws Exception
Constructor

Parameters:
auctionName - name for the auction
auctioneerID - auctioneer's ID
durationOfAuction - time duration of auction
output - the output port to be used by this auction
Throws:
Exception

ContinuousDoubleAuction

public ContinuousDoubleAuction(String auctionName,
                               double durationOfAuction)
                        throws Exception
Constructor

Parameters:
auctionName - name for the auction
durationOfAuction - time duration of auction
Throws:
Exception
Method Detail

onStart

public void onStart()
This method is called when the auction is started

Specified by:
onStart in class DoubleAuction

onStop

public void onStop()
Called when the auction finishes

Specified by:
onStop in class DoubleAuction

onReceiveAsk

public void onReceiveAsk(MessageAsk ask)
Called when a ask is sent by a provider.

Specified by:
onReceiveAsk in class DoubleAuction
Parameters:
ask - the ask sent by the provider

onReceiveBid

public void onReceiveBid(MessageBid bid)
Called when a bid is received.

Specified by:
onReceiveBid in class DoubleAuction
Parameters:
bid - the bid received by the auctioneer

GridSim
v4.0

The University of Melbourne, Australia, 2006