From 216e2e9a1a5ada9d224afaff1441defd0fb455f5 Mon Sep 17 00:00:00 2001 From: Jack Vehmeier Date: Wed, 28 Apr 2021 15:51:33 -0500 Subject: fixed --- python/GameState.py | 2 +- python/agent_AB.py | 2 +- python/alphaBeta.py | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'python') 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() -- cgit v1.2.3