Class PolicyConstraints

java.lang.Object
edu.tufts.hrilab.action.recovery.PolicyConstraints

public class PolicyConstraints extends Object
Constraints that define when a RecoveryPolicy is applicable.
  • Field Details

    • methodName

      public String methodName
      The DBEntry method name containing the recovery policy specification.
    • recoveryType

      public RecoveryType recoveryType
      Type of recovery policy - one of Action or Goal. The corresponding recovery policy can be caught in and applied under contexts of this type. Single exception is root goals which are direct action instructions.
    • goals

      public Set<Predicate> goals
      The corresponding recovery policy is applicable to these goals. Can be empty (i.e., applies to all goals). Cannot be used at the same time as excludedGoals.
    • excludedGoals

      public Set<Predicate> excludedGoals
      The corresponding recovery policy is NOT applicable to these goals. Can be empty (i.e., applies to all goals). Cannot be used at the same time as goals.
    • failedActions

      public Set<Predicate> failedActions
      The corresponding recovery policy is applicable to these failed actions. Can be empty (i.e., applies to all failed actions). Cannot be used at the same time as excludedFailedActions.
    • excludedFailedActions

      public Set<Predicate> excludedFailedActions
      The corresponding recovery policy is NOT applicable to these failed actions. Can be empty (i.e., applies to all failed actions). Cannot be used at the same time as failedActions.
    • failureReasons

      public Set<Predicate> failureReasons
      The corresponding recovery policy is applicable to these failure reasons. Can be empty (i.e., applies to all failure reasons). Cannot be used at the same time as excludedFailureReasons. If an action failure has more than one failure reason, a single policy must handle all the failure reasons.
    • excludedFailureReasons

      public Set<Predicate> excludedFailureReasons
      The corresponding recovery policy is NOT applicable to these failure reasons. Can be empty (i.e., applies to all failure reasons). Cannot be used at the same time as failureReasons.
    • actionStatuses

      public Set<ActionStatus> actionStatuses
      The corresponding recovery policy is applicable to these action statuses. Can be empty (i.e., applies to all action statuses).
    • postRecoveryExecutionType

      public PostRecoveryExecutionType postRecoveryExecutionType
      (Action Recovery Only) Indication of how to continue with execution after a recovery policy has successfully completed. See PostRecoveryExecutionType for details.
    • catchingActions

      public Set<Predicate> catchingActions
      (Action Recovery Only) The corresponding recovery policy will defer matching to failure reasons until/unless the failure propagates to an action context whose signature matches one of the entries in this field. Can be empty (i.e. applies to the direct parent of the failed context regardless of signature)
    • maximumAttempts

      public int maximumAttempts
      Maximum number of times this recovery policy can be executed for the same failure reasons under the same context ActionRecovery RETRY: Attempt count resets when the reattempted action succeeds GaolRecovery: Attempt count always increments and never resets. TODO if also want to check for progress (see notes in Recovery.java)
  • Constructor Details

    • PolicyConstraints

      public PolicyConstraints()
  • Method Details

    • alwaysApplicable

      public boolean alwaysApplicable()
      Returns true if the corresponding recovery policy is always applicable (i.e., empty recovery ASL block).
      Returns:
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object