def agent_policy(self):
        """Get the agent policy class

        Make sure you access the global config via get_global_config() instead of self.engine.global_config

        Returns:
            Agent Policy class
        """
        from metadrive.engine.engine_utils import get_global_config
        # Takeover policy shares the control between RL agent (whose action is input via env.step)
        # and external control device (whose action is input via controller).
        if get_global_config()["agent_policy"] in [TakeoverPolicy, TakeoverPolicyWithoutBrake]:
            return get_global_config()["agent_policy"]
        if get_global_config()["manual_control"]:
            if get_global_config().get("use_AI_protector", False):
                policy = AIProtectPolicy
            else:
                policy = ManualControlPolicy
        else:
            policy = get_global_config()["agent_policy"]
        return policy
Get the agent policy class

        Make sure you access the global config via get_global_config() instead of self.engine.global_config

        Returns:
            Agent Policy class
        
metadrive/manager/agent_manager.py