コード例 #1
0
ファイル: test_mcts.py プロジェクト: noke8868/mittmcts
 def test_game_with_one_move(self):
     result = MCTS(GameWithOneMove).get_simulation_result(100)
     self.assertEqual(result.move, 'win')
     self.assertEqual(result.root.children[0].wins_by_player[1], 100)
     self.assertEqual(result.max_depth, 1)
コード例 #2
0
def main():
    state = EuchreGame.initial_state(['ad', '0d', 'kd', '0s', '9s'], trump='d')
    result = (MCTS(EuchreGame, state)
              .get_simulation_result(1000, get_leaf_nodes=True))
    flamegraph(result)
コード例 #3
0
ファイル: test_mcts.py プロジェクト: noke8868/mittmcts
 def test_only_determined_moves_are_followed(self):
     result = (MCTS(
         GameWithManyMovesOnlyOneDetermined).get_simulation_result(100))
     self.assertEqual(result.root.children[0].move, 1)
     self.assertEqual(result.root.children[0].visits, 100)