Skip to content
Snippets Groups Projects
Commit 7a562a17 authored by Erik Nygren's avatar Erik Nygren :bullettrain_front:
Browse files

removed == 0.0 comparison and replaced by np.isclose

This closes #198
parent 00cf76e3
No related branches found
No related tags found
No related merge requests found
......@@ -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())
......
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