예제 #1
0
 def test_pickleable(self):
     inner_env = PointEnv(goal=(1, 2))
     env = OcclusionEnv(inner_env, [1])
     round_trip = pickle.loads(pickle.dumps(env))
     assert round_trip
     obs = inner_env.reset()
     assert round_trip.occlude(obs) == env.occlude(obs)
     assert np.array_equal(round_trip.env._goal, env.env._goal)
     step_env(round_trip)
     round_trip.close()
     env.close()
예제 #2
0
 def test_does_not_modify_action(self):
     inner_env = PointEnv(goal=(1., 2.))
     env = NoisyObservationEnv(inner_env, obs_noise=5.)
     a = env.action_space.high + 1.
     a_copy = a.copy()
     env.step(a)
     assert np.array_equal(a, a_copy)
     env.close()
예제 #3
0
 def test_does_not_modify_action(self):
     inner_env = PointEnv(goal=(2, 3))
     env = OcclusionEnv(inner_env, [1])
     a = env.action_space.high + 1.
     a_copy = a
     env.reset()
     env.step(a)
     assert np.array_equal(a, a_copy)
     env.close()
예제 #4
0
 def test_does_not_modify_action(self):
     inner_env = PointEnv(goal=(1., 2.))
     env = SlidingMemEnv(inner_env, n_steps=10)
     a = env.action_space.high + 1.
     a_copy = a.copy()
     env.reset()
     env.step(a)
     assert np.array_equal(a, a_copy)
     env.close()
예제 #5
0
 def test_pickleable(self):
     inner_env = PointEnv(goal=(1., 2.))
     env = NoisyObservationEnv(inner_env, obs_noise=5.)
     round_trip = pickle.loads(pickle.dumps(env))
     assert round_trip
     assert round_trip.obs_noise == env.obs_noise
     assert np.array_equal(round_trip.env._goal, env.env._goal)
     step_env(round_trip)
     round_trip.close()
     env.close()
예제 #6
0
 def test_does_not_modify_action(self):
     inner_env = PointEnv(goal=(1., 2.))
     env = DelayedActionEnv(inner_env, action_delay=10)
     env.reset()
     a = env.action_space.high + 1.
     a_copy = a.copy()
     env.reset()
     env.step(a)
     assert np.array_equal(a, a_copy)
     env.close()
예제 #7
0
 def test_pickleable(self):
     inner_env = PointEnv(goal=(1., 2.))
     env = DelayedActionEnv(inner_env, action_delay=10)
     round_trip = pickle.loads(pickle.dumps(env))
     assert round_trip
     assert round_trip.action_delay == env.action_delay
     assert np.array_equal(round_trip.env._goal, env.env._goal)
     step_env(round_trip)
     round_trip.close()
     env.close()
예제 #8
0
 def test_pickleable(self):
     inner_env = PointEnv(goal=(1., 2.))
     env = SlidingMemEnv(inner_env, n_steps=10)
     round_trip = pickle.loads(pickle.dumps(env))
     assert round_trip
     assert round_trip.n_steps == env.n_steps
     assert np.array_equal(round_trip.env._goal, env.env._goal)
     step_env(round_trip)
     round_trip.close()
     env.close()