-
Notifications
You must be signed in to change notification settings - Fork 1
Home
‘GA’ is an implementation of a Genetic Algorithm written in Java, built with maven.
This project, though it contains a specific example problem, was written with the intent of being generic. First however, a brief overview*.
You can build the project using maven. There may be other projects to put a UI on the countdown example included in the project, but for now you can run it (after building the project) by:
mvn exec:java
which will run a set example (you will likely have to run mvn clean install first).
You can also run the target:
mvn assembly:assembly
and then run the command-line application by just invoking java:
java -cp target/ga-1.0-jar-with-dependencies.jar com.porpoise.ga.countdown.Main
[args]
where the [args] are a series of space-separated numbers. The first being the ‘goal’ number, the reset being the constituent numbers:
java -cp target/ga-1.0-jar-with-dependencies.jar com.porpoise.ga.countdown.Main 4 5 6 7 8
Looking for 4 in 5,6,7,8:
took 125ms
Generation 5:
7 – 6 + 8 – 5
Workings:
7-6=1
1+8=9
9-5=4