SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.simevents.ListWithStat< E > Class Template Reference

Implements a list with integrated statistical probes to provide automatic collection of statistics on the sojourn times of objects in the list and on the size of the list as a function of time given by a simulator. More...

Inheritance diagram for umontreal.ssj.simevents.ListWithStat< E >:
umontreal.ssj.util.TransformingList< OE, IE > umontreal.ssj.simevents.LinkedListStat< E >

Classes

class  Node
 Represents a node that can be part of a list with statistical collecting. More...

Public Member Functions

 ListWithStat (List< Node< E > > nodeList)
 Constructs a new list with internal data structure using the default simulator and implemented by nodeList.
 ListWithStat (Simulator inSim, List< Node< E > > nodeList)
 Constructs a new list with internal data structure implemented by nodeList.
 ListWithStat (List< Node< E > > nodeList, Collection<? extends E > c)
 Constructs a list containing the elements of the specified collection, whose elements are stored into nodeList and using the default simulator.
 ListWithStat (Simulator inSim, List< Node< E > > nodeList, Collection<? extends E > c)
 Constructs a list containing the elements of the specified collection, whose elements are stored into nodeList.
 ListWithStat (List< Node< E > > nodeList, String name)
 Constructs a new list with name name, internal list nodeList, and using the default simulator.
 ListWithStat (Simulator inSim, List< Node< E > > nodeList, String name)
 Constructs a new list with name name, and internal list nodeList.
 ListWithStat (List< Node< E > > nodeList, Collection<? extends E > c, String name)
 Constructs a new list containing the elements of the specified collection c, with name name, internal list nodeList, and using the default simulator.
 ListWithStat (Simulator inSim, List< Node< E > > nodeList, Collection<? extends E > c, String name)
 Constructs a new list containing the elements of the specified collection c, with name name, and internal list nodeList.
Simulator simulator ()
 Returns the simulator associated with this list.
void setSimulator (Simulator sim)
 Sets the simulator associated with this list.
Statistic collection methods @{
boolean getStatCollecting ()
 Returns true if the list collects statistics about its size and sojourn times of elements, and false otherwise.
void setStatCollecting (boolean b)
 Starts or stops collecting statistics on this list.
void initStat ()
 Reinitializes the two statistical probes created by setStatCollecting(true) and makes an update for the probe on the list size.
double getInitTime ()
 Returns the last simulation time initStat was called.
Accumulate statSize ()
 Returns the statistical probe on the evolution of the size of the list as a function of the simulation time.
Tally statSojourn ()
 Returns the statistical probe on the sojourn times of the objects in the list.
String report ()
 Returns a string containing a statistical report on the list, provided that setStatCollecting(true) has been called before for this list.
String getName ()
 Returns the name associated to this list, or null if no name was assigned.
Public Member Functions inherited from umontreal.ssj.util.TransformingList< OE, IE >
 TransformingList (List< IE > fromList)
 Creates a new transforming list wrapping the inner list fromList.
abstract OE convertFromInnerType (IE e)
 Converts an element in the inner list to an element of the outer type.
abstract IE convertToInnerType (OE e)
 Converts an element of the outer type to an element for the inner list.

Detailed Description

Implements a list with integrated statistical probes to provide automatic collection of statistics on the sojourn times of objects in the list and on the size of the list as a function of time given by a simulator.

The automatic statistical collection can be enabled or disabled for each list, to reduce overhead. This class extends

umontreal.ssj.util.TransformingList and transforms elements into nodes associating insertion times with elements.

Definition at line 50 of file ListWithStat.java.

Constructor & Destructor Documentation

◆ ListWithStat() [1/8]

umontreal.ssj.simevents.ListWithStat< E >.ListWithStat ( List< Node< E > > nodeList)

Constructs a new list with internal data structure using the default simulator and implemented by nodeList.

The given list is cleared for the constructed list to be initially empty.

Definition at line 63 of file ListWithStat.java.

◆ ListWithStat() [2/8]

umontreal.ssj.simevents.ListWithStat< E >.ListWithStat ( Simulator inSim,
List< Node< E > > nodeList )

Constructs a new list with internal data structure implemented by nodeList.

The given list is cleared for the constructed list to be initially empty.

Parameters
nodeListthe list containing the nodes

Definition at line 76 of file ListWithStat.java.

◆ ListWithStat() [3/8]

umontreal.ssj.simevents.ListWithStat< E >.ListWithStat ( List< Node< E > > nodeList,
Collection<? extends E > c )

Constructs a list containing the elements of the specified collection, whose elements are stored into nodeList and using the default simulator.

Parameters
nodeListthe list containing the nodes
ccollection containing elements to fill in this list with

Definition at line 92 of file ListWithStat.java.

◆ ListWithStat() [4/8]

umontreal.ssj.simevents.ListWithStat< E >.ListWithStat ( Simulator inSim,
List< Node< E > > nodeList,
Collection<? extends E > c )

Constructs a list containing the elements of the specified collection, whose elements are stored into nodeList.

Parameters
inSimsimulator associate to the current variable
nodeListthe list containing the nodes
ccollection containing elements to fill in this list with

Definition at line 105 of file ListWithStat.java.

◆ ListWithStat() [5/8]

umontreal.ssj.simevents.ListWithStat< E >.ListWithStat ( List< Node< E > > nodeList,
String name )

Constructs a new list with name name, internal list nodeList, and using the default simulator.

This name can be used to identify the list in traces and reports. The given list is cleared for the constructed list to be initially empty.

Parameters
nodeListthe list containing the nodes
namename for the list object

Definition at line 119 of file ListWithStat.java.

◆ ListWithStat() [6/8]

umontreal.ssj.simevents.ListWithStat< E >.ListWithStat ( Simulator inSim,
List< Node< E > > nodeList,
String name )

Constructs a new list with name name, and internal list nodeList.

This name can be used to identify the list in traces and reports. The given list is cleared for the constructed list to be initially empty.

Parameters
inSimsimulator associate to the current variable
nodeListthe list containing the nodes
namename for the list object

Definition at line 133 of file ListWithStat.java.

◆ ListWithStat() [7/8]

umontreal.ssj.simevents.ListWithStat< E >.ListWithStat ( List< Node< E > > nodeList,
Collection<? extends E > c,
String name )

Constructs a new list containing the elements of the specified collection c, with name name, internal list nodeList, and using the default simulator.

This name can be used to identify the list in traces and reports.

Parameters
nodeListthe list containing the nodes
ccollection containing elements to fill in this list with
namename for the list object

Definition at line 147 of file ListWithStat.java.

◆ ListWithStat() [8/8]

umontreal.ssj.simevents.ListWithStat< E >.ListWithStat ( Simulator inSim,
List< Node< E > > nodeList,
Collection<? extends E > c,
String name )

Constructs a new list containing the elements of the specified collection c, with name name, and internal list nodeList.

This name can be used to identify the list in traces and reports.

Parameters
inSimsimulator associate to the current variable
nodeListthe list containing the nodes
ccollection containing elements to fill in this list with
namename for the list object

Definition at line 163 of file ListWithStat.java.

Member Function Documentation

◆ getInitTime()

double umontreal.ssj.simevents.ListWithStat< E >.getInitTime ( )

Returns the last simulation time initStat was called.

Returns
the last simulation time initStat was called

Definition at line 424 of file ListWithStat.java.

◆ getName()

String umontreal.ssj.simevents.ListWithStat< E >.getName ( )

Returns the name associated to this list, or null if no name was assigned.

Returns
the name associated to this list

Definition at line 494 of file ListWithStat.java.

◆ getStatCollecting()

boolean umontreal.ssj.simevents.ListWithStat< E >.getStatCollecting ( )

Returns true if the list collects statistics about its size and sojourn times of elements, and false otherwise.

By default, statistical collecting is turned off.

Returns
the status of statistical collecting

Definition at line 370 of file ListWithStat.java.

◆ initStat()

void umontreal.ssj.simevents.ListWithStat< E >.initStat ( )

Reinitializes the two statistical probes created by setStatCollecting(true) and makes an update for the probe on the list size.

Exceptions
IllegalStateExceptionif the statistical collection is disabled

Definition at line 410 of file ListWithStat.java.

◆ report()

String umontreal.ssj.simevents.ListWithStat< E >.report ( )

Returns a string containing a statistical report on the list, provided that setStatCollecting(true) has been called before for this list.

Even If setStatCollecting was called with false afterward, the report will be made for the collected observations. If the probes do not exist, i.e., setStatCollecting was never called for this object, an illegal state exception will be thrown.

Returns
a statistical report, represented as a string
Exceptions
IllegalStateExceptionif no statistical probes exist

Definition at line 463 of file ListWithStat.java.

◆ setSimulator()

void umontreal.ssj.simevents.ListWithStat< E >.setSimulator ( Simulator sim)

Sets the simulator associated with this list.

This list should be cleared after this method is called.

Parameters
simthe simulator of this list

Definition at line 192 of file ListWithStat.java.

◆ setStatCollecting()

void umontreal.ssj.simevents.ListWithStat< E >.setStatCollecting ( boolean b)

Starts or stops collecting statistics on this list.

If the statistical collection is turned ON, the method creates two statistical probes if they do not exist yet. The first one, of the class Accumulate, measures the evolution of the size of the list as a function of time. It can be accessed by the method statSize. The second one, of the class umontreal.ssj.stat.Tally and accessible via statSojourn, samples the sojourn times in the list of the objects removed during the observation period, i.e., between the last initialization time of this statistical probe and the current time. The method automatically calls initStat to initialize these two probes. When this method is used, it is normally invoked immediately after calling the constructor of the list.

Exceptions
IllegalStateExceptionif the statistical collection is in the same state as the caller requires

Definition at line 390 of file ListWithStat.java.

◆ simulator()

Returns the simulator associated with this list.

Returns
the simulator associated with this list

Definition at line 182 of file ListWithStat.java.

◆ statSize()

Returns the statistical probe on the evolution of the size of the list as a function of the simulation time.

This probe exists only if setStatCollecting(true) has been called for this list.

Returns
the statistical probe on the evolution of the size of the list

Definition at line 436 of file ListWithStat.java.

◆ statSojourn()

Returns the statistical probe on the sojourn times of the objects in the list.

This probe exists only if setStatCollecting(true) has been called for this list.

Returns
the statistical probe for the sojourn times in the list

Definition at line 447 of file ListWithStat.java.


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