Exemplo n.º 1
0
 def testCompete(self):
     import roomai.common
     env     = FiveCardStudEnv()
     players = [roomai.common.RandomPlayer() for i in range(5)] + [roomai.common.RandomPlayerChance()]
     scores  = FiveCardStudEnv.compete(env, players)
     print (scores)
     assert(abs(sum(scores)) < 1e-9 )
Exemplo n.º 2
0
    def testCompete(self):
        """

        """
        env = FiveCardStudEnv()
        players = [FiveCardStudRandomPlayer() for i in xrange(5)]
        scores = FiveCardStudEnv.compete(env, players)
        print scores
        assert (abs(sum(scores)) < 1e-9)
Exemplo n.º 3
0
            infos, public_state, _, _ = env.init({
                "num_players": num_players,
                "chips": chips
            })
            for i in xrange(len(players)):
                players[i].receive_info(infos[i])

            while public_state.is_terminal == False:
                turn = public_state.turn
                action = players[turn].take_action()

                infos, public_state, _, _ = env.forward(action)
                for i in xrange(len(players)):
                    players[i].receive_info(infos[i])

    def testCompete(self):
        """

        """
        env = FiveCardStudEnv()
        players = [FiveCardStudRandomPlayer() for i in xrange(5)]
        scores = FiveCardStudEnv.compete(env, players)
        print scores
        assert (abs(sum(scores)) < 1e-9)


if __name__ == "__main__":
    env = FiveCardStudEnv()
    players = [FiveCardStudRandomPlayer() for i in xrange(5)]
    scores = FiveCardStudEnv.compete(env, players)