ArbitraryVariable

A variable that can take any value from an arbitrary, finite set.

This implementation stores values in an immutable ordered set. Values and the default are non-nullable: an ArbitraryVariable always contains at least a default value and a (possibly empty) set of candidate values.

Constructors

Link copied to clipboard
constructor(default: Serializable, values: List<Serializable?>)
constructor(default: Serializable, vararg values: Double)

Convenience constructor: build from a default value and a vararg of doubles.

constructor(default: Serializable, values: Iterable<Serializable?>)

Construct from a default value and any iterable collection of values.

Properties

Link copied to clipboard
open override val default: Serializable

the default value (non-nullable)

Functions

Link copied to clipboard
open operator override fun iterator(): MutableIterator<Serializable?>
Link copied to clipboard
fun <R> Iterable<R>.randomElement(randomGenerator: RandomGenerator): R

Returns a random element of the Iterable using the provided randomGenerator.

Link copied to clipboard
fun <R> Iterable<R>.shuffled(randomGenerator: RandomGenerator): Iterable<R>

Fisher–Yates shuffle algorithm using a RandomGenerator. More information on Wikipedia.

Link copied to clipboard
open fun steps(): Long
Link copied to clipboard
open override fun stream(): Stream<Serializable?>