Bardo.Examples.Applications.Flatland.FlatlandSensor (Bardo v0.1.0)
View SourceSensor implementation for the Flatland simulation.
This module provides sensors that agents can use to perceive the Flatland environment, including vision, smell, and energy sensors.
Summary
Functions
Create a color scanner sensor configuration.
Create a distance scanner sensor configuration.
Creates an energy sensor configuration.
Initialize the sensor with provided parameters.
Initialize a new sensor for Flatland (deprecated version).
Process sensor data to generate output signals.
Read data from the sensor.
Sense the environment for the agent.
Creates a smell sensor configuration.
Terminate the sensor gracefully.
Creates a vision sensor configuration.
Functions
Create a color scanner sensor configuration.
Parameters:
- id: Sensor ID
- n: Number of rays (angles) to scan
- fanout: Number of output elements
- cortex_id: ID of the cortex
- scape_name: Name of the scape
Returns a sensor specification map.
Create a distance scanner sensor configuration.
Parameters:
- id: Sensor ID
- n: Number of rays (angles) to scan
- fanout: Number of output elements
- cortex_id: ID of the cortex
- scape_name: Name of the scape
Returns a sensor specification map.
@spec energy(pos_integer(), binary() | atom(), atom()) :: map()
Creates an energy sensor configuration.
Parameters
resolution
- The number of energy level ranges to detectcortex_id
- The ID of the cortex this sensor is connected toscape_name
- The name of the scape this sensor will read from
Returns
- A sensor specification map
Initialize the sensor with provided parameters.
Required by the Sensor behavior.
Initialize a new sensor for Flatland (deprecated version).
This function is kept for backward compatibility.
Process sensor data to generate output signals.
Required by the Sensor behavior.
Read data from the sensor.
This function sends a sensing request to the scape and processes the response.
Sense the environment for the agent.
Required by the Sensor behavior.
@spec smell(pos_integer(), pos_integer(), binary() | atom(), atom()) :: map()
Creates a smell sensor configuration.
Parameters
radius
- The radius of the smell detection areatypes
- The number of different object types to detectcortex_id
- The ID of the cortex this sensor is connected toscape_name
- The name of the scape this sensor will read from
Returns
- A sensor specification map
Terminate the sensor gracefully.
Called when the sensor is being stopped.
@spec vision(pos_integer(), pos_integer(), binary() | atom(), atom()) :: map()
Creates a vision sensor configuration.
Parameters
angle_count
- The number of different angles to look inrange
- The maximum vision rangecortex_id
- The ID of the cortex this sensor is connected toscape_name
- The name of the scape this sensor will read from
Returns
- A sensor specification map