Package FAtiMA.ReactiveComponent
Class EmotionalReactionTreeNode
- java.lang.Object
-
- FAtiMA.ReactiveComponent.EmotionalReactionTreeNode
-
- All Implemented Interfaces:
FAtiMA.Core.IIntegrityTester,IReactionNode,java.io.Serializable,java.lang.Cloneable
public class EmotionalReactionTreeNode extends java.lang.Object implements java.io.Serializable, IReactionNode
Represents a Node in the emotional reaction tree, that is matched against incoming events. This class implements a very fast mechanism of finding emotional reaction rules that match with a given event.- Author:
- Joao Dias
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringactionNodestatic java.lang.Stringparam1Nodestatic java.lang.Stringparam2Nodestatic java.lang.Stringparam3Nodestatic java.lang.StringsubjectNodestatic java.lang.StringtargetNode
-
Constructor Summary
Constructors Constructor Description EmotionalReactionTreeNode(java.lang.String type)Creates a new EmotionalReactionTreeNodeEmotionalReactionTreeNode(java.lang.String type, java.lang.String value)Deprecated.do not use this constructor anymore, use EmotionalReactionTreeNode(String type) instead
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidAddEmotionalReaction(Reaction er)Adds an Emotional Reaction rule bellow this nodevoidCheckIntegrity(FAtiMA.Core.IntegrityValidator val)Checks the integrity of all emotional Reaction rules stored bellow the node, testing if one of them refers a SpeechAct not defined.java.lang.Objectclone()ReactiongetReaction(FAtiMA.Core.sensorEffector.Event e)ReactionMatchEvent(FAtiMA.Core.sensorEffector.Event e)Tries to match a given event with all Reaction rules stored under this node.java.lang.StringtoString()Converts the node to a String
-
-
-
Field Detail
-
actionNode
public static java.lang.String actionNode
-
subjectNode
public static java.lang.String subjectNode
-
targetNode
public static java.lang.String targetNode
-
param1Node
public static java.lang.String param1Node
-
param2Node
public static java.lang.String param2Node
-
param3Node
public static java.lang.String param3Node
-
-
Constructor Detail
-
EmotionalReactionTreeNode
public EmotionalReactionTreeNode(java.lang.String type, java.lang.String value)Deprecated.do not use this constructor anymore, use EmotionalReactionTreeNode(String type) insteadCreates a new EmotionalReactionTreeNode- Parameters:
type- - the type of the node: action,subject,target,nullvalue- - not used for anything
-
EmotionalReactionTreeNode
public EmotionalReactionTreeNode(java.lang.String type)
Creates a new EmotionalReactionTreeNode- Parameters:
type- - the type of the node: action,subject,target,null
-
-
Method Detail
-
AddEmotionalReaction
public void AddEmotionalReaction(Reaction er)
Adds an Emotional Reaction rule bellow this node- Parameters:
er- - the Reaction to add
-
CheckIntegrity
public void CheckIntegrity(FAtiMA.Core.IntegrityValidator val) throws FAtiMA.Core.exceptions.UnknownSpeechActExceptionChecks the integrity of all emotional Reaction rules stored bellow the node, testing if one of them refers a SpeechAct not defined. In that case, it throws an exception- Specified by:
CheckIntegrityin interfaceFAtiMA.Core.IIntegrityTester- Throws:
FAtiMA.Core.exceptions.UnknownSpeechActException
-
MatchEvent
public Reaction MatchEvent(FAtiMA.Core.sensorEffector.Event e)
Tries to match a given event with all Reaction rules stored under this node.- Parameters:
e- - the event o match againts the reaction rules- Returns:
- the appropriate reaction rule if a match is found, null otherwise
-
toString
public java.lang.String toString()
Converts the node to a String- Overrides:
toStringin classjava.lang.Object- Returns:
- the converted String
-
clone
public java.lang.Object clone()
- Specified by:
clonein interfaceIReactionNode- Overrides:
clonein classjava.lang.Object
-
getReaction
public Reaction getReaction(FAtiMA.Core.sensorEffector.Event e)
- Specified by:
getReactionin interfaceIReactionNode
-
-