GridSim
v3.1

gridsim
Class Accumulator

Object
  extended bygridsim.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.

Since:
GridSim Toolkit 1.0
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)
          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()
          Determines the size of Accumulator object
 int getCount()
          Counts the number of items accumulated so far
 double getLast()
          Finds the last accumulated item
 double getMax()
          Finds the largest number of accumulated items
 double getMean()
          Calculates the mean of accumulated items
 double getMin()
          Finds the smallest number of accumulated items
 double getStandardDeviation()
          Calculates the standard deviation of accumulated items
 double getSum()
          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)
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()

Calculates the mean of accumulated items

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

getMean

public double getMean()
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()

Calculates the standard deviation of accumulated items

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

getStandardDeviation

public double getStandardDeviation()
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()

Finds the smallest number of accumulated items

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

getMin

public double getMin()
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()

Finds the largest number of accumulated items

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

getMax

public double getMax()
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()

Finds the last accumulated item

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

getLast

public double getLast()
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()

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()
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()

Calculates the sum of accumulated items

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

getSum

public double getSum()
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()

Determines the size of Accumulator object

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

getByteSize

public static int getByteSize()
Determines the size of Accumulator object

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

GridSim
v3.1

The University of Melbourne, Australia, 2004