Skip to content

Commit

Permalink
minibn: random_walk stops at fixed points
Browse files Browse the repository at this point in the history
  • Loading branch information
pauleve committed Mar 9, 2022
1 parent c719f65 commit 80fdcd4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions colomoto/minibn.py
Original file line number Diff line number Diff line change
Expand Up @@ -688,8 +688,9 @@ def stop_condition(x):
while True:
i += 1
nexts = list(self(x))
if nexts:
x = random.choice(nexts)
if not nexts or (len(nexts) == 1 and nexts[0] == x):
return
x = random.choice(nexts)
yield x
if i == steps:
break
Expand Down

0 comments on commit 80fdcd4

Please sign in to comment.