Bardo.Examples.Benchmarks.Dpb.DpbSensor (Bardo v0.1.0)
View SourceSensor implementation for the Double Pole Balancing (DPB) benchmark.
This module provides sensors that agents can use to perceive the state of the cart and poles in the pole balancing simulation.
Summary
Functions
Create a cart position sensor configuration.
Create a cart velocity sensor configuration.
Initialize a new sensor for the DPB simulation.
Initialize a new sensor for the DPB simulation.
Process sensory data based on sensor type.
Create a pole1 angle sensor configuration.
Create a pole1 angular velocity sensor configuration.
Create a pole2 angle sensor configuration.
Create a pole2 angular velocity sensor configuration.
Read data from the sensor.
Send a sensing request to the scape.
Functions
Create a cart position sensor configuration.
Parameters:
- id: Sensor ID
- fanout: Number of output elements (typically 1)
- cortex_id: ID of the cortex
- scape_name: Name of the scape
Returns a sensor specification map.
Create a cart velocity sensor configuration.
Parameters:
- id: Sensor ID
- fanout: Number of output elements (typically 1)
- cortex_id: ID of the cortex
- scape_name: Name of the scape
Returns a sensor specification map.
Initialize a new sensor for the DPB simulation.
This is the implementation of the Sensor behavior's init/1 callback.
Initialize a new sensor for the DPB simulation.
Parameters:
- id: Sensor ID
- sensor_type: :cart_position, :pole1_angle, :pole2_angle, :cart_velocity,
:pole1_angular_velocity, or :pole2_angular_velocity
- fanout: Number of output elements (typically 1)
- cortex_pid: PID of the cortex process
- scape_pid: PID of the scape process
- agent_id: ID of the agent
Process sensory data based on sensor type.
This is the implementation of the Sensor behavior's percept/2 callback.
Create a pole1 angle sensor configuration.
Parameters:
- id: Sensor ID
- fanout: Number of output elements (typically 1)
- cortex_id: ID of the cortex
- scape_name: Name of the scape
Returns a sensor specification map.
Create a pole1 angular velocity sensor configuration.
Parameters:
- id: Sensor ID
- fanout: Number of output elements (typically 1)
- cortex_id: ID of the cortex
- scape_name: Name of the scape
Returns a sensor specification map.
Create a pole2 angle sensor configuration.
Parameters:
- id: Sensor ID
- fanout: Number of output elements (typically 1)
- cortex_id: ID of the cortex
- scape_name: Name of the scape
Returns a sensor specification map.
Create a pole2 angular velocity sensor configuration.
Parameters:
- id: Sensor ID
- fanout: Number of output elements (typically 1)
- cortex_id: ID of the cortex
- scape_name: Name of the scape
Returns a sensor specification map.
Read data from the sensor.
This function sends a sensing request to the scape and processes the response.
Send a sensing request to the scape.
This is the implementation of the Sensor behavior's sense/2 callback.