|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ai.planning.propositional.Goal
public class Goal
A goal is defined as a set of Atoms in propositional planning. Implicitly
defined is the set of goal states which are exactly those WorldStates in
which the Goal is satisfied. This can be tested using the function
satisfiedIn(WorldState)
.
Field Summary | |
---|---|
protected java.util.Set<ai.krr.propositions.Atom> |
goals
the set of Atoms that define this Goal |
Constructor Summary | |
---|---|
Goal(ai.krr.propositions.Atom... atoms)
This constructor creates a new Goal in which the given Atoms are to be achieved. |
|
Goal(java.util.Set<ai.krr.propositions.Atom> atoms)
This constructor creates a new Goal in which the given Atoms are to be achieved. |
Method Summary | |
---|---|
Goal |
clone()
This function creates a copy of this Goal. |
boolean |
equals(java.lang.Object obj)
This function tests whether this and the given Goal are equal. |
java.util.Set<ai.krr.propositions.Atom> |
getNegativeGoals()
This function is not supported as there are no negative goals. |
java.util.Set<ai.krr.propositions.Atom> |
getPositiveGoals()
This function returns the set of goal conditions that define this Goal. |
int |
hashCode()
This function returns a hash value for this Goal. |
boolean |
isRelevant(Action<ai.krr.propositions.Atom> action)
This function tests whether the given Action is relevant for this Goal. |
Goal |
regress(Action<ai.krr.propositions.Atom> action)
This function computes a new Goal that is the result of regressing this Goal through the given Action. |
boolean |
satisfiedIn(WorldState<ai.krr.propositions.Atom> state)
This function tests whether this Goal is achieved in the given state. |
java.lang.String |
toString()
This function creates a String representation for this Goal. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final java.util.Set<ai.krr.propositions.Atom> goals
Constructor Detail |
---|
public Goal(java.util.Set<ai.krr.propositions.Atom> atoms)
This constructor creates a new Goal in which the given Atoms are to be achieved.
atoms
- the goal conditions to be achieved in some WorldStatepublic Goal(ai.krr.propositions.Atom... atoms)
This constructor creates a new Goal in which the given Atoms are to be achieved.
atoms
- the goal conditions to be achieved in some WorldStateMethod Detail |
---|
public Goal clone()
This function creates a copy of this Goal. Subsequent modifications will not change the original Goal.
clone
in class java.lang.Object
public final java.util.Set<ai.krr.propositions.Atom> getPositiveGoals()
This function returns the set of goal conditions that define this Goal.
getPositiveGoals
in interface Goal<ai.krr.propositions.Atom>
public java.util.Set<ai.krr.propositions.Atom> getNegativeGoals()
This function is not supported as there are no negative goals.
getNegativeGoals
in interface Goal<ai.krr.propositions.Atom>
public boolean isRelevant(Action<ai.krr.propositions.Atom> action)
This function tests whether the given Action is relevant for this Goal. It returns true iff at least one of the Action's positive effects is part of this goal and none of the negative effects are goal conditions.
isRelevant
in interface Goal<ai.krr.propositions.Atom>
action
- the Action to be tested for relevance
public Goal regress(Action<ai.krr.propositions.Atom> action)
This function computes a new Goal that is the result of regressing this Goal through the given Action. The given Action should be relevant or the result of this function may not be as expected. If assertions are switched on, relevance will be tested. The resulting Goal is computed by first removing all the positive effects of the given Action from this Goal and then adding all the preconditions.
regress
in interface Goal<ai.krr.propositions.Atom>
action
- the (relevant) Action used for regression in this Goal
public boolean satisfiedIn(WorldState<ai.krr.propositions.Atom> state)
This function tests whether this Goal is achieved in the given state. This is true if all the Atoms in the Goal are true in the given WorldState.
satisfiedIn
in interface Goal<ai.krr.propositions.Atom>
state
- the WorldState in which this Goal may be satisfied
public boolean equals(java.lang.Object obj)
This function tests whether this and the given Goal are equal. It returns true iff the two Goals contain exactly the same Atoms.
equals
in class java.lang.Object
obj
- the Object this Goal is compared to
public int hashCode()
This function returns a hash value for this Goal.
hashCode
in class java.lang.Object
public java.lang.String toString()
This function creates a String representation for this Goal. This is simply the String representing the contained Set of Atoms.
toString
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |