Class 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
    • Constructor Summary

      Constructors 
      Constructor Description
      EmotionalReactionTreeNode​(java.lang.String type)
      Creates a new EmotionalReactionTreeNode
      EmotionalReactionTreeNode​(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
      void AddEmotionalReaction​(Reaction er)
      Adds an Emotional Reaction rule bellow this node
      void CheckIntegrity​(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.Object clone()  
      Reaction getReaction​(FAtiMA.Core.sensorEffector.Event e)  
      Reaction MatchEvent​(FAtiMA.Core.sensorEffector.Event e)
      Tries to match a given event with all Reaction rules stored under this node.
      java.lang.String toString()
      Converts the node to a String
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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) instead
        Creates a new EmotionalReactionTreeNode
        Parameters:
        type - - the type of the node: action,subject,target,null
        value - - 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.UnknownSpeechActException
        Checks 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:
        CheckIntegrity in interface FAtiMA.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:
        toString in class java.lang.Object
        Returns:
        the converted String
      • clone

        public java.lang.Object clone()
        Specified by:
        clone in interface IReactionNode
        Overrides:
        clone in class java.lang.Object