Package FAtiMA.Core.conditions
Class EmotionCondition
java.lang.Object
FAtiMA.Core.conditions.Condition
FAtiMA.Core.conditions.PredicateCondition
FAtiMA.Core.conditions.EmotionCondition
- All Implemented Interfaces:
IGroundable,Serializable,Cloneable
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionEmotionCondition(boolean active, Symbol ToM, String emotion) EmotionCondition(boolean active, String emotion) protected -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if the Predicate is verified in the agent's KnowledgeBaseclone()Clones this EmotionCondition, returning an equal copy.This method finds all the possible sets of Substitutions that applied to the condition will make it valid (true) according to the agent's EmotionalStateGetValue()Gets the condition's value - the object compared against the condition's namebooleanIndicates if the condition is grounded (no unbound variables in it's WFN) Example: Stronger(Luke,John) is grounded while Stronger(John,[X]) is not.voidMakeGround(Substitution subst) Applies a set of substitutions to the object, grounding it.voidMakeGround(ArrayList<Substitution> bindings) Applies a set of substitutions to the object, grounding it.static EmotionConditionParseEmotionCondition(Attributes attributes) Parses a EmotionCondition given a XML attribute listvoidReplaceUnboundVariables(int variableID) Replaces all unbound variables in the object by applying a numeric identifier to each one.voidSetDirection(Symbol direction) voidSetIntensity(float intensity) voidSetIntensity(Symbol intensity) Methods inherited from class FAtiMA.Core.conditions.PredicateCondition
getPositive, GetValueBindings, isPositive, ParsePredicate, setPositive, toStringMethods inherited from class FAtiMA.Core.conditions.Condition
CheckActivation, getName, getToM, hasChangedVerifiability, isVerifiable, setName, setToM, setVerifiable
-
Field Details
-
_emotionType
-
_intensity
-
_direction
-
-
Constructor Details
-
EmotionCondition
-
EmotionCondition
-
EmotionCondition
-
-
Method Details
-
clone
Clones this EmotionCondition, returning an equal copy. If this clone is changed afterwards, the original object remains the same.- Overrides:
clonein classPredicateCondition- Returns:
- The EmotionCondition's copy.
-
ParseEmotionCondition
public static EmotionCondition ParseEmotionCondition(Attributes attributes) throws InvalidEmotionTypeException Parses a EmotionCondition given a XML attribute list- Parameters:
attributes- - A list of XMl attributes- Returns:
- - the EmotionCondition Parsed
- Throws:
InvalidEmotionTypeException
-
SetIntensity
-
SetIntensity
public void SetIntensity(float intensity) -
SetDirection
-
GetValue
Gets the condition's value - the object compared against the condition's name- Overrides:
GetValuein classPredicateCondition- Returns:
- the condition's value
-
CheckCondition
Checks if the Predicate is verified in the agent's KnowledgeBase- Overrides:
CheckConditionin classPredicateCondition- Returns:
- true if the Predicate is verified, false otherwise
- See Also:
-
GetValidBindings
This method finds all the possible sets of Substitutions that applied to the condition will make it valid (true) according to the agent's EmotionalState- Overrides:
GetValidBindingsin classCondition- Returns:
- A list with all SubstitutionsSets that make the condition valid
- See Also:
-
ReplaceUnboundVariables
public void ReplaceUnboundVariables(int variableID) Replaces all unbound variables in the object by applying a numeric identifier to each one. For example, the variable [x] becomes [x4] if the received ID is 4. Attention, this method modifies the original object.- Specified by:
ReplaceUnboundVariablesin interfaceIGroundable- Overrides:
ReplaceUnboundVariablesin classCondition- Parameters:
variableID- - the identifier to be applied
-
MakeGround
Applies a set of substitutions to the object, grounding it. Example: Applying the substitution "[X]/John" in the name "Weak([X])" returns "Weak(John)". Attention, this method modifies the original object.- Specified by:
MakeGroundin interfaceIGroundable- Overrides:
MakeGroundin classCondition- Parameters:
bindings- - A list of substitutions of the type "[Variable]/value"- See Also:
-
MakeGround
Applies a set of substitutions to the object, grounding it. Example: Applying the substitution "[X]/John" in the name "Weak([X])" returns "Weak(John)". Attention, this method modifies the original object.- Specified by:
MakeGroundin interfaceIGroundable- Overrides:
MakeGroundin classCondition- Parameters:
subst- - a substitution of the type "[Variable]/value"- See Also:
-
isGrounded
public boolean isGrounded()Indicates if the condition is grounded (no unbound variables in it's WFN) Example: Stronger(Luke,John) is grounded while Stronger(John,[X]) is not.- Specified by:
isGroundedin interfaceIGroundable- Overrides:
isGroundedin classCondition- Returns:
- true if the condition is grounded, false otherwise
-