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 Random
m_Random
the random number generator used.protected long
m_Seed
the 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 void
defineOptions()
Adds options to the internal list of options.protected <T> List<Binnable<T>>
doRandomize(List<Binnable<T>> data)
Randomizes the data.long
getSeed()
Returns the seed value.String
globalInfo()
Returns a string describing the object.void
reset()
Resets the scheme.String
seedTipText()
Returns the tip text for this property.void
setSeed(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:
globalInfo
in interfaceGlobalInfoSupporter
- Specified by:
globalInfo
in classAbstractOptionHandler
- Returns:
- a description suitable for displaying in the gui
-
defineOptions
public void defineOptions()
Adds options to the internal list of options.- Specified by:
defineOptions
in interfaceOptionHandler
- Overrides:
defineOptions
in classAbstractOptionHandler
-
reset
public void reset()
Resets the scheme.- Specified by:
reset
in interfaceRandomization
- Overrides:
reset
in classAbstractRandomization
-
setSeed
public void setSeed(long value)
Sets the seed value.- Specified by:
setSeed
in interfaceRandomizable
- Parameters:
value
- the seed
-
getSeed
public long getSeed()
Returns the seed value.- Specified by:
getSeed
in interfaceRandomizable
- Returns:
- the seed
-
seedTipText
public String seedTipText()
Returns the tip text for this property.- Specified by:
seedTipText
in 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:
doRandomize
in classAbstractRandomization
- Type Parameters:
T
- the payload type- Parameters:
data
- the data to randomize- Returns:
- the randomized data
-
-