A Genetic algorithm library and implementation written in pure java
A Genetic algorithm library and implementation written in pure java
get the full docs Here
This library allows for general creation of a genetic algorithm, In use, the user needs to define a Generator, Organism and Reproduction class. They each are generally straightforward but perform as follows
An object containing the genes (Data) of a single organism in a species. Organisms are the base in genetic evolution and do most of the interaction and data storage
A generator allows for the creation of a new Organism to be used in the initial generation. Most often this is a random process, but Generators can create their organisms through specific parameters
Allows for the creation of a child organism given one or more parent organism(s), the child organism should inherit genes from all the parents, as well as include a mutation so that the species may evolve past their original state
To create a genetic algorithm simulation is as easy as follows
// Specify the parameters for the simulation
GeneticAlgorithm<String, String> simulation = new GeneticAlgorithm<>(100, new StringGenerator(10), "Hello World");
// set the reproduction method for the simulation
simulation.setReproduction(new StringReproduce());
// Run a generation
simulation.runGeneration();
// Get the best organism in the generation
simulation.getBest();
The above example is using an implementation using strings in a genetic algorithm that can be found in this repository under String Evolution
Garrett Burroughs and Peter Adams
Wikipedia article on Genetic Algorithms: https://en.wikipedia.org/wiki/Genetic_algorithm