|
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.LocalSpecRouter
public class LocalSpecRouter
This router implements the local-specialist policy which
tries to assign contacts to agents in the same region and
prefers specialists to preserve generalists.
This router associates a region identifier with each
contact type and agent group.
The originating region of a contact is determined by
the region identifier associated with its type.
The location of agents in an agent group is determined
by the region identifier associated with the agent group.
This policy is similar to agents' preference-based routing, but
it adds a region tie breaker and the rank
(i, k) can be considered as
a measurement of the specialty of agents in group i in serving
contacts of type k. Often,
(k, i) =
(i, k).
When a new contact arrives, the router applies the same agent selection scheme as the agents' preference-based router, except that only agent groups within the originating region of the contact are accepted as candidates. If the contact cannot be served locally, it is added to a waiting queue corresponding to its type. After the contact spent a certain time in queue, called the overflow delay, the router tries to perform a new agent selection, this time allowing local and remote agents to serve the contact. If the contact can be served remotely, it is removed from the waiting queue before service starts. Otherwise, it stays in queue.
When an agent becomes free, the same contact selection scheme as with the agents' preference-based router is applied, except that a contact can be pulled from a waiting queue only if its originating region is the same as the location of the free agent. In other words, the local waiting queues are queried first. If, after this first pass, the agent is still free, the router performs a second pass which proceeds the same way as agents' preference-based, except that a contact can be pulled from a waiting queue only if it is in the same region as the free agent, or its waiting time is greater than the overflow delay.
Often,
(i, k) = s(i) for each k corresponding to a contact type
the agents in group i can serve, and
(k, i) =
(i, k).
The function s(i) is the skill count
for agent group i, i.e., the number of contact types
agents in group i can serve.
An agent in group i1 is more specialist
than an agent in group i2 if
s(i1) < s(i2).
With this format of matrix,
if an agent becomes free, local waiting queues are queried first
and the contact with the longest weighted waiting time is pulled.
Moreover, if weights
(i, k) are all set to 1 (the default),
only the location of the free agent induces priority for
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 | |
---|---|
LocalSpecRouter(int[] typeRegion,
int[] groupRegion,
double overflowDelay,
double[][] ranksGT)
Constructs a local-specialist router with contact type region identifiers typeRegion, agent group region identifiers groupRegion, overflow delay overflowDelay, and contact selection ranks matrix ranksGT. |
|
LocalSpecRouter(int[] typeRegion,
int[] groupRegion,
double overflowDelay,
double[][] ranksTG,
double[][] ranksGT)
Constructs a local-specialist router with contact type region identifiers typeRegion, agent group region identifiers groupRegion, overflow delay overflowDelay, agent selection ranks matrix ranksTG, and contact selection ranks matrix ranksGT. |
|
LocalSpecRouter(int[] typeRegion,
int[] groupRegion,
double overflowDelay,
double[][] ranksTG,
double[][] ranksGT,
double[][] weightsTG,
double[][] weightsGT)
Constructs a local-specialist router with contact type region identifiers typeRegion, agent group region identifiers groupRegion, overflow delay overflowDelay, agent selection ranks matrix ranksTG, and contact selection ranks matrix ranksGT. |
|
LocalSpecRouter(int[] typeRegion,
int[] groupRegion,
double overflowDelay,
int[] skillCounts,
boolean[][] m)
Constructs a local-specialist router with contact type region identifiers typeRegion, agent group region groupRegion, overflow delay overflowDelay, skill counts skillCounts, and incidence matrix m. |
Method Summary | |
---|---|
protected boolean |
checkFreeAgents(AgentGroup group,
Agent agent)
This method is called when the agent agent in agent group group becomes free. |
String |
getDescription()
|
int |
getGroupRegion(int i)
Returns the region identifier for agent group i. |
int[][] |
getGroupToTypeMap()
Computes a group-to-type map from the ranks matrix by calling RoutingTableUtils.getGroupToTypeMap(double[][],int[],int[]) , and
returns the result. |
double |
getOverflowDelay()
Returns the current overflow delay for this router. |
protected double |
getReroutingDelay(DequeueEvent dqEv,
int numReroutings)
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 double |
getScoreForContactSelection(AgentGroup group,
DequeueEvent ev)
Returns the score for the association between the agent group group and the queued contact represented by ev. |
int |
getTypeRegion(int k)
Returns the region identifier for contact type k. |
int[][] |
getTypeToGroupMap()
Computes a type-to-group map from the ranks matrix by calling RoutingTableUtils.getTypeToGroupMap(double[][],int[],int[]) , and
returns the result. |
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 numReroutings)
Selects an agent for serving a queued contact in the context of rerouting. |
void |
setGroupRegion(int i,
int r)
Sets the region identifier for agent group i to r. |
void |
setOverflowDelay(double overflowDelay)
Sets the overflow delay to overflowDelay. |
void |
setTypeRegion(int k,
int r)
Sets the region identifier for contact type k to r. |
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, getRankForAgentSelection, getRankForContactSelection, getRankGT, getRanksGT, getRanksTG, getRankTG, getStreamAgentSelection, getStreamContactSelection, getWaitingQueueType, getWeightGT, getWeightsGT, getWeightsTG, getWeightTG, needsDetailedAgentGroup, selectAgent, selectContact, selectWaitingQueue, 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 LocalSpecRouter(int[] typeRegion, int[] groupRegion, double overflowDelay, int[] skillCounts, boolean[][] m)
typeRegion
- the contact type region identifiers.groupRegion
- the agent group region identifiers.overflowDelay
- the delay before overflow is allowed.skillCounts
- the number of skills for each agent group.m
- the incidence matrix.
NullPointerException
- if typeRegion, groupRegion,
or m are null.
IllegalArgumentException
- if the overflow delay is negative
or the incidence matrix is non rectangular.public LocalSpecRouter(int[] typeRegion, int[] groupRegion, double overflowDelay, double[][] ranksGT)
typeRegion
- the contact type region identifiers.groupRegion
- the agent group region identifiers.overflowDelay
- the delay before overflow is allowed.ranksGT
- the matrix giving the
NullPointerException
- if typeRegion, groupRegion,
or ranks are null.
IllegalArgumentException
- if the overflow delay is negative.public LocalSpecRouter(int[] typeRegion, int[] groupRegion, double overflowDelay, double[][] ranksTG, double[][] ranksGT)
typeRegion
- the contact type region identifiers.groupRegion
- the agent group region identifiers.overflowDelay
- the delay before overflow is allowed.ranksTG
- the matrix giving the
ranksGT
- the matrix giving the
NullPointerException
- if typeRegion, groupRegion,
or ranks are null.
IllegalArgumentException
- if the overflow delay is negative.public LocalSpecRouter(int[] typeRegion, int[] groupRegion, double overflowDelay, double[][] ranksTG, double[][] ranksGT, double[][] weightsTG, double[][] weightsGT)
typeRegion
- the contact type region identifiers.groupRegion
- the agent group region identifiers.overflowDelay
- the delay before overflow is allowed.ranksTG
- the matrix giving the
ranksGT
- the matrix giving the
weightsTG
- the weights matrix defining
weightsGT
- the weights matrix defining
NullPointerException
- if typeRegion, groupRegion,
ranks or weights matrices are null.
IllegalArgumentException
- if the overflow delay is negative.Method Detail |
---|
public double getOverflowDelay()
public void setOverflowDelay(double overflowDelay)
overflowDelay
- the new overflow delay.
IllegalArgumentException
- if the overflow delay is negative.public int getTypeRegion(int k)
k
- the contact type identifier.
ArrayIndexOutOfBoundsException
- if k is negative
or greater than or equal to the number of contact types.public void setTypeRegion(int k, int r)
k
- the contact type identifier.r
- the new region identifier.
ArrayIndexOutOfBoundsException
- if k is negative
or greater than or equal to the number of contact types.public int getGroupRegion(int i)
i
- the agent group identifier.
ArrayIndexOutOfBoundsException
- if i is negative
or greater than or equal to the number of agent groups.public void setGroupRegion(int i, int r)
i
- the agent group identifier.r
- the new region identifier.
ArrayIndexOutOfBoundsException
- if i is negative
or greater than or equal to the number of agent groups.public int[][] getTypeToGroupMap()
RoutingTableUtils.getTypeToGroupMap(double[][],int[],int[])
, and
returns the result.
getTypeToGroupMap
in class AgentsPrefRouter
public int[][] getGroupToTypeMap()
RoutingTableUtils.getGroupToTypeMap(double[][],int[],int[])
, and
returns the result.
getGroupToTypeMap
in class AgentsPrefRouter
protected EndServiceEvent selectAgent(Contact ct)
Router
selectAgent
in class AgentsPrefRouter
ct
- the contact being routed to an agent.
protected EndServiceEvent selectAgent(DequeueEvent dqEv, int numReroutings)
Router
selectAgent
in class Router
dqEv
- the dequeue event representing the queued contact.numReroutings
- the number of preceding reroutings.
protected double getReroutingDelay(DequeueEvent dqEv, int numReroutings)
Router
Double.POSITIVE_INFINITY
.
getReroutingDelay
in class Router
dqEv
- the dequeue event representing the queued contact.numReroutings
- the number of reroutings so far.
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 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 getScoreForContactSelection(AgentGroup group, DequeueEvent ev)
AgentsPrefRouter
By default, this returns a score depending on the return value of
AgentsPrefRouter.getContactSelectionScore()
. This can return the weighted waiting
time (the default), the weighted number of queued agents, or the weight
only. See ContactSelectionScore
for more information.
getScoreForContactSelection
in class AgentsPrefRouter
group
- the agent group to which pulled contacts would be assigned.ev
- the dequeue event.
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 |