class Random extends Serializable
- Alphabetic
- By Inheritance
- Random
- Serializable
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def between(minInclusive: Double, maxExclusive: Double): Double
Generate a uniformly random Double in a given interval.
Generate a uniformly random Double in a given interval.
- minInclusive
inclusive minimum of the interval
- maxExclusive
exclusive maximum of the interval
- returns
uniformly random Double between minInclusive and maxExclusive
- def between(minInclusive: Int, maxExclusive: Int): Int
Generate a uniformly random Int in a given interval.
Generate a uniformly random Int in a given interval.
- minInclusive
inclusive minimum of the interval
- maxExclusive
exclusive maximum of the interval
- returns
uniformly random Int between minInclusive and maxExclusive
- def between(minInclusive: Long, maxExclusive: Long): Long
Generate a uniformly random Long in a given interval.
Generate a uniformly random Long in a given interval.
- minInclusive
inclusive minimum of the interval
- maxExclusive
exclusive maximum of the interval
- returns
uniformly random Long between minInclusive and maxExclusive
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def nextBoolean(): Boolean
Generate a uniformly random Boolean.
Generate a uniformly random Boolean.
- returns
a random Boolean
- def nextDouble(): Double
Generate a uniformly random Double between zero (inclusive) and one (exclusive).
Generate a uniformly random Double between zero (inclusive) and one (exclusive).
- returns
a uniformly random number on the unit interval
- def nextGaussian(mean: Double, stdDev: Double): Double
Generate a Gaussian-distributed random variable with given mean and standard deviation.
Generate a Gaussian-distributed random variable with given mean and standard deviation.
- mean
of the distribution
- stdDev
of the distribution
- def nextGaussian(): Double
Generate a Gaussian-distributed random Double with mean 0 and variance 1
Generate a Gaussian-distributed random Double with mean 0 and variance 1
- returns
a draw from the standard normal distribution.
- def nextInt(bound: Int): Int
Generate a uniformly random Int between zero and a given exclusive upper bound.
Generate a uniformly random Int between zero and a given exclusive upper bound.
- bound
exclusive upper bound
- returns
a random Int between 0 (inclusive) and bound (exclusive)
- def nextInt(): Int
Generate a uniformly random Int on the whole allowed range.
Generate a uniformly random Int on the whole allowed range.
- returns
a random Int
- def nextLong(bound: Long): Long
Generate a uniformly random Long between zero and a given exclusive upper bound.
Generate a uniformly random Long between zero and a given exclusive upper bound.
- bound
exclusive upper bound
- returns
a random Long between 0 (inclusive) and bound (exclusive)
- def nextLong(): Long
Generate a uniformly random Long on the whole allowed range.
Generate a uniformly random Long on the whole allowed range.
- returns
a random Long
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def shuffle[T, CC[X] <: IterableOnce[X]](xs: CC[T])(implicit bf: BuildFrom[CC[T], T, CC[T]]): CC[T]
Returns a new collection of the same type in a randomly chosen order.
Returns a new collection of the same type in a randomly chosen order.
Taken from scala.util.Random
- T
the type of elements in xs
- CC
the type of collection
- xs
the values to shuffle
- bf
builder for type CC[T] from type CC[T]
- returns
a collection of type CC[T] with elements uniformly shuffled
- def split(): Random
Split off an independent parallel stream of random numbers.
Split off an independent parallel stream of random numbers.
- returns
a new instance of Random whose stream of random numbers are independent of the present stream.
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- def zip[T, CC[X] <: IterableOnce[X]](xs: CC[T])(implicit bf: BuildFrom[CC[T], (Random, T), CC[(Random, T)]]): CC[(Random, T)]
Zip the rng with the iterable collection, splitting the rng on each new element.
Zip the rng with the iterable collection, splitting the rng on each new element.
This method is useful for producing a stream of independent random generators for multi-threaded applications.
- T
the type of elements in xs
- CC
the type of collection
- xs
the collection to zip with
- bf
builder for type CC[(Random, T)] from type CC[T]
- returns
a collection of type CC[(Random, T)] with elements zipped with split random generators
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated