ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters.router
Class AgentGroupSelectors

java.lang.Object
  extended by umontreal.iro.lecuyer.contactcenters.router.AgentGroupSelectors

public final class AgentGroupSelectors
extends Object

Provides some convenience methods to select an agent from a list of agent groups. All the methods provided by this class are static and return a reference to the selected agent group. If no agent group is available, they return null. They must be given an array of indices ind used to reference agent groups in the given router. One can also specify an optional array of booleans subset indicating which element in the list will be taken into account.

For each index j, let i = ind[j]. If r >= 0 and subset[j] is true if the subset is specified, the agent group Router.getAgentGroup (i) will be considered. Otherwise, i will be ignored.


Method Summary
static AgentGroup selectFirst(Router router, int[] ind)
          Equivalent to selectFirst (router, ind, null).
static AgentGroup selectFirst(Router router, int[] ind, boolean[] subset)
          Selects, from the given ordered list, the first agent group containing at least one free agent.
static AgentGroup selectGreatestFree(Router router, int[] ind)
          Equivalent to selectGreatestFree (router, ind, null).
static AgentGroup selectGreatestFree(Router router, int[] ind, boolean[] subset)
          Returns a reference to the agent group, among the groups referred to by the given list of indices, containing the greatest number of free agents.
static AgentGroup selectLast(Router router, int[] ind)
          Equivalent to selectLast (router, ind, null).
static AgentGroup selectLast(Router router, int[] ind, boolean[] subset)
          Selects, from the given ordered list, the last agent group containing at least one free agent.
static Agent selectLongestIdle(Router router, int[] ind)
          Equivalent to selectLongestIdle (router, ind, null).
static Agent selectLongestIdle(Router router, int[] ind, boolean[] subset)
          Returns the reference to the agent having the longest idle time among the agent groups indexed by the list ind and possibly restricted by subset if it is non-null.
static AgentGroup selectUniform(Router router, int[] ind, boolean[] subset, RandomStream stream)
          Returns a reference to a randomly selected agent group, among the groups referred to by the given list of indices.
static AgentGroup selectUniform(Router router, int[] ind, RandomStream stream)
          Equivalent to selectUniform (router, ind, null, stream).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

selectFirst

public static AgentGroup selectFirst(Router router,
                                     int[] ind,
                                     boolean[] subset)
Selects, from the given ordered list, the first agent group containing at least one free agent.

Parameters:
router - the router used to map indices in the ordered list to AgentGroup references.
ind - the ordered list of agent group indices.
subset - the subset of indices to take into account when traversing the given list.
Returns:
the selected agent group.

selectFirst

public static AgentGroup selectFirst(Router router,
                                     int[] ind)
Equivalent to selectFirst (router, ind, null).


selectLast

public static AgentGroup selectLast(Router router,
                                    int[] ind,
                                    boolean[] subset)
Selects, from the given ordered list, the last agent group containing at least one free agent.

Parameters:
router - the router used to map indices in the ordered list to AgentGroup references.
ind - the ordered list of agent group indices.
subset - the subset of indices to take into account when traversing the given list.
Returns:
the selected agent group.

selectLast

public static AgentGroup selectLast(Router router,
                                    int[] ind)
Equivalent to selectLast (router, ind, null).


selectGreatestFree

public static AgentGroup selectGreatestFree(Router router,
                                            int[] ind,
                                            boolean[] subset)
Returns a reference to the agent group, among the groups referred to by the given list of indices, containing the greatest number of free agents.

Parameters:
router - the router used to map indices in the list to AgentGroup references.
ind - the list of agent group indices.
subset - the subset of indices to take into account when traversing the given list.
Returns:
the selected agent group.

selectGreatestFree

public static AgentGroup selectGreatestFree(Router router,
                                            int[] ind)
Equivalent to selectGreatestFree (router, ind, null).


selectUniform

public static AgentGroup selectUniform(Router router,
                                       int[] ind,
                                       boolean[] subset,
                                       RandomStream stream)
Returns a reference to a randomly selected agent group, among the groups referred to by the given list of indices. The probability of group i to be selected is given by $ \Nf$[i](t)/$ \Nf$(t), where $ \Nf$[i](t) is the number of free agents in group i at current simulation time, and $ \Nf$(t) is the total number of free agents in the groups referred to by the indices.

Parameters:
router - the router used to map indices in the given list to AgentGroup references.
ind - the list of agent group indices.
subset - the subset of indices to take into account when traversing the given list.
stream - the random number stream to generate one uniform.
Returns:
the selected agent group.

selectUniform

public static AgentGroup selectUniform(Router router,
                                       int[] ind,
                                       RandomStream stream)
Equivalent to selectUniform (router, ind, null, stream).


selectLongestIdle

public static Agent selectLongestIdle(Router router,
                                      int[] ind,
                                      boolean[] subset)
Returns the reference to the agent having the longest idle time among the agent groups indexed by the list ind and possibly restricted by subset if it is non-null. This selection rule will be applied only to DetailedAgentGroup linked to the router. Indices mapping to an AgentGroup instance will be ignored.

Parameters:
router - the router used to map indices in the given list to AgentGroup references.
ind - the list of agent group indices.
subset - the subset of indices to take into account when traversing the given list.
Returns:
the selected agent.

selectLongestIdle

public static Agent selectLongestIdle(Router router,
                                      int[] ind)
Equivalent to selectLongestIdle (router, ind, null).


ContactCenters
V. 0.9.9.

To submit a bug or ask questions, send an e-mail to Richard Simard.