Example #1
0
    def delete_old_hash(self, gs: GameState, uct_nodes: List[UctNode]):
        """古いハッシュを削除"""
        # 現在の局面をルートとする局面以外を削除する
        root = self.find_same_hash_index(gs.board_hash(), gs.turn, gs.n_turns)

        self.used = 0
        for i in range(UCT_HASH_SIZE):
            self.node_hash[i].flag = False

        if root != UCT_HASH_SIZE:
            self.save_used_hash(gs, uct_nodes, root)

        self.enough_size = True