SimpleRNG

io.github.srs.utils.random.SimpleRNG
final case class SimpleRNG(seed: Long) extends RNG

A simple implementation of the RNG trait using Scala's built-in Random class. This RNG generates random values based on a seed.

Value parameters

seed

the initial seed for the random number generator.

Attributes

Note

This RNG is deterministic, meaning it will produce the same sequence of random values for the same seed.

Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait RNG
class Object
trait Matchable
class Any
Show all

Members list

Value members

Concrete methods

override def nextBoolean: (Boolean, RNG)

Generates a random boolean value along with the next RNG state.

Generates a random boolean value along with the next RNG state.

Attributes

Definition Classes
RNG
override def nextDouble: (Double, RNG)

Generates a random double value within the range [0.0, 1.0) along with the next RNG state.

Generates a random double value within the range [0.0, 1.0) along with the next RNG state.

Attributes

Definition Classes
RNG
override def nextDoubleBetween(min: Double, max: Double, isMaxExcluded: Boolean): (Double, RNG)

Generates a random double value within a specified range.

Generates a random double value within a specified range.

Attributes

Definition Classes
RNG
override def nextInt: (Int, RNG)

Generates a random integer value along with the next RNG state.

Generates a random integer value along with the next RNG state.

Attributes

Definition Classes
RNG
override def nextIntBetween(min: Int, max: Int, isMaxExcluded: Boolean): (Int, RNG)

Generates a random integer value within a specified range (inclusive of min, exclusive of max).

Generates a random integer value within a specified range (inclusive of min, exclusive of max).

Attributes

Definition Classes
RNG
override def nextLong: (Long, RNG)

Generates a random long value along with the next RNG state.

Generates a random long value along with the next RNG state.

Attributes

Definition Classes
RNG
override def nextString(length: Int): (String, RNG)

Generates a random string of a specified length.

Generates a random string of a specified length.

Attributes

Definition Classes
RNG
override def shuffle[A](seq: Seq[A]): (Seq[A], RNG)

Shuffles a sequence of elements randomly.

Shuffles a sequence of elements randomly.

Attributes

Definition Classes
RNG

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product