How Can I add my own genome into population?

HoJoon Chung hojoon at
Wed Oct 1 01:25:40 EDT 1997


  I want to know the way of adding a new genome into the population 
defined seperately after the population defined.

  My problem is as follows:
   GARealAlleleSetArray allele;
   GARealGenome genome(allele); 
   GARealGenome bestGenome(allele);

   GASimpleGA ga(genome);


     if(some condition meets){
         bestGenome = ga.statistics.bestIndvidual();
         /* Run the Damped least square algorithm
            using bestGenome.gene(0).... as input */
         /* After DLS runs,
            If DLS give more smaller objetive value than 
            that of bestGenome,
            I tried to insert DLS result into the population.
             I think this can enhance the possibility of finding
             more accurate solution in small number of generations than
             evolving population with GA only!!!
             ===> HERE, PROBLEM OCCURS!!! */

         bestGenome = DLS result
         ga.population().replace(bestGenome); // ERROR 
     //or, ga.population().add(bestGenome);   // ERROR

  What's wrong in above code?
-- Hojoon Chung                                   
-- Dept. of Earth Sci. Edu.            hojoon at
-- Seoul National University           Phone : 82-2-878-7233
-- SEOUL, KOREA                        FAX   : 82-2-874-3289

More information about the galib mailing list