ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters.router
Class LongestQueueFirstRouter

java.lang.Object
  extended by umontreal.iro.lecuyer.contactcenters.router.Router
      extended by umontreal.iro.lecuyer.contactcenters.router.QueuePriorityRouter
          extended by umontreal.iro.lecuyer.contactcenters.router.LongestQueueFirstRouter
All Implemented Interfaces:
NewContactListener

public class LongestQueueFirstRouter
extends QueuePriorityRouter

This extends the queue priority router to select contacts in the longest waiting queue. When a contact arrives into the router, the same scheme for agent group selection as with the queue priority router is used. However, when an agent becomes free, instead of using the group-to-type map to determine the order in which the queues are queried, all queues authorized by the group-to-type map are considered, and a contact is removed from the longest one. If more than one queue has the same maximal size, the contact is removed from the first queue in the ordered list given by the group-to-type map.


Field Summary
 
Fields inherited from class umontreal.iro.lecuyer.contactcenters.router.QueuePriorityRouter
groupToTypeMap, typeToGroupMap
 
Fields inherited from class umontreal.iro.lecuyer.contactcenters.router.Router
BLOCKTYPE_CANTQUEUE, BLOCKTYPE_NOLINE, BLOCKTYPE_QUEUEFULL, DEQUEUETYPE_BEGINSERVICE, DEQUEUETYPE_FANTOM, DEQUEUETYPE_NOAGENT, DEQUEUETYPE_TRANSFER, dqTypeRet
 
Constructor Summary
LongestQueueFirstRouter(int[][] typeToGroupMap, int[][] groupToTypeMap)
          Constructs a new longest-queue-first router with a type-to-group map typeToGroupMap and a group-to-type map groupToTypeMap.
 
Method Summary
 String getDescription()
           
protected  DequeueEvent selectContact(AgentGroup group, Agent agent)
          Returns a dequeue event representing a queued contact to be served by the agent agent in agent group group.
 
Methods inherited from class umontreal.iro.lecuyer.contactcenters.router.QueuePriorityRouter
canServe, checkFreeAgents, checkWaitingQueues, formatGroupToTypeMap, formatTypeToGroupMap, getGroupToTypeMap, getGroupToTypeMap, getTypeToGroupMap, getTypeToGroupMap, getWaitingQueueType, selectAgent, selectWaitingQueue, setRoutingTable, toLongString
 
Methods inherited from class umontreal.iro.lecuyer.contactcenters.router.Router
addExitedContactListener, agentReroutingEventsIterator, beginService, clearExitedContactListeners, contactReroutingEventsIterator, dequeued, endContact, endService, enqueued, exitBlocked, exitDequeued, exitServed, formatAgentGroups, formatWaitingQueues, getAgentGroup, getAgentGroupListener, getAgentGroups, getAgentReroutingEvents, getContactFactory, getContactReroutingEvents, getCurrentQueueSize, getDialers, getExitedContactListeners, getNeededWaitingQueueComparator, getNeededWaitingQueueStructure, getNumAgentGroups, getNumContactTypes, getNumWaitingQueues, getReroutingDelay, getReroutingDelay, getTotalQueueCapacity, getWaitingQueue, getWaitingQueueListener, getWaitingQueues, init, isKeepingReroutingEvents, mustClearWaitingQueue, needsDetailedAgentGroup, newContact, notifyBlocked, notifyDequeued, notifyServed, removeExitedContactListener, restore, save, selectAgent, selectContact, selectWaitingQueue, setAgentGroup, setClearWaitingQueue, setClearWaitingQueues, setContactFactory, setKeepingReroutingEvents, setTotalQueueCapacity, setWaitingQueue, startDialers, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LongestQueueFirstRouter

public LongestQueueFirstRouter(int[][] typeToGroupMap,
                               int[][] groupToTypeMap)
Constructs a new longest-queue-first router with a type-to-group map typeToGroupMap and a group-to-type map groupToTypeMap.

Parameters:
typeToGroupMap - the type-to-group map.
groupToTypeMap - the group-to-type map.
Method Detail

selectContact

protected DequeueEvent selectContact(AgentGroup group,
                                     Agent agent)
Description copied from class: Router
Returns a dequeue event representing a queued contact to be served by the agent agent in agent group group. If agent is null, the method must return a contact that can be served by any agent in the group. If no contact is available, this method returns null. The selected contacts come from waiting queues attached to the router. Before the selected contact is returned, it must be removed from its queue with dequeue type Router.DEQUEUETYPE_BEGINSERVICE, e.g., by using queue.removeFirst (DEQUEUETYPE_BEGINSERVICE), or queue.remove (ev, DEQUEUETYPE_BEGINSERVICE), etc.

Generally, it is sufficient to override this method instead of Router.checkFreeAgents(AgentGroup,Agent). One can override Router.checkFreeAgents(AgentGroup,Agent) to improve efficiency when looking for contacts in the same waiting queue. This method is not abstract and returns null by default in order to allow Router.checkFreeAgents(AgentGroup,Agent) to be overridden without implementing this method.

Overrides:
selectContact in class QueuePriorityRouter
Parameters:
group - the affected agent group.
agent - the agent having ended its service.
Returns:
the dequeue event representing the contact being selected.

getDescription

public String getDescription()
Overrides:
getDescription in class QueuePriorityRouter

ContactCenters
V. 0.9.9.

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