Articles / AI Application Programming

AI Application Programming

Books on Artificial Intelligence (AI) have to walk a line between being too scholarly and too fluffy. Some books are very academic, with lots of formulas and symbols and a dearth of practical applications. Others are high-level, with much visionary hand-waving but no code. M. Tim Jones' book manages to maintain a nice balance between these extremes.

Contents

  1. History of AI
  2. Simulated Annealing
  3. Introduction to Adaptive Resonance Theory (ART1)
  4. Ant Algorithms
  5. Introduction to Neural Networks and the BackPropagation Algorithm
  6. Introduction to Genetic Algorithms
  7. Artificial Life
  8. Introduction to Rules-Based Systems
  9. Introduction to Fuzzy Logic
  10. The Bigram Model
  11. Agent-Based Software
  12. AI Today

What I liked

A book on AI has to begin with a discussion of what AI is and where it has been. The first chapter does just that, giving an overview of the history of AI from 1940 onwards, including the contributions of several of the major figures in AI research (Alan Turing, Marvin Minsk, and so forth). He also makes the point that this book is going to be about weak AI, that is, "features that have been added to systems to give them intelligent qualities", as opposed to strong AI, which involves attempts at making computers think like humans. This sets up expectations for a discussion of pragmatic usages of AI techniques rather than a defense of AI as a field of study.

This book covers ten fields of AI research in 350 pages, and surprisingly, it does it well. For example, the chapter on simulated annealing is only twenty pages long, but it's twenty pages of good material. There's an application of the technique to the n-queens problem, some charts showing the decreasing energy and temperature as a simulated annealing solution progresses, and some illustrative code snippets from the sample programs.

Each chapter is concluded with a one- or two-page summary and a list of some applications of the topic. For example, the chapter on genetic algorithms (GAs) ends with a note about a symbolic problem (Towers of Hanoi) and an actual problem encountered by the author (star tracking), both of which have been addressed using GAs. This provides enough information to be useful for seeding a Google search without being overwhelming.

The chapter I liked the best was on fuzzy logic. It's a short chapter (only twenty pages) but it has some nice diagrams of membership functions, a nifty chart of the predator/prey example, and a good discussion of the sample code. Furthermore, the sample code provides several membership function profiles, so it's actually useful outside of the example; it could serve as the beginning of a fully-functional fuzzy logic library. After reading this chapter and working through the examples, I've been able to understand some discussions in other AI books on the topic with no problems. Just one minor nit: The Fuzzy Control Language (IEC 61131-7) could have been given a short mention in this chapter, but there's only so much space.

The sample programs are what really made this book valuable for me. At least one sample program is provided to illustrate how each topic can be applied to a problem. The programs are written in compact, well-commented C (make files are included), and they ran without a hitch on my Linux workstation. I found myself reading a section of the book, tweaking a #define or two in the sample program, and recompiling and rerunning to see the effects. It's especially nice that the code is not overly complicated. There are some structs and some pointers, but no gratuitously complex uses of macros or setjmp()/longjmp(). The CD contains all the sample programs, and it only holds about 400K of actual data, so it's easy to copy the information to your hard drive and to get the samples compiled and running.

Note that the fact that lots of actual code is provided doesn't mean that there are no theoretical underpinnings discussed. The "Ant Algorithms" chapter, for example, spends a few pages discussing Hamiltonian graphs (i.e., the Traveling Salesman problem) and shows how the ant movement algorithm is structured. The other chapters are the same, a bit of theory followed by the implementation of a sample application.

What I didn't like

There were a few typos in the book. In one place, it looked like a code sample had been copied and pasted accidentally. The author provided me with an errata file, though, and the problems should be corrected in the second printing of the book (which was due in October 2003).

Translating the sample code

In order to study the book, I began a little Open Source project to translate the examples from C to Ruby. The author has been very supportive of this effort, and it's been a good review of C and has helped me understand the sample programs much better. I chose Ruby as the translation target because it's compact and reasonably fast, and its dynamic nature seems to lend itself well to AI programming. It's also nice not to have to compile the examples, since Ruby is interpreted.

As part of the translation project, I've included some general notes on translating C code to Ruby. There's nothing spectacular there, but there are a few things which have bitten me that other folks may find interesting.

Conclusions

If you're getting a PhD in computer science, this book will not go deeply enough into each topic to make you happy. But if you're a programmer who's interested in getting an overview of artificial intelligence programming techniques for use in your work, or if you're writing a game and you want to provide some semi-intelligent behavior for your non-player characters, this is an excellent investment. You'll get a good overview of how things work, and you'll have some sample code to show you how to get started.

