Class BaseEmotion

    • Field Detail

      • _cause

        protected Event _cause
      • _direction

        protected Name _direction
      • _potential

        protected float _potential
      • _type

        protected final java.lang.String _type
      • _appraisalVariables

        protected java.lang.String[] _appraisalVariables
    • Constructor Detail

      • BaseEmotion

        protected BaseEmotion​(java.lang.String type,
                              EmotionValence valence,
                              java.lang.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​(java.lang.String type,
                              EmotionValence valence,
                              java.lang.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 Detail

      • 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 java.lang.String[] GetAppraisalVariables()
      • GetHashKey

        public java.lang.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 java.lang.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:
        enumerable
      • hashCode

        public int hashCode()
        Gets an HashCode
        Overrides:
        hashCode in class java.lang.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 java.lang.String toString()
        Converts the BaseEmotion to a String
        Overrides:
        toString in class java.lang.Object
        Returns:
        the converted String