|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ai.planning.propositional.ActionType
public class ActionType
An ActionType represents a class of Actions. ActionTypes correspond to Operators in classical planning. In propositional planning the distinction between an ActionType and an Action is almost non-existent.
Field Summary | |
---|---|
protected ai.krr.NamedSymbol |
name
the name of this action type (only used for external reference) |
protected ai.krr.propositions.Atom[] |
negEffects
preconditions, negative and positive effects of this ActionTpye |
protected ai.krr.propositions.Atom[] |
posEffects
preconditions, negative and positive effects of this ActionTpye |
protected ai.krr.propositions.Atom[] |
preconds
preconditions, negative and positive effects of this ActionTpye |
Constructor Summary | |
---|---|
protected |
ActionType(ai.krr.NamedSymbol name,
ai.krr.propositions.Atom[] pre,
ai.krr.propositions.Atom[] negE,
ai.krr.propositions.Atom[] posE)
This constructor takes a NamedSymbol representing the name of the ActionType and three Arrays of propositional Atoms representing the preconditions, negative effects (also known as the delete list), and positive effects of this ActionType. |
|
ActionType(ai.krr.NamedSymbol name,
java.util.Set<ai.krr.propositions.Atom> pre,
java.util.Set<ai.krr.propositions.Atom> negE,
java.util.Set<ai.krr.propositions.Atom> posE)
This constructor takes a NamedSymbol representing the name of the ActionType and three Sets of propositional Atoms representing the preconditions, negative effects (also known as the delete list), and positive effects of this ActionType. |
Method Summary | |
---|---|
protected ActionType |
clone()
This class does not support cloning and an Exception will be thrown if this method is called. |
static boolean |
dependent(ActionType op1,
ActionType op2)
This function tests whether the two given ActionTypes are dependent. |
boolean |
equals(java.lang.Object obj)
This function tests whether this and the given action type are equal. |
ai.krr.NamedSymbol |
getName()
This function returns the NamedSymbol representing the name of this ActionType. |
ai.krr.propositions.Atom[] |
getNegativeEffects()
This function returns the negative effects of this ActionTpye. |
ai.krr.propositions.Atom[] |
getNegativePreconditions()
This function returns null as there are no negative preconditions in this representation. |
ai.krr.fol.Variable[] |
getParameters()
This function is not supported as there are no parameters in the propositional representation. |
ai.krr.propositions.Atom[] |
getPositiveEffects()
This function returns the positive effects of this ActionTpye. |
ai.krr.propositions.Atom[] |
getPositivePreconditions()
This function returns the preconditions that must be true in a WorldState before an Action of this type can be applied. |
int |
hashCode()
This function returns a hash value for this action type. |
java.lang.String |
toString()
This function creates a String representation for this ActionType. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final ai.krr.NamedSymbol name
protected final ai.krr.propositions.Atom[] preconds
protected final ai.krr.propositions.Atom[] negEffects
protected final ai.krr.propositions.Atom[] posEffects
Constructor Detail |
---|
public ActionType(ai.krr.NamedSymbol name, java.util.Set<ai.krr.propositions.Atom> pre, java.util.Set<ai.krr.propositions.Atom> negE, java.util.Set<ai.krr.propositions.Atom> posE)
This constructor takes a NamedSymbol representing the name of the ActionType and three Sets of propositional Atoms representing the preconditions, negative effects (also known as the delete list), and positive effects of this ActionType. Note that the two effect sets must be disjoint.
name
- the name of this ActionTypepre
- the Set of Atoms constituting preconditionsnegE
- the Set of Atoms constituting negative effectsposE
- the Set of Atoms constituting positive effectsprotected ActionType(ai.krr.NamedSymbol name, ai.krr.propositions.Atom[] pre, ai.krr.propositions.Atom[] negE, ai.krr.propositions.Atom[] posE)
This constructor takes a NamedSymbol representing the name of the ActionType and three Arrays of propositional Atoms representing the preconditions, negative effects (also known as the delete list), and positive effects of this ActionType. Note that the two effect sets must be disjoint and the Arrays should not contain duplicates.
name
- the name of this ActionTypepre
- the Atoms constituting preconditionsnegE
- the Atoms constituting negative effectsposE
- the Atoms constituting positive effectsMethod Detail |
---|
protected ActionType clone() throws java.lang.CloneNotSupportedException
This class does not support cloning and an Exception will be thrown if this method is called.
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- will be thrownpublic final ai.krr.NamedSymbol getName()
This function returns the NamedSymbol representing the name of this ActionType.
getName
in interface ActionType<ai.krr.propositions.Atom>
public ai.krr.fol.Variable[] getParameters() throws java.lang.UnsupportedOperationException
This function is not supported as there are no parameters in the propositional representation. Calling this function will cause an Exception to be thrown.
getParameters
in interface ActionType<ai.krr.propositions.Atom>
java.lang.UnsupportedOperationException
public ai.krr.propositions.Atom[] getNegativePreconditions() throws java.lang.UnsupportedOperationException
This function returns null as there are no negative preconditions in this representation.
getNegativePreconditions
in interface ActionType<ai.krr.propositions.Atom>
java.lang.UnsupportedOperationException
public final ai.krr.propositions.Atom[] getPositivePreconditions()
This function returns the preconditions that must be true in a WorldState before an Action of this type can be applied.
getPositivePreconditions
in interface ActionType<ai.krr.propositions.Atom>
public final ai.krr.propositions.Atom[] getNegativeEffects()
This function returns the negative effects of this ActionTpye. Negative effects are deleted from a WorldState in which an Action of this type is applied.
getNegativeEffects
in interface ActionType<ai.krr.propositions.Atom>
public final ai.krr.propositions.Atom[] getPositiveEffects()
This function returns the positive effects of this ActionTpye. Positive effects are added to a WorldState in which an Action of this type is applied.
getPositiveEffects
in interface ActionType<ai.krr.propositions.Atom>
public boolean equals(java.lang.Object obj)
This function tests whether this and the given action type are equal. It returns true iff the two types have the same preconditions, positive effects, and negative effects. Note that the name of the action type is ignored.
equals
in class java.lang.Object
obj
- the Object this ActionType is compared to
public final int hashCode()
This function returns a hash value for this action type.
hashCode
in class java.lang.Object
public java.lang.String toString()
This function creates a String representation for this ActionType.
toString
in class java.lang.Object
public static boolean dependent(ActionType op1, ActionType op2)
This function tests whether the two given ActionTypes are dependent. Two ActionTypes are dependent if one deletes a precondition or a positive effect of the other. If there are at most n preconditions, positive, or negative effects defined for either ActionType then the time complexity of this operation is in O(n2).
op1
- the first given ActionTypeop2
- the second given ActionType
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |