#NEWLINE# def test_phi_cells( ) : #NEWLINE# #INDENT# ' Ensure correct features are activated for corresponding state ' #NEWLINE# mapDir = os . path . join ( __rlpy_location__ , 'Domains' , 'GridWorldMaps' ) #NEWLINE# mapname = os . path . join ( mapDir , '4x5.txt' ) #NEWLINE# domain = GridWorld ( mapname = mapname ) #NEWLINE# rep = IndependentDiscretization ( domain ) #NEWLINE# for r in np . arange ( 4 ) : #NEWLINE# #INDENT# for c in np . arange ( 5 ) : #NEWLINE# #INDENT# phiVec = rep . phi ( np . array ( [ r , c ] ) , terminal = False ) #NEWLINE# assert ( sum ( phiVec ) == 2 ) #NEWLINE# assert ( phiVec [ r ] == 1 ) #NEWLINE# assert ( phiVec [ ( 4 + c ) ] == 1 )