【发布时间】:2015-12-04 06:40:44
【问题描述】:
我已经阅读了很多关于极小极大算法的文档以及它在井字游戏中的实现,但我真的很难应用它。 以下是我阅读过的链接1、2、3、4、5 以及使用 java 的示例6
考虑伪代码:7
function minimax(node, depth, maximizingPlayer)
if depth = 0 or node is a terminal node
return the heuristic value of node
if (maximizingPlayer is TRUE) {
bestValue = +∞
for each child of the node {
val = minimax(child, depth-1, FALSE)
bestValue = max(bestValue, val)
}
return bestValue
} else if maximizingPlayer is FALSE {
bestValue = -∞
for each child of the node {
val = minimax(child, depth-1, TRUE)
bestValue = min(bestValue, val)
}
return bestValue
}
这是我的问题:
1.我将传递给签名节点的内容是当前玩家的有效动作吗?
2. 什么是 + 和 - 无穷大,它们的可能值是多少?
3. minimax 和板上占用的cell 是什么关系。
4. 什么是子节点,如何从中提取值?
5. 如何确定最大允许深度?
【问题讨论】:
标签: algorithm artificial-intelligence minimax