Overview | Package | Class | Tree | Deprecated | Index | Help
| ContactCenters V. 0.9.9.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## umontreal.iro.lecuyer.contactcenters.msk.stat
Class MatrixCache

    java.lang.Object
      umontreal.iro.lecuyer.contactcenters.msk.stat.MatrixCache

    public class MatrixCache

extends Object

Constructs and caches matrices of observations derived from the matrices obtained using a `CallCenterMeasureManager`. The `CallCenterMeasureManager.getValues(MeasureType,boolean)` method computes matrices whose rows usually correspond to call types. However, the rows in matrices of statistical probes correspond to segments of call types: there is one row per call type, one row per user-defined group of call types, and a final row regrouping all call types. This class computes these aggregate rows, and stores the resulting matrices in a cache for them to be retrieved faster at a later time.

Constructor Summary
`MatrixCache(CallCenter cc, CallCenterMeasureManager ccm)` Constructs a new matrix cache from the call center `cc`, and the measure manager `ccm`.

Method Summary
`void` | `clear()` Clears the cached matrix.
`DoubleMatrix2D` | `getMatrix(MeasureType mt, RowType targetRowType)` Returns a matrix of observations for type of measure `mt` adapted to row type `targetRowType`.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### MatrixCache

    public MatrixCache(CallCenter cc,
                       CallCenterMeasureManager ccm)

  Constructs a new matrix cache from the call center `cc`, and the measure manager `ccm`.

Method Detail

### clear

    public void clear()

  Clears the cached matrix.

### getMatrix

    public DoubleMatrix2D getMatrix(MeasureType mt,
                                    RowType targetRowType)

  Returns a matrix of observations for type of measure `mt` adapted to row type `targetRowType`. Usually, `targetRowType` corresponds to the value returned by `mt.getRowType(false)`. But in some situations where `mt.getRowType(false)` corresponds to `RowType.CONTACTTYPE`, the row types might differ.

  In particular, `targetRowType` is set to `RowType.INBOUNDTYPE` if we want to keep only the rows corresponding to segments of inbound call types, and `RowType.OUTBOUNDTYPE` to keep rows for segment of outbound types only. For example, if `mt` is `MeasureType.NUMARRIVALS`, the base matrix gives the number of arrivals for each segment of call type. By setting the target row type to `RowType.INBOUNDTYPE`, we obtain the number of arrivals for segments of inbound types only.

  If the target row type is `RowType.INBOUNDTYPEAWT`, the set of rows corresponding to segments of inbound types is duplicated m times, where m is the number of matrices of acceptable waiting times. If `mt` is `MeasureType.NUMSERVED`, the resulting base matrix has one row per segment of call type. By using `RowType.INBOUNDTYPEAWT` as target row type, the obtained matrix of numbers has m segments of inbound call types, and is compatible with the matrix returned if `mt` is `MeasureType.NUMSERVEDBEFOREAWT`.

  The method first obtains the base matrix using `getBaseMatrix(MeasureType)`. If the row type associated with `mt` does not correspond to contact types, the method does nothing else. It then adds or subtracts rows for the returned matrix to have the number of rows corresponding to `targetRowType`.

  Parameters:
    `mt` - the type of measure matrix for which a matrix of observations is needed.
    `targetRowType` - the target row type.
  Returns:
    the generated matrix of observations.

Overview | Package | Class | Tree | Deprecated | Index | Help
| ContactCenters V. 0.9.9.
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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