org.processmining.mining.dmcscanning.freqstat
Class FrequencyStatistics

java.lang.Object
  extended by org.processmining.mining.dmcscanning.freqstat.FrequencyStatistics

public class FrequencyStatistics
extends java.lang.Object

Class for keeping statistics of and performing analysis on the frequency in which (low-level) events occur.

Author:
Christian W. Guenther (christian at deckfour dot org)

Field Summary
protected  java.util.TreeMap distances
           
protected  long entryCounter
           
protected  long valueCounter
           
 
Constructor Summary
FrequencyStatistics()
          constructor
 
Method Summary
 void addValue(long distance)
          adds a newly discovered value to the set
 long getMaxValue()
           
 long getMinValue()
           
 int[] getNormalizedDistribution(int maxValue, int granularity)
          Creates an array of distribution values for e.g.
 long getNumberOfEntries()
           
 long getNumberOfEntriesBetweenValues(long minVal, long maxVal)
          Retrieves the number of recorded values within a given interval.
 long getNumberOfEntriesForValue(long value)
          Retrieves, for a given value, the number of entries that have been stored with that value (e.g., how many times '5' has been stored).
 long getNumberOfValues()
           
 void initialize()
          resets the object to its initial state
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

distances

protected java.util.TreeMap distances

entryCounter

protected long entryCounter

valueCounter

protected long valueCounter
Constructor Detail

FrequencyStatistics

public FrequencyStatistics()
constructor

Method Detail

initialize

public void initialize()
resets the object to its initial state


addValue

public void addValue(long distance)
adds a newly discovered value to the set

Parameters:
distance -

getNumberOfEntries

public long getNumberOfEntries()
Returns:
the total number of represented values

getNumberOfValues

public long getNumberOfValues()
Returns:
the number of distinct represented values

getMinValue

public long getMinValue()
Returns:
the smallest value stored

getMaxValue

public long getMaxValue()
Returns:
the largest value stored

getNumberOfEntriesForValue

public long getNumberOfEntriesForValue(long value)
Retrieves, for a given value, the number of entries that have been stored with that value (e.g., how many times '5' has been stored).

Parameters:
value -
Returns:

getNumberOfEntriesBetweenValues

public long getNumberOfEntriesBetweenValues(long minVal,
                                            long maxVal)
Retrieves the number of recorded values within a given interval. The interval is interpreted as: [minVal, maxVal] (boundary-inlcusive).

Parameters:
minVal -
maxVal -
Returns:

getNormalizedDistribution

public int[] getNormalizedDistribution(int maxValue,
                                       int granularity)
Creates an array of distribution values for e.g. displaying results in a plotted graph.

Parameters:
maxValue - the value the highest number of occurrences should be mapped to (e.g., display graph height)
granularity - the number of values to normalize to
Returns:
an integer array of size 'granularity', with values between [0, maxValue].