コード例 #1
0
ファイル: game_test.py プロジェクト: hyu2000/tictactoe
    def test_anti_minmax(self):
        # MinMax would also pass, but way slower
        game = GamePlay(MinMaxWithQTable(), AntiMinMaxStrat())
        verdict = game.run(verbose=True)
        self.assertEqual(verdict, GameResult.DRAW)

        pctg = game.run_tournament(100)
        self.assertAlmostEqual(pctg[2], 1.0)
コード例 #2
0
ファイル: game_test.py プロジェクト: hyu2000/tictactoe
    def test_weakened_vs_minmax(self):
        game = GamePlay(MinMaxWithQTable(),
                        WeakenedMinMax('/tmp/minmax.qtable'))
        verdict = game.run(verbose=True)
        self.assertEqual(verdict, GameResult.DRAW)

        pctg = game.run_tournament(100)
        self.assertAlmostEqual(pctg[2], 1.0)
コード例 #3
0
ファイル: game_test.py プロジェクト: hyu2000/tictactoe
 def test_RL(self):
     rl_strat = load_rl_strat()
     strat2 = WeakenedMinMax('/tmp/minmax.qtable')
     game = GamePlay(rl_strat, strat2)
     pctg = game.run_tournament(1000)
     print pctg
コード例 #4
0
    def play_game(self):
        print("Game play : todo")

        game_play = GamePlay(self.gameDisplay, self.clock)
        game_play.start()