coursework/lab-taxi/agent.py
def select_action(self, state, i_episode, num_episodes):
        """ Given the state, select an action.

        Params
        ======
        - state: the current state of the environment

        Returns
        =======
        - action: an integer, compatible with the task's action space
        """
        if i_episode != self.episode and i_episode % (num_episodes * 0.0005) == 0:
            self.epsilon -= 50/num_episodes
            
        if i_episode != self.episode and i_episode % (num_episodes * 0.005) == 0:
            self.alpha -= 20/num_episodes
            self.epsilon = 0.8
        
        if i_episode != self.episode and i_episode % (num_episodes * 0.05) == 0:
            self.gamma -= 20/num_episodes
            self.epsilon = 0.8
            self.alpha = 0.8

        return np.argmax(self.Q[state])
 Given the state, select an action.

        Params
        ======
        - state: the current state of the environment

        Returns
        =======
        - action: an integer, compatible with the task's action space
        
Given the state, select an action.
Params

the current state of the environment

Returns

an integer, compatible with the task's action space
Given the state select an action . Params the current state of the environment Returns an integer compatible with the task ' s action space
def select_action(self, state, i_episode, num_episodes):
        if i_episode != self.episode and i_episode % (num_episodes * 0.0005) == 0:
            self.epsilon -= 50/num_episodes
        if i_episode != self.episode and i_episode % (num_episodes * 0.005) == 0:
            self.alpha -= 20/num_episodes
            self.epsilon = 0.8
        if i_episode != self.episode and i_episode % (num_episodes * 0.05) == 0:
            self.gamma -= 20/num_episodes
            self.epsilon = 0.8
            self.alpha = 0.8
        return np.argmax(self.Q[state])
def select_action ( self , state , i_episode , num_episodes ) : if i_episode != self . episode and i_episode % ( num_episodes * 0.0005 ) == 0 : self . epsilon -= 50 / num_episodes if i_episode != self . episode and i_episode % ( num_episodes * 0.005 ) == 0 : self . alpha -= 20 / num_episodes self . epsilon = 0.8 if i_episode != self . episode and i_episode % ( num_episodes * 0.05 ) == 0 : self . gamma -= 20 / num_episodes self . epsilon = 0.8 self . alpha = 0.8 return np . argmax ( self . Q [ state ] )
Given the state, select an action.
Given the state select an action .
""" Given the state, select an action.

        Params
        ======
        - state: the current state of the environment

        Returns
        =======
        - action: an integer, compatible with the task's action space
        """
self
state
i_episode
num_episodes