def plot_anim(self, movesets, **kwargs):
pass
# DOESNT WORK SINE THE LENGTH OF A MOVESET IS VARIABLE
# setup = self.plot_moveset(movesets[0], show=False, export=True, export_plots=True, plot=True)
# fig = setup['fig']
# ax = setup['ax']
# plots = setup['plots']
#
# def update(i):
# label = 'Generation {}'.format(i)
# path, bumps = self.plot_moveset(movesets[i], export_data=True)
# path_xs, path_ys = Labyrinth._transform_array_into_xy(path)
# bumps_xs, bumps_ys = Labyrinth._transform_array_into_xy(bumps)
# # plots[0].set_offsets(bumps_xs, bumps_ys)
# # plots[1].set_offsets(path[0])
# # plots[2].set_offsets((path_xs[-1], path_ys[-1]))
# for i, j in enumerate(range(len(path)-2, -1, -1), 3):
# plots[i].set_positions([path_xs[i], path_ys[i]], [path_xs[i + 1], path_ys[i + 1]])
# # plots[len(plots)-1]
# return plots
#
# mywriter = animation.FFMpegWriter()
# ani = animation.FuncAnimation(fig, update, frames=np.arange(0, len(movesets)), interval=200)
# ani.save('asd.mp4', writer=mywriter)
评论列表
文章目录