ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters.expdelay
Class LastWaitingTimePredictor

java.lang.Object
  extended by umontreal.iro.lecuyer.contactcenters.expdelay.LastWaitingTimePredictor
All Implemented Interfaces:
WaitingTimePredictor
Direct Known Subclasses:
LastWaitingTimePerQueuePredictor, MeanNLastWaitingTimePredictor

public class LastWaitingTimePredictor
extends Object
implements WaitingTimePredictor

Waiting time predictor using the waiting time of the last contact beginning service as a prediction for the waiting time. This predictor monitors every waiting queue attached to the associated router, and stores the last observed waiting time. This waiting time is returned each time a prediction is requested. One can decide if the collected waiting times include times before abandonment, and time before service, using methods setCollectingAbandonment(boolean), and setCollectingService(boolean), respectively. By default, only the waiting times before service are collected.


Constructor Summary
LastWaitingTimePredictor()
           
 
Method Summary
protected  void dequeued(DequeueEvent ev)
           
 Router getRouter()
          Returns a reference to the router associated with this predictor.
 double getWaitingTime(Contact contact)
          Returns a prediction of the waiting time of contact contact waiting in any queue.
 double getWaitingTime(Contact contact, WaitingQueue queue)
          Returns a prediction of the waiting time for the given contact contact conditional on the contact joining the waiting queue queue.
 void init()
          Resets any internal variable of this predictor.
 boolean isCollectingAbandonment()
          Determines if the collected waiting times for predictions include times before abandonment.
 boolean isCollectingService()
          Determines if the collected waiting times for predictions include times before service.
 void setCollectingAbandonment(boolean collectingAbandonment)
          Sets the flag for collecting abandonment to collectingAbandonment.
 void setCollectingService(boolean collectingService)
          Sets the flag for collecting service to collectingService.
 void setRouter(Router newRouter)
          Sets the router associated with this predictor to router.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LastWaitingTimePredictor

public LastWaitingTimePredictor()
Method Detail

getRouter

public Router getRouter()
Description copied from interface: WaitingTimePredictor
Returns a reference to the router associated with this predictor. By default, this returns null since no router is bound to a newly-constructed predictor. A router is associated with a predictor using the WaitingTimePredictor.setRouter(Router) method.

Specified by:
getRouter in interface WaitingTimePredictor
Returns:
a reference to the currently associated router.

getWaitingTime

public double getWaitingTime(Contact contact)
Description copied from interface: WaitingTimePredictor
Returns a prediction of the waiting time of contact contact waiting in any queue. This method returns Double.NaN if it cannot make a prediction for the given contact.

Specified by:
getWaitingTime in interface WaitingTimePredictor
Parameters:
contact - the contact for which we need a prediction.
Returns:
the global waiting time.

getWaitingTime

public double getWaitingTime(Contact contact,
                             WaitingQueue queue)
Description copied from interface: WaitingTimePredictor
Returns a prediction of the waiting time for the given contact contact conditional on the contact joining the waiting queue queue. This method returns Double.NaN if it cannot make a prediction for the given contact, or the given waiting queue.

Specified by:
getWaitingTime in interface WaitingTimePredictor
Parameters:
contact - the contact for which a delay is predicted.
queue - the target waiting queue.
Returns:
the predicted delay.

init

public void init()
Description copied from interface: WaitingTimePredictor
Resets any internal variable of this predictor.

Specified by:
init in interface WaitingTimePredictor

setRouter

public void setRouter(Router newRouter)
Description copied from interface: WaitingTimePredictor
Sets the router associated with this predictor to router. When router is non-null, this method can also register any listener required to make the predictions. If the router associated with a predictor is changed, the predictor should unregister any listener associated with the previous router.

Specified by:
setRouter in interface WaitingTimePredictor
Parameters:
newRouter - the new router.

dequeued

protected void dequeued(DequeueEvent ev)

isCollectingAbandonment

public boolean isCollectingAbandonment()
Determines if the collected waiting times for predictions include times before abandonment. By default, this is set to false.

Returns:
true if and only if times of abandonment are used for predicting waiting times.

setCollectingAbandonment

public void setCollectingAbandonment(boolean collectingAbandonment)
Sets the flag for collecting abandonment to collectingAbandonment.

Parameters:
collectingAbandonment - the new value of the flag.
See Also:
isCollectingAbandonment()

isCollectingService

public boolean isCollectingService()
Determines if the collected waiting times for predictions include times before service. By default, this is set to true.

Returns:
true if and only if times of beginning of service are used for predicting waiting times.

setCollectingService

public void setCollectingService(boolean collectingService)
Sets the flag for collecting service to collectingService.

Parameters:
collectingService - the new value of the flag.
See Also:
isCollectingService()

ContactCenters
V. 0.9.9.

To submit a bug or ask questions, send an e-mail to Richard Simard.