Class EmotionalReactionTreeNode

java.lang.Object
FAtiMA.ReactiveComponent.EmotionalReactionTreeNode
All Implemented Interfaces:
FAtiMA.Core.IIntegrityTester, IReactionNode, Serializable, Cloneable

public class EmotionalReactionTreeNode extends Object implements 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:
  • Field Details

    • actionNode

      public static String actionNode
    • subjectNode

      public static String subjectNode
    • targetNode

      public static String targetNode
    • param1Node

      public static String param1Node
    • param2Node

      public static String param2Node
    • param3Node

      public static String param3Node
  • Constructor Details

    • EmotionalReactionTreeNode

      public EmotionalReactionTreeNode(String type, 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(String type)
      Creates a new EmotionalReactionTreeNode
      Parameters:
      type - - the type of the node: action,subject,target,null
  • Method Details

    • 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 String toString()
      Converts the node to a String
      Overrides:
      toString in class Object
      Returns:
      the converted String
    • clone

      public Object clone()
      Specified by:
      clone in interface IReactionNode
      Overrides:
      clone in class Object
    • getReaction

      public Reaction getReaction(FAtiMA.Core.sensorEffector.Event e)
      Specified by:
      getReaction in interface IReactionNode