コンテンツにスキップ

MinimaxPlayer

MinimaxPlayer

MinimaxPlayer(username: str, max_plies: int = 1, max_nodes: int | None = None)

Bases: TreeSearchPlayer

自分の各合法手について、相手が最善(自分にとって最悪)の手を選ぶと 仮定したミニマックスで評価する木探索プレイヤー。

TreeSearchPlayer が提供する evaluate/fallback/estimate_opponent/ configure_sim の4フックはそのまま利用できる。詳細は TreeSearchPlayer のクラスdocstringを参照。

ソースコード位置: src/jpoke/players/tree_search_player.py
59
60
61
62
63
64
65
66
67
def __init__(self,
             username: str,
             max_plies: int = 1,
             max_nodes: int | None = None):
    super().__init__(username=username)
    self.max_plies: int = max_plies
    self.max_nodes: int | None = max_nodes
    self.nodes_expanded: int = 0
    self._searching: bool = False