nitlanguage
/
nit.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
test_parser: add option `-x` to output XML
[nit.git]
/
lib
/
ai
/
search.nit
diff --git
a/lib/ai/search.nit
b/lib/ai/search.nit
index
64904ee
..
f406949
100644
(file)
--- a/
lib/ai/search.nit
+++ b/
lib/ai/search.nit
@@
-159,8
+159,6
@@
interface SearchProblem[S: Object, A]
# `steps` is the maximum number of steps a giver configuration can run.
fun run_configs(steps: Int)
do
# `steps` is the maximum number of steps a giver configuration can run.
fun run_configs(steps: Int)
do
- var s
-
var c = 0
loop
if astar.run_config(steps, c, "A*") then break
var c = 0
loop
if astar.run_config(steps, c, "A*") then break
@@
-597,7
+595,7
@@
class SearchSolver[S: Object, A]
print msg
var t = new Clock
print msg
var t = new Clock
- var res = run_steps(steps)
+ run_steps(steps)
print "\t{self}"
var l = t.lapse
print "\ttime={l}"
print "\t{self}"
var l = t.lapse
print "\ttime={l}"
@@
-733,7
+731,7
@@
class SearchNode[S: Object, A]
print "result:{state}"
for n in path do
var a = n.action
print "result:{state}"
for n in path do
var a = n.action
- if a != null then print " + {a or else ""}"
+ if a != null then print " + {a}"
print " {n.steps}: {n.state} ({n.cost}$)"
end
end
print " {n.steps}: {n.state} ({n.cost}$)"
end
end