ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters.ctmc
Class CallCenterCTMCKI

java.lang.Object
  extended by umontreal.iro.lecuyer.contactcenters.ctmc.CallCenterCTMCKI
All Implemented Interfaces:
Cloneable, CallCenterCTMC
Direct Known Subclasses:
CallCenterCTMCKIWithQueues

public class CallCenterCTMCKI
extends Object
implements CallCenterCTMC

CTMC model of a call center with multiple call types and agent groups.


Constructor Summary
CallCenterCTMCKI(double[] lambda, double[] lambdaBound, double[][] mu, double[][] muBound, int[] numAgents, int[] maxNumAgents, double[] rho, double[] nu, double[] nuBound, int queueCapacity, int maxQueueCapacity, AgentGroupSelector[] ags, WaitingQueueSelector[] wqs, boolean needsInServiceContactMix, int[][] thresholds)
           
 
Method Summary
 CallCenterCTMCKI clone()
          Returns an independent copy of this call center CTMC.
protected  CCEvent createEvent(double minU, double maxU, int size, int maxBits, int lqidx)
           
protected static CCEvent createEventF(StateThresh stateThresh, double minU, double maxU, int size, int maxBits, int lqidx, CCEvent lookupEvent)
           
 boolean equalsState(Object obj)
          Determines if the state of this CTMC is the same as the state of the CTMC o.
 void generateAbandonment(int k, int kpos, int np1, int nf1)
          Generates the abandonment of the kposth contact of type k.
 void generateArrival(int k, int np1, int nf1)
          Generates the arrival of a contact of type k being blocked or balking.
 void generateArrivalQueued(int k, int np1, int nf1)
          Generates the arrival of a contact of type k, and adds the new contact to the waiting queue.
 void generateArrivalServed(int k, int i, int np1, int nf1)
          Generates the arrival of a contact of type k served by an agent in group i.
 void generateEndService(int k, int i, int np1, int nf1)
          Generates the end of the service for a contact of type k served by an agent in group i.
 void generateEndService(int k, int i, int kp, int np1, int nf1)
          Generates the end of the service for a contact of type k served by an agent in group i, and assigns the kposth queued contact of type kp to the free agent.
 void generateFalseTransition(int np1, int nf1)
          Generates a false transition.
 double getArrivalRate()
          Returns the total arrival rate λ = $ \htsum_{{k=0}}^{{K-1}}$λk for all contact types.
 double getArrivalRate(int k)
          Returns the arrival rate λk for contacts of type k.
 double getJumpRate()
          Returns the uniformized transition rate used by this CTMC.
 int getLastSelectedAgentGroup()
          Returns the last agent group selected by the CallCenterCTMC.nextState(double) method.
 int getLastSelectedContact()
          Returns the index of the last selected contact having abandoned.
 int getLastSelectedContactType()
          Returns the last contact type selected by the CallCenterCTMC.nextState(double) method.
 int getLastSelectedQueuedContactType()
          Returns the type of the last contact removed from a waiting queue for service by the CallCenterCTMC.nextState(double) method.
 TransitionType getLastTransitionType()
          Returns the type of the last transition, or null if no transition occurred since the last call to CallCenterCTMC.initEmpty().
 double getMaxArrivalRate()
          Returns the total maximal arrival rate $ \tilde{\lambda}$ = $ \htsum_{{k=0}}^{{K-1}}$$ \tilde{\lambda}_{k}^{}$ for all contact types.
 double getMaxArrivalRate(int k)
          Returns the maximal arrival rate $ \tilde{\lambda}_{k}^{}$ for contacts of type k.
 int getMaxNumAgents()
          Returns the maximal total number of agents that can be used for the CTMC.
 int getMaxNumAgents(int i)
          Returns the maximal number of agents in group i.
 int[] getMaxNumAgentsArray()
          Returns an array of length I containing the maximal number of agents in each agent group.
 double getMaxPatienceRate(int k)
          Returns the maximal patience rate $ \tilde{\nu}_{k}^{}$ for contacts of type k.
 int getMaxQueueCapacity()
          Returns the current bound on the queue capacity used to determine the transition rate of the CTMC.
 double getMaxServiceRate(int k, int i)
          Returns the maximal service rate $ \tilde{\mu}_{{k,i}}^{}$ for contacts of type k served by agents in group i.
 TransitionType getNextTransition(double u)
          Returns the type of the next transition generated using the random number u.
 TransitionType getNextTransitionInt(int rv)
          Similar to CallCenterCTMC.getNextTransition(double), using a random integer rather than a uniform number.
 int getNumAgentGroups()
          Returns the number of agent groups used in the modelled call center.
 int getNumAgents()
          Returns the total number of agents available for serving contacts.
 int getNumAgents(int i)
          Returns the number of agents in group i.
 int[] getNumAgentsArray()
          Returns an array of length I containing the number of agents in each agent group.
 int getNumContactsInQueue()
          Returns the total number of contacts currently waiting in queue.
 int getNumContactsInQueue(int k)
          Returns the number of contacts of type k currently waiting in queue.
 int getNumContactsInService()
          Returns the total number of contacts currently served by agents.
 int getNumContactsInService(int k, int i)
          Returns the number of contacts of type k in service by agents in group i.
 int getNumContactsInServiceI(int i)
          Returns the number of contacts currently in service by agents in group i.
 int getNumContactsInServiceK(int k)
          Returns the number of contacts of type k currently in service.
 int getNumContactTypes()
          Returns the number of contact types used in the modelled call center.
 int getNumFollowingFalseTransitions()
          Similar to CallCenterCTMC.getNumPrecedingFalseTransitions(), but for the number of false transitions generated after the main transition.
 int getNumPrecedingFalseTransitions()
          Returns the number of additionnal false transitions generated by the last call to CallCenterCTMC.nextState(double) before the main transition.
 int getNumStateThresh()
          Returns the number of thresholds on the state space.
 int getNumTransitionsDone()
          Returns the number of generated transitions.
 double getPatienceRate(int k)
          Returns the patience rate νk for contacts of type k.
 double getProbBalking(int k)
          Returns the probability of balking ρk for contacts of type k.
 int getQueueCapacity()
          Returns the maximal queue capacity.
 double[][] getRanksGT()
          Returns the group-to-type matrix of ranks associating a priority to each agent group and contact type when selecting a waiting queue for a free agent.
 double[][] getRanksTG()
          Returns the type-to-group matrix of ranks associating a priority to each contact type and agent group when selecting an agent group for a new arrival.
 double getServiceRate(int k, int i)
          Returns the service rate μk, i for contacts of type k served by agents in group i.
 StateThresh getStateThresh()
          Returns the thresholds on the state of the CTMC.
 int[][] getStateThresholds()
          Returns the R×I + 1 matrix of thresholds whose used for state space partitioning.
 int getTargetNumTransitions()
          Returns the current target number of transitions.
 int hashCodeState()
          Computes and returns a hash code using the current state of the CTMC.
 void init(CallCenterCTMC ctmc)
          Initializes the state of this CTMC with the state of the other CTMC ctmc.
 void initEmpty()
          Initializes the system to an empty call center, and resets the counter giving the number of transitions done to 0.
 TransitionType nextState(double u)
          Generates the next state of the CTMC randomly from the current state, using the given uniform u, and changes the current state to this new state.
 TransitionType nextStateInt(int rv)
          Similar to CallCenterCTMC.nextState(double), except that the given random variate v is uniformly distributed over [0, 231 - 1].
 boolean selectContact(int i)
          Selects a new queued contact for a free agent in group i, and returns a boolean indicator determining if a contact could be selected.
 void setArrivalRate(int k, double rate)
          Sets the arrival rate for contacts of type k to rate.
 void setArrivalRates(double[] rates)
          Sets the arrival rate for each contact type k to rates[k].
 void setMaxArrivalRate(int k, double rate)
          Sets the maximal arrival rate for contacts of type k to rate.
 void setMaxArrivalRates(double[] rates)
          Sets the maximal arrival rate for each contact type k to rates[k].
 void setMaxNumAgents(int[] maxNumAgents)
          For each agent group i = 0,…, I - 1, sets the maximal number of agents in group i to numAgents[i].
 void setMaxNumAgents(int i, int n)
          Sets the maximal number of agents in group i to n.
 void setMaxPatienceRate(int k, double nuk)
          Sets the maximal patience rate $ \tilde{\nu}_{k}^{}$ for contacts of type k to nuk.
 void setMaxQueueCapacity(int q)
          Sets the bound on the queue capacity to q.
 void setMaxServiceRate(int k, int i, double muki)
          Sets the maximal service rate for contacts of type k served by agents in group i to muki.
 void setNumAgents(int[] numAgents)
          For each agent group i = 0,…, I - 1, sets the number of agents in group i to numAgents[i].
 void setNumAgents(int i, int n)
          Sets the number of agents in group i to n.
 void setPatienceRate(int k, double nuk)
          Sets the patience rate νk for contacts of type k to nuk.
 void setProbBalking(int k, double rhok)
          Sets the balking probability to ρk for contacts of type k to rhok.
 void setQueueCapacity(int q)
          Sets the capacity of the waiting queue to q.
 void setServiceRate(int k, int i, double muki)
          Sets the service rate μk, i to for contacts of type k served by agents in group i to muki.
 void setStateThresholds(int[][] thresholds)
          Sets the matrix of thresholds for this CTMC to thresholds.
 void setTargetNumTransitions(int tntr)
          Sets the target number of transitions to tntr.
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CallCenterCTMCKI

public CallCenterCTMCKI(double[] lambda,
                        double[] lambdaBound,
                        double[][] mu,
                        double[][] muBound,
                        int[] numAgents,
                        int[] maxNumAgents,
                        double[] rho,
                        double[] nu,
                        double[] nuBound,
                        int queueCapacity,
                        int maxQueueCapacity,
                        AgentGroupSelector[] ags,
                        WaitingQueueSelector[] wqs,
                        boolean needsInServiceContactMix,
                        int[][] thresholds)
Method Detail

createEventF

protected static CCEvent createEventF(StateThresh stateThresh,
                                      double minU,
                                      double maxU,
                                      int size,
                                      int maxBits,
                                      int lqidx,
                                      CCEvent lookupEvent)

createEvent

protected CCEvent createEvent(double minU,
                              double maxU,
                              int size,
                              int maxBits,
                              int lqidx)

getNumAgentGroups

public int getNumAgentGroups()
Description copied from interface: CallCenterCTMC
Returns the number of agent groups used in the modelled call center.

Specified by:
getNumAgentGroups in interface CallCenterCTMC
Returns:
the number of agent groups.

getNumContactsInQueue

public int getNumContactsInQueue()
Description copied from interface: CallCenterCTMC
Returns the total number of contacts currently waiting in queue.

