Package FAtiMA.Core.goals
Class InterestGoal
- java.lang.Object
-
- FAtiMA.Core.goals.Goal
-
- FAtiMA.Core.goals.InterestGoal
-
- All Implemented Interfaces:
IGroundable,java.io.Serializable,java.lang.Cloneable
public class InterestGoal extends Goal
Implements OCC's Interest goals- Author:
- Joao Dias
- See Also:
- Serialized Form
-
-
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 Constructor Description InterestGoal(Name description)Creates a new InterestGoal
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidAddCondition(java.lang.String conditionType, Condition cond)Adds a condition to the goal's protected conditionsvoidCheckIntegrity(IntegrityValidator val)Checks the integrity of the goal.java.lang.Objectclone()Clones this InterestGoal, returning an equal copy.java.util.ArrayList<Condition>getProtectionConstraints()Gets the InterestGoal's protected conditionsvoidMakeGround(Substitution subst)Applies a set of substitutions to the object, grounding it.voidMakeGround(java.util.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.java.lang.StringtoString()Converts the InterestGoal to a String-
Methods 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 Detail
-
InterestGoal
public InterestGoal(Name description)
Creates a new InterestGoal- Parameters:
description- - the InterestGoal's name or description
-
-
Method Detail
-
AddCondition
public void AddCondition(java.lang.String conditionType, Condition cond)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
public void CheckIntegrity(IntegrityValidator val) throws UnreachableGoalException
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
public java.util.ArrayList<Condition> 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
public void MakeGround(java.util.ArrayList<Substitution> bindings)
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:
Substitution
-
MakeGround
public void MakeGround(Substitution subst)
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:
Substitution
-
clone
public java.lang.Object clone()
Clones this InterestGoal, returning an equal copy. If this clone is changed afterwards, the original object remains the same.- Overrides:
clonein classjava.lang.Object- Returns:
- The Goal's copy.
-
-