st_signals['movement_conflict']=(notmovement_allowed)andagent.speed_counter.is_cell_exit# TODO: Modify motion check to provide proper conflict information
returnst_signals
def_handle_end_reward(self,agent:EnvAgent)->int:
'''
Handles end-of-episode reward for a particular agent.
# if final_new_position and self.rail.grid[final_new_position] == 0:
# import pdb; pdb.set_trace()
# if final_new_position and not (final_new_position[0] >= 0 and final_new_position[1] >= 0 and final_new_position[0] < self.rail.height and final_new_position[1] < self.rail.width): # TODO: Remove this
# import pdb; pdb.set_trace()
agent.position=final_new_position
agent.direction=final_new_direction
...
...
@@ -581,49 +588,6 @@ class RailEnv(Environment):
self.rewards_dict={i_agent:0fori_agentinrange(len(self.agents))}# TODO : Remove this
returnself._get_observations(),self.rewards_dict,self.dones,info_dict# TODO : Will need changes?