Skip to content

Commit

Permalink
Merge pull request kobanium#76 from kobanium/fix#71
Browse files Browse the repository at this point in the history
  • Loading branch information
kobanium authored Jul 30, 2023
2 parents 7496a47 + b6589be commit 0073a77
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
6 changes: 4 additions & 2 deletions mcts/time_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,14 @@ def get_num_visits_threshold(self, color: Stone) -> int:
return int(self.constant_visits)
if self.mode == TimeControl.CONSTANT_TIME:
self.time_limit = self.constant_time
return int(self.search_speed * self.constant_time)
threshold = int(self.search_speed * self.constant_time)
return threshold if threshold > 0 else 1
if self.mode == TimeControl.TIME_CONTROL:
remaining_time = self.remaining_time[0] \
if color is Stone.BLACK else self.remaining_time[1]
self.time_limit = remaining_time / 10.0
return int(self.search_speed * self.time_limit)
threshold = int(self.search_speed * self.time_limit)
return threshold if threshold > 0 else 1
return int(self.constant_visits)


Expand Down
1 change: 1 addition & 0 deletions mcts/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def search(self, board: GoBoard, color: Stone, time_manager: TimeManager, \
break

if len(analysis_query) > 0 and interval == 0:
root = self.node[self.current_root]
mode = analysis_query.get("mode", "lz")
sys.stdout.write(root.get_analysis(board, mode, self.get_pv_lists))
sys.stdout.flush()
Expand Down

0 comments on commit 0073a77

Please sign in to comment.