added reuse of subtree for simulations (apply_move), played around with rollout depth

This commit is contained in:
2024-01-29 12:26:19 +01:00
parent a2cb3a5719
commit f1a36964df
7 changed files with 80 additions and 42 deletions

View File

@@ -0,0 +1,16 @@
import chess
from chesspp.i_strategy import IStrategy
import chess.engine
class StockFishStrategy(IStrategy):
stockfish: chess.engine.SimpleEngine
def __init__(self):
self.stockfish = chess.engine.SimpleEngine.popen_uci(
"/home/luke/projects/pp-project/chess-engine-pp/stockfish/stockfish-ubuntu-x86-64-avx2")
def pick_next_move(self, board: chess.Board) -> chess.Move | None:
move = self.stockfish.play(board, chess.engine.Limit(depth=4)).move
print("stockfish picked:", move)
return move