Polarith AI
1.7
Sensor Class Reference

Description

This asset defines how an agent, having an AIMContext, component samples its environment (back-end class).

Every agent can have one associated sensor at a time . Derived Sensor<T> using Structure as type for the structural element (for the problem space representation of the contained Receptor<T> instances). So, this class holds objects of type Receptor which is a concrete IReceptor<T> implementation supporting Unity's serialization.

Because the generic type of Sensor<T> gets hidden by inheritance, this abstract class is compatible to Unity's serialization pipeline so that it can implement the whole ISensor<T> interface. However, this class remains abstract due to the definition of the Clone method which is required for all further derived classes. Every concrete Sensor needs to be copyable in order to support agents which require a cloned sensor instance at runtime.

Attention, a sensor might be shared by multiple agents! Changing the data of a shared sensor at runtime is not thread-safe.

Base back-end class of every derived AIMSensor.

Inheritance diagram for Sensor:
PlanarSensor SpatialSensor

Protected Fields

List< Receptorreceptors = new List<Receptor>()
 All contained receptor instances forming the shape of this sensor. More...
 

Properties

abstract Sensor Clone [get]
 Constructs a copy of this instance (read only). More...
 
abstract Quaternion Rotation [get]
 The current rotation (read only). More...
 
abstract Quaternion InverseRotation [get]
 The inverse of the current rotation (read only). More...
 
abstract VectorProjectionType ProjectionMode [get]
 The VectorProjectionType derived from the internal projection settings. More...
 
override int ReceptorCount [get]
 The number of contained receptors (read only). More...
 
override IReceptor< Structurethis[int id] [get]
 Provides quick read-only access to a contained Receptor instance. More...
 

Public Methods

override IReceptor< StructureAddReceptor ()
 Constructs and adds a Receptor instance into this sensor. More...
 
override IReceptor< StructureInsertReceptor (int id)
 Constructs and inserts a Receptor instance into this sensor with the specified id . More...
 
override IReceptor< StructureGetReceptor (int id)
 Gets the Receptor with the specified id . More...
 
override void RemoveReceptorAt (int id)
 Removes the Receptor with the specified id . More...
 
override void ClearReceptors ()
 Removes all contained Receptor instances. More...
 
Imprint