|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface Planner
Planner / planning algorithm. This interface provides a standard
way to use a planner from within Java. One way to create a planner
is to call the static IPlan.makeDefaultPlanner()
method.
A convenient way to use a planner (created by thet method) from
outside Java is to use the class FilePlanner
as a main program.
Here is how a planner might be used in Java:
import ix.icore.plan.Plan; import ix.icore.domain.Domain; import ix.iplan.IPlan; import ix.iplan.Planner; import ix.iplan.NoPlanException; ... Planner planner = IPlan.makeDefaultPlanner(); planner.setDomain(...); planner.loadPlan(...); try { planner.plan(); Plan plan = planner.getPlan(); while (!isGoodEnoughPlan(plan)) { planner.replan(); plan = planner.getPlan(); } } catch (NoPlanException e) { ... }
Method Summary | |
---|---|
Plan |
getPlan()
Returns this planner's current plan. |
PlanStats |
getStatistics()
Returns statistics gathered by the most recent plan()
or 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 plan() was
most recently called. |
void |
setDomain(Domain domain)
Sets this planner's domain. |
Method Detail |
---|
void setDomain(Domain domain)
void loadPlan(Plan plan)
void plan()
A successful call to plan() leaves this planner in a
state in which replan()
can be called.
NoPlanException
- if no plan can be found by this planner.void replan()
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 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.
NoPlanException
- if no new plan can be found by this planner.Plan getPlan()
PlanStats getStatistics()
plan()
or replan()
.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |