Commit 2947c388 authored by Egli Adrian (IT-SCI-API-PFI)'s avatar Egli Adrian (IT-SCI-API-PFI)
Browse files

Bug fixed in client and service / and simplified RailEnv for challenge round 2

parent 5df45590
Pipeline #2559 passed with stages
in 42 minutes and 46 seconds
......@@ -117,7 +117,7 @@ class RailEnv(Environment):
obs_builder_object: ObservationBuilder = GlobalObsForRailEnv(),
max_episode_steps=None,
stochastic_data=None,
remove_agents_at_target=False,
remove_agents_at_target=True,
random_seed=1
):
"""
......
......@@ -202,6 +202,7 @@ class FlatlandRemoteClient(object):
self.env = RailEnv(
width=1,
height=1,
remove_agents_at_target=True,
rail_generator=rail_from_file(test_env_file_path),
schedule_generator=schedule_from_file(test_env_file_path),
obs_builder_object=obs_builder_object
......
......@@ -204,7 +204,7 @@ class FlatlandRemoteEvaluationService:
Obtains a new redis connection from a previously instantiated
redis connection pool
"""
redis_conn = redis.Redis(connection_pool=self.redis_pool)
redis_conn = redis.Redis(connection_pool=self.redis_pool).pipeline()
try:
redis_conn.ping()
except Exception:
......
......@@ -20,6 +20,7 @@ def test_initial_status():
height=rail_map.shape[0],
rail_generator=rail_from_grid_transition_map(rail),
schedule_generator=random_schedule_generator(),
remove_agents_at_target=False,
number_of_agents=1,
obs_builder_object=TreeObsForRailEnv(max_depth=2, predictor=ShortestPathPredictorForRailEnv()),
)
......
......@@ -178,6 +178,7 @@ def test_reward_function_waiting(rendering=False):
rail, rail_map = make_simple_rail()
env = RailEnv(width=rail_map.shape[1],
height=rail_map.shape[0],
remove_agents_at_target=False,
rail_generator=rail_from_grid_transition_map(rail),
schedule_generator=random_schedule_generator(),
number_of_agents=2,
......
......@@ -1333,6 +1333,7 @@ def test_rail_env_action_required_info():
1. / 4.: 0.25} # Slow freight train
env_always_action = RailEnv(width=50,
height=50,
remove_agents_at_target=False,
rail_generator=sparse_rail_generator(
max_num_cities=10,
max_rails_between_cities=3,
......@@ -1346,6 +1347,7 @@ def test_rail_env_action_required_info():
random.seed(0)
env_only_if_action_required = RailEnv(width=50,
height=50,
remove_agents_at_target=False,
rail_generator=sparse_rail_generator(
max_num_cities=10,
max_rails_between_cities=3,
......
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