|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ai.planning.strips.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.
Nested Class Summary | |
---|---|
protected class |
Goal.UgConditions
|
Field Summary | |
---|---|
protected java.util.Set<ai.krr.fol.Atom> |
negativeGoals
the sets of Atoms that define this Goal |
protected java.util.Set<ai.krr.fol.Atom> |
positiveGoals
the sets of Atoms that define this Goal |
Constructor Summary | |
---|---|
Goal(java.util.Collection<ai.krr.fol.Literal> goalLits)
This constructor creates a new Goal in which the given positive Literals are to be achieved and the given negative Literals must not hold. |
|
Goal(java.util.Set<ai.krr.fol.Atom> posG,
java.util.Set<ai.krr.fol.Atom> negG)
This constructor creates a new Goal in which the Atoms from the first given Set are to be achieved and the Atoms from the second given Set must not hold. |
Method Summary | |
---|---|
Goal |
clone()
This function creates a copy of this Goal. |
boolean |
equals(Goal goal)
|
boolean |
equals(java.lang.Object obj)
This function tests whether this and the given Goal are equal. |
java.util.Set<ai.krr.fol.Atom> |
getNegativeGoals()
This function returns the set of negative goal conditions that define this Goal. |
java.util.Set<Goal.UgConditions> |
getPartialSubGoals(ActionType op,
Problem p)
This function computes the regression set of this Goal. |
java.util.Set<ai.krr.fol.Atom> |
getPositiveGoals()
This function returns the set of positive goal conditions that define this Goal. |
int |
hashCode()
This function returns a hash value for this Goal. |
boolean |
isRelevant(Action<ai.krr.fol.Atom> action)
This function tests whether the given Action is relevant for this Goal. |
Goal<ai.krr.fol.Atom> |
regress(Action<ai.krr.fol.Atom> action)
This function computes a new Goal that is the result of regressing this Goal through the given Action. |
Goal |
regress(Action action,
Domain domain)
This function computes a new Goal that is the result of regressing this Goal through the given Action. |
boolean |
satisfiedIn(WorldState<ai.krr.fol.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 java.util.Set<ai.krr.fol.Atom> positiveGoals
protected java.util.Set<ai.krr.fol.Atom> negativeGoals
Constructor Detail |
---|
public Goal(java.util.Set<ai.krr.fol.Atom> posG, java.util.Set<ai.krr.fol.Atom> negG)
This constructor creates a new Goal in which the Atoms from the first given Set are to be achieved and the Atoms from the second given Set must not hold. All the given Atoms must be ground and function-free.
posG
- the Atoms that must hold for this Goal to be achievednegG
- the Atoms that must not hold for this Goal to be achievedpublic Goal(java.util.Collection<ai.krr.fol.Literal> goalLits)
This constructor creates a new Goal in which the given positive Literals are to be achieved and the given negative Literals must not hold. All the given Atoms must be ground and function-free.
goals
- 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 boolean isRelevant(Action<ai.krr.fol.Atom> action)
This function tests whether the given Action is relevant for this Goal. An Action is relevant for this Goal iff:
isRelevant
in interface Goal<ai.krr.fol.Atom>
action
- the Action to be tested for relevance
public Goal<ai.krr.fol.Atom> regress(Action<ai.krr.fol.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.
The new Goal is computed by first removing the positve effects from the positve goal and the negative effects from the negative goal. Then the positive and negative preconditions are added to the positive and negative goals respectively. Note that static preconditions will be added to the goal here as there is no way to determine whether a relation is static in the current context.
regress
in interface Goal<ai.krr.fol.Atom>
action
- the (relevant) Action used for regression in this Goal
public boolean satisfiedIn(WorldState<ai.krr.fol.Atom> state)
This function tests whether this Goal is achieved in the given state.
satisfiedIn
in interface Goal<ai.krr.fol.Atom>
state
- the WorldState in which this Goal may be satisfied
public java.util.Set<ai.krr.fol.Atom> getPositiveGoals()
This function returns the set of positive goal conditions that define this Goal.
getPositiveGoals
in interface Goal<ai.krr.fol.Atom>
public java.util.Set<ai.krr.fol.Atom> getNegativeGoals()
This function returns the set of negative goal conditions that define this Goal.
getNegativeGoals
in interface Goal<ai.krr.fol.Atom>
public Goal regress(Action action, Domain domain)
This function computes a new Goal that is the result of regressing this Goal through the given Action. The given Action should be relevant.
The new Goal is computed by first removing the positve effects from the positve goal and the negative effects from the negative goal. Then the positive and negative preconditions are added to the positive and negative goals respectively. Note, however, that static preconditions will not be added to the goal!
action
- the (relevant) Action used for regression in this Goaldomain
- the Domain in which this Goal is defined
public java.util.Set<Goal.UgConditions> getPartialSubGoals(ActionType op, Problem p)
This function computes the regression set of this Goal. If a WorldState satisfies any one of these sub-goals then a state in which this Goal is satisfied is reachable. The given domain defines the ActionTypes that may be used to generate the sub-goals.
domain
- the Domain defining the possible ActionTypes
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 positive and negative Atoms.
equals
in class java.lang.Object
obj
- the Object this Goal is compared to
public boolean equals(Goal goal)
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 |