ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters.msk.stat
Class CallCenterMeasureManager

java.lang.Object
  extended by umontreal.iro.lecuyer.contactcenters.msk.stat.CallCenterMeasureManager

public abstract class CallCenterMeasureManager
extends Object

Encapsulates the matrices of counters collecting observations during simulation, and provides methods to determine which types of counters are supported, and to extract matrices of observations from the counters.

This class encapsulates observers used to update counters. Therefore, any instance of this class should be registered with the call center using the registerListeners() for listeners to be registered.

Each matrix of counters has a type represented by an enum constant in MeasureType. This type determines the role played by rows in the matrix of counters. The user can determine for which type of measures statistics are collected by giving a list of MeasureType instances to the constructor of CallCenterMeasureManager. This list can be retrieved by using the getMeasures() method.

The columns correspond to time intervals which are determined with the help of a StatPeriod implementation. Such an implementation gives the number of needed time intervals as well as a function mapping each contact, and each simulation time, to one of the columns. Usually, there is one column per period. The StatPeriod implementation of a measure manager can be obtained using the getStatPeriod() method.

The raw matrices of counters can be obtained using //important de noter the getMeasureMatrix(MeasureType) method. However, most measure managers regroup periods and normalizes values with respect to time in order to prepare matrices of observations for statistical collectors. This preparation is performed by the method getValues(MeasureType,boolean).

The number of columns in the matrices of observations, the way periods are regrouped, and how time is normalized are determined by the subclass implementing the getNumPeriodsForStatProbes(), getValues(MeasureType,boolean), and timeNormalize(MeasureType,DoubleMatrix2D) abstract methods. These methods need to be overridden by a concrete subclass.


Constructor Summary
CallCenterMeasureManager(CallCenter cc, StatPeriod statP, boolean contactTypeAgentGroup)
          Creates a measure manager for all possible types of measures on the call center model cc, and using statP to obtain the statistical periods of calls.
CallCenterMeasureManager(CallCenter cc, StatPeriod statP, boolean contactTypeAgentGroup, Collection<MeasureType> measures)
          Similar to CallCenterMeasureManager(CallCenter,StatPeriod,boolean), for a given collection of measure types.
CallCenterMeasureManager(CallCenter cc, StatPeriod statP, boolean contactTypeAgentGroup, PerformanceMeasureType[] pms)
          Similar to CallCenterMeasureManager(CallCenter,StatPeriod,boolean), for a given subset of the types of performance measures.
 
Method Summary
 void finishCurrentPeriod()
          Indicates the end of the current statistical period, whose index p is returned by StatPeriod.getStatPeriod().
 CallByCallMeasureManager getCallByCallMeasureManager()
          Returns the call-by-call measure manager used by this object.
 IntegralMeasureMatrix<GroupVolumeStatMeasureMatrix>[] getGroupVolumeStats()
          Returns the array of integral measure matrices used to compute measures related to agent groups.
 MeasureMatrix getMeasureMatrix(MeasureType mt)
          Returns the measure matrix corresponding to the measure type mt.
 MeasureType[] getMeasures()
          Returns an array containing all the measure types supported by this object.
static Set<MeasureType> getMeasureTypes(PerformanceMeasureType... pms)
          Returns the types of counters needed to estimate all the performance measures in pms.
 ArrayList<String>[] getMeasureTypesMse()
           
static MeasureType[] getMeasureTypesPm(PerformanceMeasureType pm)
          Returns the types of counters needed to estimate the particular type of performance measure pm.
abstract  int getNumPeriodsForStatProbes()
          Returns the number of periods in matrices of statistical probes used to collect statistics about the simulation.
 IntegralMeasureMatrix<QueueSizeStatMeasureMatrix>[] getQueueSizeIntegralStats()
          Return the array of integral measure matrices used to compute queue sizes.
 StatPeriod getStatPeriod()
          Returns the object determining how columns of matrices of counters are mapped to time intervals.
static PerformanceMeasureType[] getSupportedPerformanceMeasures()
          Returns the array of all types of performance measures supported by this measure manager.
