课程: AI Algorithms for Game Design with Python
免费学习该课程!
今天就开通帐号,24,700 门业界名师课程任您挑!
Solution: Write your own evaluation function - Python教程
课程: AI Algorithms for Game Design with Python
Solution: Write your own evaluation function
(upbeat music) - [Narrator] So let me show you my solution. As mentioned in the challenge instructions, all the to-do comments are merely suggestions. You were expected to come up with your own intelligent evaluation function. My solution will follow the suggestions in the comments. That is a combination of two scores for rewards and one for penalties. The first score is in line 218, and it uses my moves evaluation function. Notice that I'm normalizing this value by dividing it by six because there are at most six possible moves for the cat. That is move score will be a floating point number between zero and one. Next, in line 221, we have a proximity score that uses my straight exit evaluation function. This is also normalized to become a real number from zero to one. Then in lines 224 through 226, we calculate the Euclidean distance between the cat and the center of the hex grid, and from lines 228 to 230, I'm producing a penalty. based on this distance. We are penalizing a cat that…
内容
-
-
-
-
-
(已锁定)
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 秒
-
(已锁定)
-
-
-