Skip to content
Snippets Groups Projects
Commit 472349a6 authored by Erik Nygren's avatar Erik Nygren
Browse files

Reintroduced start of stopped agent on switch

parent fcd9eed2
No related branches found
No related tags found
No related merge requests found
...@@ -221,7 +221,7 @@ class RailEnv(Environment): ...@@ -221,7 +221,7 @@ class RailEnv(Environment):
agent.moving = False agent.moving = False
self.rewards_dict[iAgent] += stop_penalty self.rewards_dict[iAgent] += stop_penalty
if not agent.moving and action == RailEnvActions.MOVE_FORWARD: if not agent.moving and not (action == RailEnvActions.DO_NOTHING or action == RailEnvActions.STOP_MOVING):
# Only allow agent to start moving by pressing forward. # Only allow agent to start moving by pressing forward.
agent.moving = True agent.moving = True
self.rewards_dict[iAgent] += start_penalty self.rewards_dict[iAgent] += start_penalty
......
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