Ifi6057w3: erinevus redaktsioonide vahel
Mine navigeerimisribale
Mine otsikasti
| 7. rida: | 7. rida: | ||
Videoloeng: [http://www.youtube.com/watch?v=9ZSVrUZ-vn0 BFS ja DFS] | Videoloeng: [http://www.youtube.com/watch?v=9ZSVrUZ-vn0 BFS ja DFS] | ||
== Harjutustund == | |||
def test(initial, searchfunc): | |||
p = EightPuzzle(initial, GOAL) | |||
ip = search.InstrumentedProblem(p) | |||
n=searchfunc(ip) | |||
# expanded/goal tests/leaves/(solution) | |||
print (ip) | |||
if hasattr(n, "path"): | |||
print (n.path()) | |||
else: | |||
print (n) | |||
[[Ifi6057strategies|Otsingustrateegiad harjutustunniks]] | <!--2016 [[Ifi6057strategies|Otsingustrateegiad harjutustunniks]]--> | ||
Redaktsioon: 15. september 2017, kell 10:36
3. Nädal
Ülesannete lahendamine otsinguga; AIMA chapter 3.3-3.4, TI 14-15.
Lühendatud slaidid PDF
Videoloeng: BFS ja DFS
Harjutustund
def test(initial, searchfunc):
p = EightPuzzle(initial, GOAL)
ip = search.InstrumentedProblem(p)
n=searchfunc(ip)
# expanded/goal tests/leaves/(solution)
print (ip)
if hasattr(n, "path"):
print (n.path())
else:
print (n)