Package it.unibo.alchemist.util
Object Iterables
-
-
Method Summary
Modifier and Type Method Description final <R extends Any> Iterable<R>
shuffled(Iterable<R> $self, RandomGenerator randomGenerator)
Fisher–Yates shuffle algorithm using a RandomGenerator. final <R extends Any> R
randomElement(Iterable<R> $self, RandomGenerator randomGenerator)
Returns a random element of the Iterable using the provided randomGenerator. -
-
Method Detail
-
shuffled
final <R extends Any> Iterable<R> shuffled(Iterable<R> $self, RandomGenerator randomGenerator)
Fisher–Yates shuffle algorithm using a RandomGenerator. More information on Wikipedia.
- Parameters:
randomGenerator
-the simulation {@link RandomGenerator}.
-
randomElement
final <R extends Any> R randomElement(Iterable<R> $self, RandomGenerator randomGenerator)
Returns a random element of the Iterable using the provided randomGenerator.
-
-
-
-