Package FAtiMA.Core

Class ValuedAction

  • All Implemented Interfaces:
    java.io.Serializable

    public class ValuedAction
    extends java.lang.Object
    implements java.io.Serializable
    Action 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 Detail

      • ValuedAction

        public ValuedAction​(java.lang.String component,
                            Name action,
                            ActiveEmotion emotion)
        Creates a new ValuedAction
        Parameters:
        action - - the action
        emotion - - 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:
        toString in class java.lang.Object
        Returns:
        the converted String