|
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.AgentsPrefRouter
umontreal.iro.lecuyer.contactcenters.router.AgentsPrefRouterWithDelays
public class AgentsPrefRouterWithDelays
Extends the agents' preference-based router to support delays for routing, and allow priority to change with waiting time. Often, a contact has to wait for some time before it can overflow to groups of backup agents. Delays are used to favor the usage of primary agents as opposed to backup agents which are kept for customers which have waited long enough. The priority of a waiting contact may also change if it is waiting long enough. This router allows the user to input such delays, and to set up several different matrices of ranks for priority to be a piecewise-constant function of the waiting time.
Each extra matrix of ranks defines a function
[j](i, k) which associates a
matrix of ranks with the minimal waiting time wj. Let w0 = 0 and
[0](i, k) =
(i, k). So if no extra matrix of ranks is given, we have only
[0](i, k), the default matrix of ranks used by the agents' preference-based routing
policy without delays.
Note that fixing d (i, k) = 0 for all i and k, and omitting extra matrices of ranks reverts to the original agents' preference-based routing without delays.
Contact selection is done in a similar way as with the agents'
preference-based routing policy, except that delays d (i, k), and extra
matrices of ranks
[j](i, k) are taken into account while determining the
rank for a pair (i, k). More specifically, let Wk be the longest waiting
time among all queued contacts of type k.
First, the rank of a queued contact of type k is infinite (so the call cannot
leave the queue) if its waiting time Wk is smaller
than the delay d (i, k).
On the other hand,
if
Wk≥d (i, k), the rank is given by
[j'](i, k) where
j' =
{j : Wk≥wj} is the index of the matrix of
ranks applying to the queued contact.
If j' > 0, we check the other queued contacts of type k to
determine if another queued contact has a smaller rank, i.e., an higher priority.
For each scanned queued contact, we check the delay condition
and stop scanning as soon as
Wk < d (i, k) or j' = 0.
The default behavior of this policy can be altered by two switches: overflow transfer, and longest waiting time modes. When overflow transfer is turned ON, a contact gaining access to some agent groups after waiting some delay also loses access to the original agent groups. When longest waiting time is turned OFF, the contact selection gives priority to pairs (i, k) with small delays d (i, k).
If this option is disabled, contact selection is performed using the following multiple-passes process. When an agent in group i becomes free, it first searches for a contact whose type k satisfies d (i, k) = 0. Then, it searches for contacts for which d (i, k)≤dk, 1, for contacts for which d (i, k)≤dk, 2, etc., in that order. This gives higher priority to contacts with small minimal delay, because they can be served by a more restricted set of agents.
The latter behavior of this router is especially appropriate if delays are functions of the distance between the contact and the agent. For local contacts, d (i, k) is small, while it is large for remote contacts. The router then always gives priority to local assignments. However, it is often simpler and more intuitive to use the single-pass contact selection.
Field Summary |
---|
Fields inherited from class umontreal.iro.lecuyer.contactcenters.router.AgentsPrefRouter |
---|
bestAgent, bestGroup, bestQueue, bestQueuedContact, ranksGT, ranksTG, weightsGT, weightsTG |
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 | |
---|---|
AgentsPrefRouterWithDelays(double[][] ranksGT,
double[][] delaysGT)
Constructs a new agents' preference-based router with matrix of ranks ranksGT and delays matrix delaysGT. |
|
AgentsPrefRouterWithDelays(double[][] ranksTG,
double[][] ranksGT,
double[][] delaysGT)
Constructs a new agents' preference-based router with matrix of ranks ranksTG defining how contacts prefer agents, ranksGT defining how agents prefer contacts, and delaysGT for routing delays. |
|
AgentsPrefRouterWithDelays(double[][] ranksTG,
double[][] ranksGT,
double[][] weightsTG,
double[][] weightsGT,
double[][] delaysGT)
Constructs a new agents' preference-based router with matrix of ranks ranksTG defining how contacts prefer agents, and ranksGT defining how agents prefer contacts. |
Method Summary | |
---|---|
protected boolean |
checkFreeAgents(AgentGroup group,
Agent agent)
This method is called when the agent agent in agent group group becomes free. |
double |
getDelayGT(int i,
int k)
Returns d (i, k) for the given agent group index i, and contact type identifier k. |
double[][] |
getDelaysGT()
Returns the delays matrix used by this router. |
String |
getDescription()
|
boolean |
getLongestWaitingTimeStatus()
Returns true if the router uses a single-phase agent selection based on the longest waiting time. |
boolean |
getOverflowTransferStatus()
Returns true if the overflow transfer mode is enabled. |
protected double |
getRankForAgentSelection(int k,
int i)
Determines the rank to be used for agent selection for contact type k, and agent in group i. |
protected double |
getRankForContactSelection(int i,
int k)
Determines the rank to be used for contact selection for contact type k, when an agent in group i becomes free. |
protected double |
getReroutingDelay(DequeueEvent dqEv,
int numReroutingsDone)
Returns the delay, in simulation time units, after which a queued contact should be rerouted. |
protected double |
getScoreForAgentSelection(Contact ct,
AgentGroup testGroup,
Agent testAgent)
Returns the score for contact ct associated with agent group testGroup and agent testAgent. |
protected EndServiceEvent |
selectAgent(Contact ct)
Begins the service of the contact contact by trying to assign it a free agent. |
protected EndServiceEvent |
selectAgent(DequeueEvent dqEv,
int numReroutingsDone)
Selects an agent for serving a queued contact in the context of rerouting. |
protected void |
selectWaitingQueue(AgentGroup group,
Agent agent,
double bestRank,
boolean[] qCandidates,
int numCandidates)
Selects the queued contact for an agent agent in group group, with waiting queue candidates qCandidates. |
void |
setDelaysGT(double[][] delaysGT)
Sets the delays matrix of this router to delaysGT. |
void |
setLongestWaitingTimeStatus(boolean longestWaitingTime)
Sets the longest waiting time mode to longestWaitingTime. |
void |
setOverflowTransferStatus(boolean overflowTransfer)
Sets the overflow transfer mode to overFlowTransfer. |
void |
setRanksGT(double minWaitingTime,
double[][] ranksGT)
Sets the matrix of ranks used for selecting contacts which have waited at least minWaitingTime. |
String |
toLongString()
Returns a string representation of detailed information about the router. |
Methods inherited from class umontreal.iro.lecuyer.contactcenters.router.AgentsPrefRouter |
---|
canServe, checkWaitingQueues, getAgentSelectionScore, getContactSelectionScore, getGroupToTypeMap, getRankGT, getRanksGT, getRanksTG, getRankTG, getScoreForContactSelection, getStreamAgentSelection, getStreamContactSelection, getTypeToGroupMap, getWaitingQueueType, getWeightGT, getWeightsGT, getWeightsTG, getWeightTG, needsDetailedAgentGroup, selectAgent, selectContact, selectWaitingQueue, setAgentSelectionScore, setContactSelectionScore, setRanksGT, setRanksTG, setStreamAgentSelection, setStreamContactSelection, setWeightsGT, setWeightsTG |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public AgentsPrefRouterWithDelays(double[][] ranksGT, double[][] delaysGT)
ranksGT
- the contact selection matrix of ranks being used.delaysGT
- the delays matrix.
NullPointerException
- if ranksGT or delaysGT are null.
IllegalArgumentException
- if the ranks or delays 2D array are not rectangular.public AgentsPrefRouterWithDelays(double[][] ranksTG, double[][] ranksGT, double[][] delaysGT)
ranksTG
- the matrix of ranks defining how contacts prefer agents.ranksGT
- the matrix of ranks defining how agents prefer contacts.delaysGT
- the delays matrix.
NullPointerException
- if ranksGT, ranksTG, or delaysGT
are null.
IllegalArgumentException
- if the given 2D arrays are not rectangular.public AgentsPrefRouterWithDelays(double[][] ranksTG, double[][] ranksGT, double[][] weightsTG, double[][] weightsGT, double[][] delaysGT)
ranksTG
- the matrix of ranks defining how contacts prefer agents.ranksGT
- the matrix of ranks defining how agents prefer contacts.weightsTG
- the weights matrix defining
weightsGT
- the weights matrix defining
delaysGT
- the delays matrix.
NullPointerException
- if ranksGT, ranksTG, weightsTG,
weightsGT, or delaysGT are null.
IllegalArgumentException
- if the 2D arrays are not rectangular.Method Detail |
---|
public double[][] getDelaysGT()
public double getDelayGT(int i, int k)
i
- the queried agent group index.k
- the queried contact type identifier.
public void setDelaysGT(double[][] delaysGT)
delaysGT
- the new delays matrix.
NullPointerException
- if delaysGT is null.
IllegalArgumentException
- if delaysGT is not rectangular.public boolean getOverflowTransferStatus()
public void setOverflowTransferStatus(boolean overflowTransfer)
overflowTransfer
- the new status of the mode.getOverflowTransferStatus()
public boolean getLongestWaitingTimeStatus()
public void setLongestWaitingTimeStatus(boolean longestWaitingTime)
longestWaitingTime
- the new status of the mode.getLongestWaitingTimeStatus()
public void setRanksGT(double minWaitingTime, double[][] ranksGT)
minWaitingTime
- the minimum waiting time.ranksGT
- the matrix of ranks for this minimal waiting time.protected double getRankForContactSelection(int i, int k)
AgentsPrefRouter
getRankForContactSelection
in class AgentsPrefRouter
i
- the agent group index.k
- the contact type index.
protected void selectWaitingQueue(AgentGroup group, Agent agent, double bestRank, boolean[] qCandidates, int numCandidates)
AgentsPrefRouter
AgentsPrefRouter.bestQueue
and possibly the contact to be removed in the
AgentsPrefRouter.bestQueuedContact
. If AgentsPrefRouter.bestQueuedContact
is
null, the first contact in the best queue will be used. If no
waiting queue can be selected, AgentsPrefRouter.bestQueue
must be set to
null.
The default implementation selects the waiting queue with the greatest
score as computed by
AgentsPrefRouter.getScoreForContactSelection(AgentGroup,DequeueEvent)
, and the
best queued contact is always null. This method can be overridden
to use an alternate selection scheme, e.g., randomly selecting a queued
contact.
selectWaitingQueue
in class AgentsPrefRouter
group
- the agent group containing the free agent.agent
- the free agent.bestRank
- the best rank found when searching for candidates.qCandidates
- the waiting queue candidates contacts can be pulled from.protected double getRankForAgentSelection(int k, int i)
AgentsPrefRouter
getRankForAgentSelection
in class AgentsPrefRouter
k
- the contact type index.i
- the agent group index.
protected double getScoreForAgentSelection(Contact ct, AgentGroup testGroup, Agent testAgent)
AgentsPrefRouter
AgentsPrefRouter.selectAgent(Contact,double,boolean[],int)
method calls this method with testAgent = null if
testGroup is not an instance of DetailedAgentGroup
,
otherwise the method is called with testAgent = testGroup.getLongestIdleAgent()
.
By default, this returns a score depending on the return value of
AgentsPrefRouter.getAgentSelectionScore()
. This can return the longest weighted
idle time (the default), the weighted number of free agents, or the weight
only. See AgentSelectionScore
for more information.
getScoreForAgentSelection
in class AgentsPrefRouter
ct
- the contact being assigned an agent.testGroup
- the tested agent group.testAgent
- the tested agent, can be null.
protected double getReroutingDelay(DequeueEvent dqEv, int numReroutingsDone)
Router
Double.POSITIVE_INFINITY
.
getReroutingDelay
in class Router
dqEv
- the dequeue event representing the queued contact.numReroutingsDone
- the number of reroutings so far.
protected EndServiceEvent selectAgent(Contact ct)
Router
selectAgent
in class AgentsPrefRouter
ct
- the contact being routed to an agent.
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 EndServiceEvent selectAgent(DequeueEvent dqEv, int numReroutingsDone)
Router
selectAgent
in class Router
dqEv
- the dequeue event representing the queued contact.numReroutingsDone
- the number of preceding reroutings.
public String getDescription()
getDescription
in class AgentsPrefRouter
public String toLongString()
Router
Router.toString()
should be used.
toLongString
in class AgentsPrefRouter
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |