[galib] put bestIndividual into a variable
Alin Ionascu
alin1x at live.com
Mon Jul 30 18:38:41 EDT 2012
Hello everyone,
I am fairly new to GAlib and I was wondering if you could help me with something.
I created a GARealGenome:
GARealAlleleSet alleles(MIN_VALUE, MAX_VALUE); GARealGenome genome(1, alleles, Objective); GASimpleGA ga(genome);
After the GA has finished I would like to further work with the best individual.I can print it out with the following command: cout << ga.statistics().bestIndividual();
My question is the following : How can I assign the value to a variable for example a double (each individual has just a value which is a real). I tried to do something like this: double test = ga.statistics().bestIndividual(); (this obviously doesn't work since the type ga.statistics().bestIndividual() is const GAGenome& bestIndividual(unsigned int n=0) const )
Can you please tell me how I can get the value from ga.statistics().bestIndividual() into a double variable.
Thanks,Alin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/galib/attachments/20120730/2296c144/attachment.htm
More information about the galib
mailing list