Skip to Content
アルゴリズムクイックリファレンス 第2版
book

アルゴリズムクイックリファレンス 第2版

by George T. Heineman, Gary Pollice, Stanley Selkow, 黒川 利明, 黒川 洋
December 2016
Intermediate to advanced
440 pages
9h 44m
Japanese
O'Reilly Japan, Inc.
Content preview from アルゴリズムクイックリファレンス 第2版
234
7
章 
AI
における経路探索
7.9.3
 解
A*
探索
は、評価関数が最小のものを効率的に取り出し、特定の盤面状態のものが
存在するか効率的に判定できるような形でオープンな盤面状態を貯える。例7-8に、
Java
実装の例を示す。
7-8
A*
探索の実装
public Solution search(INode initial, INode goal) {
//
初期状態から始める。
int type = StateStorageFactory.PRIORITY_RETRIEVAL;
INodeSet open = StateStorageFactory.create(type);
INode copy = initial.copy();
scoringFunction.score(copy);
open.insert(copy);
//
ハッシュ表を用いて、既に訪問した状態を保持する。
INodeSet closed = StateStorageFactory.create(StateStorageFactory.HASH);
while (!open.isEmpty()) {
//
最小評価関数を持つ節点を取り除き、クローズ集合に移す。
INode best = open.remove();
//
目標状態に到達していたら終了する。
if (best.equals(goal)) { return new Solution (initial, best); }
closed.insert(best); ...
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.
Start your free trial

You might also like

Rではじめるデータサイエンス

Rではじめるデータサイエンス

Hadley Wickham, Garrett Grolemund, 黒川 利明, 大橋 真也
プログラミングRust 第2版

プログラミングRust 第2版

Jim Blandy, Jason Orendorff, Leonora F. S. Tindall, 中田 秀基
詳説 イーサネット 第2版

詳説 イーサネット 第2版

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

Publisher Resources

ISBN: 9784873117850Other