[galib] galib Digest, Vol 83, Issue 1

Paul Smith phhs80 at gmail.com
Mon Aug 23 17:30:57 EDT 2010


Thanks, Sandip, for your suggestion. I had already received a similar
suggestion from Michele Conconi:

«this is a possible way to do it. The if cicle let show the best
individual and the best score just every 20 generation, otherwise all
thet print on screen may really slow down your computation.
Hope this help.

Michele

            int gen=0;
            ga.initialize();
            while(!ga.done())
            {
                ga++;
                gen++;
                if(gen%20==0)
                {
                    cout<<"generation "<<gen<<", best idividual: "<<endl;
                    ga.population().best().write(cout);
                    cout<<"\t score: "<<ga.population().best().score()<<endl;
                }
            }
».

Paul


On Mon, Aug 23, 2010 at 12:23 PM, Sandip Karale <sandipkarale at gmail.com> wrote:
> Hi Paul,
> Here is simple code snippet of evolution of GA  for generation
> while( !ga.done() )
> {
>     ga.step();
>    //Get current population from ga
>    poulation = ga.population();
>   // Get best genome from the population which will give u the best score
>    genome = poulation.best();
>
>  //print your genome
> }
> Please correct me if I'm wrong.
> Sincerely,
> Sandip
> On Fri, Aug 20, 2010 at 9:32 PM, <galib-request at mit.edu> wrote:
>>
>> Send galib mailing list submissions to
>>        galib at mit.edu
>>
>> To subscribe or unsubscribe via the World Wide Web, visit
>>        http://mailman.mit.edu/mailman/listinfo/galib
>> or, via email, send a message with subject or body 'help' to
>>        galib-request at mit.edu
>>
>> You can reach the person managing the list at
>>        galib-owner at mit.edu
>>
>> When replying, please edit your Subject line so it is more specific
>> than "Re: Contents of galib digest..."
>>
>>
>> Today's Topics:
>>
>>   1. How to print on the screen the best score of each generation
>>      as the GA is evolving? (Paul Smith)
>>
>>
>> ----------------------------------------------------------------------
>>
>> Message: 1
>> Date: Fri, 20 Aug 2010 13:46:29 +0100
>> From: Paul Smith <phhs80 at gmail.com>
>> Subject: [galib] How to print on the screen the best score of each
>>        generation as the GA is evolving?
>> To: galib at mit.edu
>> Message-ID:
>>        <AANLkTinNq+e+W6aLTC56tGHgOYV0c4MtT6fXZmokesxa at mail.gmail.com>
>> Content-Type: text/plain; charset=ISO-8859-1
>>
>> Dear All,
>>
>> How to print on the screen the best score of each generation as the GA
>> is evolving? Is that possible?
>>
>> Thanks in advance,
>>
>> Paul
>>
>>
>> ------------------------------
>>
>> _______________________________________________
>> galib mailing list
>> galib at mit.edu
>> http://mailman.mit.edu/mailman/listinfo/galib
>>
>>
>> End of galib Digest, Vol 83, Issue 1
>> ************************************
>
>
>
> --
> I wish to walk alone always...but will be happy, if you with me....
>
> _______________________________________________
> galib mailing list
> galib at mit.edu
> http://mailman.mit.edu/mailman/listinfo/galib
>
>




More information about the galib mailing list