Skip to content
Snippets Groups Projects
Commit 10e4b5c8 authored by Wen Yao Jin's avatar Wen Yao Jin
Browse files

go

parent 31a4f82d
Branches master
No related tags found
No related merge requests found
...@@ -11,7 +11,7 @@ class Action(IntEnum): ...@@ -11,7 +11,7 @@ class Action(IntEnum):
RIGHT = 4 RIGHT = 4
class afterstateAgent: class afterstateAgent:
def __init__(self, mat, TD_lambda = 0.0, alpha = 0.0025, gamma = 0.95, epsilon = 0.01, verbose= True, symmetric=True, tuple = 2): def __init__(self, mat, TD_lambda = 0.0, alpha = 0.0025, gamma = 0.95, epsilon = 0.01, verbose= True, symmetric=1, tuple = 2):
self.state_per_tile = 12 self.state_per_tile = 12
self.commands = { Action.UP: up, Action.DOWN: down, Action.LEFT: left, Action.RIGHT: right} self.commands = { Action.UP: up, Action.DOWN: down, Action.LEFT: left, Action.RIGHT: right}
self.alpha = alpha self.alpha = alpha
...@@ -197,7 +197,7 @@ class afterstateAgent: ...@@ -197,7 +197,7 @@ class afterstateAgent:
return return
s,r = self.test_next(self._action_index,self.state) s,r = self.test_next(self._action_index,self.state)
n = next_state n = next_state
if self.symmetric is True: if self.symmetric>0:
for i in range(4): for i in range(4):
s = transpose(s) s = transpose(s)
self.set_state(s) self.set_state(s)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment