本文介绍了Java中用于Minimax算法的树表示的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在Java中实现Minimax算法. 我找不到很好的树表示形式.有没有现成的,或者我应该自己做?
I want to implement the Minimax algorithm in java. I couldnt find a good tree representation. Is there an existing one or should I make my own?
- 顺便说一句,这是针对吃豆子游戏的 谢谢
- by the way this is for the pacman game Thanks
您不需要一个.
经常用树来说明minimax算法.
The minimax algorithm is frequently illustrated with a tree.
但是,该树表示算法选择最佳移动所采取的步骤.它不是算法所拥有的数据结构.
However, that tree represents the steps taken by the algorithm to choose the best move. It is not a data structure held by the algorithm.
相反,您将使用 iteration 和递归.在树的每个内部节点上,您将遍历子级,并对每个子级使用递归.
Instead, you'll use iteration and recursion. At each interior node of the tree, you'll iterate through the children, and use recursion on each child.
更多推荐
Java中用于Minimax算法的树表示
发布评论