ContactCenters
V. 0.9.9.

umontreal.iro.lecuyer.stat.mperiods
Interface MeasureMatrix

All Known Implementing Classes:
BusyAgentsChecker, ContactSumMatrix, GroupVolumeStatMeasureMatrix, IntegralMeasureMatrix, IntegralMeasureMatrixSW, ListOfStatProbesMeasureMatrix, MatrixOfStatProbesMeasureMatrix, MeasureSet, NonStationaryMeasureMatrix, QueueSizeChecker, QueueSizeStatMeasureMatrix, SimTimeMeasureMatrix, StatProbeMeasureMatrix, SumMatrix, SumMatrixSW

public interface MeasureMatrix

Represents a matrix of measures for a set of related values during successive simulation periods. For example, it can compute the number of served customers of different types, for each simulation period. A period can be any time interval such as half an hour, a complete day, a batch, etc. At the beginning of a simulation, the matrix is initialized using the init() method. During the simulation, it is updated with new events or values by implementation-specific methods. An implementation of this interface computes raw observations of a simulated system by counting the number of occurrences of events, by summing values, or by computing integrals. At determined times, e.g., at the end of a replication or a batch, these raw observations are processed to be added into some statistical collectors. This interface provides an abstraction layer to separate the computation of observations from the required processing before they are collected.

Some methods specified by this interface are mandatory whereas others are optional. When an unsupported optional method is called, its implementation simply throws an UnsupportedOperationException.


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.
 void init()
          Initializes this matrix of measures for a new simulation replication.
 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.
 

Method Detail

init

void init()
Initializes this matrix of measures for a new simulation replication. This resets the measured values to 0, or initializes the probes used to compute them.


getNumMeasures

int getNumMeasures()
Returns the number of measures calculated by the implementation of this interface.

Returns:
the number of computed values.

setNumMeasures

void setNumMeasures(int nm)
Sets the number of measures to nm. If this method is supported, it can limit the maximal or minimal accepted number of measures.

Parameters:
nm - the new number of measures.
Throws:
IllegalArgumentException - if the given number is negative or not accepted.
UnsupportedOperationException - if the number of measures cannot be changed.

getNumPeriods

int getNumPeriods()
Returns the number of periods stored into this matrix of measures.

Returns:
the number of stored periods.

setNumPeriods

void setNumPeriods(int np)
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.

Parameters:
np - the new number of periods.
Throws:
IllegalArgumentException - if the given number is negative or not accepted.
UnsupportedOperationException - if the number of periods cannot be changed.

getMeasure

double getMeasure(int i,
                  int p)
Returns the measure corresponding to the index i and period p.

Parameters:
i - the index of the measure.
p - the period of the measure.
Returns:
the corresponding value.
Throws:
IndexOutOfBoundsException - if i or p are negative or greater than or equal to the number of measures or the number of periods, respectively.

regroupPeriods

void regroupPeriods(int x)
Increases the length of stored periods by regrouping them. If this method is supported, for p = 0, ..., 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.

Parameters:
x - the number of periods per group.
Throws:
IllegalArgumentException - if the number of periods per group is negative or 0.
UnsupportedOperationException - if the matrix does not support regrouping.

ContactCenters
V. 0.9.9.

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