Commit 3eecdb80 authored by anon's avatar anon
Browse files

Use getQValue istead of accessing it directly

Important for later assignments
parent 7d31ca54
......@@ -127,7 +127,7 @@ class QLearningAgent(ReinforcementAgent):
"""
"*** YOUR CODE HERE ***"
sample = self.alpha * (reward + self.discount * self.computeValueFromQValues(nextState))
self.qValues[(state, action)] = (1- self.alpha) * self.qValues[(state, action)] + sample
self.qValues[(state, action)] = (1- self.alpha) * self.getQValue(state, action) + sample
def getPolicy(self, state):
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment