From c5dccf6c11edd7f1bee46cf1a47affc6a0793f61 Mon Sep 17 00:00:00 2001 From: luk3k Date: Sat, 27 Jan 2024 17:31:42 +0100 Subject: [PATCH] Changes by dreistein --- i_mcts.py | 16 ++++++++++++++++ main.py | 1 + 2 files changed, 17 insertions(+) diff --git a/i_mcts.py b/i_mcts.py index 817b29f..99d1dcb 100644 --- a/i_mcts.py +++ b/i_mcts.py @@ -1,6 +1,7 @@ import chess from abc import ABC, abstractmethod from i_strategy import IStrategy +from typing import Dict class IMcts(ABC): @@ -33,3 +34,18 @@ class IMcts(ABC): :return: list of immediate children of mcts root """ pass + + @abstractmethod + def get_moves(self) -> Dict[chess.Move, int]: + """ + Return all legal moves from this node with respective scores + :return: dictionary with moves as key and scores as values + """ + pass + +""" +TODO: add score class: +how many moves until the end of the game? +score ranges? +perspective of white/black +""" \ No newline at end of file diff --git a/main.py b/main.py index 71e8941..05b5635 100644 --- a/main.py +++ b/main.py @@ -1,5 +1,6 @@ import chess import chess.engine +import chess.pgn from classic_mcts import ClassicMcts import engine import eval