Package FAtiMA.Core.conditions
Class PropertyCondition
java.lang.Object
FAtiMA.Core.conditions.Condition
FAtiMA.Core.conditions.PropertyCondition
- All Implemented Interfaces:
IGroundable,Serializable,Cloneable
- Direct Known Subclasses:
PropertyEqual,PropertyGreater,PropertyGreaterEqual,PropertyLesser,PropertyLesserEqual,PropertyNotEqual
Represents a test to a property. Used in preconditions, success conditions,
etc.. This property test is composed by the property name, and a second name
that specifies a comparison value. A PropertyTest can be one of:
PropertyEqual, PropertyNotEqual, PropertyLesser, PropertyGreater.
- Author:
- Joao Dias
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedPropertyCondition(Name name, Name value, Symbol ToM) Creates a new Property -
Method Summary
Modifier and TypeMethodDescriptionbooleanChecks if the Property Condition is verified in the agent's memory (KB + AM)clone()Clones this Condition, returning an equal copy.protected ArrayList<Substitution>GetBindings(AgentModel am, Name groundValue, Name value) GetValue()Gets the Property's test valueprotected ArrayList<Substitution>Find a set of Substitutions for the second part of the condition, which will make it become true.booleanIndicates 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 PropertyConditionParseProperty(Attributes attributes) Parses a PropertyTest given a XML attribute listvoidPrint()Prints the PropertyTest to the Standard OutputvoidReplaceUnboundVariables(int variableID) Replaces all unbound variables in the object by applying a numeric identifier to each one.Methods inherited from class FAtiMA.Core.conditions.Condition
CheckActivation, getName, getToM, GetValidBindings, hasChangedVerifiability, isVerifiable, setName, setToM, setVerifiable
-
Constructor Details
-
PropertyCondition
Creates a new Property- Parameters:
name- - the property's namevalue- - the property's value
-
PropertyCondition
-
-
Method Details
-
clone
Description copied from class:ConditionClones this Condition, returning an equal copy. If this clone is changed afterwards, the original object remains the same. -
ParseProperty
Parses a PropertyTest given a XML attribute list- Parameters:
attributes- - A list of XMl attributes- Returns:
- - the PropertyTest Parsed
-
CheckCondition
Checks if the Property Condition is verified in the agent's memory (KB + AM)- Specified by:
CheckConditionin classCondition- Returns:
- true if the condition is verified, false otherwise
- See Also:
-
GetValue
Gets the Property's test value -
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
-
Print
public void Print()Prints the PropertyTest to the Standard Output -
GetBindings
-
GetValueBindings
Find 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.
-