problem printing out the best genome that the GA found!

Joe Dumoulin joe at bresgal.com
Tue May 30 20:34:07 EDT 2000


You must create an operator<< that prints your genome and make it a friend
of the genome class you are using (i'm not sure the second part is
necessary;  it just makes it easier.  If you are using a binary string
genome, try 

cout << hex << (long) ga.statistics().bestIndividual() << "\n";

I'm not sure it will work but it's ceratinly worth a try....


Joe D

-------------------------------------------------------------------------
A student asked the master: "Master, how may I find enlightenment?"  The
master replied with a question: "Have you finished your rice?"  The
student answered: "Yes, Master."  The master responded: "Then wash
your bowl!"

On Tue, 30 May 2000, Luis Ariel Diago wrote:

> I am using galib with Visual C++ 5.0 and when I try to
> 
> print out the best genome that the GA found it give me
> the following error in the line:
> 
> cout << "The GA found:\n" <<
> ga.statistics().bestIndividual() << "\n";
> 
> Compiling...
> ex1.C
> D:\galib245\examples\ex1.C(70) : error C2679: binary
> '<<' : no operator defined which takes a right-hand
> operand of type 'const class GAGenome' (or there is no
> acceptable conversion)
> 
> Error executing cl.exe.
> 
> What should I do?
> 
> 
> =====
> ºººººººººººº   Hola!
>    |   º   º  |   Quieres contactarme?
>   (    (..)    )  escribeme a: luis_a_diago at yahoo.com
>     \   __   /    
>      |______|     Quieres conocer mas acerca de mi? 
>                   visitame en:
> http://www.geocities.com/luis_a_diago/
> 
> __________________________________________________
> Do You Yahoo!?
> Send instant messages & get email alerts with Yahoo! Messenger.
> http://im.yahoo.com/
> 





More information about the galib mailing list