Class DefaultRandomization
- java.lang.Object
-
- adams.core.logging.LoggingObject
-
- adams.core.logging.CustomLoggingLevelObject
-
- adams.core.option.AbstractOptionHandler
-
- adams.data.splitgenerator.generic.randomization.AbstractRandomization
-
- adams.data.splitgenerator.generic.randomization.DefaultRandomization
-
- All Implemented Interfaces:
Destroyable,GlobalInfoSupporter,LoggingLevelHandler,LoggingSupporter,OptionHandler,Randomizable,SizeOfHandler,Randomization,Serializable
public class DefaultRandomization extends AbstractRandomization implements Randomizable
Randomizes the data using a random number generator initialized with the seed value. Calling reset() resets the number generator.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
- See Also:
Randomize.randomizeData(List, long), Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Randomm_Randomthe random number generator used.protected longm_Seedthe seed value.-
Fields inherited from class adams.core.option.AbstractOptionHandler
m_OptionManager
-
Fields inherited from class adams.core.logging.LoggingObject
m_Logger, m_LoggingIsEnabled, m_LoggingLevel
-
-
Constructor Summary
Constructors Constructor Description DefaultRandomization()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddefineOptions()Adds options to the internal list of options.protected <T> List<Binnable<T>>doRandomize(List<Binnable<T>> data)Randomizes the data.longgetSeed()Returns the seed value.StringglobalInfo()Returns a string describing the object.voidreset()Resets the scheme.StringseedTipText()Returns the tip text for this property.voidsetSeed(long value)Sets the seed value.-
Methods inherited from class adams.data.splitgenerator.generic.randomization.AbstractRandomization
check, randomize
-
Methods inherited from class adams.core.option.AbstractOptionHandler
cleanUpOptions, destroy, finishInit, getDefaultLoggingLevel, getOptionManager, initialize, loggingLevelTipText, newOptionManager, setLoggingLevel, toCommandLine, toString
-
Methods inherited from class adams.core.logging.LoggingObject
configureLogger, getLogger, getLoggingLevel, initializeLogging, isLoggingEnabled, sizeOf
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface adams.core.logging.LoggingLevelHandler
getLoggingLevel
-
-
-
-
Field Detail
-
m_Seed
protected long m_Seed
the seed value.
-
m_Random
protected transient Random m_Random
the random number generator used.
-
-
Method Detail
-
globalInfo
public String globalInfo()
Returns a string describing the object.- Specified by:
globalInfoin interfaceGlobalInfoSupporter- Specified by:
globalInfoin classAbstractOptionHandler- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptionsin interfaceOptionHandler- Overrides:
defineOptionsin classAbstractOptionHandler
-
reset
public void reset()
Resets the scheme.- Specified by:
resetin interfaceRandomization- Overrides:
resetin classAbstractRandomization
-
setSeed
public void setSeed(long value)
Sets the seed value.- Specified by:
setSeedin interfaceRandomizable- Parameters:
value- the seed
-
getSeed
public long getSeed()
Returns the seed value.- Specified by:
getSeedin interfaceRandomizable- Returns:
- the seed
-
seedTipText
public String seedTipText()
Returns the tip text for this property.- Specified by:
seedTipTextin interfaceRandomizable- Returns:
- tip text for this property suitable for displaying in the GUI or for listing the options.
-
doRandomize
protected <T> List<Binnable<T>> doRandomize(List<Binnable<T>> data)
Randomizes the data.- Specified by:
doRandomizein classAbstractRandomization- Type Parameters:
T- the payload type- Parameters:
data- the data to randomize- Returns:
- the randomized data
-
-