views:

101

answers:

4

Hi there, I want to implement some simple genetic algorithms in Java.

So far I found only JGAP. Did somebody has some experience with that? And do you know other Java libraries for GA?

I do not want to write it my own as in http://stackoverflow.com/questions/1575061/ga-written-in-java and I have to use Java, so http://stackoverflow.com/questions/2549512/what-is-the-most-active-genetic-programming-library is also not that helpful.

+1  A: 

I know Apache Mahout (based on Apache Hadoop) has a load of machine learning type algorithms - although not sure if it's exactly what you're looking for?

http://mahout.apache.org/

lucas1000001
Evolutionary algorithms in Mahout use Watchmaker. So if you need the Hadoop clustering stuff, go without Mahout, otherwise you can just use Watchmaker standalone (theoretically you can also cluster Watchmaker using Terracotta but I don't know how the performance compares).
Dan Dyer
+1  A: 

This is an alternative I had bookmarked for my own edification later. I've used JGAP in the past and been happy with it, but this one seems to have lots of excellent examples and I thought I'd give it a try next time I needed optimization code.

http://watchmaker.uncommons.org/

John Munsch
Looks like a nice alternative. I guess I will try JGAP and Watchmaker and see what fits better. Thanks!
Nils Schmidt
+2  A: 

I wrote the Watchmaker Framework so my opinions are not unbiased. ECJ and JGAP are the two most established options and probably the most comprehensive. On the other hand their age means they target older versions of Java, which means no generics.

The Hidden Clause blog did a series of posts (scroll down the list to see them) comparing JGAP, ECJ and Watchmaker.

Of the frameworks I didn't write, Jenes is probably the one that has the API that I most like the look of. It too uses a more modern generics-based approach.

Dan Dyer
Helpful answer indeed and very nice blog! Will read myself through it. Thanks for also mentioning, that your answer is not totally unbiased.
Nils Schmidt
A: 

Have a look at Java GALib, Genetic Algorithm Library:

GALib, Java Genetic Algorithm (JAR) library, models chromosomes as real numbers, characters, strings, and string sequences. Very easy to use, just extend one of the existing GA classes and implement your fitness function. Sample GAs included.

lmsasu