Class ContextTreeModification

java.lang.Object
edu.tufts.hrilab.action.execution.ContextTreeModification

public class ContextTreeModification extends Object
  • Constructor Details

    • ContextTreeModification

      public ContextTreeModification()
  • Method Details

    • modifyContext

      public static int modifyContext(Context context, Predicate modification)
      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 step
      modification - the type and value of the modification modType(modificationInformation) insert(step) delete(step) replace(ogStep, newStep)
      Returns:
      the index of modified step
    • goToNextStep

      public static 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 children
      Parameters:
      referenceStep - the step before the step to execute
      Returns:
      found reference step
    • resetFailedContext

      public static void resetFailedContext(Context context)
      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