|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectumontreal.iro.lecuyer.simexp.SimExp
umontreal.iro.lecuyer.simexp.BatchMeansSim
umontreal.iro.lecuyer.contactcenters.msk.simlogic.BatchMeansLogic
public class BatchMeansLogic
Implements the logic for a simulation with batch means. This logic simulates
a single long replication which is divided into time intervals called
batches. The logic uses matrices of counters with a single column for storing
values for the current real batch. In the notation of the super class
BatchMeansSim
, these counters are used to generate the
vectors containing statistics for real batches. When batch aggregation is
disabled, these counters are used directly to make the matrices of
observations which correspond to the
vectors. When batch
aggregation is enabled, the vectors of counts for each real batch are added
to intermediate lists of statistical probes, and matrices of observations are
constructed by aggregating some of these vectors. The operator used for
aggregation is the sum, but it can also be the maximum for some statistics
such as the maximal number of busy agents, maximal queue size, and maximal
waiting time. For more information about batch aggregation, see the
documentation of the super class
BatchMeansSim
.
Field Summary |
---|
Fields inherited from class umontreal.iro.lecuyer.simexp.SimExp |
---|
sim, simulating |
Constructor Summary | |
---|---|
BatchMeansLogic(CallCenter cc,
BatchSimParams simParams,
PerformanceMeasureType... pms)
Constructs a new simulation logic for batch means, using the model cc, the simulation parameters simParams, and estimating performance measures of all types listed in pms. |
Method Summary | |
---|---|
void |
addEffectiveBatchObs(int s,
int h1,
double ell)
|
void |
addRealBatchObs()
|
void |
addSimLogicListener(SimLogicListener ell)
Registers the listener l to be notified about the progress of the simulator. |
void |
adjustTargetBatches(int numNewBatches)
|
void |
clearSimLogicListeners()
Removes all the listeners registered with this simulator. |
int |
computeMaxQueueSizeThresh()
Computes and returns the maximal queue size threshold before a simulated system is declared unstable. |
void |
formatReport(Map<String,Object> evalInfo)
Adds the information specific to this simulation logic into the evaluation information map of the simulator. |
int |
getAwtPeriod(Contact contact)
This returns P' - 1. |
CallCenter |
getCallCenter()
Returns the model associated with this simulation logic. |
CallCenterMeasureManager |
getCallCenterMeasureManager()
Returns an object containing the counters updated throughout the simulation. |
CallCenterStatProbes |
getCallCenterStatProbes()
Returns the call center statistical probes used by this simulation logic. |
int |
getCompletedSteps()
Returns the number of completed simulation steps. |
int |
getCurrentMainPeriod()
Returns the current period used by this simulator. |
int |
getGlobalAwtPeriod()
This returns P' - 1. |
MeasureType[] |
getMeasures()
|
int |
getNumPeriodsForCounters()
Returns 1. |
int |
getNumPeriodsForCountersAwt()
Returns 1. |
int[][] |
getScheduledAgents()
Returns the 2D array of scheduled agents for each shift and each agent group. |
List<SimLogicListener> |
getSimLogicListeners()
Returns the listeners registered with this simulator. |
BatchSimParams |
getSimParams()
Returns the parameters associated with this simulation logic. |
int[] |
getStaffing()
Returns the staffing vector used by this simulator. |
int[][] |
getStaffingMatrix()
Gets the staffing matrix for the simulated model. |
int |
getStatPeriod()
Returns 0 if the warmup period is over, or -1 otherwise. |
int |
getStatPeriod(Contact contact)
Returns the result of getStatPeriod() . |
int |
getStatPeriodAwt(Contact contact)
Returns the same value as getStatPeriod(Contact) . |
boolean |
hasMeasureMatricesFor(PerformanceMeasureType pm)
|
boolean |
hasMeasureMatrix(MeasureType mt)
|
void |
init()
Initializes the simulation logic for a new experiment. |
void |
initBatchStat()
|
void |
initEffectiveBatchProbes()
|
void |
initMeasureMatrices()
|
void |
initRealBatchProbes()
|
void |
initSimulation()
|
boolean |
isAborted()
Determines if the simulation has been aborted by using the SimLogic.setAborted(boolean) method. |
boolean |
isContactTypeAgentGroup()
|
boolean |
isSteadyState()
Determines if this simulator performs a steady-state simulation. |
boolean |
isVerbose()
Determines if the simulation logic is in verbose mode. |
boolean |
needsSlidingWindows()
Determines if sliding windows are needed by statistical counters using an object implementing this interface to get the statistical periods of calls. |
boolean |
needsStatForPeriodSegmentsAwt()
Determines if statistics for segments regrouping main periods are collected for measure types using acceptable waiting times. |
void |
registerListeners()
Registers any listener required by the simulator from the model. |
void |
removeSimLogicListener(SimLogicListener ell)
Removes the listener l from the list of listeners registered with this simulator. |
void |
reset(PerformanceMeasureType... pms)
Resets the simulation logic for a new experiment after the model has been reset. |
boolean |
seemsUnstable()
Returns true if, after the simulation, the system seems unstable. |
void |
setAborted(boolean aborted)
Aborts the current simulation. |
void |
setCurrentMainPeriod(int mp)
Sets the current period for this simulator to p. |
void |
setScheduledAgents(int[][] ag)
Sets the number of scheduled agents for each group and shift using the given 2D array. |
void |
setStaffing(int[] numAgents)
Sets the staffing vector used by this simulator to staffing. |
void |
setStaffingMatrix(int[][] numAgents)
Sets the 2D array representing the staffing matrix to staffing. |
void |
setVerbose(boolean verbose)
Sets the verbose indicator to verbose. |
void |
simulate(int numBatches)
Simulates numSteps steps, and updates observations in statistical collectors as well as the number of completed steps returned by SimLogic.getCompletedSteps() . |
void |
simulateBatch()
|
boolean |
stabilityCheck()
|
void |
unregisterListeners()
Disconnects every listener registered by the simulator from the model. |
Methods inherited from class umontreal.iro.lecuyer.simexp.SimExp |
---|
getRequiredNewObservations, getRequiredNewObservations, getRequiredNewObservations, getRequiredNewObservations, getRequiredNewObservationsTally, getRequiredNewObservationsTally, isSimulating, setSimulator, simulator |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public BatchMeansLogic(CallCenter cc, BatchSimParams simParams, PerformanceMeasureType... pms)
cc
- the simulated model.simParams
- the simulation parameters.pms
- the estimated performance measures.Method Detail |
---|
public CallCenter getCallCenter()
SimLogic
getCallCenter
in interface SimLogic
public BatchSimParams getSimParams()
SimLogic
getSimParams
in interface SimLogic
public CallCenterStatProbes getCallCenterStatProbes()
SimLogic
getCallCenterStatProbes
in interface SimLogic
public void registerListeners()
SimLogic
registerListeners
in interface SimLogic
public void unregisterListeners()
SimLogic
unregisterListeners
in interface SimLogic
public void initBatchStat()
initBatchStat
in class BatchMeansSim
public void initRealBatchProbes()
initRealBatchProbes
in class BatchMeansSim
public void addRealBatchObs()
addRealBatchObs
in class BatchMeansSim
public void initEffectiveBatchProbes()
initEffectiveBatchProbes
in class BatchMeansSim
public void addEffectiveBatchObs(int s, int h1, double ell)
addEffectiveBatchObs
in class BatchMeansSim
public void reset(PerformanceMeasureType... pms)
SimLogic
reset
in interface SimLogic
public int getNumPeriodsForCounters()
getNumPeriodsForCounters
in interface StatPeriod
public int getNumPeriodsForCountersAwt()
getNumPeriodsForCountersAwt
in interface StatPeriod
public boolean needsSlidingWindows()
StatPeriod
StatPeriod.getStatPeriod(Contact)
is never greater than
the integer returned by StatPeriod.getNumPeriodsForCounters()
, and
the same relationship holds for
StatPeriod.getStatPeriodAwt(Contact)
and
StatPeriod.getNumPeriodsForCountersAwt()
.
However, this assumption can be violated if
one needs to get real-time statistics concerning
the last observed periods.
In such cases, matrices of counters need to be implemented
using sliding windows:
when the index a statistical period becomes higher than
the number of stored periods, the first periods are discarded.
This method determines if such sliding windows
are needed.
needsSlidingWindows
in interface StatPeriod
public boolean needsStatForPeriodSegmentsAwt()
StatPeriod
needsStatForPeriodSegmentsAwt
in interface StatPeriod
public int getCompletedSteps()
SimLogic
getCompletedSteps
in interface SimLogic
public CallCenterMeasureManager getCallCenterMeasureManager()
SimLogic
getCallCenterMeasureManager
in interface SimLogic
public boolean isContactTypeAgentGroup()
public void initMeasureMatrices()
public MeasureType[] getMeasures()
public boolean hasMeasureMatrix(MeasureType mt)
public boolean hasMeasureMatricesFor(PerformanceMeasureType pm)
public int getStatPeriod(Contact contact)
getStatPeriod()
.
getStatPeriod
in interface StatPeriod
public int getStatPeriod()
getStatPeriod
in interface StatPeriod
public int getStatPeriodAwt(Contact contact)
getStatPeriod(Contact)
.
getStatPeriodAwt
in interface StatPeriod
public int getAwtPeriod(Contact contact)
getAwtPeriod
in interface AWTPeriod
contact
- the contact being queried.
public int getGlobalAwtPeriod()
getGlobalAwtPeriod
in interface AWTPeriod
public boolean isSteadyState()
SimLogic
isSteadyState
in interface SimLogic
public void formatReport(Map<String,Object> evalInfo)
SimLogic
formatReport
in interface SimLogic
public int[] getStaffing()
SimLogic
EvalOptionType.STAFFINGVECTOR
evaluation
option.
getStaffing
in interface SimLogic
public void setStaffing(int[] numAgents)
SimLogic
EvalOptionType.STAFFINGVECTOR
evaluation option.
setStaffing
in interface SimLogic
numAgents
- the new staffing vector.public int[][] getStaffingMatrix()
SimLogic
EvalOptionType.STAFFINGMATRIX
.
getStaffingMatrix
in interface SimLogic
public void setStaffingMatrix(int[][] numAgents)
SimLogic
setStaffingMatrix
in interface SimLogic
numAgents
- the new staffing matrix.public int[][] getScheduledAgents()
SimLogic
getScheduledAgents
in interface SimLogic
public void setScheduledAgents(int[][] ag)
SimLogic
setScheduledAgents
in interface SimLogic
ag
- the array of scheduled agents.public int getCurrentMainPeriod()
SimLogic
UnsupportedOperationException
.
getCurrentMainPeriod
in interface SimLogic
public void setCurrentMainPeriod(int mp)
SimLogic
UnsupportedOperationException
.
setCurrentMainPeriod
in interface SimLogic
mp
- the new current period.public void initSimulation()
initSimulation
in class BatchMeansSim
public void init()
SimLogic
init
in interface SimLogic
init
in class BatchMeansSim
public void adjustTargetBatches(int numNewBatches)
adjustTargetBatches
in class BatchMeansSim
public void simulate(int numBatches)
SimLogic
SimLogic.getCompletedSteps()
.
Usually, this method simulates the required number
of replications, and adds one observation to
each statistical collector of the matrices returned
by SimLogic.getCallCenterStatProbes()
.
Note that this method may be called several times
during a simulation experiment using sequential sampling.
For this reason, one should take account of every
observation collected since the last call to SimLogic.init()
.
simulate
in interface SimLogic
public boolean seemsUnstable()
SimLogic
seemsUnstable
in interface SimLogic
public int computeMaxQueueSizeThresh()
public boolean stabilityCheck()
public void simulateBatch()
simulateBatch
in class BatchMeansSim
public boolean isVerbose()
SimLogic
isVerbose
in interface SimLogic
public void setVerbose(boolean verbose)
SimLogic
setVerbose
in interface SimLogic
verbose
- the value of the indicator.public boolean isAborted()
SimLogic
SimLogic.setAborted(boolean)
method.
isAborted
in interface SimLogic
public void setAborted(boolean aborted)
SimLogic
setAborted
in interface SimLogic
public void addSimLogicListener(SimLogicListener ell)
SimLogic
addSimLogicListener
in interface SimLogic
ell
- the listener to be notified.public void clearSimLogicListeners()
SimLogic
clearSimLogicListeners
in interface SimLogic
public List<SimLogicListener> getSimLogicListeners()
SimLogic
getSimLogicListeners
in interface SimLogic
public void removeSimLogicListener(SimLogicListener ell)
SimLogic
removeSimLogicListener
in interface SimLogic
ell
- the listener being removed.
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |