markov-chain-0.0.3.1: Markov Chains for generating random sequences with a user definable behaviour.Source codeContentsIndex
Data.MarkovChain
PortabilityHaskell 98
Stabilitystable
Maintainerhaskell@henning-thielemann.de
Description
Markov chains can be used to recompose a list of elements respecting the fact that the probability of a certain element depends on preceding elements in the list.
Synopsis
run :: (Ord a, RandomGen g) => Int -> [a] -> Int -> g -> [a]
runMulti :: (Ord a, RandomGen g) => Int -> [[a]] -> Int -> g -> [[a]]
Documentation
runSource
:: (Ord a, RandomGen g)
=> Inttraining sequence, the one to walk through randomly
-> [a]index to start the random walk within the training sequence
-> Intrandom generator state
-> g
-> [a]

Creates a chain of elements respecting to the probabilities of possible successors. The list is considered being cyclic in order to have successors for the last elements.

Example:

 take 100 $ run 2 "The sad cat sat on the mat. " 0 (Random.mkStdGen 123)
runMultiSource
:: (Ord a, RandomGen g)
=> Inttraining sequences, the order is relevant
-> [[a]]index of starting training sequence
-> Intrandom generator state
-> g
-> [[a]]
Produced by Haddock version 2.6.0