RAIN.Core.Mind Class Reference

Mind is the base class for creating specific Mind types that assist in organizing "thinking" strategies. Mind provides access to various RAIN resources, specifically around Sensors and memory retrieval. Mind is also responsible for controlling the Think/Act cycle. More...

Inheritance diagram for RAIN.Core.Mind:
RAIN.Minds.BehaviorTreeMind RAIN.Minds.SimpleMind RAIN.Minds.GoalActionMind

List of all members.

Public Member Functions

abstract void Init (Agent agent)
 Init is called once to support setting up the Mind initially.
abstract void Think (Agent agent, float deltaTime)
 Think is called prior to Act. The purpose of Think is to do any processing, logical deliberation, decision making, or other calculation required as a precursor to action selection. RAIN supports the idea of Thinking about what you want, the determining how to Act.
abstract void Act (Agent agent, float deltaTime)
 Act is called during LateUpdate for both Action selection and Action execution. This is where, for example, Behavior Tree processing would occur. Where Think is used to perform logical deliberation and determine "what is", Act is used for decision making and determining "what to do".
virtual void GainInterestIn (string symbol)
 GainInterestIn will add the specified Aspect symbol to the set of objects that can be detected by active Sensors. This is typically called through the Agent class.
virtual void LoseInterestIn (string symbol)
 LoseInterestIn will remove the specified Aspect symbol from the set of objects that can be detected by active Sensors. This is typically called through the Agent class.
virtual void ConcentrateOn (string symbol)
 ConcentrateOn will set the specified Aspect symbol as the only Aspect detected by active Sensors. All other Aspects will be ignored. This is typically called through the Agent class.
virtual void Sense ()
 Sense tells your AI to process information from Sensors at this moment in time. Note that this is not a persistent method. You must call each time you need to update AI memory. This is typically called through the Agent class.
virtual void BeginSense ()
 BeginSense resets sensors to their initial state, preparing them to begin a sensing operation. This method should be called once before subsequent calls to Sense This is typically called through the Agent class.
virtual void GetAllObjectsWithAspect (string symbol, out GameObject[] aspects)
 GetAllDecorations will get a list of all "Decoration" objects stored in AI memory. A Decoration is a generic container for objects like Aspects. Aspects are the only decorations currently accessible in RAIN.
virtual void GetObjectWithAspect (string symbol, out GameObject aspectObject)
 GetObjectwithAspect returns a single GameObject associated with the symbol/Aspect name. This is typically a GameObject detected by Sensors associated with the Aspect.

Public Attributes

ActionContext actionContext = new ActionContext()

Protected Member Functions

void LoadSensors (Agent agent)
 Load Sensors causes all sensors attached to this GameObject hierarchy to be loaded and associated with this Mind. LoadSensors will begin at the root.

Protected Attributes

Sensor[] sensors
 sensors is an array of Sensors registered with this AI. Usually sensors are registered by calling LoadSensors() in the Init() method

Detailed Description

Mind is the base class for creating specific Mind types that assist in organizing "thinking" strategies. Mind provides access to various RAIN resources, specifically around Sensors and memory retrieval. Mind is also responsible for controlling the Think/Act cycle.


Member Function Documentation

abstract void RAIN.Core.Mind.Act ( Agent  agent,
float  deltaTime 
) [pure virtual]

Act is called during LateUpdate for both Action selection and Action execution. This is where, for example, Behavior Tree processing would occur. Where Think is used to perform logical deliberation and determine "what is", Act is used for decision making and determining "what to do".

Parameters:
agent
deltaTime

Implemented in RAIN.Minds.BehaviorTreeMind, and RAIN.Minds.SimpleMind.

virtual void RAIN.Core.Mind.BeginSense ( ) [virtual]

BeginSense resets sensors to their initial state, preparing them to begin a sensing operation. This method should be called once before subsequent calls to Sense This is typically called through the Agent class.

virtual void RAIN.Core.Mind.ConcentrateOn ( string  symbol) [virtual]

ConcentrateOn will set the specified Aspect symbol as the only Aspect detected by active Sensors. All other Aspects will be ignored. This is typically called through the Agent class.

Parameters:
symbol
virtual void RAIN.Core.Mind.GainInterestIn ( string  symbol) [virtual]

GainInterestIn will add the specified Aspect symbol to the set of objects that can be detected by active Sensors. This is typically called through the Agent class.

Parameters:
symbolThe name of an Aspect to detect
virtual void RAIN.Core.Mind.GetAllObjectsWithAspect ( string  symbol,
out GameObject[]  aspects 
) [virtual]

GetAllDecorations will get a list of all "Decoration" objects stored in AI memory. A Decoration is a generic container for objects like Aspects. Aspects are the only decorations currently accessible in RAIN.

Parameters:
symbolThe name of the decoration name to filter by. This is the same as an Aspect name.
aspectsAn returned array of matching GameObjects
virtual void RAIN.Core.Mind.GetObjectWithAspect ( string  symbol,
out GameObject  aspectObject 
) [virtual]

GetObjectwithAspect returns a single GameObject associated with the symbol/Aspect name. This is typically a GameObject detected by Sensors associated with the Aspect.

Parameters:
symbolThe symbol or name associated with an Aspect
aspectObjectThe matching GameObject returned, or null if no match is found
abstract void RAIN.Core.Mind.Init ( Agent  agent) [pure virtual]

Init is called once to support setting up the Mind initially.

Parameters:
agentThe AI agent this Mind is associated with

Implemented in RAIN.Minds.BehaviorTreeMind, and RAIN.Minds.SimpleMind.

void RAIN.Core.Mind.LoadSensors ( Agent  agent) [protected]

Load Sensors causes all sensors attached to this GameObject hierarchy to be loaded and associated with this Mind. LoadSensors will begin at the root.

of the object hierarchy (travelling up from the Mind if necessary) and then traverse the tree to find all sensors.

virtual void RAIN.Core.Mind.LoseInterestIn ( string  symbol) [virtual]

LoseInterestIn will remove the specified Aspect symbol from the set of objects that can be detected by active Sensors. This is typically called through the Agent class.

Parameters:
symbolThe name of an Aspect to remove
virtual void RAIN.Core.Mind.Sense ( ) [virtual]

Sense tells your AI to process information from Sensors at this moment in time. Note that this is not a persistent method. You must call each time you need to update AI memory. This is typically called through the Agent class.

abstract void RAIN.Core.Mind.Think ( Agent  agent,
float  deltaTime 
) [pure virtual]

Think is called prior to Act. The purpose of Think is to do any processing, logical deliberation, decision making, or other calculation required as a precursor to action selection. RAIN supports the idea of Thinking about what you want, the determining how to Act.

Parameters:
agentThe AI agent this Mind is associated with
deltaTimetimestep in seconds

Implemented in RAIN.Minds.BehaviorTreeMind, and RAIN.Minds.SimpleMind.


Member Data Documentation

sensors is an array of Sensors registered with this AI. Usually sensors are registered by calling LoadSensors() in the Init() method