def __init__(self,to_plot = True):
self.state = np.array([0,0])
self.observation_shape = np.shape(self.get_state())[0]
if to_plot:
plt.ion()
fig = plt.figure()
ax1 = fig.add_subplot(111,aspect='equal')
#ax1.axis('off')
plt.xlim([-0.5,5.5])
plt.ylim([-0.5,5.5])
self.g1 = ax1.add_artist(plt.Circle((self.state[0],self.state[1]),0.1,color='red'))
self.fig = fig
self.ax1 = ax1
self.fig.canvas.draw()
self.fig.canvas.flush_events()
评论列表
文章目录