JSHOP2
Class InternalOperator

java.lang.Object
  extended by JSHOP2.CompileTimeObject
      extended by JSHOP2.InternalElement
          extended by JSHOP2.InternalOperator

public class InternalOperator
extends InternalElement

Each operator at compile time is represented as an instance of this class.

Version:
1.0.3
Author:
Okhtay Ilghami, http://www.cs.umd.edu/~okhtay

Field Summary
private  java.util.Vector add
          This operator's add list, a Vector of objects of type DelAddElement.
private static int classCnt
          The number of objects already instantiated from this class.
private  Term cost
          The cost of this operator.
private  java.util.Vector del
          This operator's delete list, a Vector of objects of type DelAddElement.
private  LogicalPrecondition pre
          The logical precondition of this operator.
 
Fields inherited from class JSHOP2.CompileTimeObject
endl
 
Constructor Summary
InternalOperator(Predicate head, LogicalPrecondition preIn, java.util.Vector delIn, java.util.Vector addIn, Term costIn)
          To initialize an InternalOperator object.
 
Method Summary
 java.lang.String toCode()
          This function produces the Java code needed to implement this operator.
 
Methods inherited from class JSHOP2.InternalElement
getCnt, getHead
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

add

private java.util.Vector add
This operator's add list, a Vector of objects of type DelAddElement. Note that a Vector, rather than an array, is used, since at compile time we do not know how many delete/add elements there will be.


classCnt

private static int classCnt
The number of objects already instantiated from this class.


cost

private Term cost
The cost of this operator.


del

private java.util.Vector del
This operator's delete list, a Vector of objects of type DelAddElement. Note that a Vector, rather than an array, is used, since at compile time we do not know how many delete/add elements there will be.


pre

private LogicalPrecondition pre
The logical precondition of this operator.

Constructor Detail

InternalOperator

public InternalOperator(Predicate head,
                        LogicalPrecondition preIn,
                        java.util.Vector delIn,
                        java.util.Vector addIn,
                        Term costIn)
To initialize an InternalOperator object.

Parameters:
head - head of the operator (i.e., the primitive task that can be achieved by applying this operator).
preIn - the logical precondition for this operator.
delIn - the delete list of the operator. The first element of the Vector is of type Integer. If it is not null, it means that the delete list of this operator is a variable, and the value of the Integer shows that variable's index. Otherwise, the rest of the Vector is of type DelAddElement, representing the atoms and protections that will be deleted from the state of the world when this operator is applied.
addIn - the add list of the operator. The first element of the Vector is of type Integer. If it is not null, it means that the add list of this operator is a variable, and the value of the Integer shows that variable's index. Otherwise, the rest of the Vector is of type DelAddElement, representing the atoms and protections that will be added to the state of the world when this operator is applied.
costIn - the cost of the operator.
Method Detail

toCode

public java.lang.String toCode()
This function produces the Java code needed to implement this operator.

Specified by:
toCode in class CompileTimeObject
Returns:
the produced code as a String.