We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b5d37ef commit d7babe4Copy full SHA for d7babe4
graph/markov_chain.py
@@ -19,3 +19,8 @@ def next_state(chain, current_state):
19
next_state_map = chain.get(current_state)
20
next_state = __choose_state(next_state_map)
21
return next_state
22
+
23
+def iterating_markov_chain(chain, state):
24
+ while True:
25
+ state = next_state(chain, state)
26
+ yield state
0 commit comments