Specified by:
getNumContactsInQueue in interface CallCenterCTMC
Returns:
the total number of queued contacts.

getNumContactsInQueue

public int getNumContactsInQueue(int k)
Description copied from interface: CallCenterCTMC
Returns the number of contacts of type k currently waiting in queue.

Specified by:
getNumContactsInQueue in interface CallCenterCTMC
Parameters:
k - the tested contact type.
Returns:
the number of contacts waiting in queue.

getNumContactTypes

public int getNumContactTypes()
Description copied from interface: CallCenterCTMC
Returns the number of contact types used in the modelled call center.

Specified by:
getNumContactTypes in interface CallCenterCTMC
Returns:
the number of contact types.

getJumpRate

public double getJumpRate()
Description copied from interface: CallCenterCTMC
Returns the uniformized transition rate used by this CTMC.

Specified by:
getJumpRate in interface CallCenterCTMC
Returns:
the uniformized transition rate.

getQueueCapacity

public int getQueueCapacity()
Description copied from interface: CallCenterCTMC
Returns the maximal queue capacity.

Specified by:
getQueueCapacity in interface CallCenterCTMC
Returns:
the maximal queue capacity.

setQueueCapacity

public void setQueueCapacity(int q)
Description copied from interface: CallCenterCTMC
Sets the capacity of the waiting queue to q.

Specified by:
setQueueCapacity in interface CallCenterCTMC
Parameters:
q - the new queue capacity.

getMaxQueueCapacity

public int getMaxQueueCapacity()
Description copied from interface: CallCenterCTMC
Returns the current bound on the queue capacity used to determine the transition rate of the CTMC.

Specified by:
getMaxQueueCapacity in interface CallCenterCTMC
Returns:
the bound on the queue capacity.

setMaxQueueCapacity

public void setMaxQueueCapacity(int q)
Description copied from interface: CallCenterCTMC
Sets the bound on the queue capacity to q. Note that this method can change the transition rate, which usually involves recreating search indexes. Calling this method too often can thus decrease performance; one should use CallCenterCTMC.setQueueCapacity(int) instead.

Specified by:
setMaxQueueCapacity in interface CallCenterCTMC
Parameters:
q - the new maximal queue capacity.

getArrivalRate

public double getArrivalRate(int k)
Description copied from interface: CallCenterCTMC
Returns the arrival rate λk for contacts of type k.

Specified by:
getArrivalRate in interface CallCenterCTMC
Parameters:
k - the tested contact type.
Returns:
the arrival rate.

setArrivalRate

public void setArrivalRate(int k,
                           double rate)
Description copied from interface: CallCenterCTMC
Sets the arrival rate for contacts of type k to rate.

Specified by:
setArrivalRate in interface CallCenterCTMC
Parameters:
k - the contact type.
rate - the arrival rate.

setArrivalRates

public void setArrivalRates(double[] rates)
Description copied from interface: CallCenterCTMC
Sets the arrival rate for each contact type k to rates[k].

Specified by:
setArrivalRates in interface CallCenterCTMC
Parameters:
rates - the arrival rates.

getArrivalRate

public double getArrivalRate()
Description copied from interface: CallCenterCTMC
Returns the total arrival rate λ = $ \htsum_{{k=0}}^{{K-1}}$λk for all contact types.

Specified by:
getArrivalRate in interface CallCenterCTMC
Returns:
the total arrival rate.

getMaxArrivalRate

public double getMaxArrivalRate(int k)
Description copied from interface: CallCenterCTMC
Returns the maximal arrival rate $ \tilde{\lambda}_{k}^{}$ for contacts of type k.

Specified by:
getMaxArrivalRate in interface CallCenterCTMC
Parameters:
k - the tested contact type.
Returns:
the maximal arrival rate.

setMaxArrivalRate

public void setMaxArrivalRate(int k,
                              double rate)
Description copied from interface: CallCenterCTMC
Sets the maximal arrival rate for contacts of type k to rate. This can change the transition rate, and force the simulator to recompute some search indexes. Using this method often can therefore degrade performance, so it is recommended to call double) instead.

Specified by:
setMaxArrivalRate in interface CallCenterCTMC
Parameters:
k - the contact type.
rate - the arrival rate.

setMaxArrivalRates

public void setMaxArrivalRates(double[] rates)
Description copied from interface: CallCenterCTMC
Sets the maximal arrival rate for each contact type k to rates[k].

Specified by:
setMaxArrivalRates in interface CallCenterCTMC
Parameters:
rates - the arrival rates.

getMaxArrivalRate

public double getMaxArrivalRate()
Description copied from interface: CallCenterCTMC
Returns the total maximal arrival rate $ \tilde{\lambda}$ = $ \htsum_{{k=0}}^{{K-1}}$$ \tilde{\lambda}_{k}^{}$ for all contact types.

Specified by:
getMaxArrivalRate in interface CallCenterCTMC
Returns:
the total maximal arrival rate.

getLastTransitionType

public TransitionType getLastTransitionType()
Description copied from interface: CallCenterCTMC
Returns the type of the last transition, or null if no transition occurred since the last call to CallCenterCTMC.initEmpty().

Specified by:
getLastTransitionType in interface CallCenterCTMC
Returns:
the type of the last transition.

getLastSelectedAgentGroup

public int getLastSelectedAgentGroup()
Description copied from interface: CallCenterCTMC
Returns the last agent group selected by the CallCenterCTMC.nextState(double) method.

Specified by:
getLastSelectedAgentGroup in interface CallCenterCTMC
Returns:
the last selected agent group.

getLastSelectedContactType

public int getLastSelectedContactType()
Description copied from interface: CallCenterCTMC
Returns the last contact type selected by the CallCenterCTMC.nextState(double) method.

Specified by:
getLastSelectedContactType in interface CallCenterCTMC
Returns:
the last selected contact type.

getLastSelectedContact

public int getLastSelectedContact()
Description copied from interface: CallCenterCTMC
Returns the index of the last selected contact having abandoned. This returns the position of the contact having abandoned within a queue containing contacts of type k only. The returned value is thus in 0,…, Qk - 1 where k is the result of CallCenterCTMC.getLastSelectedContactType(), and Qk is the number of contacts of type k in queue.

Specified by:
getLastSelectedContact in interface CallCenterCTMC
Returns:
the last selected contact.

getLastSelectedQueuedContactType

public int getLastSelectedQueuedContactType()
Description copied from interface: CallCenterCTMC
Returns the type of the last contact removed from a waiting queue for service by the CallCenterCTMC.nextState(double) method.

Specified by:
getLastSelectedQueuedContactType in interface CallCenterCTMC
Returns:
the last selected queued contact type.

getNumAgents

public int getNumAgents()
Description copied from interface: CallCenterCTMC
Returns the total number of agents available for serving contacts.

Specified by:
getNumAgents in interface CallCenterCTMC
Returns:
the total number of agents.

getNumAgents

public int getNumAgents(int i)
Description copied from interface: CallCenterCTMC
Returns the number of agents in group i.

Specified by:
getNumAgents in interface CallCenterCTMC
Parameters:
i - the tested agent group.
Returns:
the number of agents.

getMaxNumAgents

public int getMaxNumAgents()
Description copied from interface: CallCenterCTMC
Returns the maximal total number of agents that can be used for the CTMC.

Specified by:
getMaxNumAgents in interface CallCenterCTMC
Returns:
the maximal number of agents.

getMaxNumAgents

public int getMaxNumAgents(int i)
Description copied from interface: CallCenterCTMC
Returns the maximal number of agents in group i.

Specified by:
getMaxNumAgents in interface CallCenterCTMC
Parameters:
i - the tested agent group.
Returns:
the maximal number of agents.

setNumAgents

public void setNumAgents(int i,
                         int n)
Description copied from interface: CallCenterCTMC
Sets the number of agents in group i to n. This method might cause the transition rate to increase so it should never be called during the simulation of the CTMC.

Specified by:
setNumAgents in interface CallCenterCTMC
Parameters:
i - the tested agent group.
n - the new number of agents in the group.

getMaxNumAgentsArray

public int[] getMaxNumAgentsArray()
Description copied from interface: CallCenterCTMC
Returns an array of length I containing the maximal number of agents in each agent group.

Specified by:
getMaxNumAgentsArray in interface CallCenterCTMC
Returns:
the maximal number of agents in each group.

