|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectimplementation.gridpuzzle.GridProblem
public class GridProblem
Constructor Summary | |
---|---|
GridProblem(GameGrid initial,
GameGrid goal,
AbstractHeuristic heuristic)
|
Method Summary | |
---|---|
int |
depth(GridState state)
Returns the depth of the given state in the search tree. |
java.util.List<GridState> |
expand(GridState state)
Generates all successor states of the given state. |
double |
g(GridState state)
This method returns the sum of all path costs from the initial to the given state. |
double |
h(GridState state)
This method computes the proximity of the given state to a goal. |
GridState |
initial()
Returns the starting state of the search. |
boolean |
isGoal(GridState state)
Checks whether a given state is a goal of the search or not. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GridProblem(GameGrid initial, GameGrid goal, AbstractHeuristic heuristic)
Method Detail |
---|
public double g(GridState state)
HeuristicProblem
g
in interface HeuristicProblem<GridState>
state
- to be inspected
public double h(GridState state)
HeuristicProblem
h
in interface HeuristicProblem<GridState>
public int depth(GridState state)
TreeProblem
depth
in interface TreeProblem<GridState>
state
- the state to be inspected
public java.util.List<GridState> expand(GridState state)
Problem
expand
in interface Problem<GridState>
state
- to be expanded
public GridState initial()
Problem
initial
in interface Problem<GridState>
public boolean isGoal(GridState state)
Problem
isGoal
in interface Problem<GridState>
state
- to be checked
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |