Package FAtiMA.Core.emotionalState
Class ActiveEmotion
- java.lang.Object
-
- FAtiMA.Core.emotionalState.BaseEmotion
-
- FAtiMA.Core.emotionalState.ActiveEmotion
-
- All Implemented Interfaces:
java.io.Serializable
public class ActiveEmotion extends BaseEmotion
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:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected java.lang.Object_baseEmotionClassprotected int_decayprotected float_intensityprotected int_threshold-
Fields inherited from class FAtiMA.Core.emotionalState.BaseEmotion
_appraisalVariables, _cause, _direction, _potential, _type, _valence
-
-
Constructor Summary
Constructors Constructor Description ActiveEmotion(BaseEmotion potEm, float potential, int threshold, int decay)Creates a new ActiveEmotion
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description floatDecayEmotion()Decays the emotion according to the system's timerjava.lang.ObjectgetBaseEmotionClass()floatGetIntensity()Gets the emotion's intensityfloatGetPotential()Gets 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 emotionjava.lang.StringtoXml()Converts the ActiveEmotion to XMl-
Methods inherited from class FAtiMA.Core.emotionalState.BaseEmotion
GetAppraisalVariables, GetCause, GetDirection, GetHashKey, getType, getValence, hashCode, increasePotential, SetCause, setPotential, toString
-
-
-
-
Constructor Detail
-
ActiveEmotion
public ActiveEmotion(BaseEmotion potEm, float potential, int threshold, int decay)
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 Detail
-
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
public java.lang.Object 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
public java.lang.String toXml()
Converts the ActiveEmotion to XMl- Returns:
- a XML String that contains all information about the ActiveEmotion
-
-