GridSim 5.0 beta

gridsim.auction
Class Auctioneer

Object
  extended by Thread
      extended by Sim_entity
          extended by GridSimCore
              extended by GridSim
                  extended by Auctioneer
All Implemented Interfaces:
Cloneable, Runnable

public abstract class Auctioneer
extends GridSim

This class defines the basic behavious of an auctioneer

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

Nested Class Summary
 
Nested classes/interfaces inherited from class Thread
Thread.State, Thread.UncaughtExceptionHandler
 
Field Summary
 
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
Auctioneer(String name)
          Constructor
Auctioneer(String name, double baudRate)
          Constructor
Auctioneer(String name, Link link)
           
 
Method Summary
 void addAuction(Auction auction)
          Adds an auction to this auctioneer
 void body()
          Handles external events that are coming to this Auctioneer entity.
protected abstract  void onAuctionClose(Auction auction)
          This method should be implemented to perform some auction after some auction has been finished.
protected abstract  void onResponseToAsk(MessageAsk ask, MessageBid bid, double price)
          This method is called when a match for an ask was found by a double auction.
protected  void processOtherEvent(Sim_event ev)
          Overrides this method when making a new and different type of auctioneer.
 void startAuction(int auctionID)
          Starts a given auction already added to the auctioneer
 
Methods inherited from class GridSim
clock, disableDebugMode, enableDebugMode, getAdvancedReservationList, getEntityId, getEntityName, getEntityName, getEntityName, getGISId, getGridInfoServiceEntityId, getGridResourceList, getGridSimShutdownEntityId, getGridStatisticsEntityId, getNetworkType, getNumFreePE, getNumFreePE, getNumPE, getNumPE, getResourceCharacteristics, getResourceDynamicInfo, getSimulationCalendar, getSimulationStartDate, getVisualizer, gridletCancel, gridletCancel, gridletMove, gridletMove, gridletPause, gridletPause, gridletReceive, gridletReceive, gridletReceive, gridletResume, gridletResume, gridletStatus, gridletStatus, gridletSubmit, gridletSubmit, gridletSubmit, gridSimHold, init, init, init, initNetworkType, isDebugModeEnabled, isResourceExist, isResourceExist, isTraceEnabled, pauseSimulation, pauseSimulation, receiveEventObject, receiveEventObject, recordStatistics, recordStatistics, recordStatistics, recordStatistics, resourceSupportAR, resourceSupportAR, resumeSimulation, setGIS, shutdownGridStatisticsEntity, shutdownUserEntity, startGridSimulation, startGridSimulation, stopGridSimulation
 
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 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, 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

Auctioneer

public Auctioneer(String name)
           throws Exception
Constructor

Parameters:
name -
Throws:
Exception

Auctioneer

public Auctioneer(String name,
                  double baudRate)
           throws Exception
Constructor

Parameters:
name -
baudRate -
Throws:
Exception

Auctioneer

public Auctioneer(String name,
                  Link link)
           throws Exception
Parameters:
name -
link -
Throws:
Exception
Method Detail

addAuction

public void addAuction(Auction auction)
Adds an auction to this auctioneer

Parameters:
auction -

startAuction

public void startAuction(int auctionID)
Starts a given auction already added to the auctioneer

Parameters:
auctionID - The auction's id

body

public void body()
Handles external events that are coming to this Auctioneer entity.

The services or tags available for this resource are:


This method also calls these methods in the following order:
  1. processOtherEvent(Sim_event) method

Overrides:
body in class Sim_entity
Pre Condition:
$none
Post Condition:
$none

processOtherEvent

protected void processOtherEvent(Sim_event ev)
Overrides this method when making a new and different type of auctioneer. This method is called by body() for incoming unknown tags.

Parameters:
ev - a Sim_event object
Pre Condition:
ev != null
Post Condition:
$none

onAuctionClose

protected abstract void onAuctionClose(Auction auction)
This method should be implemented to perform some auction after some auction has been finished. This method will be called whenever one of the auctions that were initiated by this Auctionerr has been concluded

Parameters:
auction - is the auction that has been concluded

onResponseToAsk

protected abstract void onResponseToAsk(MessageAsk ask,
                                        MessageBid bid,
                                        double price)
This method is called when a match for an ask was found by a double auction. The auction passes the ask, the bid that matches it and the price that they will use to trade

Parameters:
ask - the ask previously sent to the auctioneer
bid - the bid that matches the ask
price - the price used to trade
Post Condition:
the bid can be null if a match was not found

GridSim 5.0 beta

The University of Melbourne, Australia, 2009