What does the best circus train look like? This is what we hoped to find out, and why we pitted genetics against time in a battle the likes of which have not been seen since the three-eyed fish.
A circus train consists of different kinds of cars, each designed to fullfill a specific task essential to the needs of a travelling circus. There are various animal cars, a car for the circus workers to sleep in, a dining car, a feed car, a car carrying the tent and supplies. Since we were dealing with "bit strings" (that is, integers set to either 0 or 1, pretending to be bits). The following table shows how each is represented:
car type | purpose | bit string |
---|---|---|
locomotive | to pull the train | 0000 |
caboose | everyone knows... | 0001 |
sleeper | where the workers sleep | 0010 |
dining | where the workers eat | 0011 |
entertainment | where the workers play | 0100 |
ringleader | where the boss stays | 0101 |
monkey | monkeys | 0110 |
lion | lions | 0111 |
horse | horses | 1000 |
elephant | elephants | 1001 |
feed | feed for the animals | 1010 |
clowns | everyone loves clowns... | 1011 |
freakshow | swarthmore | 1100 |
cannon | every circus needs one | 1101 |
hobo | unused car, probably occupied by vagrants and swat grads | 1110 |
tent | the circus tent and supplies | 1111 |
We found from experimentation that larger population sizes and slightly
higher mutation rates led to greater improvement in the "fitness" of
our circus train. The parameters we used were:
./ga -f results -s 199 -l 56 -g 1500 -m 0.05
and here's our table of results:
run number | generation | fitness | train configuration |
---|---|---|---|
1 | 1132 | 240 | locomotive-monkey-lion-tent-elephant..-horse-sleeper-dining-entertainment-ringleader-tent-clowns-feed-caboose |
2 | 380 | 238 | locomotive-entertainment-dining-dining-sleeper-feed-tent-clowns-lion-monkey-feed-horse-elephant..-caboose |
3 | 365 | 238 | locomotive-feed-tent-elephant..-lion-clowns-dining-sleeper-sleeper-entertainment-ringleader-horse-monkey-caboose |
4 | 949 | 225 | locomotive-elephant..-horse-monkey-ringleader-entertainment-sleeper-dining-cannon-feed-lion-clowns-feed-caboose |
5 | 124 | 229 | locomotive-monkey-ringleader-dining-entertainment-entertainment-sleeper-elephant..-feed-lion-clowns-horse-tent-caboose |
6 | 179 | 228 | locomotive-clowns-tent-dining-sleeper-entertainment-monkey-feed-lion-horse-monkey-elephant..-feed-caboose |
7 | 80 | 230 | locomotive-tent-lion-horse-monkey-elephant..-feed-entertainment-sleeper-dining-entertainment-dining-tent-caboose |
8 | 115 | 225 | locomotive-horse-entertainment-dining-entertainment-sleeper-ringleader-sleeper-entertainment-tent-feed-lion-clowns-caboose |
9 | 1150 | 234 | locomotive-entertainment-sleeper-dining-entertainment-dining-ringleader-dining-tent-elephant..-lion-feed-clowns-caboose |
10 | 275 | 222 | locomotive-tent-tent-feed-horse-elephant..-monkey-lion-dining-entertainment-ringleader-sleeper-swarthmore-caboose |
It is with great pleasure that we can say the study into the genetic algorithm-based construction of circus train configurations was successful. in each test run, the resulting car configuration was tailored with the wants and needs of those on the train in mind. in most cases, the humans would not find themselves having to walk through an animal car or freakshow car to get to the diner car, and the animals would find themselves next to other animals or the feed car. also, the locomotive was always in front and th caboose in the back (this is important, you know). The only question that remains to be answered is whether our optimal settings for mutation/crossover/population/generations in the actual ga program are actually the optimal ones (we found ours by trial and error). We leave such research to future circus train researchers