Commit 0041ace3 authored by u229589's avatar u229589
Browse files

implement review comment (issue #250)

parent db0fc85a
Pipeline #2580 passed with stages
in 34 minutes and 8 seconds
......@@ -319,6 +319,8 @@ class RailEnv(Environment):
if optionals and 'distance_map' in optionals:
self.distance_map.set(optionals['distance_map'])
# todo change self.agents_static[0] with the refactoring for agents_static -> issue nr. 185
# https://gitlab.aicrowd.com/flatland/flatland/issues/185
if regenerate_schedule or self.agents_static[0] is None:
agents_hints = None
if optionals and 'agents_hints' in optionals:
......
......@@ -232,7 +232,7 @@ def test_get_entry_directions():
def test_rail_env_reset():
file_name = "test_rail_env_reset.pkl"
# Test to save and load file with distance map.
# Test to save and load file.
rail, rail_map = make_simple_rail()
......@@ -264,10 +264,6 @@ def test_rail_env_reset():
assert np.all(np.array_equal(rails_initial, rails_loaded))
assert agents_initial == agents_loaded
# Check that distance map was not recomputed
assert np.shape(env2.distance_map.get()) == dist_map_shape
assert env2.distance_map.get() is not None
env3 = RailEnv(width=1,
height=1,
rail_generator=rail_from_file(file_name),
......@@ -282,10 +278,6 @@ def test_rail_env_reset():
assert np.all(np.array_equal(rails_initial, rails_loaded))
assert agents_initial == agents_loaded
# Check that distance map was not recomputed
assert np.shape(env3.distance_map.get()) == dist_map_shape
assert env3.distance_map.get() is not None
env4 = RailEnv(width=1,
height=1,
rail_generator=rail_from_file(file_name),
......@@ -299,7 +291,3 @@ def test_rail_env_reset():
assert np.all(np.array_equal(rails_initial, rails_loaded))
assert agents_initial == agents_loaded
# Check that distance map was not recomputed
assert np.shape(env4.distance_map.get()) == dist_map_shape
assert env4.distance_map.get() is not None
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment