ai :: SearchSolver :: run_config
i
, for steps
number of steps.The message msg
suffixed by the name of the configuration is printed followed by the result
This method is used by SearchProblem::run_configs
# Run the configuration number `i`, for `steps` number of steps.
# The message `msg` suffixed by the name of the configuration is printed followed by the result
#
# This method is used by `SearchProblem::run_configs`
fun run_config(steps: Int, i: Int, msg: String): Bool
do
do
if i == 0 then
msg += " -mem"
memorize = false
break
end
i -= 1
var mems = problem.make_memory
memory = mems[i % mems.length]
msg += " {memory.class_name}"
i = i / mems.length
if i % 2 == 0 then
msg += " +mem"
memorize = true
memorize_late = false
else
msg += " +mem_late"
memorize = true
memorize_late = true
end
i = i / 2
if i % 2 == 0 then
msg += " +revisit"
do_revisit = true
else
msg += " -revisit"
do_revisit = false
end
i = i / 2
if i >= 1 then return true
end
print msg
var t = new Clock
run_steps(steps)
print "\t{self}"
var l = t.lapse
print "\ttime={l}"
return false
end
lib/ai/search.nit:553,2--603,4