|
SimJava v2.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--eduni.simjava.Sim_accum
A class for collecting basic statistical data during simulations.
This class can be used to manually calculate measurements of
interest for state-based, non-continuous measures (see the
SimJava Tutorial for details).
This is a primitive class that is still present in the API for compatibility with existing
simulations. Simulations written with the SimJava version 2.0 should make use of Sim_stat
instances for their entities if statistics are required.
Sim_stat
Constructor Summary | |
Sim_accum()
Allocate a new instance of the class. |
Method Summary | |
double |
avg()
Calculates the average value held over the total interval recorded. |
double |
interval_sum()
Sums all the intervals recorded so far. |
double |
max()
Find the maximum value recorded so far |
double |
min()
Find the minimum value recorded so far |
void |
update(double interval,
double value)
Add a new record to the statistics collected so far. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Sim_accum()
Method Detail |
public void update(double interval, double value)
interval
- How long the value was heldvalue
- The value to recordpublic double min()
public double max()
public double avg()
Sum_for_all_i(value[i]*interval[i])/total_interval
public double interval_sum()
|
SimJava v2.0 |
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |