Class ObservationContext


public class ObservationContext extends ArgumentBasedContext
  • Constructor Details

  • Method Details

    • setupArguments

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

      public void doStep()
      Description copied from class: Context
      If Context has a concrete execution step to perform, it should happen in this method. This should not include setting up next steps (i.e., children to perform), which should happen in the setupNextStep method. Primitive actions and operators (i.e., leaf nodes in the context tree) are examples where this method should be implemented.
      Overrides:
      doStep in class Context
    • hasObserver

      public boolean hasObserver()
      Check if this ObservationContext has found a valid Observer (i.e., ActionContext) in the system. This first performs doStep which calls selectionAction, and then does the check.
      Returns:
    • performAdditionalStatusUpdates

      protected void performAdditionalStatusUpdates()
      Description copied from class: Context
      A method to perform additional steps during ActionStatus updates (i.e., setStatus). If a particular Context sub-class needs this to happen, that class should override this method. NOTE: This method is only called when a select set of ActionStatuses are successfully set.
      Overrides:
      performAdditionalStatusUpdates in class Context
    • getStateUpdates

      public List<Predicate> getStateUpdates()
      Description copied from class: Context
      Get state updates for this context based on the current status (i.e., ActionStatus).
      Overrides:
      getStateUpdates in class Context
      Returns:
    • verifyReturnValue

      public Justification verifyReturnValue()
      If an observation returns null, it fails.
      Overrides:
      verifyReturnValue in class Context
      Returns:
    • getBoundObservationResults

      public Justification getBoundObservationResults()
      Attempt to retrieve the results of the observation and package them into a Justification.
      Returns:
      Justification of state with associated bindings, when applicable.
    • 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
    • copy

      public ObservationContext copy(Context newParent)
      Description copied from class: Context
      deep copy of the context, its status, and its children
      Specified by:
      copy in class Context
      Parameters:
      newParent - parent to attach the copied context too
      Returns:
      the copied context