Submitted by Koning_Health t3_ynky8r in askscience
Brainsonastick t1_ivcs3cn wrote
Reply to comment by MrRumfoord in Insects get stuck in a spider's web, why doesn't a spider get stuck in its own web? by Koning_Health
You can simulate it! There’s a class of algorithms called genetic algorithms. Basically, you write a code to convert from a string of characters to an object whose fitness you can test. In this case, a string of positions at which to fold the paper.
Then, you generate a bunch at random, test their fitness, and have the best ones interbreed. That means combining their strings (in a meaningful way) and adding random mutations.
That’s your new generation. Keep doing this over and over again and you’ll find the fitness of your planes, on average, increases each generation. After enough generations, you’ll get some pretty decent planes (assuming your code is good). Some might even be recognizable but a lot will super weird and surprising that they work at all.
There’s a simple video of a genetic algorithm evolving simple cars. It generates one capable of completing the track in only 37 generations. That sounds like a long time but on an evolutionary scale, it’s nothing. On a computer simulation time scale, it’s nothing.
Viewing a single comment thread. View all comments