Class RootContext

java.lang.Object
edu.tufts.hrilab.action.execution.Context
edu.tufts.hrilab.action.execution.RootContext

public class RootContext extends Context
  • Constructor Details

    • RootContext

      public RootContext(ActionConstraints constraints, StateMachine sm)
      RootContext constructor
      Parameters:
      constraints - root action constraints (applies to all child contexts)
      sm - state machine for root context
    • RootContext

      public RootContext(ActionConstraints constraints, StateMachine sm, ExecutionType executionType)
      RootContext constructor
      Parameters:
      constraints - root action constraints (applies to all child contexts)
      sm - state machine for root context
  • Method Details

    • createSimulationRoot

      public RootContext createSimulationRoot(StateMachine sm, ExecutionType executionType)
      RootContext for simulations
      Parameters:
      sm - state machine for simulation
      executionType - execution type for the new root (should be some simulation state)
    • getNextStepForType

      protected Context getNextStepForType()
      Description copied from class: Context
      Get the next step (i.e., context) to be executed. Returns null if there are no more steps. TODO: remove this method
      Overrides:
      getNextStepForType in class Context
      Returns:
    • setStatus

      public void setStatus(ActionStatus eStatus, Justification justification)
      Description copied from class: Context
      Set the ActionStatus and Justification for the status. NOTE: Classes overriding this method must call super.setStatus(status, justification) inside their overriding method to actually set the status and justification. Using the convenience method setStatus(status) will cause an infinite loop, and also abandon the Justification.
      Overrides:
      setStatus in class Context
    • prune

      public void prune(long historyLength)
      Prune children that are terminated. TODO: use historyLength
      Parameters:
      historyLength - ms of history to keep
    • copy

      public RootContext copy(Context newParent)
      Description copied from class: Context
      deep copy of the context, its status, and its children
      Specified by:
      copy in class Context
      Parameters:
      newParent - parent to attach the copied context too
      Returns:
      the copied context