Class InterestGoal

java.lang.Object
FAtiMA.Core.goals.Goal
FAtiMA.Core.goals.InterestGoal
All Implemented Interfaces:
IGroundable, Serializable, Cloneable

public class InterestGoal extends Goal
Implements OCC's Interest goals
Author:
Joao Dias
See Also:
  • Constructor Details

    • InterestGoal

      public InterestGoal(Name description)
      Creates a new InterestGoal
      Parameters:
      description - - the InterestGoal's name or description
  • Method Details

    • AddCondition

      public void AddCondition(String conditionType, Condition cond)
      Adds a condition to the goal's protected conditions
      Specified by:
      AddCondition in class Goal
      Parameters:
      conditionType - - in this method the conditionType is irrelevant because an InterestGoal only has protection conditions
      cond - - 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:
      CheckIntegrity in class Goal
      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 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:
      ReplaceUnboundVariables in interface IGroundable
      Specified by:
      ReplaceUnboundVariables in class Goal
      Parameters:
      variableID - - the identifier to be applied
    • MakeGround

      public void MakeGround(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:
      MakeGround in interface IGroundable
      Specified by:
      MakeGround in class Goal
      Parameters:
      bindings - - A list of substitutions of the type "[Variable]/value"
      See Also:
    • 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:
      MakeGround in interface IGroundable
      Specified by:
      MakeGround in class Goal
      Parameters:
      subst - - a substitution of the type "[Variable]/value"
      See Also:
    • clone

      public Object clone()
      Clones this InterestGoal, returning an equal copy. If this clone is changed afterwards, the original object remains the same.
      Overrides:
      clone in class Object
      Returns:
      The Goal's copy.
    • toString

      public String toString()
      Converts the InterestGoal to a String
      Overrides:
      toString in class Goal
      Returns:
      the converted String