Package FAtiMA.Core
Class ValuedAction
- java.lang.Object
-
- FAtiMA.Core.ValuedAction
-
- All Implemented Interfaces:
java.io.Serializable
public class ValuedAction extends java.lang.Object implements java.io.SerializableAction that has associated with it an emotion. This emotion was responsible in part for the selection of the action, and can be used to select between conflicting actions. The action supported by the strongest emotion wins.- Author:
- Joao Dias
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ValuedAction(java.lang.String component, Name action, float value)ValuedAction(java.lang.String component, Name action, ActiveEmotion emotion)Creates a new ValuedAction
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description NamegetAction()Gets the Action's namejava.lang.StringgetComponent()ActiveEmotiongetEmotion(EmotionalState es)Gets the Emotion that supports this actionfloatgetValue(EmotionalState es)Gets an emotional value associated with the actionvoidsetEmotion(ActiveEmotion emotion)Sets the Emotion associated with the actionjava.lang.StringtoString()Converts the ValuedAction to a String
-
-
-
Constructor Detail
-
ValuedAction
public ValuedAction(java.lang.String component, Name action, ActiveEmotion emotion)Creates a new ValuedAction- Parameters:
action- - the actionemotion- - the emotion associated to the action
-
ValuedAction
public ValuedAction(java.lang.String component, Name action, float value)
-
-
Method Detail
-
getComponent
public java.lang.String getComponent()
-
getAction
public Name getAction()
Gets the Action's name- Returns:
- the action to perform
-
getEmotion
public ActiveEmotion getEmotion(EmotionalState es)
Gets the Emotion that supports this action- Returns:
- the Emotion associated with the action
-
getValue
public float getValue(EmotionalState es)
Gets an emotional value associated with the action- Returns:
- a float representing how emotionally important is the action
-
setEmotion
public void setEmotion(ActiveEmotion emotion)
Sets the Emotion associated with the action- Parameters:
emotion- - the new ActiveEmotion to associate to the action
-
toString
public java.lang.String toString()
Converts the ValuedAction to a String- Overrides:
toStringin classjava.lang.Object- Returns:
- the converted String
-
-