public class IterativeDeepeningSearch extends java.lang.Object implements SearchForActions, SearchForStates
function ITERATIVE-DEEPENING-SEARCH(problem) returns a solution, or failure for depth = 0 to infinity do result <- DEPTH-LIMITED-SEARCH(problem, depth) if result != cutoff then return resultFigure 3.18 The iterative deepening search algorithm, which repeatedly applies depth-limited search with increasing limits. It terminates when a solution is found or if the depth- limited search returns failure, meaning that no solution exists.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
METRIC_NODES_EXPANDED |
static java.lang.String |
METRIC_PATH_COST |
Constructor and Description |
---|
IterativeDeepeningSearch() |
IterativeDeepeningSearch(NodeExpander nodeExpander) |
Modifier and Type | Method and Description |
---|---|
java.util.List<Action> |
findActions(Problem p)
Returns a list of actions to the goal if the goal was found, a list
containing a single NoOp Action if already at the goal, or an empty list
if the goal could not be found.
|
java.lang.Object |
findState(Problem p)
Returns a state which is might be but not necessary is a goal state of
the problem.
|
Metrics |
getMetrics()
Returns all the metrics of the search.
|
NodeExpander |
getNodeExpander()
Returns the node expander used by the search.
|
public static final java.lang.String METRIC_NODES_EXPANDED
public static final java.lang.String METRIC_PATH_COST
public IterativeDeepeningSearch()
public IterativeDeepeningSearch(NodeExpander nodeExpander)
public java.util.List<Action> findActions(Problem p)
SearchForActions
findActions
in interface SearchForActions
p
- the search problempublic java.lang.Object findState(Problem p)
SearchForStates
findState
in interface SearchForStates
p
- the search problempublic NodeExpander getNodeExpander()
SearchForActions
getNodeExpander
in interface SearchForActions
getNodeExpander
in interface SearchForStates
public Metrics getMetrics()
SearchForActions
getMetrics
in interface SearchForActions
getMetrics
in interface SearchForStates