SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe > Class Template Reference

Represents a matrix of statistical probes that can be managed simultaneously. More...

Inheritance diagram for umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe >:

Classes

enum  ListType

Public Member Functions

 MatrixOfStatProbes (int numRows, int numColumns)
 Constructs a new unnamed matrix of statistical probes with numRows rows, and numColumns columns, and filled with null references.
 MatrixOfStatProbes (String name, int numRows, int numColumns)
 Constructs a new matrix of statistical probes with name name, numRows rows, and numColumns columns, and filled with null references.
String getName ()
 Returns the global name of this matrix of statistical probes.
void setName (String name)
 Sets the global name of this matrix to name.
int rows ()
 Returns the number of rows in this matrix.
int columns ()
 Returns the number of columns in this matrix.
void setRows (int newRows)
 Sets the number of rows of this matrix of statistical probes to newRows, adding or removing cells as necessary.
void setColumns (int newColumns)
 Similar to setRows(int), for setting the number of columns.
get (int r, int c)
 Returns the statistical probe corresponding to the row r and column c.
void set (int r, int c, E probe)
 Sets the statistical probe corresponding to the row r and column c to probe.
void init ()
 Initializes this matrix of statistical probes by calling StatProbe.init on each element.
void sum (DoubleMatrix2D m)
 For each probe in the matrix, computes the sum by calling umontreal.ssj.stat.StatProbe.sum, and stores it into the given matrix m.
void average (DoubleMatrix2D m)
 For each statistical probe in the matrix, computes the average by calling umontreal.ssj.stat.StatProbe.average, and stores it into the given matrix m.
boolean isCollecting ()
 Determines if this matrix of statistical probes is collecting values.
void setCollecting (boolean c)
 Sets the status of the statistical collecting mechanism to c.
boolean isBroadcasting ()
 Determines if this matrix of statistical probes is broadcasting values to registered observers.
void setBroadcasting (boolean b)
 Sets the status of the observation broadcasting mechanism to b.
void addMatrixOfObservationListener (MatrixOfObservationListener l)
 Adds the observation listener l to the list of observers of this matrix of statistical probes.
void removeMatrixOfObservationListener (MatrixOfObservationListener l)
 Removes the observation listener l from the list of observers of this matrix of statistical probes.
void clearMatrixOfObservationListeners ()
 Removes all observation listeners from the list of observers of this matrix of statistical probes.
void notifyListeners (DoubleMatrix2D x)
 Notifies the observation x to all registered observers if broadcasting is ON.
List< E > viewRow (int r)
 Returns a list representing a view on row r of this matrix of statistical probe.
List< E > viewColumn (int c)
 Returns a list representing a view on column c of this matrix of statistical probe.
String rowReport (int r)
 Formats a report for the row r of the statistical probe matrix.
String columnReport (int c)
 Formats a report for the column c of the statistical probe matrix.
MatrixOfStatProbes< E > clone ()
 Clones this object.

Detailed Description

Represents a matrix of statistical probes that can be managed simultaneously.

Each element of this matrix is a

umontreal.ssj.stat.StatProbe instance which can be obtained and manipulated. Alternatively, several methods are provided to manipulate all probes in the matrix simultaneously.

Each matrix of probes can have a global name describing the contents of its elements, and local names for each cell. For example, a matrix of statistical probes for the waiting times can have the global name "<tt>Waiting times</tt>" while the first cell has local name "<tt>type 1, period 1</tt>".

 Facilities are provided to fill matrices of sums, averages, etc.
 obtained from the individual statistical probes. DoubleMatrix2D is used
 instead of 2D arrays because it more efficiently stores the values, and
 it supports computations on the elements.

 <div class="SSJ-bigskip"></div>

Definition at line 60 of file MatrixOfStatProbes.java.

Constructor & Destructor Documentation

◆ MatrixOfStatProbes() [1/2]

umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe >.MatrixOfStatProbes ( int numRows,
int numColumns )

Constructs a new unnamed matrix of statistical probes with numRows rows, and numColumns columns, and filled with null references.

Parameters
numRowsthe number of rows in the matrix.
numColumnsthe number of columns in the matrix.
Exceptions
NegativeArraySizeExceptionif `numRows` or `numColumns` are negative.

