Package FAtiMA.Core.emotionalState
Class ActiveEmotion
java.lang.Object
FAtiMA.Core.emotionalState.BaseEmotion
FAtiMA.Core.emotionalState.ActiveEmotion
- All Implemented Interfaces:
Serializable
Represents an Emotion with intensity that is active in the character's
emotional state, i.e, the character is feeling the emotion
- Author:
- Joao Dias
- See Also:
-
Field Summary
FieldsFields inherited from class FAtiMA.Core.emotionalState.BaseEmotion
_appraisalVariables, _cause, _direction, _potential, _type, _valence -
Constructor Summary
ConstructorsConstructorDescriptionActiveEmotion(BaseEmotion potEm, float potential, int threshold, int decay) Creates a new ActiveEmotion -
Method Summary
Modifier and TypeMethodDescriptionfloatDecays the emotion according to the system's timerfloatGets the emotion's intensityfloatGets the emotion's potentialvoidReforceEmotion(float potential) Reforces the intensity of the emotion by a given potentialvoidSetDecay(int decay) Sets the decay rate for the emotionvoidSetIntensity(float potential) Sets the intensity of the emotionvoidSetThreshold(int threshold) Sets the threshold for the specific emotiontoXml()Converts the ActiveEmotion to XMlMethods inherited from class FAtiMA.Core.emotionalState.BaseEmotion
GetAppraisalVariables, GetCause, GetDirection, GetHashKey, getType, getValence, hashCode, increasePotential, SetCause, setPotential, toString
-
Field Details
-
_decay
protected int _decay -
_intensity
protected float _intensity -
_threshold
protected int _threshold -
_baseEmotionClass
-
-
Constructor Details
-
ActiveEmotion
Creates a new ActiveEmotion- Parameters:
potEm- - the BaseEmotion that is the base for this ActiveEmotionpotential- - the potential for the intensity of the emotionthreshold- - the threshold for the specific emotiondecay- - the decay rate for the specific emotion
-
-
Method Details
-
DecayEmotion
public float DecayEmotion()Decays the emotion according to the system's timer- Returns:
- the intensity of the emotion after being decayed
-
GetIntensity
public float GetIntensity()Gets the emotion's intensity- Returns:
- the intensity of the emotion
-
getBaseEmotionClass
-
ReforceEmotion
public void ReforceEmotion(float potential) Reforces the intensity of the emotion by a given potential- Parameters:
potential- - the potential for the reinformcement of the emotion's intensity
-
SetDecay
public void SetDecay(int decay) Sets the decay rate for the emotion- Parameters:
decay- - the new decay rate (ranged between 1 and 10)
-
SetIntensity
public void SetIntensity(float potential) Sets the intensity of the emotion- Parameters:
potential- - the potential for the emotion's intensity
-
GetPotential
public float GetPotential()Gets the emotion's potential- Overrides:
GetPotentialin classBaseEmotion- Returns:
- - the potential for the intensity of the emotion
-
SetThreshold
public void SetThreshold(int threshold) Sets the threshold for the specific emotion- Parameters:
threshold- - the new threshold (ranged between 1 and 10)
-
toXml
Converts the ActiveEmotion to XMl- Returns:
- a XML String that contains all information about the ActiveEmotion
-