ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.contactcenters.queue
Class QueueSizeStatMeasureMatrix

java.lang.Object
  extended by umontreal.iro.lecuyer.contactcenters.queue.QueueSizeStat
      extended by umontreal.iro.lecuyer.contactcenters.queue.QueueSizeStatMeasureMatrix
All Implemented Interfaces:
Cloneable, MeasureMatrix

public class QueueSizeStatMeasureMatrix
extends QueueSizeStat
implements MeasureMatrix

Queue size statistical collector implementing MeasureMatrix. This class extends QueueSizeStat and implements the MeasureMatrix interface and defines measures for queue sizes. If the object supports K > 1 contact types, the measure 0≤k < K corresponds to the integral of the number of contacts of type k over the simulation time. The measure K corresponds to the integral of the queue size over the simulation time. If K = 1, only the integral of the queue size is computed and stored in measure 0. Since this measure matrix supports only one period, it must be combined with IntegralMeasureMatrix for the integral of the queue size to be obtained for each period.


Constructor Summary
QueueSizeStatMeasureMatrix(Simulator sim, WaitingQueue queue)
          Equivalent to QueueSizeStatMeasureMatrix(WaitingQueue), using the given simulator sim to create internal probes.
QueueSizeStatMeasureMatrix(Simulator sim, WaitingQueue queue, int numTypes)
          Equivalent to QueueSizeStatMeasureMatrix(WaitingQueue,int), using the given simulator sim to create internal probes.
QueueSizeStatMeasureMatrix(WaitingQueue queue)
          Constructs a new queue size statistical probe for the waiting queue queue and only computing aggregate queue size.
QueueSizeStatMeasureMatrix(WaitingQueue queue, int numTypes)
          Constructs a new queue size statistical probe for the waiting queue queue supporting numTypes contact types.
 
Method Summary
 double getMeasure(int i, int p)
          Returns the measure corresponding to the index i and period p.
 int getNumMeasures()
          Returns the number of measures calculated by the implementation of this interface.
 int getNumPeriods()
          Returns the number of periods stored into this matrix of measures.
static MeasureSet getQueueSizeIntegralMeasureSet(MeasureMatrix[] qscalc)
          Returns a measure set regrouping the queue size integrals for several waiting queues.
static MeasureSet getQueueSizeIntegralMeasureSet(MeasureMatrix[] qscalc, int numTypes)
          Returns a measure set regrouping the integrals of the number of contacts of each type in a set of waiting queues.
 void regroupPeriods(int x)
          Increases the length of stored periods by regrouping them.
 void setNumMeasures(int nm)
          Sets the number of measures to nm.
 void setNumPeriods(int np)
          Sets the number of periods of this matrix to np.
 
Methods inherited from class umontreal.iro.lecuyer.contactcenters.queue.QueueSizeStat
clone, getNumContactTypes, getStatQueueSize, getStatQueueSize, getWaitingQueue, init, setSimulator, setWaitingQueue, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface umontreal.iro.lecuyer.stat.mperiods.MeasureMatrix
init
 

Constructor Detail

QueueSizeStatMeasureMatrix

public QueueSizeStatMeasureMatrix(WaitingQueue queue)
Constructs a new queue size statistical probe for the waiting queue queue and only computing aggregate queue size. This is equivalent to QueueSizeStat (queue, 0).

Parameters:
queue - the observed waiting queue.

QueueSizeStatMeasureMatrix

public QueueSizeStatMeasureMatrix(Simulator sim,
                                  WaitingQueue queue)
Equivalent to QueueSizeStatMeasureMatrix(WaitingQueue), using the given simulator sim to create internal probes.


QueueSizeStatMeasureMatrix

public QueueSizeStatMeasureMatrix(WaitingQueue queue,
                                  int numTypes)
Constructs a new queue size statistical probe for the waiting queue queue supporting numTypes contact types.

Parameters:
queue - the observed waiting queue.
numTypes - the supported number of contact types.
Throws:
IllegalArgumentException - if the number of contact types is smaller than 0.

QueueSizeStatMeasureMatrix

public QueueSizeStatMeasureMatrix(Simulator sim,
                                  WaitingQueue queue,
                                  int numTypes)
Equivalent to QueueSizeStatMeasureMatrix(WaitingQueue,int), using the given simulator sim to create internal probes.

Method Detail

getNumMeasures

public int getNumMeasures()
Description copied from interface: MeasureMatrix
Returns the number of measures calculated by the implementation of this interface.

Specified by:
getNumMeasures in interface MeasureMatrix
Returns:
the number of computed values.

setNumMeasures

public void setNumMeasures(int nm)
Description copied from interface: MeasureMatrix
Sets the number of measures to nm. If this method is supported, it can limit the maximal or minimal accepted number of measures.

Specified by:
setNumMeasures in interface MeasureMatrix
Parameters:
nm - the new number of measures.

getNumPeriods

public int getNumPeriods()
Description copied from interface: MeasureMatrix
Returns the number of periods stored into this matrix of measures.

Specified by:
getNumPeriods in interface MeasureMatrix
Returns:
the number of stored periods.

setNumPeriods

public void setNumPeriods(int np)
Description copied from interface: MeasureMatrix
Sets the number of periods of this matrix to np. If this method is supported, it can limit the maximal or minimal accepted number of periods.

Specified by:
setNumPeriods in interface MeasureMatrix
Parameters:
np - the new number of periods.

getMeasure

public double getMeasure(int i,
                         int p)
Description copied from interface: MeasureMatrix
Returns the measure corresponding to the index i and period p.

Specified by:
getMeasure in interface MeasureMatrix
Parameters:
i - the index of the measure.
p - the period of the measure.
Returns:
the corresponding value.

regroupPeriods

public void regroupPeriods(int x)
Description copied from interface: MeasureMatrix
Increases the length of stored periods by regrouping them. If this method is supported, for p = 0, ..., MeasureMatrix.getNumPeriods()/x - 1, it sums the values for periods xp, ...,xp+x-1, and stores the results in period p whose length will be x times the length of original periods. If the number of periods is not a multiple of x, an additional period is used to contain the remaining sums of values. The unused periods are zeroed for future use. This method can be useful for memory management when using batch means to estimate steady-state performance measures.

Specified by:
regroupPeriods in interface MeasureMatrix
Parameters:
x - the number of periods per group.

getQueueSizeIntegralMeasureSet

public static MeasureSet getQueueSizeIntegralMeasureSet(MeasureMatrix[] qscalc)
Returns a measure set regrouping the queue size integrals for several waiting queues. Row r of the resulting matrix corresponds to the queue size integral stored in qscalc[r], and the last row contains the total queue size.

Parameters:
qscalc - the queue size matrices.
Returns:
the queue size integral measure set.

getQueueSizeIntegralMeasureSet

public static MeasureSet getQueueSizeIntegralMeasureSet(MeasureMatrix[] qscalc,
                                                        int numTypes)
Returns a measure set regrouping the integrals of the number of contacts of each type in a set of waiting queues. The row numTypes*q + k contains the integral of the number of contact of type k stored in qscalc[q] over the simulation time. If the measure set is computing the sum row (the default), row numTypes*qscalc.length + k corresponds to the integral of the total number of queued contacts of type k, over the simulation time.

Parameters:
qscalc - the queue size integral matrices.
numTypes - the number of contact types.
Returns:
the queue size integral measure set.

ContactCenters
V. 0.9.9.

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