Package FAtiMA.Core.goals
Class InterestGoal
java.lang.Object
FAtiMA.Core.goals.Goal
FAtiMA.Core.goals.InterestGoal
- All Implemented Interfaces:
IGroundable,Serializable,Cloneable
Implements OCC's Interest goals
- Author:
- Joao Dias
- See Also:
-
Field Summary
Fields inherited from class FAtiMA.Core.goals.Goal
_appliedSubstitutions, _baseIOF, _baseIOS, _dynamicIOF, _dynamicIOS, _goalID, _key, _name, ACTIVATIONEVENT, FAILUREEVENT, goalCounter, GOALDROPED, GOALFAILURE, GOALSUCCESS, IMPORTANCEOFFAILURE, IMPORTANCEOFSUCCESS, SUCCESSEVENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAddCondition(String conditionType, Condition cond) Adds a condition to the goal's protected conditionsvoidChecks the integrity of the goal.clone()Clones this InterestGoal, returning an equal copy.Gets the InterestGoal's protected conditionsvoidMakeGround(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.voidReplaceUnboundVariables(int variableID) Replaces all unbound variables in the object by applying a numeric identifier to each one.toString()Converts the InterestGoal to a StringMethods inherited from class FAtiMA.Core.goals.Goal
DecreaseImportanceOfFailure, DecreaseImportanceOfSuccess, generateEventDescription, GenerateGoalStatus, GetActivationEvent, getAppliedSubstitutions, GetCancelEvent, GetFailureEvent, GetImportanceOfFailure, GetImportanceOfSuccess, getKey, getName, GetSuccessEvent, GroundConditionList, IncreaseImportanceOfFailure, IncreaseImportanceOfSuccess, isGrounded, SetImportanceOfFailure, SetImportanceOfSuccess
-
Constructor Details
-
InterestGoal
Creates a new InterestGoal- Parameters:
description- - the InterestGoal's name or description
-
-
Method Details
-
AddCondition
Adds a condition to the goal's protected conditions- Specified by:
AddConditionin classGoal- Parameters:
conditionType- - in this method the conditionType is irrelevant because an InterestGoal only has protection conditionscond- - the condition to add
-
CheckIntegrity
Checks the integrity of the goal. For instance it checks if the goal's success conditions are reachable by at leas one action in the domain operators. If not it means that the goal will never be achieve and probably is a typo in the goal's definition (or in the actions file)- Specified by:
CheckIntegrityin classGoal- Parameters:
val- - the validator used to check the goal- Throws:
UnreachableGoalException- - thrown if a goal's success conditions can never be achieved because there is no operator with such effects
-
getProtectionConstraints
Gets the InterestGoal's protected conditions- Returns:
- an ArrayList with the conditions that the goal wants to protect
-
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- Specified by:
ReplaceUnboundVariablesin classGoal- 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- Specified by:
MakeGroundin classGoal- 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- Specified by:
MakeGroundin classGoal- Parameters:
subst- - a substitution of the type "[Variable]/value"- See Also:
-
clone
Clones this InterestGoal, returning an equal copy. If this clone is changed afterwards, the original object remains the same. -
toString
Converts the InterestGoal to a String
-