|
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.QueueAtLastGroupRouter
public class QueueAtLastGroupRouter
This router uses a queue-at-last-group policy. When a new contact of type k arrives, the serving agent is selected the same way as with queue priority routing policy: each agent group ik, 0, ik, 1,… of the type-to-group map is tested to find a free agent. However, if no agent can serve the contact, the contact is put into a waiting queue associated with the last agent group in the ordered list rather than the contact type. As usual, if the router's queue capacity is exceeded, the contact is blocked. When an agent requests a new contact to be served, it looks into its associated waiting queue only. If no contact is available in that queue, the agent remains free. The loss-delay approximation, presented in [2], assumes that the contact center uses this policy.
Field Summary | |
---|---|
static int |
DELAY
Agent group is a delay station; see isDelay(int, int) . |
static int |
LOSS
Agent group is a loss station; see isLoss(int, int) . |
static int |
LOSSDELAY
Agent group is a loss and delay station. |
static int |
NONE
Agent group which is neither loss nor delay. |
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 | |
---|---|
QueueAtLastGroupRouter(int numGroups,
int[][] typeToGroupMap)
Constructs a new queue at last group router with a type-to-group map typeToGroupMap. |
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 |
formatTypeToGroupMap()
Calls RoutingTableUtils.formatTypeToGroupMap(int[][])
with the type-to-group map associated with this
router. |
int |
getAgentGroupType(int i)
Returns the type of the agent group i regarding all contact types. |
int |
getAgentGroupType(int k,
int i)
Determines the type of agent group i for contacts of type k. |
String |
getDescription()
|
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. |
boolean |
isDelay(int k,
int i)
Determines if the agent group i is a delay station regarding the contact type k, i.e., it queues contacts of type k if it cannot serve them immediately. |
boolean |
isLoss(int k,
int i)
Determines if the agent group i is a loss station regarding the contact type k, i.e., it forwards contacts of type k it cannot serve immediately to other agent groups in the system, without queueing them. |
boolean |
isLossDelay(int i)
Determines if the agent group i is a loss/delay station, i.e., it queues some contacts it cannot serve while forwarding some other contacts to other agent groups. |
boolean |
isPureDelay(int i)
Determines if the agent group i is a pure delay station, i.e., it queues all contacts it cannot serve immediately. |
boolean |
isPureLoss(int i)
Determines if the agent group i is a pure loss station, i.e., it forwards all contacts to another agent group. |
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 |
setTypeToGroupMap(int[][] tg)
Sets the type-to-group map associated with this router to tg. |
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 |
---|
public static final int NONE
public static final int LOSS
isLoss(int, int)
.
public static final int DELAY
isDelay(int, int)
.
public static final int LOSSDELAY
protected int[][] typeToGroupMap
Constructor Detail |
---|
public QueueAtLastGroupRouter(int numGroups, int[][] typeToGroupMap)
numGroups
- the number of agent groups.typeToGroupMap
- the type-to-group map.Method Detail |
---|
public int[][] getTypeToGroupMap()
public int[] getTypeToGroupMap(int k)
k
- the index of the contact type.
public void setTypeToGroupMap(int[][] tg)
tg
- the new type-to-group map.public WaitingQueueType getWaitingQueueType()
Router
WaitingQueueType.GENERAL
must be used.
By default, this method returns WaitingQueueType.GENERAL
.
getWaitingQueueType
in class Router
public int getAgentGroupType(int k, int i)
LOSS
if the
group is a loss station, i.e., isLoss(int, int)
returns true,
DELAY
if it is a delay station (isDelay(int, int)
returns
true), and NONE
otherwise.
k
- the contact type.i
- the agent group.
IndexOutOfBoundsException
- if i or
k are negative, i is greater than or equal to
Router.getNumAgentGroups()
or k
is greater than or equal to Router.getNumContactTypes()
.public boolean isLoss(int k, int i)
k
- the contact type identifier being tested.i
- the agent group identifier being tested.
IndexOutOfBoundsException
- if i or
k are negative, i is greater than or equal to
Router.getNumAgentGroups()
or k
is greater than or equal to Router.getNumContactTypes()
.public boolean isDelay(int k, int i)
k
- the contact type identifier being tested.i
- the agent group identifier being tested.
IndexOutOfBoundsException
- if i or
k are negative, i is greater than or equal to
Router.getNumAgentGroups()
or k
is greater than or equal to Router.getNumContactTypes()
.public int getAgentGroupType(int i)
LOSS
if the group is a pure loss station
(isPureLoss(int)
returns true),
DELAY
if it is a pure delay station
(isPureDelay(int)
returns true),
LOSSDELAY
for a loss/delay station
(isLossDelay(int)
returns true),
and NONE
otherwise.
i
- the agent group being tested.
ArrayIndexOutOfBoundsException
- if i is negative
or greater than or equal to Router.getNumAgentGroups()
.public boolean isPureLoss(int i)
i
- the agent group identifier being tested.
ArrayIndexOutOfBoundsException
- if i is negative
or greater than or equal to Router.getNumAgentGroups()
.public boolean isPureDelay(int i)
i
- the agent group identifier being tested.
ArrayIndexOutOfBoundsException
- if i is negative
or greater than or equal to Router.getNumAgentGroups()
.public boolean isLossDelay(int i)
i
- the agent group identifier being tested.
ArrayIndexOutOfBoundsException
- if i is negative
or greater than or equal to Router.getNumAgentGroups()
.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 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 String formatTypeToGroupMap()
RoutingTableUtils.formatTypeToGroupMap(int[][])
with the type-to-group 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 |