|
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.msk.model.RouterManager
public class RouterManager
Manages the creation of the router as well as the data structures containing
routing information.
This class provides the necessary facility to
read and validate routing tables stored in
RouterParams
instances, construct
missing routing tables according to the rules
specified in RouterParams
, and
create the appropriate Router
instance used
for simulation.
Constructor Summary | |
---|---|
RouterManager(CallCenter cc,
RouterParams par)
Constructs a new router manager using the call center model cc, and the router's parameters par. |
Method Summary | |
---|---|
static void |
addRouterFactory(RouterFactory rf)
Registers the router factory rf for router managers. |
void |
clearRegionMap()
Clears the internal region map used by initTypeRegions() and
initGroupRegions() . |
protected Router |
createRouter(RouterParams par)
Constructs and returns the router to be managed. |
double[][] |
getDelaysGT()
Returns the currently used group-to-type delays matrix. |
int[] |
getGroupRegions()
Returns the currently used group regions. |
int[][] |
getGroupToTypeMap()
Returns the currently used group-to-type map. |
boolean[][] |
getIncidenceMatrixGT()
Returns the currently used group-to-type incidence matrix. |
boolean[][] |
getIncidenceMatrixTG()
Returns the currently used type-to-group incidence matrix. |
Map<String,Object> |
getProperties()
|
double[] |
getQueueWeights()
Returns the currently used queue weights vector. |
double[][] |
getRanksGT()
Returns the currently used group-to-type matrix of ranks. |
SortedMap<Double,double[][]> |
getRanksGTDelay()
Returns a map giving the auxiliary matrices of ranks with associated minimal waiting times. |
double[][] |
getRanksTG()
Returns the currently used type-to-group matrix of ranks. |
String |
getRegion(int id)
Returns the region name corresponding to region identifier id. |
int |
getRegion(String regStr)
Returns the region identifier corresponding to the region name regStr. |
Router |
getRouter()
Returns a reference to the router managed by this object. |
CallCenterRoutingStageInfo[][] |
getRoutingStages()
|
int |
getSkillCount(int i)
Returns the skill count for agent group i, i.e., the number of call types agents in this group can serve. |
int[] |
getSkillCounts()
Returns the currently used skill counts. |
int[] |
getTypeRegions()
Returns the currently used type regions vector. |
int[][] |
getTypeToGroupMap()
Returns the currently used type-to-group map. |
double[][] |
getWeightsGT()
Returns the currently used group-to-type matrix of weights. |
double[][] |
getWeightsTG()
Returns the currently used type-to-group matrix of weights. |
void |
init()
|
void |
initAgentsPrefBased(RouterParams par,
AgentsPrefRouter router1)
Initializes an agents preference-based router using the parameters par. |
void |
initDelays(RouterParams par)
Initializes the matrix of delays from the router's parameters par. |
void |
initGroupRegions()
Initializes the agent group region identifiers used by the local-specialist routing policy. |
void |
initGroupToTypeMap(RouterParams par)
Initializes the group-to-type map from the router parameters par, or constructs a new group-to-type map from other information if RouterParams.getRoutingTableSources()
defines the groupToTypeMap
attribute. |
void |
initIncidenceMatrixGT(RouterParams par)
Initializes the group-to-type incidence matrix from the router parameters par, or constructs a new group-to-type incidence matrix from other information if RouterParams.getRoutingTableSources()
defines the incidenceMatrixGT
attribute. |
void |
initIncidenceMatrixTG(RouterParams par)
Initializes the type-to-group incidence matrix from the router parameters par, or constructs a new type-to-group incidence matrix from other information if RouterParams.getRoutingTableSources()
defines the incidenceMatrixTG
attribute. |
void |
initQueueWeights(RouterParams par)
Initializes the queue weights using the router's parameters par. |
void |
initRanksGT(RouterParams par)
Initializes the group-to-type matrix of ranks from the router parameters par, or constructs a new group-to-type matrix of ranks from other information if RouterParams.getRoutingTableSources()
defines the ranksGT
attribute. |
void |
initRanksGTUpdate(RouterParams par)
Initializes the auxiliary group-to-type matrix of ranks associated with minimal waiting times. |
void |
initRanksTG(RouterParams par)
Initializes the type-to-group matrix of ranks from the router parameters par, or constructs a new type-to-group matrix of ranks from other information if RouterParams.getRoutingTableSources()
defines the ranksTG
attribute. |
void |
initSkillCounts(RouterParams par)
Initializes the skill counts using the router's parameters par. |
void |
initStages(RouterParams par)
Initializes the routing stages for the overflow-and-priority routing policy from parameters in par. |
void |
initTypeRegions()
Initializes the call type region identifiers used by the local-specialist routing policy. |
void |
initTypeToGroupMap(RouterParams par)
Initializes the type-to-group map from the router parameters par, or constructs a new type-to-group map from other information if RouterParams.getRoutingTableSources()
defines the typeToGroupMap
attribute. |
void |
initWeightsGT(RouterParams par)
Initializes the group-to-type matrix of weights using the router's parameters par. |
void |
initWeightsTG(RouterParams par)
Initializes the type-to-group matrix of weights using the router's parameters par. |
void |
setDelaysGT(double[][] delaysGT)
Sets the group-to-type delays matrix to delaysGT. |
void |
setGroupRegions(int[] groupRegions)
Sets the currently used group regions to groupRegions. |
void |
setGroupToTypeMap(int[][] groupToTypeMap)
Sets the group-to-type map to groupToTypeMap. |
void |
setIncidenceMatrixGT(boolean[][] incidenceMatrixGT)
Sets the group-to-type incidence matrix to incidenceMatrixGT. |
void |
setIncidenceMatrixTG(boolean[][] incidenceMatrixTG)
Sets the type-to-group incidence matrix to incidenceMatrixTG. |
void |
setQueueWeights(double[] queueWeights)
Sets the vector of queue weights to queueWeights. |
void |
setRanksGT(double[][] ranksGT)
Sets the group-to-type matrix of ranks to ranksGT. |
void |
setRanksTG(double[][] ranksTG)
Sets the type-to-group matrix of ranks to ranksTG. |
void |
setRouter(Router router)
Sets the managed router to router. |
void |
setSkillCounts(int[] skillCounts)
Sets the currently used skill counts to skillCounts. |
void |
setTypeRegions(int[] typeRegions)
Sets the vector of type regions to typeRegions. |
void |
setTypeToGroupMap(int[][] typeToGroupMap)
Sets the currently used type-to-group map to typeToGroupMap. |
void |
setWeightsGT(double[][] weightsGT)
Sets the group-to-type matrix of weights to weightsGT. |
void |
setWeightsTG(double[][] weightsTG)
Sets the type-to-group matrix of weights to weightsTG. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RouterManager(CallCenter cc, RouterParams par) throws RouterCreationException
cc
- the call center model.par
- the router's parameters.
RouterCreationException
- if a problem
occurs during the construction of the router.Method Detail |
---|
public Router getRouter()
public void setRouter(Router router)
router
- the new managed router.public Map<String,Object> getProperties()
public void initTypeToGroupMap(RouterParams par)
RouterParams.getRoutingTableSources()
defines the typeToGroupMap
attribute.
This method does nothing if
a type-to-group map was already constructed.
The obtained type-to-group map can be accessed
through getTypeToGroupMap()
after
this method succeeds, and
an illegal-argument exception is thrown
if this method fails.
par
- the router's parameters.public void initGroupToTypeMap(RouterParams par)
RouterParams.getRoutingTableSources()
defines the groupToTypeMap
attribute.
This method does nothing if
a group-to-type map was already constructed.
The obtained group-to-type map can be accessed
through getGroupToTypeMap()
after
this method succeeds, and
an illegal-argument exception is thrown
if this method fails.
par
- the router's parameters.public void initRanksTG(RouterParams par)
RouterParams.getRoutingTableSources()
defines the ranksTG
attribute.
This method does nothing if
a type-to-group matrix of ranks was already constructed.
The obtained matrix can be accessed
through getRanksTG()
after
this method succeeds, and
an illegal-argument exception is thrown
if this method fails.
par
- the router's parameters.public void initRanksGT(RouterParams par)
RouterParams.getRoutingTableSources()
defines the ranksGT
attribute.
This method does nothing if
a group-to-type matrix of ranks was already constructed.
The obtained matrix can be accessed
through getRanksGT()
after
this method succeeds, and
an illegal-argument exception is thrown
if this method fails.
par
- the router's parameters.public void initRanksGTUpdate(RouterParams par)
getRanksGTDelay()
method.
par
- the router's parameters.public void initWeightsTG(RouterParams par)
getWeightsTG()
method if this method
succeeds.
par
- the router's parameters.public void initWeightsGT(RouterParams par)
getWeightsGT()
method if this method
succeeds.
par
- the router's parameters.public void initDelays(RouterParams par)
getDelaysGT()
.
par
- the router's parameters.public void initQueueWeights(RouterParams par)
getQueueWeights()
method if
this method succeeds.
par
- the router's parameters.public void initIncidenceMatrixTG(RouterParams par)
RouterParams.getRoutingTableSources()
defines the incidenceMatrixTG
attribute.
This method does nothing if
a type-to-group incidence matrix was already constructed.
The obtained matrix can be accessed
through getIncidenceMatrixTG()
after
this method succeeds, and
an illegal-argument exception is thrown
if this method fails.
par
- the router's parameters.public void initIncidenceMatrixGT(RouterParams par)
RouterParams.getRoutingTableSources()
defines the incidenceMatrixGT
attribute.
This method does nothing if
a group-to-type incidence matrix was already constructed.
The obtained matrix can be accessed
through getIncidenceMatrixGT()
after
this method succeeds, and
an illegal-argument exception is thrown
if this method fails.
par
- the router's parameters.public void initSkillCounts(RouterParams par)
par
- the router's parameters.public CallCenterRoutingStageInfo[][] getRoutingStages()
public void initStages(RouterParams par)
getRoutingStages()
method, are already
initialized.
Otherwise, it processes parameters in
par to initialize the stages.
par
- the routing parameters.protected Router createRouter(RouterParams par) throws RouterCreationException
RouterParams.getRouterPolicy()
to get a type identifier for the router's policy.
It then retrieves parameters and initializes a router
specific to the given type.
If the name of the policy corresponds to a constant in
RouterPolicyType
, the method handles its construction
directly.
Otherwise, it queries every factory registered using
addRouterFactory(RouterFactory)
until
it gets one capable of creating the policy.
If no such factory exists, it uses the
ServiceLoader
class to find a router policy factory
dynamically.
If that last step fails, the method throws a router-creation
exception.
par
- the parameters of the router.
RouterCreationException
- if an error occurs during
the construction.public static void addRouterFactory(RouterFactory rf)
rf
- the new router factory to register.public void initAgentsPrefBased(RouterParams par, AgentsPrefRouter router1)
par
- the router's parameters.router1
- the router object.public String getRegion(int id)
initTypeRegions()
or
initGroupRegions()
, and throws a NoSuchElementException
if
no region name has been associated with the given identifier.
id
- the region identifier.
NoSuchElementException
- if no region name is associated with the corresponding
region identifier.public int getRegion(String regStr)
initTypeRegions()
or initGroupRegions()
, and throws a
NoSuchElementException
if no identifier is associated with
regStr.
regStr
- the tested region name.
NoSuchElementException
- if no region identifier is associated with the given region
name.public void clearRegionMap()
initTypeRegions()
and
initGroupRegions()
. After this method is called, it is not possible
to get the region name corresponding to the region identifiers.
public void initTypeRegions()
getTypeRegions()
associates a region identifier
to each call type.
The region name of a call type is computed as follows.
First, the call type factory is obtained using
CallCenter.getCallFactory(int)
.
If the properties returned by CallFactory.getProperties()
contains a property named region, its
value is used as the region string.
Otherwise, the name of the call type, returned by
CallFactory.getName()
,
is split using the semicolon as a delimiter, and
the region corresponds to the string following the
semicolon.
public void initGroupRegions()
getGroupRegions()
associates a region identifier
to each call type.
The region name of an agent group is computed as follows.
First, the agent group manager is obtained using
CallCenter.getAgentGroupManager(int)
.
If the properties returned by getProperties()
contains a property named region, its
value is used as the region string.
Otherwise, the name of the call type, returned by
getName(),
is split using the semicolon as a delimiter, and
the region corresponds to the string following the
semicolon.
public int[][] getGroupToTypeMap()
initGroupToTypeMap(RouterParams)
or setGroupToTypeMap(int[][])
were never called, this method returns null.
Otherwise, this method returns an array of I
arrays giving an order list of call types for
each agent group.
public void setGroupToTypeMap(int[][] groupToTypeMap)
groupToTypeMap
- the new group-to-type map.public boolean[][] getIncidenceMatrixGT()
initIncidenceMatrixGT(RouterParams)
or setIncidenceMatrixGT(boolean[][])
were never called, this method returns null.
Otherwise, this returns a I×K incidence matrix.
public void setIncidenceMatrixGT(boolean[][] incidenceMatrixGT)
incidenceMatrixGT
- the group-to-type incidence matrix.public boolean[][] getIncidenceMatrixTG()
initIncidenceMatrixTG(RouterParams)
or setIncidenceMatrixTG(boolean[][])
were never called, this method returns null.
Otherwise, this returns a K×I incidence matrix.
public void setIncidenceMatrixTG(boolean[][] incidenceMatrixTG)
incidenceMatrixTG
- the type-to-group incidence matrix.public double[] getQueueWeights()
initQueueWeights(RouterParams)
or setQueueWeights(double[])
were never called, this method returns null.
Otherwise, element k of the returned array
gives the weight for contact type k
when entering in queue.
public void setQueueWeights(double[] queueWeights)
queueWeights
- the new vector of queue weights.public double[][] getRanksGT()
initRanksGT(RouterParams)
or setRanksGT(double[][])
were never called, this method returns null.
Otherwise, it returns a I×K matrix of
ranks.
public void setRanksGT(double[][] ranksGT)
ranksGT
- the new matrix of ranks.public SortedMap<Double,double[][]> getRanksGTDelay()
public double[][] getRanksTG()
initRanksTG(RouterParams)
or setRanksTG(double[][])
were never called, this method returns null.
Otherwise, it returns a K×I matrix of
ranks.
public void setRanksTG(double[][] ranksTG)
ranksTG
- the new matrix of ranks.public int[] getSkillCounts()
initSkillCounts(RouterParams)
or setSkillCounts(int[])
were never called.
Otherwise, it returns an array whose
element i gives the skill count
for agent group i.
public int getSkillCount(int i)
Integer.MAX_VALUE
if initSkillCounts(RouterParams)
or setSkillCounts(int[])
were never called.
i
- the index of the agent group.
public void setSkillCounts(int[] skillCounts)
skillCounts
- the new skill counts.public int[] getTypeRegions()
initTypeRegions()
or
setTypeRegions(int[])
were never called.
Otherwise, index k of the returned
array gives the region identifier for
calls of type k.
public void setTypeRegions(int[] typeRegions)
typeRegions
- the new vector of type regions.public int[] getGroupRegions()
initGroupRegions()
or setGroupRegions(int[])
were never called.
Otherwise, index i of the returned
array gives the region identifier for
agents in group i.
public void setGroupRegions(int[] groupRegions)
groupRegions
- the new group regions.public int[][] getTypeToGroupMap()
initTypeToGroupMap(RouterParams)
or setTypeToGroupMap(int[][])
were never called, this method returns
null.
Otherwise, it returns an array of K arrays giving
an ordered list of agent groups for each call type.
public void setTypeToGroupMap(int[][] typeToGroupMap)
typeToGroupMap
- the new type-to-group map.public double[][] getWeightsGT()
initWeightsGT(RouterParams)
or
setWeightsGT(double[][])
were
never called, this method returns null.
Otherwise, it returns a I×K matrix of
weights.
public void setWeightsGT(double[][] weightsGT)
weightsGT
- the new matrix of weights.public double[][] getWeightsTG()
initWeightsTG(RouterParams)
or setWeightsTG(double[][])
were
never called, this method returns null.
Otherwise, it returns a K×I matrix of
weights.
public void setWeightsTG(double[][] weightsTG)
weightsTG
- the new matrix of weights.public double[][] getDelaysGT()
initDelays(RouterParams)
or
setDelaysGT(double[][])
were never called, this method returns
null.
Otherwise, it returns a I×K matrix of delays
expressed in the default time unit of the simulator.
public void setDelaysGT(double[][] delaysGT)
delaysGT
- the new delays matrix.public void init()
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |