程序包 weka.core
类 Debug.Random
java.lang.Object
java.util.Random
weka.core.Debug.Random
- 所有已实现的接口:
Serializable
,RandomGenerator
,RevisionHandler
- 封闭类:
- Debug
This extended Random class enables one to print the generated random
numbers etc., before they are returned. It can either use stdout (default)
for outputting the logging information or a Log object (level is then
INFO).
- 版本:
- $Revision: 7519 $
- 作者:
- FracPete (fracpete at waikato dot ac dot nz)
- 另请参阅:
-
嵌套类概要
-
构造器概要
构造器 -
方法概要
修饰符和类型方法说明boolean
getDebug()
returns whether to print the generated random values or notlong
getID()
returns the unique ID of this number generatorgetLog()
the currently used log, if null then stdout is used for outputting the debugging informationReturns the revision string.boolean
Returns the next pseudorandom, uniformly distributed boolean value from this random number generator's sequence.void
nextBytes
(byte[] bytes) Generates random bytes and places them into a user-supplied byte array.double
Returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence.float
Returns the next pseudorandom, uniformly distributed float value between 0.0 and 1.0 from this random number generator's sequence.double
Returns the next pseudorandom, Gaussian ("normally") distributed double value with mean 0.0 and standard deviation 1.0 from this random number generator's sequence.int
nextInt()
Returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence.int
nextInt
(int n) Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.long
nextLong()
Returns the next pseudorandom, uniformly distributed long value from this random number generator's sequence.void
prints the current stacktracevoid
setDebug
(boolean value) sets whether to print the generated random values or notvoid
the log to use, if it is null then stdout is usedvoid
setSeed
(long seed) Sets the seed of this random number generator using a single long seed.toString()
returns a string representation of this number generator从类继承的方法 java.util.Random
doubles, doubles, doubles, doubles, ints, ints, ints, ints, longs, longs, longs, longs
从接口继承的方法 java.util.random.RandomGenerator
isDeprecated, nextDouble, nextDouble, nextExponential, nextFloat, nextFloat, nextGaussian, nextInt, nextLong, nextLong
-
构造器详细资料
-
Random
public Random()Creates a new random number generator. With no debugging. -
Random
public Random(long seed) Creates a new random number generator using a single long seed. With no debugging- 参数:
seed
- the seed value
-
Random
public Random(boolean debug) Creates a new random number generator. With optional debugging.- 参数:
debug
- if true, debugging output is enabled
-
Random
public Random(long seed, boolean debug) Creates a new random number generator using a single long seed. With optional debugging- 参数:
seed
- the seed valuedebug
- if true, debugging output is enabled
-
-
方法详细资料
-
setDebug
public void setDebug(boolean value) sets whether to print the generated random values or not- 参数:
value
- if true debugging output is enabled
-
getDebug
public boolean getDebug()returns whether to print the generated random values or not- 返回:
- true if debugging output is enabled
-
setLog
the log to use, if it is null then stdout is used- 参数:
value
- the log to use
-
getLog
the currently used log, if null then stdout is used for outputting the debugging information- 返回:
- the log, can be null
-
getID
public long getID()returns the unique ID of this number generator- 返回:
- the unique ID of this number generator
-
printStackTrace
public void printStackTrace()prints the current stacktrace -
nextBoolean
public boolean nextBoolean()Returns the next pseudorandom, uniformly distributed boolean value from this random number generator's sequence.- 指定者:
nextBoolean
在接口中RandomGenerator
- 覆盖:
nextBoolean
在类中Random
- 返回:
- random boolean
-
nextBytes
public void nextBytes(byte[] bytes) Generates random bytes and places them into a user-supplied byte array.- 指定者:
nextBytes
在接口中RandomGenerator
- 覆盖:
nextBytes
在类中Random
- 参数:
bytes
- array to fill with random bytes
-
nextDouble
public double nextDouble()Returns the next pseudorandom, uniformly distributed double value between 0.0 and 1.0 from this random number generator's sequence.- 指定者:
nextDouble
在接口中RandomGenerator
- 覆盖:
nextDouble
在类中Random
- 返回:
- random double
-
nextFloat
public float nextFloat()Returns the next pseudorandom, uniformly distributed float value between 0.0 and 1.0 from this random number generator's sequence.- 指定者:
nextFloat
在接口中RandomGenerator
- 覆盖:
nextFloat
在类中Random
- 返回:
- random float
-
nextGaussian
public double nextGaussian()Returns the next pseudorandom, Gaussian ("normally") distributed double value with mean 0.0 and standard deviation 1.0 from this random number generator's sequence.- 指定者:
nextGaussian
在接口中RandomGenerator
- 覆盖:
nextGaussian
在类中Random
- 返回:
- random double, gaussian distributed
-
nextInt
public int nextInt()Returns the next pseudorandom, uniformly distributed int value from this random number generator's sequence.- 指定者:
nextInt
在接口中RandomGenerator
- 覆盖:
nextInt
在类中Random
- 返回:
- random int
-
nextInt
public int nextInt(int n) Returns a pseudorandom, uniformly distributed int value between 0 (inclusive) and the specified value (exclusive), drawn from this random number generator's sequence.- 指定者:
nextInt
在接口中RandomGenerator
- 覆盖:
nextInt
在类中Random
- 参数:
n
- the upper limit (exclusive)- 返回:
- random int
-
nextLong
public long nextLong()Returns the next pseudorandom, uniformly distributed long value from this random number generator's sequence.- 指定者:
nextLong
在接口中RandomGenerator
- 覆盖:
nextLong
在类中Random
- 返回:
- random long
-
setSeed
public void setSeed(long seed) Sets the seed of this random number generator using a single long seed. -
toString
returns a string representation of this number generator -
getRevision
Returns the revision string.- 指定者:
getRevision
在接口中RevisionHandler
- 返回:
- the revision
-