JSHOP2
Class Plan

java.lang.Object
  extended by JSHOP2.Plan

public class Plan
extends java.lang.Object

This class represent a plan as a LinkedList of ground instances of operators.

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

Field Summary
private  double cost
          The cost of the plan.
(package private) static java.lang.String endl
          The new line character in the platform JSHOP2 is running on.
private  java.util.LinkedList<Predicate> ops
          The plan as a LinkedList of ground instances of operators.
 
Constructor Summary
  Plan()
          To initialize the plan to an empty list.
private Plan(java.util.LinkedList<Predicate> opsIn, double costIn)
          This function is used by objects of this class to clone themselves.
 
Method Summary
 double addOperator(Operator op, Term[] binding)
          To add an operator instance to the end of the plan.
 java.lang.Object clone()
          To clone an object of this class.
 java.util.LinkedList<Predicate> getOps()
          To get the sequence of operators represented by this object.
 void removeOperator(double opCost)
          To remove the operator instance at the end of the plan.
 java.lang.String toString()
          This function returns a printable String representation of this plan.
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

cost

private double cost
The cost of the plan.


endl

static final java.lang.String endl
The new line character in the platform JSHOP2 is running on.


ops

private java.util.LinkedList<Predicate> ops
The plan as a LinkedList of ground instances of operators.

Constructor Detail

Plan

public Plan()
To initialize the plan to an empty list.


Plan

private Plan(java.util.LinkedList<Predicate> opsIn,
             double costIn)
This function is used by objects of this class to clone themselves.

Parameters:
opsIn - the operators in the plan.
costIn - the cost of the plan.
Method Detail

addOperator

public double addOperator(Operator op,
                          Term[] binding)
To add an operator instance to the end of the plan.

Parameters:
op - the operator the instance of which is being added.
binding - the binding to instantiate the operator.
Returns:
the cost of the operator instance being added.

clone

public java.lang.Object clone()
To clone an object of this class.

Overrides:
clone in class java.lang.Object

getOps

public java.util.LinkedList<Predicate> getOps()
To get the sequence of operators represented by this object.

Returns:
A LinkedList of operator instances in this plan.

removeOperator

public void removeOperator(double opCost)
To remove the operator instance at the end of the plan.

Parameters:
opCost - the cost of the operator instance to be removed.

toString

public java.lang.String toString()
This function returns a printable String representation of this plan.

Overrides:
toString in class java.lang.Object
Returns:
the String representation of this plan.