Procedures and classes for doing basic breadth-first and depth-first
search, with and without dynamic programming.
|
search(initialState,
goalTest,
actions,
successor,
depthFirst=False,
DP=True,
maxNodes=10000)
Returns:
path from initial state to a goal state as a list of (action, state)
tuples |
|
|
|
depthFirst(initialState,
goalTest,
actions,
successor)
See search documentation |
|
|
|
breadthFirst(initialState,
goalTest,
actions,
successor)
See search documentation |
|
|
|
depthFirstDP(initialState,
goalTest,
actions,
successor)
See search documentation |
|
|
|
breadthFirstDP(initialState,
goalTest,
actions,
successor)
See search documentation |
|
|
|
smSearch(smToSearch,
initialState=None,
goalTest=None,
maxNodes=10000,
depthFirst=False,
DP=True)
Returns:
a list of the form [(a0, s0), (a1, s1), (a2, s2), ...]
where the a's are legal actions of c{smToSearch} and s's are states
of that machine. |
|
|
|
pathValid(smToSearch,
path)
Returns:
True if taking action a1 in state s0 results in state
s1, taking action a2 in state s1 results in state s2, etc. |
|
|