Flag

data class Flag(val default: Boolean) : AbstractPrintableVariable<Boolean>

A boolean flag variable. Charts typically accept numeric values, but the semantic value of this variable is boolean; use true and false as the two possible outputs. The default value is provided at construction.

This is equivalent in behavior to a LinearVariable with two samples between 0 and 1, but keeps the boolean semantics.

Parameters

default

the default boolean value

Constructors

Link copied to clipboard
constructor(default: Boolean)

Properties

Link copied to clipboard
open override val default: Boolean

Functions

Link copied to clipboard
open operator override fun iterator(): MutableIterator<Boolean?>
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<Boolean>