ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters.ctmc
Class CallCenterCTMC11WithQueues

java.lang.Object
  extended by umontreal.iro.lecuyer.contactcenters.ctmc.CallCenterCTMC11
      extended by umontreal.iro.lecuyer.contactcenters.ctmc.CallCenterCTMC11WithQueues
All Implemented Interfaces:
Cloneable, CallCenterCTMC, CallCenterCTMCWithQueues

public class CallCenterCTMC11WithQueues
extends CallCenterCTMC11
implements CallCenterCTMCWithQueues

Extension of the CTMC model for a single contact type and agent group, with information on contacts waiting in queue.


Constructor Summary
CallCenterCTMC11WithQueues(double lambda, double maxLambda, double mu, double maxMu, int numAgents, int maxNumAgents, double rho, double nu, double maxNu, int queueCapacity, int maxQueueCapacity, int[][] thresholds)
           
 
Method Summary
 CallCenterCTMC11WithQueues clone()
          Returns an independent copy of this call center CTMC.
 void generateAbandonment(int k, int kpos, int np, int nf)
          Generates the abandonment of the kposth contact of type k.
 void generateArrival(int k, int np, int nf)
          Generates the arrival of a contact of type k being blocked or balking.
 void generateArrivalQueued(int k, int np, int nf)
          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 np, int nf)
          Generates the arrival of a contact of type k served by an agent in group i.
 void generateEndService(int k, int i, int kp, int np, int nf)
          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.
 int getLastWaitingTime(int k)
          ?eturns waiting time of the last contact of type k having entered service, or abandoned.
 int getLongestWaitingTime(int k)
          Returns the longest waiting time among all contacts of type k.
 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 v)
          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.
 
Methods inherited from class umontreal.iro.lecuyer.contactcenters.ctmc.CallCenterCTMC11
equalsState, generateEndService, generateFalseTransition, getArrivalRate, getArrivalRate, getJumpRate, getLastSelectedAgentGroup, getLastSelectedContact, getLastSelectedContactType, getLastSelectedQueuedContactType, getLastTransitionType, getMaxArrivalRate, getMaxArrivalRate, getMaxNumAgents, getMaxNumAgents, getMaxNumAgentsArray, getMaxPatienceRate, getMaxQueueCapacity, getMaxServiceRate, getNextTransition, getNextTransitionInt, getNumAgentGroups, getNumAgents, getNumAgents, getNumAgentsArray, getNumContactsInQueue, getNumContactsInQueue, getNumContactsInService, getNumContactsInService, getNumContactsInServiceI, getNumContactsInServiceK, getNumContactTypes, getNumFollowingFalseTransitions, getNumPrecedingFalseTransitions, getNumStateThresh, getNumTransitionsDone, getPatienceRate, getProbBalking, getQueueCapacity, getRanksGT, getRanksTG, getServiceRate, getStateThresh, getStateThresholds, getTargetNumTransitions, hashCodeState, setArrivalRate, setArrivalRates, setMaxArrivalRate, setMaxArrivalRates, setMaxNumAgents, setMaxNumAgents, setMaxPatienceRate, setMaxQueueCapacity, setMaxServiceRate, setNumAgents, setNumAgents, setPatienceRate, setProbBalking, setQueueCapacity, setServiceRate, setStateThresholds, setTargetNumTransitions, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface umontreal.iro.lecuyer.contactcenters.ctmc.CallCenterCTMC
equalsState, generateEndService, generateFalseTransition, getArrivalRate, getArrivalRate, getJumpRate, getLastSelectedAgentGroup, getLastSelectedContact, getLastSelectedContactType, getLastSelectedQueuedContactType, getLastTransitionType, getMaxArrivalRate, getMaxArrivalRate, getMaxNumAgents, getMaxNumAgents, getMaxNumAgentsArray, getMaxPatienceRate, getMaxQueueCapacity, getMaxServiceRate, getNextTransition, getNextTransitionInt, getNumAgentGroups, getNumAgents, getNumAgents, getNumAgentsArray, getNumContactsInQueue, getNumContactsInQueue, getNumContactsInService, getNumContactsInService, getNumContactsInServiceI, getNumContactsInServiceK, getNumContactTypes, getNumFollowingFalseTransitions, getNumPrecedingFalseTransitions, getNumStateThresh, getNumTransitionsDone, getPatienceRate, getProbBalking, getQueueCapacity, getRanksGT, getRanksTG, getServiceRate, getStateThresh, getStateThresholds, getTargetNumTransitions, hashCodeState, setArrivalRate, setArrivalRates, setMaxArrivalRate, setMaxArrivalRates, setMaxNumAgents, setMaxNumAgents, setMaxPatienceRate, setMaxQueueCapacity, setMaxServiceRate, setNumAgents, setNumAgents, setPatienceRate, setProbBalking, setQueueCapacity, setServiceRate, setStateThresholds, setTargetNumTransitions
 

Constructor Detail

CallCenterCTMC11WithQueues

public CallCenterCTMC11WithQueues(double lambda,
                                  double maxLambda,
                                  double mu,
                                  double maxMu,
                                  int numAgents,
                                  int maxNumAgents,
                                  double rho,
                                  double nu,
                                  double maxNu,
                                  int queueCapacity,
                                  int maxQueueCapacity,
                                  int[][] thresholds)
Method Detail

getLastWaitingTime

public int getLastWaitingTime(int k)
Description copied from interface: CallCenterCTMCWithQueues
?eturns waiting time of the last contact of type k having entered service, or abandoned. If no such contact exists, this method returns 0.

Specified by:
getLastWaitingTime in interface CallCenterCTMCWithQueues
Parameters:
k - the queried tppe of contact.
Returns:
the last waiting time.

getLongestWaitingTime

public int getLongestWaitingTime(int k)
Description copied from interface: CallCenterCTMCWithQueues
Returns the longest waiting time among all contacts of type k. This returns 0 if no contact of type k is waiting in queue.

Specified by:
getLongestWaitingTime in interface CallCenterCTMCWithQueues
Parameters:
k - the queried contact type.
Returns:
the longest waiting time.

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
Overrides:
initEmpty in class CallCenterCTMC11

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
Overrides:
init in class CallCenterCTMC11
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
Overrides:
selectContact in class CallCenterCTMC11
Parameters:
i - the agent group index.
Returns:
determines whether a contact is removed from a queue.

nextStateInt

public TransitionType nextStateInt(int v)
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
Overrides:
nextStateInt in class CallCenterCTMC11
Parameters:
v - the uniform random integer.
Returns:
the type of the generated transition.

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
Overrides:
nextState in class CallCenterCTMC11
Parameters:
u - the uniform used to generate the new state.
Returns:
the type of the generated transition.

generateAbandonment

public void generateAbandonment(int k,
                                int kpos,
                                int np,
                                int nf)
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
Overrides:
generateAbandonment in class CallCenterCTMC11
Parameters:
k - the contact type.
kpos - the position of the contact in queue.
np - the number of false transitions preceding the main transition.
nf - the number of false transitions following the main transition.

generateArrivalQueued

public void generateArrivalQueued(int k,
                                  int np,
                                  int nf)
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
Overrides:
generateArrivalQueued in class CallCenterCTMC11
Parameters:
k - the type of the new contact.
np - the number of false transitions preceding the main transition.
nf - the number of false transitions following the main transition.

generateArrivalServed

public void generateArrivalServed(int k,
                                  int i,
                                  int np,
                                  int nf)
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
Overrides:
generateArrivalServed in class CallCenterCTMC11
Parameters:
k - the contact type.
i - the agent group.
np - the number of false transitions preceding the main transition.
nf - the number of false transitions following the main transition.

generateEndService

public void generateEndService(int k,
                               int i,
                               int kp,
                               int np,
                               int nf)
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
Overrides:
generateEndService in class CallCenterCTMC11
Parameters:
k - the type of the contact ending service.
i - the group of the agent ending service.
kp - the type of the dequeued contact.
np - the number of false transitions preceding the main transition.
nf - the number of false transitions following the main transition.

generateArrival

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

Specified by:
generateArrival in interface CallCenterCTMC
Overrides:
generateArrival in class CallCenterCTMC11
Parameters:
k - the type of the arrival.
np - the number of false transitions preceding the main transition.
nf - the number of false transitions following the main transition.

clone

public CallCenterCTMC11WithQueues 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 CallCenterCTMC11
Returns:
the clone of the chain.

ContactCenters
V. 0.9.9.

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