Class ActionTendencies

  • All Implemented Interfaces:
    java.io.Serializable, java.lang.Cloneable

    public class ActionTendencies
    extends java.lang.Object
    implements java.io.Serializable, java.lang.Cloneable
    Implements a character's set of Action Tendencies and implements the selection mechanism
    Author:
    Joao Dias
    See Also:
    Serialized Form
    • Field Summary

      Fields 
      Modifier and Type Field Description
      protected java.util.ArrayList<Action> _actions  
      protected java.util.HashMap<java.lang.String,​java.lang.Long> _filteredActions  
    • Constructor Summary

      Constructors 
      Constructor Description
      ActionTendencies()
      Create a new ActionTendenciesSet
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void AddAction​(Action action)
      Adds a Action to the ActionTendencies Set
      void CheckIntegrity​(FAtiMA.Core.IntegrityValidator val)
      Checks the Integrity of all the actions by testing if any of them refers to a SpeechAct not defined
      void ClearFilters()  
      java.lang.Object clone()  
      java.util.ArrayList<Action> getActions()  
      void IgnoreActionForDuration​(FAtiMA.Core.ValuedAction va, long time)
      Temporarly deactives an action tendency.
      protected boolean isIgnored​(FAtiMA.Core.ValuedAction va)  
      void Print()  
      FAtiMA.Core.emotionalState.BaseEmotion RecognizeEmotion​(FAtiMA.Core.AgentModel am, FAtiMA.Core.wellFormedNames.Name action)  
      void ReinforceActionTendency​(java.lang.String action)  
      FAtiMA.Core.ValuedAction SelectAction​(FAtiMA.Core.AgentModel am)
      Selects the most appropriate ActionTendency given the character's emotional state
      • Methods inherited from class java.lang.Object

        equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • _actions

        protected java.util.ArrayList<Action> _actions
      • _filteredActions

        protected java.util.HashMap<java.lang.String,​java.lang.Long> _filteredActions
    • Constructor Detail

      • ActionTendencies

        public ActionTendencies()
        Create a new ActionTendenciesSet
    • Method Detail

      • AddAction

        public void AddAction​(Action action)
        Adds a Action to the ActionTendencies Set
        Parameters:
        action -
      • getActions

        public java.util.ArrayList<Action> getActions()
      • CheckIntegrity

        public void CheckIntegrity​(FAtiMA.Core.IntegrityValidator val)
                            throws FAtiMA.Core.exceptions.UnknownSpeechActException
        Checks the Integrity of all the actions by testing if any of them refers to a SpeechAct not defined
        Parameters:
        val - - an IntegrityValidator used do detect undefined speechActs
        Throws:
        FAtiMA.Core.exceptions.UnknownSpeechActException - - thrown when an action references a SpeechAct not defined
        See Also:
        IntegrityValidator
      • IgnoreActionForDuration

        public void IgnoreActionForDuration​(FAtiMA.Core.ValuedAction va,
                                            long time)
        Temporarly deactives an action tendency. It means that even if the action's preconditions and emotions are verified, the action is not selected for execution
        Parameters:
        va - - the action tendency to be deactivated
        time - - the amount of time that the action should be deactivated
      • ClearFilters

        public void ClearFilters()
      • isIgnored

        protected boolean isIgnored​(FAtiMA.Core.ValuedAction va)
      • SelectAction

        public FAtiMA.Core.ValuedAction SelectAction​(FAtiMA.Core.AgentModel am)
        Selects the most appropriate ActionTendency given the character's emotional state
        Parameters:
        am - - the agent's emotional state that influences the actions performed
        Returns:
        the most relevant Action (according to the emotional state)
      • RecognizeEmotion

        public FAtiMA.Core.emotionalState.BaseEmotion RecognizeEmotion​(FAtiMA.Core.AgentModel am,
                                                                       FAtiMA.Core.wellFormedNames.Name action)
      • ReinforceActionTendency

        public void ReinforceActionTendency​(java.lang.String action)
      • Print

        public void Print()
      • clone

        public java.lang.Object clone()
        Overrides:
        clone in class java.lang.Object