Exemple #1
0
    def _remove_agent_from_scene(self, agent: EnvAgent):
        """
        Remove the agent from the scene. Updates the agent object and the position
        of the agent inside the global agent_position numpy array

        Parameters
        -------
        agent: EnvAgent object
        """
        self.agent_positions[agent.position] = -1
        if self.remove_agents_at_target:
            agent.position = None
            agent.status = RailAgentStatus.DONE_REMOVED
Exemple #2
0
 def set_agent_active(self, agent: EnvAgent):
     if agent.status == RailAgentStatus.READY_TO_DEPART and self.cell_free(
             agent.initial_position):
         agent.status = RailAgentStatus.ACTIVE
         self._set_agent_to_initial_position(agent, agent.initial_position)