PDA

View Full Version : روش ایجاد یک درخت مینی ماکس MiniMax



hbi
چهارشنبه 17 بهمن 1386, 22:44 عصر
در مورد روش ایجاد یک درخت minimax چگونه عمل کنم ( تئوری بازی در هوش مصنوعی )

whitehat
پنج شنبه 18 بهمن 1386, 00:45 صبح
تولید درخت مینی ماکس به نقل از ویکی (http://en.wikipedia.org/wiki/Minimax)

function minimax(node, depth)
if node is a terminal node or depth = CutoffDepth
return the heuristic value of node
if the adversary is to play at node
let beta := +∞
foreach child of node
beta := min(beta, minimax(child, depth+1))
return beta
else {we are to play at node}
let α := -∞
foreach child of node
α := max(α, minimax(child, depth+1))
return α