diff options
-rw-r--r-- | python/GameState.py | 2 | ||||
-rw-r--r-- | python/agent_AB.py | 2 | ||||
-rw-r--r-- | python/alphaBeta.py | 3 |
3 files changed, 4 insertions, 3 deletions
diff --git a/python/GameState.py b/python/GameState.py index 6047f8d..9e780a9 100644 --- a/python/GameState.py +++ b/python/GameState.py @@ -81,7 +81,7 @@ class DotsAndBoxesState(GameState): def play_move(self, move): r, c, o = move - assert move in self.get_moves() + #assert move in self.get_moves() # check if this move makes a box makes_box = False diff --git a/python/agent_AB.py b/python/agent_AB.py index 2357d45..4107156 100644 --- a/python/agent_AB.py +++ b/python/agent_AB.py @@ -27,7 +27,7 @@ class Agent(dba.DotsAndBoxesAgent): self.game_state.play_move(move) def next_action(self): - r, c, o = self.controller.miniMax(self.game_state, 4) + r, c, o = self.controller.miniMax(self.game_state, 3) return r, c, o def end_game(self): diff --git a/python/alphaBeta.py b/python/alphaBeta.py index 5d7b932..aab2a2a 100644 --- a/python/alphaBeta.py +++ b/python/alphaBeta.py @@ -26,7 +26,8 @@ class ABNode(object): # A class for Node related operations self.CurrentScore = self.Current.score[2]-self.Current.score[1] def Make(self, r,c,o): # Function for generating a child node - self.children[(r,c,o)] = ABNode(self.Current.get_cur) + lit=deepcopy(self.Current) + self.children[(r,c,o)] = ABNode(lit) move=(r,c,o) self.children[(r,c,o)].Current.play_move(move) self.children[(r,c,o)].update_score() |