|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object ai.search.Problem ai.search.RouteProblem
Find a route between cities on a map.
Field Summary |
Fields inherited from class ai.search.Problem |
algorithm, canvas, currentNode, display, goal, heuristic, initialState, numExpanded, q, search, searchResult |
Method Summary | |
java.lang.String |
actionToString(java.lang.Object action)
Convert an action to a string. |
int |
edgeCost(Node n,
java.lang.Object action,
java.lang.Object state)
Determine the cost of an edge which is the distance between the cities. |
boolean |
equalState(java.lang.Object state1,
java.lang.Object state2)
Determine if two states are equivalent. |
boolean |
goalReached(java.lang.Object state)
Is the state a goal state? |
int |
hCost(java.lang.Object state)
Estimate the cost to goal by taking straight-line distance. |
java.lang.String |
stateToString(java.lang.Object state)
Convert a state to a string. |
java.util.Vector |
successors(java.lang.Object state)
Determine all the states which are successors of the given state. |
Methods inherited from class ai.search.Problem |
actionPerformed, run, solve, start, stop |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public boolean goalReached(java.lang.Object state)
Problem
goalReached
in class Problem
public java.util.Vector successors(java.lang.Object state)
successors
in class Problem
state
- is the given state
public int edgeCost(Node n, java.lang.Object action, java.lang.Object state)
edgeCost
in class Problem
public int hCost(java.lang.Object state)
hCost
in class Problem
public boolean equalState(java.lang.Object state1, java.lang.Object state2)
Problem
equalState
in class Problem
state1
- and states are the two states
public java.lang.String stateToString(java.lang.Object state)
Problem
stateToString
in class Problem
state
- is the given state
public java.lang.String actionToString(java.lang.Object action)
Problem
actionToString
in class Problem
action
- is the given action
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |