[galib] Obtain "bestIndividual()" value

Luca Moscatelli lucaster at gmail.com
Tue Nov 2 12:36:29 EST 2004

Hi to all.

I'm new with this library and I have a simple problem (I hope it's
simple... However, it is quite stupid :D).

I tried the first examples and they are all clear, but I saw that the
best individual is only printed at the end of each program, but what
have I to do if I want to use it?

I'll try to be more clear:
I created a GARealAlleleSet, filled with some values and inserted into
the GARealGenome, then I evolved it.
If I print the best individual like in the examples with "cout <<
ga.statistics().bestIndividual() I see the right value, but now I
want, for example, to add 1 to this value...

Now, I looked the documentation and I saw that the
ga.statistics().bestIndividual() returns a GaGenome&, how can the cout
print it?
And, how can I put this value(s) in a float variable(s)?

I hope that my problem is quite clear to you... :)

Thanks in advance to all of you!

More information about the galib mailing list