cz.cuni.jagrlib.iface
Interface EntropyHistogram

All Superinterfaces:
Property, WheelOfFortune
All Known Implementing Classes:
IntervalArray

public interface EntropyHistogram
extends WheelOfFortune

Abstract histogram interface - {#link WheelOfFortune} with incremental frequency update capability and decimation mechanism.

Since:
0.04
See Also:
EntropyHistogram.java

Field Summary
 
Fields inherited from interface cz.cuni.jagrlib.iface.Property
LOGGING, STATISTICS, TEXT_DESCRIPTION
 
Method Summary
 void decimate()
          Divides each frequency in the current context by 2.
 int getContext()
          Returns the current context.
 boolean getNonZero()
          Read non-zero attribute for the current context
 long getSumLimit()
          Returns the frequency sum limit for the current context.
 void inc(int _symbol)
          Increments a single symbol's frequency by 1.
 void inc(int _symbol, long _freq)
          Increments a single symbol's frequency.
 void inc(long[] _freq)
          Increments frequencies of all symbols in the current context.
 void init(int _defaultSymbols, long _defaultSumLimit, boolean _defaultNonZero, int _context)
          Histogram (re-)initialization.
 int setContext(int _newContext)
          Sets the given context as current.
 void setDefaultNonZero(boolean _defaultNonZero)
          Set non-zero attribute: keep frequencies non-zero at all times?
 void setDefaultSumLimit(long _defaultSumLimit)
          Sets the new default frequency sum limit for new contexts.
 void setDefaultSymbols(int _defaultSymbols)
          Sets the new default number of symbols for new contexts.
 void setNonZero(boolean _nonZero)
          Set non-zero attribute for the current context: keep frequencies non-zero at all times?
 void setSumLimit(long _sumLimit)
          Changes the frequency sum limit for the current context.
 
Methods inherited from interface cz.cuni.jagrlib.iface.WheelOfFortune
convert, get, getSymbols, left, set, set, setSymbols, total
 
Methods inherited from interface cz.cuni.jagrlib.iface.Property
commit, get, set
 

Method Detail

init

void init(int _defaultSymbols,
          long _defaultSumLimit,
          boolean _defaultNonZero,
          int _context)
Histogram (re-)initialization. Destroys all previously collected statistics.

Parameters:
_defaultSymbols - Default number of symbols for new contexts.
_defaultSumLimit - Default frequency sum limit for new contexts (0 for no bounds).
_defaultNonZero - Keeps frequencies non-zero at all times. Default frequencies are the lowest possible.
_context - The initial context.
See Also:
setDefaultSymbols(int), setDefaultSumLimit(long), setDefaultNonZero(boolean), decimate()

setDefaultSymbols

void setDefaultSymbols(int _defaultSymbols)
Sets the new default number of symbols for new contexts.

Parameters:
_defaultSymbols - New default number of symbols.
See Also:
init(int, long, boolean, int), WheelOfFortune.setSymbols(int), WheelOfFortune.getSymbols()

setDefaultSumLimit

void setDefaultSumLimit(long _defaultSumLimit)
Sets the new default frequency sum limit for new contexts.

Parameters:
_defaultSumLimit - New default frequency sum limit (0 for no bounds).
See Also:
init(int, long, boolean, int), setSumLimit(long), getSumLimit(), WheelOfFortune.total()

setSumLimit

void setSumLimit(long _sumLimit)
Changes the frequency sum limit for the current context.

Parameters:
_sumLimit - New frequency sum limit (0 for no bounds).
See Also:
init(int, long, boolean, int), setDefaultSumLimit(long), getSumLimit(), decimate(), WheelOfFortune.total()

getSumLimit

long getSumLimit()
Returns the frequency sum limit for the current context.

Returns:
Frequency sum limit (0 for no bounds).
See Also:
init(int, long, boolean, int), setDefaultSumLimit(long), setSumLimit(long), WheelOfFortune.total()

setDefaultNonZero

void setDefaultNonZero(boolean _defaultNonZero)
Set non-zero attribute: keep frequencies non-zero at all times? Value for new contexts.

Parameters:
_defaultNonZero - Non-zero attribute for new contexts.
See Also:
init(int, long, boolean, int), setNonZero(boolean), getNonZero()

setNonZero

void setNonZero(boolean _nonZero)
Set non-zero attribute for the current context: keep frequencies non-zero at all times?

Parameters:
_nonZero - Non-zero attribute for the current context.
See Also:
init(int, long, boolean, int), setDefaultNonZero(boolean), getNonZero(), decimate()

getNonZero

boolean getNonZero()
Read non-zero attribute for the current context

Returns:
Non-zero attribute of the current context.
See Also:
init(int, long, boolean, int), setDefaultNonZero(boolean), setNonZero(boolean)

setContext

int setContext(int _newContext)
Sets the given context as current. For unknown contexts initializes parameters to default values.

Parameters:
_newContext - Id of the new context.
Returns:
Id of the old context.
See Also:
init(int, long, boolean, int), setDefaultSymbols(int), setDefaultSumLimit(long), getContext()

getContext

int getContext()
Returns the current context.

Returns:
Id of the current context.
See Also:
setContext(int)

decimate

void decimate()
Divides each frequency in the current context by 2. Called automatically when the total frequency sum exceeds the limit.

See Also:
init(int, long, boolean, int), setDefaultSumLimit(long), setSumLimit(long), getSumLimit(), setDefaultNonZero(boolean), setNonZero(boolean), getNonZero(), WheelOfFortune.total()

inc

void inc(long[] _freq)
Increments frequencies of all symbols in the current context.

Parameters:
_freq - Array of frequency increments.
See Also:
inc(int,long), inc(int), decimate()

inc

void inc(int _symbol,
         long _freq)
Increments a single symbol's frequency.

Parameters:
_symbol - Symbol code.
_freq - Frequency increment of the symbol.
See Also:
inc(long[]), inc(int), decimate()

inc

void inc(int _symbol)
Increments a single symbol's frequency by 1.

Parameters:
_symbol - Symbol code.
See Also:
inc(int,long), inc(long[]), decimate()