Fix errors from merging
This commit is contained in:
@@ -1,9 +1,7 @@
|
|||||||
import chess.engine
|
|
||||||
import chess
|
import chess
|
||||||
from functools import cache
|
import chess.engine
|
||||||
|
|
||||||
from chesspp.i_strategy import IStrategy
|
from chesspp.i_strategy import IStrategy
|
||||||
import numba
|
|
||||||
|
|
||||||
# Scoring based on PeSTO (Piece-Square Tables Only) Evaluation Functions
|
# Scoring based on PeSTO (Piece-Square Tables Only) Evaluation Functions
|
||||||
# https://www.chessprogramming.org/PeSTO%27s_Evaluation_Function
|
# https://www.chessprogramming.org/PeSTO%27s_Evaluation_Function
|
||||||
|
|||||||
13
main.py
13
main.py
@@ -1,19 +1,16 @@
|
|||||||
import argparse
|
import argparse
|
||||||
import os
|
import os
|
||||||
import random
|
import random
|
||||||
import sys
|
|
||||||
import time
|
import time
|
||||||
|
|
||||||
import chess
|
import chess
|
||||||
import chess.engine
|
import chess.engine
|
||||||
import chess.pgn
|
import chess.pgn
|
||||||
from chesspp.classic_mcts import ClassicMcts
|
|
||||||
from chesspp.baysian_mcts import BayesianMcts
|
|
||||||
from chesspp.engine_factory import EngineEnum, StrategyEnum
|
|
||||||
from chesspp.random_strategy import RandomStrategy
|
|
||||||
from chesspp.stockfish_strategy import StockFishStrategy
|
|
||||||
from chesspp import engine
|
from chesspp import engine
|
||||||
from chesspp import simulation, eval
|
from chesspp import simulation, eval
|
||||||
from chesspp import util
|
from chesspp import util
|
||||||
|
from chesspp.engine_factory import EngineEnum, StrategyEnum
|
||||||
from chesspp.mcts.baysian_mcts import BayesianMcts
|
from chesspp.mcts.baysian_mcts import BayesianMcts
|
||||||
from chesspp.mcts.classic_mcts import ClassicMcts
|
from chesspp.mcts.classic_mcts import ClassicMcts
|
||||||
from chesspp.random_strategy import RandomStrategy
|
from chesspp.random_strategy import RandomStrategy
|
||||||
@@ -108,8 +105,8 @@ def test_evaluation():
|
|||||||
reject_h0 = test_result['pvalue'] < alpha
|
reject_h0 = test_result['pvalue'] < alpha
|
||||||
|
|
||||||
print(f"{games_played} games played")
|
print(f"{games_played} games played")
|
||||||
print(f"Engine {a.get_name()} won {a_wins} games ({a_wins / games_played:.2%})")
|
print(f"Engine {a} won {a_wins} games ({a_wins / games_played:.2%})")
|
||||||
print(f"Engine {b.get_name()} won {b_wins} games ({b_wins / games_played:.2%})")
|
print(f"Engine {b} won {b_wins} games ({b_wins / games_played:.2%})")
|
||||||
print(f"{draws} games ({draws / games_played:.2%}) resulted in a draw")
|
print(f"{draws} games ({draws / games_played:.2%}) resulted in a draw")
|
||||||
print(f"Hypothesis test: trials={test_result['trials']}, pvalue={test_result['pvalue']:2.10f}, statistic={test_result['statistic']:2.4f}, reject_h0={reject_h0}")
|
print(f"Hypothesis test: trials={test_result['trials']}, pvalue={test_result['pvalue']:2.10f}, statistic={test_result['statistic']:2.4f}, reject_h0={reject_h0}")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user