Package edu.tufts.hrilab.action.recovery
Class GoalRecovery
java.lang.Object
edu.tufts.hrilab.action.recovery.GoalRecovery
- Direct Known Subclasses:
ConstraintRelaxationRecovery
,DefaultGoalRecovery
,ExplorationGoalRecovery
,NormPlanningGoalRecovery
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal RecoveryStatus
Get current recovery status/mode.abstract ParameterizedAction
selectNextAction
(Goal goal, ActionConstraints constraints, StateMachine stateMachine) Select the next action to be executed.abstract ParameterizedAction
selectRecoveryPolicy
(GoalContext goalContext) Select a recovery policy from the Database of policies.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).void
updateRecoveryStatus
(GoalContext goalContext) Update recovery status based on what has happened since the last goalRecovery check-in.
-
Field Details
-
log
protected org.slf4j.Logger log -
recoveryStatus
-
-
Constructor Details
-
GoalRecovery
public GoalRecovery()
-
-
Method Details
-
getStatus
Get current recovery status/mode.- Returns:
-
updateRecoveryStatus
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
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:
-