getNumAgentsArray

public int[] getNumAgentsArray()
Description copied from interface: CallCenterCTMC
Returns an array of length I containing the number of agents in each agent group.

Specified by:
getNumAgentsArray in interface CallCenterCTMC
Returns:
the number of agents in each group.

setMaxNumAgents

public void setMaxNumAgents(int i,
                            int n)
Description copied from interface: CallCenterCTMC
Sets the maximal number of agents in group i to n. This method might cause the maximal transition rate returned by CallCenterCTMC.getJumpRate() to increase so it should never be called during the simulation of the CTMC.

Specified by:
setMaxNumAgents in interface CallCenterCTMC
Parameters:
i - the tested agent group.
n - the new maximal number of agents in the group.

setMaxNumAgents

public void setMaxNumAgents(int[] maxNumAgents)
Description copied from interface: CallCenterCTMC
For each agent group i = 0,…, I - 1, sets the maximal number of agents in group i to numAgents[i].

Specified by:
setMaxNumAgents in interface CallCenterCTMC
Parameters:
maxNumAgents - the array containing the number of agents.

setNumAgents

public void setNumAgents(int[] numAgents)
Description copied from interface: CallCenterCTMC
For each agent group i = 0,…, I - 1, sets the number of agents in group i to numAgents[i].

Specified by:
setNumAgents in interface CallCenterCTMC
Parameters:
numAgents - the array containing the number of agents.

getNumStateThresh

public int getNumStateThresh()
Description copied from interface: CallCenterCTMC
Returns the number of thresholds on the state space. When the queue size or the number of busy agents are small enough, the CTMC simulator can use a smaller transition rate, and generate a random number of successive false transitions before every transition. Since multiple transitions are generated using a single random number, this can save CPU time. This method returns the total number of transition rates the simulator can use depending on the queue size, and number of busy agents. Note that using too many vectors of thresholds can increase memory usage, because a separate search index is required for each vector of threshold.

Specified by:
getNumStateThresh in interface CallCenterCTMC
Returns:
the number of state thresholds.

getStateThresh

public StateThresh getStateThresh()
Description copied from interface: CallCenterCTMC
Returns the thresholds on the state of the CTMC.

Specified by:
getStateThresh in interface CallCenterCTMC
Returns:
the state thresholds.

getStateThresholds

public int[][] getStateThresholds()
Description copied from interface: CallCenterCTMC
Returns the R×I + 1 matrix of thresholds whose used for state space partitioning. Each row of the matrix corresponds to a vector of thresholds, column i = 0,…, I - 1 corresponds to thresholds on the number of agents in group i, and the last column corresponds to the queue size.

Specified by:
getStateThresholds in interface CallCenterCTMC
Returns:
the matrix of thresholds.

setStateThresholds

public void setStateThresholds(int[][] thresholds)
Description copied from interface: CallCenterCTMC
Sets the matrix of thresholds for this CTMC to thresholds.

Specified by:
setStateThresholds in interface CallCenterCTMC
Parameters:
thresholds - the matrix of thresholds.

getRanksTG

public double[][] getRanksTG()
Description copied from interface: CallCenterCTMC
Returns the type-to-group matrix of ranks associating a priority to each contact type and agent group when selecting an agent group for a new arrival.

Specified by:
getRanksTG in interface CallCenterCTMC
Returns:
the matrix of ranks being used.

getRanksGT

public double[][] getRanksGT()
Description copied from interface: CallCenterCTMC
Returns the group-to-type matrix of ranks associating a priority to each agent group and contact type when selecting a waiting queue for a free agent.

Specified by:
getRanksGT in interface CallCenterCTMC
Returns:
the matrix of ranks being used.

getPatienceRate

public double getPatienceRate(int k)
Description copied from interface: CallCenterCTMC
Returns the patience rate νk for contacts of type k.

Specified by:
getPatienceRate in interface CallCenterCTMC
Parameters:
k - the tested contact type.
Returns:
the patience rate.

setPatienceRate

public void setPatienceRate(int k,
                            double nuk)
Description copied from interface: CallCenterCTMC
Sets the patience rate νk for contacts of type k to nuk.

Specified by:
setPatienceRate in interface CallCenterCTMC
Parameters:
k - the affected contact type.
nuk - the new value of νk.

getMaxPatienceRate

public double getMaxPatienceRate(int k)
Description copied from interface: CallCenterCTMC
Returns the maximal patience rate $ \tilde{\nu}_{k}^{}$ for contacts of type k.

Specified by:
getMaxPatienceRate in interface CallCenterCTMC
Parameters:
k - the tested contact type.
Returns:
the maximal patience rate.

setMaxPatienceRate

public void setMaxPatienceRate(int k,
                               double nuk)
Description copied from interface: CallCenterCTMC
Sets the maximal patience rate $ \tilde{\nu}_{k}^{}$ for contacts of type k to nuk. This method can change the transition rate and recompute search indexes so using it repeatedly might degrade performance. It is recommended to use CallCenterCTMC.setPatienceRate(int,double) instead.

Specified by:
setMaxPatienceRate in interface CallCenterCTMC
Parameters:
k - the affected contact type.
nuk - the new patience rate.

getProbBalking

public double getProbBalking(int k)
Description copied from interface: CallCenterCTMC
Returns the probability of balking ρk for contacts of type k.

Specified by:
getProbBalking in interface CallCenterCTMC
Parameters:
k - the tested contact type.
Returns:
the probability of balking.

setProbBalking

public void setProbBalking(int k,
                           double rhok)
Description copied from interface: CallCenterCTMC
Sets the balking probability to ρk for contacts of type k to rhok.

Specified by:
setProbBalking in interface CallCenterCTMC
Parameters:
k - the affected contact type.
rhok - the new value of ρk.

getNumTransitionsDone

public int getNumTransitionsDone()
Description copied from interface: CallCenterCTMC
Returns the number of generated transitions. This corresponds to the number of times the CallCenterCTMC.nextState(double) method was called since the last call to CallCenterCTMC.initEmpty().

Specified by:
getNumTransitionsDone in interface CallCenterCTMC
Returns:
the number of transitions done.

getNumPrecedingFalseTransitions

public int getNumPrecedingFalseTransitions()
Description copied from interface: CallCenterCTMC
Returns the number of additionnal false transitions generated by the last call to CallCenterCTMC.nextState(double) before the main transition. Some implementation of this interface might generate several false transitions using a single random number. In this case, the call to CallCenterCTMC.nextState(double) will return a transition type while this method should be used to obtain the number of additional false transitions that were generated before the main transition.

Specified by:
getNumPrecedingFalseTransitions in interface CallCenterCTMC
Returns:
the number of additional false transitions generated by the last call to CallCenterCTMC.nextState(double) before the main transition.

getNumFollowingFalseTransitions

public int getNumFollowingFalseTransitions()
Description copied from interface: CallCenterCTMC
Similar to CallCenterCTMC.getNumPrecedingFalseTransitions(), but for the number of false transitions generated after the main transition.

Specified by:
getNumFollowingFalseTransitions in interface CallCenterCTMC
Returns:
the number of additional false transitions generated by the last call to CallCenterCTMC.nextState(double) after the main transition.

getNumContactsInService

public int getNumContactsInService()
Description copied from interface: CallCenterCTMC
Returns the total number of contacts currently served by agents.

Specified by:
getNumContactsInService in interface CallCenterCTMC
Returns:
the total number of contacts in service.

getNumContactsInService

public int getNumContactsInService(int k,
                                   int i)
Description copied from interface: CallCenterCTMC
Returns the number of contacts of type k in service by agents in group i.

Specified by:
getNumContactsInService in interface CallCenterCTMC
Parameters:
k - the tested contact type.
i - the tested agent group.
Returns:
the number of contacts in service.

getNumContactsInServiceI

public int getNumContactsInServiceI(int i)
Description copied from interface: CallCenterCTMC
Returns the number of contacts currently in service by agents in group i.

Specified by:
getNumContactsInServiceI in interface CallCenterCTMC
Parameters:
i - the tested agent group.
Returns:
the number of contacts in service.

getNumContactsInServiceK

public int getNumContactsInServiceK(int k)
Description copied from interface: CallCenterCTMC
Returns the number of contacts of type k currently in service.

Specified by:
getNumContactsInServiceK in interface CallCenterCTMC
Parameters:
k - the tested contact type.
Returns:
the number of contacts in service.

getServiceRate

public double getServiceRate(int k,
                             int i)
Description copied from interface: CallCenterCTMC
Returns the service rate μk, i for contacts of type k served by agents in group i.

Specified by:
getServiceRate in interface CallCenterCTMC
Parameters:
k - the tested contact type.
i - the tested agent group.
Returns:
the service rate.

setServiceRate

public void setServiceRate(int k,
                           int i,
                           double muki)
Description copied from interface: CallCenterCTMC
Sets the service rate μk, i to for contacts of type k served by agents in group i to muki.

Specified by:
setServiceRate in interface CallCenterCTMC
Parameters:
k - the affected contact type.
i - the affected agent group.
muki - the new service rate.

getMaxServiceRate

public double getMaxServiceRate(int k,
                                int i)
Description copied from interface: CallCenterCTMC
Returns the maximal service rate $ \tilde{\mu}_{{k,i}}^{}$ for contacts of type k served by agents in group i.

Specified by:
getMaxServiceRate in interface CallCenterCTMC
Parameters:
k - the tested contact type.
i - the tested agent group.
Returns:
the service rate.

setMaxServiceRate

public void setMaxServiceRate(int k,
                              int i,
                              double muki)
Description copied from interface: CallCenterCTMC
Sets the maximal service rate for contacts of type k served by agents in group i to muki. This method can change the transition and recompute search indexes, so using it repeatedly might degrade performance. It is recommended to use CallCenterCTMC.setServiceRate(int,int,double) instead.

Specified by:
setMaxServiceRate in interface CallCenterCTMC
Parameters:
k - the affected contact type.
i - the affected agent group.
muki - the new maximal service rate.

initEmpty

public void initEmpty()
Description copied from interface: CallCenterCTMC
Initializes the system to an empty call center, and resets the counter giving the number of transitions done to 0.

Specified by:
initEmpty in interface CallCenterCTMC

init

public void init(CallCenterCTMC ctmc)
Description copied from interface: CallCenterCTMC
Initializes the state of this CTMC with the state of the other CTMC ctmc. The parameters of this CTMC, e.g., arrival rates, service rates, etc., are unchanged while the state is set to the state of the given CTMC. This method throws an IllegalArgumentException if the given CTMC is incompatible with this CTMC, e.g., the number of contact types or agent groups differ.

Specified by:
init in interface CallCenterCTMC
Parameters:
ctmc - the CTMC to initialize the state from.

selectContact

public boolean selectContact(int i)
Description copied from interface: CallCenterCTMC
Selects a new queued contact for a free agent in group i, and returns a boolean indicator determining if a contact could be selected. After this method returns true, the method CallCenterCTMC.getLastSelectedAgentGroup() returns the value of i while CallCenterCTMC.getLastSelectedQueuedContactType() returns the type of the contact assigned to the free agent. This method can be used, e.g., when agents are added in some groups during a simulation.

Specified by:
selectContact in interface CallCenterCTMC
Parameters:
i - the agent group index.
Returns:
determines whether a contact is removed from a queue.

nextState

public TransitionType nextState(double u)
Description copied from interface: CallCenterCTMC
Generates the next state of the CTMC randomly from the current state, using the given uniform u, and changes the current state to this new state. The method then returns the type of transition being generated. Depending on the transition type, additional information about the selected contact type or agent group can be obtained using CallCenterCTMC.getLastSelectedContactType(), CallCenterCTMC.getLastSelectedQueuedContactType(), or CallCenterCTMC.getLastSelectedAgentGroup().

Specified by:
nextState in interface CallCenterCTMC
Parameters:
u - the uniform used to generate the new state.
Returns:
the type of the generated transition.

nextStateInt

public TransitionType nextStateInt(int rv)
Description copied from interface: CallCenterCTMC
Similar to CallCenterCTMC.nextState(double), except that the given random variate v is uniformly distributed over [0, 231 - 1].

Specified by:
nextStateInt in interface CallCenterCTMC
Parameters:
rv - the uniform random integer.
Returns:
the type of the generated transition.

getNextTransition

public TransitionType getNextTransition(double u)
Description copied from interface: CallCenterCTMC
Returns the type of the next transition generated using the random number u. This method is similar to CallCenterCTMC.nextState(double), except that it does not alter the state of the CTMC.

Specified by:
getNextTransition in interface CallCenterCTMC
Parameters:
u - the random number for the state generation.
Returns:
the type of the next transition.

getNextTransitionInt

public TransitionType getNextTransitionInt(int rv)
Description copied from interface: CallCenterCTMC
Similar to CallCenterCTMC.getNextTransition(double), using a random integer rather than a uniform number.

Specified by:
getNextTransitionInt in interface CallCenterCTMC
Parameters:
rv - the random number used for generating the transition.
Returns:
the type of the next transition.

generateArrivalQueued

public void generateArrivalQueued(int k,
                                  int np1,
                                  int nf1)
Description copied from interface: CallCenterCTMC
Generates the arrival of a contact of type k, and adds the new contact to the waiting queue. This method throws an IllegalStateException if the queue is full before the arrival.

Specified by:
generateArrivalQueued in interface CallCenterCTMC
Parameters:
k - the type of the new contact.
np1 - the number of false transitions preceding the main transition.
nf1 - the number of false transitions following the main transition.

generateArrivalServed

public void generateArrivalServed(int k,
                                  int i,
                                  int np1,
                                  int nf1)
Description copied from interface: CallCenterCTMC
Generates the arrival of a contact of type k served by an agent in group i. If all agents are busy in group i, this method throws an IllegalStateException.

Specified by:
generateArrivalServed in interface CallCenterCTMC
Parameters:
k - the contact type.
i - the agent group.
np1 - the number of false transitions preceding the main transition.
nf1 - the number of false transitions following the main transition.

generateEndService

public void generateEndService(int k,
                               int i,
                               int kp,
                               int np1,
                               int nf1)
Description copied from interface: CallCenterCTMC
Generates the end of the service for a contact of type k served by an agent in group i, and assigns the kposth queued contact of type kp to the free agent. If no contact of type k are in service by agents in group i, this method throws an IllegalStateException.

Specified by:
generateEndService in interface CallCenterCTMC
Parameters:
k - the type of the contact ending service.
i - the group of the agent ending service.
kp - the type of the dequeued contact.
np1 - the number of false transitions preceding the main transition.
nf1 - the number of false transitions following the main transition.

generateEndService

public void generateEndService(int k,
                               int i,
                               int np1,
                               int nf1)
Description copied from interface: CallCenterCTMC
Generates the end of the service for a contact of type k served by an agent in group i. If no contact of type k are in service by agents in group i, this method throws an IllegalStateException.

Specified by:
generateEndService in interface CallCenterCTMC
Parameters:
k - the type of the contact.
i - the group of the agent.
np1 - the number of false transitions preceding the main transition.
nf1 - the number of false transitions following the main transition.

generateFalseTransition

public void generateFalseTransition(int np1,
                                    int nf1)
Description copied from interface: CallCenterCTMC
Generates a false transition. This method only updates the transition counter of the CTMC.

Specified by:
generateFalseTransition in interface CallCenterCTMC
Parameters:
np1 - the number of false transitions preceding the main transition.
nf1 - the number of false transitions following the main transition.

generateAbandonment

public void generateAbandonment(int k,
                                int kpos,
                                int np1,
                                int nf1)
Description copied from interface: CallCenterCTMC
Generates the abandonment of the kposth contact of type k. This method throws an IllegalStateException if kpos is negative or greater than or equal to the number of queued contacts of type k.

Specified by:
generateAbandonment in interface CallCenterCTMC
Parameters:
k - the contact type.
kpos - the position of the contact in queue.
np1 - the number of false transitions preceding the main transition.
nf1 - the number of false transitions following the main transition.

generateArrival

public void generateArrival(int k,
                            int np1,
                            int nf1)
Description copied from interface: CallCenterCTMC
Generates the arrival of a contact of type k being blocked or balking.

Specified by:
generateArrival in interface CallCenterCTMC
Parameters:
k - the type of the arrival.
np1 - the number of false transitions preceding the main transition.
nf1 - the number of false transitions following the main transition.

clone

public CallCenterCTMCKI clone()
Description copied from interface: CallCenterCTMC
Returns an independent copy of this call center CTMC. In particular, calling CallCenterCTMC.nextState(double) on the returned CTMC should not affect the state of any other CTMC.

Specified by:
clone in interface CallCenterCTMC
Overrides:
clone in class Object
Returns:
the clone of the chain.

equalsState

public boolean equalsState(Object obj)
Description copied from interface: CallCenterCTMC
Determines if the state of this CTMC is the same as the state of the CTMC o. If o does not correspond to an instance of CallCenterCTMC, this method should return false.

Specified by:
equalsState in interface CallCenterCTMC
Parameters:
obj - the object to test.
Returns:
the result of the equality test.

hashCodeState

public int hashCodeState()
Description copied from interface: CallCenterCTMC
Computes and returns a hash code using the current state of the CTMC. The returned hash code should be $ \htsum_{{i=1}}^{I}$Ki$ \htsum_{{k=1}}^{K}$Sk, i + KI+1$ \htsum_{{k=1}}^{K}$Qk + KI+2n where Ki = $ \htprod_{{j=1}}^{{i-1}}$$ \tilde{N}_{j}^{}$ for i = 1,…, I + 1, and KI+1 = KI+1H.

Specified by:
hashCodeState in interface CallCenterCTMC
Returns:
the computed hash code.

toString

public String toString()
Overrides:
toString in class Object

getTargetNumTransitions

public int getTargetNumTransitions()
Description copied from interface: CallCenterCTMC
Returns the current target number of transitions. Sometimes, CallCenterCTMC.nextState(double) or CallCenterCTMC.nextStateInt(int) generate several false transitions with a single random number. When the number of transitions done is near the target number of transitions, the final number of transitions may then exceed the target.

When a target number of transition is specified, no more state change occur after the target is reach. Moreover, when the return value of CallCenterCTMC.getNumTransitionsDone() is greater than or equal to the value returned by this method, CallCenterCTMC.nextState(double), and CallCenterCTMC.nextStateInt(int) throw an IllegalStateException.

The default target number of transitions is Integer.MAX_VALUE.

Specified by:
getTargetNumTransitions in interface CallCenterCTMC
Returns:
the current target number of transitions.

setTargetNumTransitions

public void setTargetNumTransitions(int tntr)
Description copied from interface: CallCenterCTMC
Sets the target number of transitions to tntr.

Specified by:
setTargetNumTransitions in interface CallCenterCTMC
Parameters:
tntr - the new target number of transitions.

ContactCenters
V. 0.9.9.

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