[Cs254f11] trivial geography

Lee Spector lspector at hampshire.edu
Mon Nov 21 21:35:14 EST 2011


So of course after I make a huge point of how trivial it is to add trivial geography to a GP system, some of you pointed out that it's not quite so trivial to add to my own evolvefn code! That's because I wrote evolvefn in a way that relied on keeping the population sorted, which is antithetical to maintaining geographic locality in the population.

So I re-hacked it -- not a completely trivial change, but not a complete re-write either. The main change is that here I maintain the population as a list of [program error] pairs, and this leads to a couple of other changes since I was previously relying on the sortedness of the population in a couple of places. Note also that I construct the next generation in a different way because I don't want the different operators (mutation, crossover, and straight reproduction) to apply only in different parts of the geography. So I give each one a chance of being applied at each location (with different probabilities). 

The actual geography stuff is in the select function, which now also takes location and radius arguments.

The new thing is called evolvegeo:

https://gist.github.com/07146f4d07275a5050d5

 -Lee

--
Lee Spector, Professor of Computer Science
Cognitive Science, Hampshire College
893 West Street, Amherst, MA 01002-3359
lspector at hampshire.edu, http://hampshire.edu/lspector/
Phone: 413-559-5352, Fax: 413-559-5438



More information about the Cs254f11 mailing list