|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jscience.computing.ai.planning.DomainElement
org.jscience.computing.ai.planning.Operator
public abstract class Operator
Each operator at run time is represented as a class derived from this abstract class.
| Constructor Summary | |
|---|---|
Operator(Predicate head,
int delVarIdxIn,
int addVarIdxIn,
Term costIn)
To initialize the operator. |
|
| Method Summary | |
|---|---|
boolean |
apply(Term[] binding,
State s,
java.util.Vector[] delAdd)
This function is used to apply this operator to a given state. |
double |
getCost(Term[] binding)
To get the cost of this operator. |
void |
setAdd(DelAddElement[] addIn)
To set the add list. |
void |
setDel(DelAddElement[] delIn)
To set the delete list. |
| Methods inherited from class org.jscience.computing.ai.planning.DomainElement |
|---|
getHead, getIterator, unify |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Operator(Predicate head,
int delVarIdxIn,
int addVarIdxIn,
Term costIn)
head - head of the operator.delVarIdxIn - the index of the delete list as a variable, -1 if the
delete list is not a variable.addVarIdxIn - the index of the add list as a variable, -1 if the
add list is not a variable.costIn - the cost of the operator.| Method Detail |
|---|
public boolean apply(Term[] binding,
State s,
java.util.Vector[] delAdd)
binding - the current binding.s - current state of the world.delAdd - a 4-member array of type Vector used to keep
track of the atoms and protections deleted from and added to the
current state of the world as the result of applying this
operator. This data can be used later in case of a backtrack to
undo these changes.
true if the operator was applicable,
false otherwise. An operator is not applicable
when at least one of the atoms it tries to delete is protected.public double getCost(Term[] binding)
binding - the binding to be applied to the cost term.
public void setAdd(DelAddElement[] addIn)
addIn - the add list.public void setDel(DelAddElement[] delIn)
delIn - the delete list.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||