Class BaseEmotion

java.lang.Object
FAtiMA.Core.emotionalState.BaseEmotion
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ActiveEmotion, ElicitingEmotion, MemoryBaseEmotion, NeutralEmotion

public class BaseEmotion extends Object implements Serializable
Represents an emotion, which is an instance of a particular Emotion Type
Author:
Joao Dias
See Also:
  • Field Details

    • _cause

      protected Event _cause
    • _direction

      protected Name _direction
    • _potential

      protected float _potential
    • _type

      protected final String _type
    • _valence

      protected final EmotionValence _valence
    • _appraisalVariables

      protected String[] _appraisalVariables
  • Constructor Details

    • BaseEmotion

      protected BaseEmotion(String type, EmotionValence valence, String[] appraisalVariables, float potential, Event cause, Name direction)
      Creates a new BasicEmotion
      Parameters:
      type - - the type of the Emotion (ex: Hope, Distress). use the enumerable EmotionType for the possible set of emotion types
      potential - - the potential value for the intensity of the emotion
      cause - - the event that caused the emotion
      direction - - if the emotion is targeted to someone (ex: angry with Luke), this parameter specifies the target
    • BaseEmotion

      protected BaseEmotion(String type, EmotionValence valence, String[] appraisalVariables, float potential, Event cause)
    • BaseEmotion

      public BaseEmotion(BaseEmotion em)
      Creates a new BaseEmotion that consists in a copy of a given emotion
      Parameters:
      em - - the emotion that will be copied into our new emotion
  • Method Details

    • GetCause

      public Event GetCause()
      Gets the cause of the emotion
      Returns:
      - the event that caused the emotion
    • GetDirection

      public Name GetDirection()
      Gets the direction of the emotion (if the emotion directed to someone)
      Returns:
      - the name of the character to whom this emotion is directed
    • GetAppraisalVariables

      public String[] GetAppraisalVariables()
    • GetHashKey

      public String GetHashKey()
      Gets an hask key used to index this BaseEmotion
      Returns:
      - a String used to index the BaseEMotion
    • GetPotential

      public float GetPotential()
      Gets the emotion's potential
      Returns:
      - the potential for the intensity of the emotion
    • getType

      public String getType()
      Gets the emotion's type see EmotionType enumerable for the set of possible emotion types
      Returns:
      a short value corresponding to the EmotionType enumerable
    • getValence

      public EmotionValence getValence()
      Gets the emotion's valence (either positive or negative)
      Returns:
      a short value corresponding to the EmotionValence enumerable
      See Also:
    • hashCode

      public int hashCode()
      Gets an HashCode
      Overrides:
      hashCode in class Object
      Returns:
      an int that can be used as hashcode
    • SetCause

      public void SetCause(Event cause)
      Sets the emotion's cause
      Parameters:
      cause - - the event that caused the emotion
    • increasePotential

      public void increasePotential(float delta)
    • setPotential

      public void setPotential(float potential)
    • toString

      public String toString()
      Converts the BaseEmotion to a String
      Overrides:
      toString in class Object
      Returns:
      the converted String