Help: adding an individual to the initial population

Cristina Malheiro Silva l35572 at alfa.ist.utl.pt
Thu Oct 30 19:38:18 EST 1997


On Thu, 30 Oct 1997, Roberto Olmi wrote:

> Dear GAlibbers,
> 
> perhaps it is a stupid question, but:
>
I also had this problem.
 
> how can I add an individual of my choice to an initial population before
> beginning the game?
> Suppose I have a GARealGenome using a single allele set, and I want to add
> a certain gene value,
> which is supposedly close to the solution, in order to speed up
> convergence. How can I do it?

This is my solution. Maybe there's a better one.

I've derived my own genome from GA*Genome, redefining the initilize method
for initializing the genes with special values. The special values, in my
case, are specified in a file.
Instead of creating a population by cloning MyGenome, I've add N MyGenome
that are initialized randomly and M MyGenome that are initialized from
file. The initialization method depends on a flag that is a data member of
MyGenome.
To get the expected results I had to decomment a line of code in GALib in
the file gasimple.ccp that initializes oldPop. You may find this line of
code in the initialize method of GASimpleGA.

I hope my explanation will help you,

Cristina.







More information about the galib mailing list