Class GoalContext

Direct Known Subclasses:
RecoveryGoalContext

public class GoalContext extends ArgumentBasedContext
  • Field Details

  • Constructor Details

  • Method Details

    • setupArguments

      protected void setupArguments(List<? extends Object> inputArgs, List<? extends Object> returnArgs)
      Specified by:
      setupArguments in class ArgumentBasedContext
    • getGoal

      public Goal getGoal()
      Get this GoalContext's Goal.
      Returns:
    • setupNextStep

      public void setupNextStep()
      Description copied from class: Context
      If Context can have next steps (i.e., children), implement this method to add the next child context that should be executed.
      Overrides:
      setupNextStep in class Context
    • resetConcreteContext

      protected void resetConcreteContext()
      Description copied from class: Context
      This resets fields specific to concrete sub-classes and should be overridden by inheriting classes if additional resetting needs to happen.
      Overrides:
      resetConcreteContext in class Context
    • verifyEffects

      protected Justification verifyEffects()
      Description copied from class: Context
      Verify that the effects (if any) of a context are valid.
      Overrides:
      verifyEffects in class Context
      Returns:
    • setStatus

      public void setStatus(ActionStatus eStatus, Justification justification)
      Overriding setStatus to "catch" failures when a recovery operation should take place, instead of propagating failures up context tree. TODO: This method is synchronized to handle canceling. Is there a better way to handle this?
      Overrides:
      setStatus in class Context
      Parameters:
      eStatus - the execution status of the currently running event
      justification - the reason for the context's execution status
    • getSignatureInPredicateForm

      public Predicate getSignatureInPredicateForm()
      Description copied from class: ArgumentBasedContext
      Create predicate from the context cmd and arguments: "cmd(arg0, arg1, ...)".
      Overrides:
      getSignatureInPredicateForm in class ArgumentBasedContext
      Returns:
    • copy

      public GoalContext copy(Context newParent)
      Make a copy of this node in the execution tree for simulation purposes
      Specified by:
      copy in class Context
      Parameters:
      newParent - new parent context
      Returns: