Package edu.tufts.hrilab.action.state
Class State
java.lang.Object
edu.tufts.hrilab.action.state.State
-
Nested Class Summary
Nested Classes -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionboolean
boolean
boolean
addFacts
(Collection<Predicate> facts) static State
static State
createRoot
(State s) static State
createRoot
(Set<Predicate> fs) findResultingState
(Context context) findStartingState
(Context context) get the state prior to executing an actionfindStartingState
(Context context, boolean isTerminated) getFacts()
getStateChange
(Context context) get how the state changes from the initial state of an action to the completion of an actiongetStateChange
(Context startStep, Context endStep) long
void
Sets the previous transition to null, effectively removing the state transition history leading up to this state.queryFluentValue
(Term query) boolean
removeFact
(Predicate fact) boolean
removeFacts
(Collection<Predicate> facts) Create the next State based on the Context and the stateUpdates that have been extracted from the Context.
-
Constructor Details
-
State
-
State
-
-
Method Details
-
createRoot
-
createRoot
-
createRoot
-
getTimestamp
public long getTimestamp() -
update
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
-
addFact
-
addFact
-
removeFacts
-
removeFact
-
getFacts
-
getPrevious
-
findResultingState
-
findStartingState
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
-
getStateChange
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
-
pruneHistory
public void pruneHistory()Sets the previous transition to null, effectively removing the state transition history leading up to this state. -
queryFluentValue
-