public abstract class WorldState extends Object
Contact: Don Brutzman (web.nps.navy.mil/~brutzman) brutzman@nps.navy.mil
Constructor and Description |
---|
WorldState()
Creates a new instance of WorldState
|
Modifier and Type | Method and Description |
---|---|
void |
addCondition(Condition newCondition)
Adds a condition to the end of the set of conditions defining the world state
|
void |
addCondition(Condition newCondition,
int index)
Adds a condition to an index-specified location in the condition set
|
abstract WorldState |
computeStepEffect(PlanStep step)
Computes the effect of a plan step on the world state conditions
|
Condition |
getCondition(int index)
Returns the condition specified by the index
If index is outside the range (i.e. < 0 or >= size(), null is returned
|
boolean |
hasCondition(Condition testCondition)
Returns true this WorldState object has a condition that matches the parameter
|
boolean |
match(WorldState testState)
Compares this state with another and returns true if they match.
|
int |
numberOfConditions()
Returns the number of conditions that make up the world state
|
abstract List<SearchPlanStep> |
possibleSteps()
Returns an ArrayList containing all steps that are possible from the current state
|
String |
toString()
Converts the WorldState object to a user-readable String
|
abstract double |
worldStateDistance(WorldState candidate)
Compares this state with another to measure how different they are
|
public abstract List<SearchPlanStep> possibleSteps()
public abstract WorldState computeStepEffect(PlanStep step)
step
- PlanStep object.public abstract double worldStateDistance(WorldState candidate)
candidate
- WorldState object.public boolean match(WorldState testState)
testState
- another world state to which this one is being comparedWorldState
matches the testStatepublic int numberOfConditions()
public boolean hasCondition(Condition testCondition)
testCondition
- WorldState
contains Condition
testConditionpublic Condition getCondition(int index)
index
- the position number.public void addCondition(Condition newCondition)
newCondition
- Condition object.public void addCondition(Condition newCondition, int index)
newCondition
- Condition object.index
- the position number.