课程: AI Algorithms for Game Design with Python
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Solution: A depth-limited cat - Python教程
课程: AI Algorithms for Game Design with Python
Solution: A depth-limited cat
(upbeat music) - [Instructor] Let's look at my solution. I will only show this to you in the Minimax implementation, but you'll see that the same logic is going on in the Alpha-beta implementation as well. So let's revisit the max value method. Notice in line 293 that we are checking if depth equals max depth. If so, we set the reached max depth flag and return the cat's location to give up and the result of the evaluation function. That's it. So let's see this cat working with the straight exit evaluation function. Remember, this one favors the cat's clear path to an exit on a straight line. The closer to the edge the better. Now that we have the power of limited depth, we can use very small trees and see how long it takes regardless of the size of the hex grid. So let me uncheck Alpha=Beta Pruning and select limited depth. Let's say we want a limited depth of one, this cat will respond very quickly. Oh, and what do you know? The cat won. So with a limited depth of one, this cat made…
内容
-
-
-
-
-
(已锁定)
Depth-limited search3 分钟 50 秒
-
(已锁定)
Writing good evaluation functions6 分钟 55 秒
-
(已锁定)
Is alpha-beta pruning still relevant?2 分钟 32 秒
-
(已锁定)
Challenge: A depth-limited cat4 分钟 10 秒
-
(已锁定)
Solution: A depth-limited cat3 分钟 35 秒
-
(已锁定)
Challenge: Write your own evaluation function1 分钟 8 秒
-
(已锁定)
Solution: Write your own evaluation function3 分钟 7 秒
-
(已锁定)
-
-
-