public class ImageEvolutionExample extends Object
The fitness function is quite simple yet expensive to compute: - draw the polygons of a chromosome to an image - compare each pixel with the corresponding reference image
To improve the speed of the calculation, we calculate the fitness not on the original image size, but rather on a scaled down version, which is sufficient to demonstrate the power of such a genetic algorithm.
TODO: - improve user interface - make algorithm parameters configurable - add a gallery of results after x iterations / minutes (either automatic or based on button click) - allow loading / selection of other images - add logging in the user interface, e.g. number of generations, time spent, ...
Modifier and Type | Class and Description |
---|---|
static class |
ImageEvolutionExample.Display |
Modifier and Type | Field and Description |
---|---|
static float |
MUTATION_CHANGE |
static float |
MUTATION_RATE |
static int |
POLYGON_COUNT |
static int |
POLYGON_LENGTH |
static int |
POPULATION_SIZE |
static int |
TOURNAMENT_ARITY |
Constructor and Description |
---|
ImageEvolutionExample() |
public static final int POPULATION_SIZE
public static final int TOURNAMENT_ARITY
public static final float MUTATION_RATE
public static final float MUTATION_CHANGE
public static final int POLYGON_LENGTH
public static final int POLYGON_COUNT
Copyright © 2016 Hipparchus.org. All rights reserved.