Package FAtiMA.Core.emotionalState
Class BaseEmotion
java.lang.Object
FAtiMA.Core.emotionalState.BaseEmotion
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ActiveEmotion,ElicitingEmotion,MemoryBaseEmotion,NeutralEmotion
Represents an emotion, which is an
instance of a particular Emotion Type
- Author:
- Joao Dias
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected String[]protected Eventprotected Nameprotected floatprotected final Stringprotected final EmotionValence -
Constructor Summary
ConstructorsModifierConstructorDescriptionCreates a new BaseEmotion that consists in a copy of a given emotionprotectedBaseEmotion(String type, EmotionValence valence, String[] appraisalVariables, float potential, Event cause) protectedBaseEmotion(String type, EmotionValence valence, String[] appraisalVariables, float potential, Event cause, Name direction) Creates a new BasicEmotion -
Method Summary
Modifier and TypeMethodDescriptionString[]GetCause()Gets the cause of the emotionGets the direction of the emotion (if the emotion directed to someone)Gets an hask key used to index this BaseEmotionfloatGets the emotion's potentialgetType()Gets the emotion's type see EmotionType enumerable for the set of possible emotion typesGets the emotion's valence (either positive or negative)inthashCode()Gets an HashCodevoidincreasePotential(float delta) voidSets the emotion's causevoidsetPotential(float potential) toString()Converts the BaseEmotion to a String
-
Field Details
-
_cause
-
_direction
-
_potential
protected float _potential -
_type
-
_valence
-
_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 typespotential- - the potential value for the intensity of the emotioncause- - the event that caused the emotiondirection- - 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
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
Gets the cause of the emotion- Returns:
- - the event that caused the emotion
-
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
-
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
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
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 -
SetCause
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
Converts the BaseEmotion to a String
-