Definition at line 83 of file MatrixOfStatProbes.java.

◆ MatrixOfStatProbes() [2/2]

umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe >.MatrixOfStatProbes ( String name,
int numRows,
int numColumns )

Constructs a new matrix of statistical probes with name name, numRows rows, and numColumns columns, and filled with null references.

Parameters
namethe global name of the matrix.
numRowsthe number of rows in the matrix.
numColumnsthe number of columns in the matrix.
Exceptions
NegativeArraySizeExceptionif `numRows` or `numColumns` are negative.

Definition at line 97 of file MatrixOfStatProbes.java.

Member Function Documentation

◆ addMatrixOfObservationListener()

void umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe >.addMatrixOfObservationListener ( MatrixOfObservationListener l)

Adds the observation listener l to the list of observers of this matrix of statistical probes.

Parameters
lthe new observation listener.
Exceptions
NullPointerExceptionif `l` is `null`.

Definition at line 350 of file MatrixOfStatProbes.java.

◆ average()

void umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe >.average ( DoubleMatrix2D m)

For each statistical probe in the matrix, computes the average by calling umontreal.ssj.stat.StatProbe.average, and stores it into the given matrix m.

Parameters
mthe matrix to be filled with averages.
Exceptions
NullPointerExceptionif `m` is `null`.
IllegalArgumentExceptionif `m.rows()` does not correspond to rows, or m.columns() does not correspond to columns.

Definition at line 289 of file MatrixOfStatProbes.java.

◆ clearMatrixOfObservationListeners()

void umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe >.clearMatrixOfObservationListeners ( )

Removes all observation listeners from the list of observers of this matrix of statistical probes.

Definition at line 371 of file MatrixOfStatProbes.java.

◆ clone()

Clones this object.

This makes a shallow copy of this matrix, i.e., this does not clone all the probes in the matrix.

Definition at line 440 of file MatrixOfStatProbes.java.

◆ columnReport()

String umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe >.columnReport ( int c)

Formats a report for the column c of the statistical probe matrix.

The returned string is constructed by getting a view of column c and using StatProbe.report on this list.

Parameters
cthe column being reported.
Returns
the report formatted as a string.

Definition at line 432 of file MatrixOfStatProbes.java.

◆ columns()

Returns the number of columns in this matrix.

Returns
the total number of columns.

Definition at line 147 of file MatrixOfStatProbes.java.

◆ get()

E umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe >.get ( int r,
int c )

Returns the statistical probe corresponding to the row r and column c.

Parameters
rthe row to look at.
cthe column to look at.
Returns
the corresponding statistical probe.
Exceptions
ArrayIndexOutOfBoundsExceptionif `r` or `c` are negative, if `r` is greater than or equal to rows, or if c is greater than or equal to columns.

Definition at line 213 of file MatrixOfStatProbes.java.

◆ getName()

Returns the global name of this matrix of statistical probes.

Returns
the global name of the matrix.

Definition at line 120 of file MatrixOfStatProbes.java.

◆ init()

Initializes this matrix of statistical probes by calling StatProbe.init on each element.

Definition at line 246 of file MatrixOfStatProbes.java.

◆ isBroadcasting()

boolean umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe >.isBroadcasting ( )

Determines if this matrix of statistical probes is broadcasting values to registered observers.

The default is false.

Returns
the status of broadcasting.

Definition at line 329 of file MatrixOfStatProbes.java.

◆ isCollecting()

boolean umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe >.isCollecting ( )

Determines if this matrix of statistical probes is collecting values.

The default is true.

Returns
the status of statistical collecting.

Definition at line 309 of file MatrixOfStatProbes.java.

◆ notifyListeners()

void umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe >.notifyListeners ( DoubleMatrix2D x)

Notifies the observation x to all registered observers if broadcasting is ON.

Otherwise, does nothing.

Definition at line 379 of file MatrixOfStatProbes.java.

◆ removeMatrixOfObservationListener()

void umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe >.removeMatrixOfObservationListener ( MatrixOfObservationListener l)

Removes the observation listener l from the list of observers of this matrix of statistical probes.

Parameters
lthe observation listener to be deleted.

Definition at line 363 of file MatrixOfStatProbes.java.

