aboutsummaryrefslogtreecommitdiff
path: root/tests/test_monteCarlo.py
diff options
context:
space:
mode:
authorInigoGutierrez <inigogf.95@gmail.com>2022-07-01 16:10:15 +0200
committerInigoGutierrez <inigogf.95@gmail.com>2022-07-01 16:10:15 +0200
commitb08408d23186205e71dfc68634021e3236bfb45c (patch)
tree55e5679b6964902dadab1d5737546cfd4f0f2f0a /tests/test_monteCarlo.py
parentddde2a9a43daf870c26bef33f47abe45b414c3d0 (diff)
downloadimago-b08408d23186205e71dfc68634021e3236bfb45c.tar.gz
imago-b08408d23186205e71dfc68634021e3236bfb45c.zip
First version.
Diffstat (limited to 'tests/test_monteCarlo.py')
-rw-r--r--tests/test_monteCarlo.py30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/test_monteCarlo.py b/tests/test_monteCarlo.py
new file mode 100644
index 0000000..b217cf9
--- /dev/null
+++ b/tests/test_monteCarlo.py
@@ -0,0 +1,30 @@
+"""Tests for the MonteCarlo algorithm."""
+
+import unittest
+
+from imago.gameLogic.gameState import GameState
+from imago.engine.monteCarlo import MCTS
+from imago.engine.monteCarlo import MCTSNode
+
+TEST_BOARD_SIZE = 9
+
+class TestMonteCarlo(unittest.TestCase):
+ """Test MonteCarlo algorithm."""
+
+ def testPickMove(self):
+ """Test picking a move."""
+ state = GameState(TEST_BOARD_SIZE)
+ tree = MCTS(state.lastMove)
+ #print(tree.pickMove().toString())
+
+ #def testSimulation(self):
+ # """Test calculation of group liberties."""
+ # board = GameBoard(TEST_BOARD_SIZE, TEST_BOARD_SIZE)
+ # move = GameMove(board)
+ # node = MCTSNode(move, None)
+ # nMatches = 100
+ # scoreDiffHeur = 15
+ # node.simulation(nMatches, scoreDiffHeur)
+
+if __name__ == '__main__':
+ unittest.main()