Skip to content

Add old tests from imitation envs to seals #64

Description

@Rocamonde

Old tests:

def test_model_envs(env):
    """Smoke test for each of the ModelBasedEnv methods with type checks.
    Args:
        env: The environment to test.
    Raises:
        AssertionError if test fails.
    """
    state = env.initial_state()
    assert env.pomdp_state_space.contains(state)

    action = env.action_space.sample()
    new_state = env.transition(state, action)
    assert env.pomdp_state_space.contains(new_state)

    reward = env.reward(state, action, new_state)
    assert isinstance(reward, float)

    done = env.terminal(state, 0)
    assert isinstance(done, bool)

    obs = env.obs_from_state(state)
    assert env.pomdp_observation_space.contains(obs)
    next_obs = env.obs_from_state(new_state)
    assert env.pomdp_observation_space.contains(next_obs)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions