ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters.ctmc
Class CallCenterCounters

java.lang.Object
  extended by umontreal.iro.lecuyer.contactcenters.ctmc.CallCenterCounters
All Implemented Interfaces:
Cloneable

public class CallCenterCounters
extends Object
implements Cloneable

Represents statistical counters computing sums for individual replications of a simulation of a call center using a discrete-time Markov chain. After a simulator constructs an instance of this class, it calls init(CallCenterCTMC,double,int) at the beginning of each replication, and then uses collectStat(CallCenterCTMC,TransitionType) for each simulated transition. At the end of the simulation, the method updateStatOnTime(CallCenterCTMC) should also be called.


Field Summary
 double[] busyAgents
           
 double[] maxBusyAgents
           
 double[] maxQueueSize
           
 double[] numAbandoned
           
 double[] numAbandonedBeforeAWT
           
 double[] numAbandonedBeforeAWTG
           
 double[] numArrivals
           
 double[] numBlocked
           
 double numFalseTransitions
           
 double[] numServedBeforeAWT
           
 double[] numServedBeforeAWTG
           
 double numTransitions
           
 double[] queueSize
           
 double[] servedRates
           
 double[] sumWaitingTimesAbandoned
           
 double[] sumWaitingTimesServed
           
 double[] totalAgents
           
 
Constructor Summary
CallCenterCounters(CallCenterCTMC ctmc, double[] awt, boolean randomHorizon)
          Constructs a new set of call center counters using the given CTMC to obtain the number of call types, agent groups, etc.
CallCenterCounters(CallCenterCTMC ctmc, double[] awt, double[] gawt, boolean randomHorizon, double[] jumpRate, int[] startingTransition, int counterPeriod)
          Similar to constructor CallCenterCounters(CallCenterCTMC,double[],boolean), for a case with multiple periods.
 
Method Summary
 CallCenterCounters clone()
          Returns a copy of this set of counters.
 void collectStat(CallCenterCTMC ctmc, TransitionType type)
          Collects statistics concerning the last transition of the CTMC ctmc with type type by updating the appropriate counters.
 void collectSum(boolean lastTimeAvg, boolean statAWTG, CallCenterCounters... counters)
          For each counter of this set, replaces the current value with the sum of the values of all corresponding counters in the sets given by the array counters.
 AccumulateWithTimes[] getStatTotalAgents()
           
 double[] getTotalAgents()
           
 void init(CallCenterCTMC ctmc, double timeHorizon, int ntr)
          Initializes this set of counters using the given call center CTMC ctmc, for a simulation over a time horizon timeHorizon with ntr transitions.
 String toString()
          Returns a string giving the number of counted arrivals, abandoned calls, and calls waiting less than the acceptable waiting time.
 void updateStatOnTime(CallCenterCTMC ctmc)
          Updates the arrays queueSize, busyAgents, and totalAgents for this set of counters from the corresponding accumulates computing time-averages for the queue size, number of busy agents, and total number of agents, respectively.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

numArrivals

public double[] numArrivals

numBlocked

public double[] numBlocked

numAbandoned

public double[] numAbandoned

queueSize

public double[] queueSize

busyAgents

public double[] busyAgents

totalAgents

public double[] totalAgents

servedRates

public double[] servedRates

maxQueueSize

public double[] maxQueueSize

maxBusyAgents

public double[] maxBusyAgents

numTransitions

public double numTransitions

numFalseTransitions

public double numFalseTransitions

numServedBeforeAWT

public double[] numServedBeforeAWT

numAbandonedBeforeAWT

public double[] numAbandonedBeforeAWT

numServedBeforeAWTG

public double[] numServedBeforeAWTG

numAbandonedBeforeAWTG

public double[] numAbandonedBeforeAWTG

sumWaitingTimesServed

public double[] sumWaitingTimesServed

sumWaitingTimesAbandoned

public double[] sumWaitingTimesAbandoned
Constructor Detail

CallCenterCounters

public CallCenterCounters(CallCenterCTMC ctmc,
                          double[] awt,
                          boolean randomHorizon)
Constructs a new set of call center counters using the given CTMC to obtain the number of call types, agent groups, etc. The argument awt contains a vector giving the acceptable waiting times for estimating the expected number of calls waiting less than a given time limit. Element sK' + k of this array gives the sth AWT for calls of type k if k = 0,…, K - 1, or for calls of all types if k = K. Here, K' = K + 1 if K > 1, or K otherwise. This can be null if performance measures based on acceptable waiting times are not estimated.

