|
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.ExpDelayRouter
public class ExpDelayRouter
Represents a router using the expected delay to assign agent groups to new contacts. When a contact is routed to an agent group, it is assigned a free agent of this particular group. If all agents in the target group are busy, the contact enters a waiting queue specific to the target agent group. The contact cannot move across waiting queues.
A waiting queue is associated with each
agent group i.
When a new contact of type k arrives,
the router uses the weighted expected delays
Ei(t)/(k, i) for each waiting queue to
take its decisions.
Here, Ei(t) is a prediction of the waiting time
for the new contact arrived at time t
if sent to queue i while
(k, i) is a user-defined constant weight
determining the importance of contacts of type k
for agents in group i.
Two decision modes are available: deterministic, or stochastic.
In deterministic mode, the router chooses the
agent group with the minimal weighted expected delay.
In stochastic mode, the router chooses agent group
i with probability
Note that the routing of a contact of type k to an agent
in group i can be prevented by
fixing
(k, i) = 0.
Increasing
(k, i) increases the probability of
a contact of type k to be routed to an agent
in group i.
The expected delay is estimated using a
waiting time predictor.
The default predictor is the
LastWaitingTimePerQueuePredictor
which
predicts the waiting time using the last observed
waiting time before a service.
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 | |
---|---|
ExpDelayRouter(double[][] weightsTG,
RandomStream stream)
Constructs a new router using expected delays, with a weights matrix weightsTG, a random stream stream. |
|
ExpDelayRouter(double[][] weightsTG,
RandomStream stream,
WaitingTimePredictor pred)
Equivalent to ExpDelayRouter(double[][],RandomStream)
with a user-defined waiting time predictor pred. |
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. |
String |
getDescription()
|
RandomStream |
getStreamAgentSelection()
Returns the random stream used for agent selection. |
WaitingQueueType |
getWaitingQueueType()
Returns an indicator describing how the implemented routing policies organizes waiting queues. |
double[][] |
getWeightsTG()
Returns the weights matrix defining ![]() |
void |
init()
This method is called at the beginning of the simulation to reset the state of this router. |
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 |
setStreamAgentSelection(RandomStream streamAgentSelection)
Sets the random stream for agent selection to streamAgentSelection. |
void |
setWeightsTG(double[][] weightsTG)
Sets the weights matrix defining ![]() |
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 ExpDelayRouter(double[][] weightsTG, RandomStream stream)
weightsTG
- the weights matrix.stream
- the random stream used in stochastic mode.public ExpDelayRouter(double[][] weightsTG, RandomStream stream, WaitingTimePredictor pred)
ExpDelayRouter(double[][],RandomStream)
with a user-defined waiting time predictor pred.
weightsTG
- the weights matrix.stream
- the random stream used in stochastic mode.pred
- the waiting time predictor.Method Detail |
---|
public WaitingQueueType getWaitingQueueType()
Router
WaitingQueueType.GENERAL
must be used.
By default, this method returns WaitingQueueType.GENERAL
.
getWaitingQueueType
in class Router
public double[][] getWeightsTG()
public void setWeightsTG(double[][] weightsTG)
weightsTG
- the new weights matrix defining
NullPointerException
- if weightsTG is null.
IllegalArgumentException
- if weightsTG is not rectangular or has wrong
dimensions.public RandomStream getStreamAgentSelection()
public void setStreamAgentSelection(RandomStream streamAgentSelection)
streamAgentSelection
- the new random stream for agent selection.public void init()
Router
init
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 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 |