Package FAtiMA.Core.emotionalState
Class BaseEmotion
- java.lang.Object
-
- FAtiMA.Core.emotionalState.BaseEmotion
-
- All Implemented Interfaces:
java.io.Serializable
- Direct Known Subclasses:
ActiveEmotion,ElicitingEmotion,MemoryBaseEmotion,NeutralEmotion
public class BaseEmotion extends java.lang.Object implements java.io.SerializableRepresents an emotion, which is an instance of a particular Emotion Type- Author:
- Joao Dias
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.String[]_appraisalVariablesprotected Event_causeprotected Name_directionprotected float_potentialprotected java.lang.String_typeprotected EmotionValence_valence
-
Constructor Summary
Constructors Modifier Constructor Description BaseEmotion(BaseEmotion em)Creates a new BaseEmotion that consists in a copy of a given emotionprotectedBaseEmotion(java.lang.String type, EmotionValence valence, java.lang.String[] appraisalVariables, float potential, Event cause)protectedBaseEmotion(java.lang.String type, EmotionValence valence, java.lang.String[] appraisalVariables, float potential, Event cause, Name direction)Creates a new BasicEmotion
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String[]GetAppraisalVariables()EventGetCause()Gets the cause of the emotionNameGetDirection()Gets the direction of the emotion (if the emotion directed to someone)java.lang.StringGetHashKey()Gets an hask key used to index this BaseEmotionfloatGetPotential()Gets the emotion's potentialjava.lang.StringgetType()Gets the emotion's type see EmotionType enumerable for the set of possible emotion typesEmotionValencegetValence()Gets the emotion's valence (either positive or negative)inthashCode()Gets an HashCodevoidincreasePotential(float delta)voidSetCause(Event cause)Sets the emotion's causevoidsetPotential(float potential)java.lang.StringtoString()Converts the BaseEmotion to a String
-
-
-
Field Detail
-
_cause
protected Event _cause
-
_direction
protected Name _direction
-
_potential
protected float _potential
-
_type
protected final java.lang.String _type
-
_valence
protected final EmotionValence _valence
-
_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 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(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:
hashCodein classjava.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:
toStringin classjava.lang.Object- Returns:
- the converted String
-
-