From 976a00463de18d5c459063dc2752fa12ac70b146 Mon Sep 17 00:00:00 2001 From: Dipam Chakraborty <dipam@aicrowd.com> Date: Thu, 5 Aug 2021 01:14:44 +0530 Subject: [PATCH] add waiting to set_agent_active --- flatland/envs/rail_env.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/flatland/envs/rail_env.py b/flatland/envs/rail_env.py index 7ed92784..1aca7442 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) -- GitLab