Package FAtiMA.Core.conditions
Class PredicateCondition
java.lang.Object
FAtiMA.Core.conditions.Condition
FAtiMA.Core.conditions.PredicateCondition
- All Implemented Interfaces:
IGroundable,Serializable,Cloneable
- Direct Known Subclasses:
EmotionCondition,PastEventCondition
Represents a test to a predicate. Used to represent preconditions, success
conditions, etc
- Author:
- Joao Dias
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionPredicateCondition(boolean positive, Name name, Symbol ToM) Creates a new Test to a Predicateprotected -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if the Predicate is verified in the agent's KnowledgeBaseclone()Clones this Predicate, returning an equal copy.protected booleanGetValue()Gets the predicates's value - the object compared against the condition's nameprotected ArrayList<Substitution>Find a set of Substitutions for the second part of the Predicate, which will make it become true.booleanIndicates if the Predicate is positive or negative.static PredicateConditionParsePredicate(Attributes attributes) Parses a Predicate given a XML attribute listprotected voidsetPositive(boolean positive) toString()Converts the Predicate to a StringMethods inherited from class FAtiMA.Core.conditions.Condition
CheckActivation, getName, getToM, GetValidBindings, hasChangedVerifiability, isGrounded, isVerifiable, MakeGround, MakeGround, ReplaceUnboundVariables, setName, setToM, setVerifiable
-
Constructor Details
-
PredicateCondition
public PredicateCondition() -
PredicateCondition
Creates a new Test to a Predicate- Parameters:
positive- - Indicates if the Predicate is positive or negativename- - the predicate's name
-
PredicateCondition
-
-
Method Details
-
getPositive
protected boolean getPositive() -
setPositive
protected void setPositive(boolean positive) -
clone
Clones this Predicate, returning an equal copy. If this clone is changed afterwards, the original object remains the same. -
ParsePredicate
Parses a Predicate given a XML attribute list- Parameters:
attributes- - A list of XMl attributes- Returns:
- - the Predicate Parsed
-
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:
-
GetValue
Gets the predicates's value - the object compared against the condition's name -
isPositive
public boolean isPositive()Indicates if the Predicate is positive or negative. A negative predicate corresponds to the negation of the original predicate- Returns:
- True if the Predicate is positive, false otherwise.
-
toString
Converts the Predicate to a String -
GetValueBindings
Find a set of Substitutions for the second part of the Predicate, 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.
-