Class GoalContext
java.lang.Object
edu.tufts.hrilab.action.execution.Context
edu.tufts.hrilab.action.execution.ArgumentBasedContext
edu.tufts.hrilab.action.execution.GoalContext
- Direct Known Subclasses:
RecoveryGoalContext
-
Field Summary
FieldsFields 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
ConstructorsConstructorDescriptionGoalContext
(Context caller, StateMachine sm, Goal goal, ExecutionType executionType) GoalContext
(Context caller, StateMachine sm, Goal goal, ExecutionType executionType, GoalRecovery recovery) -
Method Summary
Modifier and TypeMethodDescriptionMake a copy of this node in the execution tree for simulation purposesgetGoal()
Get this GoalContext's Goal.Create predicate from the context cmd and arguments: "cmd(arg0, arg1, ...)".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, instead of propagating failures up context tree.protected void
setupArguments
(List<? extends Object> inputArgs, List<? extends Object> returnArgs) void
If Context can have next steps (i.e., children), implement this method to add the next child context that should be executed.protected Justification
Verify that the effects (if any) of a context are valid.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, doStep, 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
-
Field Details
-
goal
-
executionType
-
goalRecovery
-
-
Constructor Details
-
GoalContext
public GoalContext(Context caller, StateMachine sm, Goal goal, ExecutionType executionType, GoalRecovery recovery) -
GoalContext
-
-
Method Details
-
setupArguments
- Specified by:
setupArguments
in classArgumentBasedContext
-
getGoal
Get this GoalContext's Goal.- Returns:
-
setupNextStep
public void setupNextStep()Description copied from class:Context
If Context can have next steps (i.e., children), implement this method to add the next child context that should be executed.- Overrides:
setupNextStep
in classContext
-
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 classContext
-
verifyEffects
Description copied from class:Context
Verify that the effects (if any) of a context are valid.- Overrides:
verifyEffects
in classContext
- Returns:
-
setStatus
Overriding setStatus to "catch" failures when a recovery operation should take place, instead of propagating failures up context tree. TODO: This method is synchronized to handle canceling. Is there a better way to handle this? -
getSignatureInPredicateForm
Description copied from class:ArgumentBasedContext
Create predicate from the context cmd and arguments: "cmd(arg0, arg1, ...)".- Overrides:
getSignatureInPredicateForm
in classArgumentBasedContext
- Returns:
-
copy
Make a copy of this node in the execution tree for simulation purposes
-