diff --git a/chesspp/__init__.py b/chesspp/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/classic_mcts.py b/chesspp/classic_mcts.py similarity index 100% rename from classic_mcts.py rename to chesspp/classic_mcts.py diff --git a/engine.py b/chesspp/engine.py similarity index 100% rename from engine.py rename to chesspp/engine.py diff --git a/eval.py b/chesspp/eval.py similarity index 100% rename from eval.py rename to chesspp/eval.py diff --git a/i_mcts.py b/chesspp/i_mcts.py similarity index 100% rename from i_mcts.py rename to chesspp/i_mcts.py diff --git a/i_strategy.py b/chesspp/i_strategy.py similarity index 100% rename from i_strategy.py rename to chesspp/i_strategy.py diff --git a/lichess-engine.py b/chesspp/lichess-engine.py similarity index 100% rename from lichess-engine.py rename to chesspp/lichess-engine.py diff --git a/simulation.py b/chesspp/simulation.py similarity index 100% rename from simulation.py rename to chesspp/simulation.py diff --git a/util.py b/chesspp/util.py similarity index 100% rename from util.py rename to chesspp/util.py diff --git a/main.py b/main.py index 842a45d..2b85e3b 100644 --- a/main.py +++ b/main.py @@ -1,11 +1,11 @@ import chess import chess.engine import chess.pgn -from classic_mcts import ClassicMcts -import engine -import eval -import util -import simulation +from chesspp.classic_mcts import ClassicMcts +from chesspp import engine +from chesspp import eval +from chesspp import util +from chesspp import simulation def test_simulate(): @@ -64,11 +64,11 @@ def analyze_results(moves: dict): def test_evaluation(): a = engine.ClassicMctsEngine b = engine.RandomEngine - evaluator = simulation.Evaluation(a,b) + evaluator = simulation.Evaluation(a, b) results = evaluator.run(4) - a_results = len(list(filter(lambda x: x.winner == simulation.Winner.Engine_A, results)))/len(results)*100 - b_results = len(list(filter(lambda x: x.winner == simulation.Winner.Engine_B, results)))/len(results)*100 - draws = len(list(filter(lambda x: x.winner == simulation.Winner.Draw, results)))/len(results)*100 + a_results = len(list(filter(lambda x: x.winner == simulation.Winner.Engine_A, results))) / len(results) * 100 + b_results = len(list(filter(lambda x: x.winner == simulation.Winner.Engine_B, results))) / len(results) * 100 + draws = len(list(filter(lambda x: x.winner == simulation.Winner.Draw, results))) / len(results) * 100 print(f"Engine {a.get_name()} won {a_results}% of games") print(f"Engine {b.get_name()} won {b_results}% of games")