Skip to content
Snippets Groups Projects
Commit a133437b authored by spiglerg's avatar spiglerg
Browse files

fix?

parent 18a8c10e
No related branches found
No related tags found
No related merge requests found
......@@ -164,6 +164,8 @@ def test_dead_end():
def check_consistency(rail_env):
# We run step to check that trains do not move anymore
# after being done.
# TODO: GIACOMO: this is deprecated and should be updated; thenew behavior is that agents keep moving
# until they are manually stopped.
for i in range(7):
# prev_pos = rail_env.agents_position[0]
prev_pos = rail_env.agents[0].position
......@@ -172,13 +174,13 @@ def test_dead_end():
# it stays where it is.
_ = rail_env.step({0: 1})
_ = rail_env.step({0: 3})
assert (rail_env.agents[0].position == prev_pos)
# assert (rail_env.agents[0].position == prev_pos)
_, _, dones, _ = rail_env.step({0: 2})
if i < 5:
assert (not dones[0] and not dones['__all__'])
else:
assert (dones[0] and dones['__all__'])
# if i < 5:
# assert (not dones[0] and not dones['__all__'])
# else:
# assert (dones[0] and dones['__all__'])
# We try the configuration in the 4 directions:
rail_env.reset()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment