RAIN.Sensors.Sensor Class Reference

Sensor is the base class for all Sensor types. It defines default and support functionality for Sensors and defines the Sensor interface. More...

Inheritance diagram for RAIN.Sensors.Sensor:
RAIN.Sensors.TriggerSensor RAIN.Sensors.RaycastSensor RAIN.Sensors.BoxSensor RAIN.Sensors.SphereSensor RAIN.Sensors.ExpandingBoxSensor

List of all members.

Public Member Functions

 Sensor ()
 Default constructor.
virtual void Sense ()
 Sense is a message to the sensor to start any active sensing processes.
virtual void Reset ()
 Reset is a message to the sensor to revert to an initial state.
void AddFocus (string aspectName)
void LoseFocus (string aspectName)
 LoseFocus will remove an aspect name from the current focus of attention.
void FocusOn (string aspectName)
 FocusOn will reset the focus of attention to just the item specified.
bool AddEvidence (Entity entity, float expiration)
 AddEvidence will tell the Belief system to add new evidence about an entity. The evidence may have an associated expiration. Adding evidence is a way of suggesting to the Belief system that a Describable object has been sensed.
bool AddEvidence (GameObject beliefObject, float expiration, Vector3 position)
 AddEvidence will tell the Belief system to add new evidence about an entity. The evidence may have an associated expiration. Adding evidence is a way of suggesting to the Belief system that a GameObject object has been sensed.

Public Attributes

List< string > focusOfAttention = new List<string>()
int maxfocus = 5
 Max items we can focus on at a time.
float persistenceTime = 1.0f
 Persistence time defines how long an object is retained in memory after the Sensor stops sensing it.
List< Sensationsensations = new List<Sensation>()
 A list of Sensations supported by this Sensor. If a sensor has no Sensations, it will detect all Describable objects.

Protected Member Functions

bool AttentiveTo (Decoration[] decorations)
bool AttentiveTo (Decoration decoration)
 AttentiveTo determines whether the sensor is currently attempting to sense Aspects or Decorations related to the supplied decoration.
bool CanSense (Sensation sensation)
 CanSense determines whether the sensor is currently attempting to sense Sensations with the same name as the provided Sensation.

Detailed Description

Sensor is the base class for all Sensor types. It defines default and support functionality for Sensors and defines the Sensor interface.


Constructor & Destructor Documentation

RAIN.Sensors.Sensor.Sensor ( )

Default constructor.


Member Function Documentation

bool RAIN.Sensors.Sensor.AddEvidence ( Entity  entity,
float  expiration 
)

AddEvidence will tell the Belief system to add new evidence about an entity. The evidence may have an associated expiration. Adding evidence is a way of suggesting to the Belief system that a Describable object has been sensed.

Parameters:
entityThe Describable entity that has been sensed
expirationA time in seconds after which the evidence can be discarded
Returns:
true if evidence was added succesfully, false otherwise
bool RAIN.Sensors.Sensor.AddEvidence ( GameObject  beliefObject,
float  expiration,
Vector3  position 
)

AddEvidence will tell the Belief system to add new evidence about an entity. The evidence may have an associated expiration. Adding evidence is a way of suggesting to the Belief system that a GameObject object has been sensed.

Parameters:
beliefObjectThe GameObject for which evidence is being added
expirationA time in seconds after which the evidence can be discarded
positionA position at which the GameObject was last detected
Returns:
true if evidence was added succesfully, false otherwise
void RAIN.Sensors.Sensor.AddFocus ( string  aspectName)

AddFocus will add an aspect name to the current focus of attention

Parameters:
aspectNamethe aspect name to add to the focus of attention
bool RAIN.Sensors.Sensor.AttentiveTo ( Decoration  decoration) [protected]

AttentiveTo determines whether the sensor is currently attempting to sense Aspects or Decorations related to the supplied decoration.

Parameters:
decorationAn Aspect or Decoration to check
Returns:
true if the Sensor is currently attempting to detect the decoration type, false otherwise
bool RAIN.Sensors.Sensor.CanSense ( Sensation  sensation) [protected]

CanSense determines whether the sensor is currently attempting to sense Sensations with the same name as the provided Sensation.

Parameters:
sensationThe sensation to check for
Returns:
true if the Sensor can sense the designated Sensation, false othewise
void RAIN.Sensors.Sensor.FocusOn ( string  aspectName)

FocusOn will reset the focus of attention to just the item specified.

Parameters:
aspectNameThe name of the aspect to solely focus on
void RAIN.Sensors.Sensor.LoseFocus ( string  aspectName)

LoseFocus will remove an aspect name from the current focus of attention.

Parameters:
aspectNamethe aspect name to remove from the focus of attention
virtual void RAIN.Sensors.Sensor.Reset ( ) [virtual]

Reset is a message to the sensor to revert to an initial state.

Reimplemented in RAIN.Sensors.ExpandingBoxSensor.

virtual void RAIN.Sensors.Sensor.Sense ( ) [virtual]

Sense is a message to the sensor to start any active sensing processes.

Reimplemented in RAIN.Sensors.ExpandingBoxSensor.


Member Data Documentation

Max items we can focus on at a time.

Persistence time defines how long an object is retained in memory after the Sensor stops sensing it.

For example, if persistenceTime is set to 1.0 then any sensed object will be retained in working memory as long as it continues to be sensed. If the object moves outside of the sensor range, it will remain in working memory for 1 additional second.

A list of Sensations supported by this Sensor. If a sensor has no Sensations, it will detect all Describable objects.