Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
masus04 committed Aug 9, 2018
2 parents d139ad0 + 1c5b7b7 commit 70bef23
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions Othello/players/search_based_ai.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,6 @@ def move_search(self, starting_node, search_depth, current_player, other_player)
depth = 0
score = -sys.maxsize
move = None
time_start = datetime.datetime.now()
WIN = sys.maxsize - 1000
self.queue = PriorityQueue(len(possible_moves))
self.first = True
while depth <= search_depth and starting_node.get_empty_spaces() >= depth:
Expand All @@ -30,9 +28,6 @@ def move_search(self, starting_node, search_depth, current_player, other_player)
move = new_move
score = new_score
# print "Got to Depth:", depth
else:
# print "Cutoff at depth", depth
pass
return move

def alpha_beta_wrapper(self, node, depth, current_player, other_player):
Expand Down Expand Up @@ -113,9 +108,6 @@ def alpha_beta_search(self, node, depth, current_player, other_player, alpha=-sy
return beta

def alpha_beta_search_trans(self, node, depth, current_player, other_player, alpha=-sys.maxsize-1, beta=sys.maxsize, maximizing=True):
if datetime.datetime.now() > self.time_done - datetime.timedelta(milliseconds=10):
self.cutoff = True
return None
if depth == 0 or node.game_won() is not None:
return self.heuristic(node, self.player, self.other_player)
children = node.child_nodes(current_player)
Expand Down

0 comments on commit 70bef23

Please sign in to comment.