The boolean randomHorizon is set to true if we are simulating on a random horizon, or false for deterministic horizon. The horizon type has an impact on how some performance measures are estimated.

Parameters:
ctmc - the call center model.
awt - the vector of acceptable waiting times.
randomHorizon - true for a random time horizon, false for a deterministic horizon.

CallCenterCounters

public CallCenterCounters(CallCenterCTMC ctmc,
                          double[] awt,
                          double[] gawt,
                          boolean randomHorizon,
                          double[] jumpRate,
                          int[] startingTransition,
                          int counterPeriod)
Similar to constructor CallCenterCounters(CallCenterCTMC,double[],boolean), for a case with multiple periods. The additional argument gawt plays a role similar to awt, but contains thresholds used for all periods; this is used to estimate performance measures based of acceptable waiting times over the entire horizon while awt is used for the estimates over a single period.

The last three arguments are used to estimate performance measures for calls arriving into and leaving the system during different periods. The argument jumpRate contains a (P + 1)-dimensional vector of transition rates for each of the P + 1 period-specific CTMCs; there is P CTMCs for the main periods, plus one CTMC for the wrap-up period. The argument startingTransition, on the other hand, is a (P + 1)-dimensional vector giving the starting transition for each period; this is updated as the simulation is made. The argument counterPeriod gives the index of the period for which this set of counters computes sums.

Parameters:
ctmc - the call center model.
awt - the vector of period-specific acceptable waiting times.
gawt - the vector of global acceptable waiting times.
randomHorizon - true for a random time horizon, false for a deterministic horizon.
jumpRate - the per-period transition rates.
startingTransition - the starting transitions for each period.
counterPeriod - the period concerned by this counter.
Method Detail

init

public void init(CallCenterCTMC ctmc,
                 double timeHorizon,
                 int ntr)
Initializes this set of counters using the given call center CTMC ctmc, for a simulation over a time horizon timeHorizon with ntr transitions. For random horizon, the number of transitions is ignored.

Parameters:
ctmc - the call center CTMC.
timeHorizon - the time horizon.
ntr - the number of transitions to simulate.

collectSum

public void collectSum(boolean lastTimeAvg,
                       boolean statAWTG,
                       CallCenterCounters... counters)
For each counter of this set, replaces the current value with the sum of the values of all corresponding counters in the sets given by the array counters. This can be used to aggregate statistics from successive individual periods into a single counter.

The lastTimeAvg boolean determines if the last counter in the given array, which usually corresponds to counters concerning the wrap-up period, is taken into account when summing the time-average queue size and number of agents. This has no impact on other statistics.

If statAWTG is set to true, the number of calls waiting less than the acceptable waiting time, stored in fields numServedBeforeAWT and numAbandonedBeforeAWT, are determined by summing the numbers in fields numServedBeforeAWTG and numAbandonedBeforeAWTG in the counters of counters. If statAWTG is false, the fields numServedBeforeAWT and numAbandonedBeforeAWT are used instead.

Parameters:
lastTimeAvg - determines whether the last element in array counters is taken into account for average queue size and number of agents.
statAWTG - determines how the number of calls waiting less than the acceptable waiting time is summed up.
counters - the array of counters.

collectStat

public void collectStat(CallCenterCTMC ctmc,
                        TransitionType type)
Collects statistics concerning the last transition of the CTMC ctmc with type type by updating the appropriate counters.

Parameters:
ctmc - the call center CTMC.
type - the transition type.

updateStatOnTime

public void updateStatOnTime(CallCenterCTMC ctmc)
Updates the arrays queueSize, busyAgents, and totalAgents for this set of counters from the corresponding accumulates computing time-averages for the queue size, number of busy agents, and total number of agents, respectively. Note that the third quantity changes with time only in a multi-period setup.

Parameters:
ctmc - the call center CTMC.

getStatTotalAgents

public AccumulateWithTimes[] getStatTotalAgents()

getTotalAgents

public double[] getTotalAgents()

clone

public CallCenterCounters clone()
Returns a copy of this set of counters. This method creates a clone of each internal array in the set of counters.

Overrides:
clone in class Object

toString

public String toString()
Returns a string giving the number of counted arrivals, abandoned calls, and calls waiting less than the acceptable waiting time.

Overrides:
toString in class Object

ContactCenters
V. 0.9.9.

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