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,java.io.Serializable,java.lang.Cloneable
public class EmotionCondition extends PredicateCondition
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Symbol_directionprotected java.lang.String_emotionTypeprotected Symbol_intensity
-
Constructor Summary
Constructors Modifier Constructor Description EmotionCondition(boolean active, Symbol ToM, java.lang.String emotion)EmotionCondition(boolean active, java.lang.String emotion)protectedEmotionCondition(EmotionCondition eC)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanCheckCondition(AgentModel am)Checks if the Predicate is verified in the agent's KnowledgeBasejava.lang.Objectclone()Clones this EmotionCondition, returning an equal copy.java.util.ArrayList<SubstitutionSet>GetValidBindings(AgentModel am)This method finds all the possible sets of Substitutions that applied to the condition will make it valid (true) according to the agent's EmotionalStateNameGetValue()Gets the condition's value - the object compared against the condition's namebooleanisGrounded()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.voidMakeGround(Substitution subst)Applies a set of substitutions to the object, grounding it.voidMakeGround(java.util.ArrayList<Substitution> bindings)Applies a set of substitutions to the object, grounding it.static EmotionConditionParseEmotionCondition(org.xml.sax.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, toString
-
Methods inherited from class FAtiMA.Core.conditions.Condition
CheckActivation, getName, getToM, hasChangedVerifiability, isVerifiable, setName, setToM, setVerifiable
-
-
-
-
Constructor Detail
-
EmotionCondition
public EmotionCondition(boolean active, java.lang.String emotion)
-
EmotionCondition
public EmotionCondition(boolean active, Symbol ToM, java.lang.String emotion)
-
EmotionCondition
protected EmotionCondition(EmotionCondition eC)
-
-
Method Detail
-
clone
public java.lang.Object 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(org.xml.sax.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
public void SetIntensity(Symbol intensity)
-
SetIntensity
public void SetIntensity(float intensity)
-
SetDirection
public void SetDirection(Symbol direction)
-
GetValue
public Name GetValue()
Gets the condition's value - the object compared against the condition's name- Overrides:
GetValuein classPredicateCondition- Returns:
- the condition's value
-
CheckCondition
public boolean CheckCondition(AgentModel am)
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:
KnowledgeBase
-
GetValidBindings
public java.util.ArrayList<SubstitutionSet> GetValidBindings(AgentModel am)
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:
EmotionalState
-
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
public void MakeGround(java.util.ArrayList<Substitution> bindings)
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:
Substitution
-
MakeGround
public void MakeGround(Substitution subst)
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:
Substitution
-
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
-
-