MarkovSet is a Dictionary that contains keys pointing to WeighBags that contain objects and their probabilities. By parsing in a stream the Set "learns" what element can possibly follow another.1
Part of MathLib, a diverse library of mathematical functions.
args |
A list of arrays that each represent one node in the set: [element, [next_elements], [weigths]]
If args is | ||||
updateSeeds |
If set to |
length |
Number of items to read. |
stream |
A function or stream that returns items to read. |
Read a pair of values.
Insert a node. Any old node is overwritten.
Remove a pair of values.
Return a next item for the arg
value. If arg
is nil
, choose from seeds.
Read length
items into the set from the stream.
Returns a stream that creates a markov chain.
Julian Rohrhuber, 2004, 2007.