Skip to content
Snippets Groups Projects
Commit 29be6464 authored by spmohanty's avatar spmohanty
Browse files

Mark agents as done in dont dict on max episode steps violation

parent 71a41765
No related branches found
No related tags found
No related merge requests found
...@@ -488,6 +488,8 @@ class RailEnv(Environment): ...@@ -488,6 +488,8 @@ class RailEnv(Environment):
self.rewards_dict = {i: self.global_reward for i in range(self.get_num_agents())} self.rewards_dict = {i: self.global_reward for i in range(self.get_num_agents())}
if (self._max_episode_steps is not None) and (self._elapsed_steps >= self._max_episode_steps): if (self._max_episode_steps is not None) and (self._elapsed_steps >= self._max_episode_steps):
self.dones["__all__"] = True self.dones["__all__"] = True
for i_agent in range(self.get_num_agents()):
self.dones[i] = True
return self._get_observations(), self.rewards_dict, self.dones, info_dict return self._get_observations(), self.rewards_dict, self.dones, info_dict
......
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