I'm working with GAlib from http://lancet.mit.edu/ga/ library in C++. I've created a typical genetic algorithm with this code:
GA1DBinaryStringGenome genoma(trips.size(), Genotype::evaluator);
GASimpleGA ga(genoma);
ga.populationSize(popSize);
ga.nGenerations(genCant);
ga.pMutation(0.03);
ga.pCrossover(0.90);
ga.evolve(); // Launch
Then I get the best individual with
wladi << ga.statistics().bestIndividual();
Which is pretty much the standard. But my question is:
How can I get an Array with the best fitness of each generation?
I am dealing with the same problem right now. The only work-around I came up with is to create my own terminator function (in the main):
And then link the customized termination to your GA object:
This way I can get a link to when the GA checks for termination condition at the end of each generation.