project3_RL/reinforcement/valueIterationAgents.py
def computeQValueFromValues(self, state, action):
        """
          Compute the Q-value of action in state from the
          value function stored in self.values.
        """
        "*** YOUR CODE HERE ***"
        Qvalue = 0
        for nextstate, prob in self.mdp.getTransitionStatesAndProbs(state, action):
            Qvalue+= prob*(self.mdp.getReward(state, action, nextstate)+self.discount*self.getValue(nextstate))
        return Qvalue

          Compute the Q-value of action in state from the
          value function stored in self.values.
        
Compute the Q-value of action in state from the
value function stored in self.values.
Compute the Q - value of action in state from the value function stored in self . values .
def computeQValueFromValues(self, state, action):
        Qvalue = 0
        for nextstate, prob in self.mdp.getTransitionStatesAndProbs(state, action):
            Qvalue+= prob*(self.mdp.getReward(state, action, nextstate)+self.discount*self.getValue(nextstate))
        return Qvalue
def computeQValueFromValues ( self , state , action ) : "*** YOUR CODE HERE ***" Qvalue = 0 for nextstate , prob in self . mdp . getTransitionStatesAndProbs ( state , action ) : Qvalue += prob * ( self . mdp . getReward ( state , action , nextstate ) + self . discount * self . getValue ( nextstate ) ) return Qvalue
Compute the Q-value of action in state from the
value function stored in self.values.
Compute the Q - value of action in state from the value function stored in self . values .
"""
          Compute the Q-value of action in state from the
          value function stored in self.values.
        """ "*** YOUR CODE HERE ***"
self
state
action