|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectumontreal.iro.lecuyer.contactcenters.router.Router
umontreal.iro.lecuyer.contactcenters.router.QueuePriorityRouter
public class QueuePriorityRouter
This skill-based router with queue priority ranking is based on the routing heuristic in [14], extended to support queueing. When a contact arrives to the router, an ordered list (the type-to-group map) is used to determine which agent groups are able to serve it, and the order in which they are checked. If agent group ik, 0 contains at least one free agent, this agent serves the contact. Otherwise, the router tries to test agent groups ik, 1, ik, 2, etc. until a free agent is found, or the list of agent groups is exhausted. In other words, the contact overflows from one agent group to another. If no agent group in the ordered list associated with the contact's type is able to serve the contact, the contact is inserted into a waiting queue corresponding to its type unless the queue is full. If the total queueing capacity of the router is exceeded, the contact is blocked.
When an agent becomes free, it uses another ordered list (the group-to-type map) to determine which types of contacts it can serve. If the queue containing contacts of type ki, 0 is non-empty, the first contact, i.e., the contact of type ki, 0 with the longest waiting time, is removed and handled to the free agent. Otherwise, the queues containing contacts of types ki, 1, ki, 2, etc. are queried similarly for contacts to be served. If no contact is available in any accessible waiting queue, the agent stays free. The router behaves as if a priority queue was associated with each agent group, implementing priorities by using several FIFO waiting queues.
This router should be used only when the type-to-group and group-to-type maps are specified as input data. If one table has to be generated from the other one, the induced arbitrary order of the lists can affect the performance of the contact center.
Field Summary | |
---|---|
protected int[][] |
groupToTypeMap
Contains the group-to-type map routing table. |
protected int[][] |
typeToGroupMap
Contains the type-to-group map routing table. |
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 | |
---|---|
QueuePriorityRouter(int[][] typeToGroupMap,
int[][] groupToTypeMap)
Constructs a new queue priority router with a type-to-group map typeToGroupMap, and a group-to-type map groupToTypeMap. |
Method Summary | |
---|---|
boolean |
canServe(int i,
int k)
Returns true if and only if some agents in group i are authorized to serve contacts of type k by this router. |
protected boolean |
checkFreeAgents(AgentGroup group,
Agent agent)
This method is called when the agent agent in agent group group becomes free. |
protected void |
checkWaitingQueues(AgentGroup group)
This default implementation is suitable only for routers specifying a type-to-group and a group-to-type map and using one waiting queue for each contact type. |
String |
formatGroupToTypeMap()
Calls RoutingTableUtils.formatGroupToTypeMap(int[][])
with the group-to-type map associated with this
router. |
String |
formatTypeToGroupMap()
Calls RoutingTableUtils.formatTypeToGroupMap(int[][])
with the type-to-group map associated with this
router. |
String |
getDescription()
|
int[][] |
getGroupToTypeMap()
Returns the group-to-type map associated with this router. |
int[] |
getGroupToTypeMap(int i)
Returns the ordered list concerning agent group i in the group-to-type map. |
int[][] |
getTypeToGroupMap()
Returns the type-to-group map associated with this router. |
int[] |
getTypeToGroupMap(int k)
Returns the ordered list concerning contact type k in the type-to-group map. |
WaitingQueueType |
getWaitingQueueType()
Returns an indicator describing how the implemented routing policies organizes waiting queues. |
protected EndServiceEvent |
selectAgent(Contact ct)
Begins the service of the contact contact by trying to assign it a free agent. |
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. |
protected DequeueEvent |
selectWaitingQueue(Contact ct)
Selects a waiting queue and puts the contact contact into it. |
void |
setRoutingTable(int[][] typeToGroupMap,
int[][] groupToTypeMap)
Changes the routing table for this router. |
String |
toLongString()
Returns a string representation of detailed information about the router. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int[][] typeToGroupMap
protected int[][] groupToTypeMap
Constructor Detail |
---|
public QueuePriorityRouter(int[][] typeToGroupMap, int[][] groupToTypeMap)
typeToGroupMap
- the type-to-group map.groupToTypeMap
- the group-to-type map.Method Detail |
---|
public int[][] getTypeToGroupMap()
public int[] getTypeToGroupMap(int k)
k
- the index of the contact type.
public int[][] getGroupToTypeMap()
public int[] getGroupToTypeMap(int i)
i
- the index of the agent group.
public void setRoutingTable(int[][] typeToGroupMap, int[][] groupToTypeMap)
typeToGroupMap
- the type-to-group map.groupToTypeMap
- the group-to-type map.
IllegalArgumentException
- if the type-to-group map
does not contain K rows, or the group-to-type map does not
contain I rows.public WaitingQueueType getWaitingQueueType()
Router
WaitingQueueType.GENERAL
must be used.
By default, this method returns WaitingQueueType.GENERAL
.
getWaitingQueueType
in class Router
public boolean canServe(int i, int k)
Router
canServe
in class Router
i
- the agent group index.k
- the contact type index.
protected EndServiceEvent selectAgent(Contact ct)
Router
selectAgent
in class Router
ct
- the contact being routed to an agent.
protected DequeueEvent selectWaitingQueue(Contact ct)
Router
selectWaitingQueue
in class Router
ct
- the contact being queued.
protected DequeueEvent selectContact(AgentGroup group, Agent agent)
Router
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.
selectContact
in class Router
group
- the affected agent group.agent
- the agent having ended its service.
protected boolean checkFreeAgents(AgentGroup group, Agent agent)
Router
Router.DEQUEUETYPE_BEGINSERVICE
before
they are transferred to agents.
The method returns true if and only if at least one
free agent could be made busy.
The default implementation calls Router.selectContact(AgentGroup,Agent)
to get a new
dequeue event representing the
removed contact, extracts the contact,
and routes it to an agent, until group has no
more free agent.
checkFreeAgents
in class Router
group
- the affected agent group.agent
- the agent having ended its service.
protected void checkWaitingQueues(AgentGroup group)
checkWaitingQueues
in class Router
group
- the agent group with no more agents.public String formatTypeToGroupMap()
RoutingTableUtils.formatTypeToGroupMap(int[][])
with the type-to-group map associated with this
router.
public String formatGroupToTypeMap()
RoutingTableUtils.formatGroupToTypeMap(int[][])
with the group-to-type map associated with this
router.
public String getDescription()
getDescription
in class Router
public String toLongString()
Router
Router.toString()
should be used.
toLongString
in class Router
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |