Class RecoveryGoalContext
java.lang.Object
edu.tufts.hrilab.action.execution.Context
edu.tufts.hrilab.action.execution.ArgumentBasedContext
edu.tufts.hrilab.action.execution.GoalContext
edu.tufts.hrilab.action.execution.RecoveryGoalContext
-
Field Summary
Fields inherited from class edu.tufts.hrilab.action.execution.GoalContext
executionType, goal, goalRecovery
Fields inherited from class edu.tufts.hrilab.action.execution.ArgumentBasedContext
arguments, variable
Fields inherited from class edu.tufts.hrilab.action.execution.Context
caller, childContexts, cmd, constraints, endTime, log, maxTime, startTime, stateMachine
-
Constructor Summary
ConstructorsConstructorDescriptionRecoveryGoalContext
(Context caller, StateMachine sm, ParameterizedAction recoveryAction, ExecutionType executionType, GoalRecovery recovery) -
Method Summary
Modifier and TypeMethodDescriptionMake a copy of this node in the execution tree for simulation purposesvoid
doStep()
If Context has a concrete execution step to perform, it should happen in this method.protected void
This resets fields specific to concrete sub-classes and should be overridden by inheriting classes if additional resetting needs to happen.void
setStatus
(ActionStatus eStatus, Justification justification) Overriding setStatus to "catch" failures when a recovery operation should take place, and also to convert un-caught failures to FAIL_RECOVERY so the parent goal context can handle recovery failures differently from regular goal/action failures.Methods inherited from class edu.tufts.hrilab.action.execution.GoalContext
getGoal, getSignatureInPredicateForm, setupArguments, setupNextStep, verifyEffects
Methods inherited from class edu.tufts.hrilab.action.execution.ArgumentBasedContext
addArgument, addArgument, bindPredicate, bindText, copyArguments, getArgument, getArguments, getArgumentSilent, getArgumentType, getArgumentValue, getEvaluatedArgument, getLocalArgument, hasArgumentInScope, hasLocalArgument, redistributeArguments, setArgument
Methods inherited from class edu.tufts.hrilab.action.execution.Context
acquireLocks, addEvent, addEvent, addEvent, causedFailure, copyInternal, createSimulatedEquivalent, getActor, getActualLogicalValue, getChildContexts, getCommand, getConstraints, getContextDescription, getContextDescription, getDuration, getElapsedTime, getEndTime, getEquivalentContext, getExecType, getId, getJustification, getLogicalValue, getMaxTime, getNearestTerminatedAncestor, getNextStep, getNextStepForType, getParentContext, getRootContext, getStartTime, getStateMachine, getStateUpdates, getStatus, hasNormCheckingAncestor, isAction, isApproved, isAsynchronous, isFailure, isSimulation, isSuccess, isTerminated, performAdditionalStatusUpdates, releaseLocks, resetContext, resetCoreContext, setChildContexts, setConstraints, setEndTime, setExecType, setLogicalValue, setStartTime, setStartTime, setStateMachine, setStatus, setTimeout, setupNextStep, startOverAllMonitor, toString, updatePerformanceModels, verifyReturnValue, waitForTermination, waitForTermination
-
Constructor Details
-
RecoveryGoalContext
public RecoveryGoalContext(Context caller, StateMachine sm, ParameterizedAction recoveryAction, ExecutionType executionType, GoalRecovery recovery)
-
-
Method Details
-
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. -
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 classGoalContext
-
setStatus
Overriding setStatus to "catch" failures when a recovery operation should take place, and also to convert un-caught failures to FAIL_RECOVERY so the parent goal context can handle recovery failures differently from regular goal/action failures. TODO: This method is synchronized to handle canceling. Is there a better way to handle this?- Overrides:
setStatus
in classGoalContext
- Parameters:
eStatus
- the execution status of the currently running eventjustification
- the reason for the context's execution status
-
copy
Make a copy of this node in the execution tree for simulation purposes- Overrides:
copy
in classGoalContext
- Parameters:
newParent
- new parent context- Returns:
-