Skip to content
Snippets Groups Projects
Commit f2a5dae7 authored by u214892's avatar u214892
Browse files

#167 bugfix action_on_cellexit

parent 6f1d5581
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
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