abstract  DoubleMatrix2D getValues(MeasureType mt, boolean norm)
          Converts a matrix of counters constructed during the simulation to a matrix of double-precision observations to be added to a matching matrix of tallies.
 boolean hasMeasureMatricesFor(PerformanceMeasureType pm)
          Determines if this simulator computes the measure matrices required to estimate performance measures of type pm.
 boolean hasMeasureMatrix(MeasureType mt)
          Determines if this object has a measure matrix for the measure type mt.
 void initMeasureMatrices()
          Initializes the measure matrices defined by this object.
 boolean isContactTypeAgentGroup()
          Returns true if this group of call center measures contains matrices whose rows correspond to counters concerning (contact type, agent group) pairs.
 void registerListeners()
          Registers listeners required to get statistics during simulation.
abstract  void timeNormalize(MeasureType mt, DoubleMatrix2D m)
          Normalizes the measures in m using simulation time.
 void unregisterListeners()
          Unregisters listeners required to get statistics during simulation.
 void updateCurrentPeriod()
          Updates the current statistical period.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CallCenterMeasureManager

public CallCenterMeasureManager(CallCenter cc,
                                StatPeriod statP,
                                boolean contactTypeAgentGroup)
Creates a measure manager for all possible types of measures on the call center model cc, and using statP to obtain the statistical periods of calls. The boolean contactTypeAgentGroup is used to determine if matrices of counters contain rows of type (call type, agent group). See the constructor CallByCallMeasureManager.CallByCallMeasureManager(CallCenter,StatPeriod,boolean) for more information about this.

Parameters:
cc - the call center model.
statP - the object used to obtain statistical periods.
contactTypeAgentGroup - determines if rows of type (call type, agent group) are needed.

CallCenterMeasureManager

public CallCenterMeasureManager(CallCenter cc,
                                StatPeriod statP,
                                boolean contactTypeAgentGroup,
                                PerformanceMeasureType[] pms)
Similar to CallCenterMeasureManager(CallCenter,StatPeriod,boolean), for a given subset of the types of performance measures. The subset is obtained by calling the getMeasureTypes(PerformanceMeasureType[]) static method.


CallCenterMeasureManager

public CallCenterMeasureManager(CallCenter cc,
                                StatPeriod statP,
                                boolean contactTypeAgentGroup,
                                Collection<MeasureType> measures)
Similar to CallCenterMeasureManager(CallCenter,StatPeriod,boolean), for a given collection of measure types.

Method Detail

getSupportedPerformanceMeasures

public static PerformanceMeasureType[] getSupportedPerformanceMeasures()
Returns the array of all types of performance measures supported by this measure manager.


getMeasureTypesMse

public ArrayList<String>[] getMeasureTypesMse()

getMeasureTypesPm

public static MeasureType[] getMeasureTypesPm(PerformanceMeasureType pm)
Returns the types of counters needed to estimate the particular type of performance measure pm.

Parameters:
pm - the tested type of performance measure.
Returns:
the array of needed types of counters.

getMeasureTypes

public static Set<MeasureType> getMeasureTypes(PerformanceMeasureType... pms)
Returns the types of counters needed to estimate all the performance measures in pms.

Parameters:
pms - the tested types of performance measures.
Returns:
the set of measure types.

getStatPeriod

public StatPeriod getStatPeriod()
Returns the object determining how columns of matrices of counters are mapped to time intervals.


getCallByCallMeasureManager

public CallByCallMeasureManager getCallByCallMeasureManager()
Returns the call-by-call measure manager used by this object.


isContactTypeAgentGroup

public boolean isContactTypeAgentGroup()
Returns true if this group of call center measures contains matrices whose rows correspond to counters concerning (contact type, agent group) pairs. If no matrix with rows of type (contact type, agent group) is present, this returns false.


hasMeasureMatricesFor

public boolean hasMeasureMatricesFor(PerformanceMeasureType pm)
Determines if this simulator computes the measure matrices required to estimate performance measures of type pm.

