def act(self, agent_id):
        """
        It retrieves the action from self.engine.external_actions["action"]
        Args:
            agent_id: the id of this agent

        Returns: continuous 2-dim action [steering, throttle]

        """
        action = self.engine.external_actions[agent_id]["action"]
        self.extra_input = self.engine.external_actions[agent_id]["extra"]

        # the following content is the same as EnvInputPolicy
        if self.engine.global_config["action_check"]:
            # Do action check for external input in EnvInputPolicy
            assert self.get_input_space().contains(self.engine.external_actions[agent_id]), \
                "Input {} is not compatible with action space {}!".format(
                self.engine.external_actions[agent_id], self.get_input_space()
            )
        to_process = self.convert_to_continuous_action(action) if self.discrete_action else action

        # clip to -1, 1
        action = [clip(to_process[i], -1.0, 1.0) for i in range(len(to_process))]
        self.action_info["action"] = action
        return action

        It retrieves the action from self.engine.external_actions["action"]
        Args:
            agent_id: the id of this agent

        Returns: continuous 2-dim action [steering, throttle]

        
metadrive/policy/env_input_policy.py