|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ix.iplan.FilteredPlanner
public class FilteredPlanner
A Planner that returns only plans that pass a filter.
The filter is a Predicate1
that should return true
for a plan that should be returned and false for one that
should not. The predicate is allowed to have "state"
and so may not always return the same value for the same
plan. That lets filtering be used for such things as
eliminating duplicate plans.
Field Summary | |
---|---|
protected Predicate1 |
filter
|
protected boolean |
filterPlans
|
protected Plan |
plan
|
protected Planner |
planner
|
Constructor Summary | |
---|---|
FilteredPlanner(Planner planner,
Predicate1 filter)
|
Method Summary | |
---|---|
Plan |
getPlan()
Returns this planner's current plan. |
PlanStats |
getStatistics()
Returns statistics gathered by the most recent Planner.plan()
or Planner.replan() . |
void |
loadPlan(Plan plan)
Adds the contents of the specified plan to this planner's current plan. |
void |
plan()
Finds a plan that is a completion of this planner's current plan and makes it the new current plan. |
void |
replan()
Finds the next in a series of plans that are completions of the plan that was current when Planner.plan() was
most recently called. |
void |
setDomain(Domain domain)
Sets this planner's domain. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected Planner planner
protected Predicate1 filter
protected boolean filterPlans
protected Plan plan
Constructor Detail |
---|
public FilteredPlanner(Planner planner, Predicate1 filter)
Method Detail |
---|
public void setDomain(Domain domain)
Planner
setDomain
in interface Planner
public void loadPlan(Plan plan)
Planner
loadPlan
in interface Planner
public void plan()
Planner
A successful call to plan() leaves this planner in a
state in which Planner.replan()
can be called.
plan
in interface Planner
public void replan()
Planner
Planner.plan()
was
most recently called. That completion then becomes the
new current plan. You can think of this as reconsidering
some choice made when producing earlier plans in the sequence
and making different decision at that point. However, it
is not guaranteed that the plan found in this way will
be interestingly different from all of the earlier plans
in the sequence.
The replan() method should not be called if plan() has not been called or if this planner has thrown an exception.
A successful call to replan() leaves this planner in a
state in which Planner.replan()
can be called again.
plan() may be called instead, but this will begin a new
sequence of plans based on this planner's now current plan,
rather than on the plan that was the base for the previous
sequence.
replan
in interface Planner
public Plan getPlan()
Planner
getPlan
in interface Planner
public PlanStats getStatistics()
Planner
Planner.plan()
or Planner.replan()
.
getStatistics
in interface Planner
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |