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

added info to reset function

parent 8fbecf3f
No related branches found
No related tags found
No related merge requests found
...@@ -307,8 +307,19 @@ class RailEnv(Environment): ...@@ -307,8 +307,19 @@ class RailEnv(Environment):
self.obs_builder.reset() self.obs_builder.reset()
self.distance_map.reset(self.agents, self.rail) self.distance_map.reset(self.agents, self.rail)
info_dict = {
'action_required': {
i: (agent.status == RailAgentStatus.READY_TO_DEPART or (
agent.status == RailAgentStatus.ACTIVE and agent.speed_data['position_fraction'] == 0.0))
for i, agent in enumerate(self.agents)},
'malfunction': {
i: self.agents[i].malfunction_data['malfunction'] for i in range(self.get_num_agents())
},
'speed': {i: self.agents[i].speed_data['speed'] for i in range(self.get_num_agents())},
'status': {i: agent.status for i, agent in enumerate(self.agents)}
}
# Return the new observation vectors for each agent # Return the new observation vectors for each agent
return self._get_observations() return self._get_observations(), info_dict
def _agent_malfunction(self, i_agent) -> bool: def _agent_malfunction(self, i_agent) -> bool:
""" """
......
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