Package FAtiMA.motivationalSystem
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 Summary
FieldsModifier and TypeFieldDescriptionprotected HashMap<String,ActionEffectsOnDrives> protected HashMap<String,ExpectedGoalEffectsOnDrives> protected intprotected intprotected longprotected Motivator[]static final String -
Constructor Summary
ConstructorsConstructorDescriptionMotivationalComponent(ArrayList<String> extraFiles) Creates an empty MotivationalState -
Method Summary
Modifier and TypeMethodDescriptionvoidaddActionEffectsOnDrive(String action, String driveName, FAtiMA.Core.wellFormedNames.Symbol target, float value) voidaddExpectedGoalEffectOnDrive(String goal, short effectType, String driveName, FAtiMA.Core.wellFormedNames.Symbol target, float value) voidAddMotivator(Motivator motivator) Adds a motivator to the MotivationalStatevoidappraisal(FAtiMA.Core.AgentModel am, FAtiMA.Core.sensorEffector.Event e, FAtiMA.Core.emotionalState.AppraisalFrame as) FAtiMA.Core.Display.AgentDisplayPanelcreateDisplayPanel(FAtiMA.Core.AgentModel am) FAtiMA.Core.componentTypes.IComponentstatic doubledetermineQuadraticNeedVariation(float currentLevel, float deviation) floatgetCompetence(FAtiMA.Core.AgentModel am, FAtiMA.Core.goals.ActivePursuitGoal g) String[]floatgetContributionToNeeds(FAtiMA.Core.AgentModel am, FAtiMA.Core.goals.ActivePursuitGoal g) floatgetExpectedUtility(FAtiMA.Core.AgentModel am, FAtiMA.Core.goals.ActivePursuitGoal g) floatgetExpectedUtility(FAtiMA.Core.AgentModel am, FAtiMA.DeliberativeComponent.Intention i) floatGetIntensity(short type) Gets the received motivator's intensity, i.e.GetMotivator(short motivatorType) floatGetNeedUrgency(String agentName, short type) Gets the motivator's urgency discretizing the need intensity into diffent categories (very urgent, urgent, not urgent, satisfied)floatgetProbability(FAtiMA.Core.AgentModel am, FAtiMA.Core.goals.ActivePursuitGoal g) floatgetProbability(FAtiMA.Core.AgentModel am, FAtiMA.DeliberativeComponent.Intention i) floatgetUtility(FAtiMA.Core.AgentModel am, FAtiMA.Core.goals.ActivePursuitGoal g) floatGetWeight(short type) Gets the received motivator's weight, i.e.voidinitialize(FAtiMA.Core.AgentModel am) voidinverseAppraisal(FAtiMA.Core.AgentModel am, FAtiMA.Core.emotionalState.AppraisalFrame af) name()voidperceiveActionFailure(FAtiMA.Core.AgentModel am, FAtiMA.Core.plans.Step a) voidperceiveGoalFailure(FAtiMA.Core.AgentModel am, FAtiMA.Core.goals.ActivePursuitGoal g) voidperceiveGoalSuccess(FAtiMA.Core.AgentModel am, FAtiMA.Core.goals.ActivePursuitGoal g) floatPredictCompetenceChange(boolean succeed) FAtiMA.Core.emotionalState.AppraisalFramereappraisal(FAtiMA.Core.AgentModel am) voidreset()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) toXml()Converts the motivational state to XMLvoidupdate(FAtiMA.Core.AgentModel am, long time) voidupdate(FAtiMA.Core.AgentModel am, FAtiMA.Core.sensorEffector.Event e) voidUpdateCertainty(float expectation) Update the agent's certainty valuevoidUpdateCompetence(boolean succeed) Calculates the agent's competence about a goalfloatUpdateMotivators(FAtiMA.Core.AgentModel am, FAtiMA.Core.sensorEffector.Event e) Updates the intensity of the motivators based on the event received
-
Field Details
-
NAME
- See Also:
-
_motivators
-
_lastTime
protected long _lastTime -
_goalTried
protected int _goalTried -
_goalSucceeded
protected int _goalSucceeded -
_appraisals
-
_goalEffectsOnDrives
-
_actionEffectsOnDrives
-
-
Constructor Details
-
MotivationalComponent
Creates an empty MotivationalState
-
-
Method Details
-
determineQuadraticNeedVariation
public static double determineQuadraticNeedVariation(float currentLevel, float deviation) -
addActionEffectsOnDrive
-
addExpectedGoalEffectOnDrive
-
AddMotivator
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:
appraisalin interfaceFAtiMA.Core.componentTypes.IAppraisalDerivationComponent
-
createDisplayPanel
public FAtiMA.Core.Display.AgentDisplayPanel createDisplayPanel(FAtiMA.Core.AgentModel am) - Specified by:
createDisplayPanelin interfaceFAtiMA.Core.componentTypes.IComponent
-
createModelOfOther
public FAtiMA.Core.componentTypes.IComponent createModelOfOther()- Specified by:
createModelOfOtherin interfaceFAtiMA.Core.componentTypes.IModelOfOtherComponent
-
getCompetence
public float getCompetence(FAtiMA.Core.AgentModel am, FAtiMA.Core.goals.ActivePursuitGoal g) -
getComponentDependencies
- Specified by:
getComponentDependenciesin interfaceFAtiMA.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:
getExpectedUtilityin interfaceFAtiMA.DeliberativeComponent.strategies.IExpectedUtilityStrategy
-
getExpectedUtility
public float getExpectedUtility(FAtiMA.Core.AgentModel am, FAtiMA.DeliberativeComponent.Intention i) - Specified by:
getExpectedUtilityin interfaceFAtiMA.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
-
getMotivators
-
GetNeedUrgency
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:
getProbabilityin interfaceFAtiMA.DeliberativeComponent.IProbabilityStrategy
-
getProbability
public float getProbability(FAtiMA.Core.AgentModel am, FAtiMA.DeliberativeComponent.Intention i) - Specified by:
getProbabilityin interfaceFAtiMA.DeliberativeComponent.IProbabilityStrategy
-
getUtility
public float getUtility(FAtiMA.Core.AgentModel am, FAtiMA.Core.goals.ActivePursuitGoal g) - Specified by:
getUtilityin interfaceFAtiMA.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:
initializein interfaceFAtiMA.Core.componentTypes.IComponent
-
inverseAppraisal
public void inverseAppraisal(FAtiMA.Core.AgentModel am, FAtiMA.Core.emotionalState.AppraisalFrame af) - Specified by:
inverseAppraisalin interfaceFAtiMA.Core.componentTypes.IAppraisalDerivationComponent
-
name
- Specified by:
namein interfaceFAtiMA.Core.componentTypes.IComponent
-
perceiveActionFailure
public void perceiveActionFailure(FAtiMA.Core.AgentModel am, FAtiMA.Core.plans.Step a) - Specified by:
perceiveActionFailurein interfaceFAtiMA.DeliberativeComponent.strategies.IActionFailureStrategy
-
perceiveGoalFailure
public void perceiveGoalFailure(FAtiMA.Core.AgentModel am, FAtiMA.Core.goals.ActivePursuitGoal g) - Specified by:
perceiveGoalFailurein interfaceFAtiMA.DeliberativeComponent.strategies.IGoalFailureStrategy
-
perceiveGoalSuccess
public void perceiveGoalSuccess(FAtiMA.Core.AgentModel am, FAtiMA.Core.goals.ActivePursuitGoal g) - Specified by:
perceiveGoalSuccessin interfaceFAtiMA.DeliberativeComponent.strategies.IGoalSuccessStrategy
-
PredictCompetenceChange
public float PredictCompetenceChange(boolean succeed) -
reappraisal
public FAtiMA.Core.emotionalState.AppraisalFrame reappraisal(FAtiMA.Core.AgentModel am) - Specified by:
reappraisalin interfaceFAtiMA.Core.componentTypes.IAppraisalDerivationComponent
-
reset
public void reset()- Specified by:
resetin interfaceFAtiMA.Core.componentTypes.IComponent
-
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:
updatein interfaceFAtiMA.Core.componentTypes.IComponent
-
update
public void update(FAtiMA.Core.AgentModel am, long time) - Specified by:
updatein interfaceFAtiMA.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)
-