Commit d7f82854 authored by anon's avatar anon
Browse files

Initialize the PriorityQueue

parent 84bf38cb
......@@ -205,5 +205,15 @@ class PrioritizedSweepingValueIterationAgent(AsynchronousValueIterationAgent):
except KeyError:
predecessors[nextState] = set()
# Initialize the priorityqueue
prQueue = util.PriorityQueue()
for state in states:
if mpd.isTerminal(state):
continue
actions = self.mdp.getPossibleActions(state)
qValues = []
for action in actions:
qValues.append(self.getQValue(state, action))
prQueue.update(state, -abs(values[state] - max(qValues)))
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