RSS Recent comments

15 Nov 2003 01:42 brainless

Related subject - Cognitive Architectures
Good piece, congrats !

Just want to add one thing - AI is not the only thing about "intelligence", there's another field known as "Cognitive Architectures" is making waves in the Robotic arena.

Many folks who are playing with Lego Mindstorm are applying the Cognitive Architecture approaches to make their robot to act a little bit more life-like.

You can obtain info from the following page: ai.eecs.umich.edu/coga...

15 Nov 2003 10:09 elanthis

Game AI
On a slightly different tangent, for those less interested in AI for acedamia and industry, and more for fun and entertainment, the book AI Game Programming Wisdon (Charles River Media, ISBN 1-58450-077-8) is absolutely excellent. Charles River Media has a bunch of good gaming programming/design books, including the excellent Game Programming Gems series. The AI Wisdom book is packed with tons of topics, including pathing, tactical analysis, racing/sports AI, learning systems, fuzzy logic applications, and tons more stuff. Very useful book if you like your games to have NPCs/enemies act a little more intelligent than those in Gauntlet. ~,^

15 Nov 2003 16:53 tcopeland

Re: Game AI
> AI Game

> Programming Wisdon (Charles River Media,

> ISBN 1-58450-077-8) is absolutely

> excellent.

Very true! There's a good chapter on fuzzy logic in that book, too, written by the author of FFLL (ffll.sourceforge.net/).

23 Nov 2003 17:06 sholden

Re: Related subject - Cognitive Architectures

> You can obtain info from the following page:
> ai.eecs.umich.edu/coga...

Hooray for web pages which send HTML as text/plain.

08 May 2004 01:44 knifemakers

Re: Game AI

> On a slightly different tangent, for
> those less interested in AI for acedamia
> and industry, and more for fun and
> entertainment, the book AI Game
> Programming Wisdon (Charles River Media,
> ISBN 1-58450-077-8) is absolutely
> excellent. Charles River Media has a
> bunch of good gaming programming/design
> books, including the excellent Game
> Programming Gems series. The AI Wisdom
> book is packed with tons of topics,
> including pathing, tactical analysis,
> racing/sports AI, learning systems,
> fuzzy logic applications, and tons more
> stuff. Very useful book if you like
> your games to have NPCs/enemies act a
> little more intelligent than those in
> Gauntlet. ~,^

Thanks for suggesting the book, i've just checked around for it and it seems to be a great find. I'll let you know how my reading on it goes :D

18 Jun 2004 16:42 Avatar LionKimbro

Wiki for AI
There are two wiki I know of for AI work: the AI wiki, (www.ifi.unizh.ch/ailab...) and the AI Algorithms Wiki. (ai.squeakydolphin.com/...)

So, if you want to keep and share some notes with people as you learn about AI, check out those wiki! {:)}=

12 Jul 2004 07:53 AndrewCates

UK purchase
THe URL above only handles US purchasers. If you want to buy in the UK then the best I could find was Uk purchase (www.computer-mentors.c...)

Please note that I have no link with this purchase organisation

BozMo (catesfamily.org.uk/)

07 Sep 2004 08:13 GulDukat

German translations?
Anybody knows of a good german book or site about this topic ?

My english isnt that good to really understand such a complex thing when it is written in english.
Maybe this book also has a translation into german?
Thanx a lot

GulDukat

--

My little Site :) (www.hau-rein.org)

09 Dec 2004 08:59 modbot

Re: Wiki for AI

> There are two wiki I know of for AI

> work: the AI wiki, and the AI Algorithms

> Wiki.

>

> So, if you want to keep and share some

> notes with people as you learn about AI,

> check out those wiki! {:)}=

Wow, I did not know about AI Wiki. Pretty Cool!

31 Jul 2005 04:37 jessicajessica

tshirt famers
Never got a reply sent an email months ago. I am webmaster for a non profit organization www.liversociety.org and can write and have thousands of pages I would like to publish.

10 Aug 2005 10:04 jimmyjim

Great Book
i loved reading this and your right it kept a great line of understanding. What i liked best about it was its easy ot understand writings.

25 Oct 2005 17:55 Pfv2

good review
I own this book, and I must say it is a good introduction book and it provide an overview of some important subjects, that you can then dig by yourself if you want to.

Get this one!

Screenshot

Project Spotlight

Clement

An SMTP server used to filter unwanted mail at the SMTP protocol level.

Screenshot

Project Spotlight

NBit

A tool that computes CRCs with standard as well as custom polynomials.