def visualize(self, agent):
        self.row_history.append(self.row_position)
        self.column_history.append(self.column_position)
        if self.animate:
            print ''.join([str(self.row_position), ', ', 
                           str(self.column_position), 
                           '-row and col position  ', 
                           str(self.reward), '-reward'])
        # Periodically display the history and inputs as perceived by BECCA
        if (self.timestep % self.VISUALIZE_PERIOD) != 0:
            return

        print ' '.join(["world is", str(self.timestep), "timesteps old."])
        fig = plt.figure(11)
        plt.clf()
        plt.plot( self.row_history, 'k.')    
        plt.title("Row history")
        plt.xlabel('time step')
        plt.ylabel('position (pixels)')
        fig.show()
        fig.canvas.draw()

        fig = plt.figure(12)
        plt.clf()
        plt.plot( self.column_history, 'k.')    
        plt.title("Column history")
        plt.xlabel('time step')
        plt.ylabel('position (pixels)')
        fig.show()
        fig.canvas.draw()

        fig = plt.figure(13)
        sensed_image = np.reshape(0.5 * (
                self.sensors[:len(self.sensors)/2] - 
                self.sensors[len(self.sensors)/2:] + 1), 
                (self.fov_span, self.fov_span))
        plt.gray()
        plt.imshow(sensed_image, interpolation='nearest')
        plt.title("Image sensed")
        fig.show()
        fig.canvas.draw()

        # Periodcally show the entire feature set 
        if self.print_feature_set:
            (feature_set, feature_activities) = agent.get_index_projections()
            wtools.print_pixel_array_features(feature_set, self.num_sensors,
                                              self.num_actions,
                                              self.fov_span, self.fov_span,
                                              directory='log', 
                                              world_name=self.name)
Show what is going on in BECCA and in the world
dataset/ETHPy150Open matt2000/becca/worlds/image_2D.py/World.visualize