MarkovChain

class MarkovChain<out R : Any>(seed: suspend () -> R, gen: suspend (R) -> R) : Chain<R>

A stateless Markov chain

Constructors

MarkovChain
Link copied to clipboard
common
fun <out R : Any> MarkovChain(seed: suspend () -> R, gen: suspend (R) -> R)

Functions

collect
Link copied to clipboard
common
open suspend override fun collect(collector: FlowCollector<R>)
equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
fork
Link copied to clipboard
common
open override fun fork(): Chain<R>
Create a copy of current chain state.
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
next
Link copied to clipboard
common
open suspend override fun next(): R
Generate next value, changing state if needed
toString
Link copied to clipboard
common
open fun toString(): String
value
Link copied to clipboard
common
fun value(): R?

Properties

gen
Link copied to clipboard
common
val gen: suspend (R) -> R
value
Link copied to clipboard
common
var value: R? = null