def contour_plot(self, sensors=[0.2,0.2,0.2,0.0], title="Contour Plot of Q(s,a)"):
#
# Show a contour plot of how Q varies over the geometry of our
# play area, while fixing sensor readings and car rotation.
#
x,y,z = self.location_contours(sensors)
plt.figure(facecolor='white')
plt.hot()
im = plt.imshow(z, interpolation='bilinear', origin='lower', cmap=cm.inferno)
CBI = plt.colorbar(im, orientation='horizontal', shrink=0.8)
plt.title(title+": theta="+str(int(sensors[3]*180.0/np.pi)))
plt.xlabel('x%')
plt.ylabel('y%')
plt.show()
评论列表
文章目录