qlearningAgents.py
def computeValueFromQValues(self, state):
        """
          Returns max_action Q(state,action)
          where the max is over legal actions.  Note that if
          there are no legal actions, which is the case at the
          terminal state, you should return a value of 0.0.
        """
        if len(self.getLegalActions(state)) == 0: # check for terminal state
            return 0.0
        tempVals = util.Counter()
        for action in self.getLegalActions(state):  # calculate q-values for every possible action
            tempVals[(action)] = self.getQValue(state,action)
        return tempVals[tempVals.argMax()]
        # max_a_Q(s_t+1,a)

          Returns max_action Q(state,action)
          where the max is over legal actions.  Note that if
          there are no legal actions, which is the case at the
          terminal state, you should return a value of 0.0.
        
Returns max_action Q(state,action)
where the max is over legal actions.  Note that if
there are no legal actions, which is the case at the
terminal state, you should return a value of 0.0.
Returns max_action Q ( state action ) where the max is over legal actions . Note that if there are no legal actions which is the case at the terminal state you should return a value of 0 . 0 .
def computeValueFromQValues(self, state):
        if len(self.getLegalActions(state)) == 0: 
            return 0.0
        tempVals = util.Counter()
        for action in self.getLegalActions(state):  
            tempVals[(action)] = self.getQValue(state,action)
        return tempVals[tempVals.argMax()]
def computeValueFromQValues ( self , state ) : if len ( self . getLegalActions ( state ) ) == 0 : return 0.0 tempVals = util . Counter ( ) for action in self . getLegalActions ( state ) : tempVals [ ( action ) ] = self . getQValue ( state , action ) return tempVals [ tempVals . argMax ( ) ]
Returns max_action Q(state,action)
where the max is over legal actions.
Returns max_action Q ( state action ) where the max is over legal actions .
"""
          Returns max_action Q(state,action)
          where the max is over legal actions.  Note that if
          there are no legal actions, which is the case at the
          terminal state, you should return a value of 0.0.
        """ # check for terminal state # calculate q-values for every possible action # max_a_Q(s_t+1,a)
self
state