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...
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 |
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.
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".
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] |
virtual void RAIN.Core.Mind.GainInterestIn | ( | string | symbol | ) | [virtual] |
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.
symbol | The name of the decoration name to filter by. This is the same as an Aspect name. |
aspects | An 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.
symbol | The symbol or name associated with an Aspect |
aspectObject | The 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.
agent | The AI agent this Mind is associated with |
Implemented in RAIN.Minds.BehaviorTreeMind, and RAIN.Minds.SimpleMind.
void RAIN.Core.Mind.LoadSensors | ( | Agent | agent | ) | [protected] |
virtual void RAIN.Core.Mind.LoseInterestIn | ( | string | symbol | ) | [virtual] |
virtual void RAIN.Core.Mind.Sense | ( | ) | [virtual] |
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.
agent | The AI agent this Mind is associated with |
deltaTime | timestep in seconds |
Implemented in RAIN.Minds.BehaviorTreeMind, and RAIN.Minds.SimpleMind.
Sensor [] RAIN.Core.Mind.sensors [protected] |
sensors is an array of Sensors registered with this AI. Usually sensors are registered by calling LoadSensors() in the Init() method