def test_stacked_with_simple_and_smm_obs_wrapper_on_reset(self): # Arrange env = SMMFrameProcessWrapper( SimpleAndSMMObsWrapper(FootballEnv(config=Config()))) # Act obs = env.reset() # Assert self.assertEqual(1, np.max(obs[0])) self.assertEqual(0, np.min(obs[0])) self.assertEqual((72, 96, 4), obs[0].shape) self.assertEqual((115, ), obs[1].shape)
def test_stacked_with_simple_and_smm_obs_wrapper_on_step(self): # Arrange env = SMMFrameProcessWrapper( SimpleAndSMMObsWrapper(FootballEnv(config=Config()))) obs = env.reset() # Act first_call, _, _, _ = env.step(0) second_call, _, _, _ = env.step(0) third_call, _, _, _ = env.step(0) fourth_call, _, _, _ = env.step(0) # Assert self.assertEqual(1, np.max(first_call[0])) self.assertEqual(-1, np.min(first_call[0])) self.assertEqual(1, np.max(second_call[0])) self.assertEqual(-1, np.min(second_call[0])) self.assertEqual((72, 96, 4), obs[0].shape) self.assertEqual((115, ), obs[1].shape)
def setUp(self): self._kaggle_env = gym.make("GFootball-kaggle_11_vs_11-v0") self._gfootball_env = self._env = FootballEnv(config=Config()) self._sut = RawObs()
def setUp(self): self._env = FootballEnv(config=Config()) self._sut = SimpleAndSMMObsWrapper
def setUp(self) -> None: self._env = FootballEnv(config=Config()) self._sut = SimpleAndRawObsWrapper