|
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.QueueRatioOverflowRouter
public class QueueRatioOverflowRouter
This router sends new contacts to agent groups using a
fixed list, but for each agent group, routing occurs
conditional on the expected waiting time.
More specifically, the router uses a K×I ranks matrix
giving a rank
(k, i) for each contact
type k and agent group i. The lower is this rank,
the higher is the priority of assigning contacts of type k
to agents in group i.
If a rank is ∞, the corresponding assignment
is not allowed.
The ranks matrix giving
(k, i) for all k and i is used
to generate overflow lists defined as follows.
For each contact type k, the router creates a list of agent groupsets
sharing the same priority. The jth groupset for contact type k is denoted
i(k, j) = {i = 0,…, I - 1 |
(k, i) = rk, j}. Here,
rk, j1 < rk, j2 < ∞ for any j1 < j2.
The overflow list for contact of type k is then
i(k, 0), i(k, 1),…
For example, suppose we have the following ranks matrix:
When a new contact of type k arrives, the router performs two phases to assign an agent group or waiting queues to the contact. Here, each waiting queue corresponds to a single agent group. The first phase tries to associate an agent groupset with the contact while the second phase, which occurs when the first phase fails, associates a waiting queue to the contact. The first phase checks every agent groupset i(k, j) sequentially, and stops as soon as a groupset containing a free agent is found. For each considered groupset, the router tests every agent group to determine if at least one agent is free. If a single agent is free, the contact is routed to that agent. If several agents of that groupset are free, the contact is routed to the agent with the longest idle time.
If no agent is available in the tested groupset, one or more waiting queues must be selected to add the contact to. A waiting queue i with size Qi(t) is associated with a single agent group, which has Ni(t) agents, where t is the current simulation time. The router considers waiting queues in the current groupset only, and selects a queue only if the queue ratio (Si(t) + 1)/Ni(t) is greater than the agent-group specific target. This queue ratio gives an estimate of the expected waiting time of the contact. Note that this estimate assumes that service times are exponential, and no abandonment is allowed. If no candidate waiting queue is available, e.g., all waiting queues in the groupset have a queue ratio greater than the target queue ratio, the router checks the next agent groupset.
If there are no more groupset, the router performs the second phase
as follows.
Since no groupset contains a free agent or waiting queue with a small
enough queue ratio, the router checks every authorized waiting queue,
i.e., each queue i for
which
(k, i) < ∞, and selects the waiting queue with the
smallest queue ratio.
In this phase, the queue ratio is allowed to be greater than
the target.
The queues the contact is sent to depend on two flags associated with this router: the copy and overflow modes. The copy mode determines if contacts can be queued to multiple agent groups. The overflow mode, which is used only when contacts can be added into multiple queues, can be set to transfer or promotion. In transfer mode, the contact moves from groupsets to groupsets. In promotion mode, a copy of the contact is left in every considered groupset.
More specifically, if queueing to multiple targets is disabled, the router always sends the contact to the queue with the smallest queue ratio among the considered candidates. In the first phase, these candidates are the queues in the current groupset with a queue ratio smaller than the target. In the second phase, this corresponds to all queues the contact is authorized in.
If contacts can be added to multiple queues, the overflow mode has the following effect. If candidates were found during the first phase, when checking agent groupset i(k, j), the contact is queued to all queues in that groupset when the overflow mode is transfer. However, if the overflow mode is promotion, the contact is also added to all queues in the preceding groupsets, i.e., groupsets i(k, j') for j' = 0,…, j. If the router reaches the second phase, the contact is always sent to the queue with the smallest queue ratio. In promotion mode, it is also queued to all other authorized waiting queues.
This router needs agent groups taking individual agents into account to select agents based on their longest idle times.
Field Summary |
---|
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 | |
---|---|
QueueRatioOverflowRouter(int numGroups,
double[][] ranksTG,
double[] targetQueueRatio,
boolean allowCopies,
boolean overflowTransfer)
Constructs a new queue-ratio overflow router with ranks matrix ranksTG, numGroups agent groups, and target queue ratio for contact type k set to targetQueueRatio[k]. |
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 void |
checkWaitingQueues(AgentGroup group)
This method is called when the agent group group contains no more online agents, i.e., AgentGroup.getNumAgents() returns 0. |
protected void |
dequeued(DequeueEvent ev)
This method is called when a contact leaves a waiting queue, ev representing the corresponding dequeue event. |
String |
getDescription()
|
double[][] |
getRanksTG()
Returns the ranks matrix defining how contacts prefer agents, used for agent selection. |
double[] |
getTargetQueueRatio()
Gets the target queue ratio for each contact type. |
WaitingQueueType |
getWaitingQueueType()
Returns an indicator describing how the implemented routing policies organizes waiting queues. |
boolean |
isAllowCopies()
Determines if contacts can be added to multiple queues. |
boolean |
isOverflowTransfer()
Determines if the overflow mode is transfer. |
protected EndServiceEvent |
selectAgent(Contact contact)
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 contact)
Selects a waiting queue and puts the contact contact into it. |
void |
setAllowCopies(boolean allowCopies)
Sets the allow-copies flag to allowCopies. |
void |
setOverflowTransfer(boolean overflowTransfer)
Sets the overflow mode to overflowTransfer. |
void |
setRanksTG(double[][] ranksTG)
Sets the ranks matrix defining how contacts prefer agents to ranksTG. |
void |
setTargetQueueRatio(double[] targetQueueRatio)
Sets the target queue ratio for each contact type to targetQueueRAtio. |
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 |
Constructor Detail |
---|
public QueueRatioOverflowRouter(int numGroups, double[][] ranksTG, double[] targetQueueRatio, boolean allowCopies, boolean overflowTransfer)
numGroups
- the number of agent groups.ranksTG
- the ranks matrix.targetQueueRatio
- the target queue ratio for each contact type.allowCopies
- the allow-copies flag.overflowTransfer
- the overflow-transfer flag.
NullPointerException
- if any argument is null.
IllegalArgumentException
- if the length of
targetQueueRatio does not correspond to the
number of rows in the ranks matrix.Method Detail |
---|
public double[][] getRanksTG()
public void setRanksTG(double[][] ranksTG)
ranksTG
- the new agent selection ranks matrix.
NullPointerException
- if ranksTG is null.
IllegalArgumentException
- if ranksTG is not rectangular or has wrong
dimensions.public boolean isAllowCopies()
public void setAllowCopies(boolean allowCopies)
allowCopies
- the new value of the flag.isAllowCopies()
public boolean isOverflowTransfer()
public void setOverflowTransfer(boolean overflowTransfer)
overflowTransfer
- the new overflow mode.isOverflowTransfer()
public double[] getTargetQueueRatio()
public void setTargetQueueRatio(double[] targetQueueRatio)
targetQueueRatio
- the new target queue ratios.
IllegalArgumentException
- if the length of
targetQueueRatio does not correspond to the
number of rows in the ranks matrix.public WaitingQueueType getWaitingQueueType()
Router
WaitingQueueType.GENERAL
must be used.
By default, this method returns WaitingQueueType.GENERAL
.
getWaitingQueueType
in class Router
protected void checkWaitingQueues(AgentGroup group)
Router
AgentGroup.getNumAgents()
returns 0. It must
check each waiting queue accessible for agents in this group to determine
if they need to be cleared. A queue is cleared if no agent, whether free
or busy, is available to serve any contact in it.
checkWaitingQueues
in class Router
group
- the agent group with no more agents.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 contact)
Router
selectAgent
in class Router
contact
- the contact being routed to an agent.
protected DequeueEvent selectWaitingQueue(Contact contact)
Router
selectWaitingQueue
in class Router
contact
- the contact being queued.
protected void dequeued(DequeueEvent ev)
Router
Router.exitDequeued(DequeueEvent)
.
This method should not notify an exiting contact for a 0 dequeue type
since it is reserved for queued and served contacts.
dequeued
in class Router
ev
- the dequeue event.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.
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 |