Class ContextTreeModification
java.lang.Object
edu.tufts.hrilab.action.execution.ContextTreeModification
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic boolean
goToNextStep
(Context context, Context referenceStep) go to the step following referenceStep get copy of child contexts, modify child contexts, then set original context with modified childrenstatic int
modifyContext
(Context context, Predicate modification) Modify the context tree by inserting, removing, or replacing an action stepstatic void
resetFailedContext
(Context context) locate and reset the failed context step.
-
Constructor Details
-
ContextTreeModification
public ContextTreeModification()
-
-
Method Details
-
modifyContext
Modify the context tree by inserting, removing, or replacing an action step- Parameters:
context
- the context tree to be modified -- currently assumes context is GoalContext with 1 stepmodification
- the type and value of the modification modType(modificationInformation) insert(step) delete(step) replace(ogStep, newStep)- Returns:
- the index of modified step
-
goToNextStep
go to the step following referenceStep get copy of child contexts, modify child contexts, then set original context with modified children- Parameters:
referenceStep
- the step before the step to execute- Returns:
- found reference step
-
resetFailedContext
locate and reset the failed context step. if the context did not cause the failure, set it to progress and check children- Parameters:
context
- failed context
-