Skip to content
Snippets Groups Projects
Commit ed2750eb authored by tuhe's avatar tuhe
Browse files

Not so secret agents for some of the in-class demos

parent 023c1e5c
Branches
No related tags found
No related merge requests found
......@@ -63,6 +63,10 @@ class PolicyEvaluationAgent2(TabularAgent):
self.policy[s][a] = 1/len(mdp.A(s))
super().__init__(env, gamma)
def reset(self):
self.v = defaultdict(lambda: 0)
def pi(self, s,k, info=None):
# TODO: 1 lines missing.
......@@ -162,6 +166,11 @@ class ValueIterationAgent3(TabularAgent):
self.policy[s][a] = 1/len(mdp.A(s))
super().__init__(env, gamma, epsilon=epsilon)
def reset(self):
self.v = defaultdict(lambda: 0)
self.Q.q_.clear()
def pi(self, s,k, info=None):
from irlc import Agent
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment