Package FAtiMA.Core.conditions
Class MoodCondition
java.lang.Object
FAtiMA.Core.conditions.Condition
FAtiMA.Core.conditions.MoodCondition
- All Implemented Interfaces:
IGroundable,Serializable,Cloneable
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected shortprotected floatprotected static final shortprotected static final shortprotected static final shortprotected static final shortprotected static final shortprotected static final shortprotected static final short -
Constructor Summary
Constructors -
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 nameFind a set of Substitutions for the second part of the condition, which will make it become true.booleanIndicates if the Predicate is grounded (no unbound variables in it's WFN) Example: Stronger(Luke,John) is grounded while Stronger(John,[X]) is not.static MoodConditionParseMoodCondition(Attributes attributes) Parses a EmotionCondition given a XML attribute listMethods inherited from class FAtiMA.Core.conditions.Condition
CheckActivation, getName, getToM, hasChangedVerifiability, isVerifiable, MakeGround, MakeGround, ReplaceUnboundVariables, setName, setToM, setVerifiable
-
Field Details
-
operatorGreater
protected static final short operatorGreater- See Also:
-
operatorGreaterEqual
protected static final short operatorGreaterEqual- See Also:
-
operatorLesser
protected static final short operatorLesser- See Also:
-
operatorLesserEqual
protected static final short operatorLesserEqual- See Also:
-
operatorEqual
protected static final short operatorEqual- See Also:
-
operatorNotEqual
protected static final short operatorNotEqual- See Also:
-
invalidOperator
protected static final short invalidOperator- See Also:
-
_value
protected float _value -
_operator
protected short _operator
-
-
Constructor Details
-
MoodCondition
public MoodCondition(short operator, float value) -
MoodCondition
-
-
Method Details
-
clone
Clones this EmotionCondition, returning an equal copy. If this clone is changed afterwards, the original object remains the same. -
ParseMoodCondition
public static MoodCondition ParseMoodCondition(Attributes attributes) throws InvalidMoodOperatorException, NoMoodOperatorDefinedException Parses a EmotionCondition given a XML attribute list- Parameters:
attributes- - A list of XMl attributes- Returns:
- - the EmotionCondition Parsed
- Throws:
InvalidMoodOperatorExceptionNoMoodOperatorDefinedException
-
GetValue
Gets the condition's value - the object compared against the condition's name -
CheckCondition
Checks if the Predicate is verified in the agent's KnowledgeBase- Specified by:
CheckConditionin classCondition- 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:
-
GetValueBindings
Description copied from class:ConditionFind a set of Substitutions for the second part of the condition, which will make it become true. With this method it is possible to test conditions that have unbound variables in the second part such as: "Owner(Ball) = [x]" this condition will be true if there is anyone in the world that owns a Ball. If John owns the ball, the method returns [x]/John- Specified by:
GetValueBindingsin classCondition- Returns:
- returns all set of Substitutions that make the condition valid.
-
isGrounded
public boolean isGrounded()Description copied from class:ConditionIndicates if the Predicate 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 Predicate is grounded, false otherwise
-