diff --git a/flatland/envs/rail_env.py b/flatland/envs/rail_env.py index 7ed927842e16f2bb7da37a2cd8bb95585aa19447..1aca744293b7effae00521f7f7a2ae5dd5fc8ee7 100644 --- a/flatland/envs/rail_env.py +++ b/flatland/envs/rail_env.py @@ -276,7 +276,7 @@ class RailEnv(Environment): return len(self.agents) - 1 def set_agent_active(self, agent: EnvAgent): - if agent.status == RailAgentStatus.READY_TO_DEPART and self.cell_free(agent.initial_position): + if agent.status == RailAgentStatus.READY_TO_DEPART or agent.status == RailAgentStatus.WAITING and self.cell_free(agent.initial_position): ## Dipam : Why is this code even there??? agent.status = RailAgentStatus.ACTIVE self._set_agent_to_initial_position(agent, agent.initial_position)