ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters.msk
Class CallCenterSimStrat

java.lang.Object
  extended by umontreal.iro.lecuyer.contactcenters.app.AbstractContactCenterInfo
      extended by umontreal.iro.lecuyer.contactcenters.app.AbstractContactCenterEval
          extended by umontreal.iro.lecuyer.contactcenters.app.AbstractContactCenterSim
              extended by umontreal.iro.lecuyer.contactcenters.msk.AbstractCallCenterSim
                  extended by umontreal.iro.lecuyer.contactcenters.msk.CallCenterSimStrat
All Implemented Interfaces:
ContactCenterEval, ContactCenterInfo, ContactCenterSim, ObservableContactCenterSim

public class CallCenterSimStrat
extends AbstractCallCenterSim

Defines a call center simulator using stratified sampling. This simulator stratifies on B, the busyness factor for inbound calls, and uses proportional allocation.


Field Summary
 
Fields inherited from class umontreal.iro.lecuyer.contactcenters.msk.AbstractCallCenterSim
ccm, logger
 
Fields inherited from class umontreal.iro.lecuyer.contactcenters.app.AbstractContactCenterSim
autoResetStartStream, seqSampEachEval
 
Constructor Summary
CallCenterSimStrat(CallCenterParams ccParams, StratSimParams simParams)
          Constructs a new stratified call center simulator using the call center parameters ccParams, the simulation parameters simParams, and simulating numStrata strata.
 
Method Summary
protected  void correctControlVariables(ControlVariable[] cvs)
           
protected  SimLogic createSimLogic(CallCenter cc, SimParams simParams1)
          Constructs and returns a SimLogic implementation for the simulation logic, using the given model and simulation parameters simParams.
 void disableControlVariables()
           
 void enableControlVariables(ControlVariable... cvs)
           
 void eval()
          Performs a simulation to evaluate the performance measures.
 double getBusynessFactor(int strat)
           
 CallCenterStatProbes getCallCenterStatProbes()
           
 DoubleMatrix2D[] getConfidenceInterval(PerformanceMeasureType m, double level)
          Returns confidence intervals on the means or ratios of means, for the group of performance measures m, with confidence level level.
 MatrixOfFunctionOfMultipleMeansTallies<?> getMatrixOfFunctionOfMultipleMeansTallies(PerformanceMeasureType m)
          Returns the matrix of function of multiple means tallies used to manage observations for estimating the performance measures in group m.
 MatrixOfStatProbes<?> getMatrixOfStatProbes(PerformanceMeasureType m)
          Returns the matrix of statistical probes used to manage observations for estimating the performance measures in group m.
 MatrixOfTallies<?> getMatrixOfTallies(PerformanceMeasureType m)
          Returns the matrix of tallies used to manage observations for estimating the performance measures in group m.
 DoubleMatrix2D getMax(PerformanceMeasureType pm)
          Returns a matrix of maximum values for the performance measure m.
 DoubleMatrix2D getMin(PerformanceMeasureType pm)
          Returns a matrix of minimum values for the group of performance measures m.
 DoubleMatrix2D getVariance(PerformanceMeasureType pm)
          Returns a matrix of sample variances for the group of performance measures m.
 DoubleMatrix2D getVariance(PerformanceMeasureType pm, boolean prop, boolean cv)
           
 DoubleMatrix2D getVarianceProp(PerformanceMeasureType pm)
           
 DoubleMatrix2D getVarMeanAcrossStrata(PerformanceMeasureType pm, boolean cv)
           
 DoubleMatrix2D getVarStandardDeviationAcrossStrata(PerformanceMeasureType pm, boolean cv)
           
 boolean isUsingControlVariables()
           
static void main(String[] args)
          Main method allowing to run this class from the command-line.
 void makePilotRuns()
           
 void reset()
          Resets this contact center evaluation system for new parameters.
 void reset(CallCenterParams ccParams, SimParams simParams1)
           
 void setOptimalAllocation(PerformanceMeasureType m, int r, int c, boolean cv)
          Sets the number of replications in each stratum for optimal allocation minimizing the variance of performance measure of type m, at row r and column c.
 void setProportionalAllocation()
          Initializes the number of replications in each stratum for proportional allocation.
protected  void simulateForFixedB(double u, int numReplications)
           
 
Methods inherited from class umontreal.iro.lecuyer.contactcenters.msk.AbstractCallCenterSim
abort, addContactCenterSimListener, applyControlVariables, clearContactCenterSimListeners, createControlVariables, createModel, finishEvaluation, formatReport, getAgentGroupName, getAgentGroupProperties, getAgentGroupSegmentName, getAgentGroupSegmentProperties, getCallCenter, getCallCenterMeasureManager, getCompletedSteps, getConfidenceLevel, getContactCenterSimListeners, getContactTypeName, getContactTypeProperties, getContactTypeSegmentName, getContactTypeSegmentProperties, getCpuTime, getDefaultUnit, getEvalOption, getEvalOptions, getInContactTypeSegmentName, getInContactTypeSegmentProperties, getMainPeriodName, getMainPeriodSegmentName, getMatrixOfAWTName, getModel, getNumAgentGroups, getNumAgentGroupSegments, getNumContactTypes, getNumContactTypeSegments, getNumInContactTypes, getNumInContactTypeSegments, getNumMainPeriods, getNumMainPeriodSegments, getNumMatricesOfAWT, getNumOutContactTypes, getNumOutContactTypeSegments, getNumWaitingQueues, getNumWaitingQueueSegments, getOutContactTypeSegmentName, getOutContactTypeSegmentProperties, getPerformanceMeasure, getPerformanceMeasures, getReportParams, getRequiredNewSteps, getSimLogic, getSimStoppingCondition, getWaitingQueueName, getWaitingQueueProperties, getWaitingQueueSegmentName, getWaitingQueueSegmentProperties, hasEvalOption, init, initControlVariableSupport, initTimer, initTrace, isAborted, isVerbose, newSeeds, prepareEvaluation, removeContactCenterSimListener, resetNextSubstream, resetStartStream, resetStartSubstream, seemsUnstable, setConfidenceLevel, setEvalOption, setReportParams, setSimStoppingCondition, setVerbose
 
Methods inherited from class umontreal.iro.lecuyer.contactcenters.app.AbstractContactCenterSim
formatStatistics, formatStatisticsExcel, formatStatisticsLaTeX, getAutoResetStartStream, getConfidenceInterval, getOneSimDone, getSeqSampEachEval, hasPerformanceMeasure, setAutoResetStartStream, setOneSimDone, setSeqSampEachEval
 
Methods inherited from class umontreal.iro.lecuyer.contactcenters.app.AbstractContactCenterEval
getEvalInfo
 
Methods inherited from class umontreal.iro.lecuyer.contactcenters.app.AbstractContactCenterInfo
getNumAgentGroupsWithSegments, getNumContactTypesWithSegments, getNumInContactTypesWithSegments, getNumMainPeriodsWithSegments, getNumOutContactTypesWithSegments, getNumWaitingQueuesWithSegments
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface umontreal.iro.lecuyer.contactcenters.app.ContactCenterSim
getAutoResetStartStream, getSeqSampEachEval, setAutoResetStartStream, setSeqSampEachEval
 
Methods inherited from interface umontreal.iro.lecuyer.contactcenters.app.ContactCenterEval
formatStatistics, formatStatisticsExcel, formatStatisticsLaTeX, getEvalInfo, hasPerformanceMeasure
 
Methods inherited from interface umontreal.iro.lecuyer.contactcenters.app.ContactCenterInfo
getNumAgentGroupsWithSegments, getNumContactTypesWithSegments, getNumInContactTypesWithSegments, getNumMainPeriodsWithSegments, getNumOutContactTypesWithSegments, getNumWaitingQueuesWithSegments
 

Constructor Detail

CallCenterSimStrat

public CallCenterSimStrat(CallCenterParams ccParams,
                          StratSimParams simParams)
                   throws CallCenterCreationException
Constructs a new stratified call center simulator using the call center parameters ccParams, the simulation parameters simParams, and simulating numStrata strata.

Parameters:
ccParams - the call center parameters.
simParams - the simulation parameters.
Throws:
CallCenterCreationException
Method Detail

getCallCenterStatProbes

public CallCenterStatProbes getCallCenterStatProbes()
Overrides:
getCallCenterStatProbes in class AbstractCallCenterSim

isUsingControlVariables

public boolean isUsingControlVariables()
Overrides:
isUsingControlVariables in class AbstractCallCenterSim

disableControlVariables

public void disableControlVariables()
Overrides:
disableControlVariables in class AbstractCallCenterSim

