Ryandor.com

Forums
It is currently Wed Jul 02, 2025 9:19 pm

All times are UTC - 7 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Mon Oct 03, 2005 3:30 pm 
Offline
Peanut Gallery
Peanut Gallery
User avatar

Joined: Sun Jun 02, 2002 8:53 pm
Posts: 1864
Location: Hayward, CA
I have been working on a fun little program that uses genetic algorithms to evolve artificial neural-network-controlled bugs. They begin with randomly generated brains with the input of the direction in which the closest piece of food is, and the two outputs representing left and right movement speed. The first generation invariably begins with dozens of bugs that do little more than chase their tails all day. After about 100 generations, they begin making obviously deliberate movements towards food. After 300 generations, they are usually competing and flocking for food in interesting ways.

Anyway, curious of what would happen, I left the simulation running for a few hours while I did chores, and came back to something very startling! The amount of food in their world is fixed at a constant 50 pieces ? as soon as one piece was eaten, another would appear somewhere else. The 300th generation bug averaged 30 pieces of food in a lifetime. When I got back, it was a little over 500 generations, and each bug was averaging 20,000 pieces of food! Purely impossible, I said to myself, knowing full well that they could not possibly move quickly enough. I turned on the rendering mode (which slowed the simulation to something you can watch), and was stunned to see the entire world COVERED with food. I quickly began tearing apart the memory using various debuggers and found something very interesting ? a small glitch I had made, where an array index was not checked, thus allowing possible (but extremely unlikely) overflow into the max food variable? well, the little bugs somehow evolved to exploit that glitch, and managed to increase the amount of food in the world at an exponential rate! :?

You know you are a bad programmer when a bug in your program learns to exploit another bug in your program...

_________________
Blog: http://www.sydius.org
Web: http://www.sydius.net


Top
 Profile  
 
 Post subject:
PostPosted: Mon Oct 03, 2005 7:53 pm 
Offline
Posting Whore
Posting Whore

Joined: Fri Aug 29, 2003 6:21 pm
Posts: 1434
Location: Colorado Springs, Co.
Thats sort of cool actually.

There are several dozen share ware AI programs and fuzzy logic programs running around the net. MIT had a pretty cool one a few years ago.

Dev

_________________
"So...if crazy people don't know their crazy...does that mean your only sane if your know your crazy?"


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 04, 2005 8:22 am 
Offline
Peanut Gallery
Peanut Gallery
User avatar

Joined: Sun Jun 02, 2002 8:53 pm
Posts: 1864
Location: Hayward, CA
If you go to ai-junkie.com, they have a neat tutorial that teaches you in easy-to-understand language how to write the exact program I just made (minus the buffer overflow -- that was my addition).

I am trying to speed it up and expand it, and thus understand it as well as I can. The code the author uses is usually considered ?poor? by today?s standards, so I am also trying to write cleaner classes, etc.

I will also make it so you can save the state of the world and reload it later, thus allowing much easier long-term evolution. After that, I hope to add the ability for each bug to have a different (evolved) size of brain, as well as physical traits that would evolve. Then, I will dive into the world of speciation and try to get several distinct species of bugs to develop.

If I ever get that far (I probably won?t), I want to also refine the input sensory system. Giving the bugs too much information initially is a VERY bad idea, because it would take too long for them to evolve an ability to use it effectively. Instead, I hope to make it possible to slowly add more and more input systems over time, a little at a time, so that they can gradually evolve to use them.

Right now, the only input the bugs have is the direction they are facing and the direction of the nearest piece of food. Over time, I would like to gradually replace that with the true ?image? of what they would see ? feed them a cone-shaped snapshot of the world in front of them, basically, and hope they develop enough image recognition capabilities to still find food. From there, who knows what I might evolve. :)

_________________
Blog: http://www.sydius.org
Web: http://www.sydius.net


Top
 Profile  
 
 Post subject:
PostPosted: Tue Oct 04, 2005 6:40 pm 
Offline
Posting Whore
Posting Whore

Joined: Fri Aug 29, 2003 6:21 pm
Posts: 1434
Location: Colorado Springs, Co.
Oh I know where it will go...

6'4" with short cropped blond hair wearing black leather and a sawed off shotgun riding a hawg down the freeway shooting at some chic in a jeep! :P

"I'll be back!"

Dev

_________________
"So...if crazy people don't know their crazy...does that mean your only sane if your know your crazy?"


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 7 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group