Package FAtiMA.Core.conditions
Class MoodCondition
- java.lang.Object
-
- FAtiMA.Core.conditions.Condition
-
- FAtiMA.Core.conditions.MoodCondition
-
- All Implemented Interfaces:
IGroundable,java.io.Serializable,java.lang.Cloneable
public class MoodCondition extends Condition
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected short_operatorprotected float_valueprotected static shortinvalidOperatorprotected static shortoperatorEqualprotected static shortoperatorGreaterprotected static shortoperatorGreaterEqualprotected static shortoperatorLesserprotected static shortoperatorLesserEqualprotected static shortoperatorNotEqual
-
Constructor Summary
Constructors Modifier Constructor Description MoodCondition(short operator, float value)protectedMoodCondition(MoodCondition mC)
-
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 namejava.util.ArrayList<Substitution>GetValueBindings(AgentModel am)Find a set of Substitutions for the second part of the condition, which will make it become true.booleanisGrounded()Indicates 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(org.xml.sax.Attributes attributes)Parses a EmotionCondition given a XML attribute list-
Methods inherited from class FAtiMA.Core.conditions.Condition
CheckActivation, getName, getToM, hasChangedVerifiability, isVerifiable, MakeGround, MakeGround, ReplaceUnboundVariables, setName, setToM, setVerifiable
-
-
-
-
Field Detail
-
operatorGreater
protected static final short operatorGreater
- See Also:
- Constant Field Values
-
operatorGreaterEqual
protected static final short operatorGreaterEqual
- See Also:
- Constant Field Values
-
operatorLesser
protected static final short operatorLesser
- See Also:
- Constant Field Values
-
operatorLesserEqual
protected static final short operatorLesserEqual
- See Also:
- Constant Field Values
-
operatorEqual
protected static final short operatorEqual
- See Also:
- Constant Field Values
-
operatorNotEqual
protected static final short operatorNotEqual
- See Also:
- Constant Field Values
-
invalidOperator
protected static final short invalidOperator
- See Also:
- Constant Field Values
-
_value
protected float _value
-
_operator
protected short _operator
-
-
Constructor Detail
-
MoodCondition
public MoodCondition(short operator, float value)
-
MoodCondition
protected MoodCondition(MoodCondition mC)
-
-
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.
-
ParseMoodCondition
public static MoodCondition ParseMoodCondition(org.xml.sax.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
public Name GetValue()
Gets the condition's value - the object compared against the condition's name
-
CheckCondition
public boolean CheckCondition(AgentModel am)
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:
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
-
GetValueBindings
public java.util.ArrayList<Substitution> GetValueBindings(AgentModel am)
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
-
-