Quotulatiousness

February 25, 2011

Friday fun link: BoxCar2D

Filed under: Randomness, Science — Tags: , , — Nicholas @ 07:48

Watch the Darwinian struggle of car evolution: http://www.boxcar2d.com/.

The program learns to build a car using a genetic algorithm. It starts with a population of 20 randomly generated shapes with wheels and runs each one to see how far it goes. The cars that go the furthest reproduce to produce offspring for the next generation. The offspring combine the traits of the parents to hopefully produce better cars. Now with the button at the bottom left u can choose to input cars and different terrains. This lets people post their results and even design a car by hand.

It uses a physics library called box2D to simulate the effects of gravity, friction, collisions, motor torque, and spring tension for the car. This lets the car be a wide range of shapes and sizes, while still making the simulation realistic. This is based on the AS3 box2D flash port of the library. Watch the demo of some of its capabilities.

My inspiration for this project comes from qubit.devisland.net/ga. My implementation uses the physics library to make the car a real object instead of two point masses. There are also many extra variables because of the complicated car and axles and the color cleary illustrates the evolution.

H/T to DarkWaterMuse for the link.

No Comments

No comments yet.

RSS feed for comments on this post.

Sorry, the comment form is closed at this time.

Powered by WordPress