|
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.RepSim
umontreal.iro.lecuyer.contactcenters.msk.simlogic.RepLogic
public class RepLogic
Implements the logic for a simulation with independent replications. For each replication, this logic initializes the model to an empty state, and simulates the entire horizon, i.e., a single day, week, month, etc., depending on the model's parameters. Statistics are collected in every period.
Field Summary |
---|
Fields inherited from class umontreal.iro.lecuyer.simexp.SimExp |
---|
sim, simulating |
Constructor Summary | |
---|---|
RepLogic(CallCenter cc,
RepSimParams simParams,
PerformanceMeasureType... pms)
Constructs a new simulation logic for independent replications, using the model cc, the simulation parameters simParams, and estimating performance measures of all types listed in pms. |
Method Summary | |
---|---|
void |
addReplicationObs(int r)
|
void |
addSimLogicListener(SimLogicListener l)
Registers the listener l to be notified about the progress of the simulator. |
void |
clearSimLogicListeners()
Removes all the listeners registered with this simulator. |
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)
Computes the statistical period p of the contact by calling getStatPeriod(Contact) , and
converts p to a main period using
PeriodChangeEvent.getMainPeriod(int) . |
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()
This method returns P + 2, the number of periods. |
int |
getNumPeriodsForCountersAwt()
This method returns P', the number of segments regrouping main periods. |
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. |
RepSimParams |
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 the index of the current period. |
int |
getStatPeriod(Contact contact)
By default, this returns the period of arrival of the given contact. |
int |
getStatPeriodAwt(Contact contact)
Returns the result of getAwtPeriod(Contact) . |
boolean |
hasMeasureMatricesFor(PerformanceMeasureType pm)
|
boolean |
hasMeasureMatrix(MeasureType mt)
|
void |
init()
Initializes the simulation logic for a new experiment. |
void |
initMeasureMatrices()
|
void |
initReplication(int r)
|
void |
initReplicationProbes()
|
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 |
performReplication(int r)
|
void |
registerListeners()
Registers any listener required by the simulator from the model. |
void |
removeSimLogicListener(SimLogicListener l)
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 numSteps)
Simulates numSteps steps, and updates observations in statistical collectors as well as the number of completed steps returned by SimLogic.getCompletedSteps() . |
void |
unregisterListeners()
Disconnects every listener registered by the simulator from the model. |
Methods inherited from class umontreal.iro.lecuyer.simexp.RepSim |
---|
adjustTargetReplications, getCompletedReplications, getMaxReplications, getMinReplications, getRequiredNewReplications, getTargetReplications, replicationDone, setMaxReplications, setMinReplications, setTargetReplications, simulate, toString |
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 RepLogic(CallCenter cc, RepSimParams simParams, PerformanceMeasureType... pms)
cc
- the simulated model.simParams
- the simulation parameters.pms
- the estimated performance measures.Method Detail |
---|
public void registerListeners()
SimLogic
registerListeners
in interface SimLogic
public void unregisterListeners()
SimLogic
unregisterListeners
in interface SimLogic
public CallCenterStatProbes getCallCenterStatProbes()
SimLogic
getCallCenterStatProbes
in interface SimLogic
public void performReplication(int r)
performReplication
in class RepSim
public void initReplication(int r)
initReplication
in class RepSim
public void addReplicationObs(int r)
addReplicationObs
in class RepSim
public CallCenter getCallCenter()
SimLogic
getCallCenter
in interface SimLogic
public RepSimParams getSimParams()
SimLogic
getSimParams
in interface SimLogic
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
in interface StatPeriod
public int getStatPeriodAwt(Contact contact)
getAwtPeriod(Contact)
.
getStatPeriodAwt
in interface StatPeriod
public int getStatPeriod()
getStatPeriod
in interface StatPeriod
public int getAwtPeriod(Contact contact)
getStatPeriod(Contact)
, and
converts p to a main period using
PeriodChangeEvent.getMainPeriod(int)
.
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 initReplicationProbes()
initReplicationProbes
in class RepSim
public void init()
SimLogic
init
in interface SimLogic
init
in class RepSim
public void simulate(int numSteps)
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 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 boolean seemsUnstable()
SimLogic
seemsUnstable
in interface SimLogic
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 l)
SimLogic
addSimLogicListener
in interface SimLogic
l
- 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 l)
SimLogic
removeSimLogicListener
in interface SimLogic
l
- 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 |