This is a simple openFrameworks addon for generating random states using a Markov chain. The transition matrix can be set programmatically or with a text file.
Create a transition matrix from a file:
Setup the Markov chain with the loaded matrix, in state 0:
ofxMC::MarkovChain markov; markov.setup(mat, 0);
Update the state of the Markov chain:
You can get the state of the Markov chain like this:
It will return an
int representing the state of the Markov chain, starting at 0.
You can draw the Markov chain with the
example-rainfall depends on the ofxGui addon to work.
example-random_walker has no dependency (except ofxMarkovChain of course).
This addon was tested with Linux and openFrameworks v0.8.3