Class eduni.simjava.Sim_accum
All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class eduni.simjava.Sim_accum

java.lang.Object
   |
   +----eduni.simjava.Sim_accum

public class Sim_accum
extends Object
A class for collecting statistical data during simulations.

Constructor Index

 o Sim_accum()
Constructor.
 o Sim_accum(String)
Constructor, with name for SIM++ compatability.

Method Index

 o avg()
Calculates the average value held over the total interval recorded.
 o interval_sum()
Sums all the intervals recorded so far.
 o max()
Find the maximum value recorded so far
 o min()
Find the minimum value recorded so far
 o update(double, double)
Add a new record to the statistics collected so far.

Constructors

 o Sim_accum
  public Sim_accum()
Constructor.
Returns:
A new instance of the class
 o Sim_accum
  public Sim_accum(String name)
Constructor, with name for SIM++ compatability.
Parameters:
name - The name to be associated with the instance, (currently ignored).
Returns:
A new instance of the class

Methods

 o update
  public void update(double interval,
                     double value)
Add a new record to the statistics collected so far.
Parameters:
interval - How long the value held
value - The value to record
 o min
  public double min()
Find the minimum value recorded so far
Returns:
The minimum value recorded so far, or 0.0 if no values have been recorded
 o max
  public double max()
Find the maximum value recorded so far
Returns:
The maximum value recorded so far, or 0.0 if no values have been recorded
 o avg
  public double avg()
Calculates the average value held over the total interval recorded. i.e. Sum_for_all_i(value[i]*interval[i])/total_interval
Returns:
The average value
 o interval_sum
  public double interval_sum()
Sums all the intervals recorded so far.
Returns:
The sum of the intervals

All Packages  Class Hierarchy  This Package  Previous  Next  Index