etomica.data
Class AccumulatorAverageFixed

java.lang.Object
  extended by etomica.data.DataProcessor
      extended by etomica.data.DataProcessorForked
          extended by etomica.data.DataAccumulator
              extended by etomica.data.AccumulatorAverage
                  extended by etomica.data.AccumulatorAverageFixed
All Implemented Interfaces:
DataPipe, DataPipeForked, IDataSink, IDataSource, IEtomicaDataSource, Serializable
Direct Known Subclasses:
AccumulatorAverageCovariance, AccumulatorRatioAverage

public class AccumulatorAverageFixed
extends AccumulatorAverage

AccumulatorAverage that maintains a fixed block size.

This accumulator accepts any type of Data

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class etomica.data.AccumulatorAverage
AccumulatorAverage.StatType
 
Field Summary
protected  IData correlationSum
           
protected  IData currentBlockSum
           
protected  IData firstBlock
           
protected  IData mostRecentBlock
           
protected  IFunction negativeChop
           
protected  IData sum
           
protected  IData sumBlockSquare
           
protected  IData sumSquare
           
protected  IData work
           
 
Fields inherited from class etomica.data.AccumulatorAverage
average, blockCorrelation, blockCountDown, blockSize, count, dataGroup, error, mostRecent, standardDeviation
 
Fields inherited from class etomica.data.DataAccumulator
active, putCount
 
Fields inherited from class etomica.data.DataProcessor
dataInfo, dataSink, tag, trueDataSink
 
Constructor Summary
AccumulatorAverageFixed()
          Default constructor sets block size to Default value, and sets the interval for pushing the output data (pushInterval) to 100.
AccumulatorAverageFixed(long blockSize)
           
 
Method Summary
 void addData(IData data)
          Add the given values to the sums and block sums.
protected  void doBlockSum()
          Performs the block sum after blockSize calls to addData.
 IData getData()
          Returns a DataGroup with Data instances holding the statistics kept by this accumulator (as described in general comments for this class).
 DataPipe getDataCaster(IEtomicaDataInfo incomingDataInfo)
          Returns null (any data is good data)
 IEtomicaDataInfo processDataInfo(IEtomicaDataInfo incomingDataInfo)
          Prepares the accumulator for input data.
 void reset()
          Resets all sums to zero.
 
Methods inherited from class etomica.data.AccumulatorAverage
addDataSink, getBlockCount, getBlockSize, getTag, setBlockSize
 
Methods inherited from class etomica.data.DataAccumulator
getPushInterval, isActive, processData, setActive, setPushInterval, toString
 
Methods inherited from class etomica.data.DataProcessorForked
addDataSink, getDataSink, getDataSinks, removeDataSink, setDataSink, setDataSinks
 
Methods inherited from class etomica.data.DataProcessor
getDataInfo, getTag, insertTransformerIfNeeded, putData, putDataInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface etomica.data.IEtomicaDataSource
getDataInfo, getTag
 
Methods inherited from interface etomica.data.DataPipe
getTag
 
Methods inherited from interface etomica.data.IDataSink
putData, putDataInfo
 

Field Detail

sum

protected IData sum

sumBlockSquare

protected IData sumBlockSquare

currentBlockSum

protected IData currentBlockSum

sumSquare

protected IData sumSquare

mostRecentBlock

protected IData mostRecentBlock

correlationSum

protected IData correlationSum

firstBlock

protected IData firstBlock

work

protected IData work

negativeChop

protected final IFunction negativeChop
Constructor Detail

AccumulatorAverageFixed

public AccumulatorAverageFixed()
Default constructor sets block size to Default value, and sets the interval for pushing the output data (pushInterval) to 100.


AccumulatorAverageFixed

public AccumulatorAverageFixed(long blockSize)
Method Detail

getDataCaster

public DataPipe getDataCaster(IEtomicaDataInfo incomingDataInfo)
Returns null (any data is good data)

Parameters:
incomingDataInfo - the DataInfo for the Data that will fed to the sink's putData method

addData

public void addData(IData data)
Add the given values to the sums and block sums. If any of the given data values is NaN, method returns with no effect on accumulation sums.

Specified by:
addData in class DataAccumulator

doBlockSum

protected void doBlockSum()
Performs the block sum after blockSize calls to addData.


getData

public IData getData()
Returns a DataGroup with Data instances holding the statistics kept by this accumulator (as described in general comments for this class).

Specified by:
getData in interface IDataSource
Specified by:
getData in class DataAccumulator
Returns:
the data given by this source

reset

public void reset()
Resets all sums to zero. All statistics are cleared.

Overrides:
reset in class AccumulatorAverage

processDataInfo

public IEtomicaDataInfo processDataInfo(IEtomicaDataInfo incomingDataInfo)
Prepares the accumulator for input data. Discards any previous contributions to statistics.

Overrides:
processDataInfo in class AccumulatorAverage
Parameters:
incomingDataInfo - the DataInfo instance for the data that will be given to addData
Returns:
the DataInfo of the Data that will be output by this DataProcessor