diff --git a/flatland/envs/rail_env.py b/flatland/envs/rail_env.py index cb4da95a81758625f1f45ecb535e47d834fd5005..290cf96b72ebeb689c928b88b64dc1d0eebde70b 100644 --- a/flatland/envs/rail_env.py +++ b/flatland/envs/rail_env.py @@ -372,7 +372,8 @@ class RailEnv(Environment): info_dict: Dict = { 'action_required': { i: (agent.status == RailAgentStatus.READY_TO_DEPART or ( - agent.status == RailAgentStatus.ACTIVE and agent.speed_data['position_fraction'] == 0.0)) + agent.status == RailAgentStatus.ACTIVE and np.isclose(agent.speed_data['position_fraction'], 0.0, + rtol=1e-03))) for i, agent in enumerate(self.agents)}, 'malfunction': { i: self.agents[i].malfunction_data['malfunction'] for i in range(self.get_num_agents())