◆ rowReport()

String umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe >.rowReport ( int r)

Formats a report for the row r of the statistical probe matrix.

The returned string is constructed by getting a view of row r and using StatProbe.report on this list.

Parameters
rthe row being reported.
Returns
the report formatted as a string.

Definition at line 420 of file MatrixOfStatProbes.java.

◆ rows()

Returns the number of rows in this matrix.

Returns
the total number of rows.

Definition at line 138 of file MatrixOfStatProbes.java.

◆ set()

void umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe >.set ( int r,
int c,
E probe )

Sets the statistical probe corresponding to the row r and column c to probe.

Parameters
rthe row to modify.
cthe column to modify.
probet he new probe.
Exceptions
ArrayIndexOutOfBoundsExceptionif `r` or `c` are negative, if `r` is greater than or equal to rows, or if c is greater than or equal to columns.

Definition at line 233 of file MatrixOfStatProbes.java.

◆ setBroadcasting()

void umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe >.setBroadcasting ( boolean b)

Sets the status of the observation broadcasting mechanism to b.

A true value turns broadcasting ON, a false value turns it OFF.

Parameters
bthe status of broadcasting.

Definition at line 339 of file MatrixOfStatProbes.java.

◆ setCollecting()

void umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe >.setCollecting ( boolean c)

Sets the status of the statistical collecting mechanism to c.

A true value turns statistical collecting ON, a false value turns it OFF.

Parameters
cthe status of statistical collecting.

Definition at line 319 of file MatrixOfStatProbes.java.

◆ setColumns()

void umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe >.setColumns ( int newColumns)

Similar to setRows(int), for setting the number of columns.

Parameters
newColumnsthe new number of columns of the matrix.
Exceptions
IllegalArgumentExceptionif an error occurs during construction of statistical probes.
NegativeArraySizeExceptionif `newolumns` is negative.

Definition at line 185 of file MatrixOfStatProbes.java.

◆ setName()

void umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe >.setName ( String name)

Sets the global name of this matrix to name.

Parameters
namethe new global name of the matrix.

Definition at line 129 of file MatrixOfStatProbes.java.

◆ setRows()

void umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe >.setRows ( int newRows)

Sets the number of rows of this matrix of statistical probes to newRows, adding or removing cells as necessary.

If newRows is negative, a NegativeArraySizeException is thrown. Otherwise, if newRows is equal to rows, nothing happens. If the number of rows is reduced, the last rows - newRows rows of statistical probes are lost. If the number of rows is increased, the new elements of the matrix are set to null.

Parameters
newRowsthe new number of rows of the matrix.
Exceptions
IllegalArgumentExceptionif an error occurs during construction of statistical probes.
NegativeArraySizeExceptionif `newRows` is negative.

Definition at line 164 of file MatrixOfStatProbes.java.

◆ sum()

void umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe >.sum ( DoubleMatrix2D m)

For each probe in the matrix, computes the sum by calling umontreal.ssj.stat.StatProbe.sum, and stores it into the given matrix m.

Parameters
mthe matrix to be filled with sums.
Exceptions
NullPointerExceptionif `m` is `null`.
IllegalArgumentExceptionif `m.rows()` does not correspond to rows, or m.columns() does not correspond to columns.

Definition at line 264 of file MatrixOfStatProbes.java.

◆ viewColumn()

List< E > umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe >.viewColumn ( int c)

Returns a list representing a view on column c of this matrix of statistical probe.

The returned list cannot be modified, and becomes invalid if the number of columns in this matrix of statistical probes is changed.

Parameters
cthe column to look at.
Returns
the list of statistical probes on the column.

Definition at line 408 of file MatrixOfStatProbes.java.

◆ viewRow()

List< E > umontreal.ssj.stat.matrix.MatrixOfStatProbes< E extends StatProbe >.viewRow ( int r)

Returns a list representing a view on row r of this matrix of statistical probe.

The returned list cannot be modified, and becomes invalid if the number of rows in this matrix of statistical probes is changed.

Parameters
rthe row to look at.
Returns
the list of statistical probes on the row.

Definition at line 396 of file MatrixOfStatProbes.java.


The documentation for this class was generated from the following file: