|
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.stat.mperiods.IntegralMeasureMatrix<M>
umontreal.iro.lecuyer.stat.mperiods.IntegralMeasureMatrixSW<M>
public class IntegralMeasureMatrixSW<M extends MeasureMatrix>
This extends IntegralMeasureMatrix
to add a sliding window for the
records. With the base class, the total number of records is limited to the
number of periods in the measure matrix. With this class, the number of added
records can be greater than the number of periods. If a record is added while
all allocated periods are used, the first record is lost and the new one is
added. Therefore, the integral can be obtained for the last periods only.
Constructor Summary | |
---|---|
IntegralMeasureMatrixSW(M mat,
int numPeriods)
Calls super
(mat, numPeriods). |
Method Summary | |
---|---|
protected SumMatrixSW |
createSumMatrix(int nm,
int np)
This methods creates and returns the internal sum matrix, and is overridden in IntegralMeasureMatrixSW to create an instance of
SumMatrixSW instead. |
int |
getFirstRealRecord()
Returns the first value p for which a recorded value ![]() |
double |
getMeasure(int i,
int p)
Returns the measure i for period p. |
int |
getNumRealRecords()
Returns the total number of times the newRecord() method was called
since the last call to IntegralMeasureMatrix.init() plus one. |
protected int |
getPeriod()
Returns mpc. getNumRealPeriods() . |
double |
getSum(int i,
int r)
Returns fi(tj), the measure i of the associated measure matrix at the simulation time tj, j being r + getFirstRealRecord() . |
SumMatrixSW |
getSumMatrix()
Returns the internal sum matrix for which each period p contains the value of ![]() |
void |
newRecord()
This is the same as in the superclass, but if the number of stored records exceeds the number of real records, the first stored record is discarded. |
void |
setFirstRealRecord(int firstRealRecord)
Sets the index of the first real record to firstRealRecord. |
String |
toString()
|
Methods inherited from class umontreal.iro.lecuyer.stat.mperiods.IntegralMeasureMatrix |
---|
clone, getMeasureMatrix, getNumMeasures, getNumPeriods, getNumStoredRecords, init, regroupPeriods, setMeasureMatrix, setNumMeasures, setNumPeriods |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IntegralMeasureMatrixSW(M mat, int numPeriods)
super
(mat, numPeriods).
Method Detail |
---|
protected SumMatrixSW createSumMatrix(int nm, int np)
IntegralMeasureMatrix
IntegralMeasureMatrixSW
to create an instance of
SumMatrixSW
instead.
createSumMatrix
in class IntegralMeasureMatrix<M extends MeasureMatrix>
nm
- the number of measures.np
- the number of periods.public SumMatrixSW getSumMatrix()
IntegralMeasureMatrix
IntegralMeasureMatrix.getNumMeasures()
while the number of periods is one more than
IntegralMeasureMatrix.getNumPeriods()
.
getSumMatrix
in class IntegralMeasureMatrix<M extends MeasureMatrix>
public int getFirstRealRecord()
public void setFirstRealRecord(int firstRealRecord)
firstRealRecord
- the index of the first real record.
IllegalArgumentException
- if firstRealRecord is negative.public int getNumRealRecords()
newRecord()
method was called
since the last call to IntegralMeasureMatrix.init()
plus one. If the returned value
exceeds the number of stored records (IntegralMeasureMatrix.getNumStoredRecords()
),
only the values of IntegralMeasureMatrix.getNumStoredRecords()
are accessible; the first values are then lost.
public void newRecord()
newRecord
in class IntegralMeasureMatrix<M extends MeasureMatrix>
protected int getPeriod()
getNumRealPeriods()
.
getPeriod
in class IntegralMeasureMatrix<M extends MeasureMatrix>
IntegralMeasureMatrix.newRecord()
.public double getSum(int i, int r)
getFirstRealRecord()
.
getSum
in class IntegralMeasureMatrix<M extends MeasureMatrix>
i
- the measure index.r
- the record index.
IndexOutOfBoundsException
- if i or r are out of bounds.public double getMeasure(int i, int p)
getFirstRealRecord()
.
getMeasure
in interface MeasureMatrix
getMeasure
in class IntegralMeasureMatrix<M extends MeasureMatrix>
i
- the index of the measure.p
- the period of the measure.
IndexOutOfBoundsException
- if i or p are negative or greater than or
equal to the number of measures or the number of periods,
respectively.public String toString()
toString
in class IntegralMeasureMatrix<M extends MeasureMatrix>
|
ContactCenters V. 0.9.9. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |