Markov Build Status

HashMap / tuple-backed Markov Chains

Install

// Cargo.toml [dependencies] chainkov = "0.1.0"

Usage

```rust extern crate chainkov;

use chainkov::*;

let mut m = MarkovChain::new(); // MarkovChain{ transition_prob: {} }

m.addstatechoice("a", ("b".tostring(), 1.0)); // MarkovChain { transitionprob: {"a": [("b", 0.4)]} }

m.addstatechoice("b", ("c".tostring(), 1.0)); // MarkovChain { transitionprob: {"a": [("b", 1.0)], "b": [("c", 1.0)]} }

m.addstatechoice("c", ("d".tostring(), 1.0)); // MarkovChain { transitionprob: {"c": [("a", 1.0)], "a": [("b", 1.0)], "b": [("c", 1.0)]} }

m.generatestates("a".tostring(), 4); // ["b", "c", "a", "b"]

m.nextstate("a".tostring()); // "b" ```