예제 #1
0
def test_continuous_action_space_norm():
    env = NormalizedGymEnv('MountainCarContinuous-v0')
    env.reset()
    env.step([0.1])
    env.close()
    assert GymEnv.env_action_space_is_discrete(env) is False
    assert GymEnv.get_env_action_space_dim(env) == 1
예제 #2
0
def test_discrete_action_space_norm():
    env = NormalizedGymEnv('CartPole-v0')
    env.reset()
    env.step(1)
    env.close()
    assert GymEnv.env_action_space_is_discrete(env) is True
    assert GymEnv.get_env_action_space_dim(env) == 2
예제 #3
0
def test_norm_reward():
    env = NormalizedGymEnv('MountainCarContinuous-v0', normalize_rewards=True)
    env.reset()
    [env.step([0.01]) for _ in range(env.spec.timestep_limit + 1)]