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, variableFields 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 voidThis resets fields specific to concrete sub-classes and should be overridden by inheriting classes if additional resetting needs to happen.voidsetStatus(ActionStatus eStatus, Justification justification) Overriding setStatus to "catch" failures when a recovery operation should take place, instead of propagating failures up context tree.protected voidsetupArguments(List<? extends Object> inputArgs, List<? extends Object> returnArgs) voidIf Context can have next steps (i.e., children), implement this method to add the next child context that should be executed.protected JustificationVerify 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, setArgumentMethods 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:
setupArgumentsin classArgumentBasedContext
-
getGoal
Get this GoalContext's Goal.- Returns:
-
setupNextStep
public void setupNextStep()Description copied from class:ContextIf Context can have next steps (i.e., children), implement this method to add the next child context that should be executed.- Overrides:
setupNextStepin classContext
-
resetConcreteContext
protected void resetConcreteContext()Description copied from class:ContextThis resets fields specific to concrete sub-classes and should be overridden by inheriting classes if additional resetting needs to happen.- Overrides:
resetConcreteContextin classContext
-
verifyEffects
Description copied from class:ContextVerify that the effects (if any) of a context are valid.- Overrides:
verifyEffectsin 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:ArgumentBasedContextCreate predicate from the context cmd and arguments: "cmd(arg0, arg1, ...)".- Overrides:
getSignatureInPredicateFormin classArgumentBasedContext- Returns:
-
copy
Make a copy of this node in the execution tree for simulation purposes
-