From f2a5dae7c5139460a3e5c53e6111b77db8ae1e5b Mon Sep 17 00:00:00 2001 From: u214892 <u214892@sbb.ch> Date: Wed, 4 Sep 2019 15:55:37 +0200 Subject: [PATCH] #167 bugfix action_on_cellexit --- flatland/envs/rail_env.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/flatland/envs/rail_env.py b/flatland/envs/rail_env.py index 848ac15a..566fa7d1 100644 --- a/flatland/envs/rail_env.py +++ b/flatland/envs/rail_env.py @@ -337,11 +337,11 @@ class RailEnv(Environment): # The train is broken if agent.malfunction_data['malfunction'] > 0: + # Last step of malfunction --> Agent starts moving again after getting fixed if agent.malfunction_data['malfunction'] < 2: agent.malfunction_data['malfunction'] -= 1 self.agents[i_agent].moving = True - action_dict[i_agent] = RailEnvActions.DO_NOTHING else: agent.malfunction_data['malfunction'] -= 1 @@ -349,7 +349,6 @@ class RailEnv(Environment): # Broken agents are stopped self.rewards_dict[i_agent] += step_penalty * agent.speed_data['speed'] self.agents[i_agent].moving = False - action_dict[i_agent] = RailEnvActions.DO_NOTHING # Nothing left to do with broken agent continue -- GitLab