gridsim
Class Accumulator

Object
  |
  +--gridsim.Accumulator

public class Accumulator
extends Object

GridSim Accumulator provides a placeholder for maintaining statistical values of a series of data added to it. It can be queried for mean, min, max, sum, square mean, standard deviation, and the largest and smallest values in the data series.

Version:
2.1, June 2003
Author:
Manzur Murshed and Rajkumar Buyya
Invariant:
$none

Constructor Summary
Accumulator()
          Allocates a new Accumulator object
 
Method Summary
 void add(double item)
          An overloaded method
 void add(double item, int times)
          A method that adds an item to the Accumulator
static int ByteSize()
          Deprecated. As of GridSim 2.1, replaced by getByteSize()
 int count()
          Deprecated. As of GridSim 2.1, replaced by getCount()
static int getByteSize()
          A method that determines the size of Accumulator object
 int getCount()
          A method that counts the number of items accumulated so far
 double getLast()
          A method that finds the last accumulated item
 double getMax()
          A method that finds the largest number of accumulated items
 double getMean()
          A method that calculates the mean of accumulated items
 double getMin()
          A method that finds the smallest number of accumulated items
 double getStandardDeviation()
          A method that calculates the standard deviation of accumulated items
 double getSum()
          A method that calculates the sum of accumulated items
 double last()
          Deprecated. As of GridSim 2.1, replaced by getLast()
 double max()
          Deprecated. As of GridSim 2.1, replaced by getMax()
 double mean()
          Deprecated. As of GridSim 2.1, replaced by getMean()
 double min()
          Deprecated. As of GridSim 2.1, replaced by getMin()
 double sd()
          Deprecated. As of GridSim 2.1, replaced by getStandardDeviation()
 double sum()
          Deprecated. As of GridSim 2.1, replaced by getSum()
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Accumulator

public Accumulator()
Allocates a new Accumulator object

Pre Condition:
$none
Post Condition:
$none
Method Detail

add

public void add(double item,
                int times)
A method that adds an item to the Accumulator

Parameters:
item - an item to be added to the Accumulator
times - number of time the item value is repeated
Pre Condition:
times > 0
Post Condition:
$none

add

public void add(double item)
An overloaded method

Parameters:
item - an item to be added to the accumulator
Pre Condition:
$none
Post Condition:
$none

mean

public double mean()
Deprecated. As of GridSim 2.1, replaced by getMean()

A method that calculates the mean of accumulated items

Returns:
the mean of accumalated items
Pre Condition:
$none
Post Condition:
$none

getMean

public double getMean()
A method that calculates the mean of accumulated items

Returns:
the mean of accumalated items
Pre Condition:
$none
Post Condition:
$none

sd

public double sd()
Deprecated. As of GridSim 2.1, replaced by getStandardDeviation()

A method that calculates the standard deviation of accumulated items

Returns:
the Standard Deviation of accumulated items
Pre Condition:
$none
Post Condition:
$none

getStandardDeviation

public double getStandardDeviation()
A method that calculates the standard deviation of accumulated items

Returns:
the Standard Deviation of accumulated items
Pre Condition:
$none
Post Condition:
$none

min

public double min()
Deprecated. As of GridSim 2.1, replaced by getMin()

A method that finds the smallest number of accumulated items

Returns:
the smallest of accumulated items
Pre Condition:
$none
Post Condition:
$none

getMin

public double getMin()
A method that finds the smallest number of accumulated items

Returns:
the smallest of accumulated items
Pre Condition:
$none
Post Condition:
$none

max

public double max()
Deprecated. As of GridSim 2.1, replaced by getMax()

A method that finds the largest number of accumulated items

Returns:
the largest of accumulated items
Pre Condition:
$none
Post Condition:
$none

getMax

public double getMax()
A method that finds the largest number of accumulated items

Returns:
the largest of accumulated items
Pre Condition:
$none
Post Condition:
$none

last

public double last()
Deprecated. As of GridSim 2.1, replaced by getLast()

A method that finds the last accumulated item

Returns:
the last accumulated item
Pre Condition:
$none
Post Condition:
$none

getLast

public double getLast()
A method that finds the last accumulated item

Returns:
the last accumulated item
Pre Condition:
$none
Post Condition:
$none

count

public int count()
Deprecated. As of GridSim 2.1, replaced by getCount()

A method that counts the number of items accumulated so far

Returns:
the number of items accumulated so far
Pre Condition:
$none
Post Condition:
$result >= 0

getCount

public int getCount()
A method that counts the number of items accumulated so far

Returns:
the number of items accumulated so far
Pre Condition:
$none
Post Condition:
$result >= 0

sum

public double sum()
Deprecated. As of GridSim 2.1, replaced by getSum()

A method that calculates the sum of accumulated items

Returns:
the sum of accumulated items
Pre Condition:
$none
Post Condition:
$none

getSum

public double getSum()
A method that calculates the sum of accumulated items

Returns:
the sum of accumulated items
Pre Condition:
$none
Post Condition:
$none

ByteSize

public static int ByteSize()
Deprecated. As of GridSim 2.1, replaced by getByteSize()

A method that determines the size of Accumulator object

Returns:
the size of this object
Pre Condition:
$none
Post Condition:
$result > 0

getByteSize

public static int getByteSize()
A method that determines the size of Accumulator object

Returns:
the size of this object
Pre Condition:
$none
Post Condition:
$result > 0