boxes

(November 2010)

The idea was to render a bunch of wireframe 3D boxes, arranged to look like a given target image.

The arrangement is done using a genetic algorithm. For a similar but different foray into evolutionary art, take a look at vat.

This is me just playing around with the renderer and 3D engine:

Here's a run with a target image:

I'm pretty happy with this, although there are too many boxes packed tightly into the dark areas. (TODO: fix this)

tweaking the genetic algorithm

I use a steady-state population, run two lotteries, perform crossover and mutate the resulting individual.

To try to find better values for the parameters of the evolutionary process, I did time-limited runs over a range of population and lottery sizes, taking the median of ten runs of each combination. The vertical axis in each plot shows the (median of the) best distance achieved. Smaller numbers are better.

Using a lottery size of one (completely random selection) leads to significantly worse performance, compared to selection based on fitness:

Looking at the rest of the tradeoff landscape, we get best performance using a small population (10) and large lottery size (7):

Dec 1 - I re-ran this experiment on a very different target image and got very much the same results.

Dec 2 - One percent probability appears to be the sweet spot for mutation. Error bars are actually showing 25th through 75th percentile, not min-max:

(TODO: make the gnuplots look less horrible)