Class MotivationalComponent

java.lang.Object
FAtiMA.motivationalSystem.MotivationalComponent
All Implemented Interfaces:
FAtiMA.Core.componentTypes.IAppraisalDerivationComponent, FAtiMA.Core.componentTypes.IComponent, FAtiMA.Core.componentTypes.IModelOfOtherComponent, FAtiMA.DeliberativeComponent.IProbabilityStrategy, FAtiMA.DeliberativeComponent.IUtilityStrategy, FAtiMA.DeliberativeComponent.strategies.IActionFailureStrategy, FAtiMA.DeliberativeComponent.strategies.IExpectedUtilityStrategy, FAtiMA.DeliberativeComponent.strategies.IGoalFailureStrategy, FAtiMA.DeliberativeComponent.strategies.IGoalSuccessStrategy, Serializable, Cloneable

public class MotivationalComponent extends Object implements Serializable, Cloneable, FAtiMA.Core.componentTypes.IAppraisalDerivationComponent, FAtiMA.Core.componentTypes.IModelOfOtherComponent, FAtiMA.DeliberativeComponent.strategies.IExpectedUtilityStrategy, FAtiMA.DeliberativeComponent.IProbabilityStrategy, FAtiMA.DeliberativeComponent.IUtilityStrategy, FAtiMA.DeliberativeComponent.strategies.IGoalSuccessStrategy, FAtiMA.DeliberativeComponent.strategies.IGoalFailureStrategy, FAtiMA.DeliberativeComponent.strategies.IActionFailureStrategy
Implements the character's motivational state.
Author:
Meiyii Lim, Samuel Mascarenhas
See Also:
  • Field Details

  • Constructor Details

    • MotivationalComponent

      public MotivationalComponent(ArrayList<String> extraFiles)
      Creates an empty MotivationalState
  • Method Details

    • determineQuadraticNeedVariation

      public static double determineQuadraticNeedVariation(float currentLevel, float deviation)
    • addActionEffectsOnDrive

      public void addActionEffectsOnDrive(String action, String driveName, FAtiMA.Core.wellFormedNames.Symbol target, float value)
    • addExpectedGoalEffectOnDrive

      public void addExpectedGoalEffectOnDrive(String goal, short effectType, String driveName, FAtiMA.Core.wellFormedNames.Symbol target, float value)
    • AddMotivator

      public void AddMotivator(Motivator motivator)
      Adds a motivator to the MotivationalState
    • 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
    • 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
    • getCompetence

      public float getCompetence(FAtiMA.Core.AgentModel am, FAtiMA.Core.goals.ActivePursuitGoal g)
    • getComponentDependencies

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

      public float getContributionToNeeds(FAtiMA.Core.AgentModel am, FAtiMA.Core.goals.ActivePursuitGoal g)
    • getExpectedUtility

      public float getExpectedUtility(FAtiMA.Core.AgentModel am, FAtiMA.Core.goals.ActivePursuitGoal g)
      Specified by:
      getExpectedUtility in interface FAtiMA.DeliberativeComponent.strategies.IExpectedUtilityStrategy
    • getExpectedUtility

      public float getExpectedUtility(FAtiMA.Core.AgentModel am, FAtiMA.DeliberativeComponent.Intention i)
      Specified by:
      getExpectedUtility in interface FAtiMA.DeliberativeComponent.strategies.IExpectedUtilityStrategy
    • GetIntensity

      public float GetIntensity(short type)
      Gets the received motivator's intensity, i.e. the current level of the motivator
      Returns:
      a float value corresponding to the motivator's intensity
    • GetMotivator

      public Motivator GetMotivator(short motivatorType)
    • getMotivators

      public Motivator[] getMotivators()
    • GetNeedUrgency

      public float GetNeedUrgency(String agentName, short type)
      Gets the motivator's urgency discretizing the need intensity into diffent categories (very urgent, urgent, not urgent, satisfied)
      Returns:
      a multiplier corresponding to the motivator's urgency
    • getProbability

      public float getProbability(FAtiMA.Core.AgentModel am, FAtiMA.Core.goals.ActivePursuitGoal g)
      Specified by:
      getProbability in interface FAtiMA.DeliberativeComponent.IProbabilityStrategy
    • getProbability

      public float getProbability(FAtiMA.Core.AgentModel am, FAtiMA.DeliberativeComponent.Intention i)
      Specified by:
      getProbability in interface FAtiMA.DeliberativeComponent.IProbabilityStrategy
    • getUtility

      public float getUtility(FAtiMA.Core.AgentModel am, FAtiMA.Core.goals.ActivePursuitGoal g)
      Specified by:
      getUtility in interface FAtiMA.DeliberativeComponent.IUtilityStrategy
    • GetWeight

      public float GetWeight(short type)
      Gets the received motivator's weight, i.e. how important is the motivator to the agent
      Returns:
      a float value corresponding to the motivator's weight
    • initialize

      public void initialize(FAtiMA.Core.AgentModel am)
      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
    • name

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

      public void perceiveActionFailure(FAtiMA.Core.AgentModel am, FAtiMA.Core.plans.Step a)
      Specified by:
      perceiveActionFailure in interface FAtiMA.DeliberativeComponent.strategies.IActionFailureStrategy
    • perceiveGoalFailure

      public void perceiveGoalFailure(FAtiMA.Core.AgentModel am, FAtiMA.Core.goals.ActivePursuitGoal g)
      Specified by:
      perceiveGoalFailure in interface FAtiMA.DeliberativeComponent.strategies.IGoalFailureStrategy
    • perceiveGoalSuccess

      public void perceiveGoalSuccess(FAtiMA.Core.AgentModel am, FAtiMA.Core.goals.ActivePursuitGoal g)
      Specified by:
      perceiveGoalSuccess in interface FAtiMA.DeliberativeComponent.strategies.IGoalSuccessStrategy
    • PredictCompetenceChange

      public float PredictCompetenceChange(boolean succeed)
    • reappraisal

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

      public void reset()
      Specified by:
      reset in interface FAtiMA.Core.componentTypes.IComponent
    • toXml

      public String toXml()
      Converts the motivational state to XML
      Returns:
      a XML String that contains all information in the motivational state
    • update

      public void update(FAtiMA.Core.AgentModel am, FAtiMA.Core.sensorEffector.Event e)
      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
    • UpdateCertainty

      public void UpdateCertainty(float expectation)
      Update the agent's certainty value
      Parameters:
      expectation - - ranges from -1 to 1, -1 means complete violation of expectation while 1 means complete fulfillment of expectation Changed the factor from 10 to 3 (Meiyii)
    • UpdateCompetence

      public void UpdateCompetence(boolean succeed)
      Calculates the agent's competence about a goal
      Parameters:
      succeed - - whether a goal has succeeded, true is success, and false is failure
    • UpdateMotivators

      public float UpdateMotivators(FAtiMA.Core.AgentModel am, FAtiMA.Core.sensorEffector.Event e)
      Updates the intensity of the motivators based on the event received
    • searchEventsWithAppraisal

      public ArrayList<FAtiMA.Core.wellFormedNames.SubstitutionSet> searchEventsWithAppraisal(FAtiMA.Core.AgentModel am, FAtiMA.Core.wellFormedNames.Symbol subjectVariable, FAtiMA.Core.wellFormedNames.Symbol actionVariable, FAtiMA.Core.wellFormedNames.Symbol targetVariable, FAtiMA.Core.wellFormedNames.Symbol paramVariable, float desirability)