Galapagos
A Genetic Algorithm Framework in Java
Home

...by Andy Meneely
in his Senior Project at Calvin College.

Links

 

What is org.weiss.galapagos?
Galapagos is support code for doing Genetic Algorithms in Java. I’m implementing this support code with the intended audience of an undergraduate Artificial Intelligence class (see below).

Galapagos is not just the final project to cap off my CS major. No, it’s the final product of three years worth of ideas marinating in the deep recesses of my psyche. To see this project come to fruition is not only exciting, but (somewhat) cathartic. Furthermore, I’m very excited to take my old, abstract ideas and implement them with new technologies. Marrying my own familiar ideas with my new techniques for a (hopefully) usable project is one of the many goals of this endeavor.

Galapagos makes Genetic Algorithms easier


The beauty of Genetic Algorithms is that the searching process is completely independent of the problem itself. This dichotomy, then, lends itself easily to a programming framework. What I will be doing this year is actually writing the code for Genetic Algorithms once and for all so that anyone can simply choose which pieces they want to use.

The notion of “choosing pieces” brings me to another point about Genetic Algorithms: code integration. There are many different ways to write a Genetic Algorithm because there are many ways to implement the operators. So not only will it be beneficial to write the “textbook” operators for the algorithms, the programmer (my user) will be able to implement their own operator and use it in conjunction with the rest of the framework.

Galapagos is a pedagogical device.


What good is a product without intentionally designating an audience? Even though Genetic Algorithms programming libraries have been implemented many times (and with much more software prowess than that held by yours truly), I found that most products were not helpful for students. If a student taking an AI class wishes to put together a genetic algorithm in a single afternoon, simply for exploration or possibly a lab, then using one of those massive libraries is both too daunting and unhelpful. A goal, then, for this project is to make Galapagos programmatically and educationally accessible for undergraduates. In fact, let’s make it formal:

Goal:
Galapagos shall be able to be used by an undergraduate student, with a competency in Java, in a single afternoon.

Project Components
Here, I will outline some of the (future) technical achievements that this project will bring. The order below is the order in which I plan to attack this project:

galapagos.tests
As I develop pet problems for this framework, I will be creating unit tests to keep everything in shape. Using JUnit, I actually tend to follow the model that [link]Professor Frens advocates called “test driven development” where you write a test first, then write your code to pass that test. Since Galapagos is a conglomeration of many different pieces that must work together seamlessly, it makes perfect test to emphasize unit testing throughout the application. If applicable, I hope to use mock objects from JMock to enrich the unit testing.

galapagos.framework
This is the heart of the project: a programming framework that allows the user to simply implement their fitness function and a genome manufacturer and the rest of Genetic Algorithms will be at their fingertips.

If time allows, I would also like to create support for distributing the workload of a Genetic Algorithm over a network. This would involve thread pooling and networking, but would be very slick.

galapagos.examples
How far I get on this project is greatly dependent on how much I end up emphasizing applying Genetic Algorithms versus developing Galapagos. If I don’t get to the runner and the reporting, it’s because I found some considerably stimulating problems along the way. But, let’s hope I am not so selfish as to not make all of my work accessible to future undergraduates out there.

Regardless of the emphasis, I plan on writing tutorials for using the framework. These tutorials will not only demonstrate my commitment to my future users, they will also serve as a challenge in educating – a field in which I hope to find myself someday.

galapagos.runner
If a student wishes to simply run a GA without writing any Java code (i.e. use all of the operators from galapagos.framework), then all he or she would need to do is specify an XML file with all of the appropriate properties. But allowing for XML documents is not enough, I hope to create a simple GUI to create an XML file. This technology will involve using the SAX parser along with JavaBeans.
galapagos.report
The reporting portion has two main mechanisms: one for grabbing the information from these algorithms and the other is reporting it. The first mechanism will be incorporated into the framework in a way that captures information on each genome for each generation. The output formats of the second mechanism will be PDF, HTML, and XML. At this amorphous, preliminary stage of planning, I think I will use JFreeChart and JasperReports as tools.

Eclipse
Though not formalized, it is assumed in this project that the users will be using Eclipse for their Java development (besides, is there any other way to develop Java anyway??). Clearly this is not a requirement, but most places use Eclipse anyway and I’ll be using Eclipse for my development.

Galapagos is Open Source
This project is on SourceForge under the GNU GPL License.

This page was last updated on June 11, 2006