Class ForwardPlan

java.lang.Object
edu.uky.ai.planning.ForwardPlan
All Implemented Interfaces:
Plan, Iterable<Step>

public class ForwardPlan extends Object implements Plan
A totally ordered plan which is built from beginning (first step) to end last step). Note that this data structure is immutable. The addStep(Step) method returns a new plan with the given step added to the end without modifying the plan on which that method was called.
Author:
Stephen G. Ware
  • Constructor Details

    • ForwardPlan

      public ForwardPlan()
      Constructs a new plan with 0 steps.
  • Method Details

    • toString

      public String toString()
      Overrides:
      toString in class Object
    • size

      public int size()
      Description copied from interface: Plan
      Returns the number of steps in the plan.
      Specified by:
      size in interface Plan
      Returns:
      the number of steps
    • iterator

      public Iterator<Step> iterator()
      Specified by:
      iterator in interface Iterable<Step>
    • addStep

      public ForwardPlan addStep(Step step)
      Returns a new plan with the given step added at the end.
      Parameters:
      step - the next step to take
      Returns:
      a new plan whose last step is the given step