我需要实现一个类似3-5-8的纸牌游戏,但在选择A.I.实现的正确方法上遇到了问题。是否可以使用像OpenRules业务决策管理系统这样的软件包来创建游戏A.I.?我也看过Drools,但它似乎太复杂了。
一般来说,专家系统是否适合这种A.I.开发?
回答:
这取决于你的解决方案是使用启发式方法还是算法(或者可能是两者的结合)。例如,在国际象棋中,你对游戏状态有完全的了解,可以提前计划回合,因此一个极小极大算法可以让你在给定的搜索深度找到一个“最优”解决方案。在无法确定最优解决方案或难以确定最优解决方案的情况下(因为游戏状态不完全已知,涉及运气,或者玩家选择的数量太大而无法考虑),可以使用启发式的“足够好”解决方案。例如,你可以根据手中的牌和其他玩家显示的牌,轻松创建基本的启发式方法来决定在 blackjack 或扑克游戏中该做什么。这些简单的启发式方法随后可以扩展以包括额外的启发式方法。
以下是一套简单的规则(即启发式方法)来赢得纸牌游戏中的一墩:
Rule FirstPlayHighTrump When You're playing the first card and You have trump cards Then Play the highest trump card in your handRule FirstPlayHighCard When You're playing the first card and You don't have trump cards Then Play the highest card in your handRule PlayHighCard When You're not playing the first or last card and You have a card to win the trick Then Play the highest card in your hand that will win the trickRule PlayLowCard When You don't have a card to win the trick Then Play the lowest card in your hand Rule LastPlayLowestCardToWin When You're playing the last card and You have a card to win the trick Then Play the lowest card in your hand that will win the trick
这些规则/启发式方法比随机选择跟随花色的牌要好,但由于它们不涉及为赢得下一墩做计划,因此可以改进。