Пример #1
0
 def testStartWithCommunicator(self):
     env = RTRLBaseEnv({'generic': {'Communicator': MockCommunicator, 'kwargs': {}}}, 2, 3, run_mode='singlethread')
     env.start()
     time.sleep(0.5)
     self.assertTrue(env._running)
     self.assertTrue(env._all_comms['generic'].is_alive())
     env.close()
     self.assertFalse(env._running)
     self.assertFalse(env._all_comms['generic'].is_alive())
Пример #2
0
 def testStartMultiprocess(self):
     env = RTRLBaseEnv({}, 2, 3, run_mode='multiprocess')
     env.start()
     self.assertTrue(env._running)
     time.sleep(0.5)
     self.assertTrue(env._polling_loop.is_alive())
     env.close()
     self.assertFalse(env._running)
     self.assertFalse(env._polling_loop.is_alive())
Пример #3
0
 def testNotImplementedError(self):
     env = RTRLBaseEnv({}, 2, 3, run_mode='singlethread')
     env.start()
     with self.assertRaises(NotImplementedError):
         env.step(0)
     env.close()
Пример #4
0
 def testStartSingalthread(self):
     env = RTRLBaseEnv({}, 2, 3, run_mode='singlethread')
     env.start()
     self.assertTrue(env._running)
     env.close()
     self.assertFalse(env._running)