Class Reaction

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

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

    Fields
    Modifier and Type
    Field
    Description
    protected Float
     
    protected Float
     
    protected FAtiMA.Core.sensorEffector.Event
     
    protected Float
     
    protected FAtiMA.Core.wellFormedNames.Symbol
     
    protected Float
     
  • Constructor Summary

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

    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.
     
    Gets the appraisal variable: Desirability of the event
    Gets the appraisal variable: DesirabilityForOther of the event
    FAtiMA.Core.sensorEffector.Event
    Gets the event referenced by the emotional reaction
     
    FAtiMA.Core.wellFormedNames.Symbol
    Gets the name of the character that the appraisal variable desirabilityForOther refers
    Gets the appraisal variable: Praiseworthiness of the event
    getReaction(FAtiMA.Core.sensorEffector.Event e)
     
    boolean
    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(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
    Sets the appraisal variable: Desirability
    void
    Sets the appraisal variable: DesirabilityForOther
    void
    setEvent(FAtiMA.Core.sensorEffector.Event event)
    Sets the event that the emotional reaction references
    void
     
    void
    Sets the appraisal variable: Praiseworhtiness
    Converts the emotional Reaction to a String

    Methods inherited from class java.lang.Object

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

    • _desirability

      protected Float _desirability
    • _desirabilityForOther

      protected Float _desirabilityForOther
    • _praiseworthiness

      protected Float _praiseworthiness
    • _like

      protected Float _like
    • _other

      protected FAtiMA.Core.wellFormedNames.Symbol _other
    • _event

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

    • 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(Float desirability, Float desirabilityForOther, 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 Details

    • 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 Float getDesirability()
      Gets the appraisal variable: Desirability of the event
      Returns:
      - the event's desirability
    • getDesirabilityForOther

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

      public Float getLike()
    • getEvent

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

      public 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(Float f)
      Sets the appraisal variable: Desirability
      Parameters:
      f - - the new value of Desirability for the reaction
    • setDesirabilityForOther

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

      public void setLike(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(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(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 Object clone()
      Specified by:
      clone in interface IReactionNode
      Overrides:
      clone in class Object
    • toString

      public String toString()
      Converts the emotional Reaction to a String
      Overrides:
      toString in class Object
      Returns:
      the converted String
    • getReaction

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