Package FAtiMA.ReactiveComponent
Class ActionTendencies
- java.lang.Object
-
- FAtiMA.ReactiveComponent.ActionTendencies
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
public class ActionTendencies extends java.lang.Object implements java.io.Serializable, java.lang.CloneableImplements 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>_actionsprotected 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 voidAddAction(Action action)Adds a Action to the ActionTendencies SetvoidCheckIntegrity(FAtiMA.Core.IntegrityValidator val)Checks the Integrity of all the actions by testing if any of them refers to a SpeechAct not definedvoidClearFilters()java.lang.Objectclone()java.util.ArrayList<Action>getActions()voidIgnoreActionForDuration(FAtiMA.Core.ValuedAction va, long time)Temporarly deactives an action tendency.protected booleanisIgnored(FAtiMA.Core.ValuedAction va)voidPrint()FAtiMA.Core.emotionalState.BaseEmotionRecognizeEmotion(FAtiMA.Core.AgentModel am, FAtiMA.Core.wellFormedNames.Name action)voidReinforceActionTendency(java.lang.String action)FAtiMA.Core.ValuedActionSelectAction(FAtiMA.Core.AgentModel am)Selects the most appropriate ActionTendency given the character's emotional state
-
-
-
Field Detail
-
_actions
protected java.util.ArrayList<Action> _actions
-
_filteredActions
protected java.util.HashMap<java.lang.String,java.lang.Long> _filteredActions
-
-
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.UnknownSpeechActExceptionChecks 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 deactivatedtime- - 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:
clonein classjava.lang.Object
-
-