umontreal.iro.lecuyer.contactcenters.router
Class SingleFIFOQueueRouter
java.lang.Object
umontreal.iro.lecuyer.contactcenters.router.Router
umontreal.iro.lecuyer.contactcenters.router.QueuePriorityRouter
umontreal.iro.lecuyer.contactcenters.router.SingleFIFOQueueRouter
- All Implemented Interfaces:
- NewContactListener
public class SingleFIFOQueueRouter
- extends QueuePriorityRouter
This extends the queue priority router to implement
a single FIFO queue.
The router assumes that every attached waiting queue
uses a FIFO discipline.
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 the
contact with the longest waiting time is removed.
If more than one queue has a first contact
with the same queue time, which rarely happens in practice,
the contact is removed from the first one
in the ordered list obtained from the group-to-type map.
This policy is equivalent to but more efficient than
merging all waiting
queues, sorting the contacts in ascending
arrival times, and having the agents take the
first contact they can serve.
Constructor Summary |
SingleFIFOQueueRouter(int[][] typeToGroupMap,
int[][] groupToTypeMap)
Constructs a new single FIFO queue router with
a type-to-group map typeToGroupMap and a
group-to-type map groupToTypeMap. |
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 |
SingleFIFOQueueRouter
public SingleFIFOQueueRouter(int[][] typeToGroupMap,
int[][] groupToTypeMap)
- Constructs a new single FIFO queue 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.
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
To submit a bug or ask questions, send an e-mail to
Richard Simard.