Object.Subtypes.ActuatorObject (object v0.1.2)

Object for environmental manipulation and action execution.

Summary

Functions

Executes a physical action and updates actuator state.

Creates a new Actuator Object for environmental manipulation.

Queues an action for later execution with priority ordering.

Functions

execute_action(actuator, action_command)

Executes a physical action and updates actuator state.

Performs the specified action, calculates energy consumption and wear, then updates the actuator's internal state and metrics.

Parameters

  • actuator - ActuatorObject struct
  • action_command - Command specifying the action to execute

Returns

Tuple with execution result and updated actuator with wear/energy updates

new(opts \\ [])

Creates a new Actuator Object for environmental manipulation.

Parameters

  • opts - Configuration options:
    • :id - Actuator identifier
    • :actuator_type - Type of actuator (:motor, :hydraulic, :pneumatic)
    • :action_range - Valid action range as tuple
    • :precision - Action precision (0.0-1.0)
    • :response_time - Response time in seconds

Returns

ActuatorObject struct configured for action execution and queuing

queue_action(actuator, action_command, priority \\ :normal)

Queues an action for later execution with priority ordering.

Adds an action to the execution queue, sorted by priority and timestamp. Higher priority actions are executed first.

Parameters

  • actuator - ActuatorObject struct
  • action_command - Command to queue for execution
  • priority - Priority level (:critical, :high, :normal, :low)

Returns

Updated ActuatorObject with action added to sorted queue