Evan Sheehan | Generative Art Proposal | Darwinian Egg Drop
For my generative project I am planning to do an egg drop simulation. The egg drop, for those that may not know, is a staple activity in most public elementary school science curriculums. The challenge is to design and build a container that will protect a raw egg when dropped from a specific height.
I recall doing this several times throughout my education as a child. Each time I zealously over-designed my solutions, and I don’t believe I ever successfully protected the eggs from harm. I intend to conquer this challenge once and for all by having a computer design my solutions for me.
Initial Concepts
Predator-prey simulation using flocking
I explored several different simulation ideas initially. They were all largely based on flocking algorithms. My original idea (bottom-right) was a simulation that used flocking algorithms to mimic an environment of predators and their prey. The idea was to track the populations of each species and compare that to the predicted behavior according to the Lotka-Volterra equation.
Evolve flocking creatures within an ecosystem
My second idea (bottom-left) was to create an evolutionary ecosystem where the animals (the triangles) were competing for food (the dots). Every X clock cycles the fitness of each animal is evaluated and they breed, evolving new animals. Parameters that would vary across creatures might be things like their maximum speed, propensity to wander, and their sensitivity to food.
Simulated dog fight
A third idea (top-right) was to create a dog-fight simulation. Possibly once an entire side of the battle had been defeated, you could evaluate the fitness of each ship and recombine them to create a new generation of ships and watch the battle evolve that way. Otherwise you might just watch the ships chase each other around the screen and be able to tune the parameters manually to see what different effects they have.
Evolutionary Egg Drop
At some point during all of this, I had the idea for the egg drop simulation. The idea of revisiting this design challenge from my childhood was so appealing that I immediately abandoned my desire to play with flocking algorithms in order to pursue it.
Evolving Egg Cartons
Containers can vary by rigidity, size, and wind resistance
One of the first things I began to consider is what qualities of a potential egg container could be made variable such that a variety of containers can be generated and bred together. One common solution to this problem in reality is a parachute, so wind resistance is an obvious quality that can probably be easily mimicked. Another common solution is to wrap the egg in a lot of packing material to dissipate the force of impact. I can probably create a similar effect by suspending the egg inside the container using springs of varying length and rigidity.
Evaluate fitness to evolve not just a solution, but an efficient solution
It’s not enough to consider a solution fit if the egg survives. That could easily lead to boring solutions that just increase the wind resistance or springiness of the container until the egg survives. I want a variety of spring lengths, rigidity, and wind resistance for the solutions, so I think I’ll need to develop some kind of measure of efficiency in addition to ensuring the survival of the egg. My hope is that this process will converge on local maxima contingent upon the random initial conditions, rather than always evolving the same solution.
I can penalize high wind resistance by trying to minimize the amount of time it takes the egg to reach the ground. I will also attempt to assign some cost to having overly long springs. The spring rigidity may not need special consideration in the fitness function: if the springs are too loose, the egg will bang into the ground; if the springs are too rigid, they’ll just transmit the force directly to the egg and break it.
Toxiclibs Implementation
I’m looking at Toxiclibs to implement this simulation. Toxiclibs gives me springs, gravity, and 2D meshes. My hope is that by subclassing some of these tools, I can access the data I need to evaluate a container’s fitness and breed new ones. By Thursday I hope to have at least a 2D mesh egg that breaks when dropped. If I can implement at least this much, I should have a sense for how much trouble I’m in on this project.