#NEWLINE# def learn( self , s , p_actions , a , r , ns , np_actions , na , terminal ) : #NEWLINE# #INDENT# 'Iterative learning method for the agent.\n\n        Args:\n            s (ndarray):    The current state features\n            p_actions (ndarray):    The actions available in state s\n            a (int):    The action taken by the agent in state s\n            r (float):  The reward received by the agent for taking action a in state s\n            ns (ndarray):   The next state features\n            np_actions (ndarray): The actions available in state ns\n            na (int):   The action taken by the agent in state ns\n            terminal (bool): Whether or not ns is a terminal state\n        ' #NEWLINE# self . LSPI . process ( s , a , r , ns , na , terminal ) #NEWLINE# if ( ( self . LSPI . samples_count + ( 1 % self . LSPI . steps_between_LSPI ) ) == 0 ) : #NEWLINE# #INDENT# self . LSPI . representationExpansionLSPI ( ) #NEWLINE# if terminal : #NEWLINE# #INDENT# self . episodeTerminated ( ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# super ( LSPI_SARSA , self ) . learn ( s , p_actions , a , r , ns , np_actions , na , terminal )