Bardo.Examples.Benchmarks.Dpb.DpbActuator (Bardo v0.1.0)

View Source

Actuator implementation for the Double Pole Balancing (DPB) benchmark.

This module provides actuators that agents can use to control the cart in the pole balancing simulation.

Summary

Functions

Process signals from the neural network and apply forces to the cart.

Handle a list of incoming signals from the neural network.

Initialize a new actuator for the DPB simulation.

Initialize a new actuator for the DPB simulation.

Create a force actuator configuration for DPB with damping.

Create a force actuator configuration for DPB without damping.

Functions

actuate(actuator_type, arg)

Process signals from the neural network and apply forces to the cart.

This is the implementation of the Actuator behavior's actuate/2 callback.

handle(signals, state)

Handle a list of incoming signals from the neural network.

This function:

  1. Converts neural network output to a force value
  2. Sends the force value to the DPB simulator
  3. Processes responses (fitness, simulation state)

init(params)

Initialize a new actuator for the DPB simulation.

This is the implementation of the Actuator behavior's init/1 callback.

init(id, actuator_type, fanin, cortex_pid, scape_pid, agent_id, parameters)

Initialize a new actuator for the DPB simulation.

Parameters:

  • id: Actuator ID
  • actuator_type: :force
  • fanin: Number of input elements
  • cortex_pid: PID of the cortex process
  • scape_pid: PID of the scape process
  • agent_id: ID of the agent
  • parameters: Additional parameters (with_damping or without_damping)

with_damping(id, fanin, cortex_id, scape_name)

@spec with_damping(integer(), integer(), atom(), atom()) :: map()

Create a force actuator configuration for DPB with damping.

Parameters:

  • id: Actuator ID
  • fanin: Number of input elements from the neural network
  • cortex_id: ID of the cortex
  • scape_name: Name of the scape

Returns an actuator specification map.

without_damping(id, fanin, cortex_id, scape_name)

@spec without_damping(integer(), integer(), atom(), atom()) :: map()

Create a force actuator configuration for DPB without damping.

Parameters:

  • id: Actuator ID
  • fanin: Number of input elements from the neural network
  • cortex_id: ID of the cortex
  • scape_name: Name of the scape

Returns an actuator specification map.