From e609931c2bf4c2f61489d67e1c110867bc0357b4 Mon Sep 17 00:00:00 2001 From: Erik Nygren <erik.nygren@sbb.ch> Date: Fri, 26 Apr 2019 09:54:35 +0200 Subject: [PATCH] updated reward function and the test accordingly --- tests/test_environments.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_environments.py b/tests/test_environments.py index 210f1c76..198104fc 100644 --- a/tests/test_environments.py +++ b/tests/test_environments.py @@ -140,8 +140,10 @@ def test_dead_end(): _ = rail_env.step({0: 1}) _ = rail_env.step({0: 3}) assert (rail_env.agents_position[0] == prev_pos) - - _, _, dones, _ = rail_env.step({0: 2}) + if rail_env.agents_position[0] != rail_env.agents_target[0]: + _, _, dones, _ = rail_env.step({0: 2}) + else: + _, _, dones, _ = rail_env.step({0: 0}) if i < 5: assert (not dones[0] and not dones['__all__']) -- GitLab