How to plot XY graph in Genetic Algorithm in Java

336 views Asked by At

I want to consist of graph function my problem for genetic algorithm. How can I do ? My chart consists of 2 independent axes, lets say X is number of iterations and Y represents corresponding best chromosome minimum value of fitness function. I am doing replacement after mutation, and then I am selecting the best chromosome. You can see below my cycle. How I can implement a graph library? I don't know anything about how to draw graphs.

for(int i=0; i

    for(int j=0;j<parameters.getMaxSelection();j++){

        select.binaryTournamentSelection(pop.chromosome);

        for(int k=0;k<parameters.getMaxCrossover();k++){

            crossing.onePointCrossover();       

            for(int m=0;m<parameters.getMaxMutation();m++){

                    mut.bitFlip();

                    mut.steadyStateSorting(pop);
            }
        }
    }
}
1

There are 1 answers

1
Naji Kadri On

This may not be what you are looking for but this code might give you some ideas about the XY Graph : https://github.com/najikadri/ONSA