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

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

Inheritance diagram for umontreal.ssj.stat.list.ListOfStatProbes< E extends StatProbe >:

Public Member Functions

 ListOfStatProbes ()
 Constructs an empty list of statistical probes.
 ListOfStatProbes (String name)
 Constructs an empty list of statistical probes with name name.
String getName ()
 Returns the global name of this list of statistical probes.
void setName (String name)
 Sets the global name of this list to name.
boolean isModifiable ()
 Determines if this list of statistical probes is modifiable, i.e., if probes can be added or removed.
void setUnmodifiable ()
 Forbids any future modification to this list of statistical probes.
void init ()
 Initializes this list of statistical probes by calling umontreal.ssj.stat.StatProbe.init on each element.
void sum (double[] s)
 For each probe in the list, computes the sum by calling umontreal.ssj.stat.StatProbe.sum, and stores the results into the array s.
void average (double[] a)
 For each probe in this list, computes the average by calling umontreal.ssj.stat.StatProbe.average, and stores the results into the array a.
boolean isCollecting ()
 Determines if this list 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 list of statistical probes is broadcasting observations to registered observers.
void setBroadcasting (boolean b)
 Sets the status of the observation broadcasting mechanism to b.
void addArrayOfObservationListener (ArrayOfObservationListener l)
 Adds the observation listener l to the list of observers of this list of statistical probes.
void removeArrayOfObservationListener (ArrayOfObservationListener l)
 Removes the observation listener l from the list of observers of this list of statistical probes.
void clearArrayOfObservationListeners ()
 Removes all observation listeners from the list of observers of this list of statistical probes.
void notifyListeners (double[] x)
 Notifies the observation x to all registered observers if broadcasting is ON.
String report ()
 Formats a report for each probe in the list of statistical probes.
ListOfStatProbes< E > clone ()
 Clones this object.

Detailed Description

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

Each element of this list is a

umontreal.ssj.stat.StatProbe instance which can be obtained and manipulated.

When constructing a list of statistical probes, one specifies the concrete subclass of the umontreal.ssj.stat.StatProbe objects in it. One then creates an empty list of probes, and fills it with statistical probes. If the list is not intended to be modified, one can then use the setUnmodifiable to prevent any change in the contents of the list.

Each list of statistical probes can have a global name describing the contents of its elements, and local names associated with each individual probe. For example, a list of statistical probes for the waiting times can have the global name Waiting times while the individual probes have local names type 1, type 2, etc. These names are used for formatting reports.

Facilities are provided to fill arrays with sums, averages, etc. obtained from the individual statistical probes. Methods are also provided to manipulate the contents of the list. However, one should always call init immediately after adding or removing statistical probes in the list.

Definition at line 59 of file ListOfStatProbes.java.

Constructor & Destructor Documentation

◆ ListOfStatProbes() [1/2]

umontreal.ssj.stat.list.ListOfStatProbes< E extends StatProbe >.ListOfStatProbes ( )

Constructs an empty list of statistical probes.

Definition at line 72 of file ListOfStatProbes.java.

◆ ListOfStatProbes() [2/2]

umontreal.ssj.stat.list.ListOfStatProbes< E extends StatProbe >.ListOfStatProbes ( String name)

Constructs an empty list of statistical probes with name name.

Parameters
namethe name of the new list.

Definition at line 81 of file ListOfStatProbes.java.

Member Function Documentation

◆ addArrayOfObservationListener()

void umontreal.ssj.stat.list.ListOfStatProbes< E extends StatProbe >.addArrayOfObservationListener ( ArrayOfObservationListener l)

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

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

Definition at line 223 of file ListOfStatProbes.java.

◆ average()

void umontreal.ssj.stat.list.ListOfStatProbes< E extends StatProbe >.average ( double[] a)

For each probe in this list, computes the average by calling umontreal.ssj.stat.StatProbe.average, and stores the results into the array a.

This method throws an exception if the size of s mismatches with the size of the list.

Parameters
athe array to be filled with averages.
Exceptions
NullPointerExceptionif `a` is `null`.
IllegalArgumentExceptionif `a.length` does not correspond to size.

Definition at line 166 of file ListOfStatProbes.java.

◆ clearArrayOfObservationListeners()

