Package edu.uky.ai.planning
Class BackwardPlan
java.lang.Object
edu.uky.ai.planning.BackwardPlan
A totally ordered plan which is built from end (last step) to beginning.
In keeping with the contract of
Iterable.iterator()
, this plan's
iterator still gives steps from first to last. Note that this data
structure is immutable. The addStep(Step)
method returns a new
plan with the given step added to the beginning without modifying the plan
on which that method was called.- Author:
- Stephen G. Ware
-
Constructor Details
-
BackwardPlan
public BackwardPlan()Constructs a new plan with 0 steps.
-
-
Method Details
-
toString
-
size
public int size()Description copied from interface:Plan
Returns the number of steps in the plan. -
iterator
-
addStep
Returns a new plan with the given step added at the beginning.- Parameters:
step
- the first step to take- Returns:
- a new plan whose first step is the given step
-