Skip to Content
PythonによるAIプログラミング入門 ―ディープラーニングを始める前に身につけておくべき15の基礎技術
book

PythonによるAIプログラミング入門 ―ディープラーニングを始める前に身につけておくべき15の基礎技術

by Prateek Joshi, 相川 愛三
March 2019
Intermediate to advanced
424 pages
5h 18m
Japanese
O'Reilly Japan, Inc.
Content preview from PythonによるAIプログラミング入門 ―ディープラーニングを始める前に身につけておくべき15の基礎技術

9章人工知能を使ったゲーム

本章では人工知能を使ったゲームの作り方を説明します。ゲームに勝つための戦略を効率よく立てる探索アルゴリズムの使い方を学び、それを使って、いくつかのゲームの知的な対戦相手(ボット)を作ります。

本章では次の事柄について学びます。

  • 探索アルゴリズムのゲーム応用
  • 組み合わせ探索
  • ミニマックス法
  • アルファ・ベータ法
  • ネガマックス法
  • コイン取りゲーム
  • 三目並べ
  • 『Connect Four』
  • 『Hexapawn』

9.1 探索アルゴリズムのゲーム応用

ゲームの戦略を立てるためには、探索アルゴリズムが使われます。探索アルゴリズムを使って、多数の可能性の中から最良の次の1手を探すのです。考慮すべきパラメータは、スピード、正確さ、複雑さなどさまざまあります。探索アルゴリズムは、その時点で可能なすべての指し手を考慮し、その中から未来の一連の指し手を評価します。ゲームによって勝敗条件は異なりますが、探索アルゴリズムの目標は、最終的な勝敗条件に到達する(すなわちゲームに勝つ)ために資する最適な一連の指し手を見つけることです。

ただし、以上の説明は、対戦相手がいない場合における理想論にすぎません。現実のゲームでは、複数のプレイヤーが参加するので、これほど単純ではありません。2人対戦のゲームを考えてみます。プレイヤーが1手指すたびに、相手プレイヤーはゴール達成を妨げるような手を指してくるでしょう。したがって、探索アルゴリズムが現在の状態から最善手を見つけても、相手がそれを阻止するので、そのとおりに進めることはできません。つまり、探索アルゴリズムは、1手指すたびに常に局面を評価し直さなければならないのです。

そこで、コンピュータにゲームの状況を把握させる方法を検討します。ここでは、ゲームを探索木だと考えます。ゲーム木の各ノードは、未来の状態を表します。例えば、 ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

行動を変えるデザイン ―心理学と行動経済学をプロダクトデザインに活用する

行動を変えるデザイン ―心理学と行動経済学をプロダクトデザインに活用する

Stephen Wendel, 武山 政直, 相島 雅樹, 反中 望, 松村 草也
詳説 イーサネット 第2版

詳説 イーサネット 第2版

Charles E. Spurgeon, Joann Zimmerman, 三浦 史光, 豊沢 聡

Publisher Resources

ISBN: 9784873118727Other