Class Reaction

  • All Implemented Interfaces:
    FAtiMA.Core.IIntegrityTester, FAtiMA.Core.wellFormedNames.IGroundable, IReactionNode, java.io.Serializable, java.lang.Cloneable

    public class Reaction
    extends java.lang.Object
    implements java.io.Serializable, FAtiMA.Core.wellFormedNames.IGroundable, IReactionNode
    Represents an Emotional Reaction based in Construal Frames that specify values for some of OCC's appraisal variables: Desirability, DesirabilityForOther, Like and Praiseworthiness.
    Author:
    Joao Dias
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Reaction()
      Creates a new empty Emotional Reaction
      Reaction​(FAtiMA.Core.sensorEffector.Event event)
      Creates a new empty Emotional Reaction
      Reaction​(java.lang.Float desirability, java.lang.Float desirabilityForOther, java.lang.Float praiseworthiness, FAtiMA.Core.wellFormedNames.Symbol other)
      Creates a new Emotional Reaction
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void CheckIntegrity​(FAtiMA.Core.IntegrityValidator val)
      Checks the integrity of the Reaction by testing if the reaction references an event with an speechAct not defined.
      java.lang.Object clone()  
      java.lang.Float getDesirability()
      Gets the appraisal variable: Desirability of the event
      java.lang.Float getDesirabilityForOther()
      Gets the appraisal variable: DesirabilityForOther of the event
      FAtiMA.Core.sensorEffector.Event getEvent()
      Gets the event referenced by the emotional reaction
      java.lang.Float getLike()  
      FAtiMA.Core.wellFormedNames.Symbol getOther()
      Gets the name of the character that the appraisal variable desirabilityForOther refers
      java.lang.Float getPraiseworthiness()
      Gets the appraisal variable: Praiseworthiness of the event
      Reaction getReaction​(FAtiMA.Core.sensorEffector.Event e)  
      boolean isGrounded()
      Indicates if the Predicate is grounded (no unbound variables in it's WFN) Example: Stronger(Luke,John) is grounded while Stronger(John,[X]) is not.
      void MakeGround​(FAtiMA.Core.wellFormedNames.Substitution subst)
      Applies a set of substitutions to the object, grounding it.
      void MakeGround​(java.util.ArrayList<FAtiMA.Core.wellFormedNames.Substitution> bindings)
      Applies a set of substitutions to the object, grounding it.
      boolean MatchEvent​(FAtiMA.Core.sensorEffector.Event eventPerception)
      tests if a given event matches the emotional Reaction
      void ReplaceUnboundVariables​(int variableID)
      Replaces all unbound variables in the object by applying a numeric identifier to each one.
      void setDesirability​(java.lang.Float f)
      Sets the appraisal variable: Desirability
      void setDesirabilityForOther​(java.lang.Float f)
      Sets the appraisal variable: DesirabilityForOther
      void setEvent​(FAtiMA.Core.sensorEffector.Event event)
      Sets the event that the emotional reaction references
      void setLike​(java.lang.Float f)  
      void setPraiseworthiness​(java.lang.Float f)
      Sets the appraisal variable: Praiseworhtiness
      java.lang.String toString()
      Converts the emotional Reaction to a String
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Field Detail

      • _desirability

        protected java.lang.Float _desirability
      • _desirabilityForOther

        protected java.lang.Float _desirabilityForOther
      • _praiseworthiness

        protected java.lang.Float _praiseworthiness
      • _like

        protected java.lang.Float _like
      • _other

        protected FAtiMA.Core.wellFormedNames.Symbol _other
      • _event

        protected FAtiMA.Core.sensorEffector.Event _event
    • Constructor Detail

      • Reaction

        public Reaction()
        Creates a new empty Emotional Reaction
      • Reaction

        public Reaction​(FAtiMA.Core.sensorEffector.Event event)
        Creates a new empty Emotional Reaction
        Parameters:
        event - - the event that this reaction references
      • Reaction

        public Reaction​(java.lang.Float desirability,
                        java.lang.Float desirabilityForOther,
                        java.lang.Float praiseworthiness,
                        FAtiMA.Core.wellFormedNames.Symbol other)
        Creates a new Emotional Reaction
        Parameters:
        desirability - - the desirability of the event
        desirabilityForOther - - the desirability of the event for other agents
        praiseworthiness - - the paiseworthiness of the event
        other - - which character does the desirabilityForOther variable reference
    • Method Detail

      • CheckIntegrity

        public void CheckIntegrity​(FAtiMA.Core.IntegrityValidator val)
                            throws FAtiMA.Core.exceptions.UnknownSpeechActException
        Checks the integrity of the Reaction by testing if the reaction references an event with an speechAct not defined. In this case it throws the exception.
        Specified by:
        CheckIntegrity in interface FAtiMA.Core.IIntegrityTester
        Throws:
        FAtiMA.Core.exceptions.UnknownSpeechActException
      • getDesirability

        public java.lang.Float getDesirability()
        Gets the appraisal variable: Desirability of the event
        Returns:
        - the event's desirability
      • getDesirabilityForOther

        public java.lang.Float getDesirabilityForOther()
        Gets the appraisal variable: DesirabilityForOther of the event
        Returns:
        - the event's desirability for other agent
      • getLike

        public java.lang.Float getLike()
      • getEvent

        public FAtiMA.Core.sensorEffector.Event getEvent()
        Gets the event referenced by the emotional reaction
        Returns:
        the reaction's event
      • getPraiseworthiness

        public java.lang.Float getPraiseworthiness()
        Gets the appraisal variable: Praiseworthiness of the event
        Returns:
        - the event's praiseworthiness for the agent
      • getOther

        public FAtiMA.Core.wellFormedNames.Symbol getOther()
        Gets the name of the character that the appraisal variable desirabilityForOther refers
        Returns:
        - the name of the desirabilityForOther's character
      • MatchEvent

        public boolean MatchEvent​(FAtiMA.Core.sensorEffector.Event eventPerception)
        tests if a given event matches the emotional Reaction
        Parameters:
        eventPerception - - the event to test with the Reaction
        Returns:
        true if the event corresponds to the emotional Reaction, false otherwise
      • setDesirability

        public void setDesirability​(java.lang.Float f)
        Sets the appraisal variable: Desirability
        Parameters:
        f - - the new value of Desirability for the reaction
      • setDesirabilityForOther

        public void setDesirabilityForOther​(java.lang.Float f)
        Sets the appraisal variable: DesirabilityForOther
        Parameters:
        f - - the new value of DesirabilityForOther for the reaction
      • setLike

        public void setLike​(java.lang.Float f)
      • setEvent

        public void setEvent​(FAtiMA.Core.sensorEffector.Event event)
        Sets the event that the emotional reaction references
        Parameters:
        event - - the new event referenced by the reaction
      • setPraiseworthiness

        public void setPraiseworthiness​(java.lang.Float f)
        Sets the appraisal variable: Praiseworhtiness
        Parameters:
        f - - the new value of Praiseworthiness for the reaction
      • ReplaceUnboundVariables

        public void ReplaceUnboundVariables​(int variableID)
        Replaces all unbound variables in the object by applying a numeric identifier to each one. For example, the variable [x] becomes [x4] if the received ID is 4. Attention, this method modifies the original object.
        Specified by:
        ReplaceUnboundVariables in interface FAtiMA.Core.wellFormedNames.IGroundable
        Parameters:
        variableID - - the identifier to be applied
      • MakeGround

        public void MakeGround​(java.util.ArrayList<FAtiMA.Core.wellFormedNames.Substitution> bindings)
        Applies a set of substitutions to the object, grounding it. Example: Applying the substitution "[X]/John" in the name "Weak([X])" returns "Weak(John)". Attention, this method modifies the original object.
        Specified by:
        MakeGround in interface FAtiMA.Core.wellFormedNames.IGroundable
        Parameters:
        bindings - - A list of substitutions of the type "[Variable]/value"
        See Also:
        Substitution
      • MakeGround

        public void MakeGround​(FAtiMA.Core.wellFormedNames.Substitution subst)
        Applies a set of substitutions to the object, grounding it. Example: Applying the substitution "[X]/John" in the name "Weak([X])" returns "Weak(John)". Attention, this method modifies the original object.
        Specified by:
        MakeGround in interface FAtiMA.Core.wellFormedNames.IGroundable
        Parameters:
        subst - - a substitution of the type "[Variable]/value"
        See Also:
        Substitution
      • isGrounded

        public boolean isGrounded()
        Indicates if the Predicate is grounded (no unbound variables in it's WFN) Example: Stronger(Luke,John) is grounded while Stronger(John,[X]) is not.
        Specified by:
        isGrounded in interface FAtiMA.Core.wellFormedNames.IGroundable
        Returns:
        true if the Predicate is grounded, false otherwise
      • clone

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

        public java.lang.String toString()
        Converts the emotional Reaction to a String
        Overrides:
        toString in class java.lang.Object
        Returns:
        the converted String