Class State

java.lang.Object
edu.tufts.hrilab.action.state.State

public class State extends Object
  • Constructor Details

  • Method Details

    • createRoot

      public static State createRoot()
    • createRoot

      public static State createRoot(Set<Predicate> fs)
    • createRoot

      public static State createRoot(State s)
    • getTimestamp

      public long getTimestamp()
    • update

      public State update(Context context)
      Create the next State based on the Context and the stateUpdates that have been extracted from the Context. The stateUpdates are an ordered list of Predicates where the boolean indicates assertion (true) or retraction (false).
      Parameters:
      context -
      Returns:
    • addFacts

      public boolean addFacts(Collection<Predicate> facts)
    • addFact

      public boolean addFact(Predicate fact)
    • addFact

      public boolean addFact(Predicate fact, boolean checkOperator)
    • removeFacts

      public boolean removeFacts(Collection<Predicate> facts)
    • removeFact

      public boolean removeFact(Predicate fact)
    • getFacts

      public Set<Predicate> getFacts()
    • getPrevious

      public State.Transition getPrevious()
    • findResultingState

      public State findResultingState(Context context)
    • findStartingState

      public State findStartingState(Context context)
      get the state prior to executing an action
      Parameters:
      context - action which want to get state prior to execution
      Returns:
      state prior to execution of action
    • findStartingState

      public State findStartingState(Context context, boolean isTerminated)
    • getStateChange

      public Set<Predicate> getStateChange(Context context)
      get how the state changes from the initial state of an action to the completion of an action
      Parameters:
      context - action to get state change
      Returns:
      set of predicates representing the resulting state the initial state
    • getStateChange

      public Set<Predicate> getStateChange(Context startStep, Context endStep)
    • pruneHistory

      public void pruneHistory()
      Sets the previous transition to null, effectively removing the state transition history leading up to this state.
    • queryFluentValue

      public List<Map<Variable,Symbol>> queryFluentValue(Term query)