#NEWLINE# def __init__( self , mapname = os . path . join ( default_map_dir , '4x5.txt' ) , noise = 0.1 , episodeCap = None ) : #NEWLINE# #INDENT# self . map = np . loadtxt ( mapname , dtype = np . uint8 ) #NEWLINE# if ( self . map . ndim == 1 ) : #NEWLINE# #INDENT# self . map = self . map [ np . newaxis , : ] #NEWLINE# #UNINDENT# self . start_state = np . argwhere ( ( self . map == self . START ) ) [ 0 ] #NEWLINE# ( self . ROWS , self . COLS ) = np . shape ( self . map ) #NEWLINE# self . statespace_limits = np . array ( [ [ 0 , ( self . ROWS - 1 ) ] , [ 0 , ( self . COLS - 1 ) ] ] ) #NEWLINE# self . NOISE = noise #NEWLINE# self . DimNames = [ 'Row' , 'Col' ] #NEWLINE# if ( not self . episodeCap ) : #NEWLINE# #INDENT# self . episodeCap = 1000 #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . episodeCap = episodeCap #NEWLINE# #UNINDENT# super ( GridWorld , self ) . __init__ ( )