Parameters:
pm - the tested type of performance measures.
Returns:
true of the measures can be estimated, false otherwise.

initMeasureMatrices

public void initMeasureMatrices()
Initializes the measure matrices defined by this object.


finishCurrentPeriod

public void finishCurrentPeriod()
Indicates the end of the current statistical period, whose index p is returned by StatPeriod.getStatPeriod(). This method updates the columns p of matrices of counters containing integrals with respect to simulation time. These matrices contain, for example, the time-average queue size, time-average number of busy agents, etc.


updateCurrentPeriod

public void updateCurrentPeriod()
Updates the current statistical period. For any period p preceding the current statistical period, this method fills up the columns p of matrices of counters containing integrals with respect to simulation time. It also initializes the maximal queue size and maximal number of busy agents for the current statistical period.


getMeasures

public MeasureType[] getMeasures()
Returns an array containing all the measure types supported by this object.

Returns:
an array of measure types.

hasMeasureMatrix

public boolean hasMeasureMatrix(MeasureType mt)
Determines if this object has a measure matrix for the measure type mt.

Parameters:
mt - the tested measure type.
Returns:
true if and only if a measure matrix of the tested type is available.

getMeasureMatrix

public MeasureMatrix getMeasureMatrix(MeasureType mt)
Returns the measure matrix corresponding to the measure type mt. This method is mainly used by the getValues(MeasureType,boolean) method of subclasses. One should call getValues(MeasureType,boolean) instead to get matrices of counters from measure types.

Parameters:
mt - the tested measure type.
Returns:
the measure matrix.

getGroupVolumeStats

public IntegralMeasureMatrix<GroupVolumeStatMeasureMatrix>[] getGroupVolumeStats()
Returns the array of integral measure matrices used to compute measures related to agent groups. Each element of this array corresponds to an agent group.

Returns:
the integral measure matrices for agent groups.

getQueueSizeIntegralStats

public IntegralMeasureMatrix<QueueSizeStatMeasureMatrix>[] getQueueSizeIntegralStats()
Return the array of integral measure matrices used to compute queue sizes. Each element of this array corresponds to a waiting queue.

Returns:
the integral measure matrices for waiting queues.

registerListeners

public void registerListeners()
Registers listeners required to get statistics during simulation.


unregisterListeners

public void unregisterListeners()
Unregisters listeners required to get statistics during simulation.


getNumPeriodsForStatProbes

public abstract int getNumPeriodsForStatProbes()
Returns the number of periods in matrices of statistical probes used to collect statistics about the simulation. This usually returns P', the number of segments regrouping main periods. However, for steady-state simulations, this returns 1.

Returns:
the number of periods for statistics.

getValues

public abstract DoubleMatrix2D getValues(MeasureType mt,
                                         boolean norm)
Converts a matrix of counters constructed during the simulation to a matrix of double-precision observations to be added to a matching matrix of tallies. The format of raw measures stored into the matrix of counters is specific to the simulation type. This method formats these measures into a matrix with one row for each measure type, and one column for each segment of main periods.

If norm is true, the measures are normalized to the default time unit if they correspond to durations. This normalization is performed by calling timeNormalize(MeasureType,DoubleMatrix2D). Otherwise, time durations are relative to the length of the corresponding period.

Matrices of counters have a number of periods depending on the type of measures collected. The output matrix of observations has getNumPeriodsForStatProbes() columns. See the documentation of MeasureType for more information about measure types.

Parameters:
mt - the measure type queried.
norm - determines if normalization to default time unit is done.
Returns:
the matrix of values.

timeNormalize

public abstract void timeNormalize(MeasureType mt,
                                   DoubleMatrix2D m)
Normalizes the measures in m using simulation time. This method must normalize time durations to the default simulation time unit by dividing every value by the correct period duration. The given matrix should have getNumPeriodsForStatProbes() columns.

Parameters:
mt - the type of measure being processed.
m - the matrix of values, obtained by getValues(MeasureType,boolean).

ContactCenters
V. 0.9.9.

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