enableControlVariables

public void enableControlVariables(ControlVariable... cvs)
Overrides:
enableControlVariables in class AbstractCallCenterSim

correctControlVariables

protected void correctControlVariables(ControlVariable[] cvs)

simulateForFixedB

protected void simulateForFixedB(double u,
                                 int numReplications)

makePilotRuns

public void makePilotRuns()

getBusynessFactor

public double getBusynessFactor(int strat)

setProportionalAllocation

public void setProportionalAllocation()
Initializes the number of replications in each stratum for proportional allocation. This sets the number of replications ns to n/m, where n is the total number of replications and m is the number of strata.


setOptimalAllocation

public void setOptimalAllocation(PerformanceMeasureType m,
                                 int r,
                                 int c,
                                 boolean cv)
Sets the number of replications in each stratum for optimal allocation minimizing the variance of performance measure of type m, at row r and column c. The boolean cv determines if control variables are used. One must call makePilotRuns() before calling this method.

Parameters:
m - the type of performance measure.
r - the row index.
c - the column index.
cv - determines if control variables will be used.

eval

public void eval()
Description copied from interface: ContactCenterSim
Performs a simulation to evaluate the performance measures. Unless ContactCenterSim.getAutoResetStartStream() returns false, if ContactCenterSim.eval() is called multiple times without changing system parameters, ContactCenterEval.getPerformanceMeasure(PerformanceMeasureType) should return the same matrices of estimates after each call. This requires that random streams used for simulation be reset after each evaluation. Thus, before returning, this method should use RandomStream.resetStartSubstream() on all random streams in order to reset the seeds. It is also recommended to always use RandomStream.resetNextSubstream() for all random streams after any replication to improve synchronization of random streams.

Specified by:
eval in interface ContactCenterEval
Specified by:
eval in interface ContactCenterSim
Overrides:
eval in class AbstractCallCenterSim

getMatrixOfStatProbes

public MatrixOfStatProbes<?> getMatrixOfStatProbes(PerformanceMeasureType m)
Description copied from interface: ContactCenterSim
Returns the matrix of statistical probes used to manage observations for estimating the performance measures in group m. The particular subclass of the statistical probe matrix depends on the performance measure type only. For averages, this method must return a MatrixOfTallies object. For functions of multiple averages, e.g., ratios of averages, this must return a MatrixOfFunctionOfMultipleMeansTallies.

Specified by:
getMatrixOfStatProbes in interface ContactCenterSim
Overrides:
getMatrixOfStatProbes in class AbstractCallCenterSim
Parameters:
m - the group of performance measures of interest.
Returns:
the matrix of statistical probes.

getMatrixOfTallies

public MatrixOfTallies<?> getMatrixOfTallies(PerformanceMeasureType m)
Description copied from interface: ContactCenterSim
Returns the matrix of tallies used to manage observations for estimating the performance measures in group m. This matrix is available only for performance measures corresponding to expectations, not functions of expectations.

Specified by:
getMatrixOfTallies in interface ContactCenterSim
Overrides:
getMatrixOfTallies in class AbstractCallCenterSim
Parameters:
m - the group of performance measures of interest.
Returns:
the matrix of tallies.

getMatrixOfFunctionOfMultipleMeansTallies

public MatrixOfFunctionOfMultipleMeansTallies<?> getMatrixOfFunctionOfMultipleMeansTallies(PerformanceMeasureType m)
Description copied from interface: ContactCenterSim
Returns the matrix of function of multiple means tallies used to manage observations for estimating the performance measures in group m. This matrix is available only for performance measures corresponding functions of expectations.

Specified by:
getMatrixOfFunctionOfMultipleMeansTallies in interface ContactCenterSim
Overrides:
getMatrixOfFunctionOfMultipleMeansTallies in class AbstractCallCenterSim
Parameters:
m - the group of performance measures of interest.
Returns:
the matrix of function of multiple means tallies.

getVariance

public DoubleMatrix2D getVariance(PerformanceMeasureType pm,
                                  boolean prop,
                                  boolean cv)

getVarianceProp

public DoubleMatrix2D getVarianceProp(PerformanceMeasureType pm)

getVariance

public DoubleMatrix2D getVariance(PerformanceMeasureType pm)
Description copied from interface: ContactCenterSim
Returns a matrix of sample variances for the group of performance measures m. If the group of performance measures is not supported, or the sample variance cannot be computed, this method throws a NoSuchElementException.

Specified by:
getVariance in interface ContactCenterSim
Overrides:
getVariance in class AbstractCallCenterSim
Parameters:
pm - the queried group of performance measures.
Returns:
the matrix of sample variances.

getVarMeanAcrossStrata

public DoubleMatrix2D getVarMeanAcrossStrata(PerformanceMeasureType pm,
                                             boolean cv)

getVarStandardDeviationAcrossStrata

public DoubleMatrix2D getVarStandardDeviationAcrossStrata(PerformanceMeasureType pm,
                                                          boolean cv)

getMin

public DoubleMatrix2D getMin(PerformanceMeasureType pm)
Description copied from interface: ContactCenterSim
Returns a matrix of minimum values for the group of performance measures m. If the group of measures defines no minimum (e.g., a ratio of expectations), or it is not supported, this method throws NoSuchElementException.

Specified by:
getMin in interface ContactCenterSim
Overrides:
getMin in class AbstractCallCenterSim
Parameters:
pm - the queried group of performance measures.
Returns:
the matrix of minima.

getMax

public DoubleMatrix2D getMax(PerformanceMeasureType pm)
Description copied from interface: ContactCenterSim
Returns a matrix of maximum values for the performance measure m. If the group of measures defines no maximum (e.g., a ratio of expectations), or if it is not supported, this method throws NoSuchElementException.

Specified by:
getMax in interface ContactCenterSim
Overrides:
getMax in class AbstractCallCenterSim
Parameters:
pm - the queried group of performance measures.
Returns:
the matrix of maxima.

getConfidenceInterval

public DoubleMatrix2D[] getConfidenceInterval(PerformanceMeasureType m,
                                              double level)
Description copied from interface: ContactCenterSim
Returns confidence intervals on the means or ratios of means, for the group of performance measures m, with confidence level level. This must return an array of two matrices, the first containing the lower bound values and the second, the upper bound values. For an unbounded confidence interval, one of the two matrices can be null. For each element of the performance measure matrix, a confidence interval whose desired coverage probability is level must be computed, independently of the other elements in the matrix. As a result, the coverage probability of all computed intervals will be smaller than level. The way each interval is computed is implementation-specific.

Specified by:
getConfidenceInterval in interface ContactCenterSim
Overrides:
getConfidenceInterval in class AbstractCallCenterSim
Parameters:
m - the queried group of performance measures.
level - desired probability that, for a given performance measure, the (random) confidence interval covers the true mean (a constant).
Returns:
an array of two matrices containing lower and upper bounds of the confidence intervals.

reset

public void reset()
Description copied from interface: ContactCenterEval
Resets this contact center evaluation system for new parameters. Every cached or processed parameter should be reread from the parameter objects. In the case of the simulation, one should try to preserve random number seeds whenever possible, even if the contact center needs to be reconstructed. Some implementatios of this interface provide specialized reset methods allowing to change the associated parameter objects.

Specified by:
reset in interface ContactCenterEval
Overrides:
reset in class AbstractCallCenterSim

reset

public void reset(CallCenterParams ccParams,
                  SimParams simParams1)
           throws CallCenterCreationException
Overrides:
reset in class AbstractCallCenterSim
Throws:
CallCenterCreationException

createSimLogic

protected SimLogic createSimLogic(CallCenter cc,
                                  SimParams simParams1)
Description copied from class: AbstractCallCenterSim
Constructs and returns a SimLogic implementation for the simulation logic, using the given model and simulation parameters simParams.

By default, this method creates a RepLogic instance if simParams is an instance of RepSimParams, a BatchMeansLogic if simParams is an instance of BatchSimParams, and throws an exception otherwise.

Overrides:
createSimLogic in class AbstractCallCenterSim
Parameters:
cc - the simulation model.
simParams1 - the simulation parameters.
Returns:
the simulation logic.

main

public static void main(String[] args)
                 throws IOException,
                        JAXBException,
                        CallCenterCreationException
Main method allowing to run this class from the command-line. The needed command-line arguments are the name of an XML file containing the non-stationary simulation parameters (root element mskccparams), and the name of a second XML file containing the simulation parameters (root elements batchsimparams or repsimparams).

Parameters:
args - the command-line arguments.
Throws:
IOException
JAXBException
CallCenterCreationException

ContactCenters
V. 0.9.9.

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