aboutsummaryrefslogtreecommitdiff
path: root/tests/test_monteCarlo.py
blob: b217cf9a3e73d2133d7a655cc6dc5b012b934071 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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()