composabl_core.agent.skill.skill_controller

A Controller is a component that directly controls the actions of an agent based on its sensor. It is predefined logic that exists already within the process (e.g., PID, MPC, Mathematical Expressions, ...) and is often seen as the "Benchmark" to beat by the Skill Teacher type. It is however common to also combine the Controller with the Skill Teacher to provide a more robust and adaptive solution.

class SkillController(abc.ABC):

The SkillController API specification

SkillController(*args, **kwargs)

Initializes the SkillController with the foundational properties required for controlling an agent.

Attributes:
  • action_space: The space of possible actions that the controller can output.
  • sensor_space: The types of sensors that the controller can process to make decisions.
  • scenario: The specific scenario or environment in which the controller operates.
@abstractmethod
async def compute_action(self, transformed_sensors: Dict, action):

Determines the action to be taken by the agent based on the current transformed sensor. This method encapsulates the control logic, utilizing the provided sensor and potentially the current action state to compute the next action.

Arguments:
  • transformed_sensors (Dict): The sensor after being processed or transformed, providing the relevant information for decision-making.
  • action: The current or most recent action taken by the agent, which may influence the computation of the next action.
Returns:

The action to be taken by the agent in response to the transformed sensor.

async def transform_sensors(self, sensors):

Processes or transforms the raw sensors from the environment before they are utilized for control decisions. This method allows the controller to apply necessary preprocessing steps to make the sensors more suitable for the implemented control logic.

Arguments:
  • obs: The raw sensors data from the environment.
Returns:

The transformed sensor relevant to the control logic.

@abstractmethod
async def filtered_sensor_space(self):

Specifies a subset of the sensor space that is relevant to the control logic of the controller. This method helps to identify which aspects of the sensors are most pertinent for decision-making, potentially improving the efficiency and effectiveness of the controller.

Returns:

An enumeration of the sensor types or features that are considered relevant by

@abstractmethod
async def compute_success_criteria(self, transformed_sensors: Dict, action):

Evaluates whether the current state and action meet the defined success criteria for the control logic. This method is crucial for assessing the effectiveness of the controller in achieving its objectives within the environment.

Arguments:
  • transformed_sensors (Dict): The transformed sensor relevant to the success criteria.
  • action: The action taken in response to the sensor.
@abstractmethod
async def compute_termination(self, transformed_sensors: Dict, action):

Determines if the current state and action justify the termination of the control session. This could be due to the achievement of control objectives, failure conditions being met, or other criteria predefined by the controller.

Arguments:
  • transformed_sensors (Dict): The transformed sensor from the environment.
  • action: The action taken by the agent.