|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ai.planning.strips.ActionType
public class ActionType
An ActionType represents a class of Actions. ActionTypes correspond to Operators in classical STRIPS planning.
Nested Class Summary | |
---|---|
static class |
ActionType.ArrayGrounding
A Substitution maps a set of Variables to a set of Terms. |
Field Summary | |
---|---|
protected ai.krr.NamedSymbol |
name
the name of this action type (used to refer to this type) |
protected ai.krr.fol.Atom[] |
negativeEffects
preconditions, negative and positive effects of this ActionTpye |
protected ai.krr.fol.Atom[] |
negativePreconds
preconditions, negative and positive effects of this ActionTpye |
protected ai.krr.fol.Variable[] |
params
the variables representing the parameters of this action type |
protected ai.krr.fol.Atom[] |
positiveEffects
preconditions, negative and positive effects of this ActionTpye |
protected ai.krr.fol.Atom[] |
positivePreconds
preconditions, negative and positive effects of this ActionTpye |
Constructor Summary | |
---|---|
ActionType(ai.krr.NamedSymbol name,
java.util.List<ai.krr.fol.Variable> vars,
java.util.Collection<ai.krr.fol.Literal> preconds,
java.util.Collection<ai.krr.fol.Literal> effects)
This constructor takes a NamedSymbol representing the name of the ActionType, a List of Variables representing the parameters of the ActionType, and two Lists of propositional Literals representing the preconditions and effects of this ActionType. |
|
ActionType(ai.krr.NamedSymbol name,
java.util.List<ai.krr.fol.Variable> vars,
java.util.List<ai.krr.fol.Atom> negP,
java.util.List<ai.krr.fol.Atom> posP,
java.util.List<ai.krr.fol.Atom> negE,
java.util.List<ai.krr.fol.Atom> posE)
This constructor takes a NamedSymbol representing the name of the ActionType, a List of Variables representing the parameters of the ActionType, and four Lists of propositional Atoms representing the negative and positive preconditions, the negative effects (also known as the delete list), and the 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. |
protected static boolean |
disjoint(ai.krr.fol.Atom[] atoms1,
ai.krr.fol.Atom[] atoms2)
|
static boolean |
disjoint(ai.krr.fol.Atom[] atoms1,
ai.krr.fol.Atom[] atoms2,
Grounding g)
|
static boolean |
fullyGrounded(ai.krr.fol.Atom atom,
Grounding g)
|
java.util.List<Action> |
getApplicableActions(WorldState state,
boolean allowComplements)
This function returns a List of all the Actions that are instances of this ActionType and which are applicable in the given WorldState. |
ai.krr.NamedSymbol |
getName()
This function returns the NamedSymbol representing the name of this ActionType. |
ai.krr.fol.Atom[] |
getNegativeEffects()
This function returns the negative effects of this ActionTpye. |
ai.krr.fol.Atom[] |
getNegativePreconditions()
This function returns the preconditions that must be false in a WorldState before an Action of this type can be applied. |
ai.krr.fol.Variable[] |
getParameters()
This function returns the variables representing parameters of this ActionType. |
ai.krr.fol.Atom[] |
getPositiveEffects()
This function returns the positive effects of this ActionTpye. |
ai.krr.fol.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. |
protected static int |
nrVarsUnground(ai.krr.fol.Atom atom,
Grounding g)
|
java.lang.String |
toString()
This function creates a String representation for this ActionType. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected final ai.krr.NamedSymbol name
protected final ai.krr.fol.Variable[] params
protected final ai.krr.fol.Atom[] negativePreconds
protected final ai.krr.fol.Atom[] positivePreconds
protected final ai.krr.fol.Atom[] negativeEffects
protected final ai.krr.fol.Atom[] positiveEffects
Constructor Detail |
---|
public ActionType(ai.krr.NamedSymbol name, java.util.List<ai.krr.fol.Variable> vars, java.util.List<ai.krr.fol.Atom> negP, java.util.List<ai.krr.fol.Atom> posP, java.util.List<ai.krr.fol.Atom> negE, java.util.List<ai.krr.fol.Atom> posE)
This constructor takes a NamedSymbol representing the name of the ActionType, a List of Variables representing the parameters of the ActionType, and four Lists of propositional Atoms representing the negative and positive preconditions, the negative effects (also known as the delete list), and the positive effects of this ActionType.
Note that, for an ActionType to be valid, the following conditions must be satisfied:
name
- the name of this ActionTypevars
- the parameter list for this action typenegP
- the List of Atoms constituting negative preconditionsposP
- the List of Atoms constituting positive preconditionsnegE
- the List of Atoms constituting negative effectsposE
- the List of Atoms constituting positive effectspublic ActionType(ai.krr.NamedSymbol name, java.util.List<ai.krr.fol.Variable> vars, java.util.Collection<ai.krr.fol.Literal> preconds, java.util.Collection<ai.krr.fol.Literal> effects)
This constructor takes a NamedSymbol representing the name of the ActionType, a List of Variables representing the parameters of the ActionType, and two Lists of propositional Literals representing the preconditions and effects of this ActionType.
Note that, for an ActionType to be valid, the following conditions must be satisfied:
name
- the name of this ActionTypevars
- the parameter list for this action typepreconds
- the List of Literals constituting preconditionseffects
- the List of Literals constituting negative 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.fol.Atom>
public final ai.krr.fol.Variable[] getParameters()
This function returns the variables representing parameters of this ActionType.
getParameters
in interface ActionType<ai.krr.fol.Atom>
public final ai.krr.fol.Atom[] getNegativePreconditions()
This function returns the preconditions that must be false in a WorldState before an Action of this type can be applied.
getNegativePreconditions
in interface ActionType<ai.krr.fol.Atom>
public final ai.krr.fol.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.fol.Atom>
public final ai.krr.fol.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.fol.Atom>
public final ai.krr.fol.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.fol.Atom>
public java.util.List<Action> getApplicableActions(WorldState state, boolean allowComplements)
This function returns a List of all the Actions that are instances of this ActionType and which are applicable in the given WorldState. The given boolean determines whether this List may contain Actions with inconsistent effects.
state
- the WorldState in which the returned Actions are applicableallowComplements
- whether complementary effects are permitted
public java.lang.String toString()
This function creates a String representation for this ActionType.
toString
in class java.lang.Object
public int hashCode()
This function returns a hash value for this action type.
hashCode
in class java.lang.Object
public static boolean disjoint(ai.krr.fol.Atom[] atoms1, ai.krr.fol.Atom[] atoms2, Grounding g)
public static boolean fullyGrounded(ai.krr.fol.Atom atom, Grounding g)
protected static boolean disjoint(ai.krr.fol.Atom[] atoms1, ai.krr.fol.Atom[] atoms2)
protected static int nrVarsUnground(ai.krr.fol.Atom atom, Grounding g)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |