|
SSJ V. 1.2.5. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.util.Observable
umontreal.iro.lecuyer.stat.StatProbe
umontreal.iro.lecuyer.simevents.Accumulate
public class Accumulate
A subclass of StatProbe
,
for collecting statistics on a
variable that evolves in simulation time, with a piecewise-constant trajectory.
Each time the variable changes its value, the method update
must be called to inform the probe of the new value.
The probe can be reinitialized by init
.
Constructor Summary | |
---|---|
Accumulate()
Constructs a new Accumulate statistical probe and initializes it by invoking init(). |
|
Accumulate(String name)
Construct and initializes a new Accumulate statistical probe with name name and initial time 0. |
Method Summary | |
---|---|
double |
average()
Returns the time-average since the last initialization to the last call to update. |
Object |
clone()
Clone this object. |
double |
getInitTime()
Returns the initialization time for this object. |
double |
getLastTime()
Returns the last update time for this object. |
double |
getLastValue()
Returns the value passed to this probe by the last call to its update method (or the initial value if
update was never called after init ). |
void |
init()
Initializes the statistical collector and puts the current value of the corresponding variable to 0. |
void |
init(double x)
Same as init followed by update (x). |
String |
report()
Returns a string containing a report for this statistical collector. |
double |
sum()
Returns the sum cumulated so far for this probe. |
void |
update()
Updates the accumulator using the last value passed to update . |
void |
update(double x)
Gives a new observation x to the statistical collector. |
Methods inherited from class umontreal.iro.lecuyer.stat.StatProbe |
---|
getName, max, min, setBroadcasting, setCollecting, setName |
Methods inherited from class java.util.Observable |
---|
addObserver, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Accumulate()
public Accumulate(String name)
name
- descriptive name for the probeMethod Detail |
---|
public void init()
update
to give the value of the variable at the
initialization time.
init
in class StatProbe
public void init(double x)
init
followed by update
(x).
x
- initial value of the probepublic void update()
update
.
public void update(double x)
notifyObservers
(new Double (x))
inherited from
Observable
.
x
- new observation given to the probepublic double sum()
StatProbe
Tally
or
Accumulate
).
sum
in class StatProbe
public double average()
average
in class StatProbe
public String report()
StatProbe
report
in class StatProbe
public double getInitTime()
init
was called for
the last time.
public double getLastTime()
update
or
the initialization time if update
was never called after
init
.
public double getLastValue()
update
method (or the initial value if
update
was never called after init
).
public Object clone()
clone
in class StatProbe
|
SSJ V. 1.2.5. |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |