jsim.statistic
Class BatchStat

java.lang.Object
  extended by jsim.statistic.Statistic
      extended by jsim.statistic.SampleStat
          extended by jsim.statistic.BatchStat
All Implemented Interfaces:
java.io.Serializable

public class BatchStat
extends SampleStat

This class provides facilities for gathering and displaying statistical summary results of batch runs.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class jsim.statistic.Statistic
CONF_LEVEL, LABEL, lastTime, MAX_DOUBLE, maxValue, minValue, MONITOR, name, nobs, sum, sumSquares, sumSquBatch
 
Constructor Summary
BatchStat(java.lang.String name)
          Constructs a batch statistic with name and default batch size.
BatchStat(java.lang.String name, int batchSize)
          Constructs a batch statistic with name and batch size.
 
Method Summary
 double[] getBatchData()
          Get the vector which collects all the batch mean values.
 int getBatchSize()
          Get the batch size.
 java.util.Vector getObsStats()
          Get observational statistics for this batch stat variable.
 void setBatchProperties(int bSize, int nBatches)
          Set the batch size and number of batches.
 void setBatchSize(int batchSize)
          Set the batch size.
 boolean tally(double value)
          Save the value of the observation in bSum.
 
Methods inherited from class jsim.statistic.Statistic
confidence, confidence, getName, getStats, getSumSquBatch, max, mean, min, precision, precision, printLabel, printStat, resetStat, rms, samples, setPrimary, stdDev, variance
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BatchStat

public BatchStat(java.lang.String name)
Constructs a batch statistic with name and default batch size.

Parameters:
name - name of the batch statisitic

BatchStat

public BatchStat(java.lang.String name,
                 int batchSize)
Constructs a batch statistic with name and batch size.

Parameters:
name - name of the batch statisitic
batchSize - size of a batch
Method Detail

getBatchSize

public int getBatchSize()
Get the batch size.

Returns:
int current batch size

setBatchSize

public void setBatchSize(int batchSize)
Set the batch size.

Parameters:
batchSize - the batch size

tally

public boolean tally(double value)
              throws StatException
Save the value of the observation in bSum. If a full batch has been collected, call process batch.

Overrides:
tally in class SampleStat
Parameters:
value - value being tallied
Returns:
boolean signal enough batch data has been collected is true, otherwize continues to collect
Throws:
StatException

setBatchProperties

public void setBatchProperties(int bSize,
                               int nBatches)
Set the batch size and number of batches. In case the size of batch is doubled, adjust the local data stores (localArray) accordingly.

Parameters:
bSize - size of batches
nBatches - number of batches have been collected

getBatchData

public double[] getBatchData()
Get the vector which collects all the batch mean values.

Returns:
double [] batch mean vector

getObsStats

public java.util.Vector getObsStats()
Get observational statistics for this batch stat variable.

Returns:
Vector observational stat results