#NEWLINE# def process( self , action ) : #NEWLINE# #INDENT# real_action = self . real_actions [ action ] #NEWLINE# self . reward = self . ale . act ( real_action ) #NEWLINE# self . terminal = self . ale . game_over ( ) #NEWLINE# self . ale . getScreenGrayscale ( self . screen ) #NEWLINE# reshaped_screen = np . reshape ( self . screen , ( 210 , 160 ) ) #NEWLINE# resized_screen = cv2 . resize ( reshaped_screen , ( 84 , 110 ) ) #NEWLINE# x_t1 = resized_screen [ 18 : 102 , : ] #NEWLINE# x_t1 = np . reshape ( x_t1 , ( 84 , 84 , 1 ) ) #NEWLINE# x_t1 = x_t1 . astype ( np . float32 ) #NEWLINE# x_t1 *= ( 1.0 / 255.0 ) #NEWLINE# self . s_t1 = np . append ( x_t1 , self . s_t [ : , : , 0 : 3 ] , axis = 2 ) #NEWLINE# if self . terminal : #NEWLINE# #INDENT# self . ale . reset_game ( )