Ejemplo n.º 1
0
    def test_human_mode(self):
        env = Env()
        with self.assertRaises(ValueError):
            env.reset()

        env.set_mode(human_mode=True)
        with self.assertRaises(ValueError):
            env.set_agents([])

        with self.assertRaises(ValueError):
            env.run()

        state = env.reset()
        self.assertIsInstance(state, dict)
        for _ in range(100):
            state, _, _ = env.step(np.random.choice(state['legal_actions']))
Ejemplo n.º 2
0
    def test_set_mode(self):
        env = Env()
        with self.assertRaises(ValueError):
            env.set_mode()

        with self.assertRaises(ValueError):
            env.set_mode(active_player=100)

        with self.assertRaises(ValueError):
            env.set_mode(single_agent_mode=True, human_mode=True)