TwoStateMarkovChain

class TwoStateMarkovChain(theInitialState: Int = 0, val p01: Double = 0.5, val p11: Double = 0.5, streamNumber: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null) : RVariable(source)

Randomly generates the states of a two state discrete Markov Chain. Assumes that the states are labeled 0, 1

Author

rossetti

Parameters

theInitialState

the initial state, defaults to 0

p01

the probability of transitioning from state 0 to state 1

p11

the probability of transitioning from state 1 to state 1

streamNumber

the random number stream number, defaults to 0, which means the next stream

streamProvider

the provider of random number streams, defaults to KSLRandom.DefaultRNStreamProvider

name

an optional name

Constructors

Link copied to clipboard
constructor(theInitialState: Int = 0, p01: Double = 0.5, p11: Double = 0.5, streamNumber: Int = 0, streamProvider: RNStreamProviderIfc = KSLRandom.DefaultRNStreamProvider, name: String? = null)

Properties

Link copied to clipboard
Link copied to clipboard
val p0: Double
Link copied to clipboard
val p01: Double = 0.5
Link copied to clipboard
val p1: Double
Link copied to clipboard
val p11: Double = 0.5
Link copied to clipboard
var state: Int

Functions

Link copied to clipboard
open override fun instance(streamNum: Int, rnStreamProvider: RNStreamProviderIfc): TwoStateMarkovChain
Link copied to clipboard
fun reset()

Sets the state back to the initial state