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>)
fork
Link copied to clipboard
common
open suspend override fun fork(): Chain<R>
Create a copy of current chain state.
next
Link copied to clipboard
common
open suspend override fun next(): R
Generate next value, changing state if needed
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

Sources

common source
Link copied to clipboard