Closed tmhglnd closed 8 months ago
For MarkovChain()
there is now an markov.read()
method to set the transition table.
This is now fixed in 7211cf46a1a096b705eab5ee3e20554b2f8897fc. The methods .stringify()
and .parse()
have been added to the DeepMarkovChain
class. See more details in the docs: https://github.com/tmhglnd/total-serialism/blob/master/docs/stochastic-methods.md#deepmarkovchain
For the normal Markov this will be quite straight forward, for the DeepMarkov it needs some translation because that class uses the
Map
object. Below some code that should be implemented from https://stackoverflow.com/questions/29085197/how-do-you-json-stringify-an-es6-map: