Class GoalRecovery

java.lang.Object
edu.tufts.hrilab.action.recovery.GoalRecovery
Direct Known Subclasses:
ConstraintRelaxationRecovery, DefaultGoalRecovery, ExplorationGoalRecovery, NormPlanningGoalRecovery

public abstract class GoalRecovery extends Object
  • Field Details

    • log

      protected org.slf4j.Logger log
    • recoveryStatus

      protected RecoveryStatus recoveryStatus
  • Constructor Details

    • GoalRecovery

      public GoalRecovery()
  • Method Details

    • getStatus

      public final RecoveryStatus getStatus()
      Get current recovery status/mode.
      Returns:
    • updateRecoveryStatus

      public void updateRecoveryStatus(GoalContext goalContext)
      Update recovery status based on what has happened since the last goalRecovery check-in. For example, if in recovery mode, and a recovery policy has been executed, GoalRecovery needs to be updated with the results of that recovery policy. This method provides the mechanism for that update. While it's unlikely this method needs to be overridden, it can be in order to handle corner cases.
      Parameters:
      goalContext -
    • selectNextAction

      public abstract ParameterizedAction selectNextAction(Goal goal, ActionConstraints constraints, StateMachine stateMachine)
      Select the next action to be executed. This is only called in PLAN mode, not for RECOVER mode.
      Parameters:
      goal -
      constraints -
      stateMachine -
      Returns:
    • shouldAttemptRecovery

      public abstract boolean shouldAttemptRecovery(ActionStatus actionStatus, Justification justification, GoalContext goalContext)
      Determines if a recovery attempt should be made, and locally sets the recovery mode (e.g., PLAN, RECOVER).
      Parameters:
      actionStatus -
      justification -
      goalContext -
      Returns:
    • selectRecoveryPolicy

      public abstract ParameterizedAction selectRecoveryPolicy(GoalContext goalContext)
      Select a recovery policy from the Database of policies. Can return null if there are no valid policies available. Only called when in RECOVER mode.
      Returns: