Class DeliberativeComponent

  • All Implemented Interfaces:
    FAtiMA.Core.componentTypes.IAdvancedPerceptionsComponent, FAtiMA.Core.componentTypes.IAppraisalDerivationComponent, FAtiMA.Core.componentTypes.IBehaviourComponent, FAtiMA.Core.componentTypes.IComponent, FAtiMA.Core.componentTypes.IModelOfOtherComponent, FAtiMA.Core.componentTypes.IProcessExternalRequestComponent, IOptionsStrategy, IExpectedUtilityStrategy, java.io.Serializable

    public class DeliberativeComponent
    extends java.lang.Object
    implements java.io.Serializable, FAtiMA.Core.componentTypes.IComponent, FAtiMA.Core.componentTypes.IBehaviourComponent, FAtiMA.Core.componentTypes.IModelOfOtherComponent, FAtiMA.Core.componentTypes.IAppraisalDerivationComponent, FAtiMA.Core.componentTypes.IAdvancedPerceptionsComponent, FAtiMA.Core.componentTypes.IProcessExternalRequestComponent, IOptionsStrategy, IExpectedUtilityStrategy
    Implements the Agent's Architecture deliberative processes (deliberative appraisal + problem-focused coping/emotion-focused coping).
    Author:
    Joao Dias
    See Also:
    Serialized Form
    • Constructor Detail

      • DeliberativeComponent

        public DeliberativeComponent()
        Creates a new DeliberativeProcess
    • Method Detail

      • actionFailedPerception

        public void actionFailedPerception​(FAtiMA.Core.sensorEffector.Event e)
        Specified by:
        actionFailedPerception in interface FAtiMA.Core.componentTypes.IAdvancedPerceptionsComponent
      • actionSelectedForExecution

        public void actionSelectedForExecution​(FAtiMA.Core.ValuedAction selectedAction)
        Specified by:
        actionSelectedForExecution in interface FAtiMA.Core.componentTypes.IBehaviourComponent
      • actionSelection

        public FAtiMA.Core.ValuedAction actionSelection​(FAtiMA.Core.AgentModel am)
        Deliberative Coping process. Gets the most relevant intention, thinks about it for one reasoning cycle (planning) and if possible selects an action for execution.
        Specified by:
        actionSelection in interface FAtiMA.Core.componentTypes.IBehaviourComponent
      • addGoal

        public void addGoal​(FAtiMA.Core.AgentModel am,
                            java.lang.String goalName)
                     throws FAtiMA.Core.exceptions.UnknownGoalException
        Adds a goal to the agent's Goal List
        Parameters:
        am -
        goalName - - the name of the Goal
        Throws:
        FAtiMA.Core.exceptions.UnknownGoalException - - thrown if the goal is not specified in the GoalLibrary file. You can only add goals defined in the GoalLibrary.
      • addGoal

        public void addGoal​(FAtiMA.Core.AgentModel am,
                            java.lang.String goalName,
                            float importanceOfSuccess,
                            float importanceOfFailure)
                     throws FAtiMA.Core.exceptions.UnknownGoalException
        Adds a goal to the agent's Goal List
        Parameters:
        goalName - - the name of the Goal
        importanceOfSuccess - - the goal's importance of success
        importanceOfFailure - - the goal's importance of failure
        Throws:
        FAtiMA.Core.exceptions.UnknownGoalException - - thrown if the goal is not specified in the GoalLibrary file. You can only add goals defined in the GoalLibrary.
      • addGoal

        public void addGoal​(FAtiMA.Core.goals.Goal goal)
        Adds a goal to the agent's Goal List
        Parameters:
        goal - - the goal to add
      • addIntention

        public void addIntention​(FAtiMA.Core.AgentModel am,
                                 FAtiMA.Core.goals.ActivePursuitGoal goal)
        Creates and Adds an intention to the set of intentions that the planner is currently trying to achieve (however the planner only picks one of them at each reasoning cycle)
        Parameters:
        goal - - the goal that we want to add
      • addOptionsStrategy

        public void addOptionsStrategy​(IOptionsStrategy strategy)
      • addProtectionConstraint

        public void addProtectionConstraint​(FAtiMA.Core.plans.ProtectedCondition cond)
        Adds a ProtectionConstraint to the DeliberativeLayer. The planner will detect when there are threats to these ProtectionConstraints and deal with them with emotion-focused coping strategies.
        Parameters:
        cond - - the ProtectedCondition to add
        See Also:
        ProtectedCondition
      • addSubIntention

        public void addSubIntention​(FAtiMA.Core.AgentModel am,
                                    Intention mainIntention,
                                    FAtiMA.Core.goals.ActivePursuitGoal goal)
      • appraisal

        public void appraisal​(FAtiMA.Core.AgentModel am,
                              FAtiMA.Core.sensorEffector.Event e,
                              FAtiMA.Core.emotionalState.AppraisalFrame as)
        Specified by:
        appraisal in interface FAtiMA.Core.componentTypes.IAppraisalDerivationComponent
      • changeGoalImportance

        public void changeGoalImportance​(FAtiMA.Core.AgentModel am,
                                         java.lang.String goalName,
                                         float importance,
                                         java.lang.String importanceType)
        Changes a Goal's Importance
        Parameters:
        goalName - - the name of the goal to change
        importance - - the new value for the importance
        importanceType - - the type of importance: the String "CIS" changes the importance of success the String "CIF" changes the importance of failure
      • checkLinks

        public void checkLinks​(FAtiMA.Core.AgentModel am)
        Updates all the plans that the deliberative layer is currently working with, i.e., it updates all plans of all current active intentions
      • containsIntention

        public boolean containsIntention​(FAtiMA.Core.goals.ActivePursuitGoal goal)
      • createDisplayPanel

        public FAtiMA.Core.Display.AgentDisplayPanel createDisplayPanel​(FAtiMA.Core.AgentModel am)
        Specified by:
        createDisplayPanel in interface FAtiMA.Core.componentTypes.IComponent
      • createModelOfOther

        public FAtiMA.Core.componentTypes.IComponent createModelOfOther()
        Specified by:
        createModelOfOther in interface FAtiMA.Core.componentTypes.IModelOfOtherComponent
      • entityRemovedPerception

        public void entityRemovedPerception​(java.lang.String entity)
        Specified by:
        entityRemovedPerception in interface FAtiMA.Core.componentTypes.IAdvancedPerceptionsComponent
      • filter

        public FAtiMA.Core.goals.ActivePursuitGoal filter​(FAtiMA.Core.AgentModel am,
                                                          java.util.ArrayList<FAtiMA.Core.goals.ActivePursuitGoal> options)
      • filter2ndLevel

        public Intention filter2ndLevel​(FAtiMA.Core.AgentModel am)
        Filters the most relevant intention from the set of possible intentions/goals. Corresponds to Focusing on a given goal
        Returns:
        - the most relevant intention (the one with highest expected utility)
      • getComponentDependencies

        public java.lang.String[] getComponentDependencies()
        Specified by:
        getComponentDependencies in interface FAtiMA.Core.componentTypes.IComponent
      • getEmotionalPlanner

        public EmotionalPlanner getEmotionalPlanner()
        Gets the agent's emotional planner used in the deliberative reasoning process
        Returns:
        the agent's EmotionalPlanner
      • getGoals

        public java.util.ArrayList<FAtiMA.Core.goals.Goal> getGoals()
        Gets the agent's goals
        Returns:
        a list with the agent's goals
      • getIntentionKeysSet

        public java.util.Set<java.lang.String> getIntentionKeysSet()
        Gets a set of IntentionKeys
        Returns:
        a set with the keys used to store all intentions
      • getIntentionsIterator

        public java.util.Iterator<Intention> getIntentionsIterator()
        Gets a iterator that allows you to iterate over the set of active Intentions
        Returns:
        iterator
      • initialize

        public void initialize​(FAtiMA.Core.AgentModel ag)
        Specified by:
        initialize in interface FAtiMA.Core.componentTypes.IComponent
      • inverseAppraisal

        public void inverseAppraisal​(FAtiMA.Core.AgentModel am,
                                     FAtiMA.Core.emotionalState.AppraisalFrame af)
        Specified by:
        inverseAppraisal in interface FAtiMA.Core.componentTypes.IAppraisalDerivationComponent
      • lookAtPerception

        public void lookAtPerception​(FAtiMA.Core.AgentCore ag,
                                     java.lang.String subject,
                                     java.lang.String target)
        Specified by:
        lookAtPerception in interface FAtiMA.Core.componentTypes.IAdvancedPerceptionsComponent
      • name

        public java.lang.String name()
        Specified by:
        name in interface FAtiMA.Core.componentTypes.IComponent
      • options

        public java.util.ArrayList<FAtiMA.Core.goals.ActivePursuitGoal> options​(FAtiMA.Core.AgentModel am)
        Specified by:
        options in interface IOptionsStrategy
      • processExternalRequest

        public void processExternalRequest​(FAtiMA.Core.AgentModel am,
                                           java.lang.String type,
                                           java.lang.String perception)
        Specified by:
        processExternalRequest in interface FAtiMA.Core.componentTypes.IProcessExternalRequestComponent
      • propertyChangedPerception

        public void propertyChangedPerception​(java.lang.String ToM,
                                              FAtiMA.Core.wellFormedNames.Name propertyName,
                                              java.lang.String value)
        Specified by:
        propertyChangedPerception in interface FAtiMA.Core.componentTypes.IAdvancedPerceptionsComponent
      • reappraisal

        public FAtiMA.Core.emotionalState.AppraisalFrame reappraisal​(FAtiMA.Core.AgentModel am)
        Specified by:
        reappraisal in interface FAtiMA.Core.componentTypes.IAppraisalDerivationComponent
      • removeAllGoals

        public void removeAllGoals()
        Removes all the agent's goals
      • removeGoal

        public void removeGoal​(java.lang.String goalName)
        Removes a given goal from the agent's goal list
        Parameters:
        goalName - - the name of the goal to remove
      • removeIntention

        public void removeIntention​(Intention i)
      • reset

        public void reset()
        Resets the deliberative layer. Clears the events to be appraised, the current intentions and actions.
        Specified by:
        reset in interface FAtiMA.Core.componentTypes.IComponent
      • setUtilityForOthersStrategy

        public void setUtilityForOthersStrategy​(IGetUtilityForOthers strat)
      • setUtilityStrategy

        public void setUtilityStrategy​(IUtilityStrategy strategy)
      • update

        public void update​(FAtiMA.Core.AgentModel am,
                           FAtiMA.Core.sensorEffector.Event event)
        Specified by:
        update in interface FAtiMA.Core.componentTypes.IComponent
      • update

        public void update​(FAtiMA.Core.AgentModel am,
                           long time)
        Specified by:
        update in interface FAtiMA.Core.componentTypes.IComponent
      • ResetIntention

        public void ResetIntention​(FAtiMA.Core.AgentModel am)
      • updateProbabilities

        public void updateProbabilities()
        Forces the recalculation of all plan's probability