GridSim
v3.3

eduni.simjava
Class Sim_accum

Object
  extended byeduni.simjava.Sim_accum

public class Sim_accum
extends Object

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.

Version:
1.0, 4 September 1996, 1.1, 29 May 1997 fwh corrected update() bug.
Author:
Ross McNab
See Also:
Sim_stat

Constructor Summary
Sim_accum()
          Allocate a new instance of the class.
Sim_accum(String name)
          Allocate a new, named, 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 Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Sim_accum

public Sim_accum()
Allocate a new instance of the class.


Sim_accum

public Sim_accum(String name)
Allocate a new, named, instance of the class. The name is supplied for SIM++ compatibility.

Parameters:
name - The name to be associated with the instance (currently ignored)
Method Detail

update

public void update(double interval,
                   double value)
Add a new record to the statistics collected so far.

Parameters:
interval - How long the value was held
value - The value to record

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

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

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

interval_sum

public double interval_sum()
Sums all the intervals recorded so far.

Returns:
The sum of the intervals

GridSim
v3.3

The University of Melbourne, Australia, 2005