课程: AI Algorithms for Game Design with Python
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Solution: A perfect cat in a small world - Python教程
课程: AI Algorithms for Game Design with Python
Solution: A perfect cat in a small world
(exciting music) - [Instructor] Let's look at my solutions, starting with max value. Starting at line 210, we have the logic for terminating the search just before time is up. The last call, MS constant is 0.5. So, half a millisecond before the deadline we start a chain of returns until we reach level 0 and return timeout. The first part you have to add was to check for terminal states, and that's in line 216. Since this is a max node, it's the cat's turn, and so a terminal state occurs when there are no legal moves left for the cat. That's why the check is as simple as legal moves being empty. Now, lines 217 through 219 have the action to take when we are at a terminal state. Take a moment to read this and make sense of it. Basically, it gives more importance to levels that are closer to level 0 and less importance to deeper levels when calculating the utility, which is a large negative number. That's because losing is the worst outcome for the cat. The sooner the defeat, the more we…
内容
-
-
-
-
Minimax overview4 分钟 1 秒
-
(已锁定)
Minimax example5 分钟
-
(已锁定)
The minimax algorithm3 分钟 41 秒
-
(已锁定)
A word on complexity2 分钟 45 秒
-
(已锁定)
Challenge: A perfect cat in a small world4 分钟 49 秒
-
(已锁定)
Solution: A perfect cat in a small world8 分钟 24 秒
-
Alpha-beta pruning5 分钟 32 秒
-
(已锁定)
The alpha-beta search algorithm5 分钟 9 秒
-
(已锁定)
Challenge: A pruning cat49 秒
-
(已锁定)
Solution: A pruning cat2 分钟 19 秒
-
-
-
-
-