Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 5a2dd2d

Browse files
committed
update create_animation remove save file name
1 parent c98fa4f commit 5a2dd2d

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

‎Search/nqueens.py

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -277,8 +277,7 @@ def create_animation(history,
277277
plot_objective=False,
278278
summarize=False,
279279
xlabel="Generation",
280-
ylabel="Conflicts",
281-
save_filename=None):
280+
ylabel="Conflicts"):
282281

283282
hist = summarize_history(history) if summarize else history
284283

@@ -307,13 +306,6 @@ def animate(i):
307306
ax1 = fig.add_subplot(1, 1, 1)
308307

309308

310-
anim = FuncAnimation(fig, animate, frames=range(len(hist)), interval=200, repeat=True)
311-
312-
if save_filename:
313-
try:
314-
anim.save(save_filename, writer='imagemagick')
315-
except:
316-
print('Not able to save the GIF file.')
317-
309+
anim = FuncAnimation(fig, animate, frames=range(len(hist)), interval=200, repeat=True)
318310
clear_output()
319311
return anim

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /