Skip to content

Commit

Permalink
Make random_mdp test deterministic by seeding the environment.
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestum committed Sep 5, 2023
1 parent 09c5f2f commit 4872ceb
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions tests/algorithms/test_mce_irl.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,8 @@ def test_infinite_horizon_error(random_mdp, rng):
def test_policy_om_random_mdp(discount: float):
"""Test that optimal policy occupancy measure ("om") for a random MDP is sane."""
mdp = gym.make("seals/Random-v0")
mdp.seed(0)

V, Q, pi = mce_partition_fh(mdp, discount=discount)
assert np.all(np.isfinite(V))
assert np.all(np.isfinite(Q))
Expand Down

0 comments on commit 4872ceb

Please sign in to comment.