io.github.srs.utils.random
Members list
Type members
Classlikes
A trait representing a Random Number Generator (RNG).
A trait representing a Random Number Generator (RNG).
Attributes
- Supertypes
-
class Objecttrait Matchableclass Any
- Known subtypes
-
class SimpleRNG
A simple implementation of the RNG trait using Scala's built-in Random class. This RNG generates random values based on a seed.
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.
- Supertypes
-
trait Serializabletrait Producttrait Equalstrait RNGclass Objecttrait Matchableclass AnyShow all
Types
A domain-specific alias for a function that generates a random value of type A
and returns it along with the next state of the RNG.
A domain-specific alias for a function that generates a random value of type A
and returns it along with the next state of the RNG.
Attributes
Extensions
Extensions
Maps the value generated by the Rand to a new value of type B
using the provided function f
.
Maps the value generated by the Rand to a new value of type B
using the provided function f
.
Type parameters
- B
-
the type of the value to be generated by the transformed Rand.
Value parameters
- f
-
the function to transform the value of type
A
into a value of typeB
.
Attributes
- Returns
-
a new Rand that generates a value of type
B
.