Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked

AI -- Artificial Intelligence

by dimmesdale (Friar)
on Jun 29, 2001 at 02:38 UTC ( [id://92487] : perlmeditation . print w/replies, xml ) Need Help??

I did some searches on the site, and very little has actually been discussed about Artificial Intelligence--or so I found.

I was wondering if any one has worked with it, specifically with perl, or otherwise, and how they think perl can be involved. AI is an important issue in computer programming(in particular, in games), and I was also wondering what were some common techniques some people have used.

Personally, I know that one vital aspect of AI is a look-up table, so to say, of past events; a memory, if you will. Also, to make characters smarter in a game, you can make new instances of those characters by borrowing some elements that can be within a certain range from two other parents--which are the same type, but have survived whereas others have not. This gives an effect of natural selection: "survival of the fittest".

That aside, however, I was wondering specifically as to where the future of AI lies, specifically with Perl. Is there anything special about it that makes it easier?

Replies are listed 'Best First'.
Re: AI -- Artificial Intelligence
by princepawn (Parson) on Jun 29, 2001 at 02:47 UTC
    You might want to join the mailing list.

    Ken Williams presented AI::Categorize recently.

    I just read an article on the Semantic Web recently and the following quote tickledme:

    it is a curious phenomenon that the AI label tends to get dropped once the problem AI researchers were studying becomes tractable to some degree and yields practical systems. Voice recognition and text-to-speech, expert systems, machine vision, text summarizers, and theorem provers are just a few examples of classic AI tech that has become part of the standard bag of tricks. The AI label tends to mark things which aren't yet implemented in a generally useful manner, often because hardware or general practices haven't yet caught up.

    I recently authored Array::PatternMatcher which is a Perl transliteration of the Pattern Matcher presented in "Paradigms of Artificial Intelligence Programming: Case Studies in Common Lisp" by Peter Norvig. I was going to create some sort of CPAN module after that that offered Prolog semantics with Perl syntax but thought it wiser to create perl bindings for SWI-Prolog instead.

Re: AI -- Artificial Intelligence
by Masem (Monsignor) on Jun 29, 2001 at 04:13 UTC
    I've twiddled with a number of AI algorithms, not necessarily in perl, but there's a lot going for perl in this area, specifically the fact that most AI's are not normal thought of in terms of interactions with the OS to any great extent, and using perl allows this interaction to occur. (Not that other languages can't do this, but perl makes the process much easier). This allows for more interesting uses of perl and AI; for example, I am attempting to develop a rules-based system that can be used as a possible backend of a socket connection for business logic. The possiblities are , of course, endless.

    Dr. Michael K. Neylon - || "You've left the lens cap of your mind on again, Pinky" - The Brain
      for example, I am attempting to develop a rules-based system that can be used as a possible backend of a socket connection for business logic.
      I think the hardest part of mating logical formalism with Perl is that rules systems (ie, Prolog) have a built in search engine and a different means of using variables.
      This allows for more interesting uses of perl and AI; for example, I am attempting to develop a rules-based system that can be used as a possible backend of a socket connection for business logic
      If you consider functional languages rule-based, then Erlang is the ticket for networked functional programming. The phone switching software for country Sweden was written entirely in Erlang.
Re: AI -- Artificial Intelligence
by arhuman (Vicar) on Jun 29, 2001 at 13:10 UTC
    Even if I must admit I was quite deceived by IA results... (except in speech recognition)
    I still believe that things remain to be found.
    I can't believe that with the computers, the language, the theory we have now,
    we aren't able to do something more efficient...
    To my mind you should mix different methods depending on your needs.

    Here are some methods I like to use :
    • Genetics Algorithms.
      Each time I read 'survival of the fittest' it comes to my mind.
      Each time I've to tweak/optimize complex function that I can "rate" the result I choose this techniques too...
      Although transcoding your parameters for efficient crossing-over may be a REAL task...
      (see Masem's work : Algorithm::Genetic or the infamous Genetic Programming or breeding Perls)

    • Neural networks.
      To classify complex objects (picture,sound).
      To create simple semi-adaptative behaviour.
      (tons of links on the web, here is start, CPAN has some modules too...)

    • Computationnal Optimization(Simplex, simulated annealing...)
      Not really IA, but I like to combine with others techniques.
      (See Math::Amoeba for the simplex)

    • "Inferential Theory of Learning" from Michalsky
      He did a wonderful job in formalizing the "learning process"...
      Every symbolic learning engine could take benefit of it...

    • Sorted Alpha-Beta.
      For turn by turn process, with only one action at each step (chess play...)

    Now speaking about Perl, I think that knowledge and logic (predicate) are well suited to be described with string,lists,hash...

    Please tell us informed about what you do, beccause it's a very interesting topic to my mind...

    UPDATE : shotgunfx comment lead me to add the alpha-beta entry...

    "Only Bad Coders Code Badly In Perl" (OBC2BIP)
      Please tell us informed about what you do...
      I presume you are talking to me? . . .

      Well, I only ask because I am thinking about programming a game. I've read up on some topics--Tricks of the Game Programming Gurus, and 3D Game Programming With C++--quite a while ago, and I'm renewing my interest with it.

      I'm trying to organize in my mind how I'm going to implement the brains, i.e., AI, of the characters, and I was hoping to get some more input onto the subject (thanks to princepawn about the AI perl newsgroup). For one example, if a character needs to find the player then I have a variety of searching and chasing algorithms. However, I need to choose the one most suitable for the character; for example, a primitive, easy, character would probably get the 'guess and check' method. However, that primitive character would probably be allowed a simple ability to learn bits and pieces of more advanced methods if he happened to see it, somewhat taught it to him, etc.

      Right now I'm thinking about how smart to make certain characters, and once I've decided that how to make them that smart. The challance is, of course, judging how smart to make them, because it's easy to make an impossible to beat AI, making a challanging one, and one with an unique personality, however, is the challange.

      I'm looking, now, at different people's advice on the subject, and at different implementations of it. A challange I've arrived at is the actual data implementation of the 'brain'. If any one has any experience with this, I'd be grateful.

      Well, I guess I got somewhat of the subject, but I hope I've answered the question suitably enough for you.

        Years back I did game development. What passes for AI will really depend on what type of game it is. For instance, I was working on a driving game, so we came up with ADI (Ass**** Driving Intelligence). The goal was to make people drive as badly as real people. (I'm from Massachusetts btw) So our goals were to mimic how people really drive. An RPG or a Quake style shooter have very different ideas of intelligence. Also, unless it's turn based, speed will be an issue as well.

        As far as the searching method in your example, I would think the best way would be to define this "attribute" with a range, say 1..5.

        Then I would define 5 (or however many) search algorithims as functions and call the appropriate one based on the entity's level. When you decide he's getting smarter, bump up his search "attribute" level.

        You could also take an opposite approach and only have one ideal search and have a clutter factor that adds randomness to the result. This clutter factor would get reduced as the character gets "smartah"


        "To be civilized is to deny one's nature."
Re: AI -- Artificial Intelligence
by chipmunk (Parson) on Jun 29, 2001 at 05:29 UTC
    By the way, A.I. Artificial Intelligence opens tomorrow in the US and Canada. I don't know if Perl was involved in the production, however. :)