void umontreal.ssj.stat.list.ListOfStatProbes< E extends StatProbe >.clearArrayOfObservationListeners ( )

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

Definition at line 244 of file ListOfStatProbes.java.

◆ clone()

Clones this object.

This makes a shallow copy of this list, i.e., this does not clone all the probes in the list. The created clone is modifiable, even if the original list is unmodifiable.

Definition at line 276 of file ListOfStatProbes.java.

◆ getName()

String umontreal.ssj.stat.list.ListOfStatProbes< E extends StatProbe >.getName ( )

Returns the global name of this list of statistical probes.

Returns
the global name of the list.

Definition at line 91 of file ListOfStatProbes.java.

◆ init()

Initializes this list of statistical probes by calling umontreal.ssj.stat.StatProbe.init on each element.

Definition at line 128 of file ListOfStatProbes.java.

◆ isBroadcasting()

boolean umontreal.ssj.stat.list.ListOfStatProbes< E extends StatProbe >.isBroadcasting ( )

Determines if this list of statistical probes is broadcasting observations to registered observers.

The default is false.

Returns
the status of broadcasting.

Definition at line 202 of file ListOfStatProbes.java.

◆ isCollecting()

boolean umontreal.ssj.stat.list.ListOfStatProbes< E extends StatProbe >.isCollecting ( )

Determines if this list of statistical probes is collecting values.

Each probe of the list could or could not be collecting values. The default is true.

Returns
the status of statistical collecting.

Definition at line 182 of file ListOfStatProbes.java.

◆ isModifiable()

boolean umontreal.ssj.stat.list.ListOfStatProbes< E extends StatProbe >.isModifiable ( )

Determines if this list of statistical probes is modifiable, i.e., if probes can be added or removed.

Any list of statistical probes is modifiable by default, until one calls the setUnmodifiable method.

Definition at line 109 of file ListOfStatProbes.java.

◆ notifyListeners()

void umontreal.ssj.stat.list.ListOfStatProbes< E extends StatProbe >.notifyListeners ( double[] x)

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

Otherwise, does nothing.

Definition at line 252 of file ListOfStatProbes.java.

◆ removeArrayOfObservationListener()

void umontreal.ssj.stat.list.ListOfStatProbes< E extends StatProbe >.removeArrayOfObservationListener ( ArrayOfObservationListener l)

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

Parameters
lthe observation listener to be deleted.

Definition at line 236 of file ListOfStatProbes.java.

◆ report()

String umontreal.ssj.stat.list.ListOfStatProbes< E extends StatProbe >.report ( )

Formats a report for each probe in the list of statistical probes.

The returned string is constructed by using StatProbe.report (getName(), this).

Returns
the report formatted as a string.

Definition at line 267 of file ListOfStatProbes.java.

◆ setBroadcasting()

void umontreal.ssj.stat.list.ListOfStatProbes< 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 212 of file ListOfStatProbes.java.

◆ setCollecting()

void umontreal.ssj.stat.list.ListOfStatProbes< 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 192 of file ListOfStatProbes.java.

◆ setName()

void umontreal.ssj.stat.list.ListOfStatProbes< E extends StatProbe >.setName ( String name)

Sets the global name of this list to name.

Parameters
namethe new global name of the list.

Definition at line 100 of file ListOfStatProbes.java.

◆ setUnmodifiable()

void umontreal.ssj.stat.list.ListOfStatProbes< E extends StatProbe >.setUnmodifiable ( )

Forbids any future modification to this list of statistical probes.

After this method is called, any attempt to modify the list results in an exception. Setting a list unmodifiable can be useful if some data structures are defined depending on the probes in the list.

Definition at line 119 of file ListOfStatProbes.java.

◆ sum()

void umontreal.ssj.stat.list.ListOfStatProbes< E extends StatProbe >.sum ( double[] s)

For each probe in the list, computes the sum by calling umontreal.ssj.stat.StatProbe.sum, and stores the results into the array s.

This method throws an exception if the size of s mismatches with the size of the list.

Parameters
sthe array to be filled with sums.
Exceptions
NullPointerExceptionif `s` is `null`.
IllegalArgumentExceptionif `s.length` does not correspond to size.

Definition at line 146 of file ListOfStatProbes.java.


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