|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ai.planning.propositional.ssp.ForwardSearchPlanner
public class ForwardSearchPlanner
This class represents a planner that can solve (simple) propositional
planning problems. The algorithm used is forward state-space search, i.e.
each search state corresponds to a WorldState
. Successors are
generated by applying applicable actions from the Domain
specified in
the Problem
given to the planner at construction time. The
SearchEngine used to perform the search is an
AStarSearcherForIntCostFn
. It explores the search space from the
initial state defined in the planning problem and stops when a state that
satisfies the goal has been found. The search is performed as a graph search,
i.e. a test for repeated states is performed to avoid multiple exploration of
equal states reached via different paths. The heuristic used simply counts
the number of unachieved goal conditions and this is obviously not an
admissible heuristic. For a more detailed and theoretical description of the
algorithm see Ghallab, Nau and
Traverso. Automated Planning: Theory and Practice, section 4.2.
Field Summary | |
---|---|
protected Problem |
problem
the planning problem to be solved by this planner |
Constructor Summary | |
---|---|
ForwardSearchPlanner(Problem problem)
This constructor creates a new ForwardSearchPlanner for the given planning Problem. |
Method Summary | |
---|---|
protected java.lang.Object |
clone()
This class does not support cloning and an Exception will be thrown if this method is called. |
SequentialPlan |
doPlanSearch()
This function will search for a solution to the given planning Problem. |
ai.search.informed.BestFirstSearcherForIntCostFn |
getSearchEngine()
This function returns the SearchEngine (a BestFirstSearcherForIntCostFn ) that is used by this planner to
perform the search for the next plan. |
int |
hashCode()
This function returns the hash code for the problem provided at construction time. |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected final Problem problem
Constructor Detail |
---|
public ForwardSearchPlanner(Problem problem)
This constructor creates a new ForwardSearchPlanner for the given
planning Problem. A limited amount of configuration can be done by using
the function getSearchEngine()
and configuring the search
engine. The search for a plan is then started with the function
doPlanSearch()
.
The following code can be used to generate and print all the solutions for a given planning problem, which is passed to the constructor of the planner. Before planning begins, the underlying SearchEngine may be configured, as shown in the example. Here, tracing is switched on. The loop then searches for a plan until the returned value is null, indicating there are no more plans. Note that plans need to be assigned to a NameSpace (even null) before they can be printed.
ForwardSearchPlanner planner = new ForwardSearchPlanner(problem); planner.getSearchEngine().setTraceStream(System.out); SequentialPlan plan; while ((plan = planner.doPlanSearch()) != null) { plan.assignTo(null); System.out.println("Solution plan: " + plan.toString()); } System.out.println("no more plans!");
problem
- the planning Problem to be solved by this plannerMethod Detail |
---|
protected java.lang.Object clone() throws java.lang.CloneNotSupportedException
This class does not support cloning and an Exception will be thrown if this method is called.
clone
in class java.lang.Object
java.lang.CloneNotSupportedException
- will be thrownpublic SequentialPlan doPlanSearch()
This function will search for a solution to the given planning Problem. If a solution is found, it will be returned as a SequentialPlan. Calling doPlanSearch again will continue the search to find another solution plan. When no more plans can be found the function will return null.
doPlanSearch
in interface Planner<ai.krr.propositions.Atom>
public ai.search.informed.BestFirstSearcherForIntCostFn getSearchEngine()
This function returns the SearchEngine (a
BestFirstSearcherForIntCostFn
) that is used by this planner to
perform the search for the next plan. Configuring this search engine
directly effects the way this planner works.
public int hashCode()
This function returns the hash code for the problem provided at construction time.
hashCode
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |