课程: AI Algorithms for Game Design with Python

免费学习该课程!

今天就开通帐号,24,700 门业界名师课程任您挑!

Minimax example

Minimax example

- [Instructor] So let me show you how min and max works on the tree we just saw. The only argument we need is the current state of the game. At the moment, we are called to produce our next move. This is the top max node. Now, recall that min and max operates in a depth first traversal. This is the order of evaluation you'll see in this example we'll go from left to right. Recall that we have three possible moves: A, B, and C. So the agent is going to decide which of these three moves minimizes our maximum loss, or in other words, which of these moves will yield the best result for us? Since this is a max node, we are going to choose the maximum of these three options. So we start by analyzing move A. This produces a new state in a min node, which in turn has three possible moves. Notice that to choose the minimum value here, we need the values, so we need to dig deeper. Starting at the leftmost move, which takes us to yet another max node. Again, we need scores, so we keep on…

内容