This commit is contained in:
zhm-real
2020-06-20 13:25:52 -07:00
parent e67c39290f
commit 6cb8928fa4
7 changed files with 7 additions and 4 deletions
+5 -1
View File
@@ -40,7 +40,11 @@ def animation(xI, xG, obs, path, visited, name):
plt.plot(x[0], x[1], linewidth='3', color='#808080', marker='o')
plt.gcf().canvas.mpl_connect('key_release_event',
lambda event: [exit(0) if event.key == 'escape' else None])
if count % 20 == 0: plt.pause(0.01)
if count < 500: length = 20
elif count < 700: length = 30
else: length = 50
if count % length == 0: plt.pause(0.001)
# plot optimal path
path_x = [path[i][0] for i in range(len(path))]