(q_values, state, epsilon=0.1)
Choose an action based on a epsilon greedy policy.    
    A random action is selected with epsilon probability, else select the best action.
Choose an action based on a epsilon greedy policy.    
    A random action is selected with epsilon probability, else select the best action.
Choose an action based on a epsilon greedy policy . A random action is selected with epsilon probability else select the best action .
def egreedy_policy(q_values, state, epsilon=0.1):
    ''' 
    Choose an action based on a epsilon greedy policy.    
    A random action is selected with epsilon probability, else select the best action.    
    '''
    if np.random.random() < epsilon:
        return np.random.choice(4)
    else:
        return np.argmax(q_values[state])
def egreedy_policy ( q_values , state , epsilon = 0.1 ) : if np . random . random ( ) < epsilon : return np . random . choice ( 4 ) else : return np . argmax ( q_values [ state ] )